From 8e4e122e294640978016810a4d006a0be203363e Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期五, 14 十一月 2025 20:22:55 +0800
Subject: [PATCH] dupate
---
src/views/mdc/realtime-status/index.vue | 34 ++++++++++++++++++++++++----------
1 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/src/views/mdc/realtime-status/index.vue b/src/views/mdc/realtime-status/index.vue
index 49adb0c..462fa0b 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@yxqiche.com
- * @LastEditTime: 2025-04-16 12:05:31
+ * @LastEditTime: 2025-05-28 13:45:33
* @FilePath: /cps-web/src/views/mdc/realtime-status/index.vue
瀹炴椂鐪嬫澘
-->
@@ -212,6 +212,7 @@
this.gettimestatus();
},
next() {
+
if ((this.current * this.line) < this.total / this.column) {
this.current = Number(this.current) + 1;
this.gettimestatus();
@@ -292,6 +293,7 @@
if (eventData.data.DeviceStatus) {
var time = moment(eventData.data.DeviceStatus.t).format('YYYY-MM-DD HH:mm:ss');
var preT = moment(eventData.data.DeviceStatus.preT).format('YYYY-MM-DD HH:mm:ss');
+ //console.log('time='+time+",preT="+preT);
var diffTime = that.changeTime(time,preT); //杞崲鎴愬樊鍊硷紙鏃跺垎绉掞級
var diffTime = diffTime;
item.time = diffTime;
@@ -324,8 +326,12 @@
} else {
if(eventData.data[item1.key]) {
if(item1.key == "Alarm") {
- var vJson = JSON.parse(eventData.data[item1.key].v);
- item1.code = JSON.stringify(vJson[0]);
+ try {
+ var vJson = JSON.parse(eventData.data[item1.key].v);
+ item1.code = JSON.stringify(vJson[0]);
+ } catch (e) {
+ item1.code = eventData.data[item1.key].v;
+ }
}else {
item1.code = eventData.data[item1.key].v;
}
@@ -360,6 +366,7 @@
this.$HTTP.get(`/api/mdc/work-station-analysis/device-status-statistics`).then(res => {
if (res.code == 200) {
var deviceNumAll = 0;
+ var newResData = [];
res.data.forEach(item => {
item.active = false;
this.allwcs.forEach(item1 => {
@@ -371,13 +378,20 @@
item.active = true;
}
deviceNumAll += item.deviceNum;
+ if(item.statusName != '璋冭瘯') {
+ newResData.push(item);
+ }
+ if(item.statusName == '鎶ヨ') {
+ item.icon = "Position";
+ }else if(item.statusName == '寰呮満') {
+ item.icon = "Loading";
+ }else if(item.statusName == '绂荤嚎') {
+ item.icon = "Clock";
+ }else {
+ item.icon = "Odometer";
+ }
})
- res.data[0].icon = "Position";
- res.data[1].icon = "Loading";
- res.data[2].icon = "Clock";
- res.data[3].icon = "Warning";
- res.data[4].icon = "Odometer";
- res.data.push({
+ newResData.push({
active: false,
color: "#08f1f4",
deviceNum: deviceNumAll,
@@ -385,7 +399,7 @@
status: "10",
statusName: "鍏ㄩ儴",
})
- this.devicestatus = res.data;
+ this.devicestatus = newResData;
}
})
}
--
Gitblit v1.9.3