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({
state: {
nowInput:'',
lateSend: 100,//写入停止后 *100毫秒进行发送 例如10*100就是1000毫秒(1s)
lateSendBtn: 10,//写入停止后 *100毫秒进行发送 例如10*100就是1000毫秒(1s)
equipmentList: [],//当前账户施肥设备

View File

@ -162,6 +162,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -204,15 +206,18 @@ selectValue(e) {
}, 100);
},
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",
});
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
});

View File

@ -279,6 +279,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -346,15 +348,18 @@ 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
});

View File

@ -343,6 +343,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -385,18 +387,22 @@ selectValue(e) {
}, 100);
},
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",
});
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
});
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) {

View File

@ -979,6 +979,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -1061,15 +1063,18 @@ selectValue(e) {
}, 100);
},
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",
});
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
});

View File

@ -389,6 +389,8 @@ return num
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
getSendData(number) {
@ -499,15 +501,18 @@ return num
}, 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
});

View File

@ -267,6 +267,8 @@ return num
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
getSendData(number){
@ -377,15 +379,18 @@ getSendData(number){
}, 100);
},
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",
});
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
});

View File

@ -355,6 +355,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -422,15 +424,18 @@ 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
});

View File

@ -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

View File

@ -118,6 +118,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -160,15 +162,18 @@ selectValue(e) {
}, 100);
},
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",
});
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
});

View File

@ -303,6 +303,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -370,15 +372,18 @@ selectValue(e) {
}, 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
});

View File

@ -149,6 +149,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -216,15 +218,18 @@ selectValue(e) {
}, 100);
},
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",
});
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
});

View File

@ -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
});

View File

@ -158,6 +158,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -225,15 +227,18 @@ 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
});

View File

@ -275,6 +275,8 @@ return hexString;
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -342,15 +344,18 @@ return hexString;
}, 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
});

View File

@ -174,6 +174,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -241,15 +243,18 @@ 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
});

View File

@ -279,6 +279,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -346,15 +348,18 @@ 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
});

View File

@ -169,6 +169,8 @@ export default {
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput=e.target.value
e.currentTarget.select();
},
//
@ -236,15 +238,18 @@ 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
});