From 35a5b36f140c947d154460ce61007d6ace54ec9b Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期一, 07 十月 2024 00:52:42 +0800
Subject: [PATCH] 1
---
src/views/mdc/realtime-status/index.vue | 51 +++++++++++++++++++++++----------------------------
1 files changed, 23 insertions(+), 28 deletions(-)
diff --git a/src/views/mdc/realtime-status/index.vue b/src/views/mdc/realtime-status/index.vue
index 904247d..c5457e3 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: gaosp
- * @LastEditTime: 2024-09-04 22:11:55
+ * @LastEditors: lzhe lzhe@example.com
+ * @LastEditTime: 2024-10-07 00:51:38
* @FilePath: /mdc/Users/mache/Documents/demo/cps-web/src/views/mdc/realtime-status/index.vue
瀹炴椂鐪嬫澘
-->
@@ -127,6 +127,7 @@
}
},
mounted() {
+ this.deviceStatus = this.$route.query.currentTag?[...this.$route.query.currentTag]:[];
this.getstationlabelList(); //鑾峰彇鏍囩瑙嗗浘涓嬬殑list
this.setIntervalTime(); //鍗佺澧炲姞鏃堕棿
this.getprocess(); //鑾峰彇棰滆壊==銆嬭幏鍙栭《閮╰itle==銆嬭缃嚑琛屽嚑鍒�==銆媤s
@@ -277,10 +278,9 @@
workStationGroupIdList: this.workStationGroupIdList
}
this.timestatus = [];
- this.$HTTP.post(`/api/blade-cps/workstation/real-time-status?current=${this.current || 0}&size=${this.size || 0}`, obj).then(res => {
+ this.$HTTP.post(`/api/blade-cps/workstation/real-time-status?current=${this.current || 0}&size=${this.size || 6}`, obj).then(res => {
if (res.code == 200) {
var ids = [];
- console.log(this.allwcs, res.data)
res.data.records.forEach(item => {
ids.push(item.id);
if (item.properties != null && item.properties.length != 0) {
@@ -314,11 +314,12 @@
that.$TOOL.socket.sendDataToWebSocket(obj); //鍙戦��
}
}, 500);
- var num = 0;
+ //var num = 0;
var intervalId;
this.$TOOL.socket.websocket.onmessage = function (event) {
- num++;
+ //num++;
var eventData = JSON.parse(event.data);
+ if(Object.keys(eventData.data).length == 0) return;
if (that.timestatus.length == 0) return; //娌″�间笉鐢ㄥ惊鐜�
that.timestatus.forEach((item, index) => { //绗竴姝ユ妸v鏀惧埌code閲�
if (eventData.id == item.id) {
@@ -344,16 +345,12 @@
}
item.properties.forEach((item1, index1) => {
if (item1.key == "DeviceStatus") { //鏈哄櫒鐘舵��
- if (item1.value == "2") {
- that.allwcs.forEach(item2 => {
- if (item2.code == item1.value) {
- item1.color = item2.color;
- item1.code = item2.name;
- }
- })
- } else {
- item1.color = "#75C0C0";
- }
+ that.allwcs.forEach(item2 => {
+ if (item2.code == item1.value) {
+ item1.color = item2.color;
+ item1.code = item2.name;
+ }
+ })
} else {
if (item1.key == 'Alarm') { //鎶ヨ
if (eventData.data[item1.key]) {
@@ -364,33 +361,28 @@
} else {
item1.name = v[0].code;
item1.code = v[0].msg;
- that.allwcs.forEach(item2 => {
- if (item2.name == "鎶ヨ") {
- item1.color = item2.color;
- }
- })
}
} else {
item1.name = v.code;
item1.code = v.msg;
- that.allwcs.forEach(item2 => {
- if (item2.name == "鎶ヨ") {
- item1.color = item2.color;
- }
- })
}
}
} else {
if (eventData.data[item1.key]) {
item1.code = eventData.data[item1.key].v;
- item1.color = "#75C0C0";
}
}
+ that.allwcs.forEach(item2 => {
+ if (item2.name == "鎶ヨ") {
+ item1.color = item2.color;
+ }
+ })
}
})
}
});
};
+ console.log(this.timestatus,214)
// var len = res.data.records.length;
// intervalId = setInterval(function() {
// if (num === len) {
@@ -411,6 +403,9 @@
item.color = item1.color;
}
})
+ if (this.$route.query.currentTag == item.status) {
+ item.active = true;
+ }
})
res.data[0].icon = "Position";
res.data[1].icon = "Loading";
@@ -530,7 +525,7 @@
font-weight: 700;
font-size: 16px;
color: #333;
- width: 33%;
+ width: 26%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
--
Gitblit v1.9.3