From a9833153fb5aef7e26af84f9be904c4337a6e781 Mon Sep 17 00:00:00 2001 From: selia-zx <1771203023@qq.com> Date: Thu, 29 May 2025 16:59:21 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E4=B8=AD=E5=A4=AE=E7=A9=BA?= =?UTF-8?q?=E8=B0=83-=E7=B3=BB=E7=BB=9F=E7=9B=91=E6=B5=8B-=E5=8E=8B?= =?UTF-8?q?=E7=BC=A9=E6=9C=BA=E5=8F=82=E6=95=B0=E5=86=85=E5=AE=B9tab?= =?UTF-8?q?=E5=88=86=E5=BC=80=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../centerairC/sysMonitor/hostDetails.vue | 87 ++++++++++++------- 1 file changed, 57 insertions(+), 30 deletions(-) diff --git a/src/views/centerairC/sysMonitor/hostDetails.vue b/src/views/centerairC/sysMonitor/hostDetails.vue index 5bbb1eb..dab932e 100644 --- a/src/views/centerairC/sysMonitor/hostDetails.vue +++ b/src/views/centerairC/sysMonitor/hostDetails.vue @@ -173,30 +173,34 @@
-
压缩机参数
+
+
+ {{ item.mtTypeName }} +
+
- {{ item.otherName }}: - {{ item.curValue }} - {{ item.unit }} + {{ subItem.otherName }}: + {{ subItem.curValue }} + {{ subItem.unit }}
-
@@ -240,6 +244,8 @@ export default { isMagnetic: false, isShowWarning: false, //是否有报警 dayData: "", //监测天数 + sharedIndex: 0, + currentDisplayData: [], }; }, computed: { @@ -407,27 +413,33 @@ export default { } }); } - if (item.mtType === "9") { - // 压缩机参数 - this.compressorData = item.list; - // 遍历数组 - for (let i = 0; i < this.compressorData.length; i++) { - const item = this.compressorData[i]; - if (item.paramType === "1" && Number(item.curValue) === 0) { - item.curValue = "停止"; - console.log("压缩机停止了啊是0···················"); - } else if ( - item.paramType === "1" && - Number(item.curValue) === 1 - ) { - item.curValue = "运行"; - } - } - } }); + // 使用 filter 方法过滤掉 item 为 '0' 的对象 + this.compressorData = data.filter((obj) => obj.mtType !== "0"); + console.log("压缩机数组", this.compressorData); + // 在组件挂载后触发 handleEnter 方法,这里默认点击第一个元素 + if (this.compressorData.length > 0) { + this.handleEnter(0, this.compressorData[0].name); + } } }); }, + handleEnter(index, event) { + console.log("index", index); + this.sharedIndex = index; + // 更新当前显示的数据为点击项的子列表 + this.currentDisplayData = this.compressorData[index].list; + // 遍历数组 + for (let i = 0; i < this.currentDisplayData.length; i++) { + const item = this.currentDisplayData[i]; + if (item.paramType === "1" && Number(item.curValue) === 0) { + item.curValue = "停止"; + console.log("压缩机停止了啊是0···················"); + } else if (item.paramType === "1" && Number(item.curValue) === 1) { + item.curValue = "运行"; + } + } + }, // 采集参数列表 getCollect(id) { let data = { @@ -856,7 +868,7 @@ export default { } } .detail-data-bottom { - // width: 100%; + width: 100%; // padding: 0.1rem 0.3rem; z-index: 0; display: flex; @@ -1065,4 +1077,19 @@ export default { } } } +.choice { + margin-left: 0 !important; +} +.choice .mr20 { + width: 1rem !important; + color: #c0dffc; + font-weight: bold !important; + font-size: 0.18rem !important; + text-align: center !important; + background-color: transparent !important; + box-shadow: none !important; +} +.timeStyle { + color: #ffffff !important; +}