1 #80

Merged
xiaomeng merged 1 commits from pc-master into portal 2023-12-21 16:14:07 +00:00
2 changed files with 107 additions and 30 deletions

View File

@ -72,13 +72,13 @@
<div class="input-main">
<div>标定低点AD值</div>
<input @blur="blurChange(20904 + (active * 5 + 1), $event)"
v-model="inputData[20904 + (active * 5 + 1)]"
v-model="inputDataNew[20904 + (active * 5 + 1)]"
@input="change(20904 + (active * 5 + 1), $event)" type="number" placeholder="0.0">
</div>
<div class="input-main">
<div>标定低点数据</div>
<input @blur="blurChange1(20904 + (active * 5 + 2), $event)"
v-model="inputData[20904 + (active * 5 + 2)]"
v-model="inputDataNew[20904 + (active * 5 + 2)]"
@input="change1(20904 + (active * 5 + 2), $event)" type="number" placeholder="0.0">
</div>
</div>
@ -86,13 +86,13 @@
<div class="input-main">
<div>标定高点AD值</div>
<input @blur="blurChange(20904 + (active * 5 + 3), $event)"
v-model="inputData[20904 + (active * 5 + 3)]"
v-model="inputDataNew[20904 + (active * 5 + 3)]"
@input="change(20904 + (active * 5 + 3), $event)" type="number" placeholder="0.0">
</div>
<div class="input-main">
<div>标定高点数据</div>
<input @blur="blurChange1(20904 + (active * 5 + 4), $event)"
v-model="inputData[20904 + (active * 5 + 4)]"
v-model="inputDataNew[20904 + (active * 5 + 4)]"
@input="change1(20904 + (active * 5 + 4), $event)" type="number" placeholder="0.0">
</div>
</div>
@ -127,6 +127,7 @@ export default {
sel2: false,
sel3: false,
inputData: [],
inputDataNew:[],
sensorType: '',//
openList1: [],//
openList2: [],//
@ -205,31 +206,57 @@ return num
};
this.changeBtn(20904 + (this.active * 5), dataNum);
},
//inputData
getSaveCountData(){
for (var i = 0; i < 48; i++) {
this.typeList.forEach((el, index) => {
if (el.value == this.inputData[20904 + (i * 5)]) {
if (el.countType == 0) {
this.inputData[20904 + (i * 5 + 2)]= this.inputDataNew[20904 + (i * 5 + 2)]
this.inputData[20904 + (i * 5 + 4)]=this.inputDataNew[20904 + (i * 5 + 4)]
} else if (el.countType == 1) {
this.inputData[20904 + (i * 5 + 2)] = this.sendCountType1(this.inputDataNew[20904 + (i * 5 + 2)])
this.inputData[20904 + (i * 5 + 4)] = this.sendCountType1(this.inputDataNew[20904 + (i * 5 + 4)])
} else if (el.countType == 2) {
this.inputData[20904 + (i * 5 + 2)] = this.sendCountType2(this.inputDataNew[20904 + (i * 5 + 2)])
this.inputData[20904 + (i * 5 + 4)] = this.sendCountType2(this.inputDataNew[20904 + (i * 5 + 4)])
} else if (el.countType == 3) {
this.inputData[20904 + (i * 5 + 2)] = this.sendCountType3(this.inputDataNew[20904 + (i * 5 + 2)])
this.inputData[20904 + (i * 5 + 4)] = this.sendCountType3(this.inputDataNew[20904 + (i * 5 + 4)])
} else if (el.countType == 4) {
this.inputData[20904 + (i * 5 + 2)] = this.sendCountType4(this.inputDataNew[20904 + (i * 5 + 2)])
this.inputData[20904 + (i * 5 + 4)] = this.sendCountType4(this.inputDataNew[20904 + (i * 5 + 4)])
}
}
})
}
},
//
getCountData() {
for (var i = 0; i < 48; i++) {
this.typeList.forEach((el, index) => {
if (el.value == this.inputData[20904 + (i * 5)]) {
if (el.countType == 0) {
this.inputDataNew[20904 + (i * 5 + 2)] = this.inputData[20904 + (i * 5 + 2)]
this.inputDataNew[20904 + (i * 5 + 4)] = this.inputData[20904 + (i * 5 + 4)]
} else if (el.countType == 1) {
this.inputData[20904 + (i * 5 + 2)] = this.countType1(this.inputData[20904 + (i * 5 + 2)])
this.inputData[20904 + (i * 5 + 4)] = this.countType1(this.inputData[20904 + (i * 5 + 4)])
this.inputDataNew[20904 + (i * 5 + 2)] = this.countType1(this.inputData[20904 + (i * 5 + 2)])
this.inputDataNew[20904 + (i * 5 + 4)] = this.countType1(this.inputData[20904 + (i * 5 + 4)])
} else if (el.countType == 2) {
this.inputData[20904 + (i * 5 + 2)] = this.countType2(this.inputData[20904 + (i * 5 + 2)])
this.inputData[20904 + (i * 5 + 4)] = this.countType2(this.inputData[20904 + (i * 5 + 4)])
this.inputDataNew[20904 + (i * 5 + 2)] = this.countType2(this.inputData[20904 + (i * 5 + 2)])
this.inputDataNew[20904 + (i * 5 + 4)] = this.countType2(this.inputData[20904 + (i * 5 + 4)])
} else if (el.countType == 3) {
this.inputData[20904 + (i * 5 + 2)] = this.countType3(this.inputData[20904 + (i * 5 + 2)])
this.inputData[20904 + (i * 5 + 4)] = this.countType3(this.inputData[20904 + (i * 5 + 4)])
this.inputDataNew[20904 + (i * 5 + 2)] = this.countType3(this.inputData[20904 + (i * 5 + 2)])
this.inputDataNew[20904 + (i * 5 + 4)] = this.countType3(this.inputData[20904 + (i * 5 + 4)])
} else if (el.countType == 4) {
this.inputData[20904 + (i * 5 + 2)] = this.countType4(this.inputData[20904 + (i * 5 + 2)])
this.inputData[20904 + (i * 5 + 4)] = this.countType4(this.inputData[20904 + (i * 5 + 4)])
this.inputDataNew[20904 + (i * 5 + 2)] = this.countType4(this.inputData[20904 + (i * 5 + 2)])
this.inputDataNew[20904 + (i * 5 + 4)] = this.countType4(this.inputData[20904 + (i * 5 + 4)])
}
}
})
}
}
},
getSensorType() {
this.typeList.forEach((el, index) => {
@ -377,7 +404,8 @@ return num
};
this.api.getReadControlSensorChannel(data).then((res) => {
if (res.data.code == 200) {
this.inputData = res.data.data;
this.inputData = JSON.parse(JSON.stringify(res.data.data));
this.inputDataNew = res.data.data;
// this.getData272()
this.getOpen()
this.getSensorType()
@ -509,7 +537,17 @@ return num
type: "success",
});
store.nowInput=''
this.getSaveCountData()
// this.dataInit();
for (var i = 0; i < 48; i++) {
if((20904 + (i * 5))==data.regAddress){
this.inputData[20904 + (i * 5)]=data.num
console.log( this.inputData[20904 + (i * 5)],20904 + (i * 5),777);
}
}
this.getCountData()
} else {
this.inputData[data.regAddress]=store.nowInput
this.$message.error(res.data.msg);

View File

@ -54,13 +54,13 @@
<div>
<div class="input-main">
<div>标定低点AD值</div>
<input @blur="blurChange(numberList[active] + 1, $event)" v-model="inputData[numberList[active] + 1]"
<input @blur="blurChange(numberList[active] + 1, $event)" v-model="inputDataNew[numberList[active] + 1]"
@input="change(numberList[active] + 1, $event)"
type="number" placeholder="0.0">
</div>
<div class="input-main">
<div>标定低点数据</div>
<input @blur="blurChange1(numberList[active] + 2, $event)" v-model="inputData[numberList[active] + 2]"
<input @blur="blurChange1(numberList[active] + 2, $event)" v-model="inputDataNew[numberList[active] + 2]"
@input="change1(numberList[active] + 2, $event)"
type="number" placeholder="0.0">
</div>
@ -68,13 +68,13 @@
<div>
<div class="input-main">
<div>标定高点AD值</div>
<input @blur="blurChange(numberList[active] + 3, $event)" v-model="inputData[numberList[active] + 3]"
<input @blur="blurChange(numberList[active] + 3, $event)" v-model="inputDataNew[numberList[active] + 3]"
@input="change(numberList[active] + 3, $event)"
type="number" placeholder="0.0">
</div>
<div class="input-main">
<div>标定高点数据</div>
<input @blur="blurChange1(numberList[active] + 4, $event)" v-model="inputData[numberList[active] + 4]"
<input @blur="blurChange1(numberList[active] + 4, $event)" v-model="inputDataNew[numberList[active] + 4]"
@input="change1(numberList[active] + 4 , $event)"
type="number" placeholder="0.0">
</div>
@ -99,6 +99,7 @@ export default {
sel3: false,
numberList: [273, 278, 283, 288, 293, 298],
inputData: [],
inputDataNew:[],
sensorType:'',//
openList: [],//
typeList:this.$store.state.typeList
@ -174,6 +175,32 @@ return num
},
};
this.changeBtn(this.numberList[this.active], dataNum);
},
//inputData
getSaveCountData(){
for (var i = 0; i < 48; i++) {
this.typeList.forEach((el, index) => {
if (el.value == this.inputData[this.numberList[i]]) {
if(el.countType==0){
this.inputData[this.numberList[i] + 2]=this.inputDataNew[this.numberList[i] + 2]
this.inputData[this.numberList[i] + 4]=this.inputDataNew[this.numberList[i] + 4]
}else if(el.countType==1){
this.inputData[this.numberList[i] + 2]=this.sendCountType1(this.inputDataNew[this.numberList[i] + 2])
this.inputData[this.numberList[i] + 4]=this.sendCountType1(this.inputDataNew[this.numberList[i] + 4])
}else if(el.countType==2){
this.inputData[this.numberList[i] + 2]=this.sendCountType2(this.inputDataNew[this.numberList[i] + 2])
this.inputData[this.numberList[i] + 4]=this.sendCountType2(this.inputDataNew[this.numberList[i] + 4])
}else if(el.countType==3){
this.inputData[this.numberList[i] + 2]=this.sendCountType3(this.inputDataNew[this.numberList[i] + 2])
this.inputData[this.numberList[i] + 4]=this.sendCountType3(this.inputDataNew[this.numberList[i] + 4])
}else if(el.countType==4){
this.inputData[this.numberList[i] + 2]=this.sendCountType4(this.inputDataNew[this.numberList[i] + 2])
this.inputData[this.numberList[i] + 4]=this.sendCountType4(this.inputDataNew[this.numberList[i] + 4])
}
}
})
}
},
//
getCountData(){
@ -181,19 +208,20 @@ return num
this.typeList.forEach((el, index) => {
if (el.value == this.inputData[this.numberList[i]]) {
if(el.countType==0){
this.inputDataNew[this.numberList[i] + 2]=this.inputData[this.numberList[i] + 2]
this.inputDataNew[this.numberList[i] + 4]=this.inputData[this.numberList[i] + 4]
}else if(el.countType==1){
this.inputData[this.numberList[i] + 2]=this.countType1(this.inputData[this.numberList[i] + 2])
this.inputData[this.numberList[i] + 4]=this.countType1(this.inputData[this.numberList[i] + 4])
this.inputDataNew[this.numberList[i] + 2]=this.countType1(this.inputData[this.numberList[i] + 2])
this.inputDataNew[this.numberList[i] + 4]=this.countType1(this.inputData[this.numberList[i] + 4])
}else if(el.countType==2){
this.inputData[this.numberList[i] + 2]=this.countType2(this.inputData[this.numberList[i] + 2])
this.inputData[this.numberList[i] + 4]=this.countType2(this.inputData[this.numberList[i] + 4])
this.inputDataNew[this.numberList[i] + 2]=this.countType2(this.inputData[this.numberList[i] + 2])
this.inputDataNew[this.numberList[i] + 4]=this.countType2(this.inputData[this.numberList[i] + 4])
}else if(el.countType==3){
this.inputData[this.numberList[i] + 2]=this.countType3(this.inputData[this.numberList[i] + 2])
this.inputData[this.numberList[i] + 4]=this.countType3(this.inputData[this.numberList[i] + 4])
this.inputDataNew[this.numberList[i] + 2]=this.countType3(this.inputData[this.numberList[i] + 2])
this.inputDataNew[this.numberList[i] + 4]=this.countType3(this.inputData[this.numberList[i] + 4])
}else if(el.countType==4){
this.inputData[this.numberList[i] + 2]=this.countType4(this.inputData[this.numberList[i] + 2])
this.inputData[this.numberList[i] + 4]=this.countType4(this.inputData[this.numberList[i] + 4])
this.inputDataNew[this.numberList[i] + 2]=this.countType4(this.inputData[this.numberList[i] + 2])
this.inputDataNew[this.numberList[i] + 4]=this.countType4(this.inputData[this.numberList[i] + 4])
}
}
@ -256,7 +284,8 @@ return num
};
this.api.postReg(data).then((res) => {
if (res.data.code == 200) {
this.inputData = res.data.data;
this.inputData = JSON.parse(JSON.stringify(res.data.data));
this.inputDataNew = res.data.data;
this.getData272()
this.getSensorType()
this.getCountData()
@ -387,7 +416,17 @@ getSendData(number){
type: "success",
});
store.nowInput=''
this.getSaveCountData()
// this.dataInit();
for (var i = 0; i < 48; i++) {
if(this.numberList[i]==data.regAddress){
this.inputData[this.numberList[i]]=data.num
}
}
this.getCountData()
} else {
this.inputData[data.regAddress]=store.nowInput
this.$message.error(res.data.msg);