pc-master #83
|
@ -281,6 +281,87 @@ export default {
|
|||
delMessage(data) {
|
||||
return sendDelRequest(`/shortMessage/delmesbyid`, data)
|
||||
},
|
||||
//控制器新页面接口
|
||||
//目标值 目标温度/湿度/co2
|
||||
targetValue(data) {
|
||||
return sendGetRequest(`/readControl/targetValue`, data)
|
||||
},
|
||||
//电磁阀1
|
||||
solenoidValve1(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve1`, data)
|
||||
},
|
||||
//电磁阀2
|
||||
solenoidValve2(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve2`, data)
|
||||
},
|
||||
//电磁阀3
|
||||
solenoidValve3(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve3`, data)
|
||||
},
|
||||
//电磁阀4
|
||||
solenoidValve4(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve4`, data)
|
||||
},
|
||||
//电磁阀5
|
||||
solenoidValve5(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve5`, data)
|
||||
},
|
||||
//电磁阀6
|
||||
solenoidValve6(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve6`, data)
|
||||
},
|
||||
//电磁阀7
|
||||
solenoidValve7(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve7`, data)
|
||||
},
|
||||
//电磁阀8
|
||||
solenoidValve8(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve8`, data)
|
||||
},
|
||||
//强制通道输出
|
||||
forceChannelOutput(data) {
|
||||
return sendGetRequest(`/readControl/forceChannelOutput`, data)
|
||||
},
|
||||
//天窗
|
||||
readskylight(data) {
|
||||
return sendGetRequest(`/readControl/readskylight`, data)
|
||||
},
|
||||
//固有参数
|
||||
intrinsicParameter(data) {
|
||||
return sendGetRequest(`/readControl/intrinsicParameter`, data)
|
||||
},
|
||||
//厂家内部参数
|
||||
manufacturerparameter(data) {
|
||||
return sendGetRequest(`/readControl/manufacturerparameter`, data)
|
||||
},
|
||||
//高压微雾
|
||||
highpressuremist(data) {
|
||||
return sendGetRequest(`/readControl/highpressuremist`, data)
|
||||
},
|
||||
//内遮阳
|
||||
innercurtain(data) {
|
||||
return sendGetRequest(`/readControl/innercurtain`, data)
|
||||
},
|
||||
//外遮阳
|
||||
externalsunshade(data) {
|
||||
return sendGetRequest(`/readControl/externalsunshade`, data)
|
||||
},
|
||||
//风机湿帘
|
||||
fanwetcurtain(data) {
|
||||
return sendGetRequest(`/readControl/fanwetcurtain`, data)
|
||||
},
|
||||
//补光灯
|
||||
readfilllight(data) {
|
||||
return sendGetRequest(`/readControl/readfilllight`, data)
|
||||
},
|
||||
//内保温
|
||||
interiorthermalinsulation(data) {
|
||||
return sendGetRequest(`/readControl/interiorthermalinsulation`, data)
|
||||
},
|
||||
//环流风扇
|
||||
readcirculationfan(data) {
|
||||
return sendGetRequest(`/readControl/readcirculationfan`, data)
|
||||
},
|
||||
|
||||
|
||||
//二维码溯源
|
||||
|
|
|
@ -686,6 +686,12 @@
|
|||
color: #859BB6;
|
||||
}
|
||||
|
||||
.outline {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.el-dropdown-menu {
|
||||
width: 300px;
|
||||
border: none;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -729,7 +729,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.outline{
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 24px;
|
||||
}
|
||||
.el-dropdown-menu {
|
||||
width: 300px;
|
||||
border: none;
|
||||
|
|
|
@ -117,6 +117,15 @@ export default {
|
|||
})
|
||||
}
|
||||
}
|
||||
// if (store.equipmentName['solenoid' + store.nameList[index]]) {
|
||||
// // store.equipmentName['fertilization'+store.nameList[index]]
|
||||
// this.routerList[1].list.push({
|
||||
// name: store.equipmentName['solenoid' + store.nameList[index]],
|
||||
// status: -1,
|
||||
// index: index + 1,
|
||||
// router: 'irrigateSet'
|
||||
// })
|
||||
// }
|
||||
})
|
||||
},
|
||||
//去首页
|
||||
|
|
|
@ -9,45 +9,25 @@
|
|||
</div>
|
||||
<el-collapse v-model="$store.state.activeNames">
|
||||
<template v-for="(item, index) in routerList">
|
||||
<el-collapse-item
|
||||
:class="routerNow == item.router ? 'active' : ''"
|
||||
:name="index + 1"
|
||||
:key="index"
|
||||
v-if="!item.isRouter"
|
||||
>
|
||||
<el-collapse-item :class="routerNow == item.router ? 'active' : ''" :name="index + 1" :key="index"
|
||||
v-if="!item.isRouter">
|
||||
<template slot="title" class="collapse-title">
|
||||
<span class="name">{{ item.name }}</span>
|
||||
</template>
|
||||
<!-- -->
|
||||
<ul class="table-ul">
|
||||
<li
|
||||
@click="toRouter(item1)"
|
||||
:class="
|
||||
routerNow == item1.router && routerIndex == index1 + 1
|
||||
<li @click="toRouter(item1)" :class="routerNow == item1.router && routerIndex == index1 + 1
|
||||
? 'active'
|
||||
: ''
|
||||
"
|
||||
class="table-li"
|
||||
v-for="(item1, index1) in item.list"
|
||||
:key="index1"
|
||||
>
|
||||
" class="table-li" v-for="(item1, index1) in item.list" :key="index1">
|
||||
{{ item1.name }}
|
||||
<div
|
||||
class="status"
|
||||
:class="item1.status == 0 ? 'outline' : 'online'"
|
||||
v-if="item1.status >= 0"
|
||||
>
|
||||
<div class="status" :class="item1.status == 0 ? 'outline' : 'online'" v-if="item1.status >= 0">
|
||||
{{ item1.status == 0 ? "离线" : "在线" }}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</el-collapse-item>
|
||||
<div
|
||||
@click="toRouter(item)"
|
||||
:class="routerNow == item.router ? 'active' : ''"
|
||||
class="no-list"
|
||||
v-else
|
||||
>
|
||||
<div @click="toRouter(item)" :class="routerNow == item.router ? 'active' : ''" class="no-list" v-else>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</template>
|
||||
|
@ -104,6 +84,28 @@ export default {
|
|||
var isParamInArray2 = this.purview.some((obj) => obj["id"] === 6); //传感器输入合成
|
||||
var isParamInArray3 = this.purview.some((obj) => obj["id"] === 5); //传感器通道
|
||||
var isParamInArray4 = this.purview.some((obj) => obj["id"] === 7); //数据上传
|
||||
var isParamInArray5 = this.purview.some((obj) => obj["id"] === 1); //目标值
|
||||
|
||||
var isParamInArray6 = this.purview.some((obj) => obj["id"] === 3); //报警设置
|
||||
var isParamInArray7 = this.purview.some((obj) => obj["id"] === 4); //固有参数
|
||||
var isParamInArray8 = this.purview.some((obj) => obj["id"] === 11); //电磁阀1
|
||||
var isParamInArray9 = this.purview.some((obj) => obj["id"] === 12); //电磁阀2
|
||||
var isParamInArray10 = this.purview.some((obj) => obj["id"] === 13); //电磁阀3
|
||||
var isParamInArray11 = this.purview.some((obj) => obj["id"] === 14); //电磁阀4
|
||||
var isParamInArray12 = this.purview.some((obj) => obj["id"] === 15); //电磁阀5
|
||||
var isParamInArray13 = this.purview.some((obj) => obj["id"] === 16); //电磁阀6
|
||||
var isParamInArray14 = this.purview.some((obj) => obj["id"] === 17); //电磁阀7
|
||||
var isParamInArray15 = this.purview.some((obj) => obj["id"] === 18); //电磁阀8
|
||||
var isParamInArray16 = this.purview.some((obj) => obj["id"] === 19); //天窗
|
||||
var isParamInArray17 = this.purview.some((obj) => obj["id"] === 20); //补光灯
|
||||
var isParamInArray18 = this.purview.some((obj) => obj["id"] === 21); //环流风扇
|
||||
var isParamInArray19 = this.purview.some((obj) => obj["id"] === 22); //厂家内部参数
|
||||
var isParamInArray20 = this.purview.some((obj) => obj["id"] === 23);//高压微雾
|
||||
var isParamInArray21 = this.purview.some((obj) => obj["id"] === 24);//内遮阳
|
||||
var isParamInArray22 = this.purview.some((obj) => obj["id"] === 25);//外遮阳
|
||||
var isParamInArray23 = this.purview.some((obj) => obj["id"] === 26);//风机湿帘
|
||||
var isParamInArray24 = this.purview.some((obj) => obj["id"] === 2);//强制输出通道
|
||||
var isParamInArray25 = this.purview.some((obj) => obj["id"] === 27);//内保温
|
||||
if (isParamInArray) {
|
||||
this.routerList.push(
|
||||
{ name: "加热水泵", list: [], router: "waterPump", isRouter: true },
|
||||
|
@ -158,7 +160,7 @@ export default {
|
|||
store.ControlData['21533'] = this.countData10(store.ControlData['21533'])
|
||||
store.ControlData['21562'] = this.countData10(store.ControlData['21562'])
|
||||
|
||||
this.$router.push({ path: `/waterPump` });
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -212,7 +214,126 @@ export default {
|
|||
isRouter: true,
|
||||
});
|
||||
}
|
||||
if (isParamInArray5) {
|
||||
this.routerList.push({ name: "目标温度", list: [], router: "targetTemperature", isRouter: true },
|
||||
{ name: "目标湿度", list: [], router: "targetHumidity", isRouter: true },
|
||||
{ name: "目标CO2", list: [], router: "targetCo2", isRouter: true });
|
||||
}
|
||||
if (isParamInArray7) {
|
||||
this.routerList.push({ name: "设备固有参数", list: [], router: "intrinsicParameter", isRouter: true });
|
||||
}
|
||||
|
||||
if (isParamInArray8 || isParamInArray9 || isParamInArray10 || isParamInArray11 || isParamInArray12 || isParamInArray13 || isParamInArray14 || isParamInArray15) {
|
||||
|
||||
this.routerList.push({
|
||||
name: "电磁自动控制", list: [], router: "electromagneticControl"
|
||||
},);
|
||||
let targetObject = this.routerList.find(item => item.name === '电磁自动控制');
|
||||
if (isParamInArray8) {
|
||||
targetObject.list.push({ name: '1#电磁阀', status: -1, router: 'electromagneticControl', index: 1 });
|
||||
}
|
||||
if (isParamInArray9) {
|
||||
targetObject.list.push({ name: '2#电磁阀', status: -1, router: 'electromagneticControl', index: 2 });
|
||||
}
|
||||
if (isParamInArray10) {
|
||||
targetObject.list.push({ name: '3#电磁阀', status: -1, router: 'electromagneticControl', index: 3 });
|
||||
}
|
||||
if (isParamInArray11) {
|
||||
targetObject.list.push({ name: '4#电磁阀', status: -1, router: 'electromagneticControl', index: 4 });
|
||||
}
|
||||
if (isParamInArray12) {
|
||||
targetObject.list.push({ name: '5#电磁阀', status: -1, router: 'electromagneticControl', index: 5 });
|
||||
}
|
||||
if (isParamInArray13) {
|
||||
targetObject.list.push({ name: '6#电磁阀', status: -1, router: 'electromagneticControl', index: 6 });
|
||||
}
|
||||
if (isParamInArray14) {
|
||||
targetObject.list.push({ name: '7#电磁阀', status: -1, router: 'electromagneticControl', index: 7 });
|
||||
}
|
||||
if (isParamInArray15) {
|
||||
targetObject.list.push({ name: '8#电磁阀', status: -1, router: 'electromagneticControl', index: 8 });
|
||||
}
|
||||
}
|
||||
|
||||
if (isParamInArray16) {
|
||||
this.routerList.push({
|
||||
name: "天窗控制", list: [
|
||||
{ name: '天窗1', status: -1, router: 'sunroofControl', index: 1 },
|
||||
{ name: '天窗2', status: -1, router: 'sunroofControl', index: 2 },
|
||||
{ name: '天窗3', status: -1, router: 'sunroofControl', index: 3 },
|
||||
{ name: '天窗4', status: -1, router: 'sunroofControl', index: 4 },
|
||||
], router: "sunroofControl",
|
||||
});
|
||||
}
|
||||
if (isParamInArray17) {
|
||||
this.routerList.push({
|
||||
name: "补光灯", list: [
|
||||
{ name: '时段一', status: -1, router: 'LED', index: 1 },
|
||||
{ name: '时段二', status: -1, router: 'LED', index: 2 },
|
||||
{ name: '时段三', status: -1, router: 'LED', index: 3 },
|
||||
{ name: '时段四', status: -1, router: 'LED', index: 4 },
|
||||
], router: "LED",
|
||||
});
|
||||
}
|
||||
|
||||
if (isParamInArray18) {
|
||||
this.routerList.push({
|
||||
name: "环流风扇", list: [
|
||||
{ name: '环流风扇1', status: -1, router: 'circulationCan', index: 1 },
|
||||
{ name: '环流风扇2', status: -1, router: 'circulationCan', index: 2 },
|
||||
], router: "circulationCan",
|
||||
});
|
||||
}
|
||||
|
||||
if (isParamInArray19) {
|
||||
this.routerList.push({ name: "厂家内部参数配置", list: [], router: "parameterSet", isRouter: true });
|
||||
}
|
||||
|
||||
if (isParamInArray20) {
|
||||
this.routerList.push({
|
||||
name: "高压微雾", list: [
|
||||
{ name: '高压微雾1', status: -1, router: 'coercionMist', index: 1 },
|
||||
{ name: '高压微雾2', status: -1, router: 'coercionMist', index: 2 },
|
||||
], router: "coercionMist"
|
||||
});
|
||||
}
|
||||
|
||||
if (isParamInArray21) {
|
||||
this.routerList.push({
|
||||
name: "内遮阳控制", list: [
|
||||
{ name: '内遮阳1', status: -1, router: 'insizeSunshade', index: 1 },
|
||||
{ name: '内遮阳2', status: -1, router: 'insizeSunshade', index: 2 },
|
||||
], router: "insizeSunshade",
|
||||
});
|
||||
}
|
||||
|
||||
if (isParamInArray22) {
|
||||
this.routerList.push({
|
||||
name: "外遮阳控制", list: [
|
||||
{ name: '外遮阳1', status: -1, router: 'outsizeSunshade', index: 1 },
|
||||
{ name: '外遮阳2', status: -1, router: 'outsizeSunshade', index: 2 },
|
||||
], router: "outsizeSunshade",
|
||||
});
|
||||
}
|
||||
|
||||
if (isParamInArray23) {
|
||||
this.routerList.push({ name: "风机湿帘", list: [], router: "wetFan", isRouter: true });
|
||||
}
|
||||
|
||||
if (isParamInArray24) {
|
||||
this.routerList.push({ name: "强制输出参数", list: [], router: "forceOutput", isRouter: true });
|
||||
}
|
||||
if (isParamInArray25) {
|
||||
this.routerList.push({
|
||||
name: "内保温", list: [
|
||||
{ name: '内保温1', status: -1, router: 'internalInsulation', index: 1 },
|
||||
{ name: '内保温2', status: -1, router: 'internalInsulation', index: 2 },
|
||||
], router: "internalInsulation",
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
this.$router.push({ path: `/${this.routerList[0].router}` });
|
||||
},
|
||||
//去首页
|
||||
toHome(index) {
|
||||
|
@ -226,14 +347,38 @@ export default {
|
|||
if (item.router) {
|
||||
if (item.http) {
|
||||
window.location.href = item.http;
|
||||
} else if (
|
||||
item.router == "skylight" &&
|
||||
this.$route.query.id != item.index
|
||||
) {
|
||||
this.$router.push({ path: `/skylight?id=${item.index}` });
|
||||
} else if (item.router == "fan" && this.$route.query.id != item.index) {
|
||||
this.$router.push({ path: `/fan?id=${item.index}` });
|
||||
} else if (item.router != this.routerNow && !item.http) {
|
||||
}
|
||||
// else if (
|
||||
// item.router == "skylight" &&
|
||||
// this.$route.query.id != item.index
|
||||
// ) {
|
||||
// this.$router.push({ path: `/skylight?id=${item.index}` });
|
||||
// } else if (item.router == "fan" && this.$route.query.id != item.index) {
|
||||
// this.$router.push({ path: `/fan?id=${item.index}` });
|
||||
// } else if (item.router == 'electromagneticControl' && this.$route.query.id != item.index) {
|
||||
// this.$router.push({ path: `/electromagneticControl?id=${item.index}` })
|
||||
// } else if (item.router == 'sunroofControl' && this.$route.query.id != item.index) {
|
||||
// this.$router.push({ path: `/sunroofControl?id=${item.index}` })
|
||||
// } else if (item.router == 'outsizeSunshade' && this.$route.query.id != item.index) {
|
||||
// this.$router.push({ path: `/outsizeSunshade?id=${item.index}` })
|
||||
// } else if (item.router == 'outsizeSunshade' && this.$route.query.id != item.index) {
|
||||
// this.$router.push({ path: `/outsizeSunshade?id=${item.index}` })
|
||||
// } else if (item.router == 'insizeSunshade' && this.$route.query.id != item.index) {
|
||||
// this.$router.push({ path: `/insizeSunshade?id=${item.index}` })
|
||||
// }
|
||||
else {
|
||||
if (item.index) {
|
||||
if (item.router == this.routerNow && item.index == this.$route.query.id) {
|
||||
return
|
||||
}
|
||||
this.$router.push({ path: `/${item.router}?id=${item.index}` })
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if (item.router == this.routerNow) {
|
||||
return
|
||||
}
|
||||
this.$router.push({ name: item.router });
|
||||
}
|
||||
}
|
||||
|
@ -267,8 +412,7 @@ export default {
|
|||
}
|
||||
|
||||
.el-collapse-item {
|
||||
&.active {
|
||||
}
|
||||
&.active {}
|
||||
}
|
||||
|
||||
.no-list {
|
||||
|
|
|
@ -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', 'skylight', 'fan', 'upload-con', 'sensorSet-con', 'waterPump', 'geothermalFan', 'uptake', 'downtake', 'rollByRoll', 'snowRemoval'], img: require('../assets/image/header-img0.png') },
|
||||
{ name: '设定值参数', router: 'status', index: 1, routerList: ['status', 'skylight', 'fan', 'upload-con', 'sensorSet-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', 'skylight', 'control', 'fan', 'upload-con', 'sensorSet-con', 'synthesis-con', 'waterPump', 'geothermalFan', 'uptake', 'downtake', 'rollByRoll', 'snowRemoval'], img: require('../assets/image/left-img0.png'), list: [] },
|
||||
{ name: '温室', routerList: ['realTime', 'skylight', 'control', 'fan', 'upload-con', 'sensorSet-con', '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/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',
|
||||
|
@ -301,12 +301,24 @@ export default {
|
|||
}
|
||||
},
|
||||
toRouter1(item) {
|
||||
console.log(item,11);
|
||||
if (item.router) {
|
||||
if (item.http) {
|
||||
window.location.href = item.http;
|
||||
} else if (item.deviceState==0) {
|
||||
this.$message('当前设备为离线状态');
|
||||
} else if (item.router == 'formula' && this.$route.query.index != item.index) {
|
||||
|
||||
if (this.routerNow == 'realTime') {
|
||||
if (item.router == 'formula') {
|
||||
|
||||
this.$store.state.equipmentIndex = item.index
|
||||
this.routerIndex = item.index
|
||||
if (item.deviceName == 10) {
|
||||
this.$router.push({ path: `/skylight?change=${item.index}` })
|
||||
} else if (item.deviceName == 1 && this.routerNow != 'irrigateSet') {
|
||||
this.$router.push({ path: `/irrigateSet?change=${item.index}` })
|
||||
}
|
||||
} else if (this.routerNow == 'realTime') {
|
||||
this.$store.state.equipmentIndex = item.index
|
||||
this.$router.push({ path: `/realTime?index=${item.index ? item.index : 1}&name=${item.deviceName}` })
|
||||
} else if (this.routerNow == 'formula') {
|
||||
|
@ -318,23 +330,12 @@ export default {
|
|||
} else if (this.routerNow == 'dataAnalysis') {
|
||||
this.$store.state.equipmentIndex = item.index
|
||||
this.$router.push({ path: `/dataAnalysis?index=${item.index ? item.index : 1}` })
|
||||
} else if (item.router == 'formula') {
|
||||
|
||||
this.$store.state.equipmentIndex = item.index
|
||||
this.routerIndex = item.index
|
||||
if (item.deviceName == 10) {
|
||||
this.$router.push({ path: `/skylight?change=${item.index}` })
|
||||
} else if (item.deviceName == 1 && this.routerNow != 'irrigateSet') {
|
||||
this.$router.push({ path: `/irrigateSet?change=${item.index}` })
|
||||
}
|
||||
}
|
||||
} else if (item.router == 'formula' && this.$route.query.index == item.index) {
|
||||
|
||||
return
|
||||
} else if (item.router != this.routerNow && !item.http) {
|
||||
this.$router.push({ name: item.router })
|
||||
}
|
||||
} else if (!item.deviceState) {
|
||||
this.$message('当前设备为离线状态');
|
||||
} else {
|
||||
this.$message('当前页面正在努力开发中');
|
||||
}
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn ">
|
||||
<div class="btn" :class="openIndex == 1 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1)" :class="inputData[21400] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 2 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(2)" :class="inputData[21400] == 2 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet3.png" alt="" />手动打开
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 3 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(3)" :class="inputData[21400] == 3 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />手动关闭
|
||||
</div>
|
||||
</div>
|
||||
|
@ -22,52 +22,52 @@
|
|||
<div class="text-tips">手动启动时开灯</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn ">
|
||||
<div class="btn blue btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(0)" :class="actList2[0] == '1' ? 'blue' : 'off'">
|
||||
1#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(1)" :class="actList2[1] == '1' ? 'blue' : 'off'">
|
||||
2#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(2)" :class="actList2[2] == '1' ? 'blue' : 'off'">
|
||||
3#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(3)" :class="actList2[3] == '1' ? 'blue' : 'off'">
|
||||
4#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(4)" :class="actList2[4] == '1' ? 'blue' : 'off'">
|
||||
5#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(5)" :class="actList2[5] == '1' ? 'blue' : 'off'">
|
||||
6#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(6)" :class="actList2[6] == '1' ? 'blue' : 'off'">
|
||||
7#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(7)" :class="actList2[7] == '1' ? 'blue' : 'off'">
|
||||
8#灯
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view padding-none border-none shrink-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen2(0)" :class="actList3[0] == '1' ? 'blue' : 'off'">
|
||||
{{actList3[0] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>高温报警时,禁止启动补光灯</span>
|
||||
</div>
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen2(1)" :class="actList3[1] == '1' ? 'blue' : 'off'">
|
||||
{{actList3[1] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>使用1#日标温度</span>
|
||||
</div>
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen2(2)" :class="actList3[2] == '1' ? 'blue' : 'off'">
|
||||
{{actList3[2] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
|
@ -76,59 +76,65 @@
|
|||
</div>
|
||||
<div class="flex-view padding-none border-none shrink-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen2(3)" :class="actList3[3] == '1' ? 'blue' : 'off'">
|
||||
{{actList3[3] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>室外关照大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(21403, $event)" v-model="inputData[21403]" @input="changeCount10(21403, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,禁止启用补光灯。 (KLux)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view padding-none shrink-none">
|
||||
<div class="input-main-80">
|
||||
<span>多组补光灯启动时,间隔</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(21424, $event)" v-model="inputData[21424]" @input="change(21424, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>秒顺序启动,防止同时启动瞬间功率过大</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-tips">时段1</div>
|
||||
<div class="text-tips">时段{{indexs}}</div>
|
||||
<div class="flex-view border-none padding-none shrink-none">
|
||||
<div class="input-main-80">
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]-4, $event)" v-model="inputData[startList[indexs-1]-4]" @input="change(startList[indexs-1]-4, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]-3, $event)" v-model="inputData[startList[indexs-1]-3]" @input="change(startList[indexs-1]-3, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]-2, $event)" v-model="inputData[startList[indexs-1]-2]" @input="change(startList[indexs-1]-2, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]-1, $event)" v-model="inputData[startList[indexs-1]-1]" @input="change(startList[indexs-1]-1, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none">
|
||||
<div class="input-btn ">
|
||||
<div class="btn blue btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(0)" :class="actList1[0] == '1' ? 'blue' : 'off'">
|
||||
1#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(1)" :class="actList1[1] == '1' ? 'blue' : 'off'">
|
||||
2#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(2)" :class="actList1[2] == '1' ? 'blue' : 'off'">
|
||||
3#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(3)" :class="actList1[3] == '1' ? 'blue' : 'off'">
|
||||
4#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(4)" :class="actList1[4] == '1' ? 'blue' : 'off'">
|
||||
5#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(5)" :class="actList1[5] == '1' ? 'blue' : 'off'">
|
||||
6#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(6)" :class="actList1[6] == '1' ? 'blue' : 'off'">
|
||||
7#灯
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(7)" :class="actList1[7] == '1' ? 'blue' : 'off'">
|
||||
8#灯
|
||||
</div>
|
||||
</div>
|
||||
|
@ -139,13 +145,298 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
openIndex: 1,
|
||||
openIndex1: 1,
|
||||
openIndex2: 1,
|
||||
inputData: [],
|
||||
indexs: 1,
|
||||
actList1: [],
|
||||
actList2: [],
|
||||
actList3: [],
|
||||
startList:[21408,21413,21418,21423],
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {},
|
||||
watch: {
|
||||
$route(newVal, oldVal) {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.getActive1();
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
// 计算展示值 计算公式 (x - 400) / 10
|
||||
countData(data) {
|
||||
if (data) {
|
||||
return (data - 400) / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//失去焦点
|
||||
blurChangeCount(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: (el.target.value * 10) + 400,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = (el.target.value * 10) + 400
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen(active) {
|
||||
if (this.actList1[active] == '1') {
|
||||
this.actList1[active] = '0'
|
||||
} else {
|
||||
this.actList1[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList1.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.inputData[this.startList[this.indexs - 1]]=parseInt(num, 2)
|
||||
this.changeBtn(this.startList[this.indexs - 1], dataNum);
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen1(active) {
|
||||
if (this.actList2[active] == '1') {
|
||||
this.actList2[active] = '0'
|
||||
} else {
|
||||
this.actList2[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList2.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.changeBtn(21401, dataNum);
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen2(active) {
|
||||
if (this.actList3[active] == '1') {
|
||||
this.actList3[active] = '0'
|
||||
} else {
|
||||
this.actList3[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList3.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.changeBtn(21402, dataNum);
|
||||
},
|
||||
getActive1() {
|
||||
this.actList1 = []
|
||||
var num = this.inputData[this.startList[this.indexs - 1]]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 8)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList1 = openListNew.reverse();
|
||||
},
|
||||
getActive2() {
|
||||
this.actList2 = []
|
||||
var num = this.inputData[21401]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 8)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList2 = openListNew.reverse();
|
||||
},
|
||||
getActive3() {
|
||||
this.actList3 = []
|
||||
var num = this.inputData[21402]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 4)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList3 = openListNew.reverse();
|
||||
},
|
||||
// 工作方式选择
|
||||
changeOpen(index) {
|
||||
this.inputData[21400] = index;
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: index,
|
||||
},
|
||||
};
|
||||
this.changeBtn(21400, dataNum);
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.readfilllight(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.getActive1()
|
||||
this.getActive2()
|
||||
this.getActive3()
|
||||
}
|
||||
})
|
||||
},
|
||||
//二进制转换后的补全
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
//反转数组 不影响原数组
|
||||
myReverse(arr) {
|
||||
return [...arr].reverse()
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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>
|
||||
|
|
|
@ -1,90 +1,111 @@
|
|||
<template>
|
||||
<div class="circulationCan">
|
||||
<div class="table-title">
|
||||
<img src="../../assets/img/circulationCan.png" alt="">环流风扇
|
||||
<img src="../../assets/img/circulationCan.png" alt="">环流风扇{{ indexs }}
|
||||
</div>
|
||||
<div class="title-tips">工作方式选择</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn ">
|
||||
<div class="btn" :class="openIndex == 1 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1)" :class="inputData[startList[indexs - 1]] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 2 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1)" :class="inputData[startList[indexs - 1]] == 2 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet3.png" alt="" />手动打开
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 3 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1)" :class="inputData[startList[indexs - 1]] == 3 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />手动关闭
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(0)" :class="actList1[0] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[0] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>时段1:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+2, $event)" v-model="inputData[startList[indexs-1]+2]" @input="change(startList[indexs-1]+2, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+3, $event)" v-model="inputData[startList[indexs-1]+3]" @input="change(startList[indexs-1]+3, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+4, $event)" v-model="inputData[startList[indexs-1]+4]" @input="change(startList[indexs-1]+4, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+5, $event)" v-model="inputData[startList[indexs-1]+5]" @input="change(startList[indexs-1]+5, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>时段2:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+6, $event)" v-model="inputData[startList[indexs-1]+6]" @input="change(startList[indexs-1]+6, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+7, $event)" v-model="inputData[startList[indexs-1]+7]" @input="change(startList[indexs-1]+7, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+8, $event)" v-model="inputData[startList[indexs-1]+8]" @input="change(startList[indexs-1]+8, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+9, $event)" v-model="inputData[startList[indexs-1]+9]" @input="change(startList[indexs-1]+9, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>时段3:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+10, $event)" v-model="inputData[startList[indexs-1]+10]" @input="change(startList[indexs-1]+10, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+11, $event)" v-model="inputData[startList[indexs-1]+11]" @input="change(startList[indexs-1]+11, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+12, $event)" v-model="inputData[startList[indexs-1]+12]" @input="change(startList[indexs-1]+12, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+13, $event)" v-model="inputData[startList[indexs-1]+13]" @input="change(startList[indexs-1]+13, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>时段4:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+14, $event)" v-model="inputData[startList[indexs-1]+14]" @input="change(startList[indexs-1]+14, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+15, $event)" v-model="inputData[startList[indexs-1]+15]" @input="change(startList[indexs-1]+15, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+16, $event)" v-model="inputData[startList[indexs-1]+16]" @input="change(startList[indexs-1]+16, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+17, $event)" v-model="inputData[startList[indexs-1]+17]" @input="change(startList[indexs-1]+17, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(1)" :class="actList1[1] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[1] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>加湿时,同时运行环流风扇。</span>
|
||||
<span>湿度高于</span>
|
||||
<input @blur="blurChange10(startList[indexs - 1] + 18, $event)" v-model="inputData[startList[indexs - 1] + 18]"
|
||||
@input="changeCount10(startList[indexs - 1] + 18, $event)" type="text" placeholder="0">
|
||||
<span>启动,滞回带</span>
|
||||
<input @blur="blurChange10(startList[indexs - 1] + 19, $event)" v-model="inputData[startList[indexs - 1] + 19]"
|
||||
@input="changeCount10(startList[indexs - 1] + 19, $event)" type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn off btn-w80" @click="changeIndexOpen(3)" :class="actList1[3] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[3] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
|
@ -94,15 +115,12 @@
|
|||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn off btn-w80" @click="changeIndexOpen(2)" :class="actList1[2] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[2] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>加湿时,同时运行环流风扇。</span>
|
||||
<input type="text" placeholder="0">
|
||||
<span>%,启动环流风扇。 控制精度</span>
|
||||
<input type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -112,11 +130,246 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
openIndex:1,
|
||||
inputData: [],
|
||||
startList: [21450, 21470],//每个阀门的起始参数
|
||||
indexs: 1,
|
||||
actList1: [],
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {},
|
||||
watch: {
|
||||
$route(newVal, oldVal) {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.getActive1();
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
// 计算展示值 计算公式 (x - 400) / 10
|
||||
countData(data) {
|
||||
if (data) {
|
||||
return (data - 400) / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//失去焦点
|
||||
blurChangeCount(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: (el.target.value * 10) + 400,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = (el.target.value * 10) + 400
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen(active) {
|
||||
if (this.actList1[active] == '1') {
|
||||
this.actList1[active] = '0'
|
||||
} else {
|
||||
this.actList1[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList1.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.inputData[this.startList[this.indexs - 1] + 1]=parseInt(num, 2)
|
||||
this.changeBtn(this.startList[this.indexs - 1] + 1, dataNum);
|
||||
},
|
||||
getActive1() {
|
||||
this.actList1 = []
|
||||
var num = this.inputData[this.startList[this.indexs - 1] + 1]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 2)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList1 = openListNew.reverse();
|
||||
},
|
||||
// 工作方式选择
|
||||
changeOpen(index) {
|
||||
this.inputData[this.startList[this.indexs - 1]] = index;
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: index,
|
||||
},
|
||||
};
|
||||
this.changeBtn(this.startList[this.indexs - 1], dataNum);
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.readcirculationfan(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.startList.forEach((el, index) => {
|
||||
this.inputData[el + 18] = this.countData10(this.inputData[el + 18])
|
||||
this.inputData[el + 19] = this.countData10(this.inputData[el + 19])
|
||||
})
|
||||
this.getActive1()
|
||||
}
|
||||
})
|
||||
},
|
||||
//二进制转换后的补全
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
//反转数组 不影响原数组
|
||||
myReverse(arr) {
|
||||
return [...arr].reverse()
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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>
|
||||
|
|
|
@ -1,61 +1,67 @@
|
|||
<template>
|
||||
<div class="coercionMist">
|
||||
<div class="table-title">
|
||||
<img src="../../assets/img/coercionMist.png" alt="">高压微雾
|
||||
<img src="../../assets/img/coercionMist.png" alt="">高压微雾{{ indexs }}
|
||||
</div>
|
||||
<div class="title-tips">工作方式选择</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn ">
|
||||
<div class="btn" :class="openIndex == 1 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1)" :class="inputData[startList[indexs - 1]] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 2 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(2)" :class="inputData[startList[indexs - 1]] == 2 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet3.png" alt="" />手动打开
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 3 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(3)" :class="inputData[startList[indexs - 1]] == 3 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />手动关闭
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(0)" :class="actList1[0] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[0] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<span>室内温度高于目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs - 1] + 2, $event)" v-model="inputData[startList[indexs - 1] + 2]"
|
||||
@input="changeCount10(startList[indexs - 1] + 2, $event)" type="text" placeholder="0">
|
||||
<span>度,开启高压微雾降温。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none">
|
||||
<div class="input-main input-main-w120">
|
||||
<span>开启</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+3, $event)" v-model="inputData[startList[indexs-1]+3]" @input="change(startList[indexs-1]+3, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>秒,关闭</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+4, $event)" v-model="inputData[startList[indexs-1]+4]" @input="change(startList[indexs-1]+4, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>秒,进行间隔工作。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(1)" :class="actList1[1] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[1] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<span>室内湿度低于目标湿度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs - 1] + 5, $event)" v-model="inputData[startList[indexs - 1] + 5]"
|
||||
@input="changeCount10(startList[indexs - 1] + 5, $event)" type="text" placeholder="0">
|
||||
<span>%,开启高压微雾加湿。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none">
|
||||
<div class="input-main input-main-w120">
|
||||
<span>开启</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+6, $event)" v-model="inputData[startList[indexs-1]+6]" @input="change(startList[indexs-1]+6, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>秒,关闭</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+7, $event)" v-model="inputData[startList[indexs-1]+7]" @input="change(startList[indexs-1]+7, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>秒,进行间隔工作。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -65,16 +71,250 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
openIndex:1
|
||||
openIndex: 1,
|
||||
inputData: [],
|
||||
startList: [21800, 21808],//每个阀门的起始参数
|
||||
indexs: 1,
|
||||
actList1: [],
|
||||
}
|
||||
},
|
||||
mounted(){},
|
||||
methods:{},
|
||||
watch: {
|
||||
$route(newVal, oldVal) {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.getActive1();
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
// 计算展示值 计算公式 (x - 400) / 10
|
||||
countData(data) {
|
||||
if (data) {
|
||||
return (data - 400) / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//失去焦点
|
||||
blurChangeCount(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: (el.target.value * 10) + 400,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = (el.target.value * 10) + 400
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen(active) {
|
||||
if (this.actList1[active] == '1') {
|
||||
this.actList1[active] = '0'
|
||||
} else {
|
||||
this.actList1[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList1.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.inputData[this.startList[this.indexs - 1] + 1]=parseInt(num, 2)
|
||||
this.changeBtn(this.startList[this.indexs - 1] + 1, dataNum);
|
||||
},
|
||||
getActive1() {
|
||||
this.actList1 = []
|
||||
var num = this.inputData[this.startList[this.indexs - 1] + 1]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 2)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList1 = openListNew.reverse();
|
||||
},
|
||||
// 工作方式选择
|
||||
changeOpen(index) {
|
||||
this.inputData[this.startList[this.indexs - 1]] = index;
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: index,
|
||||
},
|
||||
};
|
||||
this.changeBtn(this.startList[this.indexs - 1], dataNum);
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.highpressuremist(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.startList.forEach((el, index) => {
|
||||
this.inputData[el + 2] = this.countData10(this.inputData[el + 2])
|
||||
this.inputData[el + 5] = this.countData10(this.inputData[el + 5])
|
||||
})
|
||||
this.getActive1()
|
||||
}
|
||||
})
|
||||
},
|
||||
//二进制转换后的补全
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
//反转数组 不影响原数组
|
||||
myReverse(arr) {
|
||||
return [...arr].reverse()
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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>
|
||||
<style lang="scss"></style>
|
||||
|
||||
|
|
@ -1,24 +1,32 @@
|
|||
<template>
|
||||
<div class="electromagneticControl">
|
||||
<div class="table-title">
|
||||
<img src="../../assets/img/electromagneticControl.png" alt="">电磁自动控制
|
||||
<img src="../../assets/img/electromagneticControl.png" alt="">{{ indexs }}#电磁阀
|
||||
</div>
|
||||
<div class="title-tips">
|
||||
工作方式选择
|
||||
</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn ">
|
||||
<div class="btn" :class="openIndex == 1 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1)" :class="inputData[startList[indexs - 1]] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 2 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(2)" :class="inputData[startList[indexs - 1]] == 2 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet3.png" alt="" />手动打开
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 3 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(3)" :class="inputData[startList[indexs - 1]] == 3 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />手动关闭
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>手动开启阀门的时间</span>
|
||||
<input @blur="blurChange(startList[indexs - 1]+1, $event)" v-model="inputData[startList[indexs - 1]+1]" @input="change(startList[indexs - 1]+1, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none">
|
||||
<div class="input-sel">
|
||||
<div class="title">运行模式选择(2选1)</div>
|
||||
|
@ -34,34 +42,35 @@
|
|||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-btn p-t-31">
|
||||
<div class="btn blue btn-w66">
|
||||
周一
|
||||
</div>
|
||||
<div class="btn off btn-w66">
|
||||
周二
|
||||
</div>
|
||||
<div class="btn off btn-w66">
|
||||
周三
|
||||
</div>
|
||||
<div class="btn off btn-w66">
|
||||
周四
|
||||
</div>
|
||||
<div class="btn off btn-w66">
|
||||
周五
|
||||
</div>
|
||||
<div class="btn off btn-w66">
|
||||
周六
|
||||
</div>
|
||||
<div class="btn off btn-w66">
|
||||
<div class="btn btn-w66" @click="changeIndexOpen(0)" :class="actList1[0] == '1' ? 'blue' : 'off'">
|
||||
周日
|
||||
</div>
|
||||
<div class="btn btn-w66" @click="changeIndexOpen(1)" :class="actList1[1] == '1' ? 'blue' : 'off'">
|
||||
周一
|
||||
</div>
|
||||
<div class="btn btn-w66" @click="changeIndexOpen(2)" :class="actList1[2] == '1' ? 'blue' : 'off'">
|
||||
周二
|
||||
</div>
|
||||
<div class="btn btn-w66" @click="changeIndexOpen(3)" :class="actList1[3] == '1' ? 'blue' : 'off'">
|
||||
周三
|
||||
</div>
|
||||
<div class="btn btn-w66" @click="changeIndexOpen(4)" :class="actList1[4] == '1' ? 'blue' : 'off'">
|
||||
周四
|
||||
</div>
|
||||
<div class="btn btn-w66" @click="changeIndexOpen(5)" :class="actList1[5] == '1' ? 'blue' : 'off'">
|
||||
周五
|
||||
</div>
|
||||
<div class="btn btn-w66" @click="changeIndexOpen(6)" :class="actList1[6] == '1' ? 'blue' : 'off'">
|
||||
周六
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
|
||||
<div class="input-main-80">
|
||||
<span>时间段启动:每次灌溉时长</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+4, $event)" v-model="inputData[startList[indexs - 1]+4]" @input="change(startList[indexs - 1]+4, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -70,15 +79,20 @@
|
|||
<div>1</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+6, $event)" v-model="inputData[startList[indexs - 1]+6]" @input="change(startList[indexs - 1]+6, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+7, $event)" v-model="inputData[startList[indexs - 1]+5]" @input="change(startList[indexs - 1]+5, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+8, $event)" v-model="inputData[startList[indexs - 1]+5]" @input="change(startList[indexs - 1]+5, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+9, $event)" v-model="inputData[startList[indexs - 1]+5]" @input="change(startList[indexs - 1]+5, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时间段里启动次数</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+5, $event)" v-model="inputData[startList[indexs - 1]+5]" @input="change(startList[indexs - 1]+5, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
|
@ -86,15 +100,20 @@
|
|||
<div>2</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+11, $event)" v-model="inputData[startList[indexs - 1]+11]" @input="change(startList[indexs - 1]+11, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+12, $event)" v-model="inputData[startList[indexs - 1]+12]" @input="change(startList[indexs - 1]+12, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+13, $event)" v-model="inputData[startList[indexs - 1]+13]" @input="change(startList[indexs - 1]+13, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+14, $event)" v-model="inputData[startList[indexs - 1]+14]" @input="change(startList[indexs - 1]+14, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时间段里启动次数</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+10, $event)" v-model="inputData[startList[indexs - 1]+10]" @input="change(startList[indexs - 1]+10, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-tips">
|
||||
|
@ -103,34 +122,41 @@
|
|||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>有效检测时间段</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+15, $event)" v-model="inputData[startList[indexs - 1]+15]" @input="change(startList[indexs - 1]+15, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+16, $event)" v-model="inputData[startList[indexs - 1]+16]" @input="change(startList[indexs - 1]+16, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1]+17, $event)" v-model="inputData[startList[indexs - 1]+17]" @input="change(startList[indexs - 1]+17, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1+18], $event)" v-model="inputData[startList[indexs - 1]+18]" @input="change(startList[indexs - 1]+18, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>最低土壤湿度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs - 1]+19, $event)" v-model="inputData[startList[indexs - 1]+19]" @input="changeCount10(startList[indexs - 1]+19, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>最高土壤湿度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs - 1]+20, $event)" v-model="inputData[startList[indexs - 1]+20]" @input="changeCount10(startList[indexs - 1]+20, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>灌溉时长上限</span>
|
||||
<input type="text" placeholder="0">
|
||||
<span>%</span>
|
||||
<input @blur="blurChange(startList[indexs - 1]+21, $event)" v-model="inputData[startList[indexs - 1]+21]" @input="change(startList[indexs - 1]+21, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -139,18 +165,241 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
timer:null,
|
||||
indexs: 1,//几号阀
|
||||
openIndex: 1,
|
||||
sensorType: '',
|
||||
typeList: [{ label: '无意义的传感器', value: 0, countType: 0, unit: '' },
|
||||
{ label: '空气温度', value: 1, countType: 3, unit: '℃' },
|
||||
{ label: '空气湿度', value: 2, countType: 2, unit: '%' },]
|
||||
startList: [20201, 20251, 20301, 20351, 20401, 20451, 20501, 20551],//每个阀门的起始参数
|
||||
sensorType: '',//选择的类型
|
||||
actList1: [],//周几数组
|
||||
inputData: [],
|
||||
typeList: [{ label: '间隔模式启动', value: 1, },
|
||||
{ label: '土壤湿度传感器启动', value: 2, },]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route(newVal, oldVal) {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
//二进制转换后的补全
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//周几开启
|
||||
changeIndexOpen(active) {
|
||||
if (this.actList1[active] == '1') {
|
||||
this.actList1[active] = '0'
|
||||
} else {
|
||||
this.actList1[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList1.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.inputData[this.startList[this.indexs - 1] + 2]=parseInt(num, 2)
|
||||
this.changeBtn(this.startList[this.indexs - 1] + 2, dataNum);
|
||||
},
|
||||
//反转数组 不影响原数组
|
||||
myReverse(arr) {
|
||||
return [...arr].reverse()
|
||||
},
|
||||
getActive1() {
|
||||
this.actList1 = []
|
||||
var num = this.inputData[this.startList[this.indexs - 1] + 2]
|
||||
var num1 = this.padString(num.toString(2), 7)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList1 = openListNew.reverse();
|
||||
},
|
||||
// 工作方式选择
|
||||
changeOpen(index) {
|
||||
this.inputData[this.startList[this.indexs - 1]] = index;
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: this.openIndex,
|
||||
},
|
||||
};
|
||||
this.changeBtn(this.startList[this.indexs - 1], dataNum);
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api['solenoidValve' + this.indexs](data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.sensorType = ''
|
||||
this.getSensorType()
|
||||
this.openIndex = this.inputData[this.startList[this.indexs - 1]]
|
||||
this.getActive1()
|
||||
this.inputData[this.startList[this.indexs - 1]+19] =this.countData10(this.inputData[this.startList[this.indexs - 1]+19]);
|
||||
this.inputData[this.startList[this.indexs - 1]+20] =this.countData10(this.inputData[this.startList[this.indexs - 1]+20]);
|
||||
}
|
||||
})
|
||||
},
|
||||
//类型选择
|
||||
handleCommand(command) {
|
||||
console.log(command);
|
||||
this.typeList.forEach((el, index) => {
|
||||
if (el.value == command) {
|
||||
this.sensorType = el.label
|
||||
}
|
||||
})
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: command,
|
||||
},
|
||||
};
|
||||
this.changeBtn(this.startList[this.indexs - 1] + 3, dataNum);
|
||||
},
|
||||
getSensorType() {
|
||||
console.log();
|
||||
this.typeList.forEach((el, index) => {
|
||||
if (el.value == this.inputData[this.startList[this.indexs - 1] + 3]) {
|
||||
this.sensorType = el.label
|
||||
}
|
||||
})
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
@ -8,16 +8,19 @@
|
|||
</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn ">
|
||||
<div class="btn blue">
|
||||
<div class="btn blue" @click="changeOpen()" :class="inputData[20600] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />非测试模式
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn flex-warp">
|
||||
<div class="btn off btn-w80 m-b-20" v-for="item,index in 64" :key="index">
|
||||
{{index+1}}#
|
||||
<template v-for="item,index in pageList">
|
||||
<div @click="changeType(index, index1)" class="btn btn-w80 m-b-20" :class="item1==1?'blue':'off'" v-for="item1,index1 in item" :key="(index*16)+index1+1">
|
||||
{{(index*16)+index1+1}}#
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -25,10 +28,176 @@
|
|||
<script>
|
||||
export default {
|
||||
data(){
|
||||
return {}
|
||||
return {
|
||||
inputData: [],
|
||||
nowSel: {
|
||||
index: -1,
|
||||
value: 0,
|
||||
},
|
||||
pageList:[[],[],[],[]]
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.dataInit()
|
||||
},
|
||||
methods:{
|
||||
// 工作方式选择
|
||||
changeOpen() {
|
||||
if(this.inputData[20600]==0){
|
||||
this.inputData[20600]=1
|
||||
}else{
|
||||
this.inputData[20600]=0
|
||||
}
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: this.inputData[20600],
|
||||
},
|
||||
};
|
||||
this.changeBtn(20600, dataNum);
|
||||
},
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
getList(data) {
|
||||
var num = data
|
||||
var num1 = this.padString(num.toString(2), 16)
|
||||
var openListNew = num1.split("")
|
||||
var list = openListNew.reverse()
|
||||
return list
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.forceChannelOutput(data).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.pageList.forEach((el, index) => {
|
||||
this.pageList[index] = this.getList(this.inputData[20601 + index])
|
||||
})
|
||||
this.$forceUpdate();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
//反转数组 不影响原数组
|
||||
myReverse(arr) {
|
||||
return [...arr].reverse()
|
||||
},
|
||||
changeType(index, index1) {
|
||||
var store = this.$store.state
|
||||
const that = this
|
||||
if (this.pageList[index][index1] == '1') {
|
||||
this.pageList[index][index1] = '0'
|
||||
} else {
|
||||
this.pageList[index][index1] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var num = this.myReverse(this.pageList[index]).join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
|
||||
if (this.nowSel.index == -1) {
|
||||
this.changeBtn(20601 + index, dataNum)
|
||||
this.nowSel.index = index
|
||||
this.nowSel.value = parseInt(num, 2)
|
||||
} else {
|
||||
if (this.nowSel.index == index) {
|
||||
this.changeBtn(20601 + index, dataNum)
|
||||
this.nowSel.index = index
|
||||
this.nowSel.value = parseInt(num, 2)
|
||||
} else {
|
||||
|
||||
var code = 20601 + this.nowSel.index
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: this.nowSel.value,
|
||||
};
|
||||
this.nowSel.index = -1
|
||||
this.nowSel.value = 0
|
||||
that.changeData(data);
|
||||
this.changeBtn(20601 + index, dataNum)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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) {
|
||||
this.api.postControlWrite(data).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.$message({
|
||||
message: res.data.msg,
|
||||
type: "success",
|
||||
});
|
||||
// this.dataInit();
|
||||
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
if (this.nowSel.index != -1) {
|
||||
this.timer = null
|
||||
this.nowSel.index = -1
|
||||
this.nowSel.value = 0
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted(){},
|
||||
methods:{},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<set-params></set-params>
|
||||
<div class="page-content">
|
||||
<div class="table-title">
|
||||
<img src="../../assets/image/formula.png" alt=""> {{ titleName }}参数 <div class="tips">种植作物配方1</div>
|
||||
<img src="../../assets/image/formula.png" alt=""> {{ titleName }}参数 <div class="tips">{{$store.state.equipmentName['fertilization' + $store.state.nameList[indexs-1]]}}</div>
|
||||
</div>
|
||||
<div class="input-view">
|
||||
<div class="input-sel">
|
||||
|
|
|
@ -1,135 +1,397 @@
|
|||
<template>
|
||||
<div class="insizeSunshade">
|
||||
<div class="table-title">
|
||||
<img src="../../assets/img/insizeSunshade.png" alt="">外遮阳控制
|
||||
<img src="../../assets/img/insizeSunshade.png" alt="">内遮阳{{ indexs }}
|
||||
</div>
|
||||
<div class="title-tips">工作方式选择</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn ">
|
||||
<div class="btn" :class="openIndex == 1 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1)" :class="inputData[startList[indexs - 1]] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 2 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(2)" :class="inputData[startList[indexs - 1]] == 2 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet3.png" alt="" />手动打开
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 3 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(3)" :class="inputData[startList[indexs - 1]] == 3 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />手动关闭
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 4 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(4)" :class="inputData[startList[indexs - 1]] == 4 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />停止
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(0)" :class="actList1[0] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[0] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>白天遮阳时段限制:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1] + 2, $event)" v-model="inputData[startList[indexs - 1] + 2]"
|
||||
@input="change(startList[indexs - 1] + 2, $event)" type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1] + 3, $event)" v-model="inputData[startList[indexs - 1] + 3]"
|
||||
@input="change(startList[indexs - 1] + 3, $event)" type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1] + 4, $event)" v-model="inputData[startList[indexs - 1] + 4]"
|
||||
@input="change(startList[indexs - 1] + 4, $event)" type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs - 1] + 5, $event)" v-model="inputData[startList[indexs - 1] + 5]"
|
||||
@input="change(startList[indexs - 1] + 5, $event)" type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(1)" :class="actList1[1] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[1] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>室外光照大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs-1]+6, $event)" v-model="inputData[startList[indexs-1]+6]" @input="changeCount10(startList[indexs-1]+6, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,展开内遮阳。光照确认时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+12, $event)" v-model="inputData[startList[indexs-1]+12]" @input="change(startList[indexs-1]+12, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(2)" :class="actList1[2] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[2] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>室内温度高于目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs-1]+7, $event)" v-model="inputData[startList[indexs-1]+7]" @input="changeCount10(startList[indexs-1]+7, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>度,展开内遮阳。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(3)" :class="actList1[3] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[3] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>夜间保温时段:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+8, $event)" v-model="inputData[startList[indexs-1]+8]" @input="change(startList[indexs-1]+8, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+9, $event)" v-model="inputData[startList[indexs-1]+9]" @input="change(startList[indexs-1]+9, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+10, $event)" v-model="inputData[startList[indexs-1]+10]" @input="change(startList[indexs-1]+10, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+11, $event)" v-model="inputData[startList[indexs-1]+11]" @input="change(startList[indexs-1]+11, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(5)" :class="actList1[5] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[5] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>天窗除湿时,内遮阳开启角度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+13, $event)" v-model="inputData[startList[indexs-1]+13]" @input="change(startList[indexs-1]+13, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(6)" :class="actList1[6] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[6] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>光照大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs-1]+14, $event)" v-model="inputData[startList[indexs-1]+14]" @input="changeCount10(startList[indexs-1]+14, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,提前</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+15, $event)" v-model="inputData[startList[indexs-1]+15]" @input="change(startList[indexs-1]+15, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟收拢内遮阳。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(4)" :class="actList1[4] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[4] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>预留条件</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>夜间保温结束时,分</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+16, $event)" v-model="inputData[startList[indexs-1]+16]" @input="change(startList[indexs-1]+16, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>步收拢遮阳网,间隔时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+17, $event)" v-model="inputData[startList[indexs-1]+17]" @input="change(startList[indexs-1]+17, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
openIndex:1,
|
||||
inputData: [],
|
||||
startList: [21840, 21858],//每个阀门的起始参数
|
||||
indexs: 1,
|
||||
actList1: [],
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {},
|
||||
watch: {
|
||||
$route(newVal, oldVal) {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.getActive1();
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
// 计算展示值 计算公式 (x - 400) / 10
|
||||
countData(data) {
|
||||
if (data) {
|
||||
return (data - 400) / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//失去焦点
|
||||
blurChangeCount(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: (el.target.value * 10) + 400,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = (el.target.value * 10) + 400
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen(active) {
|
||||
if (this.actList1[active] == '1') {
|
||||
this.actList1[active] = '0'
|
||||
} else {
|
||||
this.actList1[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList1.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.inputData[this.startList[this.indexs - 1] + 1]=parseInt(num, 2)
|
||||
this.changeBtn(this.startList[this.indexs - 1] + 1, dataNum);
|
||||
},
|
||||
getActive1() {
|
||||
this.actList1 = []
|
||||
var num = this.inputData[this.startList[this.indexs - 1] + 1]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 5)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList1 = openListNew.reverse();
|
||||
},
|
||||
// 工作方式选择
|
||||
changeOpen(index) {
|
||||
this.inputData[this.startList[this.indexs - 1]] = index;
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: index,
|
||||
},
|
||||
};
|
||||
this.changeBtn(this.startList[this.indexs - 1], dataNum);
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.innercurtain(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.startList.forEach((el, index) => {
|
||||
this.inputData[el + 2] = this.countData10(this.inputData[el + 2])
|
||||
this.inputData[el + 8] = this.countData10(this.inputData[el + 8])
|
||||
})
|
||||
this.getActive1()
|
||||
}
|
||||
})
|
||||
},
|
||||
//二进制转换后的补全
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
//反转数组 不影响原数组
|
||||
myReverse(arr) {
|
||||
return [...arr].reverse()
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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>
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
<template>
|
||||
<div class="internalInsulation">
|
||||
<div class="table-title">
|
||||
<img src="../../assets/img/internalInsulation.png" alt="">内保温
|
||||
<img src="../../assets/img/internalInsulation.png" alt="">内保温{{ indexs }}
|
||||
</div>
|
||||
<div class="title-tips">工作方式选择</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn ">
|
||||
<div class="btn" :class="openIndex == 1 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1)" :class="inputData[startList[indexs - 1]] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 2 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(2)" :class="inputData[startList[indexs - 1]] == 2 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet3.png" alt="" />手动打开
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 3 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(3)" :class="inputData[startList[indexs - 1]] == 3 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />手动关闭
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 4 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(4)" :class="inputData[startList[indexs - 1]] == 4 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />停止
|
||||
</div>
|
||||
</div>
|
||||
|
@ -23,21 +23,27 @@
|
|||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>夜间保温时段:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+3, $event)" v-model="inputData[startList[indexs-1]+3]" @input="change(startList[indexs-1]+3, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+4, $event)" v-model="inputData[startList[indexs-1]+4]" @input="change(startList[indexs-1]+4, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+5, $event)" v-model="inputData[startList[indexs-1]+5]" @input="change(startList[indexs-1]+5, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+6, $event)" v-model="inputData[startList[indexs-1]+6]" @input="change(startList[indexs-1]+6, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>夜间保温结束时,分</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+10, $event)" v-model="inputData[startList[indexs-1]+10]" @input="change(startList[indexs-1]+10, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>步收拢内保温,间隔时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+11, $event)" v-model="inputData[startList[indexs-1]+11]" @input="change(startList[indexs-1]+11, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -45,39 +51,43 @@
|
|||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(0)" :class="actList1[0] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[0] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>室内温度高于目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs - 1] + 2, $event)" v-model="inputData[startList[indexs - 1] + 2]"
|
||||
@input="changeCount10(startList[indexs - 1] + 2, $event)" type="text" placeholder="0">
|
||||
<span>度,展开内保温。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(1)" :class="actList1[1] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[1] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>天窗除湿时,内保温开启角度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+7, $event)" v-model="inputData[startList[indexs-1]+7]" @input="change(startList[indexs-1]+7, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(2)" :class="actList1[2] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[2] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>光照大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs - 1] + 8, $event)" v-model="inputData[startList[indexs - 1] + 8]"
|
||||
@input="changeCount10(startList[indexs - 1] + 8, $event)" type="text" placeholder="0">
|
||||
<span>时,提前</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+9, $event)" v-model="inputData[startList[indexs-1]+9]" @input="change(startList[indexs-1]+9, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟收拢内保温。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -89,10 +99,246 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
openIndex: 1,
|
||||
inputData: [],
|
||||
startList: [22000, 22012],//每个阀门的起始参数
|
||||
indexs: 1,
|
||||
actList1: [],
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {},
|
||||
watch: {
|
||||
$route(newVal, oldVal) {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.getActive1();
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
// 计算展示值 计算公式 (x - 400) / 10
|
||||
countData(data) {
|
||||
if (data) {
|
||||
return (data - 400) / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//失去焦点
|
||||
blurChangeCount(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: (el.target.value * 10) + 400,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = (el.target.value * 10) + 400
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen(active) {
|
||||
if (this.actList1[active] == '1') {
|
||||
this.actList1[active] = '0'
|
||||
} else {
|
||||
this.actList1[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList1.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.inputData[this.startList[this.indexs - 1] + 1]=parseInt(num, 2)
|
||||
this.changeBtn(this.startList[this.indexs - 1] + 1, dataNum);
|
||||
},
|
||||
getActive1() {
|
||||
this.actList1 = []
|
||||
var num = this.inputData[this.startList[this.indexs - 1] + 1]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 3)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList1 = openListNew.reverse();
|
||||
},
|
||||
// 工作方式选择
|
||||
changeOpen(index) {
|
||||
this.inputData[this.startList[this.indexs - 1]] = index;
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: index,
|
||||
},
|
||||
};
|
||||
this.changeBtn(this.startList[this.indexs - 1], dataNum);
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.interiorthermalinsulation(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.startList.forEach((el, index) => {
|
||||
this.inputData[el + 2] = this.countData10(this.inputData[el + 2])
|
||||
this.inputData[el + 8] = this.countData10(this.inputData[el + 8])
|
||||
})
|
||||
this.getActive1()
|
||||
}
|
||||
})
|
||||
},
|
||||
//二进制转换后的补全
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
//反转数组 不影响原数组
|
||||
myReverse(arr) {
|
||||
return [...arr].reverse()
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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>
|
||||
|
|
|
@ -4,240 +4,482 @@
|
|||
<img src="../../assets/img/intrinsicParameter.png" alt="">设备固有参数
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>1#电磁阀自控传感器选择</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand($event,20650)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20650]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<span></span>
|
||||
<input @blur="blurChange(20651, $event)" v-model="inputData[20651]" @input="change(20651, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>2#电磁阀自控传感器选择</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand($event,20652)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20652]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20653, $event)" v-model="inputData[20653]" @input="change(20653, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>3#电磁阀自控传感器选择</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand($event,20654)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20654]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<span></span>
|
||||
<input @blur="blurChange(20655, $event)" v-model="inputData[20655]" @input="change(20655, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>4#电磁阀自控传感器选择</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand($event,20656)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20656]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20657, $event)" v-model="inputData[20657]" @input="change(20657, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>5#电磁阀自控传感器选择</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand($event,20658)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20658]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<span></span>
|
||||
<input @blur="blurChange(20659, $event)" v-model="inputData[20659]" @input="change(20659, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>6#电磁阀自控传感器选择</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand($event,20660)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20660]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20661, $event)" v-model="inputData[20661]" @input="change(20661, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>7#电磁阀自控传感器选择</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand($event,20662)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20662]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<span></span>
|
||||
<input @blur="blurChange(20663, $event)" v-model="inputData[20663]" @input="change(20663, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>8#电磁阀自控传感器选择</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand($event,20664)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20664]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20665, $event)" v-model="inputData[20665]" @input="change(20665, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>湿帘水泵1-2组输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20724, $event)" v-model="inputData[20724]" @input="change(20724, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20725, $event)" v-model="inputData[20725]" @input="change(20725, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>环流风扇1-2组输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20722, $event)" v-model="inputData[20722]" @input="change(20722, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20723, $event)" v-model="inputData[20723]" @input="change(20723, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>高压微雾1-2组输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20721, $event)" v-model="inputData[20721]" @input="change(20721, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20720, $event)" v-model="inputData[20720]" @input="change(20720, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>冷暖风机1-2组输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20727, $event)" v-model="inputData[20727]" @input="change(20727, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20728, $event)" v-model="inputData[20728]" @input="change(20728, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20729, $event)" v-model="inputData[20729]" @input="change(20729, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20730, $event)" v-model="inputData[20730]" @input="change(20730, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>模式选择</span>
|
||||
<el-dropdown @command="handleCommand1($event,20726)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20726]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<!-- <div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>CO2补气1-2组输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>轴流风机1-5组输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20707, $event)" v-model="inputData[20707]" @input="change(20707, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20708, $event)" v-model="inputData[20708]" @input="change(20708, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20709, $event)" v-model="inputData[20709]" @input="change(20709, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20710, $event)" v-model="inputData[20710]" @input="change(20710, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20711, $event)" v-model="inputData[20711]" @input="change(20711, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span></span>
|
||||
<span>补光灯1-8组输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20712, $event)" v-model="inputData[20712]" @input="change(20712, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20713, $event)" v-model="inputData[20713]" @input="change(20713, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20714, $event)" v-model="inputData[20714]" @input="change(20714, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20715, $event)" v-model="inputData[20715]" @input="change(20715, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20716, $event)" v-model="inputData[20716]" @input="change(20716, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20717, $event)" v-model="inputData[20717]" @input="change(20717, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20718, $event)" v-model="inputData[20718]" @input="change(20718, $event)"
|
||||
type="text" placeholder="0">
|
||||
<input @blur="blurChange(20719, $event)" v-model="inputData[20719]" @input="change(20719, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>1#天窗全程运行时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20667, $event)" v-model="inputData[20667]" @input="change(20667, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20669, $event)" v-model="inputData[20669]" @input="change(20669, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20670, $event)" v-model="inputData[20670]" @input="change(20670, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>天窗朝向</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand2($event,20668)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20668]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>2#天窗全程运行时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20671, $event)" v-model="inputData[20671]" @input="change(20671, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20673, $event)" v-model="inputData[20673]" @input="change(20673, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20674, $event)" v-model="inputData[20674]" @input="change(20674, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>天窗朝向</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand2($event,20672)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20672]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>3#天窗全程运行时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20675, $event)" v-model="inputData[20675]" @input="change(20675, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20677, $event)" v-model="inputData[20677]" @input="change(20677, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20678, $event)" v-model="inputData[20678]" @input="change(20678, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>天窗朝向</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand2($event,20676)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20676]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>4#天窗全程运行时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20679, $event)" v-model="inputData[20679]" @input="change(20679, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20681, $event)" v-model="inputData[20681]" @input="change(20681, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20682, $event)" v-model="inputData[20682]" @input="change(20682, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>天窗朝向</span>
|
||||
<input type="text" placeholder="0">
|
||||
<el-dropdown @command="handleCommand2($event,20680)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="inputDataNew[20680]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>所有设备的行程保护时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20666, $event)" v-model="inputData[20666]" @input="change(20666, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="title-tips-bold">设备位置</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>经度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(20896, $event)" v-model="inputData[20896]" @input="changeCount10(20896, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>维度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(20897, $event)" v-model="inputData[20897]" @input="changeCount10(20897, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>1#内遮阳全程运行时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20683, $event)" v-model="inputData[20683]" @input="change(20683, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20684, $event)" v-model="inputData[20684]" @input="change(20684, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20685, $event)" v-model="inputData[20685]" @input="change(20685, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>2#内遮阳全程运行时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20686, $event)" v-model="inputData[20686]" @input="change(20686, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20687, $event)" v-model="inputData[20687]" @input="change(20687, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20688, $event)" v-model="inputData[20688]" @input="change(20688, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>1#外遮阳全程运行时间</span>
|
||||
<input @blur="blurChange(20689, $event)" v-model="inputData[20689]" @input="change(20689, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input @blur="blurChange(20690, $event)" v-model="inputData[20690]" @input="change(20690, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input @blur="blurChange(20691, $event)" v-model="inputData[20691]" @input="change(20691, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>2#外遮阳全程运行时间</span>
|
||||
<input @blur="blurChange(20692, $event)" v-model="inputData[20692]" @input="change(20692, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input @blur="blurChange(20693, $event)" v-model="inputData[20693]" @input="change(20693, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input @blur="blurChange(20694, $event)" v-model="inputData[20694]" @input="change(20694, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>1#内保温全程运行时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20695, $event)" v-model="inputData[20695]" @input="change(20695, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20696, $event)" v-model="inputData[20696]" @input="change(20696, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20697, $event)" v-model="inputData[20697]" @input="change(20697, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>2#内保温全程运行时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20698, $event)" v-model="inputData[20698]" @input="change(20698, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20699, $event)" v-model="inputData[20699]" @input="change(20699, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20700, $event)" v-model="inputData[20700]" @input="change(20700, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>1#湿帘窗全程运行时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20701, $event)" v-model="inputData[20701]" @input="change(20701, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20702, $event)" v-model="inputData[20702]" @input="change(20702, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20703, $event)" v-model="inputData[20703]" @input="change(20703, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>2#湿帘窗全程运行时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20704, $event)" v-model="inputData[20704]" @input="change(20704, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>打开输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20705, $event)" v-model="inputData[20705]" @input="change(20705, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>关闭输出通道:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20706, $event)" v-model="inputData[20706]" @input="change(20706, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -245,10 +487,214 @@
|
|||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
sensorType: '',
|
||||
typeList1: [{ label: '平均1#土壤湿度', value: 0 },
|
||||
{ label: '1#土壤湿度', value: 1 },
|
||||
{ label: '2#土壤湿度', value: 2 },
|
||||
{ label: '3#土壤湿度', value: 3 },
|
||||
{ label: '4#土壤湿度', value: 4 },
|
||||
{ label: '5#土壤湿度', value: 5 },
|
||||
{ label: '6#土壤湿度', value: 6 },
|
||||
{ label: '7#土壤湿度', value: 7 },
|
||||
{ label: '8#土壤湿度', value: 8 },],
|
||||
list1:[20650,20652,20654,20656,20658,20660,20662,20664],
|
||||
typeList2: [
|
||||
{ label: '东', value: 1 },
|
||||
{ label: '西', value: 2 },
|
||||
{ label: '南', value: 3 },
|
||||
{ label: '北', value: 4 },
|
||||
{ label: '东南', value: 5 },
|
||||
{ label: '东北', value: 6 },
|
||||
{ label: '西南', value: 7 },
|
||||
{ label: '西北', value: 8 },],
|
||||
list2:[20668,20672,20676,20680],
|
||||
typeList3: [
|
||||
{ label: '加热模式', value: 1 },
|
||||
{ label: '制冷模式', value: 2 },],
|
||||
inputData:[],
|
||||
inputDataNew:[],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.dataInit()
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
getData1(data) {
|
||||
var name=''
|
||||
this.typeList1.forEach((el, index) => {
|
||||
if (el.value == data) {
|
||||
name=el.label
|
||||
}
|
||||
})
|
||||
return name
|
||||
},
|
||||
getData2(data) {
|
||||
var name=''
|
||||
this.typeList2.forEach((el, index) => {
|
||||
if (el.value == data) {
|
||||
name=el.label
|
||||
}
|
||||
})
|
||||
return name
|
||||
},
|
||||
getData3(data) {
|
||||
var name=''
|
||||
this.typeList3.forEach((el, index) => {
|
||||
if (el.value == data) {
|
||||
name=el.label
|
||||
}
|
||||
})
|
||||
return name
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.intrinsicParameter(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData =JSON.parse(JSON.stringify(res.data.data));
|
||||
this.inputDataNew=JSON.parse(JSON.stringify(res.data.data))
|
||||
this.inputData[20896] =this.countData10(this.inputData[20896]);
|
||||
this.inputData[20897] =this.countData10(this.inputData[20897]);
|
||||
this.list1.forEach((el,index)=>{
|
||||
this.inputDataNew[el]=this.getData1(this.inputData[el])
|
||||
})
|
||||
this.list2.forEach((el,index)=>{
|
||||
this.inputDataNew[el]=this.getData2(this.inputData[el])
|
||||
})
|
||||
this.inputDataNew[20726]=this.getData3(this.inputData[20726])
|
||||
console.log(this.inputData, this.inputDataNew);
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
//类型选择
|
||||
handleCommand(command,code) {
|
||||
this.typeList1.forEach((el, index) => {
|
||||
if (el.value == command) {
|
||||
this.inputDataNew[code] = el.label
|
||||
}
|
||||
})
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: command,
|
||||
},
|
||||
};
|
||||
this.changeBtn(code, dataNum);
|
||||
},
|
||||
|
||||
//类型选择
|
||||
handleCommand1(command,code) {
|
||||
this.typeList3.forEach((el, index) => {
|
||||
if (el.value == command) {
|
||||
this.inputDataNew[code] = el.label
|
||||
}
|
||||
})
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: command,
|
||||
},
|
||||
};
|
||||
this.changeBtn(code, dataNum);
|
||||
},
|
||||
|
||||
//类型选择
|
||||
handleCommand2(command,code) {
|
||||
this.typeList2.forEach((el, index) => {
|
||||
if (el.value == command) {
|
||||
this.inputDataNew[code] = el.label
|
||||
}
|
||||
})
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: command,
|
||||
},
|
||||
};
|
||||
this.changeBtn(code, dataNum);
|
||||
},
|
||||
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
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() { },
|
||||
methods: {},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
<div class="page-content">
|
||||
<div class="table-title">
|
||||
<img src="../../assets/image/irrigateSet.png" alt="" />
|
||||
{{ indexs }}#灌溉组配置
|
||||
<div class="tips">种植作物1</div>
|
||||
{{$store.state.equipmentName['solenoid' + $store.state.nameList[indexs-1]]}}
|
||||
<div class="tips"> {{$store.state.equipmentName['solenoid' + $store.state.nameList[indexs-1]]}}</div>
|
||||
</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn">
|
||||
|
@ -20,9 +20,6 @@
|
|||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="input-main">
|
||||
<span>手动启动时间</span>
|
||||
|
|
|
@ -1,95 +1,118 @@
|
|||
<template>
|
||||
<div class="outsizeSunshade">
|
||||
<div class="table-title">
|
||||
<img src="../../assets/img/outsizeSunshade.png" alt="">外遮阳控制
|
||||
<img src="../../assets/img/outsizeSunshade.png" alt="">外遮阳{{ indexs }}
|
||||
</div>
|
||||
<div class="title-tips">工作方式选择</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn ">
|
||||
<div class="btn" :class="openIndex == 1 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1)" :class="inputData[startList[indexs-1]] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 2 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(2)" :class="inputData[startList[indexs-1]] == 2 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet3.png" alt="" />手动打开
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 3 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(3)" :class="inputData[startList[indexs-1]] == 3 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />手动关闭
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 4 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(4)" :class="inputData[startList[indexs-1]] == 4 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />停止
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(0)" :class="actList1[0] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[0] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>工作时段限制:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+2, $event)" v-model="inputData[startList[indexs-1]+2]" @input="change(startList[indexs-1]+2, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+3, $event)" v-model="inputData[startList[indexs-1]+3]" @input="change(startList[indexs-1]+3, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+4, $event)" v-model="inputData[startList[indexs-1]+4]" @input="change(startList[indexs-1]+4, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+5, $event)" v-model="inputData[startList[indexs-1]+5]" @input="change(startList[indexs-1]+5, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(4)" :class="actList1[4] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[4] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>降雨时遮阳网处于的位置</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+13, $event)" v-model="inputData[startList[indexs-1]+13]" @input="change(startList[indexs-1]+13, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>%</span>
|
||||
<span>降雨确认时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+14, $event)" v-model="inputData[startList[indexs-1]+14]" @input="change(startList[indexs-1]+14, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(1)" :class="actList1[1] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[1] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>室外光照大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs-1]+7, $event)" v-model="inputData[startList[indexs-1]+7]" @input="changeCount10(startList[indexs-1]+7, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,展开外遮阳</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+8, $event)" v-model="inputData[startList[indexs-1]+8]" @input="change(startList[indexs-1]+8, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>% (KLux)。光照确认时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+6, $event)" v-model="inputData[startList[indexs-1]+6]" @input="change(startList[indexs-1]+6, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>室外光照大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs-1]+9, $event)" v-model="inputData[startList[indexs-1]+9]" @input="changeCount10(startList[indexs-1]+9, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,外遮阳展开 100%(KLux)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(3)" :class="actList1[3] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[3] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>风速大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+11, $event)" v-model="inputData[startList[indexs-1]+11]" @input="change(startList[indexs-1]+11, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时收拢遮阳网,大风保护解除时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs-1]+12, $event)" v-model="inputData[startList[indexs-1]+12]" @input="changeCount10(startList[indexs-1]+12, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(2)" :class="actList1[2] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[2] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>室内温度高于目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs-1]+10, $event)" v-model="inputData[startList[indexs-1]+10]" @input="changeCount10(startList[indexs-1]+10, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>度,展开外遮阳。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -99,11 +122,249 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
openIndex:1,
|
||||
inputData: [],
|
||||
startList: [21900,21915],//每个阀门的起始参数
|
||||
indexs: 1,
|
||||
actList1: [],
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {},
|
||||
watch: {
|
||||
$route(newVal, oldVal) {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.getActive1();
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
// 计算展示值 计算公式 (x - 400) / 10
|
||||
countData(data) {
|
||||
if (data) {
|
||||
return (data - 400) / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//失去焦点
|
||||
blurChangeCount(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: (el.target.value * 10) + 400,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = (el.target.value * 10) + 400
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen(active) {
|
||||
if (this.actList1[active] == '1') {
|
||||
this.actList1[active] = '0'
|
||||
} else {
|
||||
this.actList1[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList1.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.inputData[this.startList[this.indexs - 1] + 1]=parseInt(num, 2)
|
||||
this.changeBtn(this.startList[this.indexs - 1] + 1, dataNum);
|
||||
},
|
||||
getActive1() {
|
||||
this.actList1 = []
|
||||
var num = this.inputData[this.startList[this.indexs - 1] + 1]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 5)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList1 = openListNew.reverse();
|
||||
},
|
||||
// 工作方式选择
|
||||
changeOpen(index) {
|
||||
this.inputData[this.startList[this.indexs-1]] = index;
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: index,
|
||||
},
|
||||
};
|
||||
this.changeBtn(this.startList[this.indexs - 1], dataNum);
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.externalsunshade(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.startList.forEach((el, index) => {
|
||||
this.inputData[el + 7] = this.countData10(this.inputData[el + 7])
|
||||
this.inputData[el + 9] = this.countData10(this.inputData[el + 9])
|
||||
this.inputData[el + 10] = this.countData10(this.inputData[el + 10])
|
||||
this.inputData[el + 12] = this.countData10(this.inputData[el + 12])
|
||||
|
||||
})
|
||||
this.getActive1()
|
||||
}
|
||||
})
|
||||
},
|
||||
//二进制转换后的补全
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
//反转数组 不影响原数组
|
||||
myReverse(arr) {
|
||||
return [...arr].reverse()
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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>
|
||||
|
|
|
@ -6,26 +6,26 @@
|
|||
<div class="flex-view shrink-none border-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>1#外遮阳:目标温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand3($event,21745)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21745]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21744)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21744]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -34,26 +34,26 @@
|
|||
<div class="flex-view shrink-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>2#外遮阳:目标温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand3($event,21747)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21747]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21746)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21746]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -63,52 +63,52 @@
|
|||
<div class="flex-view shrink-none border-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>1#内遮阳:目标温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand3($event,21749)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21749]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21748)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21748]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>目标湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand4($event,21751)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21751]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList4" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand2($event,21750)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21750]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -118,52 +118,52 @@
|
|||
<div class="flex-view shrink-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>2#内遮阳:目标温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand3($event,21753)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21753]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21752)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21752]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>目标湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand4($event,21755)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21755]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList4" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand2($event,21754)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21754]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -173,52 +173,52 @@
|
|||
<div class="flex-view shrink-none border-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>1#天窗: 目标温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21757)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21757]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand3($event,21756)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21756]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>目标湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand4($event,21759)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21759]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList4" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand2($event,21758)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21758]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -228,52 +228,52 @@
|
|||
<div class="flex-view shrink-none border-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>2#天窗: 目标温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand3($event,21761)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21761]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21760)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21760]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>目标湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand4($event,21763)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21763]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList4" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand2($event,21762)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21762]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -283,52 +283,52 @@
|
|||
<div class="flex-view shrink-none border-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>3#天窗: 目标温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand3($event,21765)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21765]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21764)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21764]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>目标湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand4($event,21767)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21767]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList4" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand2($event,21766)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21766]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -338,52 +338,52 @@
|
|||
<div class="flex-view shrink-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>4#天窗: 目标温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand3($event,21769)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21769]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21768)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21768]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>目标湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand4($event,21771)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21771]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList4" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand2($event,21770)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21770]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -393,26 +393,26 @@
|
|||
<div class="flex-view shrink-none border-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环流风机: 1#风扇室内湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand2($event,21730)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21730]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>2#风扇室内湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand2($event,21731)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21731]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -421,26 +421,26 @@
|
|||
<div class="flex-view shrink-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>湿帘外翻窗:1#湿帘窗温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21742)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21742]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>2#湿帘窗温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21743)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21743]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -450,52 +450,52 @@
|
|||
<div class="flex-view shrink-none border-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span class="padding-none">1#高压微雾:目标温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand3($event,21733)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21733]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21732)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21732]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>目标湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand4($event,21735)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21735]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList4" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand2($event,21734)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21734]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -504,52 +504,52 @@
|
|||
<div class="flex-view shrink-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span class="padding-none">2#高压微雾:目标温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand3($event,21737)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21737]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21736)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21736]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>目标湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand4($event,21739)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21739]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList4" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境湿度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand2($event,21738)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21738]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -559,26 +559,26 @@
|
|||
<div class="flex-view shrink-none border-none">
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>轴流风机: 目标温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand3($event,21741)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21741]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList3" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="input-sel input-sel-w180">
|
||||
<span>环境温度选择</span>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-dropdown @command="handleCommand1($event,21740)">
|
||||
<div class="el-dropdown-link">
|
||||
<input v-model="sensorType" type="text" class="input-input" placeholder="无">
|
||||
<input v-model="inputDataNew[21740]" type="text" class="input-input" placeholder="无">
|
||||
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
|
||||
</div>
|
||||
<el-dropdown-menu class="input-menu-180" slot="dropdown">
|
||||
<el-dropdown-item v-for="item, index in typeList" :key="index" :command="item.value">{{
|
||||
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
|
||||
item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -591,16 +591,211 @@
|
|||
data(){
|
||||
return {
|
||||
sensorType:'',
|
||||
typeList: [{ label: '无意义的传感器', value: 0, countType: 0, unit: '' },
|
||||
{ label: '空气温度', value: 1, countType: 3, unit: '℃' },
|
||||
{ label: '空气湿度', value: 2, countType: 2, unit: '%' },]
|
||||
typeList1: [
|
||||
{ label: '1#平均空气温度', value: 1 },
|
||||
{ label: '2#平均空气温度', value: 2 },
|
||||
{ label: '1#空气温度', value: 3 },
|
||||
{ label: '2#空气温度', value: 4 },
|
||||
{ label: '3#空气温度', value: 5 },
|
||||
{ label: '4#空气温度', value: 6 },
|
||||
{ label: '5#空气温度', value: 7 },
|
||||
{ label: '6#空气温度', value: 8 },
|
||||
{ label: '7#空气温度', value: 7 },
|
||||
{ label: '8#空气温度', value: 8 },],
|
||||
list1:[21732,21736,21740,21742,21743,21744,21746,21748,21752,21756,21760,21764,21768],
|
||||
typeList2: [
|
||||
{ label: '1#平均空气湿度', value: 1 },
|
||||
{ label: '2#平均空气湿度', value: 2 },
|
||||
{ label: '1#空气湿度', value: 3 },
|
||||
{ label: '2#空气湿度', value: 4 },
|
||||
{ label: '3#空气湿度', value: 5 },
|
||||
{ label: '4#空气湿度', value: 6 },
|
||||
{ label: '5#空气湿度', value: 7 },
|
||||
{ label: '6#空气湿度', value: 8 },
|
||||
{ label: '7#空气湿度', value: 7 },
|
||||
{ label: '8#空气湿度', value: 8 },],
|
||||
list2:[21730,21731,21734,21738,21750,21754,21758,21762,21766,21770],
|
||||
typeList3: [
|
||||
{ label: '目标温度1', value: 1 },
|
||||
{ label: '目标温度2', value: 2 },],
|
||||
list3:[21733,21737,21741,21745,21747,21749,21753,21757,21761,21765,21769],
|
||||
typeList4: [
|
||||
{ label: '目标湿度1', value: 1 },
|
||||
{ label: '目标湿度2', value: 2 },],
|
||||
list4:[21735,21739,21751,21755,21759,21763,21767,21771],
|
||||
inputData:[],
|
||||
inputDataNew:[],
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.dataInit()
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
mounted(){},
|
||||
methods:{
|
||||
getData1(data) {
|
||||
var name=''
|
||||
this.typeList1.forEach((el, index) => {
|
||||
if (el.value == data) {
|
||||
name=el.label
|
||||
}
|
||||
})
|
||||
return name
|
||||
},
|
||||
getData2(data) {
|
||||
var name=''
|
||||
this.typeList2.forEach((el, index) => {
|
||||
if (el.value == data) {
|
||||
name=el.label
|
||||
}
|
||||
})
|
||||
return name
|
||||
},
|
||||
getData3(data) {
|
||||
var name=''
|
||||
this.typeList3.forEach((el, index) => {
|
||||
if (el.value == data) {
|
||||
name=el.label
|
||||
}
|
||||
})
|
||||
return name
|
||||
},
|
||||
getData4(data) {
|
||||
var name=''
|
||||
this.typeList4.forEach((el, index) => {
|
||||
if (el.value == data) {
|
||||
name=el.label
|
||||
}
|
||||
})
|
||||
return name
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.manufacturerparameter(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData =JSON.parse(JSON.stringify(res.data.data));
|
||||
this.inputDataNew=JSON.parse(JSON.stringify(res.data.data))
|
||||
|
||||
this.list1.forEach((el,index)=>{
|
||||
this.inputDataNew[el]=this.getData1(this.inputData[el])
|
||||
})
|
||||
this.list2.forEach((el,index)=>{
|
||||
this.inputDataNew[el]=this.getData2(this.inputData[el])
|
||||
})
|
||||
this.list3.forEach((el,index)=>{
|
||||
this.inputDataNew[el]=this.getData3(this.inputData[el])
|
||||
})
|
||||
this.list4.forEach((el,index)=>{
|
||||
this.inputDataNew[el]=this.getData4(this.inputData[el])
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
//类型选择
|
||||
handleCommand(command) {
|
||||
console.log(command);
|
||||
handleCommand1(command,code) {
|
||||
this.typeList1.forEach((el, index) => {
|
||||
if (el.value == command) {
|
||||
this.inputDataNew[code] = el.label
|
||||
}
|
||||
})
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: command,
|
||||
},
|
||||
};
|
||||
this.changeBtn(code, dataNum);
|
||||
},
|
||||
//类型选择
|
||||
handleCommand2(command,code) {
|
||||
this.typeList2.forEach((el, index) => {
|
||||
if (el.value == command) {
|
||||
this.inputDataNew[code] = el.label
|
||||
}
|
||||
})
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: command,
|
||||
},
|
||||
};
|
||||
this.changeBtn(code, dataNum);
|
||||
},
|
||||
//类型选择
|
||||
handleCommand3(command,code) {
|
||||
this.typeList3.forEach((el, index) => {
|
||||
if (el.value == command) {
|
||||
this.inputDataNew[code] = el.label
|
||||
}
|
||||
})
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: command,
|
||||
},
|
||||
};
|
||||
this.changeBtn(code, dataNum);
|
||||
},
|
||||
//类型选择
|
||||
handleCommand4(command,code) {
|
||||
this.typeList4.forEach((el, index) => {
|
||||
if (el.value == command) {
|
||||
this.inputDataNew[code] = el.label
|
||||
}
|
||||
})
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: command,
|
||||
},
|
||||
};
|
||||
this.changeBtn(code, dataNum);
|
||||
},
|
||||
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
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</div> -->
|
||||
<div class="table-title">
|
||||
<img src="../../assets/image/real-time.png" alt="" />
|
||||
实时数据
|
||||
实时数据<span class="outline" v-if="deviceState==0">(设备离线)</span>
|
||||
</div>
|
||||
<div class="timeNow" v-if="list.length">
|
||||
<!-- {{ time.year.year }}-{{ time.year.month }}-{{ time.year.date }}<span> {{ time.time }}:{{ time.timeS
|
||||
|
@ -337,6 +337,7 @@ export default {
|
|||
url: '',
|
||||
timer: null,
|
||||
deviceName: 1,
|
||||
deviceState:1,
|
||||
controlList: [],
|
||||
statusInterval: null,//status状态的Interval
|
||||
statusTime: 2,//status状态的秒数
|
||||
|
@ -379,6 +380,7 @@ export default {
|
|||
const store = this.$store.state
|
||||
this.indexs = this.$route.query.index ? this.$route.query.index : store.equipmentIndex;
|
||||
this.deviceName = store.equipmentList[this.indexs - 1].deviceName
|
||||
this.deviceState = store.equipmentList[this.indexs - 1].deviceState
|
||||
clearInterval(this.statusInterval) && this.statusInterval
|
||||
setTimeout(() => {
|
||||
|
||||
|
@ -398,6 +400,7 @@ export default {
|
|||
const store = this.$store.state
|
||||
this.indexs = this.$route.query.index ? this.$route.query.index : store.equipmentIndex;
|
||||
this.deviceName = store.equipmentList[this.indexs - 1].deviceName
|
||||
this.deviceState = store.equipmentList[this.indexs - 1].deviceState
|
||||
// this.getTime()
|
||||
|
||||
setTimeout(() => {
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
<template>
|
||||
<div class="sunroofControl">
|
||||
<div class="table-title">
|
||||
<img src="../../assets/img/sunroofControl.png" alt="">天窗控制
|
||||
<img src="../../assets/img/sunroofControl.png" alt="">天窗{{indexs}}
|
||||
</div>
|
||||
<div class="title-tips">工作方式选择</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn ">
|
||||
<div class="btn" :class="openIndex == 1 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1)" :class="inputData[startList[indexs-1]] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 2 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(2)" :class="inputData[startList[indexs-1]] == 2 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet3.png" alt="" />手动打开
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 3 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(3)" :class="inputData[startList[indexs-1]] == 3 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />手动关闭
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 4 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(4)" :class="inputData[startList[indexs-1]] == 4 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />停止
|
||||
</div>
|
||||
</div>
|
||||
|
@ -26,12 +26,14 @@
|
|||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<div>温度控制精度</div>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs-1]+3, $event)" v-model="inputData[startList[indexs-1]+3]" @input="changeCount10(startList[indexs-1]+3, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<div>计算周期</div>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+5, $event)" v-model="inputData[startList[indexs-1]+5]" @input="change(startList[indexs-1]+5, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -41,12 +43,14 @@
|
|||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<div>比例系数</div>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+6, $event)" v-model="inputData[startList[indexs-1]+6]" @input="change(startList[indexs-1]+6, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<div>积分系数</div>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+7, $event)" v-model="inputData[startList[indexs-1]+7]" @input="change(startList[indexs-1]+7, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -56,7 +60,8 @@
|
|||
</div>
|
||||
<div class="input-main input-main-w260">
|
||||
<div>天窗分阶段全部打开次数</div>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+4, $event)" v-model="inputData[startList[indexs-1]+4]" @input="change(startList[indexs-1]+4, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view padding-none">
|
||||
|
@ -65,89 +70,366 @@
|
|||
</div>
|
||||
<div class="input-main input-main-w260">
|
||||
<div>风机运行时,天窗打开角度</div>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+2, $event)" v-model="inputData[startList[indexs-1]+2]" @input="change(startList[indexs-1]+2, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(0)" :class="actList1[0] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[0] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<span>室外温度低于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(startList[indexs-1]+8, $event)" v-model="inputData[startList[indexs-1]+8]" @input="changeCountData(startList[indexs-1]+8, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>度禁止开启天窗。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(1)" :class="actList1[1] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[1] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<span>风速大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs-1]+13, $event)" v-model="inputData[startList[indexs-1]+13]" @input="changeCount10(startList[indexs-1]+13, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,关闭天窗。大风保护解除时间</span>
|
||||
</div>
|
||||
<div class="input-main input-main-w80">
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+14, $event)" v-model="inputData[startList[indexs-1]+14]" @input="change(startList[indexs-1]+14, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none ">
|
||||
<div class="input-btn">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(3)" :class="actList1[3] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[3] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<span>开启天窗除湿功能;</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none ">
|
||||
<div class="input-btn">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(4)" :class="actList1[4] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[4] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<span>选择下雨保护条件有效;</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(5)" :class="actList1[5] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[5] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<span>开启天窗除湿功能:</span>
|
||||
<span>选择有雨量桶检测条件有效;</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none">
|
||||
<div class="input-main input-main-w100">
|
||||
<span>湿度控制精度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs-1]+9, $event)" v-model="inputData[startList[indexs-1]+9]" @input="changeCount10(startList[indexs-1]+9, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>天窗除湿时开启角度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+12, $event)" v-model="inputData[startList[indexs-1]+12]" @input="change(startList[indexs-1]+12, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-main input-main-w100">
|
||||
<span>实测温度比目标温度低</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(startList[indexs-1]+15, $event)" v-model="inputData[startList[indexs-1]+15]" @input="changeCount10(startList[indexs-1]+15, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>将进行间断除湿开</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+10, $event)" v-model="inputData[startList[indexs-1]+10]" @input="change(startList[indexs-1]+10, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟,关</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(startList[indexs-1]+11, $event)" v-model="inputData[startList[indexs-1]+11]" @input="change(startList[indexs-1]+11, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(2)" :class="actList1[2] == '1' ? 'blue' : 'off'">
|
||||
{{ actList1[2] == '1' ? '有效' : '无效' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main input-main-w120">
|
||||
<span>室内温度低于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(startList[indexs-1]+16, $event)" v-model="inputData[startList[indexs-1]+16]" @input="changeCountData(startList[indexs-1]+16, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>度,禁止开窗除湿。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view padding-none">
|
||||
<div class="input-main input-main-w120">
|
||||
<span>下雨检测时间</span>
|
||||
<input @blur="blurChange(startList[indexs-1]+17, $event)" v-model="inputData[startList[indexs-1]+17]" @input="change(startList[indexs-1]+17, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
openIndex: 1
|
||||
inputData: [],
|
||||
startList: [21250, 21273, 21296, 21319],//每个阀门的起始参数
|
||||
indexs: 1,
|
||||
actList1: [],
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {},
|
||||
watch: {
|
||||
$route(newVal, oldVal) {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.getActive1();
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
// 计算展示值 计算公式 (x - 400) / 10
|
||||
countData(data) {
|
||||
if (data) {
|
||||
return (data - 400) / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//失去焦点
|
||||
blurChangeCount(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: (el.target.value * 10) + 400,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = (el.target.value * 10) + 400
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen(active) {
|
||||
if (this.actList1[active] == '1') {
|
||||
this.actList1[active] = '0'
|
||||
} else {
|
||||
this.actList1[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList1.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.inputData[this.startList[this.indexs - 1] + 1]=parseInt(num, 2)
|
||||
this.changeBtn(this.startList[this.indexs - 1] + 1, dataNum);
|
||||
},
|
||||
getActive1() {
|
||||
this.actList1 = []
|
||||
var num = this.inputData[this.startList[this.indexs - 1] + 1]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 6)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList1 = openListNew.reverse();
|
||||
},
|
||||
// 工作方式选择
|
||||
changeOpen(index) {
|
||||
this.inputData[this.startList[this.indexs-1]] = index;
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: index,
|
||||
},
|
||||
};
|
||||
this.changeBtn(this.startList[this.indexs - 1], dataNum);
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.readskylight(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.startList.forEach((el, index) => {
|
||||
this.inputData[el + 3] = this.countData10(this.inputData[el + 3])
|
||||
this.inputData[el + 8] = this.countData(this.inputData[el + 8])
|
||||
this.inputData[el + 9] = this.countData10(this.inputData[el + 9])
|
||||
this.inputData[el + 13] = this.countData10(this.inputData[el + 13])
|
||||
this.inputData[el + 15] = this.countData10(this.inputData[el + 15])
|
||||
this.inputData[el + 16] = this.countData(this.inputData[el + 16])
|
||||
})
|
||||
this.getActive1()
|
||||
}
|
||||
})
|
||||
},
|
||||
//二进制转换后的补全
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
//反转数组 不影响原数组
|
||||
myReverse(arr) {
|
||||
return [...arr].reverse()
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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>
|
||||
|
|
|
@ -6,76 +6,92 @@
|
|||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>1#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20064, $event)" v-model="inputData[20064]" @input="change(20064, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20065, $event)" v-model="inputData[20065]" @input="change(20065, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20067, $event)" v-model="inputData[20067]" @input="change(20067, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标CO2</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20066, $event)" v-model="inputData[20066]" @input="change(20066, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>2#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20068, $event)" v-model="inputData[20068]" @input="change(20068, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20069, $event)" v-model="inputData[20069]" @input="change(20069, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20071, $event)" v-model="inputData[20071]" @input="change(20071, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标CO2</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20070, $event)" v-model="inputData[20070]" @input="change(20070, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>3#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20072, $event)" v-model="inputData[20072]" @input="change(20072, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20073, $event)" v-model="inputData[20073]" @input="change(20073, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20075, $event)" v-model="inputData[20075]" @input="change(20075, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标CO2</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20074, $event)" v-model="inputData[20074]" @input="change(20074, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>4#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20076, $event)" v-model="inputData[20076]" @input="change(20076, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20077, $event)" v-model="inputData[20077]" @input="change(20077, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20079, $event)" v-model="inputData[20079]" @input="change(20079, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标CO2</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20078, $event)" v-model="inputData[20078]" @input="change(20078, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>%</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -85,10 +101,186 @@
|
|||
<script>
|
||||
export default {
|
||||
data(){
|
||||
return {}
|
||||
return {
|
||||
inputData:[],
|
||||
}
|
||||
},
|
||||
mounted(){},
|
||||
methods:{},
|
||||
|
||||
mounted() {
|
||||
const that = this;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
// 计算展示值 计算公式 (x - 400) / 10
|
||||
countData(data) {
|
||||
if (data) {
|
||||
return (data - 400) / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//失去焦点
|
||||
blurChangeCount(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: (el.target.value * 10) + 400,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = (el.target.value * 10) + 400
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.targetValue(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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>
|
||||
|
|
|
@ -9,76 +9,92 @@
|
|||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>1#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20032, $event)" v-model="inputData[20032]" @input="change(20032, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20033, $event)" v-model="inputData[20033]" @input="change(20033, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20035, $event)" v-model="inputData[20035]" @input="change(20035, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标湿度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(20034, $event)" v-model="inputData[20034]" @input="changeCount10(20034, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>2#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20036, $event)" v-model="inputData[20036]" @input="change(20036, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20037, $event)" v-model="inputData[20037]" @input="change(20037, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20039, $event)" v-model="inputData[20039]" @input="change(20039, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标湿度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(20038, $event)" v-model="inputData[20038]" @input="changeCount10(20038, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>3#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20040, $event)" v-model="inputData[20040]" @input="change(20040, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20041, $event)" v-model="inputData[20041]" @input="change(20041, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20043, $event)" v-model="inputData[20043]" @input="change(20043, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标湿度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(20042, $event)" v-model="inputData[20042]" @input="changeCount10(20042, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>4#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20044, $event)" v-model="inputData[20044]" @input="change(20044, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20045, $event)" v-model="inputData[20045]" @input="change(20045, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20047, $event)" v-model="inputData[20047]" @input="change(20047, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标湿度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(20046, $event)" v-model="inputData[20046]" @input="changeCount10(20046, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -89,76 +105,92 @@
|
|||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>1#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20048, $event)" v-model="inputData[20048]" @input="change(20048, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20049, $event)" v-model="inputData[20049]" @input="change(20049, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20051, $event)" v-model="inputData[20051]" @input="change(20051, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标湿度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(20050, $event)" v-model="inputData[20050]" @input="changeCount10(20050, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>2#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20052, $event)" v-model="inputData[20052]" @input="change(20052, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20053, $event)" v-model="inputData[20053]" @input="change(20053, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20055, $event)" v-model="inputData[20055]" @input="change(20055, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标湿度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(20054, $event)" v-model="inputData[20054]" @input="changeCount10(20054, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>3#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20056, $event)" v-model="inputData[20056]" @input="change(20056, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20057, $event)" v-model="inputData[20057]" @input="change(20057, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20059, $event)" v-model="inputData[20059]" @input="change(20059, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标湿度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(20058, $event)" v-model="inputData[20058]" @input="changeCount10(20058, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>4#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20060, $event)" v-model="inputData[20060]" @input="change(20060, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20061, $event)" v-model="inputData[20061]" @input="change(20061, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20063, $event)" v-model="inputData[20063]" @input="change(20063, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标湿度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(20062, $event)" v-model="inputData[20062]" @input="changeCount10(20062, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -167,10 +199,193 @@
|
|||
<script>
|
||||
export default {
|
||||
data(){
|
||||
return {}
|
||||
return {
|
||||
inputData:[]
|
||||
}
|
||||
},
|
||||
mounted(){},
|
||||
methods:{},
|
||||
|
||||
mounted() {
|
||||
const that = this;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
// 计算展示值 计算公式 (x - 400) / 10
|
||||
countData(data) {
|
||||
if (data) {
|
||||
return (data - 400) / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//失去焦点
|
||||
blurChangeCount(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: (el.target.value * 10) + 400,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = (el.target.value * 10) + 400
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.targetValue(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.inputData[20034] =this.countData10(this.inputData[20034]);
|
||||
this.inputData[20038] =this.countData10(this.inputData[20038]);
|
||||
this.inputData[20042] =this.countData10(this.inputData[20042]);
|
||||
this.inputData[20046] =this.countData10(this.inputData[20046]);
|
||||
this.inputData[20050] =this.countData10(this.inputData[20050]);
|
||||
this.inputData[20054] =this.countData10(this.inputData[20054]);
|
||||
this.inputData[20058] =this.countData10(this.inputData[20058]);
|
||||
this.inputData[20062] =this.countData10(this.inputData[20062]);
|
||||
}
|
||||
})
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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>
|
||||
|
|
|
@ -9,76 +9,92 @@
|
|||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>1#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20000, $event)" v-model="inputData[20000]" @input="change(20000, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20001, $event)" v-model="inputData[20001]" @input="change(20001, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20003, $event)" v-model="inputData[20003]" @input="change(20003, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(20002, $event)" v-model="inputData[20002]" @input="changeCountData(20002, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>2#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20004, $event)" v-model="inputData[20004]" @input="change(20004, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20005, $event)" v-model="inputData[20005]" @input="change(20005, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20007, $event)" v-model="inputData[20007]" @input="change(20007, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(20006, $event)" v-model="inputData[20006]" @input="changeCountData(20006, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>3#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20008, $event)" v-model="inputData[20008]" @input="change(20008, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20009, $event)" v-model="inputData[20009]" @input="change(20009, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20011, $event)" v-model="inputData[20011]" @input="change(20011, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(20010, $event)" v-model="inputData[20010]" @input="changeCountData(20010, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>4#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20012, $event)" v-model="inputData[20012]" @input="change(20012, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20013, $event)" v-model="inputData[20013]" @input="change(20013, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20015, $event)" v-model="inputData[20015]" @input="change(20015, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(20014, $event)" v-model="inputData[20014]" @input="changeCountData(20014, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -89,76 +105,92 @@
|
|||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>1#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20016, $event)" v-model="inputData[20016]" @input="change(20016, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20017, $event)" v-model="inputData[20017]" @input="change(20017, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20019, $event)" v-model="inputData[20019]" @input="change(20019, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(20018, $event)" v-model="inputData[20018]" @input="changeCountData(20018, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>2#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20020, $event)" v-model="inputData[20020]" @input="change(20020, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20021, $event)" v-model="inputData[20021]" @input="change(20021, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20023, $event)" v-model="inputData[20023]" @input="change(20023, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(20022, $event)" v-model="inputData[20022]" @input="changeCountData(20022, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>3#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20024, $event)" v-model="inputData[20024]" @input="change(20024, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20025, $event)" v-model="inputData[20025]" @input="change(20025, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20027, $event)" v-model="inputData[20027]" @input="change(20027, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(20026, $event)" v-model="inputData[20026]" @input="changeCountData(20026, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-main-80">
|
||||
<span>4#时段起始时间:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20028, $event)" v-model="inputData[20028]" @input="change(20028, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20029, $event)" v-model="inputData[20029]" @input="change(20029, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>过渡时间(分钟):</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(20031, $event)" v-model="inputData[20031]" @input="change(20031, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(20030, $event)" v-model="inputData[20030]" @input="changeCountData(20030, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -167,15 +199,196 @@
|
|||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
timer: null,
|
||||
inputData: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
// 计算展示值 计算公式 (x - 400) / 10
|
||||
countData(data) {
|
||||
if (data) {
|
||||
return (data - 400) / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//失去焦点
|
||||
blurChangeCount(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: (el.target.value * 10) + 400,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = (el.target.value * 10) + 400
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.targetValue(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.inputData[20002] =this.countData(this.inputData[20002]);
|
||||
this.inputData[20006] =this.countData(this.inputData[20006]);
|
||||
this.inputData[20010] =this.countData(this.inputData[20010]);
|
||||
this.inputData[20014] =this.countData(this.inputData[20014]);
|
||||
this.inputData[20018] =this.countData(this.inputData[20018]);
|
||||
this.inputData[20022] =this.countData(this.inputData[20022]);
|
||||
this.inputData[20026] =this.countData(this.inputData[20026]);
|
||||
this.inputData[20030] =this.countData(this.inputData[20030]);
|
||||
}
|
||||
})
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted(){},
|
||||
methods:{},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
<style lang="scss"></style>
|
||||
|
||||
|
|
@ -8,13 +8,13 @@
|
|||
</div>
|
||||
<div class="flex-view">
|
||||
<div class="input-btn ">
|
||||
<div class="btn" :class="openIndex == 1 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1,21950)" :class="inputData[21950] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 2 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(2,21950)" :class="inputData[21950] == 2 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet3.png" alt="" />手动打开
|
||||
</div>
|
||||
<div class="btn" :class="openIndex == 3 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(3,21950)" :class="inputData[21950] == 3 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />手动关闭
|
||||
</div>
|
||||
</div>
|
||||
|
@ -22,19 +22,19 @@
|
|||
<div class="text-tips">手动打开时风机启动</div>
|
||||
<div class="flex-view border-none">
|
||||
<div class="input-btn ">
|
||||
<div class="btn blue btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(0)" :class="actList1[0] == '1' ? 'blue' : 'off'">
|
||||
1#
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(1)" :class="actList1[1] == '1' ? 'blue' : 'off'">
|
||||
2#
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(2)" :class="actList1[2] == '1' ? 'blue' : 'off'">
|
||||
3#
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(3)" :class="actList1[3] == '1' ? 'blue' : 'off'">
|
||||
4#
|
||||
</div>
|
||||
<div class="btn off btn-w80">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen(4)" :class="actList1[4] == '1' ? 'blue' : 'off'">
|
||||
5#
|
||||
</div>
|
||||
</div>
|
||||
|
@ -42,28 +42,32 @@
|
|||
<div class="text-tips">工作时段限制</div>
|
||||
<div class="flex-view border-none">
|
||||
<div class="input-main-80">
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(21952, $event)" v-model="inputData[21952]" @input="change(21952, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(21953, $event)" v-model="inputData[21953]" @input="change(21953, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>-</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(21954, $event)" v-model="inputData[21954]" @input="change(21954, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>:</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(21955, $event)" v-model="inputData[21955]" @input="change(21955, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-tips">工作时段限制</div>
|
||||
<div class="flex-view shrink-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeOpen(1,21956)" :class="inputData[21956] == 1 ? 'blue' : 'off'">
|
||||
{{inputData[21956] == 1 ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>工作模式一</span>
|
||||
</div>
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeOpen(2,21956)" :class="inputData[21956] == 2 ? 'blue' : 'off'">
|
||||
{{inputData[21956] == 2 ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
|
@ -73,110 +77,131 @@
|
|||
<div class="flex-view shrink-none">
|
||||
<div class="input-main-80">
|
||||
<span>工作模式一:风机湿帘工作最大级数</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(21959, $event)" v-model="inputData[21959]" @input="change(21959, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>风机湿帘工作调整时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(21961, $event)" v-model="inputData[21961]" @input="change(21961, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(0)" :class="actList2[0] == '1' ? 'blue' : 'off'">
|
||||
{{actList2[0] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>室外温度小于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(21958, $event)" v-model="inputData[21958]" @input="changeCountData(21958, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,禁止启动风机。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(1)" :class="actList2[1] == '1' ? 'blue' : 'off'">
|
||||
{{actList2[1] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>实测温度大于目标温度</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(21960, $event)" v-model="inputData[21960]" @input="changeCount10(21960, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,跳过天窗直接启动风机。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view border-none shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(2)" :class="actList2[2] == '1' ? 'blue' : 'off'">
|
||||
{{actList2[2] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>预留条件</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view shrink-none padding-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen1(3)" :class="actList2[3] == '1' ? 'blue' : 'off'">
|
||||
{{actList2[3] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>湿帘结束后,风机延时吹干湿帘时间</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(21962, $event)" v-model="inputData[21962]" @input="change(21962, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view shrink-none">
|
||||
<div class="input-main-80">
|
||||
<span>工作模式二:控温精度滞回带</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange10(21964, $event)" v-model="inputData[21964]" @input="changeCount10(21964, $event)"
|
||||
type="text" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-view padding-none border-none shrink-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen2(0)" :class="actList3[0] == '1' ? 'blue' : 'off'">
|
||||
{{actList3[0] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>温度大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(21965, $event)" v-model="inputData[21965]" @input="changeCountData(21965, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,启动1#风机。</span>
|
||||
</div>
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen2(1)" :class="actList3[1] == '1' ? 'blue' : 'off'">
|
||||
{{actList3[1] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>温度大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(21966, $event)" v-model="inputData[21966]" @input="changeCountData(21966, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,启动2#风机。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view padding-none border-none shrink-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen2(2)" :class="actList3[2] == '1' ? 'blue' : 'off'">
|
||||
{{actList3[2] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>温度大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(21967, $event)" v-model="inputData[21967]" @input="changeCountData(21967, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,启动3#风机。</span>
|
||||
</div>
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen2(3)" :class="actList3[3] == '1' ? 'blue' : 'off'">
|
||||
{{actList3[3] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>温度大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(21968, $event)" v-model="inputData[21968]" @input="changeCountData(21968, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,启动4#风机。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view padding-none shrink-none">
|
||||
<div class="input-btn">
|
||||
<div class="btn off btn-w80">
|
||||
无效
|
||||
<div class="btn btn-w80" @click="changeIndexOpen2(4)" :class="actList3[4] == '1' ? 'blue' : 'off'">
|
||||
{{actList3[4] == '1' ? '有效' : '无效'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-main-80">
|
||||
<span>温度大于</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChangeCount(21969, $event)" v-model="inputData[21969]" @input="changeCountData(21969, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>时,启动5#风机。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -186,13 +211,13 @@
|
|||
<span>湿帘水泵1:</span>
|
||||
</div>
|
||||
<div class="input-btn ">
|
||||
<div class="btn" :class="openIndex1 == 1 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1,21970)" :class="inputData[21970] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
|
||||
</div>
|
||||
<div class="btn" :class="openIndex1 == 2 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(2,21970)" :class="inputData[21970] == 2 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet3.png" alt="" />手动打开
|
||||
</div>
|
||||
<div class="btn" :class="openIndex1 == 3 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(3,21970)" :class="inputData[21970] == 3 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />手动关闭
|
||||
</div>
|
||||
</div>
|
||||
|
@ -200,7 +225,8 @@
|
|||
<div class="flex-view shrink-none">
|
||||
<div class="input-main-80">
|
||||
<span>降温需求到达</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(21971, $event)" v-model="inputData[21971]" @input="change(21971, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>级时,湿帘泵1启动。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -210,13 +236,13 @@
|
|||
<span>湿帘水泵2:</span>
|
||||
</div>
|
||||
<div class="input-btn ">
|
||||
<div class="btn" :class="openIndex2 == 1 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(1,21972)" :class="inputData[21972] == 1 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
|
||||
</div>
|
||||
<div class="btn" :class="openIndex2 == 2 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(2,21972)" :class="inputData[21972] == 2 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet3.png" alt="" />手动打开
|
||||
</div>
|
||||
<div class="btn" :class="openIndex2 == 3 ? 'blue' : 'green'">
|
||||
<div class="btn" @click="changeOpen(3,21972)" :class="inputData[21972] == 3 ? 'blue' : 'green'">
|
||||
<img src="../../assets/image/irrigateSet1.png" alt="" />手动关闭
|
||||
</div>
|
||||
</div>
|
||||
|
@ -224,7 +250,8 @@
|
|||
<div class="flex-view border-none shrink-none">
|
||||
<div class="input-main-80">
|
||||
<span>降温需求到达2</span>
|
||||
<input type="text" placeholder="0">
|
||||
<input @blur="blurChange(21972, $event)" v-model="inputData[21972]" @input="change(21972, $event)"
|
||||
type="text" placeholder="0">
|
||||
<span>级时,湿帘泵2启动。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -234,13 +261,297 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
openIndex: 1,
|
||||
openIndex1: 1,
|
||||
openIndex2: 1,
|
||||
inputData: [],
|
||||
actList1: [],
|
||||
actList2: [],
|
||||
actList3: [],
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {},
|
||||
mounted() {
|
||||
const that = this;
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
}, 0);
|
||||
//input获取焦点后全选
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue;//input放入焦点,全选文本
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//失去焦点 计算公式 x/10
|
||||
blurChange10(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value * 10,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//反向计算 计算公式 x/10
|
||||
changeCount10(code, el) {
|
||||
var data = el.target.value * 10
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
// 计算展示值 计算公式 x/10
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
// 计算展示值 计算公式 (x - 400) / 10
|
||||
countData(data) {
|
||||
if (data) {
|
||||
return (data - 400) / 10
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
//失去焦点
|
||||
blurChangeCount(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: (el.target.value * 10) + 400,
|
||||
}; //避免开启多个计时器
|
||||
if (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
},
|
||||
changeCountData(code, el) {
|
||||
var data = (el.target.value * 10) + 400
|
||||
var sendData = {
|
||||
target: {
|
||||
value: data
|
||||
}
|
||||
}
|
||||
this.change(code, sendData)
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen(active) {
|
||||
if (this.actList1[active] == '1') {
|
||||
this.actList1[active] = '0'
|
||||
} else {
|
||||
this.actList1[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList1.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num,2),
|
||||
},
|
||||
};
|
||||
this.changeBtn(21951, dataNum);
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen1(active) {
|
||||
if (this.actList2[active] == '1') {
|
||||
this.actList2[active] = '0'
|
||||
} else {
|
||||
this.actList2[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList2.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.changeBtn(21957, dataNum);
|
||||
},
|
||||
//开关无效
|
||||
changeIndexOpen2(active) {
|
||||
if (this.actList3[active] == '1') {
|
||||
this.actList3[active] = '0'
|
||||
} else {
|
||||
this.actList3[active] = '1'
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.actList3.slice().reverse()
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.changeBtn(21963, dataNum);
|
||||
},
|
||||
getActive1() {
|
||||
this.actList1 = []
|
||||
var num = this.inputData[21951]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 5)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList1 = openListNew.reverse();
|
||||
},
|
||||
getActive2() {
|
||||
this.actList2 = []
|
||||
var num = this.inputData[21957]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 4)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList2 = openListNew.reverse();
|
||||
},
|
||||
getActive3() {
|
||||
this.actList3 = []
|
||||
var num = this.inputData[21963]
|
||||
|
||||
var num1 = this.padString(num.toString(2), 5)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.actList3 = openListNew.reverse();
|
||||
},
|
||||
// 工作方式选择
|
||||
changeOpen(index,code) {
|
||||
this.inputData[code] = index;
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: index,
|
||||
},
|
||||
};
|
||||
this.changeBtn(code, dataNum);
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
};
|
||||
this.api.fanwetcurtain(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.inputData = res.data.data;
|
||||
this.inputData[21958]=this.countData(this.inputData[21958])
|
||||
this.inputData[21960]=this.countData10(this.inputData[21960])
|
||||
this.inputData[21964]=this.countData10(this.inputData[21964])
|
||||
this.inputData[21965]=this.countData(this.inputData[21965])
|
||||
this.inputData[21966]=this.countData(this.inputData[21966])
|
||||
this.inputData[21967]=this.countData(this.inputData[21967])
|
||||
this.inputData[21968]=this.countData(this.inputData[21968])
|
||||
this.inputData[21969]=this.countData(this.inputData[21969])
|
||||
this.inputData[21976]=this.countData(this.inputData[21976])
|
||||
this.inputData[21977]=this.countData10(this.inputData[21977])
|
||||
this.inputData[21981]=this.countData(this.inputData[21981])
|
||||
this.inputData[21982]=this.countData10(this.inputData[21982])
|
||||
this.getActive1()
|
||||
this.getActive2()
|
||||
this.getActive3()
|
||||
}
|
||||
})
|
||||
},
|
||||
//二进制转换后的补全
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
//反转数组 不影响原数组
|
||||
myReverse(arr) {
|
||||
return [...arr].reverse()
|
||||
},
|
||||
//全选文本
|
||||
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 (this.timer) {
|
||||
this.timer && clearInterval(this.timer);
|
||||
this.changeData(data);
|
||||
}
|
||||
|
||||
},
|
||||
//修改数据的函数
|
||||
changeBtn(code, el) {
|
||||
var store = this.$store.state
|
||||
var data = {
|
||||
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
|
||||
regAddress: code,
|
||||
num: el.target.value,
|
||||
};
|
||||
this.delayTimerBtn(0, data);
|
||||
},
|
||||
//切换btn的限制 写入停止后j*100毫秒调取函数
|
||||
delayTimerBtn(i, data) {
|
||||
const that = this;
|
||||
//整体接口
|
||||
let j = this.$store.state.lateSendBtn;
|
||||
//避免开启多个计时器
|
||||
this.timer && clearInterval(this.timer);
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
++i;
|
||||
if (i == j) {
|
||||
that.changeData(data);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
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>
|
||||
|
|
Loading…
Reference in New Issue