From 3e2690f4f8e42e826164431d7ecff4d7e6318fe6 Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期日, 06 十月 2024 22:47:29 +0800
Subject: [PATCH] 1
---
src/views/mdc/station-live.vue | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/views/mdc/station-live.vue b/src/views/mdc/station-live.vue
index fc2e9de..1744fc6 100644
--- a/src/views/mdc/station-live.vue
+++ b/src/views/mdc/station-live.vue
@@ -2,14 +2,14 @@
* @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:46:49
* @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
-->
<template>
<div class="aposcope-main">
<div class="aposcope-left">
- <div class="left-title">鏌ヨ鏉′欢1</div>
+ <div class="left-title">鏌ヨ鏉′欢</div>
<el-tree :data="tableData" node-key="id" default-expand-all :expand-on-click-node="false" :props="defalutProps" @node-click="handleNodeClick" ref="treeRef" highlight-current />
</div>
<div class="aposcope-right">
@@ -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