Merge pull request '修改参数成功后取消数据请求' (#73) from pc-master into portal

Reviewed-on: #73
portal
xiaomeng 2023-12-14 00:13:35 +00:00
commit 25be1a7ad9
18 changed files with 312 additions and 229 deletions

View File

@ -5,6 +5,7 @@ Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
nowInput:'',
lateSend: 100,//写入停止后 *100毫秒进行发送 例如10*100就是1000毫秒(1s) lateSend: 100,//写入停止后 *100毫秒进行发送 例如10*100就是1000毫秒(1s)
lateSendBtn: 10,//写入停止后 *100毫秒进行发送 例如10*100就是1000毫秒(1s) lateSendBtn: 10,//写入停止后 *100毫秒进行发送 例如10*100就是1000毫秒(1s)
equipmentList: [],//当前账户施肥设备 equipmentList: [],//当前账户施肥设备

View File

@ -160,10 +160,12 @@ export default {
} }
}); });
}, },
// //
selectValue(e) { selectValue(e) {
e.currentTarget.select(); var store = this.$store.state
}, store.nowInput=e.target.value
e.currentTarget.select();
},
// //
blurChange(code, el) { blurChange(code, el) {
var store=this.$store.state var store=this.$store.state
@ -204,18 +206,21 @@ selectValue(e) {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postWriteFs(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postWriteFs(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", 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
});
}, },
}, },

View File

@ -277,10 +277,12 @@ export default {
} }
}); });
}, },
// //
selectValue(e) { selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select(); e.currentTarget.select();
}, },
// //
blurChange(code, el) { blurChange(code, el) {
var store = this.$store.state var store = this.$store.state
@ -346,18 +348,21 @@ export default {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postControlWrite(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postControlWrite(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", message: res.data.msg,
}); type: "success",
this.dataInit(); });
} else { store.nowInput=''
this.$message.error("请求出错"); // this.dataInit();
} } else {
this.timer = null this.inputData[data.regAddress]=store.nowInput
}); this.$message.error(res.data.msg);
}
this.timer = null
});
}, },
}, },

View File

@ -341,10 +341,12 @@ export default {
} }
this.change(store.formulaNum[this.indexs - 1] + 2, dataSel); this.change(store.formulaNum[this.indexs - 1] + 2, dataSel);
}, },
// //
selectValue(e) { selectValue(e) {
e.currentTarget.select(); var store = this.$store.state
}, store.nowInput=e.target.value
e.currentTarget.select();
},
// //
blurChange(code, el) { blurChange(code, el) {
var store=this.$store.state var store=this.$store.state
@ -385,18 +387,22 @@ selectValue(e) {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postWriteFs(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postWriteFs(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", 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 }) { tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) { if (rowIndex % 2 == 1) {

View File

@ -978,9 +978,11 @@ export default {
}); });
}, },
// //
selectValue(e) { selectValue(e) {
e.currentTarget.select(); var store = this.$store.state
}, store.nowInput=e.target.value
e.currentTarget.select();
},
// //
blurChange10(code, el) { blurChange10(code, el) {
var store=this.$store.state var store=this.$store.state
@ -1061,18 +1063,21 @@ selectValue(e) {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postWriteFs(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postWriteFs(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", 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) { handleClose1(done) {
// this.$confirm('') // this.$confirm('')

View File

@ -387,10 +387,12 @@ return num
} }
}); });
}, },
// //
selectValue(e) { selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select(); e.currentTarget.select();
}, },
getSendData(number) { getSendData(number) {
var number1 = number var number1 = number
this.typeList.some((el, index) => { this.typeList.some((el, index) => {
@ -499,18 +501,21 @@ return num
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postControlWrite(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postControlWrite(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", message: res.data.msg,
}); type: "success",
this.dataInit(); });
} else { store.nowInput=''
this.$message.error("请求出错"); // this.dataInit();
} } else {
this.timer = null this.inputData[data.regAddress]=store.nowInput
}); this.$message.error(res.data.msg);
}
this.timer = null
});
}, },
}, },

View File

