From ea2b6775c278d8990e858a309a966b82b36f4d40 Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期六, 13 七月 2024 15:11:25 +0800 Subject: [PATCH] 设备数采配置提交 --- src/components/view/a6-device-management.vue | 72 ++++++++++++++++++++++++++---------- 1 files changed, 52 insertions(+), 20 deletions(-) diff --git a/src/components/view/a6-device-management.vue b/src/components/view/a6-device-management.vue index dfe4981..75ee698 100644 --- a/src/components/view/a6-device-management.vue +++ b/src/components/view/a6-device-management.vue @@ -51,15 +51,15 @@ <template> <div class="role_manage"> - <div> + <div v-if="!showData"> <el-row class="title"> - <el-col :span="12" style="padding-left: 20px;">璁惧宸ュ叿鏄庣粏</el-col> + <el-col :span="12" style="padding-left: 20px;text-align: left;">璁惧宸ュ叿鏄庣粏</el-col> <el-col :span="12" style="text-align: right;"> <el-button size="medium" type="primary" @click="dialogVisible2 = true">鏂板</el-button> </el-col> </el-row> </div> - <div class="search"> + <div class="search" v-if="!showData"> <div class="search_thing"> <div class="search_label">鐘舵�侊細</div> <el-select v-model="componentData.entity.deviceStatus" placeholder="鍏ㄩ儴" size="small"> @@ -82,7 +82,7 @@ <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button> </div> </div> - <div class="table"> + <div class="table" v-if="!showData"> <!-- 璇硶 瀛愮粍浠堕�氳繃 this.$emit +浼犲叆鏂规硶鍚� 璋冪敤鐖剁粍浠舵柟娉� 渚嬪 this.$emit锛坰electAllByOne锛� 灏遍渶鍦ㄧ埗缁勪欢澹版槑骞朵紶鍏� @selectAllByOne="selectAllByOne"--> <ValueTable @selectAllByOne="selectAllByOne" @isUpdate="isUpdate" ref="ValueTable" :url="$api.deviceScope.selectDeviceParameter" :upUrl="$api.deviceScope.upDeviceParameter" @@ -421,14 +421,17 @@ </el-row> </span> </el-dialog> + <dataAcquisitionConfig v-if="showData" :tableList="tableList"/> </div> </template> <script> import ValueTable from '../tool/value-table.vue' + import dataAcquisitionConfig from '../do/b6-device-management/b6-data-acquisition-config.vue' export default { components: { - ValueTable + ValueTable, + dataAcquisitionConfig }, data() { return { @@ -447,6 +450,8 @@ dialogVisible: false, dialogVisible2: false, addPower: false, + showData: false, // 鏁伴噰閰嶇疆椤甸潰 + tableList: [], componentData: { entity: { deviceStatus: null, @@ -455,7 +460,7 @@ largeCategory: null, orderBy: { field: 'id', - order: 'desc' + order: 'asc' } }, isIndex: true, @@ -475,8 +480,12 @@ id: 'handleConfig', font: '鏁伴噰閰嶇疆', type: 'text', - method: 'handleConfig' + method: 'handleConfig', + disabFun: (row, index) => { + return row.insProductItem === '' + } }], + headNoShow:['enDeviceName'], tagField: { deviceStatus: { select: [] @@ -578,6 +587,7 @@ let up = false let del = false let add = false + let config = false for (var i = 0; i < power.length; i++) { if (power[i].menuMethod == 'upDeviceParameter') { up = true @@ -588,15 +598,21 @@ if (power[i].menuMethod == 'addDeviceParameter') { add = true } + if (power[i].menuMethod == 'saveDataAcquisitionConfiguration') { + config = true + } } - if (!up) { - this.componentData.do.splice(1, 1) - } - if (!del) { - this.componentData.do.splice(0, 1) - } - this.addPower = add - }, + if (!config) { + this.componentData.do.splice(2, 1) + } + if (!up) { + this.componentData.do.splice(1, 1) + } + if (!del) { + this.componentData.do.splice(0, 1) + } + this.addPower = add + }, // 鑾峰彇瀛楀吀 selectEnumByCategory() { this.$axios.post(this.$api.enums.selectEnumByCategory, { @@ -709,9 +725,11 @@ this.formData.imageName = response.data.name; } }, - handleSuccessUpImg2(response, ) { + handleSuccessUpImg2(response) { if (response.code == 200) { this.$nextTick(() => { + this.formData.imageUpload = response.data.url; + this.formData.imageName = response.data.name; this.formData2.imageUpload = response.data.url; this.formData2.imageName = response.data.name; }) @@ -826,11 +844,25 @@ }) }, handleConfig(row){ - this.configForm = {} - this.dialogVisible3 = true - this.$axios.post(this.$api.deviceScope.getNumberCollect+'?id='+row.id).then(res => { - this.configForm = res.data + // this.configForm = {} + // this.dialogVisible3 = true + // this.$axios.post(this.$api.deviceScope.getNumberCollect+'?id='+row.id).then(res => { + // this.configForm = res.data + // }) + this.showData = true + const list = row.insProductItem.split(';') + let list2 = [] + list.map((item) => { + const obj = Object.assign({ + deviceId: row.id, + insProductItem: item, + }) + list2.push(obj) }) + this.tableList = list2 + }, + closeDataVue () { + this.showData = false }, submitForm3(){ if(!this.configForm.ip){ -- Gitblit v1.9.3