wyh пре 2 година
родитељ
комит
67d20e4e03

+ 4 - 1
itdmWeb/src/api/api.js

@@ -85,6 +85,8 @@ const listGraph = (params)=>getAction("/second/screen/chushihua",params);
 const listBdc = (params)=>getAction("/itdmFirstPage/getFrstPageTaskNum",params);
 // 首页列表
 const listBdc2 = (params)=>getAction("/itdmFirstPage/itdmTask/list",params);
+// 数据确认提交按钮
+const saveSj = (params)=>postAction("/itdmgomgongdanshuju/ItdmGongdanshuju/editList",params);
 
 
 //日志管理
@@ -207,7 +209,8 @@ export {
   confirmPa,
   listGraph,
   listBdc,
-  listBdc2
+  listBdc2,
+  saveSj
 }
 
 

+ 104 - 8
itdmWeb/src/views/module-iTDM/gongdanshuju/ItdmGongdanShujuList.vue

@@ -69,7 +69,8 @@
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <a-button type="primary" @click="create" icon="sengch" style="margin-left: 8px">生成</a-button>
+              <a-button type="primary" @click="submitSJ" icon="check" style="margin-left: 8px">提交</a-button>
+              <a-button type="primary" @click="create" icon="vertical-align-bottom" style="margin-left: 8px">生成</a-button>
               <a @click="handleToggleSearch" style="margin-left: 8px">
                 {{ toggleSearchStatus ? '收起' : '展开' }}
                 <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
@@ -90,7 +91,7 @@
       </a-upload> -->
     <!-- 高级查询区域 -->
     <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
-    <a-dropdown v-if="selectedRowKeys.length > 0">
+    <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
       <a-menu slot="overlay">
         <a-menu-item key="1" @click="batchDel">
           <a-icon type="delete" />
@@ -101,17 +102,17 @@
         <a-icon type="down" />
       </a-button>
     </a-dropdown>
-    </div>
+    </div> -->
 
     <!-- table区域-begin -->
     <div>
-      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+      <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
         <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
         style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-      </div>
+      </div> -->
 
-      <a-table
+      <!-- <a-table
         ref="table"
         size="middle"
         :scroll="{x:true}"
@@ -165,7 +166,49 @@
           </a-dropdown>
         </span>
 
-      </a-table>
+      </a-table> -->
+
+      
+        <vxe-toolbar>
+          <template #buttons>
+            <vxe-button icon="vxe-icon-square-plus" @click="insertEvent()">新增</vxe-button>
+            <vxe-button @click="$refs.xTable.removeCheckboxRow()">删除选中</vxe-button>
+          </template>
+        </vxe-toolbar>
+
+        <vxe-table
+          border
+          show-overflow
+          ref="xTable"
+          height="500"
+          :data="dataSource"
+          :mouse-config="{selected: true}"
+          :checkbox-config="{range: true}"
+          :menu-config="tableMenu"
+          :keyboard-config="{isArrow: true, isDel: true, isEnter: true, isTab: true, isEdit: true, isChecked: true}"
+          :edit-config="{trigger: 'dblclick', mode: 'cell'}">
+          <vxe-column type="checkbox" width="60"></vxe-column>
+          <vxe-column field="shiyanType_dictText" title="试验类型" :edit-render="{autofocus: '.vxe-input--inner'}">
+            <template #edit="{ row }">
+              <input v-model="row.shiyanType" type="text" class="myinput" />
+            </template>
+          </vxe-column>
+          <vxe-column field="shiyanTime" title="生成时间" :edit-render="{autofocus: '.vxe-input--inner'}">
+            <template #edit="{ row }">
+              <vxe-input v-model="row.shiyanTime" type="text"></vxe-input>
+            </template>
+          </vxe-column>
+          <vxe-column field="shiyanWendu" title="温度" :edit-render="{autofocus: '.vxe-input--inner'}">
+            <template #edit="{ row }">
+              <vxe-input v-model="row.shiyanWendu" type="text"></vxe-input>
+            </template>
+          </vxe-column>
+          <vxe-column field="shiyanShidu" title="湿度" :edit-render="{autofocus: '.vxe-input--inner'}">
+            <template #edit="{ row }">
+              <vxe-input v-model="row.shiyanShidu" type="text"></vxe-input>
+            </template>
+          </vxe-column>
+        </vxe-table>
     </div>
 
     <itdm-gongdan-shuju-modal ref="modalForm" @ok="modalFormOk"></itdm-gongdan-shuju-modal>
@@ -174,11 +217,13 @@
 
 <script>
 import { httpAction, getAction } from '@/api/manage'
+import { saveSj } from '@/api/api'
 import '@assets/less/TableExpand.less'
 import { mixinDevice } from '@/utils/mixin'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import ItdmGongdanShujuModal from './modules/ItdmGongdanShujuModal'
 import { filterMultiDictText } from '@comp/dict/JDictSelectUtil'
+import VXETable from 'vxe-table'
 
 export default {
   name: 'ItdmGongdanShujuList',
@@ -296,7 +341,30 @@ export default {
 
       },
       dictOptions: {},
-      superFieldList: []
+      superFieldList: [],
+
+      // vex-table
+      // tableData: [
+      //   { id: 10001, name: 'Test1', role: 'Develop', sex: 'Man', age: 28, address: 'test abc' },
+      //   { id: 10002, name: 'Test2', role: 'Test', sex: 'Women', age: 22, address: 'Guangzhou' },
+      //   { id: 10003, name: 'Test3', role: 'PM', sex: 'Man', age: 32, address: 'Shanghai' },
+      //   { id: 10004, name: 'Test4', role: 'Designer', sex: 'Women', age: 23, address: 'test abc' },
+      //   { id: 10005, name: 'Test5', role: 'Develop', sex: 'Women', age: 30, address: 'Shanghai' },
+      //   { id: 10006, name: 'Test6', role: 'Designer', sex: 'Women', age: 21, address: 'test abc' },
+      //   { id: 10007, name: 'Test7', role: 'Test', sex: 'Man', age: 29, address: 'test abc' },
+      //   { id: 10008, name: 'Test8', role: 'Develop', sex: 'Man', age: 35, address: 'test abc' }
+      // ],
+      tableMenu: {
+        body: {
+          options: [
+            [
+              { code: 'copy', name: '复制', prefixIcon: 'vxe-icon-copy', disabled: false },
+              { code: 'remove', name: '删除', disabled: false },
+              { code: 'save', name: '保存', prefixIcon: 'vxe-icon-save', disabled: false }
+            ]
+          ]
+        }
+      },
     }
   },
   created() {
@@ -313,6 +381,34 @@ export default {
   },
   methods: {
 
+          // vex-table
+          async insertEvent () {
+            const $table = this.$refs.xTable
+            const record = {
+              sex: '1'
+            }
+            const { row: newRow } = await $table.insertAt(record)
+            await $table.setActiveCell(newRow, 'name')
+          },
+          getInsertEvent () {
+            const $table = this.$refs.xTable
+            const insertRecords = $table.getInsertRecords()
+            VXETable.modal.alert(insertRecords.length)
+          },
+          getSelectionEvent () {
+            const $table = this.$refs.xTable
+            const selectRecords = $table.getCheckboxRecords()
+            VXETable.modal.alert(selectRecords.length)
+          },
+
+      // 提交
+      submitSJ(){
+        console.log(this.dataSource)
+        saveSj(this.dataSource).then((res) => {
+          confirm.log(res)
+        })
+      },
+
     init() {
 
       getAction('/weituo/itdmWeituoInfo/distinctClientList', {}).then((res) => {