From 6ef89b00cce212f98ffe6ac339642e25e507d88a Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期三, 11 九月 2024 19:38:26 +0800
Subject: [PATCH] update
---
src/views/mdc/station-live.vue | 38 +++++++++++++++++++++++++-------------
1 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/src/views/mdc/station-live.vue b/src/views/mdc/station-live.vue
index dc233a0..be7034a 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-06-17 14:20:06
+ * @LastEditTime: 2024-09-09 12:04:32
* @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
-->
@@ -70,7 +70,7 @@
<div class="status-box" v-for="item in achievements"><div class="status-color" :style="{'background-color': item.color}"></div>{{ item.name }}</div>
</div>
<div class="status-wrap">
- <el-checkbox v-model="checked1" label="浜哄伐鍙嶉鐘舵��" size="large" />
+ <el-checkbox v-model="humanFeedback" label="浜哄伐鍙嶉鐘舵��" size="large" />
<div class="status-con">
<div class="status-box" v-for="item in collectionstatus"><div class="status-color" :style="{'background-color': item.color}"></div>{{ item.name }}</div>
</div>
@@ -133,7 +133,7 @@
return {
achievements: [],
collectionstatus: [],
- checked1: "",
+ humanFeedback: "",
alarmtotal: 0,
alarmtableData: [],
wcsDate: "",
@@ -336,7 +336,7 @@
getrecord() { //鐝鐘舵�佽褰晅able
var obj = {
date: this.wcsDate,
- humanFeedback: true,
+ humanFeedback: this.humanFeedback,
workstationId: this.lastLevelId
}
this.$HTTP.post(`/api/blade-mdc/status-record/shift-index-status-record-table`,obj).then(res=> {
@@ -412,7 +412,7 @@
var obj = {
date: this.wcsDate,
//date : "2024-05-15",
- humanFeedback: true,
+ humanFeedback: this.humanFeedback,
workstationId: this.lastLevelId
}
this.$HTTP.post(`/api/blade-mdc/status-record/shift-index-status-record-chart`,obj).then(res=> {
@@ -560,7 +560,7 @@
getwscLvalue() {
var obj = {
date: this.wcsDate,
- humanFeedback: true,
+ humanFeedback: this.humanFeedback,
workstationId: this.lastLevelId
}
this.$HTTP.post(`/api/blade-mdc/status-record/time-distribution`,obj).then(res=> {
@@ -599,7 +599,7 @@
getwcsR() {
var obj = {
date: this.wcsDate,
- humanFeedback: true,
+ humanFeedback: this.humanFeedback,
workstationId: this.lastLevelId
}
this.$HTTP.post(`/api/blade-mdc/status-record/equipment-efficiency`,obj).then(res=> {
@@ -659,11 +659,13 @@
this.$TOOL.socket.sendDataToWebSocket(obj); //鍙戦��
this.$TOOL.socket.websocket.onmessage = function(event) {
if(res.data.length == 0) return; //娌″�间笉鐢ㄥ惊鐜�
- res.data.forEach(item=> { //绗竴姝ユ妸v鏀惧埌code閲�
+ res.data.forEach((item,index)=> { //绗竴姝ユ妸v鏀惧埌code閲�
var eventData = JSON.parse(event.data);
if(item.name == "DeviceStatus") { //鏈哄櫒鐘舵��
- item.code = eventData.data[item.name].v;
- that.allwcs.forEach(item1=> {
+ if(eventData.data[item.name]) {
+ item.code = eventData.data[item.name].v;
+ }
+ that.allwcs.forEach((item1)=> {
if(item.code == item1.code) {
item.codeName = item1.name; //绗簩姝ユ妸v鐨刢ode鍜岃繍琛屽搴�
if(item.code == "2") {
@@ -677,9 +679,19 @@
if(item.name == 'Alarm') { //鎶ヨ
if(eventData.data[item.name]) {
var v = JSON.parse(eventData.data[item.name].v);
- item.description = v.code;
- item.codeName = v.msg;
- item.color = "#370C0D";
+ if(Array.isArray(v)) { //濡傛灉鏄暟缁勶紝涓嶈祴鍊�
+ if(v.length == 0) {
+ res.data.splice(index,1);
+ }else {
+ item.description = v[0].code;
+ item.codeName = v[0].msg;
+ item.color = "#370C0D";
+ }
+ }else {
+ item.description = v.code;
+ item.codeName = v.msg;
+ item.color = "#370C0D";
+ }
}
}else {
if(eventData.data[item.name]) {
--
Gitblit v1.9.3