From 7932db50024f878e89fa2574ce402cecfe1a6b05 Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Fri, 1 Mar 2024 16:25:38 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E4=BF=AE=E6=94=B9=E9=A3=8E=E6=9C=BA?= =?UTF-8?q?=E7=8A=B6=E6=80=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/content/fanInfo/FanInfo.vue | 34 +++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/components/content/fanInfo/FanInfo.vue b/src/components/content/fanInfo/FanInfo.vue index b7857fc..da19ef8 100644 --- a/src/components/content/fanInfo/FanInfo.vue +++ b/src/components/content/fanInfo/FanInfo.vue @@ -13,9 +13,10 @@
{{ changeNum(item) }}号风机
-
+ +
- 状态:{{ item.breakdown ? '故障' : item.running ? '运行' : '故障' }} + 状态:{{ changeStateText(item.breakdown, item.running) }}
{ }) transducerData.value = tranArr } -const getImage = (type) => { - switch (type) { - case false: - return "blue-state-icon.png"; - case true: - return "red-state-icon.png"; - } -} + const changeNum = (item) => { switch (item.equipmentName) { case '1号变频器': @@ -512,11 +506,25 @@ const handleOnMounted = () => { } } const changeStopColor = (breakdown, running) => { - console.log('breakdown,running', breakdown, running) if (breakdown) { - return true + return 'red' } else { - return !running; + if (running) { + return '#3eab3f' + } else { + return '#E6A23C' + } + } +} +const changeStateText = (breakdown, running) => { + if (breakdown) { + return '故障' + } else { + if (running) { + return '运行' + } else { + return '停止' + } } } /**