Merge pull request 'pc-master' (#93) from pc-master into portal
Reviewed-on: #93
This commit is contained in:
		
						commit
						4cf5350e16
					
				@ -1138,7 +1138,7 @@
 | 
			
		||||
  color: #859BB6;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.systemSet .system-tips {
 | 
			
		||||
.system-tips {
 | 
			
		||||
  background: rgba(0, 92, 178, 0.15);
 | 
			
		||||
  border: 2px solid rgba(0, 186, 255, 0.2);
 | 
			
		||||
  width: 100%;
 | 
			
		||||
@ -3336,6 +3336,11 @@
 | 
			
		||||
  margin-right: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.systemSet-con {
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  height: 100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.el-button span {
 | 
			
		||||
  color: #606266;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								src/assets/css/main.min.css
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/assets/css/main.min.css
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -1184,19 +1184,17 @@
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.systemSet {
 | 
			
		||||
    .system-tips {
 | 
			
		||||
        background: rgba(0, 92, 178, 0.15);
 | 
			
		||||
        border: 2px solid rgba(0, 186, 255, 0.20);
 | 
			
		||||
        width: 100%;
 | 
			
		||||
        padding: 20px;
 | 
			
		||||
        font-size: 14px;
 | 
			
		||||
        font-family: Microsoft YaHei;
 | 
			
		||||
        font-weight: 400;
 | 
			
		||||
        color: #A8B6C8;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.system-tips {
 | 
			
		||||
    background: rgba(0, 92, 178, 0.15);
 | 
			
		||||
    border: 2px solid rgba(0, 186, 255, 0.20);
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    padding: 20px;
 | 
			
		||||
    font-size: 14px;
 | 
			
		||||
    font-family: Microsoft YaHei;
 | 
			
		||||
    font-weight: 400;
 | 
			
		||||
    color: #A8B6C8;
 | 
			
		||||
}
 | 
			
		||||
.upload {
 | 
			
		||||
    .upload-view {
 | 
			
		||||
        width: 520px;
 | 
			
		||||
@ -3537,7 +3535,13 @@
 | 
			
		||||
       
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
.systemSet-con{
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    .page-content{
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
.el-button span {
 | 
			
		||||
 | 
			
		||||
    color: #606266;
 | 
			
		||||
 | 
			
		||||
@ -355,6 +355,7 @@ export default {
 | 
			
		||||
            ], router: "internalInsulation",
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
        this.routerList.push( { name: '系统参数配置', list: [], router: 'systemSet-con', isRouter: true, },);
 | 
			
		||||
        setTimeout(() => {
 | 
			
		||||
          var router = this.$route.query
 | 
			
		||||
        if (router.token && router.userid){
 | 
			
		||||
 | 
			
		||||
@ -195,6 +195,10 @@ const routes = [
 | 
			
		||||
        path: '/exitSettings',
 | 
			
		||||
        name: 'exitSettings',
 | 
			
		||||
        component: () => import('../views/page/exitSettings.vue')
 | 
			
		||||
      },{
 | 
			
		||||
        path: '/systemSet-con',
 | 
			
		||||
        name: 'systemSet-con',
 | 
			
		||||
        component: () => import('../views/page/systemSet-con.vue')
 | 
			
		||||
      },]
 | 
			
		||||
    },]
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
@ -62,7 +62,7 @@ export default {
 | 
			
		||||
            headerList: [
 | 
			
		||||
                { name: '实时数据', router: 'realTime', routerList: ['realTime'], img: require('../assets/image/header-img1.png') },
 | 
			
		||||
                // { name: '设定值参数', router: 'status', index: 1, routerList: ['formula', 'irrigateSet', 'PIDSet', 'systemSet', 'upload', 'sensorSet'], img: require('../assets/image/header-img0.png') },
 | 
			
		||||
                { name: '设定值参数', router: 'status', index: 1, routerList: ['status','exitSettings', 'skylight', 'fan', 'upload-con', 'sensorSet-con','alarmSettings', 'synthesis-con','waterPump', 'geothermalFan', 'uptake', 'downtake', 'rollByRoll', 'snowRemoval',"targetTemperature", "targetHumidity", "targetCo2", "sunroofControl", "outsizeSunshade", "insizeSunshade", "wetFan", "LED", 'electromagneticControl', "coercionMist", "circulationCan", "internalInsulation", "forceOutput", "intrinsicParameter", "parameterSet",], img: require('../assets/image/header-img0.png') },
 | 
			
		||||
                { name: '设定值参数', router: 'status', index: 1, routerList: ['status','exitSettings', 'skylight','systemSet-con', 'fan', 'upload-con', 'sensorSet-con','alarmSettings', 'synthesis-con','waterPump', 'geothermalFan', 'uptake', 'downtake', 'rollByRoll', 'snowRemoval',"targetTemperature", "targetHumidity", "targetCo2", "sunroofControl", "outsizeSunshade", "insizeSunshade", "wetFan", "LED", 'electromagneticControl', "coercionMist", "circulationCan", "internalInsulation", "forceOutput", "intrinsicParameter", "parameterSet",], img: require('../assets/image/header-img0.png') },
 | 
			
		||||
                { name: '设备菜单', router: '', routerList: [], img: require('../assets/image/header-img1.png') },
 | 
			
		||||
                { name: '视频监控', router: '', routerList: [], img: require('../assets/image/header-img2.png') },
 | 
			
		||||
                //  history history
 | 
			
		||||
@ -79,7 +79,7 @@ export default {
 | 
			
		||||
            activeNames: [3],
 | 
			
		||||
            leftList: [
 | 
			
		||||
                { name: '首页', img: require('../assets/image/index-icon.png'), list: [], router: 'realTime', isRouter: true, },
 | 
			
		||||
                { name: '温室', routerList: ['realTime','exitSettings', 'skylight', 'control', 'fan', 'upload-con', 'sensorSet-con', 'synthesis-con','alarmSettings', 'waterPump', 'geothermalFan', 'uptake', 'downtake', 'rollByRoll', 'snowRemoval', "targetTemperature", "targetHumidity", "targetCo2", "sunroofControl", "outsizeSunshade", "insizeSunshade", "wetFan", "LED", 'electromagneticControl', "coercionMist", "circulationCan", "internalInsulation", "forceOutput", "intrinsicParameter", "parameterSet"], img: require('../assets/image/left-img0.png'), list: [] },
 | 
			
		||||
                { name: '温室', routerList: ['realTime','exitSettings', 'skylight', 'control','systemSet-con', 'fan', 'upload-con', 'sensorSet-con', 'synthesis-con','alarmSettings', 'waterPump', 'geothermalFan', 'uptake', 'downtake', 'rollByRoll', 'snowRemoval', "targetTemperature", "targetHumidity", "targetCo2", "sunroofControl", "outsizeSunshade", "insizeSunshade", "wetFan", "LED", 'electromagneticControl', "coercionMist", "circulationCan", "internalInsulation", "forceOutput", "intrinsicParameter", "parameterSet"], img: require('../assets/image/left-img0.png'), list: [] },
 | 
			
		||||
                // { name: '二号温室', img: require('../assets/image/left-img1.png'), list: [] },
 | 
			
		||||
                { name: '施肥机', routerList: ['formula', 'irrigateSet', 'PIDSet', 'systemSet', 'upload', 'sensorSet', 'realTime', 'history', 'dataAnalysis'], img: require('../assets/image/left-img2.png'), list: [] },],
 | 
			
		||||
            routerNow: 'realTime',
 | 
			
		||||
 | 
			
		||||
@ -43,6 +43,15 @@
 | 
			
		||||
                五号风组
 | 
			
		||||
            </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="flex-view padding-none">
 | 
			
		||||
            <div class="input-main-80" style="width: auto;">
 | 
			
		||||
        <span>温度确认时间</span>
 | 
			
		||||
        <input @blur="blurChange('21665', $event)" v-model="inputData['21665']" @input="change('21665', $event)"
 | 
			
		||||
          type="text" value="60" placeholder="60" />
 | 
			
		||||
        <span>分钟</span>
 | 
			
		||||
      </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="bold-title">通道输入信号类型</div>
 | 
			
		||||
        <div class="input-100-view">
 | 
			
		||||
 | 
			
		||||
@ -44,7 +44,7 @@
 | 
			
		||||
                        <img :src="item.img" alt="">
 | 
			
		||||
                        <div>
 | 
			
		||||
                            <div class="text">{{ item.name }}</div>
 | 
			
		||||
                            <div class="number" :class="item.num=='无效'?'red':''">{{ item.num }}</div>
 | 
			
		||||
                            <div class="number" :class="item.num=='故障'?'red':''">{{ item.num }}</div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </vue-seamless>
 | 
			
		||||
@ -810,7 +810,7 @@ export default {
 | 
			
		||||
                                    //     num=this.countType3(el.environmentData)+el1.unit
 | 
			
		||||
                                    //    }else{
 | 
			
		||||
                                        if(el.equipmentStart==0){
 | 
			
		||||
                                        num='无效'
 | 
			
		||||
                                        num='故障'
 | 
			
		||||
                                    }else{
 | 
			
		||||
                                        num = el.environmentData + el1.unit
 | 
			
		||||
                                    }
 | 
			
		||||
@ -910,7 +910,7 @@ export default {
 | 
			
		||||
                                    //    }else{
 | 
			
		||||
                                  
 | 
			
		||||
                                    if(el.equipmentStart==0){
 | 
			
		||||
                                        num='无效'
 | 
			
		||||
                                        num='故障'
 | 
			
		||||
                                    }else{
 | 
			
		||||
                                        num = el.environmentData + el1.unit
 | 
			
		||||
                                    }
 | 
			
		||||
@ -954,7 +954,7 @@ export default {
 | 
			
		||||
                                    // console.log(el1);
 | 
			
		||||
                                    var num=0
 | 
			
		||||
                                    if(el.equipmentStart==0){
 | 
			
		||||
                                        num='无效'
 | 
			
		||||
                                        num='故障'
 | 
			
		||||
                                    }else{
 | 
			
		||||
                                        num = el.environmentData + el1.unit
 | 
			
		||||
                                    }
 | 
			
		||||
@ -1018,7 +1018,7 @@ export default {
 | 
			
		||||
                                    // console.log(el1);
 | 
			
		||||
                                    var num=0
 | 
			
		||||
                                    if(el.equipmentStart==0){
 | 
			
		||||
                                        num='无效'
 | 
			
		||||
                                        num='故障'
 | 
			
		||||
                                    }else{
 | 
			
		||||
                                        num = el.environmentData + el1.unit
 | 
			
		||||
                                    }
 | 
			
		||||
 | 
			
		||||
@ -43,6 +43,12 @@
 | 
			
		||||
        <div v-else class="sel"></div>
 | 
			
		||||
        有雨量桶检测
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="input-main-80" style="width: auto;">
 | 
			
		||||
        <span>温度确认时间</span>
 | 
			
		||||
        <input @blur="blurChange('21666', $event)" v-model="inputData['21666']" @input="change('21666', $event)"
 | 
			
		||||
          type="text" value="60" placeholder="60" />
 | 
			
		||||
        <span>分钟</span>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="flex-view  border-bottom">
 | 
			
		||||
      <div class="input-main border-right">
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										233
									
								
								src/views/page/systemSet-con.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										233
									
								
								src/views/page/systemSet-con.vue
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,233 @@
 | 
			
		||||
<template>
 | 
			
		||||
    <div class="systemSet-con">
 | 
			
		||||
        <div class="table-title">
 | 
			
		||||
            <img src="../../assets/image/system.png" alt=""> 系统参数设置
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="flex-view border-none padding-none">
 | 
			
		||||
            <div class="input-main-80" style="width: auto;">
 | 
			
		||||
                <span>软件版本号</span>
 | 
			
		||||
                <input v-model="inputData['1163']" disabled type="text" placeholder="0">
 | 
			
		||||
 | 
			
		||||
                <span></span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="input-main">
 | 
			
		||||
                <span>施肥机状况</span>
 | 
			
		||||
                <input v-model="inputData['1164']" disabled type="text" placeholder="0">
 | 
			
		||||
                <span></span>
 | 
			
		||||
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="input-main-80" style="width: auto;">
 | 
			
		||||
                <span>施肥机剩余使用时间</span>
 | 
			
		||||
                <input v-model="inputData['1165']" disabled type="text" placeholder="0">
 | 
			
		||||
                <span>天</span>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="flex-view">
 | 
			
		||||
          
 | 
			
		||||
            <div class="input-main">
 | 
			
		||||
                <span>信号质量</span>
 | 
			
		||||
                <input @blur="blurChange('1061', $event)" v-model="inputData['1061']" @input="change('1061', $event)"
 | 
			
		||||
                    type="number" placeholder="0">
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="input-main">
 | 
			
		||||
                <span>SIM</span>
 | 
			
		||||
                <input @blur="blurChange('1062', $event)" v-model="inputData['1062']" @input="change('1062', $event)"
 | 
			
		||||
                    type="number" placeholder="0">
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="input-main">
 | 
			
		||||
                <span>4G</span>
 | 
			
		||||
                <input @blur="blurChange('1063', $event)" v-model="inputData['1063']" @input="change('1063', $event)"
 | 
			
		||||
                    type="number" placeholder="0">
 | 
			
		||||
            </div>
 | 
			
		||||
            <br>
 | 
			
		||||
            <div class="input-main-80" style="width: 100%;">
 | 
			
		||||
                <span>IP</span>
 | 
			
		||||
                <input @blur="blurChange('1064', $event)" v-model="inputData['1064']" @input="change('1064', $event)"
 | 
			
		||||
                    type="number" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1065', $event)" v-model="inputData['1065']" @input="change('1065', $event)"
 | 
			
		||||
                    type="number" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1066', $event)" v-model="inputData['1066']" @input="change('1066', $event)"
 | 
			
		||||
                    type="number" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1067', $event)" v-model="inputData['1067']" @input="change('1067', $event)"
 | 
			
		||||
                    type="number" placeholder="0">
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="flex-view" style="border: none;">
 | 
			
		||||
 | 
			
		||||
            <div class="input-main-80">
 | 
			
		||||
                <span>ICCID</span>
 | 
			
		||||
                <input @blur="blurChange('1051', $event)" v-model="inputData['1051']" @input="change16to10('1051', $event)"
 | 
			
		||||
                    type="text" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1052', $event)" v-model="inputData['1052']" @input="change16to10('1052', $event)"
 | 
			
		||||
                    type="text" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1053', $event)" v-model="inputData['1053']" @input="change16to10('1053', $event)"
 | 
			
		||||
                    type="text" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1054', $event)" v-model="inputData['1054']" @input="change16to10('1054', $event)"
 | 
			
		||||
                    type="text" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1055', $event)" v-model="inputData['1055']" @input="change16to10('1055', $event)"
 | 
			
		||||
                    type="text" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1056', $event)" v-model="inputData['1056']" @input="change16to10('1056', $event)"
 | 
			
		||||
                    type="text" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1057', $event)" v-model="inputData['1057']" @input="change16to10('1057', $event)"
 | 
			
		||||
                    type="text" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1058', $event)" v-model="inputData['1058']" @input="change16to10('1058', $event)"
 | 
			
		||||
                    type="text" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1059', $event)" v-model="inputData['1059']" @input="change16to10('1059', $event)"
 | 
			
		||||
                    type="text" placeholder="0">
 | 
			
		||||
                <input @blur="blurChange('1060', $event)" v-model="inputData['1060']" @input="change16to10('1060', $event)"
 | 
			
		||||
                    type="text" placeholder="0">
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="system-tips">
 | 
			
		||||
                说明:4G:=0,无网络;=2,2G网络;=4,4G网络 <br>
 | 
			
		||||
                SIM:=0,SIM卡正常;=1,无SIM卡;=2,SIM卡异常(网络注册失败)<br>
 | 
			
		||||
                信号质量:CSQ<11 信号很差;11<CSQ<18,信号不稳定;CSQ>18,信号稳定,最大是31.
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import setParams from '../../components/setParams.vue';
 | 
			
		||||
export default {
 | 
			
		||||
    components: {
 | 
			
		||||
        setParams
 | 
			
		||||
    },
 | 
			
		||||
    data() {
 | 
			
		||||
        return {
 | 
			
		||||
            inputData: []
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    mounted() {
 | 
			
		||||
        this.dataInit()
 | 
			
		||||
        //input获取焦点后全选
 | 
			
		||||
        let inputList = document.querySelectorAll('input');
 | 
			
		||||
        for (let index = 0; index < inputList.length; index++) {
 | 
			
		||||
            inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
        change16to10(code, el) {
 | 
			
		||||
            var num = parseInt(el.target.value, 16)
 | 
			
		||||
            var dataNum = {
 | 
			
		||||
                target: {
 | 
			
		||||
                    value: num
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            this.change(code, dataNum)
 | 
			
		||||
        },
 | 
			
		||||
        fliter2(string) {
 | 
			
		||||
            var data = ''
 | 
			
		||||
            if (string.length < 2) {
 | 
			
		||||
                data = '0' + string
 | 
			
		||||
            } else {
 | 
			
		||||
                data = string
 | 
			
		||||
            }
 | 
			
		||||
            return data
 | 
			
		||||
        },
 | 
			
		||||
        dataInit() {
 | 
			
		||||
            var store = this.$store.state
 | 
			
		||||
            var data = {
 | 
			
		||||
                deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
 | 
			
		||||
            };
 | 
			
		||||
            this.api.getControlGetState(data).then((res) => {
 | 
			
		||||
                if (res.data.code == 200) {
 | 
			
		||||
                    this.inputData = res.data.data;
 | 
			
		||||
                    this.inputData['1051'] = this.fliter2(this.inputData['1051'].toString(16))
 | 
			
		||||
                    this.inputData['1052'] = this.fliter2(this.inputData['1052'].toString(16))
 | 
			
		||||
                    this.inputData['1053'] = this.fliter2(this.inputData['1053'].toString(16))
 | 
			
		||||
                    this.inputData['1054'] = this.fliter2(this.inputData['1054'].toString(16))
 | 
			
		||||
                    this.inputData['1055'] = this.fliter2(this.inputData['1055'].toString(16))
 | 
			
		||||
                    this.inputData['1056'] = this.fliter2(this.inputData['1056'].toString(16))
 | 
			
		||||
                    this.inputData['1057'] = this.fliter2(this.inputData['1057'].toString(16))
 | 
			
		||||
                    this.inputData['1058'] = this.fliter2(this.inputData['1058'].toString(16))
 | 
			
		||||
                    this.inputData['1059'] = this.fliter2(this.inputData['1059'].toString(16))
 | 
			
		||||
                    this.inputData['1060'] = this.fliter2(this.inputData['1060'].toString(16))
 | 
			
		||||
                    this.inputData['1163'] = 'REV:' + this.inputData['1163']
 | 
			
		||||
                    this.inputData['1164'] = this.getType(this.inputData['1164'])
 | 
			
		||||
                } else {
 | 
			
		||||
                    this.$message.error(res.data.msg);
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
        },
 | 
			
		||||
        getType(index) {
 | 
			
		||||
            if (index == 0) {
 | 
			
		||||
                return '施肥机正常'
 | 
			
		||||
            } else if (index == 1) {
 | 
			
		||||
                return '施肥机待锁机'
 | 
			
		||||
            } else if (index == 2) {
 | 
			
		||||
                return '施肥机已锁机'
 | 
			
		||||
            } else {
 | 
			
		||||
                return ' '
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        //全选文本
 | 
			
		||||
        selectValue(e) {
 | 
			
		||||
            var store = this.$store.state
 | 
			
		||||
            store.nowInput = e.target.value
 | 
			
		||||
            e.currentTarget.select();
 | 
			
		||||
        },
 | 
			
		||||
        //失去焦点
 | 
			
		||||
        blurChange(code, el) {
 | 
			
		||||
            var store = this.$store.state;
 | 
			
		||||
            var data = {
 | 
			
		||||
                equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
 | 
			
		||||
                regAddress: code,
 | 
			
		||||
                num: el.target.value,
 | 
			
		||||
            }; //避免开启多个计时器
 | 
			
		||||
            if (store.nowInput != el.target.value) {
 | 
			
		||||
                this.changeData(data);
 | 
			
		||||
            }
 | 
			
		||||
            // if (this.timer) {
 | 
			
		||||
            //     this.timer && clearInterval(this.timer);
 | 
			
		||||
            //     this.changeData(data);
 | 
			
		||||
            // }
 | 
			
		||||
 | 
			
		||||
        },
 | 
			
		||||
        change(code, el) {
 | 
			
		||||
            var store = this.$store.state
 | 
			
		||||
            var data = {
 | 
			
		||||
                equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
 | 
			
		||||
                regAddress: code,
 | 
			
		||||
                num: el.target.value,
 | 
			
		||||
            };
 | 
			
		||||
            this.delayTimer(0, data);
 | 
			
		||||
        },
 | 
			
		||||
        //限制 写入停止后j*100毫秒调取函数
 | 
			
		||||
        delayTimer(i, data) {
 | 
			
		||||
            // const that = this;
 | 
			
		||||
            // //整体接口
 | 
			
		||||
            // let j = this.$store.state.lateSend;
 | 
			
		||||
            // //避免开启多个计时器
 | 
			
		||||
            // this.timer && clearInterval(this.timer);
 | 
			
		||||
 | 
			
		||||
            // this.timer = setInterval(() => {
 | 
			
		||||
            //     ++i;
 | 
			
		||||
            //     if (i == j) {
 | 
			
		||||
            //         that.changeData(data);
 | 
			
		||||
            //         clearInterval(this.timer);
 | 
			
		||||
            //     }
 | 
			
		||||
            // }, 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",
 | 
			
		||||
                    });
 | 
			
		||||
                    store.nowInput = "";
 | 
			
		||||
                    // this.dataInit();
 | 
			
		||||
                } else {
 | 
			
		||||
                    this.inputData[data.regAddress] = store.nowInput;
 | 
			
		||||
                    this.$message.error(res.data.msg);
 | 
			
		||||
                }
 | 
			
		||||
                this.timer = null;
 | 
			
		||||
            });
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss"></style>
 | 
			
		||||
    
 | 
			
		||||
@ -5,6 +5,25 @@
 | 
			
		||||
            <div class="table-title">
 | 
			
		||||
                <img src="../../assets/image/system.png" alt=""> 系统参数设置
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="flex-view border-none padding-none">
 | 
			
		||||
            <div class="input-main-80" style="width: auto;">
 | 
			
		||||
                <span>软件版本号</span>
 | 
			
		||||
                <input v-model="inputData['76']" disabled type="text" placeholder="0">
 | 
			
		||||
 | 
			
		||||
                <span></span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="input-main">
 | 
			
		||||
                <span>施肥机状况</span>
 | 
			
		||||
                <input v-model="inputData['77']" disabled type="text" placeholder="0">
 | 
			
		||||
                <span></span>
 | 
			
		||||
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="input-main-80" style="width: auto;">
 | 
			
		||||
                <span>施肥机剩余使用时间</span>
 | 
			
		||||
                <input v-model="inputData['78']" disabled type="text" placeholder="0">
 | 
			
		||||
                <span>天</span>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
            <div class="flex-view">
 | 
			
		||||
                <div class="input-main">
 | 
			
		||||
                    <span>信号质量</span>
 | 
			
		||||
@ -110,12 +129,24 @@ export default {
 | 
			
		||||
                    this.inputData['62']=  this.fliter2(this.inputData['62'].toString(16))
 | 
			
		||||
                    this.inputData['63']=  this.fliter2(this.inputData['63'].toString(16))
 | 
			
		||||
                    this.inputData['64']=  this.fliter2(this.inputData['64'].toString(16))
 | 
			
		||||
                  
 | 
			
		||||
                    this.inputData['76'] = 'REV:' + this.inputData['76']
 | 
			
		||||
                    this.inputData['77'] = this.getType(this.inputData['77'])
 | 
			
		||||
                } else {
 | 
			
		||||
                    this.$message.error(res.data.msg);
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
        },
 | 
			
		||||
        getType(index) {
 | 
			
		||||
            if (index == 0) {
 | 
			
		||||
                return '施肥机正常'
 | 
			
		||||
            } else if (index == 1) {
 | 
			
		||||
                return '施肥机待锁机'
 | 
			
		||||
            } else if (index == 2) {
 | 
			
		||||
                return '施肥机已锁机'
 | 
			
		||||
            } else {
 | 
			
		||||
                return ' '
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
    //全选文本
 | 
			
		||||
    selectValue(e) {
 | 
			
		||||
      var store = this.$store.state
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user