From f8f6aef5508148a784c05e71366796bb0b61164d Mon Sep 17 00:00:00 2001
From: 李喆(开发组) <lzhe@yxqiche.com>
Date: 星期二, 18 十一月 2025 14:04:31 +0800
Subject: [PATCH] Merge branch 'new' of http://122.9.151.159:9090/r/smart-web into new
---
src/views/mdc/realtime-status/index.vue | 60 +++++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 47 insertions(+), 13 deletions(-)
diff --git a/src/views/mdc/realtime-status/index.vue b/src/views/mdc/realtime-status/index.vue
index fd7c5cd..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 lzhe@example.com
- * @LastEditTime: 2024-10-31 17:27:54
+ * @LastEditors: 鏉庡枂(寮�鍙戠粍) lzhe@yxqiche.com
+ * @LastEditTime: 2025-05-28 13:45:33
* @FilePath: /cps-web/src/views/mdc/realtime-status/index.vue
瀹炴椂鐪嬫澘
-->
@@ -79,7 +79,7 @@
</div>
</div>
</div>
- <el-dialog :title="titleMap" v-model="visible" :width="740">
+ <el-dialog :title="titleMap" v-model="visible" :width="740" v-if="visible">
<div class="dialogstyle">
<el-table :data="timestatus[clickIndex].properties" style="width: 100%" border>
<el-table-column prop="name" label="鏁版嵁鐐�"></el-table-column>
@@ -129,6 +129,10 @@
this.deviceStatus = this.$route.query.currentTag ? [...this.$route.query.currentTag] : [];
this.getstationlabelList(); //鑾峰彇鏍囩瑙嗗浘涓嬬殑list
this.getprocess(); //鑾峰彇棰滆壊==銆嬭幏鍙栭《閮╰itle==銆嬭缃嚑琛屽嚑鍒�==銆媤s
+ //姣忎竴鍒嗛挓鎵ц涓�娆�
+ var intervalId = setInterval(() => {
+ this.getdevicestatus();
+ }, 60000);
},
methods: {
getSetting() {
@@ -175,6 +179,7 @@
this.stationlabel = this.stationlabelList[0].groupName;
this.workStationGroupIdList = [this.stationlabelList[0].groupId];
}
+ this.clickIndex = 0;
this.gettimestatus(); //鏌ヨ鍒楄〃
},
showvisible(item, index) {
@@ -193,7 +198,12 @@
item.active = false;
})
this.devicestatus[index].active = true;
- this.deviceStatus = [item.status];
+ if(item.status == 10) { //鍏ㄩ儴
+ this.deviceStatus = [];
+ }else {
+ this.deviceStatus = [item.status];
+ }
+ this.current = "1";
this.gettimestatus();
},
prev() {
@@ -202,13 +212,14 @@
this.gettimestatus();
},
next() {
+
if ((this.current * this.line) < this.total / this.column) {
this.current = Number(this.current) + 1;
this.gettimestatus();
}
},
goSet() {
- this.$router.push('/mdc/configuration?isShowSearch=1'); //鍒嗘瀽璁剧疆
+ this.$router.push('/mdc/configuration?isShowSearch=1'); //鍒嗘瀽璁剧疆(isShowSearch琛ㄧず鍗虫椂淇℃伅鏉�)
},
gostatus(item) {
this.$router.push('/mdc/station-live?code=' + item.id);
@@ -282,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;
@@ -314,8 +326,12 @@
} else {
if(eventData.data[item1.key]) {
if(item1.key == "Alarm") {
- var vJson = JSON.parse(eventData.data[item1.key].v);
- item1.code = 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;
}
@@ -349,6 +365,8 @@
getdevicestatus() {
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 => {
@@ -359,13 +377,29 @@
if (this.$route.query.currentTag == item.status) {
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";
- this.devicestatus = res.data;
+ newResData.push({
+ active: false,
+ color: "#08f1f4",
+ deviceNum: deviceNumAll,
+ icon: "price-tag",
+ status: "10",
+ statusName: "鍏ㄩ儴",
+ })
+ this.devicestatus = newResData;
}
})
}
--
Gitblit v1.9.3