pc-master #24
@ -58,9 +58,9 @@
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="input-main">
 | 
			
		||||
                            <div>标定低点数据</div>
 | 
			
		||||
                            <input @blur="blurChange(20904 + (active * 5 + 2), $event)"
 | 
			
		||||
                            <input @blur="blurChange1(20904 + (active * 5 + 2), $event)"
 | 
			
		||||
                                v-model="inputData[20904 + (active * 5 + 2)]"
 | 
			
		||||
                                @input="change(20904 + (active * 5 + 2), $event)" type="number" placeholder="0.0">
 | 
			
		||||
                                @input="change1(20904 + (active * 5 + 2), $event)" type="number" placeholder="0.0">
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div>
 | 
			
		||||
@ -72,9 +72,9 @@
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="input-main">
 | 
			
		||||
                            <div>标定高点数据</div>
 | 
			
		||||
                            <input @blur="blurChange(20904 + (active * 5 + 4), $event)"
 | 
			
		||||
                            <input @blur="blurChange1(20904 + (active * 5 + 4), $event)"
 | 
			
		||||
                                v-model="inputData[20904 + (active * 5 + 4)]"
 | 
			
		||||
                                @input="change(20904 + (active * 5 + 4), $event)" type="number" placeholder="0.0">
 | 
			
		||||
                                @input="change1(20904 + (active * 5 + 4), $event)" type="number" placeholder="0.0">
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
@ -119,6 +119,7 @@ export default {
 | 
			
		||||
    watch: {
 | 
			
		||||
        'active'(newVal, oldVal) {
 | 
			
		||||
            this.getSensorType()
 | 
			
		||||
            this.getCountData()
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
    mounted() {
 | 
			
		||||
@ -130,6 +131,39 @@ export default {
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
          //countType计算类型 
 | 
			
		||||
        //0是原数据 
 | 
			
		||||
        //1是原数据-400 
 | 
			
		||||
        //2是原数据/10 
 | 
			
		||||
        //3是(原数据-400) / 10
 | 
			
		||||
        countType1(data) {
 | 
			
		||||
            var num = data - 400
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        countType2(data) {
 | 
			
		||||
            var num = data / 10
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        countType3(data) {
 | 
			
		||||
 | 
			
		||||
            var num = (data - 400) / 10
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        //反向计算提交
 | 
			
		||||
        sendCountType1(data) {
 | 
			
		||||
            var num = data + 400
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        sendCountType2(data) {
 | 
			
		||||
            var num = data * 10
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        sendCountType3(data) {
 | 
			
		||||
 | 
			
		||||
            var num = (data* 10)+400
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        
 | 
			
		||||
        //类型选择
 | 
			
		||||
        handleCommand(command) {
 | 
			
		||||
            this.typeList.forEach((el, index) => {
 | 
			
		||||
@ -144,6 +178,26 @@ export default {
 | 
			
		||||
            };
 | 
			
		||||
            this.changeBtn(20904 + (this.active * 5), dataNum);
 | 
			
		||||
        },
 | 
			
		||||
        //根据类型修改数据
 | 
			
		||||
        getCountData(){
 | 
			
		||||
            this.typeList.forEach((el, index) => {
 | 
			
		||||
                if (el.value == this.inputData[20904 + (this.active * 5)]) {
 | 
			
		||||
                   if(el.countType==0){
 | 
			
		||||
 | 
			
		||||
                   }else if(el.countType==1){
 | 
			
		||||
                    this.inputData[20904 + (this.active * 5 + 2)]=this.countType1(this.inputData[20904 + (this.active * 5 + 2)])
 | 
			
		||||
                   this.inputData[20904 + (this.active * 5 + 4)]=this.countType1(this.inputData[20904 + (this.active * 5 + 4)])
 | 
			
		||||
                   }else if(el.countType==2){
 | 
			
		||||
                    this.inputData[20904 + (this.active * 5 + 2)]=this.countType2(this.inputData[20904 + (this.active * 5 + 2)])
 | 
			
		||||
                   this.inputData[20904 + (this.active * 5 + 4)]=this.countType2(this.inputData[20904 + (this.active * 5 + 4)])
 | 
			
		||||
                   }else if(el.countType==3){
 | 
			
		||||
                    this.inputData[20904 + (this.active * 5 + 2)]=this.countType3(this.inputData[20904 + (this.active * 5 + 2)])
 | 
			
		||||
                   this.inputData[20904 + (this.active * 5 + 4)]=this.countType3(this.inputData[20904 + (this.active * 5 + 4)])
 | 
			
		||||
                   }
 | 
			
		||||
                  
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
        },
 | 
			
		||||
        getSensorType() {
 | 
			
		||||
            this.typeList.forEach((el, index) => {
 | 
			
		||||
                if (el.value == this.inputData[20904 + (this.active * 5)]) {
 | 
			
		||||
@ -294,6 +348,7 @@ export default {
 | 
			
		||||
                    // this.getData272()
 | 
			
		||||
                    this.getOpen()
 | 
			
		||||
                    this.getSensorType()
 | 
			
		||||
                    this.getCountData()
 | 
			
		||||
                } else {
 | 
			
		||||
                    this.$message.error(res.data.msg);
 | 
			
		||||
                }
 | 
			
		||||
@ -303,6 +358,47 @@ export default {
 | 
			
		||||
        selectValue(e) {
 | 
			
		||||
            e.currentTarget.select();
 | 
			
		||||
        },
 | 
			
		||||
        getSendData(number){
 | 
			
		||||
            var number1=number
 | 
			
		||||
            this.typeList.some((el, index)  => {
 | 
			
		||||
                if (el.value == this.inputData[20904 + (this.active * 5)]) {
 | 
			
		||||
                   if(el.countType==0){
 | 
			
		||||
                    number1=number
 | 
			
		||||
                   }else if(el.countType==1){
 | 
			
		||||
                    number1=this.sendCountType1(number)
 | 
			
		||||
                   }else if(el.countType==2){
 | 
			
		||||
                    number1=this.sendCountType2(number)
 | 
			
		||||
                   }else if(el.countType==3){
 | 
			
		||||
                    number1=this.sendCountType3(number)
 | 
			
		||||
                   }
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
            return number1
 | 
			
		||||
        },
 | 
			
		||||
        //需要反向计算提交
 | 
			
		||||
        change1(code, el) {
 | 
			
		||||
            var store = this.$store.state
 | 
			
		||||
            var data = {
 | 
			
		||||
                equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
 | 
			
		||||
                regAddress: code,
 | 
			
		||||
                num: this.getSendData(el.target.value),
 | 
			
		||||
            };
 | 
			
		||||
            this.delayTimer(0, data);
 | 
			
		||||
        },
 | 
			
		||||
        //需要反向计算提交
 | 
			
		||||
        blurChange1(code, el) {
 | 
			
		||||
            var store = this.$store.state
 | 
			
		||||
            var data = {
 | 
			
		||||
                equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
 | 
			
		||||
                regAddress: code,
 | 
			
		||||
                num:this.getSendData(el.target.value) ,
 | 
			
		||||
            }; //避免开启多个计时器
 | 
			
		||||
            if (this.timer) {
 | 
			
		||||
                this.timer && clearInterval(this.timer);
 | 
			
		||||
                this.changeData(data);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        },
 | 
			
		||||
        //失去焦点
 | 
			
		||||
        blurChange(code, el) {
 | 
			
		||||
            var store = this.$store.state
 | 
			
		||||
 | 
			
		||||
@ -60,8 +60,8 @@
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="input-main">
 | 
			
		||||
                                <div>标定低点数据</div>
 | 
			
		||||
                                <input @blur="blurChange(numberList[active] + 2, $event)" v-model="inputData[numberList[active] + 2]"
 | 
			
		||||
                                    @input="change(numberList[active] + 2, $event)"
 | 
			
		||||
                                <input @blur="blurChange1(numberList[active] + 2, $event)" v-model="inputData[numberList[active] + 2]"
 | 
			
		||||
                                    @input="change1(numberList[active] + 2, $event)"
 | 
			
		||||
                                     type="number" placeholder="0.0">
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
@ -74,8 +74,8 @@
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="input-main">
 | 
			
		||||
                                <div>标定高点数据</div>
 | 
			
		||||
                                <input @blur="blurChange(numberList[active] + 4, $event)" v-model="inputData[numberList[active] + 4]"
 | 
			
		||||
                                    @input="change(numberList[active] + 4 , $event)"
 | 
			
		||||
                                <input @blur="blurChange1(numberList[active] + 4, $event)" v-model="inputData[numberList[active] + 4]"
 | 
			
		||||
                                    @input="change1(numberList[active] + 4 , $event)"
 | 
			
		||||
                                     type="number" placeholder="0.0">
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
@ -107,6 +107,7 @@ export default {
 | 
			
		||||
    watch:{
 | 
			
		||||
        'active'(newVal,oldVal){
 | 
			
		||||
            this.getSensorType()
 | 
			
		||||
            this.getCountData()
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
    mounted() { 
 | 
			
		||||
@ -118,6 +119,38 @@ export default {
 | 
			
		||||
   }
 | 
			
		||||
        },
 | 
			
		||||
    methods: {
 | 
			
		||||
             //countType计算类型 
 | 
			
		||||
        //0是原数据 
 | 
			
		||||
        //1是原数据-400 
 | 
			
		||||
        //2是原数据/10 
 | 
			
		||||
        //3是(原数据-400) / 10
 | 
			
		||||
        countType1(data) {
 | 
			
		||||
            var num = data - 400
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        countType2(data) {
 | 
			
		||||
            var num = data / 10
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        countType3(data) {
 | 
			
		||||
 | 
			
		||||
            var num = (data - 400) / 10
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        //反向计算提交
 | 
			
		||||
        sendCountType1(data) {
 | 
			
		||||
            var num = data + 400
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        sendCountType2(data) {
 | 
			
		||||
            var num = data * 10
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        sendCountType3(data) {
 | 
			
		||||
 | 
			
		||||
            var num = (data* 10)+400
 | 
			
		||||
            return num
 | 
			
		||||
        },
 | 
			
		||||
        //类型选择
 | 
			
		||||
        handleCommand(command){
 | 
			
		||||
            this.typeList.forEach((el,index)=>{
 | 
			
		||||
@ -131,6 +164,26 @@ export default {
 | 
			
		||||
                },
 | 
			
		||||
            };
 | 
			
		||||
            this.changeBtn(this.numberList[this.active], dataNum);
 | 
			
		||||
        },
 | 
			
		||||
           //根据类型修改数据
 | 
			
		||||
           getCountData(){
 | 
			
		||||
            this.typeList.forEach((el, index) => {
 | 
			
		||||
                if (el.value == this.inputData[this.numberList[this.active]]) {
 | 
			
		||||
                   if(el.countType==0){
 | 
			
		||||
 | 
			
		||||
                   }else if(el.countType==1){
 | 
			
		||||
                    this.inputData[this.numberList[this.active] + 2]=this.countType1(this.inputData[this.numberList[this.active] + 2])
 | 
			
		||||
                   this.inputData[this.numberList[this.active] + 4]=this.countType1(this.inputData[this.numberList[this.active] + 4])
 | 
			
		||||
                   }else if(el.countType==2){
 | 
			
		||||
                    this.inputData[this.numberList[this.active] + 2]=this.countType2(this.inputData[this.numberList[this.active] + 2])
 | 
			
		||||
                   this.inputData[this.numberList[this.active] + 4]=this.countType2(this.inputData[this.numberList[this.active] + 4])
 | 
			
		||||
                   }else if(el.countType==3){
 | 
			
		||||
                    this.inputData[this.numberList[this.active] + 2]=this.countType3(this.inputData[this.numberList[this.active] + 2])
 | 
			
		||||
                   this.inputData[this.numberList[this.active] + 4]=this.countType3(this.inputData[this.numberList[this.active] + 4])
 | 
			
		||||
                   }
 | 
			
		||||
                  
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
        },
 | 
			
		||||
        getSensorType(){
 | 
			
		||||
            this.typeList.forEach((el,index)=>{
 | 
			
		||||
@ -191,6 +244,7 @@ export default {
 | 
			
		||||
                    this.inputData = res.data.data;
 | 
			
		||||
                    this.getData272()
 | 
			
		||||
                    this.getSensorType()
 | 
			
		||||
                    this.getCountData()
 | 
			
		||||
                } else {
 | 
			
		||||
                    this.$message.error(res.data.msg);
 | 
			
		||||
                }
 | 
			
		||||
@ -200,6 +254,47 @@ export default {
 | 
			
		||||
selectValue(e) {
 | 
			
		||||
	e.currentTarget.select();
 | 
			
		||||
},
 | 
			
		||||
getSendData(number){
 | 
			
		||||
            var number1=number
 | 
			
		||||
            this.typeList.some((el, index)  => {
 | 
			
		||||
                if (el.value == this.inputData[this.numberList[this.active]]) {
 | 
			
		||||
                   if(el.countType==0){
 | 
			
		||||
                    number1=number
 | 
			
		||||
                   }else if(el.countType==1){
 | 
			
		||||
                    number1=this.sendCountType1(number)
 | 
			
		||||
                   }else if(el.countType==2){
 | 
			
		||||
                    number1=this.sendCountType2(number)
 | 
			
		||||
                   }else if(el.countType==3){
 | 
			
		||||
                    number1=this.sendCountType3(number)
 | 
			
		||||
                   }
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
            return number1
 | 
			
		||||
        },
 | 
			
		||||
        //需要反向计算提交
 | 
			
		||||
        change1(code, el) {
 | 
			
		||||
            var store = this.$store.state
 | 
			
		||||
            var data = {
 | 
			
		||||
                equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
 | 
			
		||||
                regAddress: code,
 | 
			
		||||
                num: this.getSendData(el.target.value),
 | 
			
		||||
            };
 | 
			
		||||
            this.delayTimer(0, data);
 | 
			
		||||
        },
 | 
			
		||||
        //需要反向计算提交
 | 
			
		||||
        blurChange1(code, el) {
 | 
			
		||||
            var store = this.$store.state
 | 
			
		||||
            var data = {
 | 
			
		||||
                equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
 | 
			
		||||
                regAddress: code,
 | 
			
		||||
                num:this.getSendData(el.target.value) ,
 | 
			
		||||
            }; //避免开启多个计时器
 | 
			
		||||
            if (this.timer) {
 | 
			
		||||
                this.timer && clearInterval(this.timer);
 | 
			
		||||
                this.changeData(data);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        },
 | 
			
		||||
  //失去焦点
 | 
			
		||||
    blurChange(code, el) {
 | 
			
		||||
      var store=this.$store.state
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user