From 8fd32a4083908335fdb56d6737d021fd30b02b11 Mon Sep 17 00:00:00 2001 From: sunmeng <1162067978@qq.com> Date: Wed, 28 Aug 2024 08:53:48 +0800 Subject: [PATCH] 1 --- src/views/page/realTime.vue | 24 ++++++++++++++++++++++++ src/views/page/sensorSet-soil.vue | 6 +++--- src/views/page/upload-soil.vue | 6 +++--- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/views/page/realTime.vue b/src/views/page/realTime.vue index 3404ed9..206a918 100644 --- a/src/views/page/realTime.vue +++ b/src/views/page/realTime.vue @@ -1262,6 +1262,30 @@ export default { // this.$message.error(res.data.msg); } }) + this.api.getControlRtDatastation(formData).then(res => { + this.controlList = [] + if (res.data.code == 200) { + res.data.data.forEach((el, index) => { + list.forEach((el1, index1) => { + if (el.formula == el1.value) { + // console.log(el1); + var num = 0 + if (el.equipmentStart == 0) { + num = '故障' + } else { + num = el.environmentData + el1.unit + } + this.controlList.push({ + ...el, + num: num, + img: require(`../../assets/image/real-time-${el.formula}.png`) + }) + } + }) + }) + } + // console.log(this.controlList); + }) var nowDevice = store.equipmentList[this.indexs - 1] // var data2 = { // cameraid: nowDevice.cameraSerialNumber, diff --git a/src/views/page/sensorSet-soil.vue b/src/views/page/sensorSet-soil.vue index 35cc3c3..1e8b6d7 100644 --- a/src/views/page/sensorSet-soil.vue +++ b/src/views/page/sensorSet-soil.vue @@ -258,7 +258,7 @@ export default { }, //根据类型反向计算赋值给inputData getSaveCountData() { - for (var i = 0; i < 48; i++) { + for (var i = 0; i < 96; i++) { this.typeList.forEach((el, index) => { if (el.value == this.inputData[this.numberList[i]]) { if (el.countType == 0) { @@ -284,7 +284,7 @@ export default { }, //根据类型修改数据 getCountData() { - for (var i = 0; i < 6; i++) { + for (var i = 0; i < 96; i++) { this.typeList.forEach((el, index) => { if (el.value == this.inputData[this.numberList[i]]) { if (el.countType == 0) { @@ -550,7 +550,7 @@ export default { store.nowInput = '' this.getSaveCountData() // this.dataInit(); - for (var i = 0; i < 48; i++) { + for (var i = 0; i < 96; i++) { if (this.numberList[i] == data.regAddress) { this.inputData[this.numberList[i]] = data.num diff --git a/src/views/page/upload-soil.vue b/src/views/page/upload-soil.vue index 6b11d90..8704837 100644 --- a/src/views/page/upload-soil.vue +++ b/src/views/page/upload-soil.vue @@ -519,7 +519,6 @@ export default { this.actList2.forEach((el, index) => { this.actList2New[this.actList2New.length-el-1] = '1' }) - console.log(this.actList2,this.actList2New,this.actList2New.join("")); var num = this.actList2New.join(""); var dataNum = { target: { @@ -534,7 +533,8 @@ export default { } else { this.actList3.splice(this.actList3.indexOf(index), 1) } - this.actList3New=['0','0','0','0','0'] + this.actList3New=['0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0',] + this.actList3.forEach((el, index) => { this.actList3New[this.actList3New.length-el-1] = '1' }) @@ -630,7 +630,7 @@ export default { } this.actList8New=['0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'] this.actList8.forEach((el, index) => { - this.actList6New[this.actList8New.length-el-1] = '1' + this.actList8New[this.actList8New.length-el-1] = '1' }) var num = this.actList8New.join(""); -- 2.40.1