@ -265,10 +265,12 @@ return num
} }
}); });
}, },
// //
selectValue(e) { selectValue(e) {
e.currentTarget.select(); var store = this.$store.state
}, store.nowInput=e.target.value
e.currentTarget.select();
},
getSendData(number){ getSendData(number){
var number1=number var number1=number
this.typeList.some((el, index) => { this.typeList.some((el, index) => {
@ -377,18 +379,21 @@ getSendData(number){
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postWriteFs(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postWriteFs(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", message: res.data.msg,
}); type: "success",
this.dataInit(); });
} else { store.nowInput=''
this.$message.error("请求出错"); // this.dataInit();
} } else {
this.timer=null this.inputData[data.regAddress]=store.nowInput
}); this.$message.error(res.data.msg);
}
this.timer = null
});
}, },
}, },

View File

@ -355,7 +355,9 @@ export default {
}, },
// //
selectValue(e) { selectValue(e) {
e.currentTarget.select(); var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
}, },
// //
blurChange(code, el) { blurChange(code, el) {
@ -422,18 +424,21 @@ export default {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postControlWrite(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postControlWrite(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", 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
});
}, },
}, },

View File

@ -193,10 +193,10 @@ export default {
message: res.data.msg, message: res.data.msg,
type: "success", type: "success",
}); });
this.dataInit(); // this.dataInit();
} else { } else {
this.$message.error("请求出错"); this.$message.error(res.data.msg);
} }
if (this.nowSel.index != -1) { if (this.nowSel.index != -1) {
this.timer = null this.timer = null

View File

@ -116,10 +116,12 @@ export default {
} }
}); });
}, },
// //
selectValue(e) { selectValue(e) {
e.currentTarget.select(); var store = this.$store.state
}, store.nowInput=e.target.value
e.currentTarget.select();
},
// //
blurChange(code, el) { blurChange(code, el) {
var store=this.$store.state var store=this.$store.state
@ -160,18 +162,21 @@ selectValue(e) {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postWriteFs(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postWriteFs(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", message: res.data.msg,
}); type: "success",
this.dataInit(); });
} else { store.nowInput=''
this.$message.error("请求出错"); // this.dataInit();
} } else {
this.timer=null this.inputData[data.regAddress]=store.nowInput
}); this.$message.error(res.data.msg);
}
this.timer = null
});
}, },
}, },

View File

@ -301,10 +301,12 @@ export default {
} }
}); });
}, },
// //
selectValue(e) { selectValue(e) {
e.currentTarget.select(); var store = this.$store.state
}, store.nowInput=e.target.value
e.currentTarget.select();
},
// //
blurChange(code, el) { blurChange(code, el) {
var store=this.$store.state var store=this.$store.state
@ -369,19 +371,22 @@ selectValue(e) {
} }
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postControlWrite(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postControlWrite(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", message: res.data.msg,
}); type: "success",
this.dataInit(); });
} else { store.nowInput=''
this.$message.error("请求出错"); // this.dataInit();
} } else {
this.timer=null this.inputData[data.regAddress]=store.nowInput
}); this.$message.error(res.data.msg);
}
this.timer = null
});
}, },
selList1(index) { selList1(index) {
if (this.actList1.indexOf(index) == -1) { if (this.actList1.indexOf(index) == -1) {

View File

@ -147,10 +147,12 @@ export default {
} }
}); });
}, },
// //
selectValue(e) { selectValue(e) {
e.currentTarget.select(); var store = this.$store.state
}, store.nowInput=e.target.value
e.currentTarget.select();
},
// //
blurChange(code, el) { blurChange(code, el) {
var store=this.$store.state var store=this.$store.state
@ -216,18 +218,21 @@ selectValue(e) {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postWriteFs(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postWriteFs(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", message: res.data.msg,
}); type: "success",
this.dataInit(); });
} else { store.nowInput=''
this.$message.error("请求出错"); // this.dataInit();
} } else {
this.timer=null this.inputData[data.regAddress]=store.nowInput
}); this.$message.error(res.data.msg);
}
this.timer = null
});
}, },
selList1(index) { selList1(index) {
if (this.actList1.indexOf(index) == -1) { if (this.actList1.indexOf(index) == -1) {

View File

@ -185,6 +185,8 @@ export default {
}, },
// //
selectValue(e) { selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select(); e.currentTarget.select();
}, },
// //
@ -252,15 +254,19 @@ export default {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
var store = this.$store.state
this.api.postControlWrite(data).then((res) => { this.api.postControlWrite(data).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message({ this.$message({
message: res.data.msg, message: res.data.msg,
type: "success", type: "success",
}); });
this.dataInit(); store.nowInput=''
// this.dataInit();
} else { } else {
this.$message.error("请求出错"); this.inputData[data.regAddress]=store.nowInput
this.$message.error(res.data.msg);
} }
this.timer = null this.timer = null
}); });

