From cf9188af8fa9359e432bfb8769e9456ec3d8c059 Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期日, 06 十月 2024 22:36:42 +0800
Subject: [PATCH] 1
---
.env.development | 4 ++--
src/views/mdc/realtime-status/index.vue | 2 +-
src/views/mdc/station-live.vue | 29 +++++++++++++++--------------
3 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/.env.development b/.env.development
index b99bd8d..d559a8b 100644
--- a/.env.development
+++ b/.env.development
@@ -1,7 +1,7 @@
###
# @Date: 2024-03-23 09:49:06
# @LastEditors: lzhe lzhe@example.com
- # @LastEditTime: 2024-06-17 13:02:52
+ # @LastEditTime: 2024-10-06 21:10:14
# @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/.env.development
###
# 鏈湴鐜
@@ -11,7 +11,7 @@
VUE_APP_TITLE = 鍒堕�犱俊鎭鐞嗙郴缁�
# 鎺ュ彛鍦板潃
-VUE_APP_API_BASEURL = http://120.46.212.231:84
+VUE_APP_API_BASEURL = http://120.46.212.231:85
# 鏈湴绔彛
VUE_APP_PORT = 2800
diff --git a/src/views/mdc/realtime-status/index.vue b/src/views/mdc/realtime-status/index.vue
index 642affb..2c66d48 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-09-09 11:23:54
+ * @LastEditTime: 2024-10-06 22:31:43
* @FilePath: /mdc/Users/mache/Documents/demo/cps-web/src/views/mdc/realtime-status/index.vue
瀹炴椂鐪嬫澘
-->
diff --git a/src/views/mdc/station-live.vue b/src/views/mdc/station-live.vue
index fc2e9de..e9c0f18 100644
--- a/src/views/mdc/station-live.vue
+++ b/src/views/mdc/station-live.vue
@@ -2,7 +2,7 @@
* @Author: lzhe lzhe@example.com
* @Date: 2024-03-26 10:28:33
* @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-09-12 11:28:21
+ * @LastEditTime: 2024-10-06 22:33:59
* @FilePath: /smart-web/src/views/master/person/main/index.vue
* @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -644,7 +644,7 @@
}
},
getdmp(lastLevelId,machineId) {
- this.$HTTP.get(`/api/blade-cps/workstation/get-dmp-variables?machineId=${machineId}&workstationId=${lastLevelId}`).then(res=> {
+ this.$HTTP.get(`/api/blade-cps/workstation/listDatapointsByWorkstationId?machineId=${machineId}&workstationId=${lastLevelId}`).then(res=> {
if(res.code == 200) {
this.dmpList = [];
var that = this;
@@ -653,17 +653,18 @@
type: "realTimeData",
workstationIdList: [lastLevelId]
}
+ if(res.data.dpConfig == null || res.data.dpConfig.length == 0) return; //娌″�间笉鐢ㄥ惊鐜�
if(this.$TOOL.socket.websocket == null) { //娌℃湁寤虹珛鍏堝缓绔�
this.$TOOL.socket.connectToWebSocket(this.$TOOL.cookie.get("TOKEN"));
}
this.$TOOL.socket.sendDataToWebSocket(obj); //鍙戦��
this.$TOOL.socket.websocket.onmessage = function(event) {
- if(res.data.length == 0) return; //娌″�间笉鐢ㄥ惊鐜�
- res.data.forEach((item,index)=> { //绗竴姝ユ妸v鏀惧埌code閲�
+ var JSONData = JSON.parse(res.data.dpConfig);
+ JSONData.forEach((item,index)=> { //绗竴姝ユ妸v鏀惧埌code閲�
var eventData = JSON.parse(event.data);
- if(item.name == "DeviceStatus") { //鏈哄櫒鐘舵��
- if(eventData.data[item.name]) {
- item.code = eventData.data[item.name].v;
+ if(item.dpName == "DeviceStatus") { //鏈哄櫒鐘舵��
+ if(eventData.data[item.dpName]) {
+ item.code = eventData.data[item.dpName].v;
}
that.allwcs.forEach((item1)=> {
if(item.code == item1.code) {
@@ -676,12 +677,12 @@
}
})
}else {
- if(item.name == 'Alarm') { //鎶ヨ
- if(eventData.data[item.name]) {
- var v = JSON.parse(eventData.data[item.name].v);
+ if(item.dpName == 'Alarm') { //鎶ヨ
+ if(eventData.data[item.dpName]) {
+ var v = JSON.parse(eventData.data[item.dpName].v);
if(Array.isArray(v)) { //濡傛灉鏄暟缁勶紝涓嶈祴鍊�
if(v.length == 0) {
- res.data.splice(index,1);
+ JSONData.splice(index,1);
}else {
item.description = v[0].code;
item.codeName = v[0].msg;
@@ -694,14 +695,14 @@
}
}
}else {
- if(eventData.data[item.name]) {
- item.codeName = eventData.data[item.name].v;
+ if(eventData.data[item.dpName]) {
+ item.codeName = eventData.data[item.dpName].v;
}
item.color = "#75C0C0";
}
}
});
- that.dmpList = res.data;
+ that.dmpList = JSONData;
};
}
})
--
Gitblit v1.9.3