|
@@ -314,20 +314,27 @@
|
|
|
console.log(e)
|
|
|
},
|
|
|
add () {
|
|
|
- this.edit(this.modelDefault);
|
|
|
+ // this.edit(this.modelDefault);
|
|
|
},
|
|
|
edit (record) {
|
|
|
console.log(record)
|
|
|
this.model = Object.assign({}, record);
|
|
|
// 联锁条件
|
|
|
this.model.interlockConditionData = [record.interlockConditionDeviceId, record.interlockConditionModuleName, record.interlockConditionTag+'&'+record.interlockSetValue]
|
|
|
- // 仪表状态-仪表状态位号
|
|
|
- this.model.instrumentStatusData = [record.instrumentStatusDeviceId, record.instrumentStatusModuleName, record.instrumentStatusTag+'&'+record.instrumentStatusValue]
|
|
|
- // 仪表状态-原始模拟量位号
|
|
|
- this.model.ysmnlData = [record.ysmnlDeviceId, record.ysmnlModuleName, record.ysmnlTag+'&'+record.ysmnlValue]
|
|
|
- // 仪表状态-阈值Math.round解决相乘会出现很多小数的情况
|
|
|
- this.model.thresholdValueN = Math.round(parseInt(record.thresholdValue)*100)
|
|
|
- // this.model.thresholdValueN = (parseInt(record.thresholdValue)*100).toFixed(0)
|
|
|
+ // 仪表状态
|
|
|
+ if(record.instrumentStatusJuge === '0'){
|
|
|
+ // 仪表状态-仪表状态位号
|
|
|
+ this.model.instrumentStatusData = [record.instrumentStatusDeviceId, record.instrumentStatusModuleName, record.instrumentStatusTag+'&'+record.instrumentStatusValue]
|
|
|
+ }
|
|
|
+ if(this.model.instrumentStatusJuge === '1' || this.model.instrumentStatusJuge === '2'){
|
|
|
+ // 仪表状态-原始模拟量位号
|
|
|
+ this.model.ysmnlData = [record.ysmnlDeviceId, record.ysmnlModuleName, record.ysmnlTag+'&'+record.ysmnlValue]
|
|
|
+ }
|
|
|
+ if(this.model.instrumentStatusJuge === '2'){
|
|
|
+ // 仪表状态-阈值Math.round解决相乘会出现很多小数的情况
|
|
|
+ this.model.thresholdValueN = Math.round(parseInt(record.thresholdValue)*100)
|
|
|
+ // this.model.thresholdValueN = (parseInt(record.thresholdValue)*100).toFixed(0)
|
|
|
+ }
|
|
|
// 当前值
|
|
|
this.model.currentValueData = [record.currentValueDeviceId, record.currentValueModuleName, record.currentValueTag+'&'+record.currentValue]
|
|
|
// 旁路
|
|
@@ -358,18 +365,25 @@
|
|
|
this.model.interlockConditionModuleName = this.model.interlockConditionData[1]
|
|
|
this.model.interlockConditionTag = (this.model.interlockConditionData[2].split('&'))[0]
|
|
|
this.model.interlockSetValue = (this.model.interlockConditionData[2].split('&'))[1]
|
|
|
- // 仪表状态-仪表状态位号
|
|
|
- this.model.instrumentStatusDeviceId = this.model.instrumentStatusData[0]
|
|
|
- this.model.instrumentStatusModuleName = this.model.instrumentStatusData[1]
|
|
|
- this.model.instrumentStatusTag = (this.model.instrumentStatusData[2].split('&'))[0]
|
|
|
- this.model.instrumentStatusValue = (this.model.instrumentStatusData[2].split('&'))[1]
|
|
|
- // 仪表状态-原始模拟量位号
|
|
|
- this.model.ysmnlDeviceId = this.model.ysmnlData[0]
|
|
|
- this.model.ysmnlModuleName = this.model.ysmnlData[1]
|
|
|
- this.model.ysmnlTag = (this.model.ysmnlData[2].split('&'))[0]
|
|
|
- this.model.ysmnlValue = (this.model.ysmnlData[2].split('&'))[1]
|
|
|
- // 仪表状态-阈值--设置thresholdValueN是防止自身转换出现问题
|
|
|
- this.model.thresholdValue = parseInt(this.model.thresholdValueN)/100
|
|
|
+ // 仪表状态
|
|
|
+ if(this.model.instrumentStatusJuge === '0'){
|
|
|
+ // 仪表状态-仪表状态位号
|
|
|
+ this.model.instrumentStatusDeviceId = this.model.instrumentStatusData[0]
|
|
|
+ this.model.instrumentStatusModuleName = this.model.instrumentStatusData[1]
|
|
|
+ this.model.instrumentStatusTag = (this.model.instrumentStatusData[2].split('&'))[0]
|
|
|
+ this.model.instrumentStatusValue = (this.model.instrumentStatusData[2].split('&'))[1]
|
|
|
+ }
|
|
|
+ if(this.model.instrumentStatusJuge === '1' || this.model.instrumentStatusJuge === '2'){
|
|
|
+ // 仪表状态-原始模拟量位号
|
|
|
+ this.model.ysmnlDeviceId = this.model.ysmnlData[0]
|
|
|
+ this.model.ysmnlModuleName = this.model.ysmnlData[1]
|
|
|
+ this.model.ysmnlTag = (this.model.ysmnlData[2].split('&'))[0]
|
|
|
+ this.model.ysmnlValue = (this.model.ysmnlData[2].split('&'))[1]
|
|
|
+ }
|
|
|
+ if(this.model.instrumentStatusJuge === '2'){
|
|
|
+ // 仪表状态-阈值--设置thresholdValueN是防止自身转换出现问题
|
|
|
+ this.model.thresholdValue = parseInt(this.model.thresholdValueN)/100
|
|
|
+ }
|
|
|
|
|
|
// 当前值
|
|
|
this.model.currentValueDeviceId = this.model.currentValueData[0]
|
|
@@ -380,7 +394,7 @@
|
|
|
// 旁路位号
|
|
|
if(this.model.ifBypass === '0'){
|
|
|
// 否
|
|
|
- this.bypass = this.model.bypassNo
|
|
|
+ this.model.bypass = this.model.bypassNo
|
|
|
}
|
|
|
if(this.model.ifBypass === '0'){
|
|
|
// 是
|