View File

@ -158,8 +158,10 @@ export default {
}, },
// //
selectValue(e) { selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select(); e.currentTarget.select();
}, },
// //
blurChange(code, el) { blurChange(code, el) {
var store = this.$store.state var store = this.$store.state
@ -225,18 +227,21 @@ export default {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postControlWrite(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postControlWrite(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", message: res.data.msg,
}); type: "success",
this.dataInit(); });
} else { store.nowInput=''
this.$message.error("请求出错"); // this.dataInit();
} } else {
this.timer = null this.inputData[data.regAddress]=store.nowInput
}); this.$message.error(res.data.msg);
}
this.timer = null
});
}, },
}, },

View File

@ -273,10 +273,12 @@ return hexString;
}) })
this.getStatus(data) this.getStatus(data)
}, },
// //
selectValue(e) { selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select(); e.currentTarget.select();
}, },
// //
blurChange(code, el) { blurChange(code, el) {
var store = this.$store.state var store = this.$store.state
@ -342,18 +344,21 @@ return hexString;
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postControlWrite(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postControlWrite(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", message: res.data.msg,
}); type: "success",
this.dataInit(); });
} else { store.nowInput=''
this.$message.error("请求出错"); // this.dataInit();
} } else {
this.timer = null this.inputData[data.regAddress]=store.nowInput
}); this.$message.error(res.data.msg);
}
this.timer = null
});
}, },
}, },

View File

@ -172,10 +172,12 @@ export default {
}) })
}, },
// //
selectValue(e) { selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select(); e.currentTarget.select();
}, },
// //
blurChange(code, el) { blurChange(code, el) {
var store = this.$store.state var store = this.$store.state
@ -241,18 +243,21 @@ export default {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postControlWrite(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postControlWrite(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", message: res.data.msg,
}); type: "success",
this.dataInit(); });
} else { store.nowInput=''
this.$message.error("请求出错"); // this.dataInit();
} } else {
this.timer = null this.inputData[data.regAddress]=store.nowInput
}); this.$message.error(res.data.msg);
}
this.timer = null
});
}, },
}, },

View File

@ -276,11 +276,13 @@ export default {
this.statusNum=res.data.data['1015'] this.statusNum=res.data.data['1015']
} }
}) })
}, },
// //
selectValue(e) { selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select(); e.currentTarget.select();
}, },
// //
blurChange(code, el) { blurChange(code, el) {
var store = this.$store.state var store = this.$store.state
@ -346,18 +348,21 @@ export default {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postControlWrite(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postControlWrite(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", message: res.data.msg,
}); type: "success",
this.dataInit(); });
} else { store.nowInput=''
this.$message.error("请求出错"); // this.dataInit();
} } else {
this.timer = null this.inputData[data.regAddress]=store.nowInput
}); this.$message.error(res.data.msg);
}
this.timer = null
});
}, },
}, },

View File

@ -166,11 +166,13 @@ export default {
}) })
}, },
// //
selectValue(e) { selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select(); e.currentTarget.select();
}, },
// //
blurChange(code, el) { blurChange(code, el) {
var store = this.$store.state var store = this.$store.state
@ -236,18 +238,21 @@ export default {
}, 100); }, 100);
}, },
changeData(data) { changeData(data) {
this.api.postControlWrite(data).then((res) => { var store = this.$store.state
if (res.data.code == 200) { this.api.postControlWrite(data).then((res) => {
this.$message({ if (res.data.code == 200) {
message: res.data.msg, this.$message({
type: "success", message: res.data.msg,
}); type: "success",
this.dataInit(); });
} else { store.nowInput=''
this.$message.error("请求出错"); // this.dataInit();
} } else {
this.timer = null this.inputData[data.regAddress]=store.nowInput
}); this.$message.error(res.data.msg);
}
this.timer = null
});
}, },
}, },