From 72ccf07d76e29f0e6e4bd613a5a841d5aecb4eeb Mon Sep 17 00:00:00 2001 From: z_yu <1534695664@qq.com> Date: Fri, 16 Sep 2022 13:52:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8FenvironmentalScreen=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=BC=8F=E6=B0=B4=E4=BC=A0=E6=84=9F=E5=99=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/environmentalScreen/index.vue | 67 ++++++++++++++++++++----- 1 file changed, 55 insertions(+), 12 deletions(-) diff --git a/src/views/environmentalScreen/index.vue b/src/views/environmentalScreen/index.vue index a482dea..e6d60fb 100644 --- a/src/views/environmentalScreen/index.vue +++ b/src/views/environmentalScreen/index.vue @@ -49,21 +49,21 @@ 报警 @@ -274,6 +274,13 @@ export default { unit: '', curstatus: 0 } + }, + waterLeakage: { + waterLeakageStatus1: false, + waterLeakageStatus2: false, + waterLeakageStatus3: false, + waterLeakageStatus4: false, + waterLeakageText4: '' } } }, @@ -386,12 +393,18 @@ export default { const result = data.find((item) => { return item.property_id === element.deviceSpecParams[0].paramId && item.device_id === element.deviceInfo.deviceId }) - this.$set(this.topDisplayData, element.divPosition, { - show: true, - curValue: result.curvalue, - unit: result.unit, - curstatus: result.curstatus - }) + if (result) { + this.$set(this.topDisplayData, element.divPosition, { + show: true, + curValue: result.curvalue, + unit: result.unit, + curstatus: result.curstatus + }) + } else { + this.$set(this.topDisplayData, element.divPosition, { + show: false + }) + } } else if (element.divPosition.includes('OAO')) { // 获取3D弹窗显示的数据 const wenduParamId = element.deviceSpecParams.find((item) => { return item.paramName === '温度' })?.paramId @@ -408,7 +421,7 @@ export default { return item.property_id === siduParamId && item.device_id === element.deviceInfo.deviceId }) } - console.log(wendu?.curstatus, sidu?.curstatus) + // console.log(wendu?.curstatus, sidu?.curstatus) this.oaoMessage.push({ id: element.divPosition, wendu: (wendu?.curvalue) ? (Math.round(wendu?.curvalue)) : '-', @@ -417,6 +430,36 @@ export default { }) } else { // LS 漏水感应器 + const waterLeakageParamId1 = element.deviceSpecParams.find((item) => { return item.paramName === '维护报警' })?.paramId + const waterLeakageParamId2 = element.deviceSpecParams.find((item) => { return item.paramName === '漏水报警' })?.paramId + const waterLeakageParamId3 = element.deviceSpecParams.find((item) => { return item.paramName === '感应线断裂' })?.paramId + const waterLeakage4 = element.deviceSpecParams.find((item) => { return item.paramName === '漏水位置' }) + if (waterLeakage4) { + this.waterLeakage.waterLeakageText4 = waterLeakage4.unit + } + const waterLeakageParamId4 = waterLeakage4?.paramId + if (waterLeakageParamId1) { + this.waterLeakage.waterLeakageStatus1 = data.find((item) => { + return item.property_id === waterLeakageParamId1 && item.device_id === element.deviceInfo.deviceId + })?.curstatus > 0 + } + if (waterLeakageParamId2) { + this.$set(this.waterLeakage, 'waterLeakageStatus2', data.find((item) => { + return item.property_id === waterLeakageParamId2 && item.device_id === element.deviceInfo.deviceId + })?.curstatus > 0) + } + if (waterLeakageParamId3) { + this.$set(this.waterLeakage, 'waterLeakageStatus3', data.find((item) => { + return item.property_id === waterLeakageParamId3 && item.device_id === element.deviceInfo.deviceId + })?.curstatus > 0) + } + if (waterLeakageParamId4) { + const waterLeakageValue4 = data.find((item) => { + return item.property_id === waterLeakageParamId4 && item.device_id === element.deviceInfo.deviceId + }) + this.$set(this.waterLeakage, 'waterLeakageStatus4', waterLeakageValue4?.curstatus > 0) + this.waterLeakage.waterLeakageText4 = waterLeakageValue4?.curvalue ? waterLeakageValue4?.curvalue + ' ' + this.waterLeakage.waterLeakageText4 : '' + } } }) })