From 345708c092a7c7daafe2da9a2181c92d689d8fc0 Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期二, 18 六月 2024 18:14:32 +0800
Subject: [PATCH] 1
---
src/views/mdc/realtime-status/index.vue | 52 ++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 38 insertions(+), 14 deletions(-)
diff --git a/src/views/mdc/realtime-status/index.vue b/src/views/mdc/realtime-status/index.vue
index 439c2ea..a13892a 100644
--- a/src/views/mdc/realtime-status/index.vue
+++ b/src/views/mdc/realtime-status/index.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-04-09 22:11:21
* @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-06-18 16:45:04
+ * @LastEditTime: 2024-06-18 18:14:08
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/realtime-status/index.vue
瀹炴椂鐪嬫澘
-->
@@ -115,7 +115,9 @@
mounted() {
this.getstationlabelList(); //鑾峰彇鏍囩瑙嗗浘涓嬬殑list
this.setIntervalTime(); //鍗佺澧炲姞鏃堕棿
- this.getSetting(); //璁剧疆鍑犺鍑犲垪 ==銆嬭幏鍙栭《閮╰itle=銆嬭幏鍙栭鑹诧紝鑾峰彇鏈哄櫒=銆媤s
+ this.getSetting(); //璁剧疆鍑犺鍑犲垪 ==銆嬭幏鍙栭《閮╰itle
+ //this.getprocess(); //鑾峰彇棰滆壊锛岃幏鍙栨満鍣�
+ this.gettimestatus(); //ws
},
methods: {
getSetting() {
@@ -235,7 +237,6 @@
this.$HTTP.get(`/api/blade-cps/global_wcs/wcs-achievements`).then(res=> {
if(res.code == 200) {
this.allwcs = res.data;
- this.gettimestatus();
}
})
},
@@ -272,13 +273,38 @@
ids.push(item.id);
if(item.properties != null) {
item.properties.forEach(item1=> {
- this.devicestatus.forEach(item2=> {
- if(item2.status == item1.value) {
- item.statusName = item2.statusName;
- item1.statusName = item2.statusName;
- item.statusStyle = item2.color;
- }
- })
+ // this.devicestatus.forEach(item2=> {
+ // if(item2.status == item1.value) {
+ // item.statusName = item2.statusName;
+ // item1.statusName = item2.statusName;
+ // item.statusStyle = item2.color;
+ // }
+ // })
+ if(item1.value == 1) {
+ item.statusName = '鎶ヨ';
+ item1.statusName = '鎶ヨ';
+ item.statusStyle = "#370C0D";
+ }
+ if(item1.value == 2) {
+ item.statusName = '杩愯';
+ item1.statusName = '杩愯';
+ item.statusStyle = "#73D13D";
+ }
+ if(item1.value == 3) {
+ item.statusName = "寰呮満";
+ item1.statusName = "寰呮満";
+ item.statusStyle = "#FFC53D";
+ }
+ if(item1.value == 4) {
+ item.statusName = "绂荤嚎";
+ item1.statusName = "绂荤嚎";
+ item.statusStyle = "#595959";
+ }
+ if(item1.value == 5) {
+ item.statusName = "璋冭瘯";
+ item1.statusName = "璋冭瘯";
+ item.statusStyle = "#40A9FF";
+ }
})
}
})
@@ -302,7 +328,6 @@
this.$TOOL.socket.websocket.onmessage = function(event) {
num ++;
var eventData = JSON.parse(event.data);
- console.log(eventData,1234)
if(eventData.data.DeviceStatus != undefined) {
var time = moment(eventData.data.DeviceStatus.t).format('YYYY-MM-DD HH:mm:ss');
var diffTime = that.changeTime(time); //杞崲鎴愬樊鍊硷紙鏃跺垎绉掞級
@@ -371,8 +396,8 @@
res.data.forEach(item=> {
item.active = false;
})
- res.data[0].color = "#73D13D";
- res.data[1].color = "#370C0D";
+ res.data[0].color = "#370C0D";
+ res.data[1].color = "#73D13D";
res.data[2].color = "#FFC53D";
res.data[3].color = "#595959";
res.data[4].color = "#40A9FF";
@@ -382,7 +407,6 @@
res.data[3].icon = "Warning";
res.data[4].icon = "Odometer";
this.devicestatus = res.data;
- this.getprocess(); //鑾峰彇棰滆壊锛岃幏鍙栨満鍣�
}
})
}
--
Gitblit v1.9.3