修改和优化顶卷模块
parent
1370fdd036
commit
8a07725056
|
@ -6,7 +6,8 @@
|
|||
<view class="content" v-if="purviewList.indexOf('10')!=-1">
|
||||
<div class="item">
|
||||
<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="line"></view>
|
||||
<view class="control_model">
|
||||
|
@ -17,12 +18,12 @@
|
|||
<text @click="change00(item.type,1)"
|
||||
:class="getTypeRoll(item.type)==1?'txt_act':'txt'">打 开</text>
|
||||
<text @click="change00(item.type,2)"
|
||||
:class="getTypeRoll(item.type)==2?'txt_act':'txt'">停 止</text>
|
||||
<text @click="change00(item.type,3)"
|
||||
:class="getTypeRoll(item.type)==2?'txt_act':'txt'">{{ item.type_2 ? '关 闭' : '停 止' }}</text>
|
||||
<text @click="change00(item.type,3)" v-if="!item.type_2"
|
||||
:class="getTypeRoll(item.type)==3?'txt_act':'txt'">关 闭</text>
|
||||
</view>
|
||||
<view class="line1"></view>
|
||||
<view class="roll_input">
|
||||
<view class="roll_input" v-if="!item.type_2">
|
||||
<view class="">
|
||||
<view class="">
|
||||
<input v-model="item.open_value"
|
||||
|
@ -40,6 +41,16 @@
|
|||
<text>通道关闭</text>
|
||||
</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>
|
||||
</u-collapse-item>
|
||||
|
@ -331,34 +342,129 @@
|
|||
backgroundColor: '#24B383',
|
||||
},
|
||||
deviceId: '',
|
||||
|
||||
wxgetpermission:[],//小程序手机控制权限数据
|
||||
|
||||
wxgetpermission: [], //小程序手机控制权限数据
|
||||
itemList: [{
|
||||
head: "1#顶卷膜",
|
||||
type: 21680,
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
}, {
|
||||
head: "2#顶卷膜",
|
||||
type: 21683,
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
}, {
|
||||
head: "3#顶卷膜",
|
||||
type: 21686,
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
}, {
|
||||
head: "1#侧卷膜",
|
||||
type: 21689,
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
}, {
|
||||
head: "2#侧卷膜",
|
||||
type: 21692,
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
}, ],
|
||||
head: "1#顶卷膜",
|
||||
type: 21680,
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
},
|
||||
{
|
||||
head: "2#顶卷膜",
|
||||
type: 21683,
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
},
|
||||
{
|
||||
head: "3#顶卷膜",
|
||||
type: 21686,
|
||||
open_value: 0,
|
||||
close_value: 0
|
||||
},
|
||||
{
|
||||
head: "1#侧卷膜",
|
||||
type: 21689,
|
||||
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: {
|
||||
width: "690rpx",
|
||||
background: " #FFFFFF",
|
||||
|
@ -374,11 +480,87 @@
|
|||
color: "#333333",
|
||||
height: '91rpx'
|
||||
},
|
||||
txt_act21680: 0,
|
||||
txt_act21683: 0,
|
||||
txt_act21686: 0,
|
||||
txt_act21689: 0,
|
||||
txt_act21692: 0,
|
||||
txt_act_list: [{
|
||||
txt_act21680: 0,
|
||||
key: 21680
|
||||
},
|
||||
{
|
||||
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: [],
|
||||
inputData1: [],
|
||||
timer: '',
|
||||
|
@ -405,7 +587,7 @@
|
|||
fiveControlIndex: 0, //五防项目index
|
||||
pop_title: '',
|
||||
close_btn_all: false,
|
||||
fiveControlUrl:"",
|
||||
fiveControlUrl: "",
|
||||
fiveControlList: [{
|
||||
title: '加温水泵',
|
||||
controlState: 0,
|
||||
|
@ -423,16 +605,16 @@
|
|||
controlState: 0,
|
||||
num: '1004',
|
||||
close_btn: true,
|
||||
progress_num:'1006',
|
||||
progress:''
|
||||
progress_num: '1006',
|
||||
progress: ''
|
||||
},
|
||||
{
|
||||
title: '下风口',
|
||||
controlState: 0,
|
||||
num: '1007',
|
||||
close_btn: true,
|
||||
progress_num:'1009',
|
||||
progress:''
|
||||
progress_num: '1009',
|
||||
progress: ''
|
||||
},
|
||||
{
|
||||
title: '卷被',
|
||||
|
@ -469,42 +651,40 @@
|
|||
},
|
||||
methods: {
|
||||
// 小程序手机控制权限数据
|
||||
getcontrol_wxgetpermission(){
|
||||
getcontrol_wxgetpermission() {
|
||||
var deviceId = this.deviceId
|
||||
this.$http({
|
||||
url:this.api.getcontrol_wxgetpermission + '?deviceId=' + deviceId,
|
||||
method:'GET'
|
||||
}).then(res=>{
|
||||
if(res.code == 200){
|
||||
url: this.api.getcontrol_wxgetpermission + '?deviceId=' + deviceId,
|
||||
method: 'GET'
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.wxgetpermission = res.data;
|
||||
this.itemList = this.itemList.map(i=>{
|
||||
this.itemList = this.itemList.map(i => {
|
||||
return {
|
||||
...i,
|
||||
nickName:''
|
||||
nickName: ''
|
||||
}
|
||||
})
|
||||
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)
|
||||
if(s.length > 0){
|
||||
this.itemList.forEach(h => {
|
||||
let s = this.wxgetpermission.filter(m => m.name == h.head)
|
||||
if (s.length > 0) {
|
||||
h.nickName = s[0].nickName
|
||||
}
|
||||
})
|
||||
console.log(this.itemList);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 判断小程序手机控制是否有这个项,有的话返回true
|
||||
isInclude(el){
|
||||
isInclude(el) {
|
||||
let result = false;
|
||||
this.wxgetpermission.forEach(item=>{
|
||||
if(item.name == el.head){
|
||||
this.wxgetpermission.forEach(item => {
|
||||
if (item.name == el.head) {
|
||||
result = true
|
||||
}
|
||||
})
|
||||
return result
|
||||
},
|
||||
|
||||
|
||||
toWebView(url) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/web_view_controller/web_view_controller?deviceId=${this.deviceId}&url=${url}`
|
||||
|
@ -546,31 +726,31 @@
|
|||
};
|
||||
this.changeBtn(21613 + ((this.indexs - 1) * 11), dataNum);
|
||||
},
|
||||
|
||||
|
||||
// 五防项目修改
|
||||
changefiveControl(index){
|
||||
changefiveControl(index) {
|
||||
this.fiveControlIndex = index
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: this.fiveControlIndex,
|
||||
},
|
||||
};
|
||||
if(this.pop_title == '加温水泵'){
|
||||
if (this.pop_title == '加温水泵') {
|
||||
this.changeBtn(21520, dataNum);
|
||||
}else if(this.pop_title == '地热风机'){
|
||||
} else if (this.pop_title == '地热风机') {
|
||||
this.changeBtn(21526, dataNum);
|
||||
}else if(this.pop_title == '上风口'){
|
||||
} else if (this.pop_title == '上风口') {
|
||||
this.changeBtn(21530, dataNum);
|
||||
}else if(this.pop_title == '下风口'){
|
||||
} else if (this.pop_title == '下风口') {
|
||||
this.changeBtn(21541, dataNum);
|
||||
}else if(this.pop_title == '卷被'){
|
||||
} else if (this.pop_title == '卷被') {
|
||||
this.changeBtn(21548, dataNum);
|
||||
}else if(this.pop_title == '除雪'){
|
||||
} else if (this.pop_title == '除雪') {
|
||||
this.changeBtn(21558, dataNum);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
changeBtn(code, el) {
|
||||
|
||||
var data = {
|
||||
|
@ -605,17 +785,8 @@
|
|||
},
|
||||
// 根据type参数返回对应的txt_act21680
|
||||
getTypeRoll(i) {
|
||||
if (i == 21680) {
|
||||
return this.txt_act21680
|
||||
} 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
|
||||
}
|
||||
let arr = this.txt_act_list.filter(el => el.key == i)
|
||||
return arr[0][Object.keys(arr[0])[0]]
|
||||
},
|
||||
|
||||
|
||||
|
@ -643,18 +814,27 @@
|
|||
uni.stopPullDownRefresh();
|
||||
this.inputData = res.data
|
||||
for (let i = 0; i < this.itemList.length; i++) {
|
||||
this.itemList[i].open_value = this.inputData[Number('21681') + i *
|
||||
3]
|
||||
this.itemList[i].close_value = this.inputData[Number('21682') + i *
|
||||
3]
|
||||
}
|
||||
// console.log(this.itemList);
|
||||
if (!this.itemList[i].type_2) {
|
||||
this.itemList[i].open_value = this.inputData[Number('21681') +
|
||||
i *
|
||||
3]
|
||||
this.itemList[i].close_value = this.inputData[Number('21682') +
|
||||
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 => {
|
||||
el.controlState = res.data[el.num];
|
||||
if(el.progress_num){
|
||||
if (el.progress_num) {
|
||||
el.progress = res.data[el.progress_num];
|
||||
}
|
||||
})
|
||||
|
@ -756,11 +936,11 @@
|
|||
this.fiveControlShow = true;
|
||||
this.pop_title = this.fiveControlList[index].title;
|
||||
this.close_btn_all = this.fiveControlList[index].close_btn;
|
||||
|
||||
|
||||
if (index == 0) {
|
||||
this.fiveControlIndex = this.fiveControl[21520];
|
||||
this.fiveControlUrl = 'waterPump';
|
||||
|
||||
|
||||
} else if (index == 1) {
|
||||
this.fiveControlIndex = this.fiveControl[21526];
|
||||
this.fiveControlUrl = 'geothermalFan'
|
||||
|
@ -791,66 +971,51 @@
|
|||
return ''
|
||||
}
|
||||
},
|
||||
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
|
||||
getType(type) {
|
||||
var number = this.padString(Number(this.inputData[type]).toString(2), 3)
|
||||
// console.log(number); //001
|
||||
// console.log(number[0]); //0 bit2 关闭
|
||||
// console.log(number[1]); //0 bit1 停止
|
||||
// console.log(number[2]); //1 bit0 打开
|
||||
if (type == '21680') {
|
||||
if (Number(number[0])) {
|
||||
this.txt_act21680 = 3
|
||||
} else if (Number(number[1])) {
|
||||
this.txt_act21680 = 2
|
||||
} else if (Number(number[2])) {
|
||||
this.txt_act21680 = 1
|
||||
} else {
|
||||
this.txt_act21680 = 0
|
||||
}
|
||||
} else if (type == '21683') {
|
||||
if (Number(number[0])) {
|
||||
this.txt_act21683 = 3
|
||||
} else if (Number(number[1])) {
|
||||
this.txt_act21683 = 2
|
||||
} else if (Number(number[2])) {
|
||||
this.txt_act21683 = 1
|
||||
} else {
|
||||
this.txt_act21683 = 0
|
||||
}
|
||||
} else if (type == '21686') {
|
||||
if (Number(number[0])) {
|
||||
this.txt_act21686 = 3
|
||||
} else if (Number(number[1])) {
|
||||
this.txt_act21686 = 2
|
||||
} else if (Number(number[2])) {
|
||||
this.txt_act21686 = 1
|
||||
} else {
|
||||
this.txt_act21686 = 0
|
||||
}
|
||||
} else if (type == '21689') {
|
||||
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
|
||||
}
|
||||
getType(type, flag) {
|
||||
if (flag == 1) {
|
||||
var number = this.padString(Number(this.inputData[type]).toString(2), 3)
|
||||
// console.log(number); //001
|
||||
// console.log(number[0]); //0 bit2 关闭
|
||||
// console.log(number[1]); //0 bit1 停止
|
||||
// console.log(number[2]); //1 bit0 打开
|
||||
let arr = this.txt_act_list.filter(el => el.key == type)
|
||||
let key1 = Object.keys(arr[0])[0];
|
||||
this.txt_act_list.forEach(el => {
|
||||
if (el.key == type) {
|
||||
if (Number(number[0])) {
|
||||
el[key1] = 3
|
||||
} else if (Number(number[1])) {
|
||||
el[key1] = 2
|
||||
} else if (Number(number[2])) {
|
||||
el[key1] = 1
|
||||
} else {
|
||||
el[key1] = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (flag == 2) {
|
||||
var number = this.padString(Number(this.inputData[type]).toString(2), 2)
|
||||
// console.log(number); //01
|
||||
// console.log(number[0]); //1 bit1 关闭
|
||||
// console.log(number[1]); //1 bit0 打开
|
||||
let arr = this.txt_act_list.filter(el => el.key == type)
|
||||
let key1 = Object.keys(arr[0])[0];
|
||||
this.txt_act_list.forEach(el => {
|
||||
if (el.key == type) {
|
||||
if (Number(number[0])) {
|
||||
el[key1] = 2
|
||||
} else if (Number(number[1])) {
|
||||
el[key1] = 1
|
||||
} else {
|
||||
el[key1] = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -858,33 +1023,45 @@
|
|||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
if (type == 21680) {
|
||||
this.txt_act21680 = index
|
||||
} else if (type == 21683) {
|
||||
this.txt_act21683 = index
|
||||
} else if (type == 21686) {
|
||||
this.txt_act21686 = index
|
||||
} else if (type == 21689) {
|
||||
this.txt_act21689 = index
|
||||
} else if (type == 21692) {
|
||||
this.txt_act21692 = index
|
||||
}
|
||||
var list = ["0", "0", "0"];
|
||||
if (index == 1) {
|
||||
list[2] = "1";
|
||||
} else {
|
||||
list[2] = "0";
|
||||
}
|
||||
if (index == 2) {
|
||||
list[1] = "1";
|
||||
} else {
|
||||
list[1] = "0";
|
||||
}
|
||||
if (index == 3) {
|
||||
list[0] = "1";
|
||||
} else {
|
||||
list[0] = "0";
|
||||
let arr = this.txt_act_list.filter(el => el.key == type)
|
||||
let key1 = Object.keys(arr[0])[0];
|
||||
this.txt_act_list.forEach(el=>{
|
||||
if(el.key == type){
|
||||
el[key1] = index
|
||||
}
|
||||
})
|
||||
|
||||
if (type > 21679 && type < 21708) {
|
||||
var list = ["0", "0", "0"];
|
||||
if (index == 1) {
|
||||
list[2] = "1";
|
||||
} else {
|
||||
list[2] = "0";
|
||||
}
|
||||
if (index == 2) {
|
||||
list[1] = "1";
|
||||
} else {
|
||||
list[1] = "0";
|
||||
}
|
||||
if (index == 3) {
|
||||
list[0] = "1";
|
||||
} 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 dataNum = {
|
||||
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 m1 = _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 {
|
||||
$orig: $orig,
|
||||
m0: m0,
|
||||
|
@ -572,6 +572,17 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
var _default = {
|
||||
data: function data() {
|
||||
return {
|
||||
|
@ -607,6 +618,81 @@ var _default = {
|
|||
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: {
|
||||
width: "690rpx",
|
||||
|
@ -622,11 +708,67 @@ var _default = {
|
|||
color: "#333333",
|
||||
height: '91rpx'
|
||||
},
|
||||
txt_act21680: 0,
|
||||
txt_act21683: 0,
|
||||
txt_act21686: 0,
|
||||
txt_act21689: 0,
|
||||
txt_act21692: 0,
|
||||
txt_act_list: [{
|
||||
txt_act21680: 0,
|
||||
key: 21680
|
||||
}, {
|
||||
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: [],
|
||||
inputData1: [],
|
||||
timer: '',
|
||||
|
@ -733,7 +875,6 @@ var _default = {
|
|||
});
|
||||
});
|
||||
_this.itemList.forEach(function (h) {
|
||||
// h.nickName = (this.wxgetpermission.filter(m=>m.name == h.head))[0].nickName
|
||||
var s = _this.wxgetpermission.filter(function (m) {
|
||||
return m.name == h.head;
|
||||
});
|
||||
|
@ -741,7 +882,6 @@ var _default = {
|
|||
h.nickName = s[0].nickName;
|
||||
}
|
||||
});
|
||||
console.log(_this.itemList);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -850,17 +990,10 @@ var _default = {
|
|||
},
|
||||
// 根据type参数返回对应的txt_act21680
|
||||
getTypeRoll: function getTypeRoll(i) {
|
||||
if (i == 21680) {
|
||||
return this.txt_act21680;
|
||||
} 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;
|
||||
}
|
||||
var arr = this.txt_act_list.filter(function (el) {
|
||||
return el.key == i;
|
||||
});
|
||||
return arr[0][Object.keys(arr[0])[0]];
|
||||
},
|
||||
// 读取所有寄存器的状态值
|
||||
dataInit: function dataInit() {
|
||||
|
@ -887,16 +1020,21 @@ var _default = {
|
|||
uni.stopPullDownRefresh();
|
||||
_this3.inputData = res.data;
|
||||
for (var i = 0; i < _this3.itemList.length; i++) {
|
||||
_this3.itemList[i].open_value = _this3.inputData[Number('21681') + i * 3];
|
||||
_this3.itemList[i].close_value = _this3.inputData[Number('21682') + i * 3];
|
||||
if (!_this3.itemList[i].type_2) {
|
||||
_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');
|
||||
_this3.getType('21683');
|
||||
_this3.getType('21686');
|
||||
_this3.getType('21689');
|
||||
_this3.getType('21692');
|
||||
// this.getType('21680')
|
||||
// this.getType('21683')
|
||||
// this.getType('21686')
|
||||
// this.getType('21689')
|
||||
// this.getType('21692')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1029,94 +1167,96 @@ var _default = {
|
|||
padString: function padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
getType: function getType(type) {
|
||||
var number = this.padString(Number(this.inputData[type]).toString(2), 3);
|
||||
// console.log(number); //001
|
||||
// console.log(number[0]); //0 bit2 关闭
|
||||
// console.log(number[1]); //0 bit1 停止
|
||||
// console.log(number[2]); //1 bit0 打开
|
||||
if (type == '21680') {
|
||||
if (Number(number[0])) {
|
||||
this.txt_act21680 = 3;
|
||||
} else if (Number(number[1])) {
|
||||
this.txt_act21680 = 2;
|
||||
} else if (Number(number[2])) {
|
||||
this.txt_act21680 = 1;
|
||||
} else {
|
||||
this.txt_act21680 = 0;
|
||||
}
|
||||
} else if (type == '21683') {
|
||||
if (Number(number[0])) {
|
||||
this.txt_act21683 = 3;
|
||||
} else if (Number(number[1])) {
|
||||
this.txt_act21683 = 2;
|
||||
} else if (Number(number[2])) {
|
||||
this.txt_act21683 = 1;
|
||||
} else {
|
||||
this.txt_act21683 = 0;
|
||||
}
|
||||
} else if (type == '21686') {
|
||||
if (Number(number[0])) {
|
||||
this.txt_act21686 = 3;
|
||||
} else if (Number(number[1])) {
|
||||
this.txt_act21686 = 2;
|
||||
} else if (Number(number[2])) {
|
||||
this.txt_act21686 = 1;
|
||||
} else {
|
||||
this.txt_act21686 = 0;
|
||||
}
|
||||
} else if (type == '21689') {
|
||||
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;
|
||||
}
|
||||
getType: function getType(type, flag) {
|
||||
if (flag == 1) {
|
||||
var number = this.padString(Number(this.inputData[type]).toString(2), 3);
|
||||
// console.log(number); //001
|
||||
// console.log(number[0]); //0 bit2 关闭
|
||||
// console.log(number[1]); //0 bit1 停止
|
||||
// console.log(number[2]); //1 bit0 打开
|
||||
var arr = this.txt_act_list.filter(function (el) {
|
||||
return el.key == type;
|
||||
});
|
||||
var key1 = Object.keys(arr[0])[0];
|
||||
this.txt_act_list.forEach(function (el) {
|
||||
if (el.key == type) {
|
||||
if (Number(number[0])) {
|
||||
el[key1] = 3;
|
||||
} else if (Number(number[1])) {
|
||||
el[key1] = 2;
|
||||
} else if (Number(number[2])) {
|
||||
el[key1] = 1;
|
||||
} else {
|
||||
el[key1] = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (flag == 2) {
|
||||
var number = this.padString(Number(this.inputData[type]).toString(2), 2);
|
||||
// console.log(number); //01
|
||||
// console.log(number[0]); //1 bit1 关闭
|
||||
// console.log(number[1]); //1 bit0 打开
|
||||
var _arr = this.txt_act_list.filter(function (el) {
|
||||
return el.key == type;
|
||||
});
|
||||
var _key = Object.keys(_arr[0])[0];
|
||||
this.txt_act_list.forEach(function (el) {
|
||||
if (el.key == type) {
|
||||
if (Number(number[0])) {
|
||||
el[_key] = 2;
|
||||
} else if (Number(number[1])) {
|
||||
el[_key] = 1;
|
||||
} else {
|
||||
el[_key] = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
change00: function change00(type, index) {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
if (type == 21680) {
|
||||
this.txt_act21680 = index;
|
||||
} else if (type == 21683) {
|
||||
this.txt_act21683 = index;
|
||||
} else if (type == 21686) {
|
||||
this.txt_act21686 = index;
|
||||
} else if (type == 21689) {
|
||||
this.txt_act21689 = index;
|
||||
} else if (type == 21692) {
|
||||
this.txt_act21692 = index;
|
||||
}
|
||||
var list = ["0", "0", "0"];
|
||||
if (index == 1) {
|
||||
list[2] = "1";
|
||||
} else {
|
||||
list[2] = "0";
|
||||
}
|
||||
if (index == 2) {
|
||||
list[1] = "1";
|
||||
} else {
|
||||
list[1] = "0";
|
||||
}
|
||||
if (index == 3) {
|
||||
list[0] = "1";
|
||||
} else {
|
||||
list[0] = "0";
|
||||
var arr = this.txt_act_list.filter(function (el) {
|
||||
return el.key == type;
|
||||
});
|
||||
var key1 = Object.keys(arr[0])[0];
|
||||
this.txt_act_list.forEach(function (el) {
|
||||
if (el.key == type) {
|
||||
el[key1] = index;
|
||||
}
|
||||
});
|
||||
if (type > 21679 && type < 21708) {
|
||||
var list = ["0", "0", "0"];
|
||||
if (index == 1) {
|
||||
list[2] = "1";
|
||||
} else {
|
||||
list[2] = "0";
|
||||
}
|
||||
if (index == 2) {
|
||||
list[1] = "1";
|
||||
} else {
|
||||
list[1] = "0";
|
||||
}
|
||||
if (index == 3) {
|
||||
list[0] = "1";
|
||||
} 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 dataNum = {
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue