修改和优化顶卷模块
This commit is contained in:
parent
1370fdd036
commit
8a07725056
@ -6,7 +6,8 @@
|
|||||||
<view class="content" v-if="purviewList.indexOf('10')!=-1">
|
<view class="content" v-if="purviewList.indexOf('10')!=-1">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<u-collapse :accordion='false' :item-style="itemStyle" :head-style='headStyle'>
|
<u-collapse :accordion='false' :item-style="itemStyle" :head-style='headStyle'>
|
||||||
<u-collapse-item :title="item.nickName" v-for="(item,index) in itemList" :key="index" align="center" v-show="isInclude(item)">
|
<u-collapse-item :title="item.nickName" v-for="(item,index) in itemList" :key="index" align="center"
|
||||||
|
v-show="isInclude(item)">
|
||||||
<view class="collapseItem">
|
<view class="collapseItem">
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="control_model">
|
<view class="control_model">
|
||||||
@ -17,12 +18,12 @@
|
|||||||
<text @click="change00(item.type,1)"
|
<text @click="change00(item.type,1)"
|
||||||
:class="getTypeRoll(item.type)==1?'txt_act':'txt'">打 开</text>
|
:class="getTypeRoll(item.type)==1?'txt_act':'txt'">打 开</text>
|
||||||
<text @click="change00(item.type,2)"
|
<text @click="change00(item.type,2)"
|
||||||
:class="getTypeRoll(item.type)==2?'txt_act':'txt'">停 止</text>
|
:class="getTypeRoll(item.type)==2?'txt_act':'txt'">{{ item.type_2 ? '关 闭' : '停 止' }}</text>
|
||||||
<text @click="change00(item.type,3)"
|
<text @click="change00(item.type,3)" v-if="!item.type_2"
|
||||||
:class="getTypeRoll(item.type)==3?'txt_act':'txt'">关 闭</text>
|
:class="getTypeRoll(item.type)==3?'txt_act':'txt'">关 闭</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="line1"></view>
|
<view class="line1"></view>
|
||||||
<view class="roll_input">
|
<view class="roll_input" v-if="!item.type_2">
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="">
|
<view class="">
|
||||||
<input v-model="item.open_value"
|
<input v-model="item.open_value"
|
||||||
@ -40,6 +41,16 @@
|
|||||||
<text>通道关闭</text>
|
<text>通道关闭</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="roll_input" v-else>
|
||||||
|
<view class="">
|
||||||
|
<view class="">
|
||||||
|
<input v-model="item.open_value"
|
||||||
|
@blur="blurChangeData00_1(item.type+1,$event)" type="number"
|
||||||
|
placeholder="0">
|
||||||
|
</view>
|
||||||
|
<text>通道;</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-collapse-item>
|
</u-collapse-item>
|
||||||
@ -332,33 +343,128 @@
|
|||||||
},
|
},
|
||||||
deviceId: '',
|
deviceId: '',
|
||||||
|
|
||||||
wxgetpermission:[],//小程序手机控制权限数据
|
wxgetpermission: [], //小程序手机控制权限数据
|
||||||
itemList: [{
|
itemList: [{
|
||||||
head: "1#顶卷膜",
|
head: "1#顶卷膜",
|
||||||
type: 21680,
|
type: 21680,
|
||||||
open_value: 0,
|
open_value: 0,
|
||||||
close_value: 0
|
close_value: 0
|
||||||
}, {
|
},
|
||||||
head: "2#顶卷膜",
|
{
|
||||||
type: 21683,
|
head: "2#顶卷膜",
|
||||||
open_value: 0,
|
type: 21683,
|
||||||
close_value: 0
|
open_value: 0,
|
||||||
}, {
|
close_value: 0
|
||||||
head: "3#顶卷膜",
|
},
|
||||||
type: 21686,
|
{
|
||||||
open_value: 0,
|
head: "3#顶卷膜",
|
||||||
close_value: 0
|
type: 21686,
|
||||||
}, {
|
open_value: 0,
|
||||||
head: "1#侧卷膜",
|
close_value: 0
|
||||||
type: 21689,
|
},
|
||||||
open_value: 0,
|
{
|
||||||
close_value: 0
|
head: "1#侧卷膜",
|
||||||
}, {
|
type: 21689,
|
||||||
head: "2#侧卷膜",
|
open_value: 0,
|
||||||
type: 21692,
|
close_value: 0
|
||||||
open_value: 0,
|
},
|
||||||
close_value: 0
|
{
|
||||||
}, ],
|
head: "2#侧卷膜",
|
||||||
|
type: 21692,
|
||||||
|
open_value: 0,
|
||||||
|
close_value: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "外遮阳1",
|
||||||
|
type: 21695,
|
||||||
|
open_value: 0,
|
||||||
|
close_value: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "外遮阳2",
|
||||||
|
type: 21698,
|
||||||
|
open_value: 0,
|
||||||
|
close_value: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "外遮阳3",
|
||||||
|
type: 21701,
|
||||||
|
open_value: 0,
|
||||||
|
close_value: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "外遮阳4",
|
||||||
|
type: 21704,
|
||||||
|
open_value: 0,
|
||||||
|
close_value: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "外遮阳5",
|
||||||
|
type: 21707,
|
||||||
|
open_value: 0,
|
||||||
|
close_value: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "风机1",
|
||||||
|
type: 21710,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "风机2",
|
||||||
|
type: 21712,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "风机3",
|
||||||
|
type: 21714,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "风机4",
|
||||||
|
type: 21716,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "风机5",
|
||||||
|
type: 21718,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "风机6",
|
||||||
|
type: 21720,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "风机7",
|
||||||
|
type: 21722,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "风机8",
|
||||||
|
type: 21724,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "风机9",
|
||||||
|
type: 21726,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
head: "风机10",
|
||||||
|
type: 21728,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
},
|
||||||
|
],
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
width: "690rpx",
|
width: "690rpx",
|
||||||
background: " #FFFFFF",
|
background: " #FFFFFF",
|
||||||
@ -374,11 +480,87 @@
|
|||||||
color: "#333333",
|
color: "#333333",
|
||||||
height: '91rpx'
|
height: '91rpx'
|
||||||
},
|
},
|
||||||
txt_act21680: 0,
|
txt_act_list: [{
|
||||||
txt_act21683: 0,
|
txt_act21680: 0,
|
||||||
txt_act21686: 0,
|
key: 21680
|
||||||
txt_act21689: 0,
|
},
|
||||||
txt_act21692: 0,
|
{
|
||||||
|
txt_act21683: 0,
|
||||||
|
key: 21683
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21686: 0,
|
||||||
|
key: 21686
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21689: 0,
|
||||||
|
key: 21689
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21692: 0,
|
||||||
|
key: 21692
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21695: 0,
|
||||||
|
key: 21695
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21698: 0,
|
||||||
|
key: 21698
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21701: 0,
|
||||||
|
key: 21701
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21704: 0,
|
||||||
|
key: 21704
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21707: 0,
|
||||||
|
key: 21707
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21710: 0,
|
||||||
|
key: 21710
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21712: 0,
|
||||||
|
key: 21712
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21714: 0,
|
||||||
|
key: 21714
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21716: 0,
|
||||||
|
key: 21716
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21718: 0,
|
||||||
|
key: 21718
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21720: 0,
|
||||||
|
key: 21720
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21722: 0,
|
||||||
|
key: 21722
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21724: 0,
|
||||||
|
key: 21724
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21726: 0,
|
||||||
|
key: 21726
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txt_act21728: 0,
|
||||||
|
key: 21728
|
||||||
|
},
|
||||||
|
],
|
||||||
inputData: [],
|
inputData: [],
|
||||||
inputData1: [],
|
inputData1: [],
|
||||||
timer: '',
|
timer: '',
|
||||||
@ -405,7 +587,7 @@
|
|||||||
fiveControlIndex: 0, //五防项目index
|
fiveControlIndex: 0, //五防项目index
|
||||||
pop_title: '',
|
pop_title: '',
|
||||||
close_btn_all: false,
|
close_btn_all: false,
|
||||||
fiveControlUrl:"",
|
fiveControlUrl: "",
|
||||||
fiveControlList: [{
|
fiveControlList: [{
|
||||||
title: '加温水泵',
|
title: '加温水泵',
|
||||||
controlState: 0,
|
controlState: 0,
|
||||||
@ -423,16 +605,16 @@
|
|||||||
controlState: 0,
|
controlState: 0,
|
||||||
num: '1004',
|
num: '1004',
|
||||||
close_btn: true,
|
close_btn: true,
|
||||||
progress_num:'1006',
|
progress_num: '1006',
|
||||||
progress:''
|
progress: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '下风口',
|
title: '下风口',
|
||||||
controlState: 0,
|
controlState: 0,
|
||||||
num: '1007',
|
num: '1007',
|
||||||
close_btn: true,
|
close_btn: true,
|
||||||
progress_num:'1009',
|
progress_num: '1009',
|
||||||
progress:''
|
progress: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '卷被',
|
title: '卷被',
|
||||||
@ -469,36 +651,34 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 小程序手机控制权限数据
|
// 小程序手机控制权限数据
|
||||||
getcontrol_wxgetpermission(){
|
getcontrol_wxgetpermission() {
|
||||||
var deviceId = this.deviceId
|
var deviceId = this.deviceId
|
||||||
this.$http({
|
this.$http({
|
||||||
url:this.api.getcontrol_wxgetpermission + '?deviceId=' + deviceId,
|
url: this.api.getcontrol_wxgetpermission + '?deviceId=' + deviceId,
|
||||||
method:'GET'
|
method: 'GET'
|
||||||
}).then(res=>{
|
}).then(res => {
|
||||||
if(res.code == 200){
|
if (res.code == 200) {
|
||||||
this.wxgetpermission = res.data;
|
this.wxgetpermission = res.data;
|
||||||
this.itemList = this.itemList.map(i=>{
|
this.itemList = this.itemList.map(i => {
|
||||||
return {
|
return {
|
||||||
...i,
|
...i,
|
||||||
nickName:''
|
nickName: ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.itemList.forEach(h=>{
|
this.itemList.forEach(h => {
|
||||||
// h.nickName = (this.wxgetpermission.filter(m=>m.name == h.head))[0].nickName
|
let s = this.wxgetpermission.filter(m => m.name == h.head)
|
||||||
let s = this.wxgetpermission.filter(m=>m.name == h.head)
|
if (s.length > 0) {
|
||||||
if(s.length > 0){
|
|
||||||
h.nickName = s[0].nickName
|
h.nickName = s[0].nickName
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(this.itemList);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 判断小程序手机控制是否有这个项,有的话返回true
|
// 判断小程序手机控制是否有这个项,有的话返回true
|
||||||
isInclude(el){
|
isInclude(el) {
|
||||||
let result = false;
|
let result = false;
|
||||||
this.wxgetpermission.forEach(item=>{
|
this.wxgetpermission.forEach(item => {
|
||||||
if(item.name == el.head){
|
if (item.name == el.head) {
|
||||||
result = true
|
result = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -548,24 +728,24 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 五防项目修改
|
// 五防项目修改
|
||||||
changefiveControl(index){
|
changefiveControl(index) {
|
||||||
this.fiveControlIndex = index
|
this.fiveControlIndex = index
|
||||||
var dataNum = {
|
var dataNum = {
|
||||||
target: {
|
target: {
|
||||||
value: this.fiveControlIndex,
|
value: this.fiveControlIndex,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
if(this.pop_title == '加温水泵'){
|
if (this.pop_title == '加温水泵') {
|
||||||
this.changeBtn(21520, dataNum);
|
this.changeBtn(21520, dataNum);
|
||||||
}else if(this.pop_title == '地热风机'){
|
} else if (this.pop_title == '地热风机') {
|
||||||
this.changeBtn(21526, dataNum);
|
this.changeBtn(21526, dataNum);
|
||||||
}else if(this.pop_title == '上风口'){
|
} else if (this.pop_title == '上风口') {
|
||||||
this.changeBtn(21530, dataNum);
|
this.changeBtn(21530, dataNum);
|
||||||
}else if(this.pop_title == '下风口'){
|
} else if (this.pop_title == '下风口') {
|
||||||
this.changeBtn(21541, dataNum);
|
this.changeBtn(21541, dataNum);
|
||||||
}else if(this.pop_title == '卷被'){
|
} else if (this.pop_title == '卷被') {
|
||||||
this.changeBtn(21548, dataNum);
|
this.changeBtn(21548, dataNum);
|
||||||
}else if(this.pop_title == '除雪'){
|
} else if (this.pop_title == '除雪') {
|
||||||
this.changeBtn(21558, dataNum);
|
this.changeBtn(21558, dataNum);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -605,17 +785,8 @@
|
|||||||
},
|
},
|
||||||
// 根据type参数返回对应的txt_act21680
|
// 根据type参数返回对应的txt_act21680
|
||||||
getTypeRoll(i) {
|
getTypeRoll(i) {
|
||||||
if (i == 21680) {
|
let arr = this.txt_act_list.filter(el => el.key == i)
|
||||||
return this.txt_act21680
|
return arr[0][Object.keys(arr[0])[0]]
|
||||||
} else if (i == 21683) {
|
|
||||||
return this.txt_act21683
|
|
||||||
} else if (i == 21686) {
|
|
||||||
return this.txt_act21686
|
|
||||||
} else if (i == 21689) {
|
|
||||||
return this.txt_act21689
|
|
||||||
} else if (i == 21692) {
|
|
||||||
return this.txt_act21692
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
@ -643,18 +814,27 @@
|
|||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
this.inputData = res.data
|
this.inputData = res.data
|
||||||
for (let i = 0; i < this.itemList.length; i++) {
|
for (let i = 0; i < this.itemList.length; i++) {
|
||||||
this.itemList[i].open_value = this.inputData[Number('21681') + i *
|
if (!this.itemList[i].type_2) {
|
||||||
3]
|
this.itemList[i].open_value = this.inputData[Number('21681') +
|
||||||
this.itemList[i].close_value = this.inputData[Number('21682') + i *
|
i *
|
||||||
3]
|
3]
|
||||||
}
|
this.itemList[i].close_value = this.inputData[Number('21682') +
|
||||||
// console.log(this.itemList);
|
i *
|
||||||
|
3]
|
||||||
|
this.getType((21680 + i * 3), 1)
|
||||||
|
} else {
|
||||||
|
this.itemList[i].value = this.inputData[21711 + (i - 10) * 2]
|
||||||
|
this.getType((21710 + (i - 10) * 2), 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// this.getType('21680')
|
||||||
|
// this.getType('21683')
|
||||||
|
// this.getType('21686')
|
||||||
|
// this.getType('21689')
|
||||||
|
// this.getType('21692')
|
||||||
|
|
||||||
this.getType('21680')
|
|
||||||
this.getType('21683')
|
|
||||||
this.getType('21686')
|
|
||||||
this.getType('21689')
|
|
||||||
this.getType('21692')
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -743,7 +923,7 @@
|
|||||||
// 五防项目状态
|
// 五防项目状态
|
||||||
this.fiveControlList.forEach(el => {
|
this.fiveControlList.forEach(el => {
|
||||||
el.controlState = res.data[el.num];
|
el.controlState = res.data[el.num];
|
||||||
if(el.progress_num){
|
if (el.progress_num) {
|
||||||
el.progress = res.data[el.progress_num];
|
el.progress = res.data[el.progress_num];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -791,66 +971,51 @@
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
padString(str, length) {
|
padString(str, length) {
|
||||||
return str.padStart(length, '0');
|
return str.padStart(length, '0');
|
||||||
},
|
},
|
||||||
|
|
||||||
getType(type) {
|
getType(type, flag) {
|
||||||
var number = this.padString(Number(this.inputData[type]).toString(2), 3)
|
if (flag == 1) {
|
||||||
// console.log(number); //001
|
var number = this.padString(Number(this.inputData[type]).toString(2), 3)
|
||||||
// console.log(number[0]); //0 bit2 关闭
|
// console.log(number); //001
|
||||||
// console.log(number[1]); //0 bit1 停止
|
// console.log(number[0]); //0 bit2 关闭
|
||||||
// console.log(number[2]); //1 bit0 打开
|
// console.log(number[1]); //0 bit1 停止
|
||||||
if (type == '21680') {
|
// console.log(number[2]); //1 bit0 打开
|
||||||
if (Number(number[0])) {
|
let arr = this.txt_act_list.filter(el => el.key == type)
|
||||||
this.txt_act21680 = 3
|
let key1 = Object.keys(arr[0])[0];
|
||||||
} else if (Number(number[1])) {
|
this.txt_act_list.forEach(el => {
|
||||||
this.txt_act21680 = 2
|
if (el.key == type) {
|
||||||
} else if (Number(number[2])) {
|
if (Number(number[0])) {
|
||||||
this.txt_act21680 = 1
|
el[key1] = 3
|
||||||
} else {
|
} else if (Number(number[1])) {
|
||||||
this.txt_act21680 = 0
|
el[key1] = 2
|
||||||
}
|
} else if (Number(number[2])) {
|
||||||
} else if (type == '21683') {
|
el[key1] = 1
|
||||||
if (Number(number[0])) {
|
} else {
|
||||||
this.txt_act21683 = 3
|
el[key1] = 0
|
||||||
} else if (Number(number[1])) {
|
}
|
||||||
this.txt_act21683 = 2
|
}
|
||||||
} else if (Number(number[2])) {
|
})
|
||||||
this.txt_act21683 = 1
|
} else if (flag == 2) {
|
||||||
} else {
|
var number = this.padString(Number(this.inputData[type]).toString(2), 2)
|
||||||
this.txt_act21683 = 0
|
// console.log(number); //01
|
||||||
}
|
// console.log(number[0]); //1 bit1 关闭
|
||||||
} else if (type == '21686') {
|
// console.log(number[1]); //1 bit0 打开
|
||||||
if (Number(number[0])) {
|
let arr = this.txt_act_list.filter(el => el.key == type)
|
||||||
this.txt_act21686 = 3
|
let key1 = Object.keys(arr[0])[0];
|
||||||
} else if (Number(number[1])) {
|
this.txt_act_list.forEach(el => {
|
||||||
this.txt_act21686 = 2
|
if (el.key == type) {
|
||||||
} else if (Number(number[2])) {
|
if (Number(number[0])) {
|
||||||
this.txt_act21686 = 1
|
el[key1] = 2
|
||||||
} else {
|
} else if (Number(number[1])) {
|
||||||
this.txt_act21686 = 0
|
el[key1] = 1
|
||||||
}
|
} else {
|
||||||
} else if (type == '21689') {
|
el[key1] = 0
|
||||||
if (Number(number[0])) {
|
}
|
||||||
this.txt_act21689 = 3
|
}
|
||||||
} else if (Number(number[1])) {
|
})
|
||||||
this.txt_act21689 = 2
|
|
||||||
} else if (Number(number[2])) {
|
|
||||||
this.txt_act21689 = 1
|
|
||||||
} else {
|
|
||||||
this.txt_act21689 = 0
|
|
||||||
}
|
|
||||||
} else if (type == '21692') {
|
|
||||||
if (Number(number[0])) {
|
|
||||||
this.txt_act21692 = 3
|
|
||||||
} else if (Number(number[1])) {
|
|
||||||
this.txt_act21692 = 2
|
|
||||||
} else if (Number(number[2])) {
|
|
||||||
this.txt_act21692 = 1
|
|
||||||
} else {
|
|
||||||
this.txt_act21692 = 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -858,33 +1023,45 @@
|
|||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中...'
|
title: '加载中...'
|
||||||
})
|
})
|
||||||
if (type == 21680) {
|
let arr = this.txt_act_list.filter(el => el.key == type)
|
||||||
this.txt_act21680 = index
|
let key1 = Object.keys(arr[0])[0];
|
||||||
} else if (type == 21683) {
|
this.txt_act_list.forEach(el=>{
|
||||||
this.txt_act21683 = index
|
if(el.key == type){
|
||||||
} else if (type == 21686) {
|
el[key1] = index
|
||||||
this.txt_act21686 = index
|
}
|
||||||
} else if (type == 21689) {
|
})
|
||||||
this.txt_act21689 = index
|
|
||||||
} else if (type == 21692) {
|
if (type > 21679 && type < 21708) {
|
||||||
this.txt_act21692 = index
|
var list = ["0", "0", "0"];
|
||||||
}
|
if (index == 1) {
|
||||||
var list = ["0", "0", "0"];
|
list[2] = "1";
|
||||||
if (index == 1) {
|
} else {
|
||||||
list[2] = "1";
|
list[2] = "0";
|
||||||
} else {
|
}
|
||||||
list[2] = "0";
|
if (index == 2) {
|
||||||
}
|
list[1] = "1";
|
||||||
if (index == 2) {
|
} else {
|
||||||
list[1] = "1";
|
list[1] = "0";
|
||||||
} else {
|
}
|
||||||
list[1] = "0";
|
if (index == 3) {
|
||||||
}
|
list[0] = "1";
|
||||||
if (index == 3) {
|
} else {
|
||||||
list[0] = "1";
|
list[0] = "0";
|
||||||
} else {
|
}
|
||||||
list[0] = "0";
|
} else if (type > 21709 && type < 21729) {
|
||||||
|
var list = ["0", "0"];
|
||||||
|
if (index == 1) {
|
||||||
|
list[1] = "1";
|
||||||
|
} else {
|
||||||
|
list[1] = "0";
|
||||||
|
};
|
||||||
|
if (index == 2) {
|
||||||
|
list[0] = "1";
|
||||||
|
} else {
|
||||||
|
list[0] = "0";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var num = list.join("");
|
var num = list.join("");
|
||||||
var dataNum = {
|
var dataNum = {
|
||||||
target: {
|
target: {
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -142,7 +142,7 @@ var render = function () {
|
|||||||
var m0 = _vm.isInclude(item)
|
var m0 = _vm.isInclude(item)
|
||||||
var m1 = _vm.getTypeRoll(item.type)
|
var m1 = _vm.getTypeRoll(item.type)
|
||||||
var m2 = _vm.getTypeRoll(item.type)
|
var m2 = _vm.getTypeRoll(item.type)
|
||||||
var m3 = _vm.getTypeRoll(item.type)
|
var m3 = !item.type_2 ? _vm.getTypeRoll(item.type) : null
|
||||||
return {
|
return {
|
||||||
$orig: $orig,
|
$orig: $orig,
|
||||||
m0: m0,
|
m0: m0,
|
||||||
@ -572,6 +572,17 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
var _default = {
|
var _default = {
|
||||||
data: function data() {
|
data: function data() {
|
||||||
return {
|
return {
|
||||||
@ -607,6 +618,81 @@ var _default = {
|
|||||||
type: 21692,
|
type: 21692,
|
||||||
open_value: 0,
|
open_value: 0,
|
||||||
close_value: 0
|
close_value: 0
|
||||||
|
}, {
|
||||||
|
head: "外遮阳1",
|
||||||
|
type: 21695,
|
||||||
|
open_value: 0,
|
||||||
|
close_value: 0
|
||||||
|
}, {
|
||||||
|
head: "外遮阳2",
|
||||||
|
type: 21698,
|
||||||
|
open_value: 0,
|
||||||
|
close_value: 0
|
||||||
|
}, {
|
||||||
|
head: "外遮阳3",
|
||||||
|
type: 21701,
|
||||||
|
open_value: 0,
|
||||||
|
close_value: 0
|
||||||
|
}, {
|
||||||
|
head: "外遮阳4",
|
||||||
|
type: 21704,
|
||||||
|
open_value: 0,
|
||||||
|
close_value: 0
|
||||||
|
}, {
|
||||||
|
head: "外遮阳5",
|
||||||
|
type: 21707,
|
||||||
|
open_value: 0,
|
||||||
|
close_value: 0
|
||||||
|
}, {
|
||||||
|
head: "风机1",
|
||||||
|
type: 21710,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
}, {
|
||||||
|
head: "风机2",
|
||||||
|
type: 21712,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
}, {
|
||||||
|
head: "风机3",
|
||||||
|
type: 21714,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
}, {
|
||||||
|
head: "风机4",
|
||||||
|
type: 21716,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
}, {
|
||||||
|
head: "风机5",
|
||||||
|
type: 21718,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
}, {
|
||||||
|
head: "风机6",
|
||||||
|
type: 21720,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
}, {
|
||||||
|
head: "风机7",
|
||||||
|
type: 21722,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
}, {
|
||||||
|
head: "风机8",
|
||||||
|
type: 21724,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
}, {
|
||||||
|
head: "风机9",
|
||||||
|
type: 21726,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
|
}, {
|
||||||
|
head: "风机10",
|
||||||
|
type: 21728,
|
||||||
|
value: 0,
|
||||||
|
type_2: 2
|
||||||
}],
|
}],
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
width: "690rpx",
|
width: "690rpx",
|
||||||
@ -622,11 +708,67 @@ var _default = {
|
|||||||
color: "#333333",
|
color: "#333333",
|
||||||
height: '91rpx'
|
height: '91rpx'
|
||||||
},
|
},
|
||||||
txt_act21680: 0,
|
txt_act_list: [{
|
||||||
txt_act21683: 0,
|
txt_act21680: 0,
|
||||||
txt_act21686: 0,
|
key: 21680
|
||||||
txt_act21689: 0,
|
}, {
|
||||||
txt_act21692: 0,
|
txt_act21683: 0,
|
||||||
|
key: 21683
|
||||||
|
}, {
|
||||||
|
txt_act21686: 0,
|
||||||
|
key: 21686
|
||||||
|
}, {
|
||||||
|
txt_act21689: 0,
|
||||||
|
key: 21689
|
||||||
|
}, {
|
||||||
|
txt_act21692: 0,
|
||||||
|
key: 21692
|
||||||
|
}, {
|
||||||
|
txt_act21695: 0,
|
||||||
|
key: 21695
|
||||||
|
}, {
|
||||||
|
txt_act21698: 0,
|
||||||
|
key: 21698
|
||||||
|
}, {
|
||||||
|
txt_act21701: 0,
|
||||||
|
key: 21701
|
||||||
|
}, {
|
||||||
|
txt_act21704: 0,
|
||||||
|
key: 21704
|
||||||
|
}, {
|
||||||
|
txt_act21707: 0,
|
||||||
|
key: 21707
|
||||||
|
}, {
|
||||||
|
txt_act21710: 0,
|
||||||
|
key: 21710
|
||||||
|
}, {
|
||||||
|
txt_act21712: 0,
|
||||||
|
key: 21712
|
||||||
|
}, {
|
||||||
|
txt_act21714: 0,
|
||||||
|
key: 21714
|
||||||
|
}, {
|
||||||
|
txt_act21716: 0,
|
||||||
|
key: 21716
|
||||||
|
}, {
|
||||||
|
txt_act21718: 0,
|
||||||
|
key: 21718
|
||||||
|
}, {
|
||||||
|
txt_act21720: 0,
|
||||||
|
key: 21720
|
||||||
|
}, {
|
||||||
|
txt_act21722: 0,
|
||||||
|
key: 21722
|
||||||
|
}, {
|
||||||
|
txt_act21724: 0,
|
||||||
|
key: 21724
|
||||||
|
}, {
|
||||||
|
txt_act21726: 0,
|
||||||
|
key: 21726
|
||||||
|
}, {
|
||||||
|
txt_act21728: 0,
|
||||||
|
key: 21728
|
||||||
|
}],
|
||||||
inputData: [],
|
inputData: [],
|
||||||
inputData1: [],
|
inputData1: [],
|
||||||
timer: '',
|
timer: '',
|
||||||
@ -733,7 +875,6 @@ var _default = {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
_this.itemList.forEach(function (h) {
|
_this.itemList.forEach(function (h) {
|
||||||
// h.nickName = (this.wxgetpermission.filter(m=>m.name == h.head))[0].nickName
|
|
||||||
var s = _this.wxgetpermission.filter(function (m) {
|
var s = _this.wxgetpermission.filter(function (m) {
|
||||||
return m.name == h.head;
|
return m.name == h.head;
|
||||||
});
|
});
|
||||||
@ -741,7 +882,6 @@ var _default = {
|
|||||||
h.nickName = s[0].nickName;
|
h.nickName = s[0].nickName;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(_this.itemList);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -850,17 +990,10 @@ var _default = {
|
|||||||
},
|
},
|
||||||
// 根据type参数返回对应的txt_act21680
|
// 根据type参数返回对应的txt_act21680
|
||||||
getTypeRoll: function getTypeRoll(i) {
|
getTypeRoll: function getTypeRoll(i) {
|
||||||
if (i == 21680) {
|
var arr = this.txt_act_list.filter(function (el) {
|
||||||
return this.txt_act21680;
|
return el.key == i;
|
||||||
} else if (i == 21683) {
|
});
|
||||||
return this.txt_act21683;
|
return arr[0][Object.keys(arr[0])[0]];
|
||||||
} else if (i == 21686) {
|
|
||||||
return this.txt_act21686;
|
|
||||||
} else if (i == 21689) {
|
|
||||||
return this.txt_act21689;
|
|
||||||
} else if (i == 21692) {
|
|
||||||
return this.txt_act21692;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 读取所有寄存器的状态值
|
// 读取所有寄存器的状态值
|
||||||
dataInit: function dataInit() {
|
dataInit: function dataInit() {
|
||||||
@ -887,16 +1020,21 @@ var _default = {
|
|||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
_this3.inputData = res.data;
|
_this3.inputData = res.data;
|
||||||
for (var i = 0; i < _this3.itemList.length; i++) {
|
for (var i = 0; i < _this3.itemList.length; i++) {
|
||||||
_this3.itemList[i].open_value = _this3.inputData[Number('21681') + i * 3];
|
if (!_this3.itemList[i].type_2) {
|
||||||
_this3.itemList[i].close_value = _this3.inputData[Number('21682') + i * 3];
|
_this3.itemList[i].open_value = _this3.inputData[Number('21681') + i * 3];
|
||||||
|
_this3.itemList[i].close_value = _this3.inputData[Number('21682') + i * 3];
|
||||||
|
_this3.getType(21680 + i * 3, 1);
|
||||||
|
} else {
|
||||||
|
_this3.itemList[i].value = _this3.inputData[21711 + (i - 10) * 2];
|
||||||
|
_this3.getType(21710 + (i - 10) * 2, 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// console.log(this.itemList);
|
|
||||||
|
|
||||||
_this3.getType('21680');
|
// this.getType('21680')
|
||||||
_this3.getType('21683');
|
// this.getType('21683')
|
||||||
_this3.getType('21686');
|
// this.getType('21686')
|
||||||
_this3.getType('21689');
|
// this.getType('21689')
|
||||||
_this3.getType('21692');
|
// this.getType('21692')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1029,94 +1167,96 @@ var _default = {
|
|||||||
padString: function padString(str, length) {
|
padString: function padString(str, length) {
|
||||||
return str.padStart(length, '0');
|
return str.padStart(length, '0');
|
||||||
},
|
},
|
||||||
getType: function getType(type) {
|
getType: function getType(type, flag) {
|
||||||
var number = this.padString(Number(this.inputData[type]).toString(2), 3);
|
if (flag == 1) {
|
||||||
// console.log(number); //001
|
var number = this.padString(Number(this.inputData[type]).toString(2), 3);
|
||||||
// console.log(number[0]); //0 bit2 关闭
|
// console.log(number); //001
|
||||||
// console.log(number[1]); //0 bit1 停止
|
// console.log(number[0]); //0 bit2 关闭
|
||||||
// console.log(number[2]); //1 bit0 打开
|
// console.log(number[1]); //0 bit1 停止
|
||||||
if (type == '21680') {
|
// console.log(number[2]); //1 bit0 打开
|
||||||
if (Number(number[0])) {
|
var arr = this.txt_act_list.filter(function (el) {
|
||||||
this.txt_act21680 = 3;
|
return el.key == type;
|
||||||
} else if (Number(number[1])) {
|
});
|
||||||
this.txt_act21680 = 2;
|
var key1 = Object.keys(arr[0])[0];
|
||||||
} else if (Number(number[2])) {
|
this.txt_act_list.forEach(function (el) {
|
||||||
this.txt_act21680 = 1;
|
if (el.key == type) {
|
||||||
} else {
|
if (Number(number[0])) {
|
||||||
this.txt_act21680 = 0;
|
el[key1] = 3;
|
||||||
}
|
} else if (Number(number[1])) {
|
||||||
} else if (type == '21683') {
|
el[key1] = 2;
|
||||||
if (Number(number[0])) {
|
} else if (Number(number[2])) {
|
||||||
this.txt_act21683 = 3;
|
el[key1] = 1;
|
||||||
} else if (Number(number[1])) {
|
} else {
|
||||||
this.txt_act21683 = 2;
|
el[key1] = 0;
|
||||||
} else if (Number(number[2])) {
|
}
|
||||||
this.txt_act21683 = 1;
|
}
|
||||||
} else {
|
});
|
||||||
this.txt_act21683 = 0;
|
} else if (flag == 2) {
|
||||||
}
|
var number = this.padString(Number(this.inputData[type]).toString(2), 2);
|
||||||
} else if (type == '21686') {
|
// console.log(number); //01
|
||||||
if (Number(number[0])) {
|
// console.log(number[0]); //1 bit1 关闭
|
||||||
this.txt_act21686 = 3;
|
// console.log(number[1]); //1 bit0 打开
|
||||||
} else if (Number(number[1])) {
|
var _arr = this.txt_act_list.filter(function (el) {
|
||||||
this.txt_act21686 = 2;
|
return el.key == type;
|
||||||
} else if (Number(number[2])) {
|
});
|
||||||
this.txt_act21686 = 1;
|
var _key = Object.keys(_arr[0])[0];
|
||||||
} else {
|
this.txt_act_list.forEach(function (el) {
|
||||||
this.txt_act21686 = 0;
|
if (el.key == type) {
|
||||||
}
|
if (Number(number[0])) {
|
||||||
} else if (type == '21689') {
|
el[_key] = 2;
|
||||||
if (Number(number[0])) {
|
} else if (Number(number[1])) {
|
||||||
this.txt_act21689 = 3;
|
el[_key] = 1;
|
||||||
} else if (Number(number[1])) {
|
} else {
|
||||||
this.txt_act21689 = 2;
|
el[_key] = 0;
|
||||||
} else if (Number(number[2])) {
|
}
|
||||||
this.txt_act21689 = 1;
|
}
|
||||||
} else {
|
});
|
||||||
this.txt_act21689 = 0;
|
|
||||||
}
|
|
||||||
} else if (type == '21692') {
|
|
||||||
if (Number(number[0])) {
|
|
||||||
this.txt_act21692 = 3;
|
|
||||||
} else if (Number(number[1])) {
|
|
||||||
this.txt_act21692 = 2;
|
|
||||||
} else if (Number(number[2])) {
|
|
||||||
this.txt_act21692 = 1;
|
|
||||||
} else {
|
|
||||||
this.txt_act21692 = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
change00: function change00(type, index) {
|
change00: function change00(type, index) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中...'
|
title: '加载中...'
|
||||||
});
|
});
|
||||||
if (type == 21680) {
|
var arr = this.txt_act_list.filter(function (el) {
|
||||||
this.txt_act21680 = index;
|
return el.key == type;
|
||||||
} else if (type == 21683) {
|
});
|
||||||
this.txt_act21683 = index;
|
var key1 = Object.keys(arr[0])[0];
|
||||||
} else if (type == 21686) {
|
this.txt_act_list.forEach(function (el) {
|
||||||
this.txt_act21686 = index;
|
if (el.key == type) {
|
||||||
} else if (type == 21689) {
|
el[key1] = index;
|
||||||
this.txt_act21689 = index;
|
}
|
||||||
} else if (type == 21692) {
|
});
|
||||||
this.txt_act21692 = index;
|
if (type > 21679 && type < 21708) {
|
||||||
}
|
var list = ["0", "0", "0"];
|
||||||
var list = ["0", "0", "0"];
|
if (index == 1) {
|
||||||
if (index == 1) {
|
list[2] = "1";
|
||||||
list[2] = "1";
|
} else {
|
||||||
} else {
|
list[2] = "0";
|
||||||
list[2] = "0";
|
}
|
||||||
}
|
if (index == 2) {
|
||||||
if (index == 2) {
|
list[1] = "1";
|
||||||
list[1] = "1";
|
} else {
|
||||||
} else {
|
list[1] = "0";
|
||||||
list[1] = "0";
|
}
|
||||||
}
|
if (index == 3) {
|
||||||
if (index == 3) {
|
list[0] = "1";
|
||||||
list[0] = "1";
|
} else {
|
||||||
} else {
|
list[0] = "0";
|
||||||
list[0] = "0";
|
}
|
||||||
|
} else if (type > 21709 && type < 21729) {
|
||||||
|
var list = ["0", "0"];
|
||||||
|
if (index == 1) {
|
||||||
|
list[1] = "1";
|
||||||
|
} else {
|
||||||
|
list[1] = "0";
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (index == 2) {
|
||||||
|
list[0] = "1";
|
||||||
|
} else {
|
||||||
|
list[0] = "0";
|
||||||
|
}
|
||||||
|
;
|
||||||
}
|
}
|
||||||
var num = list.join("");
|
var num = list.join("");
|
||||||
var dataNum = {
|
var dataNum = {
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user