电磁阀显示与隐藏

This commit is contained in:
home孙 2025-08-07 19:43:24 +08:00
parent e6c6e2fbf0
commit 250f2f86c6

View File

@ -1000,7 +1000,7 @@
<view class="content"> <view class="content">
<template v-for="(item,index) in electronMagneticStatus"> <template v-for="(item,index) in electronMagneticStatus">
<view class="lishui-item" v-if="item.state != 0" :key="index"> <view class="lishui-item" v-if="item.show == 0" :key="index">
<view class="lishui-title"> <view class="lishui-title">
<view class="title-left"> <view class="title-left">
{{ item.name }} {{ item.name }}
@ -2247,52 +2247,68 @@
valve_input_value: '', valve_input_value: '',
valveControlIndex: 0, valveControlIndex: 0,
electronMagneticStatus: [{ electronMagneticStatus: [{
id:11,
name: '1#电磁阀', name: '1#电磁阀',
code: 1166, code: 1166,
state:0, state:0,
open:0, open:0,
show:0,
}, },
{ {
id:12,
name: '2#电磁阀', name: '2#电磁阀',
code: 1167, code: 1167,
state:0, state:0,
open:0, open:0,
show:0,
}, },
{ {
id:13,
name: '3#电磁阀', name: '3#电磁阀',
code: 1168, code: 1168,
state:0, state:0,
open:0, open:0,
show:0,
}, },
{ {
id:14,
name: '4#电磁阀', name: '4#电磁阀',
code: 1169, code: 1169,
state:0, state:0,
open:0, open:0,
show:0,
}, },
{ {
id:15,
name: '5#电磁阀', name: '5#电磁阀',
code: 1170, code: 1170,
state:0, state:0,
open:0, open:0,
show:0,
}, },
{ {
id:16,
name: '6#电磁阀', name: '6#电磁阀',
code: 1171, code: 1171,
state:0, state:0,
open:0, open:0,
show:0,
}, },
{ {
id:17,
name: '7#电磁阀', name: '7#电磁阀',
code: 1172, code: 1172,
state:0, state:0,
open:0, open:0,
show:0,
}, },
{ {
id:18,
name: '8#电磁阀', name: '8#电磁阀',
code: 1173, code: 1173,
state:0, state:0,
open:0, open:0,
show:0,
}, },
], ],
electronMagneticList:[], electronMagneticList:[],
@ -3019,6 +3035,8 @@
if (res.code == 200) { if (res.code == 200) {
uni.hideLoading() uni.hideLoading()
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
res.data.forEach((el, index) => { res.data.forEach((el, index) => {
this.purviewList.push(el.id.toString()) this.purviewList.push(el.id.toString())
if (el.id == '19') { if (el.id == '19') {
@ -3079,12 +3097,12 @@
this.highpressuremistList = this.toNewList(this.highpressuremistList, this.highpressuremistList = this.toNewList(this.highpressuremistList,
el.child) el.child)
} else { } else {
this.electronMagneticStatus.forEach((el1,index)=>{
for (let t = 0; t < this.electronMagneticStatus.length; t++) { if(el1.id==el.id){
if ((t + 11) == el.id) { this.electronMagneticStatus[index].name=el.nickName
this.electronMagneticStatus[t].name = el.nickName this.electronMagneticStatus[index].show=el.state
} }
} })
} }
@ -3410,7 +3428,8 @@
}, },
getDCF(t,data){ getDCF(t,data){
var index=t var index=t
var num=data[1174] var num=data[1174]?data[1174]:'0'
var num1 = this.padString(num.toString(2), 8) var num1 = this.padString(num.toString(2), 8)
var openListNew = [] var openListNew = []