From 389cdb3b70a6a3cc75266f9fb98e217c92a02318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=90=8C?= <525441437@qq.com> Date: Wed, 13 Dec 2023 17:16:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E5=90=8E=E5=8F=96=E6=B6=88=E6=95=B0=E6=8D=AE=E8=AF=B7?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/index.js | 1 + src/views/page/PIDSet.vue | 35 +++++++++++++++------------ src/views/page/fan.vue | 35 +++++++++++++++------------ src/views/page/formula.vue | 36 +++++++++++++++------------ src/views/page/irrigateSet.vue | 33 ++++++++++++++----------- src/views/page/sensorSet-con.vue | 35 +++++++++++++++------------ src/views/page/sensorSet.vue | 37 ++++++++++++++++------------ src/views/page/skylight.vue | 29 +++++++++++++--------- src/views/page/synthesis-con.vue | 4 +-- src/views/page/systemSet.vue | 37 ++++++++++++++++------------ src/views/page/upload-con.vue | 39 +++++++++++++++++------------- src/views/page/upload.vue | 37 ++++++++++++++++------------ src/views/wufang/downtake.vue | 10 ++++++-- src/views/wufang/geothermalFan.vue | 31 ++++++++++++++---------- src/views/wufang/rollByRoll.vue | 35 +++++++++++++++------------ src/views/wufang/snowRemoval.vue | 35 +++++++++++++++------------ src/views/wufang/uptake.vue | 37 ++++++++++++++++------------ src/views/wufang/waterPump.vue | 35 +++++++++++++++------------ 18 files changed, 312 insertions(+), 229 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 76b3920..1786a65 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -5,6 +5,7 @@ Vue.use(Vuex) export default new Vuex.Store({ state: { + nowInput:'', lateSend: 100,//写入停止后 *100毫秒进行发送 例如10*100就是1000毫秒(1s) lateSendBtn: 10,//写入停止后 *100毫秒进行发送 例如10*100就是1000毫秒(1s) equipmentList: [],//当前账户施肥设备 diff --git a/src/views/page/PIDSet.vue b/src/views/page/PIDSet.vue index b3a9e4c..84bbc11 100644 --- a/src/views/page/PIDSet.vue +++ b/src/views/page/PIDSet.vue @@ -160,10 +160,12 @@ export default { } }); }, - //全选文本 -selectValue(e) { - e.currentTarget.select(); -}, + //全选文本 + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value + e.currentTarget.select(); + }, //失去焦点 blurChange(code, el) { var store=this.$store.state @@ -204,18 +206,21 @@ selectValue(e) { }, 100); }, changeData(data) { - this.api.postWriteFs(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", + 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.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer=null - }); }, }, diff --git a/src/views/page/fan.vue b/src/views/page/fan.vue index 5a92a32..3bba3a3 100644 --- a/src/views/page/fan.vue +++ b/src/views/page/fan.vue @@ -277,10 +277,12 @@ export default { } }); }, - //全选文本 - selectValue(e) { + //全选文本 + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value e.currentTarget.select(); - }, + }, //失去焦点 blurChange(code, el) { var store = this.$store.state @@ -346,18 +348,21 @@ export default { }, 100); }, changeData(data) { - this.api.postControlWrite(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - this.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer = null - }); + var store = this.$store.state + this.api.postControlWrite(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 + }); }, }, diff --git a/src/views/page/formula.vue b/src/views/page/formula.vue index 87e6ae2..80dabce 100644 --- a/src/views/page/formula.vue +++ b/src/views/page/formula.vue @@ -341,10 +341,12 @@ export default { } this.change(store.formulaNum[this.indexs - 1] + 2, dataSel); }, - //全选文本 -selectValue(e) { - e.currentTarget.select(); -}, + //全选文本 + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value + e.currentTarget.select(); + }, //失去焦点 blurChange(code, el) { var store=this.$store.state @@ -385,18 +387,22 @@ selectValue(e) { }, 100); }, changeData(data) { - this.api.postWriteFs(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", + 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.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer=null - }); + }, tableRowClassName({ row, rowIndex }) { if (rowIndex % 2 == 1) { diff --git a/src/views/page/irrigateSet.vue b/src/views/page/irrigateSet.vue index bef30f7..fbbc12b 100644 --- a/src/views/page/irrigateSet.vue +++ b/src/views/page/irrigateSet.vue @@ -978,9 +978,11 @@ export default { }); }, //全选文本 -selectValue(e) { - e.currentTarget.select(); -}, + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value + e.currentTarget.select(); + }, //失去焦点 blurChange10(code, el) { var store=this.$store.state @@ -1061,18 +1063,21 @@ selectValue(e) { }, 100); }, changeData(data) { - this.api.postWriteFs(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", + 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.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer=null - }); }, handleClose1(done) { // this.$confirm('确认关闭?') diff --git a/src/views/page/sensorSet-con.vue b/src/views/page/sensorSet-con.vue index 6eaaaaa9..ef15a74 100644 --- a/src/views/page/sensorSet-con.vue +++ b/src/views/page/sensorSet-con.vue @@ -387,10 +387,12 @@ return num } }); }, - //全选文本 - selectValue(e) { + //全选文本 + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value e.currentTarget.select(); - }, + }, getSendData(number) { var number1 = number this.typeList.some((el, index) => { @@ -499,18 +501,21 @@ return num }, 100); }, changeData(data) { - this.api.postControlWrite(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - this.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer = null - }); + var store = this.$store.state + this.api.postControlWrite(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 + }); }, }, diff --git a/src/views/page/sensorSet.vue b/src/views/page/sensorSet.vue index a665544..439c9de 100644 --- a/src/views/page/sensorSet.vue +++ b/src/views/page/sensorSet.vue @@ -265,10 +265,12 @@ return num } }); }, - //全选文本 -selectValue(e) { - e.currentTarget.select(); -}, + //全选文本 + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value + e.currentTarget.select(); + }, getSendData(number){ var number1=number this.typeList.some((el, index) => { @@ -377,18 +379,21 @@ getSendData(number){ }, 100); }, changeData(data) { - this.api.postWriteFs(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - this.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer=null - }); + 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 + }); }, }, diff --git a/src/views/page/skylight.vue b/src/views/page/skylight.vue index 6ff936c..80cd9b0 100644 --- a/src/views/page/skylight.vue +++ b/src/views/page/skylight.vue @@ -355,7 +355,9 @@ export default { }, //全选文本 selectValue(e) { - e.currentTarget.select(); + var store = this.$store.state + store.nowInput=e.target.value + e.currentTarget.select(); }, //失去焦点 blurChange(code, el) { @@ -422,18 +424,21 @@ export default { }, 100); }, changeData(data) { - this.api.postControlWrite(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", + var store = this.$store.state + this.api.postControlWrite(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.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer = null - }); }, }, diff --git a/src/views/page/synthesis-con.vue b/src/views/page/synthesis-con.vue index da24d84..2a2b964 100644 --- a/src/views/page/synthesis-con.vue +++ b/src/views/page/synthesis-con.vue @@ -193,10 +193,10 @@ export default { message: res.data.msg, type: "success", }); - this.dataInit(); + // this.dataInit(); } else { - this.$message.error("请求出错"); + this.$message.error(res.data.msg); } if (this.nowSel.index != -1) { this.timer = null diff --git a/src/views/page/systemSet.vue b/src/views/page/systemSet.vue index ab3a7b1..9a130c2 100644 --- a/src/views/page/systemSet.vue +++ b/src/views/page/systemSet.vue @@ -116,10 +116,12 @@ export default { } }); }, - //全选文本 -selectValue(e) { - e.currentTarget.select(); -}, + //全选文本 + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value + e.currentTarget.select(); + }, //失去焦点 blurChange(code, el) { var store=this.$store.state @@ -160,18 +162,21 @@ selectValue(e) { }, 100); }, changeData(data) { - this.api.postWriteFs(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - this.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer=null - }); + 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 + }); }, }, diff --git a/src/views/page/upload-con.vue b/src/views/page/upload-con.vue index e0bb709..35594dd 100644 --- a/src/views/page/upload-con.vue +++ b/src/views/page/upload-con.vue @@ -301,10 +301,12 @@ export default { } }); }, - //全选文本 -selectValue(e) { - e.currentTarget.select(); -}, + //全选文本 + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value + e.currentTarget.select(); + }, //失去焦点 blurChange(code, el) { var store=this.$store.state @@ -369,19 +371,22 @@ selectValue(e) { } }, 100); }, - changeData(data) { - this.api.postControlWrite(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - this.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer=null - }); + changeData(data) { + var store = this.$store.state + this.api.postControlWrite(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 + }); }, selList1(index) { if (this.actList1.indexOf(index) == -1) { diff --git a/src/views/page/upload.vue b/src/views/page/upload.vue index 330572c..8e2aadc 100644 --- a/src/views/page/upload.vue +++ b/src/views/page/upload.vue @@ -147,10 +147,12 @@ export default { } }); }, - //全选文本 -selectValue(e) { - e.currentTarget.select(); -}, + //全选文本 + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value + e.currentTarget.select(); + }, //失去焦点 blurChange(code, el) { var store=this.$store.state @@ -216,18 +218,21 @@ selectValue(e) { }, 100); }, changeData(data) { - this.api.postWriteFs(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - this.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer=null - }); + 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 + }); }, selList1(index) { if (this.actList1.indexOf(index) == -1) { diff --git a/src/views/wufang/downtake.vue b/src/views/wufang/downtake.vue index dfbca1b..09a7eeb 100644 --- a/src/views/wufang/downtake.vue +++ b/src/views/wufang/downtake.vue @@ -185,6 +185,8 @@ export default { }, //全选文本 selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value e.currentTarget.select(); }, //失去焦点 @@ -252,15 +254,19 @@ export default { }, 100); }, changeData(data) { + var store = this.$store.state + this.api.postControlWrite(data).then((res) => { if (res.data.code == 200) { this.$message({ message: res.data.msg, type: "success", }); - this.dataInit(); + store.nowInput='' + // this.dataInit(); } else { - this.$message.error("请求出错"); + this.inputData[data.regAddress]=store.nowInput + this.$message.error(res.data.msg); } this.timer = null }); diff --git a/src/views/wufang/geothermalFan.vue b/src/views/wufang/geothermalFan.vue index 203c5dc..1b2957a 100644 --- a/src/views/wufang/geothermalFan.vue +++ b/src/views/wufang/geothermalFan.vue @@ -158,8 +158,10 @@ export default { }, //全选文本 selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value e.currentTarget.select(); - }, + }, //失去焦点 blurChange(code, el) { var store = this.$store.state @@ -225,18 +227,21 @@ export default { }, 100); }, changeData(data) { - this.api.postControlWrite(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - this.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer = null - }); + var store = this.$store.state + this.api.postControlWrite(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 + }); }, }, diff --git a/src/views/wufang/rollByRoll.vue b/src/views/wufang/rollByRoll.vue index f53a13a..a838a4c 100644 --- a/src/views/wufang/rollByRoll.vue +++ b/src/views/wufang/rollByRoll.vue @@ -273,10 +273,12 @@ return hexString; }) this.getStatus(data) }, - //全选文本 - selectValue(e) { + //全选文本 + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value e.currentTarget.select(); - }, + }, //失去焦点 blurChange(code, el) { var store = this.$store.state @@ -342,18 +344,21 @@ return hexString; }, 100); }, changeData(data) { - this.api.postControlWrite(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - this.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer = null - }); + var store = this.$store.state + this.api.postControlWrite(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 + }); }, }, diff --git a/src/views/wufang/snowRemoval.vue b/src/views/wufang/snowRemoval.vue index c00b034..6cd8109 100644 --- a/src/views/wufang/snowRemoval.vue +++ b/src/views/wufang/snowRemoval.vue @@ -172,10 +172,12 @@ export default { }) }, - //全选文本 - selectValue(e) { + //全选文本 + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value e.currentTarget.select(); - }, + }, //失去焦点 blurChange(code, el) { var store = this.$store.state @@ -241,18 +243,21 @@ export default { }, 100); }, changeData(data) { - this.api.postControlWrite(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - this.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer = null - }); + var store = this.$store.state + this.api.postControlWrite(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 + }); }, }, diff --git a/src/views/wufang/uptake.vue b/src/views/wufang/uptake.vue index bd22bb8..7d600c0 100644 --- a/src/views/wufang/uptake.vue +++ b/src/views/wufang/uptake.vue @@ -276,11 +276,13 @@ export default { this.statusNum=res.data.data['1015'] } }) - }, - //全选文本 - selectValue(e) { + }, + //全选文本 + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value e.currentTarget.select(); - }, + }, //失去焦点 blurChange(code, el) { var store = this.$store.state @@ -346,18 +348,21 @@ export default { }, 100); }, changeData(data) { - this.api.postControlWrite(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - this.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer = null - }); + var store = this.$store.state + this.api.postControlWrite(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 + }); }, }, diff --git a/src/views/wufang/waterPump.vue b/src/views/wufang/waterPump.vue index e964a2e..37e3ccf 100644 --- a/src/views/wufang/waterPump.vue +++ b/src/views/wufang/waterPump.vue @@ -166,11 +166,13 @@ export default { }) - }, + }, //全选文本 - selectValue(e) { + selectValue(e) { + var store = this.$store.state + store.nowInput=e.target.value e.currentTarget.select(); - }, + }, //失去焦点 blurChange(code, el) { var store = this.$store.state @@ -236,18 +238,21 @@ export default { }, 100); }, changeData(data) { - this.api.postControlWrite(data).then((res) => { - if (res.data.code == 200) { - this.$message({ - message: res.data.msg, - type: "success", - }); - this.dataInit(); - } else { - this.$message.error("请求出错"); - } - this.timer = null - }); + var store = this.$store.state + this.api.postControlWrite(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 + }); }, },