From 065acf09a04b6c47e58439ef4c1db610ee70131d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=90=8C?= <525441437@qq.com> Date: Mon, 18 Mar 2024 15:15:45 +0800 Subject: [PATCH 1/2] 1 --- src/views/page/irrigateSet.vue | 898 +++++++++++---------------------- 1 file changed, 286 insertions(+), 612 deletions(-) diff --git a/src/views/page/irrigateSet.vue b/src/views/page/irrigateSet.vue index 9e58e71..b5f0b40 100644 --- a/src/views/page/irrigateSet.vue +++ b/src/views/page/irrigateSet.vue @@ -4,244 +4,119 @@
- {{$store.state.equipmentName['solenoid' + $store.state.nameList[indexs-1]]}} -
{{$store.state.equipmentName['solenoid' + $store.state.nameList[indexs-1]]}}
+ {{ $store.state.equipmentName['solenoid' + $store.state.nameList[indexs - 1]] }} +
{{ $store.state.equipmentName['solenoid' + $store.state.nameList[indexs - 1]] }}
控制模式选择 -
+
停止
-
+
手动启动
-
+
自动
- +
手动启动时间 - +
自动运行起始日期 - + - + - +
间隔灌溉天数 - +
灌溉 - + 次清水,间隔灌溉 - + 次施肥。
施肥时采用 - + 号配方。 达到中液位混合 - + (秒)电磁阀开始输出
电磁阀控制通道 - - - - - - - - - - + + + + + + + + + +
- -
- - + +
+ + 灌溉清水时不启动施肥机
-
- - +
+ + 灌溉结束时,清空混液罐
-
- - +
+ + 轮灌模式
-
- - +
+ + 灌溉清水时不启动进水泵
@@ -249,14 +124,8 @@
施肥机自动运行模式选择 - - -
1#灌溉组控制参数配置
+ +
{{ indexs }}#灌溉组控制参数配置
-
+
时间点启动
每次灌溉时长 - +
@@ -303,91 +162,51 @@
1
- + : - +
2
- + : - +
3
- + : - +
4
- + : - +
5
- + : - +
@@ -399,27 +218,17 @@
- -
1#灌溉组控制参数配置
+ +
{{ indexs }}#灌溉组控制参数配置
间隔启动
每次灌溉时长 - +
@@ -429,118 +238,58 @@
1
- + : - + - - + : - + 时间段里启动次数 - +
2
- + : - + - - + : - + 时间段里启动次数 - +
3
- + : - + - - + : - + 时间段里启动次数 - +
@@ -552,98 +301,56 @@
- -
1#灌溉组控制参数配置
+ +
{{ indexs }}#灌溉组控制参数配置
光积累启动
有效检测时间段 - + : - + - - + : - +
启动时灌湛时长 - +
光积累启动值 - +
最小光照值 - + Klux
最短灌溉间隔 - +
最长灌溉间隔 - +
@@ -654,80 +361,46 @@
- -
1#灌溉组控制参数配置
+ +
{{ indexs }}#灌溉组控制参数配置
土壤传感器
有效检测时间段 - + : - + - - + : - +
最低土壤湿度 - + %
最高土壤湿度 - + %
灌溉时长上限 - +
@@ -738,15 +411,9 @@
- -
1#灌溉组控制参数配置
+ +
{{ indexs }}#灌溉组控制参数配置
外控模式 @@ -756,28 +423,36 @@
1
外部输入通道 - +
2
外部输入通道 - +
+
+
+ 有效时间: + + : + + -- + + : + +
+
返回 @@ -794,7 +469,7 @@ export default { }, data() { return { - topActive:1, + topActive: 1, open1: false, open2: false, open3: false, @@ -811,11 +486,11 @@ export default { }; }, watch: { - '$store.state.equipmentIndex': function(newValue, oldValue) { + '$store.state.equipmentIndex': function (newValue, oldValue) { const that = this; - setTimeout(() => { - that.dataInit(); - }, 0); + setTimeout(() => { + that.dataInit(); + }, 0); }, $route(newVal, oldVal) { const that = this; @@ -833,27 +508,27 @@ export default { }, 0); //input获取焦点后全选 let inputList = document.querySelectorAll('input'); - for (let index = 0; index < inputList.length; index++) { - inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本 - } + for (let index = 0; index < inputList.length; index++) { + inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本 + } }, methods: { - countData10(data){ - if(data){ - return data/10 - }else{ - return 0 - } - }, - changeData10(code,el){ - var data=el.target.value*10 - var sendData={ - target:{ - value:data - } - } - this.change(code,sendData) - }, + countData10(data) { + if (data) { + return data / 10 + } else { + return 0 + } + }, + changeData10(code, el) { + var data = el.target.value * 10 + var sendData = { + target: { + value: data + } + } + this.change(code, sendData) + }, handleCommand(command) { if (command == "1") { this.model1 = true; @@ -866,15 +541,15 @@ export default { } else if (command == "5") { this.model4 = true; } - this.inputData[10 + (this.indexs - 1) + "53"] = command; - this.get53data(command) - var data53={ - target: { - value: this.inputData[10 + (this.indexs - 1) + "53"], - }, - } - this.changeBtn(10 + (this.indexs - 1) + "53", data53); - + this.inputData[10 + (this.indexs - 1) + "53"] = command; + this.get53data(command) + var data53 = { + target: { + value: this.inputData[10 + (this.indexs - 1) + "53"], + }, + } + this.changeBtn(10 + (this.indexs - 1) + "53", data53); + }, get53data(index) { var data = index; @@ -892,20 +567,20 @@ export default { } this.data53 = text53; }, - change00(index) { - this.topActive=index + change00(index) { + this.topActive = index var list = ["0", "0", "0"]; - if (index==1) { + if (index == 1) { list[0] = "1"; } else { list[0] = "0"; } - if (index==2) { + if (index == 2) { list[1] = "1"; } else { list[1] = "0"; } - if (index==3) { + if (index == 3) { list[2] = "1"; } else { list[2] = "0"; @@ -919,21 +594,21 @@ export default { this.changeBtn(10 + (this.indexs - 1) + "00", dataNum); }, padString(str, length) { - return str.padStart(length, '0'); - }, + return str.padStart(length, '0'); + }, getType00() { - var number =this.padString( this.inputData[10 + (this.indexs - 1) + "00"].toString(2),3) + var number = this.padString(this.inputData[10 + (this.indexs - 1) + "00"].toString(2), 3) if (Number(number[0])) { - this.topActive=1 - } else if(Number(number[1])){ - this.topActive=2 - }else if(Number(number[2])){ - this.topActive=3 - }else{ - this.topActive=0 + this.topActive = 1 + } else if (Number(number[1])) { + this.topActive = 2 + } else if (Number(number[2])) { + this.topActive = 3 + } else { + this.topActive = 0 } - console.log( this.topActive,11); + console.log(this.topActive, 11); }, change59() { var list = ["0", "0", "0", "0"]; @@ -966,7 +641,7 @@ export default { this.changeBtn(10 + (this.indexs - 1) + "59", dataNum); }, getType() { - var number =this.padString( this.inputData[10 + (this.indexs - 1) + "59"].toString(2),4) + var number = this.padString(this.inputData[10 + (this.indexs - 1) + "59"].toString(2), 4) console.log(number); if (Number(number[3])) { this.open1 = true; @@ -992,10 +667,10 @@ export default { } }, dataInit() { - var indexs=this.indexs - var store=this.$store.state + var indexs = this.indexs + var store = this.$store.state var data = { - equipmentId:store.equipmentList[store.equipmentIndex-1].deviceId, + equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId, pattern: 10 + (this.indexs - 1) + "00", //需要根据文档填写 //6目标ph-数值 regNum: 67, }; @@ -1003,15 +678,15 @@ export default { if (res.data.code == 200) { this.inputData = res.data.data; this.getType(); - this.getType00(); + this.getType00(); this.get53data(this.inputData[10 + (this.indexs - 1) + "53"]); - this.inputData[10 + (indexs - 1) + '01']=this.countData10(this.inputData[10 + (indexs - 1) + '01']) - this.inputData[10 + (indexs - 1) + '06']=this.countData10(this.inputData[10 + (indexs - 1) + '06']) - this.inputData[10 + (indexs - 1) + '17']=this.countData10(this.inputData[10 + (indexs - 1) + '17']) - this.inputData[10 + (indexs - 1) + '39']=this.countData10(this.inputData[10 + (indexs - 1) + '39']) - this.inputData[10 + (indexs - 1) + '40']=this.countData10(this.inputData[10 + (indexs - 1) + '40']) - this.inputData[10 + (indexs - 1) + '43']=this.countData10(this.inputData[10 + (indexs - 1) + '43']) - this.inputData[10 + (indexs - 1) + '44']=this.countData10(this.inputData[10 + (indexs - 1) + '44']) + this.inputData[10 + (indexs - 1) + '01'] = this.countData10(this.inputData[10 + (indexs - 1) + '01']) + this.inputData[10 + (indexs - 1) + '06'] = this.countData10(this.inputData[10 + (indexs - 1) + '06']) + this.inputData[10 + (indexs - 1) + '17'] = this.countData10(this.inputData[10 + (indexs - 1) + '17']) + this.inputData[10 + (indexs - 1) + '39'] = this.countData10(this.inputData[10 + (indexs - 1) + '39']) + this.inputData[10 + (indexs - 1) + '40'] = this.countData10(this.inputData[10 + (indexs - 1) + '40']) + this.inputData[10 + (indexs - 1) + '43'] = this.countData10(this.inputData[10 + (indexs - 1) + '43']) + this.inputData[10 + (indexs - 1) + '44'] = this.countData10(this.inputData[10 + (indexs - 1) + '44']) } else { this.$message.error(res.data.msg); } @@ -1020,47 +695,47 @@ export default { //全选文本 selectValue(e) { var store = this.$store.state - store.nowInput=e.target.value - e.currentTarget.select(); + store.nowInput = e.target.value + e.currentTarget.select(); }, - //失去焦点 - blurChange10(code, el) { - var store=this.$store.state + //失去焦点 + blurChange10(code, el) { + var store = this.$store.state var data = { - equipmentId: store.equipmentList[store.equipmentIndex-1].deviceId, + equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId, regAddress: code, - num: el.target.value*10, + num: el.target.value * 10, }; //避免开启多个计时器 if (store.nowInput != el.target.value) { - this.changeData(data); - } - // if (this.timer) { - // this.timer && clearInterval(this.timer); - // this.changeData(data); - // } - + this.changeData(data); + } + // if (this.timer) { + // this.timer && clearInterval(this.timer); + // this.changeData(data); + // } + }, - //失去焦点 + //失去焦点 blurChange(code, el) { - var store=this.$store.state + var store = this.$store.state var data = { - equipmentId: store.equipmentList[store.equipmentIndex-1].deviceId, + equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId, regAddress: code, num: el.target.value, }; //避免开启多个计时器 if (store.nowInput != el.target.value) { - this.changeData(data); - } - // if (this.timer) { - // this.timer && clearInterval(this.timer); - // this.changeData(data); - // } - + this.changeData(data); + } + // if (this.timer) { + // this.timer && clearInterval(this.timer); + // this.changeData(data); + // } + }, - changeBtn(code,el){ - var store=this.$store.state + changeBtn(code, el) { + var store = this.$store.state var data = { - equipmentId: store.equipmentList[store.equipmentIndex-1].deviceId, + equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId, regAddress: code, num: el.target.value, }; @@ -1084,9 +759,9 @@ export default { }, //间隔灌溉天数 change(code, el) { - var store=this.$store.state + var store = this.$store.state var data = { - equipmentId: store.equipmentList[store.equipmentIndex-1].deviceId, + equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId, regAddress: code, num: el.target.value, }; @@ -1110,20 +785,20 @@ export default { }, changeData(data) { var store = this.$store.state - this.api.postWriteFs(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - store.nowInput='' - // this.dataInit(); - } else { - this.inputData[data.regAddress]=store.nowInput - this.$message.error(res.data.msg); - } - this.timer = null + this.api.postWriteFs(data).then((res) => { + if (res.data.code == 200) { + this.$message({ + message: res.data.msg, + type: "success", }); + store.nowInput = '' + // this.dataInit(); + } else { + this.inputData[data.regAddress] = store.nowInput + this.$message.error(res.data.msg); + } + this.timer = null + }); }, handleClose1(done) { // this.$confirm('确认关闭?') @@ -1153,9 +828,8 @@ export default { // }) // .catch(_ => {}); }, - handleClose5(done) {}, + handleClose5(done) { }, }, }; - - \ No newline at end of file + \ No newline at end of file -- 2.40.1 From 2dde0571e33db36688780ce53f13a05b23c5b5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=90=8C?= <525441437@qq.com> Date: Mon, 18 Mar 2024 15:22:12 +0800 Subject: [PATCH 2/2] 1 --- src/views/page/realTime.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/page/realTime.vue b/src/views/page/realTime.vue index 81665c2..cf3fefc 100644 --- a/src/views/page/realTime.vue +++ b/src/views/page/realTime.vue @@ -258,7 +258,7 @@ || item.type == 13 || item.type == 14 || item.type == 15 || item.type == 16">
{{ getNumberStatus(item) }}
+ v-if="item.type == 6 || item.type == 5 || item.type == 2 || item.type == 15|| item.type == 16 || item.type == 14 || item.type == 13 || item.type == 12"> {{ item.progress }}%
-- 2.40.1