From 5270308151082506e0e6df2c72d278d2976ec860 Mon Sep 17 00:00:00 2001
From: liulijun <liulijun@hnkhzn.com>
Date: 星期三, 29 四月 2026 10:28:58 +0800
Subject: [PATCH] WCS设备监控
---
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/原料库/ConveyorLineJob_YL1ndFloor.cs | 48
项目代码/WCS/WCSClient/src/views/Index.vue | 51
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/原料库/YL_DB.cs | 62
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/StackerCraneJob_CP.cs | 61
项目代码/WCS/WCSClient/src/uitils/websocket.js | 9
项目代码/WCS/WCSClient/src/views/LineInfocopy.vue | 613 +++++--
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/ConveyorLineJob_CPD.cs | 228 +-
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/原料库/StackerCraneJob_YLSC3.cs | 55
项目代码/WCS/WCSClient/src/views/LineComponent.vue | 701 +++++---
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/原料库/StackerCraneJob_YLSC2.cs | 78
项目代码/WCS/WCSClient/src/views/LineComponentCP.vue | 474 ++++++
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj | 4
项目代码/WCS/WCSClient/babel.config.js | 3
项目代码/WCS/WCSClient/src/views/Home.vue | 1630 +++++++++++++++-----
项目代码/WCS/WCSClient/src/views/LineInfo.vue | 629 +++++--
15 files changed, 3,436 insertions(+), 1,210 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/babel.config.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/babel.config.js"
index e955840..dac5750 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/babel.config.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/babel.config.js"
@@ -1,5 +1,8 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
+ ],
+ plugins: [
+ '@babel/plugin-transform-optional-chaining'
]
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/uitils/websocket.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/uitils/websocket.js"
index d15ff7f..82c33fc 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/uitils/websocket.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/uitils/websocket.js"
@@ -1,7 +1,7 @@
import { ref, reactive } from 'vue';
export const useWebSocket = (protocols) => {
- const ws = new WebSocket("ws://localhost:9260/", protocols);
+ let ws = null;
const messages = ref([]);
const status = reactive({
isConnected: false,
@@ -10,6 +10,8 @@
// 浜嬩欢鐩戝惉
const connect = () => {
+ // 鍒涘缓鏂扮殑WebSocket瀹炰緥锛屼娇鐢ㄩ厤缃枃浠朵腑閰嶇疆鐨勭鍙�
+ ws = new WebSocket("ws://localhost:9260/", protocols);
ws.onopen = () => {
status.isConnected = true;
console.log('WebSocket 杩炴帴鎴愬姛');
@@ -41,7 +43,7 @@
// 鍙戦�佹秷鎭柟娉�
const send = (data) => {
- if (status.isConnected) {
+ if (status.isConnected && ws) {
ws.send(JSON.stringify(data));
}
};
@@ -51,6 +53,7 @@
messages,
status,
send,
- close: () => ws.close()
+ close: () => ws && ws.close(),
+ reconnect: connect
};
};
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/Home.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/Home.vue"
index f834133..54a5978 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/Home.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/Home.vue"
@@ -1,67 +1,12 @@
<template>
<div class="title">
- <el-row :gutter="20" style="height:85%">
- <el-col :span="8">
- <span style="position: relative; top: 100px;left: 30px;">
- <h4>涓�妤艰澶囩洃鎺�</h4>
+ <el-row :gutter="0" style="height:100%; width:400px;">
+ <el-col :span="16">
+ <span style="position: absolute; top: 10px; left: 30px;">
+ <h2>涓�妤煎師鏂欏簱璁惧鐩戞帶</h2>
</span>
- <el-row :gutter="20" style="height:1000px">
- <el-col :span="8">
- <div>
- <div v-for="(group, index) in groupedLines(linescopy7)" :key="index">
- <div class="positionY-group">
- <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
- :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
- :positionY="line.positionY" :condition="line.condition"
- url="api/Equipment/GetLineInfoByNo" />
- </div>
- </div>
- <div style="margin-top: 118px;"></div>
- <div v-for="(group, index) in groupedLines(linescopy8)" :key="index">
- <div class="positionY-group">
- <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
- :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
- :positionY="line.positionY" :condition="line.condition"
- url="api/Equipment/GetLineInfoByNo" />
- </div>
- </div>
- <div style="margin-top: 115px;"></div>
- <div v-for="(group, index) in groupedLines(linescopy9)" :key="index">
- <div class="positionY-group">
- <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
- :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
- :positionY="line.positionY" :condition="line.condition"
- url="api/Equipment/GetLineInfoByNo" />
- </div>
- </div>
- <div style="margin-top: 112px;"></div>
- <div v-for="(group, index) in groupedLines(linescopy10)" :key="index">
- <div class="positionY-group">
- <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
- :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
- :positionY="line.positionY" :condition="line.condition" />
- </div>
- </div>
- <div style="margin-top: 109px;"></div>
- <div v-for="(group, index) in groupedLines(linescopy11)" :key="index">
- <div class="positionY-group">
- <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
- :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
- :positionY="line.positionY" :condition="line.condition" />
- </div>
- </div>
- <div style="margin-top: 107px;"></div>
- <div v-for="(group, index) in groupedLines(linescopy12)" :key="index">
- <div class="positionY-group">
- <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
- :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
- :positionY="line.positionY" :condition="line.condition" />
- </div>
- </div>
- </div>
- </el-col>
-
- <el-col :span="8">
+ <el-row :gutter="20" style="height:1000px; width:100%;">
+ <el-col :span="24">
<div>
<div v-for="(group, index) in groupedLines(linescopy1)" :key="index">
<div class="positionY-group">
@@ -71,7 +16,7 @@
url="api/Equipment/GetLineInfoByNo" />
</div>
</div>
- <div style="margin-top: 108px;"></div>
+ <div style="margin-top: 30px;"></div>
<div v-for="(group, index) in groupedLines(linescopy2)" :key="index">
<div class="positionY-group">
<LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
@@ -80,7 +25,7 @@
url="api/Equipment/GetLineInfoByNo" />
</div>
</div>
- <div style="margin-top: 58px;"></div>
+ <div style="margin-top:50px;"></div>
<div v-for="(group, index) in groupedLines(linescopy3)" :key="index">
<div class="positionY-group">
<LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
@@ -89,7 +34,7 @@
url="api/Equipment/GetLineInfoByNo" />
</div>
</div>
- <div style="margin-top: 58px;"></div>
+ <div style="margin-top: 20px;"></div>
<div v-for="(group, index) in groupedLines(linescopy4)" :key="index">
<div class="positionY-group">
<LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
@@ -97,7 +42,7 @@
:positionY="line.positionY" :condition="line.condition" />
</div>
</div>
- <div style="margin-top: 115px;"></div>
+ <div style="margin-top: 40px;"></div>
<div v-for="(group, index) in groupedLines(linescopy5)" :key="index">
<div class="positionY-group">
<LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
@@ -105,8 +50,56 @@
:positionY="line.positionY" :condition="line.condition" />
</div>
</div>
- <div style="margin-top: 115px;"></div>
+ <div style="margin-top: 30px;"></div>
<div v-for="(group, index) in groupedLines(linescopy6)" :key="index">
+ <div class="positionY-group">
+ <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 40px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopy7)" :key="index">
+ <div class="positionY-group">
+ <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 30px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopy8)" :key="index">
+ <div class="positionY-group">
+ <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 30px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopy9)" :key="index">
+ <div class="positionY-group">
+ <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 50px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopy10)" :key="index">
+ <div class="positionY-group">
+ <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 0px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopy11)" :key="index">
+ <div class="positionY-group">
+ <LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 30px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopy12)" :key="index">
<div class="positionY-group">
<LineInfoCopy v-for="(line, lineIndex) in group.lines" :key="lineIndex"
:equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
@@ -121,374 +114,814 @@
<el-col :span="8">
<!-- 鍫嗗灈鏈� -->
<div style="position: relative; top: 50px;">
+ <!-- <div style="margin-top: 33px;"></div> -->
<div class="stackerDiv">
- <div class="stackDivName">涓�鍙峰爢鍨涙満</div>
- <LineComponent :x="xValue1" ref="stacker1" :equipNo="SC01"></LineComponent>
+ <div class="stackDivName" style="text-align: left;">浜斿彿鍫嗗灈鏈�</div>
+ <LineComponent :x="xValue1" ref="stacker5" :equipNo="SC05"></LineComponent>
</div>
<el-divider></el-divider>
<div class="stackerDiv">
- <div class="stackDivName">浜屽彿鍫嗗灈鏈�</div>
- <LineComponent :x="xValue2" ref="stacker2" :equipNo="SC02"></LineComponent>
+ <div class="stackDivName" style="text-align: left;">鍥涘彿鍫嗗灈鏈�</div>
+ <LineComponent :x="xValue2" ref="stacker4" :equipNo="SC04"></LineComponent>
</div>
<el-divider></el-divider>
+ <!-- <div style="margin-top: 85px;"></div> -->
<div class="stackerDiv">
- <div class="stackDivName">涓夊彿鍫嗗灈鏈�</div>
+ <div class="stackDivName" style="text-align: left;">涓夊彿鍫嗗灈鏈�</div>
<LineComponent :x="xValue3" ref="stacker3" :equipNo="SC03"></LineComponent>
</div>
<el-divider></el-divider>
+ <!-- <div style="margin-top: 55px;"></div> -->
<div class="stackerDiv">
- <div class="stackDivName">鍥涘彿鍫嗗灈鏈�</div>
- <LineComponent :x="xValue4" ref="stacker4" :equipNo="SC04"></LineComponent>
+ <div class="stackDivName" style="text-align: left;">浜屽彿鍫嗗灈鏈�</div>
+ <LineComponent :x="xValue4" ref="stacker2" :equipNo="SC02"></LineComponent>
</div>
<el-divider></el-divider>
+ <!-- <div style="margin-top: 35px;"></div> -->
<div class="stackerDiv">
- <div class="stackDivName">浜斿彿鍫嗗灈鏈�</div>
- <LineComponent :x="xValue5" ref="stacker5" :equipNo="SC05"></LineComponent>
+ <div class="stackDivName" style="text-align: left;">涓�鍙峰爢鍨涙満</div>
+ <LineComponent :x="xValue5" ref="stacker1" :equipNo="SC01"></LineComponent>
</div>
<el-divider></el-divider>
- <div class="stackerDiv">
- <div class="stackDivName">鍏彿鍫嗗灈鏈�</div>
- <LineComponent :x="xValue6" ref="stacker6" :equipNo="SC06"></LineComponent>
- </div>
</div>
</el-col>
</el-row>
-
</div>
+ <el-row :gutter="0" style="width:400px;">
+ <el-col :span="16">
+ <span style="position: absolute; top: 10px; left: 30px;">
+ <h2>涓�妤兼垚鍝佸簱璁惧鐩戞帶</h2>
+ </span>
+ <el-row :gutter="20" style="height:1000px; width:100%;">
+ <el-col :span="24">
+ <div>
+ <div v-for="(group, index) in groupedLines(linescopyCP1)" :key="index">
+ <div class="positionY-group">
+ <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition"
+ url="api/Equipment/GetLineInfoByNo" />
+ </div>
+ </div>
+ <div style="margin-top: 20px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopyCP2)" :key="index">
+ <div class="positionY-group">
+ <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition"
+ url="api/Equipment/GetLineInfoByNo" />
+ </div>
+ </div>
+ <div style="margin-top:40px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopyCP3)" :key="index">
+ <div class="positionY-group">
+ <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition"
+ url="api/Equipment/GetLineInfoByNo" />
+ </div>
+ </div>
+ <div style="margin-top: 20px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopyCP4)" :key="index">
+ <div class="positionY-group">
+ <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 50px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopyCP5)" :key="index">
+ <div class="positionY-group">
+ <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 30px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopyCP6)" :key="index">
+ <div class="positionY-group">
+ <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 50px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopyCP7)" :key="index">
+ <div class="positionY-group">
+ <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 30px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopyCP8)" :key="index">
+ <div class="positionY-group">
+ <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 50px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopyCP9)" :key="index">
+ <div class="positionY-group">
+ <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ <div style="margin-top: 30px;"></div>
+ <div v-for="(group, index) in groupedLines(linescopyCP10)" :key="index">
+ <div class="positionY-group">
+ <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex"
+ :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX"
+ :positionY="line.positionY" :condition="line.condition" />
+ </div>
+ </div>
+ </div>
+ </el-col>
+ </el-row>
+
+ </el-col>
+ <el-col :span="8">
+ <!-- 鍫嗗灈鏈� -->
+ <div style="position: relative; top: 50px;">
+ <!-- <div style="margin-top: 33px;"></div> -->
+ <div class="stackerDivCP">
+ <div class="stackDivName" style="text-align: left;">浜斿彿鍫嗗灈鏈�</div>
+ <LineComponentCP :x="xValue1" ref="stackerCP5" :equipNo="SC05CP"></LineComponentCP>
+ </div>
+ <el-divider></el-divider>
+ <div class="stackerDivCP">
+ <div class="stackDivName" style="text-align: left;">鍥涘彿鍫嗗灈鏈�</div>
+ <LineComponentCP :x="xValue2" ref="stackerCP4" :equipNo="SC04CP"></LineComponentCP>
+ </div>
+ <el-divider></el-divider>
+ <!-- <div style="margin-top: 85px;"></div> -->
+ <div class="stackerDivCP">
+ <div class="stackDivName" style="text-align: left;">涓夊彿鍫嗗灈鏈�</div>
+ <LineComponentCP :x="xValue3" ref="stackerCP3" :equipNo="SC03CP"></LineComponentCP>
+ </div>
+ <el-divider></el-divider>
+ <!-- <div style="margin-top: 55px;"></div> -->
+ <div class="stackerDivCP">
+ <div class="stackDivName" style="text-align: left;">浜屽彿鍫嗗灈鏈�</div>
+ <LineComponentCP :x="xValue4" ref="stackerCP2" :equipNo="SC02CP"></LineComponentCP>
+ </div>
+ <el-divider></el-divider>
+ <!-- <div style="margin-top: 35px;"></div> -->
+ <div class="stackerDivCP">
+ <div class="stackDivName" style="text-align: left;">涓�鍙峰爢鍨涙満</div>
+ <LineComponentCP :x="xValue5" ref="stackerCP1" :equipNo="SC01CP"></LineComponentCP>
+ </div>
+ <el-divider></el-divider>
+ </div>
+ </el-col>
+ </el-row>
</template>
+
+
<script>
import { onMounted, ref, reactive } from "vue";
import LineInfo from "./LineInfo.vue";
import LineInfoCopy from "./LineInfocopy.vue";
import LineComponent from './LineComponent.vue';
+import LineComponentCP from './LineComponentCP.vue';
import JElDescription from "./JElDescription";
import { useWebSocket } from '@/uitils/websocket';
+
export default {
+ setup() {
+ // 浣跨敤淇鍚庣殑WebSocket閽╁瓙鍑芥暟
+ const { ws, messages, status, send, reconnect } = useWebSocket();
+
+ return {
+ ws,
+ messages,
+ status,
+ send,
+ reconnect
+ };
+ },
data() {
return {
- ws: null, // WebSocket瀹炰緥
- messages: [], // 娑堟伅鍒楄〃
- status: { // 杩炴帴鐘舵��
- isConnected: false,
- error: null
- },
+ // 鍫嗗灈鏈鸿澶囩紪鍙烽厤缃�
+ SC01: "SC01_YL",
+ SC02: "SC02_YL",
+ SC03: "SC03_YLDual",
+ SC04: "SC04_YLDual",
+ SC05: "SC05_YLDual",
+ SC01CP: "SC01_CP",
+ SC02CP: "SC02_CP",
+ SC03CP: "SC03_CP",
+ SC04CP: "SC04_CP",
+ SC05CP: "SC05_CP",
linescopy1: [
+ // {
+ // equipNo: "101",
+ // imgType: "1",
+ // positionX: 0,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "102",
+ // imgType: "1",
+ // positionX: 0,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "103",
+ // imgType: "1",
+ // positionX: 0,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "109",
+ // imgType: "1",
+ // positionX: 0.5,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "200",
+ // imgType: "1",
+ // positionX: 1,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "202",
+ // imgType: "1",
+ // positionX: 1,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "204",
+ // imgType: "1",
+ // positionX: 1,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "206",
+ // imgType: "1",
+ // positionX: 1,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "208",
+ // imgType: "1",
+ // positionX: 1,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "210",
+ // imgType: "1",
+ // positionX: 1,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "212",
+ // imgType: "1",
+ // positionX: 1,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "302",
+ // imgType: "1",
+ // positionX: 1,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "304",
+ // imgType: "1",
+ // positionX: 1,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "306",
+ // imgType: "1",
+ // positionX: 1,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "309",
+ // imgType: "1",
+ // positionX: 1.5,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "310",
+ // imgType: "1",
+ // positionX: 2,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "313",
+ // imgType: "1",
+ // positionX: 2.5,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "314",
+ // imgType: "1",
+ // positionX: 3,
+ // positionY: 16,
+ // condition: false,
+ // },
{
- equipNo: "1005",
+ equipNo: "320",
imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
- {
- equipNo: "1006",
- imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
-
- {
- equipNo: "1007",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
- condition: false,
- },
- {
- equipNo: "1008",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
+ //positionX: 3,
+ positionX: 0,
+ positionY: 16,
condition: false,
}
],
linescopy2: [
+ // {
+ // equipNo: "104",
+ // imgType: "1",
+ // positionX: 0,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "106",
+ // imgType: "1",
+ // positionX: 0,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "108",
+ // imgType: "1",
+ // positionX: 0,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "200.1",
+ // imgType: "1",
+ // positionX: 2.325,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "201",
+ // imgType: "1",
+ // positionX: 2.325,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "203",
+ // imgType: "1",
+ // positionX: 2.325,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "205",
+ // imgType: "1",
+ // positionX: 2.325,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "207",
+ // imgType: "1",
+ // positionX: 2.325,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "209",
+ // imgType: "1",
+ // positionX: 2.325,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "211",
+ // imgType: "1",
+ // positionX: 2.325,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "301",
+ // imgType: "1",
+ // positionX: 2.325,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "303",
+ // imgType: "1",
+ // positionX: 2.325,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "305",
+ // imgType: "1",
+ // positionX: 2.325,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "311",
+ // imgType: "1",
+ // positionX: 4.65,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "315",
+ // imgType: "1",
+ // positionX: 6.975,
+ // positionY: 16,
+ // condition: false,
+ // },
{
- equipNo: "1009",
+ equipNo: "321",
imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
- {
- equipNo: "1010",
- imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
-
- {
- equipNo: "1011",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
- condition: false,
- },
- {
- equipNo: "1025",
- imgType: "1",
- positionX: 0.6,
- positionY: 21,
- condition: false,
- },
- {
- equipNo: "1012",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
+ //positionX: 6.975,
+ positionX: 0,
+ positionY: 16,
condition: false,
}
],
linescopy3: [
+ // {
+ // equipNo: "309.1",
+ // imgType: "1",
+ // positionX: 20.175,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "312",
+ // imgType: "1",
+ // positionX: 20.65,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "316",
+ // imgType: "1",
+ // positionX: 25.65,
+ // positionY: 0,
+ // condition: false,
+ // },
{
- equipNo: "1017",
+ equipNo: "322",
imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
- {
- equipNo: "1018",
- imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
-
- {
- equipNo: "1019",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
- condition: false,
- },
- {
- equipNo: "1026",
- imgType: "1",
- positionX: 0.6,
- positionY: 21,
- condition: false,
- },
- {
- equipNo: "1020",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
+ //positionX: 25.65,
+ positionX: 0,
+ positionY: 0,
condition: false,
}
],
linescopy4: [
+ // {
+ // equipNo: "413",
+ // imgType: "1",
+ // positionX: 22,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "317",
+ // imgType: "1",
+ // positionX: 25.65,
+ // positionY: 0,
+ // condition: false,
+ // },
{
- equipNo: "1021",
+ equipNo: "323",
imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
- {
- equipNo: "1022",
- imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
-
- {
- equipNo: "1023",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
- condition: false,
- },
- {
- equipNo: "1024",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
+ //positionX: 25.65,
+ positionX: 0,
+ positionY: 0,
condition: false,
}
],
linescopy5: [
+ // {
+ // equipNo: "410",
+ // imgType: "1",
+ // positionX: 17.525,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "411",
+ // imgType: "1",
+ // positionX: 17.525,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "412",
+ // imgType: "1",
+ // positionX: 17.525,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "318",
+ // imgType: "1",
+ // positionX: 21.65,
+ // positionY: 16,
+ // condition: false,
+ // },
{
- equipNo: "1031",
+ equipNo: "324",
imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
- {
- equipNo: "1032",
- imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
-
- {
- equipNo: "1033",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
- condition: false,
- },
- {
- equipNo: "1034",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
+ //positionX: 21.65,
+ positionX: 0,
+ positionY: 16,
condition: false,
}
],
linescopy6: [
+ // {
+ // equipNo: "414",
+ // imgType: "1",
+ // positionX: 22,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "319",
+ // imgType: "1",
+ // positionX: 24.3,
+ // positionY: 16,
+ // condition: false,
+ // },
{
- equipNo: "1035",
+ equipNo: "325",
imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
- {
- equipNo: "1036",
- imgType: "1",
- positionX: 0.6,
- positionY: 8,
- condition: false,
- },
-
- {
- equipNo: "1037",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
- condition: false,
- },
- {
- equipNo: "1038",
- imgType: "1",
- positionX: 0.6,
- positionY: 20,
+ //positionX: 24.3,
+ positionX: 0,
+ positionY: 16,
condition: false,
}
],
linescopy7: [
+ //{
+ // equipNo: "409",
+ // imgType: "2",
+ // positionX: 17.525,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "415",
+ // imgType: "2",
+ // positionX: 18.9,
+ // positionY: 16,
+ // condition: false,
+ // },
{
- equipNo: "1001",
- imgType: "1",
- positionX: 5,
- positionY: 8,
+ equipNo: "424",
+ imgType: "2",
+ //positionX: 19.3,
+ positionX: 0,
+ positionY: 16,
condition: false,
},
- {
- equipNo: "1002",
- imgType: "1",
- positionX: 5,
- positionY: 8,
- condition: false,
- },
-
- {
- equipNo: "1003",
- imgType: "1",
- positionX: 5,
- positionY: 20,
- condition: false,
- },
- {
- equipNo: "1004",
- imgType: "1",
- positionX: 5,
- positionY: 20,
- condition: false,
- },
+ // {
+ // equipNo: "424.1",
+ // imgType: "2",
+ // positionX: 21.7,
+ // positionY: 16,
+ // condition: false,
+ // },
],
linescopy8: [
- {
- equipNo: "1039",
- imgType: "1",
- positionX: 6,
- positionY: 8,
- condition: false,
- },
- {
- equipNo: "1040",
- imgType: "1",
- positionX: 6,
- positionY: 16,
- condition: false,
- },
+ // {
+ // equipNo: "408",
+ // imgType: "2",
+ // positionX: 17.525,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "416",
+ // imgType: "2",
+ // positionX: 18.9,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "423",
+ // imgType: "2",
+ // positionX: 19.3,
+ // positionX: 0,
+ // positionY: 16,
+ // condition: false,
+ // },
],
linescopy9: [
+ // {
+ // equipNo: "407",
+ // imgType: "2",
+ // positionX: 17.525,
+ // positionY: 16,
+ // condition: false,
+ // },
{
- equipNo: "1013",
- imgType: "1",
- positionX: 6,
- positionY: 8,
- condition: false,
- },
- {
- equipNo: "1014",
- imgType: "1",
- positionX: 6,
+ equipNo: "422",
+ imgType: "2",
+ //positionX: 20.65,
+ positionX: 0,
positionY: 16,
condition: false,
},
+ // {
+ // equipNo: "422.1",
+ // imgType: "2",
+ // positionX: 23.05,
+ // positionY: 16,
+ // condition: false,
+ // },
],
linescopy10: [
+ // {
+ // equipNo: "406",
+ // imgType: "2",
+ // positionX: 17.525,
+ // positionY: 16,
+ // condition: false,
+ // },
{
- equipNo: "1015",
- imgType: "1",
- positionX: 6,
- positionY: 8,
- condition: false,
- },
- {
- equipNo: "1016",
- imgType: "1",
- positionX: 6,
+ equipNo: "425",
+ imgType: "2",
+ //positionX: 24.4,
+ positionX: 0,
positionY: 16,
condition: false,
},
],
linescopy11: [
- {
- equipNo: "1027",
- imgType: "1",
- positionX: 6,
- positionY: 8,
- condition: false,
- },
- {
- equipNo: "1028",
- imgType: "1",
- positionX: 6,
- positionY: 16,
- condition: false,
- },
+ // {
+ // equipNo: "404",
+ // imgType: "2",
+ // positionX: 17.525,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "418",
+ // imgType: "2",
+ // positionX: 18.9,
+ // positionY: 16,
+ // condition: false,
+ // },
+ // {
+ // equipNo: "421",
+ // imgType: "2",
+ // positionX: 19.3,
+ // positionY: 16,
+ // condition: false,
+ // },
],
linescopy12: [
+ // {
+ // equipNo: "403",
+ // imgType: "2",
+ // positionX: 17.525,
+ // positionY: 16,
+ // condition: false,
+ // },
{
- equipNo: "1029",
- imgType: "1",
- positionX: 6,
- positionY: 8,
+ equipNo: "419",
+ imgType: "2",
+ //positionX: 18.9,
+ positionX: 0,
+ positionY: 16,
condition: false,
},
+ // {
+ // equipNo: "419.1",
+ // imgType: "2",
+ // positionX: 23.1,
+ // positionY: 16,
+ // condition: false,
+ // },
+ ],
+ linescopyCP1: [
{
- equipNo: "1030",
+ equipNo: "1003",
imgType: "1",
- positionX: 6,
+ positionX: 0,
positionY: 16,
condition: false,
},
],
-
+ linescopyCP2: [
+ {
+ equipNo: "1008",
+ imgType: "1",
+ positionX: 0,
+ positionY: 16,
+ condition: false,
+ },
+ ],
+ linescopyCP3: [
+ {
+ equipNo: "1007",
+ imgType: "1",
+ positionX: 0,
+ positionY: 16,
+ condition: false,
+ },
+ ],
+ linescopyCP4: [
+ {
+ equipNo: "1012",
+ imgType: "1",
+ positionX: 0,
+ positionY: 16,
+ condition: false,
+ },
+ ],
+ linescopyCP5: [
+ {
+ equipNo: "1013",
+ imgType: "1",
+ positionX: 0,
+ positionY: 16,
+ condition: false,
+ },
+ ],
+ linescopyCP6: [
+ {
+ equipNo: "1018",
+ imgType: "1",
+ positionX: 0,
+ positionY: 16,
+ condition: false,
+ },
+ ],
+ linescopyCP7: [
+ {
+ equipNo: "1017",
+ imgType: "1",
+ positionX: 0,
+ positionY: 16,
+ condition: false,
+ },
+ ],
+ linescopyCP8: [
+ {
+ equipNo: "1022",
+ imgType: "1",
+ positionX: 0,
+ positionY: 16,
+ condition: false,
+ },
+ ],
+ linescopyCP9: [
+ {
+ equipNo: "1023",
+ imgType: "1",
+ positionX: 0,
+ positionY: 16,
+ condition: false,
+ },
+ ],
+ linescopyCP10: [
+ {
+ equipNo: "1026",
+ imgType: "1",
+ positionX: 0,
+ positionY: 16,
+ condition: false,
+ },
+ ],
+
StackerCrane: {
Automatic: "",
Fault: "",
@@ -554,9 +987,455 @@
LineInfoCopy,
LineInfo,
LineComponent,
+ LineComponentCP,
JElDescription,
},
methods: {
+ groupedLines(linescopy) {
+ const groups = {};
+ linescopy.forEach((line) => {
+ const positionY = line.positionY;
+ if (!groups[positionY]) {
+ groups[positionY] = {
+ positionY,
+ lines: [],
+ };
+ }
+ groups[positionY].lines.push(line);
+ });
+ return Object.values(groups);
+ },
+ mouseClickRGVFirst() {
+ this.fullscreenLoading = true;
+ this.RGVFirst = true;
+ this.fullscreenLoading = false;
+ },
+ mouseClickSecond() {
+ this.fullscreenLoading = true;
+ this.RGVSecond = true;
+ this.fullscreenLoading = false;
+ },
+ mouseClickThird() {
+ this.fullscreenLoading = true;
+ this.RGVThird = true;
+ this.fullscreenLoading = false;
+ },
+ // SendCommand(x) {
+ // this.fullscreenLoading = true;
+ // this.formRGV.DeviceCode = x;
+ // this.http.post("api/DeviceInfo/RGVHandTask", this.formRGV)
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // $vue.refresh();
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // RGVReset(x) {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/RGVReset?DeviceCode=" + x, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // RGVemergencyStop(x) {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/RGVemergencyStop?DeviceCode=" + x, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // RGVPause(x) {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/RGVPause?DeviceCode=" + x, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // RGVCancel(x) {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/RGVCancel?DeviceCode=" + x, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // RGVInitialize(x) {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/RGVInitialize?DeviceCode=" + x, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ },
+ computed: {
+
+ },
+ mounted() {
+ // 鐩戝惉WebSocket娑堟伅
+ this.$watch(
+ () => this.messages.length,
+ (newLength, oldLength) => {
+ if (newLength > oldLength) {
+ const data = this.messages[newLength - 1];
+ this.processWebSocketMessage(data);
+ }
+ }
+ );
+ },
+ created() {
+ // WebSocket杩炴帴宸插湪setup涓垵濮嬪寲
+ },
+ methods: {
+ // 澶勭悊WebSocket娑堟伅
+ processWebSocketMessage(data) {
+ //鏀跺埌鐨勬秷鎭暟鎹�
+ console.log(data);
+ // 澶勭悊鍫嗗灈鏈烘暟鎹�
+ if (data && data.R_PP_Status) {
+ const stackerComponentsMap = {
+ "SC01_YL": 'stacker1',
+ "SC02_YL": 'stacker2',
+ "SC03_YLDual": 'stacker3',
+ "SC04_YLDual": 'stacker4',
+ "SC05_YLDual": 'stacker5',
+ "SC01_CP": 'stackerCP1',
+ "SC02_CP": 'stackerCP2',
+ "SC03_CP": 'stackerCP3',
+ "SC04_CP": 'stackerCP4',
+ "SC05_CP": 'stackerCP5',
+ };
+ const componentKey = stackerComponentsMap[data.R_PP_Status];
+ if (componentKey) {
+ const stackerData = {
+ YL_Status: data.YL_Status || "",
+ YL_AutoStatus: data.YL_AutoStatus || "",
+ YL_TaskNum: data.YL_TaskNum || "",
+ YL_WorkStatus: data.YL_WorkStatus || "",
+ YL_WorkType: data.YL_WorkType || "",
+ YL_Row: data.YL_Row || "0",
+ YL_Column: data.YL_Column || "0",
+ YL_Layer: data.YL_Layer || "0",
+ DeviceCode: data.R_PP_Status || "",
+ StackerAlarm: data.StackerAlarm || ""
+ };
+ this.$nextTick(() => {
+ if (this.$refs[componentKey]) {
+ this.$refs[componentKey].moveDot(stackerData);
+ } else {
+ console.error('缁勪欢寮曠敤涓嶅瓨鍦�:', componentKey);
+ }
+ });
+ } else {
+ console.warn('鏈壘鍒板尮閰嶇殑缁勪欢鏄犲皠:', data.R_PP_Status);
+ }
+ }
+ // 澶勭悊杈撻�佺嚎鏁版嵁锛堝吋瀹瑰師鏂欏簱鍜屾垚鍝佸簱锛�
+ else if (data && (data.ConveyorLineInfo || data.ConveyorLineCPInfo)) {
+ // 鑾峰彇杈撻�佺嚎鏁版嵁锛屽吋瀹逛笉鍚岀殑閿悕
+ const conveyorLineData = data.ConveyorLineInfo || data.ConveyorLineCPInfo;
+ // 鏇存柊杈撻�佺嚎鐘舵��
+
+ // 瀹氫箟缂栧彿鏄犲皠鍏崇郴锛堝師鏂欏簱鍜屾垚鍝佸簱锛�
+ const stationCodeMap = {
+ "SC05-1": "320",
+ "SC05-2": "321",
+ "SC04-1": "322",
+ "SC04-2": "323",
+ "SC03-1": "324",
+ "SC03-2": "325",
+ "SC02-2": "424",
+ "SC02-1": "423",
+ "SC01-1": "422",
+ "SC01-2": "425",
+ };
+
+ // 鍏堟敹闆嗘墍鏈塃rror淇℃伅
+ const errorMap = {};
+ for (const key in conveyorLineData) {
+ if (conveyorLineData[key].Error !== undefined) {
+ errorMap[key] = conveyorLineData[key].Error;
+ }
+ }
+
+ // 閬嶅巻鎵�鏈夎緭閫佺嚎鏁版嵁锛屾洿鏂板搴旂殑鏉′欢
+ for (const stationCode in conveyorLineData) {
+ // 璺宠繃鍙湁Error瀛楁鐨勯」
+ if (conveyorLineData[stationCode].Error !== undefined && Object.keys(conveyorLineData[stationCode]).length === 1) {
+ continue;
+ }
+
+ // 鑾峰彇鏄犲皠鍚庣殑缂栧彿
+ const mappedStationCode = stationCodeMap[stationCode] || stationCode;
+ // 閬嶅巻鎵�鏈塴inescopy鏁扮粍锛屾煡鎵惧搴旂殑绔欏彴
+ const allLines = [
+ ...this.linescopy1,
+ ...this.linescopy2,
+ ...this.linescopy3,
+ ...this.linescopy4,
+ ...this.linescopy5,
+ ...this.linescopy6,
+ ...this.linescopy7,
+ ...this.linescopy8,
+ ...this.linescopy9,
+ ...this.linescopy10,
+ ...this.linescopy11,
+ ...this.linescopy12,
+ ...this.linescopyCP1,
+ ...this.linescopyCP2,
+ ...this.linescopyCP3,
+ ...this.linescopyCP4,
+ ...this.linescopyCP5,
+ ...this.linescopyCP6,
+ ...this.linescopyCP7,
+ ...this.linescopyCP8,
+ ...this.linescopyCP9,
+ ...this.linescopyCP10
+ ];
+
+ allLines.forEach((line) => {
+ if (String(line.equipNo) === String(mappedStationCode)) {
+ // 鍒ゆ柇鏄惁涓烘垚鍝佸簱杈撻�佺嚎锛堢紪鍙蜂互10寮�澶达級
+ const isCP = String(line.equipNo).startsWith('10');
+ // 鏍规嵁HasGoods瀛楁鍒ゆ柇鐘舵�侊紝鎴愬搧搴撴牴鎹换鍔″彿鍒ゆ柇鏄惁鏈夌洏
+ const rawHasGoods = conveyorLineData[stationCode].HasGoods || false;
+ const taskNum = conveyorLineData[stationCode].TaskNum;
+ const hasGoods = isCP ? (taskNum && taskNum !== '0') : rawHasGoods;
+ // 纭繚condition鏄竷灏斿��
+ line.condition = !!hasGoods;
+ // 瀛樺偍杈撻�佺嚎璇︾粏淇℃伅鍒板叏灞�鍙橀噺
+ this.$root.conveyorLineDetails = this.$root.conveyorLineDetails || {};
+ // 鑾峰彇鐜版湁鐨勮缁嗕俊鎭�
+ const existingDetails = this.$root.conveyorLineDetails[line.equipNo] || {};
+ // 鏍规嵁搴撶被鍨嬩娇鐢ㄤ笉鍚岀殑瀛楁鍒ゆ柇鎶ヨ鐘舵��
+ let alarmMessage = "鏃�";
+ let isAlarm = false;
+
+ if (isCP) {
+ // 鎴愬搧搴擄細浣跨敤Status瀛楁
+ const statusValue = conveyorLineData[stationCode].Status;
+ if (statusValue === 1 || statusValue === 2 || statusValue === 3) {
+ alarmMessage = "姝e父";
+ isAlarm = false;
+ } else if (statusValue === 4) {
+ alarmMessage = statusValue === 0 ? "鑴辨満涓�" : "璁惧鏁呴殰";
+ isAlarm = true;
+ } else {
+ isAlarm = false;
+ }
+ } else {
+ // 鍘熸枡搴擄細浣跨敤Error瀛楁
+ let errorValue = undefined;
+ for (const scKey in stationCodeMap) {
+ if (stationCodeMap[scKey] === mappedStationCode) {
+ errorValue = errorMap[scKey];
+ break;
+ }
+ }
+ if (errorValue === 1) {
+ alarmMessage = "姝e父";
+ } else if (errorValue === 2) {
+ alarmMessage = "鏁呴殰";
+ isAlarm = true;
+ }
+ }
+ // 鍚堝苟鏁版嵁锛岀‘淇濇潵鑷笉鍚屾暟鎹簮鐨勫瓧娈甸兘鑳借淇濈暀
+ this.$root.conveyorLineDetails[line.equipNo] = {
+ taskNum: taskNum || existingDetails.taskNum || "鏃�",
+ inStock: hasGoods ? "鏄�" : existingDetails.inStock || "鍚�",
+ alarm: alarmMessage || existingDetails.alarm || "鏃�",
+ rfid: conveyorLineData[stationCode].RFID || existingDetails.rfid || "鏃�",
+ width: conveyorLineData[stationCode].Width || existingDetails.width || 0,
+ request: conveyorLineData[stationCode].Request || existingDetails.request || "鏃�",
+ reresult: conveyorLineData[stationCode].Reresult || existingDetails.reresult || "鏃�",
+ error: alarmMessage || existingDetails.error || "鏃�",
+ heartbeat: conveyorLineData[stationCode].Heartbeat || existingDetails.heartbeat || "鏃�",
+ status: conveyorLineData[stationCode].Status || existingDetails.status || "鏃�",
+ palletCode: conveyorLineData[stationCode].PalletCode || existingDetails.palletCode || "鏃�",
+ command: conveyorLineData[stationCode].Command || existingDetails.command || "鏃�",
+ isAlarm: isAlarm,
+ };
+ }
+ });
+ }
+ }
+ // 澶勭悊璁惧鏁版嵁锛屽寘鎷緭閫佺嚎鍜屾ā鎷熶俊鍙�
+ else if (data && (data.StackerDataJson || data.ConveyorLineDataJson)) {
+ // 澶勭悊杈撻�佺嚎鏁版嵁
+ if (data.ConveyorLineDataJson) {
+ try {
+ const conveyorLineData = JSON.parse(data.ConveyorLineDataJson);
+ // 鏇存柊杈撻�佺嚎鐘舵��
+ // 瀹氫箟缂栧彿鏄犲皠鍏崇郴锛岀洿鎺ユ槧灏勫埌鍏蜂綋鐨勮緭閫佺嚎缂栧彿
+ const stationCodeMap = {
+ "SC05-1": "320",
+ "SC05-2": "321",
+ "SC04-1": "322",
+ "SC04-2": "323",
+ "SC03-1": "324",
+ "SC03-2": "325",
+ "SC02-2": "424",
+ "SC02-1": "423",
+ "SC01-1": "422",
+ "SC01-2": "425",
+ "SC05-1-CP": "1003",
+ "SC05-2-CP": "1008",
+ "SC04-1-CP": "1007",
+ "SC04-2-CP": "1012",
+ "SC03-1-CP": "1013",
+ "SC03-2-CP": "1018",
+ "SC02-1-CP": "1017",
+ "SC02-2-CP": "1022",
+ "SC01-1-CP": "1023",
+ "SC01-2-CP": "1026",
+ };
+
+ // 閬嶅巻鎵�鏈塴inescopy鏁扮粍锛屾煡鎵惧搴旂殑绔欏彴
+ const linesArrays = [
+ this.linescopy1,
+ this.linescopy2,
+ this.linescopy3,
+ this.linescopy4,
+ this.linescopy5,
+ this.linescopy6,
+ this.linescopy7,
+ this.linescopy8,
+ this.linescopy9,
+ this.linescopy10,
+ this.linescopy11,
+ this.linescopy12,
+ this.linescopyCP1,
+ this.linescopyCP2,
+ this.linescopyCP3,
+ this.linescopyCP4,
+ this.linescopyCP5,
+ this.linescopyCP6,
+ this.linescopyCP7,
+ this.linescopyCP8,
+ this.linescopyCP9,
+ this.linescopyCP10
+ ];
+
+ // 閬嶅巻鎵�鏈夎緭閫佺嚎鏁版嵁锛屾洿鏂板搴旂殑鏉′欢
+ for (const roadway in conveyorLineData) {
+ // 鑾峰彇鏄犲皠鍚庣殑缂栧彿
+ const mappedStationCode = stationCodeMap[roadway] || roadway;
+
+ // 閬嶅巻姣忎釜lines鏁扮粍
+ linesArrays.forEach((linesArray) => {
+ linesArray.forEach((line) => {
+ if (String(line.equipNo) === String(mappedStationCode)) {
+ if (conveyorLineData[roadway][line.equipNo]) {
+ // 鍒ゆ柇鏄惁涓烘垚鍝佸簱杈撻�佺嚎锛堢紪鍙蜂互10寮�澶达級
+ const isCP = String(line.equipNo).startsWith('10');
+ // 鏍规嵁HasGoods瀛楁鍒ゆ柇鐘舵�侊紝鎴愬搧搴撴牴鎹换鍔″彿鍒ゆ柇鏄惁鏈夌洏
+ const rawHasGoods = conveyorLineData[roadway][line.equipNo].inStock || conveyorLineData[roadway][line.equipNo].HasGoods || false;
+ const taskNum = conveyorLineData[roadway][line.equipNo].taskNum || conveyorLineData[roadway][line.equipNo].TaskNum;
+ const hasGoods = isCP ? (taskNum && taskNum !== '0') : rawHasGoods;
+ line.condition = !!hasGoods;
+ // 瀛樺偍杈撻�佺嚎璇︾粏淇℃伅鍒板叏灞�鍙橀噺
+ this.$root.conveyorLineDetails = this.$root.conveyorLineDetails || {};
+ // 鑾峰彇鐜版湁鐨勮缁嗕俊鎭�
+ const existingDetails = this.$root.conveyorLineDetails[line.equipNo] || {};
+ // 鏍规嵁搴撶被鍨嬩娇鐢ㄤ笉鍚岀殑瀛楁鍒ゆ柇鎶ヨ鐘舵��
+ let alarmMessage = "鏃�";
+ let isAlarm = false;
+
+ if (isCP) {
+ // 鎴愬搧搴擄細浣跨敤Status瀛楁
+ const statusValue = conveyorLineData[roadway][line.equipNo].status || conveyorLineData[roadway][line.equipNo].Status;
+ if (statusValue === 1 || statusValue === 2 || statusValue === 3) {
+ alarmMessage = "姝e父";
+ isAlarm = false;
+ } else if (statusValue === 0 || statusValue === 4) {
+ alarmMessage = statusValue === 0 ? "鑴辨満涓�" : "璁惧鏁呴殰";
+ isAlarm = true;
+ } else {
+ isAlarm = false;
+ }
+ } else {
+ // 鍘熸枡搴擄細浣跨敤Error瀛楁
+ const errorValue = conveyorLineData[roadway][line.equipNo].error || conveyorLineData[roadway][line.equipNo].Error;
+ if (errorValue === 1) {
+ alarmMessage = "姝e父";
+ isAlarm = false;
+ } else if (errorValue === 2) {
+ alarmMessage = "鏁呴殰";
+ isAlarm = true;
+ } else {
+ isAlarm = false;
+ }
+ }
+ // 鍚堝苟鏁版嵁锛岀‘淇濇潵鑷笉鍚屾暟鎹簮鐨勫瓧娈甸兘鑳借淇濈暀
+ this.$root.conveyorLineDetails[line.equipNo] = {
+ taskNum: taskNum || existingDetails.taskNum || "鏃�",
+ inStock: hasGoods ? "鏄�" : existingDetails.inStock || "鍚�",
+ rfid: conveyorLineData[roadway][line.equipNo].rfid || conveyorLineData[roadway][line.equipNo].RFID || existingDetails.rfid || "鏃�",
+ width: conveyorLineData[roadway][line.equipNo].width || conveyorLineData[roadway][line.equipNo].Width || existingDetails.width || 0,
+ request: conveyorLineData[roadway][line.equipNo].request || conveyorLineData[roadway][line.equipNo].Request || existingDetails.request || "鏃�",
+ reresult: conveyorLineData[roadway][line.equipNo].reresult || conveyorLineData[roadway][line.equipNo].Reresult || existingDetails.reresult || "鏃�",
+ error: alarmMessage || existingDetails.error || "鏃�",
+ alarm: alarmMessage || existingDetails.alarm || "鏃�",
+ heartbeat: conveyorLineData[roadway][line.equipNo].heartbeat || conveyorLineData[roadway][line.equipNo].Heartbeat || existingDetails.heartbeat || "鏃�",
+ status: conveyorLineData[roadway][line.equipNo].status || conveyorLineData[roadway][line.equipNo].Status || existingDetails.status || "鏃�",
+ palletCode: conveyorLineData[roadway][line.equipNo].palletCode || conveyorLineData[roadway][line.equipNo].PalletCode || existingDetails.palletCode || "鏃�",
+ command: conveyorLineData[roadway][line.equipNo].command || conveyorLineData[roadway][line.equipNo].Command || existingDetails.command || "鏃�",
+ isAlarm: isAlarm,
+ };
+ }
+ }
+ });
+ });
+ }
+ } catch (e) {
+ console.error('杈撻�佺嚎鏁版嵁瑙f瀽澶辫触', e);
+ }
+ }
+ }
+ // 涓嶅啀鏄剧ず鏈鐞嗙殑娑堟伅绫诲瀷鏃ュ織锛岄伩鍏嶆帶鍒跺彴娣蜂贡
+ // 鍙鐞嗗凡鐭ョ被鍨嬬殑鏁版嵁锛屽拷鐣ュ叾浠栫被鍨�
+ },
groupedLines(linescopy) {
const groups = {};
linescopy.forEach((line) => {
@@ -675,81 +1554,6 @@
});
},
},
- computed: {
-
- },
- mounted() {
- },
- created() {
-
- this.ws = new WebSocket('ws://localhost:9260/');
-
- this.ws.onmessage = (event) => {
- try {
- const data = JSON.parse(event.data);
- console.log('鏀跺埌娑堟伅:', data);
- // 澶勭悊娑堟伅...
- } catch (e) {
- console.error('娑堟伅瑙f瀽澶辫触', e);
- }
- };
- const stackerComponentsMap = {
- "SC01": 'stacker1',
- "SC02": 'stacker2',
- "SC03": 'stacker3',
- "SC04": 'stacker4',
- "SC05": 'stacker5',
- "SC06": 'stacker6',
- };
- // const componentKey = stackerComponentsMap[data.R_PP_Status];
- // if (componentKey) {
- // this.StackerCrane.Automatic = data;
- // this.StackerCrane.Fault = data;
- // this.StackerCrane.Running = data;
- // this.StackerCrane.CurrentColumn = data;
- // this.StackerCrane.CurrentLayer = data;
- // this.StackerCrane.LevelPoint = data;
- // this.StackerCrane.DeviceName = data;
- // this.StackerCrane.DeviceCode = data;
- // this.StackerCrane.CurrentTaskNum = data;
- // this.StackerCrane.StackerAlarm = data;
-
- // this.$nextTick(() => {
- // this.$refs[componentKey].moveDot(this.StackerCrane);
- // });
- // }
- const stationMap = {
- "SC011F": this.linescopy1,
- "SC021F": this.linescopy2,
- "SC031F": this.linescopy3,
- "SC041F": this.linescopy4,
- "SC051F": this.linescopy5,
- "SC061F": this.linescopy6,
- "SC071F": this.linescopy7,
- "SC081F": this.linescopy8,
- "SC091F": this.linescopy9,
- "SC101F": this.linescopy10,
- "SC111F": this.linescopy11,
- "SC121F": this.linescopy12,
- "SC012F": this.linescopy13,
- "SC022F": this.linescopy13,
- "SC032F": this.linescopy13,
- "SC042F": this.linescopy13,
- "SC052F": this.linescopy13,
- "SC062F": this.linescopy13,
- "SC072F": this.linescopy13,
- "SC082F": this.linescopy14,
- };
-
- // var station = eventData.stationChildCode;
- // if (stationMap[eventData.roadway]) {
- // stationMap[eventData.roadway].forEach((line) => {
- // if (line.equipNo === station) {
- // line.condition = eventData.inStock;
- // }
- // })
- // }
- },
};
</script>
@@ -758,7 +1562,8 @@
margin-bottom: 10px;
} */
.title {
- height: 1800px;
+ height: auto;
+ margin-bottom: 50px;
}
.cardWidth {
@@ -787,7 +1592,13 @@
.stackerDiv {
border: 1px solid rgba(0, 195, 255, 0.822);
- width: 980px;
+ width: 2720px;
+ padding-left: 3px;
+}
+
+.stackerDivCP {
+ border: 1px solid rgba(0, 195, 255, 0.822);
+ width: 2000px;
padding-left: 3px;
}
@@ -890,4 +1701,5 @@
height: 1px;
/* margin-top:180px; */
background-color: #a0cfff;
-}</style>
\ No newline at end of file
+}
+</style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/Index.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/Index.vue"
index e59ef4f..73e74e4 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/Index.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/Index.vue"
@@ -91,7 +91,8 @@
<component :is="Component" :key="$route.name"
v-if="!$route.meta || ($route.meta && !$route.meta.hasOwnProperty('keepAlive'))" />
</keep-alive>
- <component :is="Component" :key="$route.name" v-if="$route.meta && $route.meta.hasOwnProperty('keepAlive')" />
+ <component :is="Component" :key="$route.name"
+ v-if="$route.meta && $route.meta.hasOwnProperty('keepAlive')" />
</router-view>
</el-scrollbar>
</div>
@@ -359,6 +360,54 @@
});
};
+ const s = ref(null);
+ const handleMessage = e => {
+ if (e) {
+ s.value = e.data;
+ console.log("WebSocket 鏀跺埌娑堟伅: ", e.data);
+ store.dispatch("sethomedata", s.value);
+ let data = JSON.parse(e.data);
+ messageList.push(data);
+ ElNotification({
+ title: data.title,
+ message: h("i", { style: "color: teal" }, data.message),
+ position: "bottom-right"
+ });
+ }
+ };
+ const createSocket = url => {
+ //console.log(url);
+
+ //鍒涘缓WebSocket杩炴帴
+ //"ws://127.0.0.1:9295/admin"
+ //client = new WebSocket("ws://192.168.0.250:9260/");
+ client = new WebSocket("ws:localhost:9260/");
+ client.onopen = function () {
+ //client.onmessage = handleMessage;
+ // store.commit("setWebsocket", client);
+ console.log("WebSocket 杩炴帴鎴愬姛");
+ };
+
+ client.onmessage = function (event) {
+ // console.log("WebSocket 鏀跺埌娑堟伅: ", event);
+
+ if (event != undefined) {
+ store.dispatch("sethomedata", JSON.parse(event.data));
+ }
+ // handleMessage(event);
+ };
+
+ client.onclose = function () {
+ console.log("WebSocket 杩炴帴鍏抽棴");
+ setTimeout(createSocket, 10000);
+ };
+
+ client.onerror = function (err) {
+ console.log("WebSocket 杩炴帴閿欒: ", err);
+ };
+ client.onmessage();
+ };
+
const getSelectMenuName = (id) => {
return menuOptions.value.find(function (x) {
return x.id == id;
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineComponent.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineComponent.vue"
index 3faff30..b6a3e7c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineComponent.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineComponent.vue"
@@ -1,17 +1,9 @@
<template>
<div>
- <el-row>
- <template v-for="item in 32" :key="item">
- <el-col :span="0.9">
- <span class="image-text"></span>
- <img src="../../public/璐ф灦.jpeg" />
- </el-col>
- </template>
- </el-row>
<el-row style="padding-bottom: 5px;">
- <template v-for="item in 32" :key="item">
- <el-col :span="0.9">
- <span class="image-text"></span>
+ <template v-for="item in columnCount" :key="item">
+ <el-col :span="columnWidth">
+ <span class="image-text">{{ 91-item }}</span>
<img src="../../public/璐ф灦.jpeg" />
</el-col>
</template>
@@ -19,146 +11,57 @@
</div>
<div class="line-container">
<div class="line"></div>
- <!-- <div class="dot" :style="{ right: dotPosition + 'px' }" ref="childDot" @click="mouseClick"></div> -->
- <div :class="update()"
- :style="{ transform: `translateX(${StackerCrane.CurrentColumn < 33 ? StackerCrane.CurrentColumn * 30 - 59 : 0}px)` }"
+ <div :class="update()" :style="{ transform: `translateX(${calculateDotPosition()}px)` }"
ref="childDot" @click="mouseClick"></div>
</div>
<div>
<el-row style="padding-top: 5px;">
- <template v-for="item in 32" :key="item">
- <el-col :span="0.9">
- <span class="image-text"></span>
+ <template v-for="item in columnCount" :key="item">
+ <el-col :span="columnWidth">
+ <span class="image-text">{{ 91-item }}</span>
<img src="../../public/璐ф灦.jpeg" />
</el-col>
</template>
- </el-row>
- <el-row style="padding-bottom: 5px;">
- <template v-for="item in 32" :key="item">
- <el-col :span="0.9">
- <span class="image-text"></span>
- <img src="../../public/璐ф灦.jpeg" />
- </el-col>
- </template>
+ <div style="margin-top: 60px;"></div>
</el-row>
</div>
- <el-dialog v-model="dialogVisible" title="鍫嗗灈鏈轰俊鎭煡鐪�" :before-close="handleClose">
- <el-form ref="$form" :model="StackerCrane" label-position="left" label-width="120px" size="medium">
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="璁惧缂栧彿锛�">
- <j-el-description :value="StackerCrane.DeviceName" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="璁惧鐘舵��:">
- <j-el-description :value="StackerCrane.Fault" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="宸ヤ綔妯″紡:">
- <j-el-description :value="StackerCrane.Automatic" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="浠诲姟鍙凤細">
- <j-el-description :value="StackerCrane.CurrentTaskNum" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div" style="margin-bottom: 10px;">
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="浣滀笟鐘舵��:">
- <j-el-description :value="StackerCrane.Running" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="褰撳墠琛屽垪灞傦細">
- <j-el-description
- :value="StackerCrane.CurrentRow + '-' + StackerCrane.CurrentLayer + '-' + StackerCrane.CurrentColumn "
- type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div" style="margin-bottom: 10px;">
- <el-col :span="24" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="鎶ヨ淇℃伅:">
- <j-el-description :value="StackerCrane.StackerAlarm" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- </el-row>
- <el-divider />
- <h4 style="margin-bottom: 20px;">鎵嬪姩鎿嶄綔</h4>
- <el-form ref="form" :model="form" label-width="90px">
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="浠诲姟鍛戒护" prop="TargetAddress">
- <el-select size="large" v-model="form.TaskType" placeholder="璇烽�夋嫨浠诲姟鍛戒护">
- <el-option label="鍏ュ簱" value="17" />
- <el-option label="鍑哄簱" value="18" />
- <el-option label="绉诲簱" value="20" />
- <el-option label="鍙栬揣" value="24" />
- <el-option label="鏀捐揣" value="48" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="璧风偣琛屽垪灞�:">
- <el-input size="large" v-model="form.SourceAddress" style="width: 800px" placeholder="璇疯緭鍏ヨ捣鐐硅鍒楀眰" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="缁堢偣琛屽垪灞�:">
- <el-input size="large" v-model="form.TargetAddress" style="width: 800px" placeholder="璇疯緭鍏ョ粓鐐硅鍒楀眰" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-divider />
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="5" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="primary" size="small" plain @click="start">
- <i class="el-icon-check">鍚姩</i>
- </el-button>
-
- </el-col>
- <el-col :span="5" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="warning" size="small" plain @click="reset">
- <i class="el-icon-check">澶嶄綅</i>
- </el-button>
- </el-col>
- <el-col :span="5" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="danger" size="small" plain @click="disconnected">
- <i class="el-icon-check">涓柇</i>
- </el-button>
- </el-col>
- <el-col :span="5" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="danger" size="small" plain @click="emergencyStop">
- <i class="el-icon-check">鎬ュ仠</i>
- </el-button>
- </el-col>
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="danger" size="small" plain @click="StackerRecall">
- <i class="el-icon-check">鍙洖</i>
- </el-button>
- </el-col>
- </el-row>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="dialogVisible = false">鍙栨秷</el-button>
- <el-button type="primary" @click="dialogVisible = false">
- 纭
- </el-button>
+ <el-dialog v-model="dialogVisible" :before-close="handleClose" width="520px" class="modern-dialog">
+ <div class="dialog-header">
+ <h3 class="dialog-title">鍫嗗灈鏈轰俊鎭�</h3>
+ </div>
+ <div class="dialog-content">
+ <div class="info-list">
+ <div class="info-item">
+ <span class="item-label">璁惧缂栧彿</span>
+ <span class="item-value">{{ yL_DB.R_PP_Status || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">璁惧鐘舵��</span>
+ <span :class="['item-value', statusClass]">{{ yL_DB.YL_Status || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">宸ヤ綔妯″紡</span>
+ <span :class="['item-value', autoStatusClass]">{{ yL_DB.YL_AutoStatus || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">浠诲姟鍙�</span>
+ <span class="item-value">{{ yL_DB.YL_TaskNum || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">浣滀笟鐘舵��</span>
+ <span class="item-value">{{ yL_DB.YL_WorkStatus || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">褰撳墠琛屽垪灞�</span>
+ <span class="item-value">{{ yL_DB.YL_Row + '-' + yL_DB.YL_Column + '-' + yL_DB.YL_Layer || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">鎶ヨ淇℃伅</span>
+ <span class="item-value">{{ yL_DB.StackerAlarm || '鏃�' }}</span>
+ </div>
</div>
- </template>
+ </div>
</el-dialog>
</template>
@@ -171,20 +74,45 @@
},
data() {
return {
+ YLDBMap: {
+ YL_Status: {
+ 0: "涓嶅湪绾�",
+ 1: "鍦ㄧ嚎",
+ 2: "鎬ュ仠",
+ 3: "鏈煡",
+ },
+ YL_AutoStatus: {
+ 1: "鍗婅嚜鍔�",
+ 2: "鍗曟",
+ 3: "鑷姩",
+ 4: "鎵嬪姩",
+ 5: "鑴辨満",
+ },
+ YL_WorkStatus: {
+ 1: "寰呭懡",
+ 2: "鍙栬揣瀹屾垚",
+ 3: "鍙栬揣涓�",
+ 5: "鏀捐揣涓�",
+ 6: "浠诲姟鎵ц閿欒",
+ 7: "鏈煡",
+ 9: "浠诲姟瀹屾垚",
+ },
+ },
x: 0, // 鍒濆x鍊�
- url: "api/Equipment/GetStackerInfoByNo",
dialogVisible: false,
- StackerCrane: {
- Automatic: "",
- Fault: "",
- CurrentLayer: "1",
- CurrentRow: "1",
- CurrentColumn: "1",
- CurrentTaskNum: "",
- Running: "",
- DeviceName: "",
- DeviceCode: "",
- StackerAlarm:"",
+ timer1: null,
+ yL_DB: {
+ R_PP_Status: "",
+ YL_Status: "",
+ YL_AutoStatus: "",
+ YL_TaskNum: "",
+ YL_WorkStatus: "",
+ YL_WorkType: "",
+ YL_Row: "",
+ YL_Column: "",
+ YL_Layer: "",
+ StackerAlarm: "",
+ CurrentColumn: "1"
},
form: {
TaskType: "",
@@ -194,6 +122,7 @@
},
};
},
+
props: {
equipNo: {
type: String,
@@ -204,33 +133,194 @@
dotPosition() {
return this.x;
},
+ // 鍒楁暟锛氬師鏂欏簱90鍒�
+ columnCount() {
+ return 90;
+ },
+ // 鍒楀锛氭牴鎹�90鍒楄绠�
+ columnWidth() {
+ return 24 / 90;
+ },
+ // 姣忓垪鐨勫疄闄呭搴︼紙鍍忕礌锛�
+ pixelPerColumn() {
+ return 30;
+ },
+ // 浠撳簱鏈�澶у垪鏁�
+ maxColumn() {
+ return 90;
+ },
+ // 璁惧鐘舵�佹枃瀛楅鑹�
+ statusClass() {
+ const status = this.yL_DB.YL_Status;
+ if (status === '涓嶅湪绾�') {
+ return 'status-red';
+ } else if (status === '鍦ㄧ嚎') {
+ return 'status-green';
+ }
+ return '';
+ },
+ // 宸ヤ綔妯″紡鏂囧瓧棰滆壊
+ autoStatusClass() {
+ const status = this.yL_DB.YL_AutoStatus;
+ if (status === '鑷姩' || status === '鍗婅嚜鍔�') {
+ return 'status-green';
+ } else if (status === '鎵嬪姩') {
+ return 'status-blue';
+ } else if (status === '鑴辨満') {
+ return 'status-red';
+ }
+ return '';
+ }
},
mounted() {
- this.moveDot(this.x);
+ // 鍒濆鍖栨椂浼犻�掔┖瀵硅薄锛岄伩鍏嶇被鍨嬩笉鍖归厤閿欒
+ this.moveDot({});
+ // 鍚姩瀹氭椂鍣紝姣忕鏇存柊涓�娆℃暟鎹�
+ this.timer1 = setInterval(() => {
+ this.updateData();
+ }, 1000);
+ },
+ beforeUnmount() {
+ // 娓呴櫎瀹氭椂鍣�
+ if (this.timer1) {
+ clearInterval(this.timer1);
+ this.timer1 = null;
+ }
+ },
+ watch: {
+ '$root.stackerData': {
+ handler() {
+ this.updateData();
+ },
+ deep: true
+ }
},
methods: {
+ updateData() {
+ const equipNoStr = String(this.equipNo);
+ if (this.$root.stackerData && this.$root.stackerData[equipNoStr]) {
+ const stackerData = this.$root.stackerData[equipNoStr];
+ this.moveDot(stackerData);
+ }
+ },
+ // 璁$畻鎸囩ず鍣ㄤ綅缃�
+ calculateDotPosition() {
+ // 鏈敹鍒颁俊鎭垨CurrentColumn涓�0锛屾寚绀哄櫒鍦ㄥ闈�
+ if (!this.yL_DB.CurrentColumn || this.yL_DB.CurrentColumn == "0") {
+ return -30; // 鏄剧ず鍦ㄨ揣浣嶅尯鍩熷乏渚у闈�
+ }
+
+ // 璁$畻鎸囩ず鍣ㄤ綅缃紝纭繚涓庡搴斿垪瀵归綈
+ const currentColumn = parseInt(this.yL_DB.CurrentColumn);
+
+ // 瀹為檯璐т綅瀹藉害锛堝浘鐗囧搴︼級
+ const columnWidth = 30; // 璐т綅鍥剧墖瀹藉害涓�30px
+ const dotWidth = 25; // 鎸囩ず鍣ㄥ搴︿负25px
+
+ // 鐢变簬鍒楀彿鏄粠鍙冲埌宸﹂�掑噺鏄剧ず鐨勶紝闇�瑕佽绠楀疄闄呯储寮�
+ // 渚嬪锛氱90鍒楀湪鏈�宸﹁竟锛岀1鍒楀湪鏈�鍙宠竟
+ // 妯℃澘涓樉绀虹殑鍒楀彿鏄� 91-item锛屾墍浠ョ1涓猠l-col鏄剧ず90锛岀90涓猠l-col鏄剧ず1
+ // 褰撳墠鍒楀彿涓篶urrentColumn锛屽搴旂殑绱㈠紩涓� maxColumn - currentColumn
+ const actualIndex = this.maxColumn - currentColumn;
+
+ // 璁$畻浣嶇疆锛�
+ // (瀹為檯绱㈠紩 * 璐т綅瀹藉害) = 璇ュ垪鐨勮捣濮嬩綅缃�
+ // + (璐т綅瀹藉害 / 2) = 璇ュ垪鐨勪腑蹇冧綅缃�
+ // - (鎸囩ず鍣ㄥ搴� / 2) = 灏嗘寚绀哄櫒涓績涓庡垪涓績瀵归綈
+ const position = actualIndex * columnWidth + (columnWidth / 2) - (dotWidth / 2);
+
+ // 璋冭瘯淇℃伅
+ console.log('褰撳墠鍒�:', currentColumn, '瀹為檯绱㈠紩:', actualIndex);
+ console.log('璐т綅瀹藉害:', columnWidth, '鎸囩ず鍣ㄥ搴�:', dotWidth);
+ console.log('璁$畻浣嶇疆:', position);
+
+ return position;
+ },
+
moveDot(x) {
- this.StackerCrane.Automatic = x.Automatic == null ? "鏁呴殰" : x.Automatic;
- this.StackerCrane.Fault = x.Fault == null ? "鏁呴殰" : x.Fault;
- this.StackerCrane.Running = x.Running == null ? "鏁呴殰" : x.Running;
- this.StackerCrane.CurrentColumn = x.CurrentColumn == undefined ? 1 : x.CurrentColumn;
- this.StackerCrane.CurrentLayer = x.CurrentLayer == undefined ? 1 : x.CurrentLayer;
- this.StackerCrane.LevelPoint = x.LevelPoint;
- this.StackerCrane.DeviceName = x.DeviceName;
- this.StackerCrane.CurrentTaskNum = x.CurrentTaskNum;
- this.StackerCrane.StackerAlarm = x.StackerAlarm;
- this.form.DeviceCode = x.DeviceCode;
+ // 鏄犲皠宸ヤ綔妯″紡
+ const autoStatusCode = x.YL_AutoStatus;
+ if (autoStatusCode !== undefined) {
+ this.yL_DB.YL_AutoStatus = this.YLDBMap.YL_AutoStatus[autoStatusCode] || autoStatusCode;
+ } else {
+ this.yL_DB.YL_AutoStatus = "鏃�";
+ }
+
+ // 鏄犲皠璁惧鐘舵��
+ const statusCode = parseInt(x.YL_Status);
+ if (!isNaN(statusCode)) {
+ this.yL_DB.YL_Status = this.YLDBMap.YL_Status[statusCode] || statusCode.toString();
+ } else {
+ this.yL_DB.YL_Status = "鏃�";
+ }
+
+ // 鏄犲皠宸ヤ綔鐘舵��
+ const workStatusCode = x.YL_WorkStatus;
+ if (workStatusCode !== undefined) {
+ this.yL_DB.YL_WorkStatus = this.YLDBMap.YL_WorkStatus[workStatusCode] || workStatusCode;
+ } else {
+ this.yL_DB.YL_WorkStatus = "鏃�";
+ }
+
+ // 鍏朵粬鏁版嵁璧嬪��
+ this.yL_DB.R_PP_Status = x.DeviceCode || "鏃�";
+ this.yL_DB.YL_WorkType = x.YL_WorkType || "鏃�";
+ this.yL_DB.YL_TaskNum = x.YL_TaskNum || "鏃�";
+
+ // 澶勭悊琛屽彿
+ const rowValue = parseInt(x.YL_Row);
+ this.yL_DB.YL_Row = (!isNaN(rowValue) && rowValue > 0) ? rowValue.toString() : "0";
+
+ // 鏍规嵁灏忚揣浣嶅彿璁$畻鍒楀彿
+ // 鐩存帴浣跨敤鍘熷灏忚揣浣嶅彿
+ const smallColumn = parseInt(x.YL_Column);
+ let displayColumn;
+ if (!isNaN(smallColumn) && smallColumn > 0) {
+ // 鐩存帴浣跨敤灏忚揣浣嶅彿锛屼笉杩涜杞崲
+ displayColumn = smallColumn;
+ } else {
+ // 娌℃湁鏀跺埌淇℃伅锛屾寚绀哄櫒鍦ㄥ闈�
+ displayColumn = 0;
+ }
+
+ // 澶勭悊鍒楀彿
+ this.yL_DB.YL_Column = (!isNaN(smallColumn) && smallColumn > 0) ? smallColumn.toString() : "0";
+
+ // 澶勭悊灞傚彿
+ const layerValue = parseInt(x.YL_Layer);
+ this.yL_DB.YL_Layer = (!isNaN(layerValue) && layerValue > 0) ? layerValue.toString() : "0";
+ // 澶勭悊鍚庣鏂板弬鏁帮紝鏄剧ず鍒版姤璀︿俊鎭腑
+ this.yL_DB.StackerAlarm = x.StackerAlarm || "鏃�";
+ this.yL_DB.CurrentColumn = displayColumn.toString();
+
+ this.form.DeviceCode = x.DeviceCode || "";
},
update() {
- if (this.StackerCrane.Automatic == "鑱旀満妯″紡" && this.StackerCrane.Fault != "鏁呴殰" && this.StackerCrane.Running == "寰呮満") {
+ // 鑾峰彇StackerAlarm鐨勫�硷紝杞崲涓哄瓧绗︿覆杩涜姣旇緝
+ const alarmValue = String(this.yL_DB.StackerAlarm).trim();
+ // 褰揝tackerAlarm瀛楁鐨勫�间笉涓�0鎴栫┖鏃讹紝灏辨晠闅滄姤璀︼紙鏄剧ず绾㈣壊锛�
+ if (alarmValue !== '' && alarmValue !== '0' && alarmValue !== '鏃�') {
+ return 'dot-Fault ';
+ }
+ if (this.yL_DB.YL_Status == "鍦ㄧ嚎" && (this.yL_DB.YL_AutoStatus == "鑷姩" || this.yL_DB.YL_AutoStatus == "鍗婅嚜鍔�")) {
return 'dot-Automatic ';
}
- else if (this.StackerCrane.Automatic == "鑱旀満妯″紡" && this.StackerCrane.Fault != "鏁呴殰" && this.StackerCrane.Running == "杩愯涓�") {
+ else if (this.yL_DB.YL_Status == "鍦ㄧ嚎" && this.yL_DB.YL_AutoStatus == "鎵嬪姩") {
return 'dot-Running ';
- } else if (this.StackerCrane.Fault == "鏁呴殰") {
- return 'dot-Fault ';
} else {
return 'dot-Fault ';
+ }
+ },
+ status() {
+ const statusText = this.ConveyorLineInfo.YL_Status;
+ if (statusText === '鎵嬪姩') {
+ return 'custom-img-blue';
+ } else if (statusText === '鑷姩') {
+ return 'custom-img-green';
+ } else if (statusText === '鑴辨満') {
+ return 'custom-img-red';
+ } else {
+ return '';
}
},
mouseClick() {
@@ -238,85 +328,85 @@
this.dialogVisible = true;
this.fullscreenLoading = false;
},
- start() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/StackerHandTask", this.form)
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success("鍫嗗灈鏈哄懡浠ゅ凡涓嬪彂");
- // $vue.success("鎴愬姛.");
- this.show = false;
- $vue.refresh();
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- }, reset() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/StackerReset?DeviceCode=" + this.form.DeviceCode)
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success("澶嶄綅鎴愬姛");
- // $vue.success("鎴愬姛.");
- this.show = false;
- $vue.refresh();
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
-
- emergencyStop() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/StackerEmergencyStop?DeviceCode=" + this.form.DeviceCode)
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success("鎬ュ仠宸叉寜涓�");
- // $vue.success("鎴愬姛.");
- // this.show = false;
- // $vue.refresh();
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- disconnected() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/StackerDisconnected?DeviceCode=" + this.form.DeviceCode)
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success("涓柇鍫嗗灈鏈轰换鍔�");
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- StackerRecall() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/StackerRecall?DeviceCode=" + this.form.DeviceCode)
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success("鍙洖鍫嗗灈鏈�");
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- }
+ // start() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/StackerHandTask", this.form)
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success("鍫嗗灈鏈哄懡浠ゅ凡涓嬪彂");
+ // // $vue.success("鎴愬姛.");
+ // this.show = false;
+ // $vue.refresh();
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // }, reset() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/StackerReset?DeviceCode=" + this.form.DeviceCode)
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success("澶嶄綅鎴愬姛");
+ // // $vue.success("鎴愬姛.");
+ // this.show = false;
+ // $vue.refresh();
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+
+ // emergencyStop() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/StackerEmergencyStop?DeviceCode=" + this.form.DeviceCode)
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success("鎬ュ仠宸叉寜涓�");
+ // // $vue.success("鎴愬姛.");
+ // // this.show = false;
+ // // $vue.refresh();
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // disconnected() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/StackerDisconnected?DeviceCode=" + this.form.DeviceCode)
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success("涓柇鍫嗗灈鏈轰换鍔�");
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // StackerRecall() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/StackerRecall?DeviceCode=" + this.form.DeviceCode)
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success("鍙洖鍫嗗灈鏈�");
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // }
},
};
</script>
@@ -324,9 +414,10 @@
<style scoped>
.line-container {
position: relative;
- height: 20px;
+ height: 25px;
background-color: #ecf5ff;
- width: 960px;
+ width: 2720px;
+ /* 90鍒� * 30px姣忓垪 */
}
.line {
@@ -334,13 +425,13 @@
top: 0;
left: 0;
right: 0;
- height: 1px;
+ height: 0px;
background-color: #a0cfff;
}
.dot-Running {
position: absolute;
- top: -5px;
+ top: 0px;
width: 25px;
height: 25px;
border-radius: 50%;
@@ -356,7 +447,7 @@
.dot-Automatic {
position: absolute;
- top: -5px;
+ top: 0px;
width: 25px;
height: 25px;
border-radius: 50%;
@@ -372,7 +463,7 @@
.dot-Fault {
position: absolute;
- top: -5px;
+ top: 0px;
width: 25px;
height: 25px;
border-radius: 50%;
@@ -388,19 +479,111 @@
img {
width: 30px;
- height: 25px;
+ height: 30px;
}
.image-text {
position: absolute;
top: 5px;
- /* left: 10px; */
- color: white;
- /* 鏂囧瓧棰滆壊 */
+ color: #000000;
font-size: 12px;
- /* 瀛楀彿澶у皬 */
font-weight: bold;
- /* 瀛椾綋绮楃粏 */
+ font-family: 'Microsoft YaHei', Arial, sans-serif;
margin-left: 5px;
}
-</style>
+
+.modern-dialog {
+ border-radius: 16px !important;
+ overflow: hidden;
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
+}
+
+.modern-dialog .el-dialog__header {
+ display: none;
+}
+
+.modern-dialog .el-dialog__body {
+ padding: 0;
+ margin: 0;
+}
+
+.dialog-header {
+ background: linear-gradient(135deg, #409eff 0%, #67c23a 100%);
+ padding: 20px 24px;
+ text-align: center;
+}
+
+.dialog-title {
+ color: #fff;
+ font-size: 18px;
+ font-weight: 600;
+ margin: 0;
+ letter-spacing: 2px;
+}
+
+.dialog-content {
+ padding: 28px;
+ background: #f8fafc;
+ display: flex;
+ justify-content: center;
+}
+
+.info-list {
+ width: 100%;
+ max-width: 420px;
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+}
+
+.info-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 16px 20px;
+ background: #fff;
+ border-radius: 12px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
+ transition: all 0.3s ease;
+}
+
+.info-item:hover {
+ transform: translateX(4px);
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
+}
+
+.item-label {
+ font-size: 14px;
+ color: #6b7280;
+ font-weight: 500;
+ min-width: 80px;
+ text-align: left;
+}
+
+.item-value {
+ font-size: 15px;
+ color: #1f2937;
+ font-weight: 500;
+ text-align: right;
+ flex: 1;
+ margin-left: 20px;
+ word-break: break-all;
+ padding-left: 20px;
+ border-left: 1px solid #e5e7eb;
+}
+
+.status-blue {
+ color: #409eff !important;
+ font-weight: 600;
+}
+
+.status-green {
+ color: #67c23a !important;
+ font-weight: 600;
+}
+
+.status-red {
+ color: #f56c6c !important;
+ font-weight: 600;
+}
+</style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineComponentCP.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineComponentCP.vue"
new file mode 100644
index 0000000..389137f
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineComponentCP.vue"
@@ -0,0 +1,474 @@
+<template>
+ <div>
+ <el-row style="padding-bottom: 5px;">
+ <template v-for="item in 65" :key="item">
+ <el-col :span="24/65">
+ <span class="image-text">{{ 66 - item }}</span>
+ <img src="../../public/璐ф灦.jpeg" />
+ </el-col>
+ </template>
+ </el-row>
+ </div>
+ <div class="line-container">
+ <div class="line"></div>
+ <div :class="update()" :style="{ transform: `translateX(${calculateDotPosition()}px)` }"
+ ref="childDot" @click="mouseClick"></div>
+ </div>
+ <div>
+ <el-row style="padding-top: 5px;">
+ <template v-for="item in 65" :key="item">
+ <el-col :span="24/65">
+ <span class="image-text">{{ 66 - item }}</span>
+ <img src="../../public/璐ф灦.jpeg" />
+ </el-col>
+ <div style="margin-top: 60px;"></div>
+ </template>
+ </el-row>
+ </div>
+
+ <el-dialog v-model="dialogVisible" :before-close="handleClose" width="520px" class="modern-dialog">
+ <div class="dialog-header">
+ <h3 class="dialog-title">鍫嗗灈鏈轰俊鎭�</h3>
+ </div>
+ <div class="dialog-content">
+ <div class="info-list">
+ <div class="info-item">
+ <span class="item-label">璁惧缂栧彿</span>
+ <span class="item-value">{{ yL_DB.R_PP_Status || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">璁惧鐘舵��</span>
+ <span :class="['item-value', statusClass]">{{ yL_DB.YL_Status || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">宸ヤ綔妯″紡</span>
+ <span :class="['item-value', autoStatusClass]">{{ yL_DB.YL_AutoStatus || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">浠诲姟鍙�</span>
+ <span class="item-value">{{ yL_DB.YL_TaskNum || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">浣滀笟鐘舵��</span>
+ <span class="item-value">{{ yL_DB.YL_WorkStatus || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">褰撳墠琛屽垪灞�</span>
+ <span class="item-value">{{ yL_DB.YL_Row + '-' + yL_DB.YL_Column + '-' + yL_DB.YL_Layer || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">鎶ヨ淇℃伅</span>
+ <span class="item-value">{{ yL_DB.StackerAlarm || '鏃�' }}</span>
+ </div>
+ </div>
+ </div>
+ </el-dialog>
+</template>
+
+<script>
+import JElDescription from "./JElDescription";
+export default {
+ components: {
+ JElDescription
+ },
+ data() {
+ return {
+ YLDBMap: {
+ YL_Status: {
+ 0: "涓嶅湪绾�",
+ 1: "鍦ㄧ嚎",
+ 2: "鎬ュ仠",
+ 3: "鏈煡",
+ },
+ YL_AutoStatus: {
+ 1: "鍗婅嚜鍔�",
+ 2: "鏈煡",
+ 3: "鑷姩",
+ 4: "鎵嬪姩",
+ 5: "鏈煡",
+ },
+ YL_WorkStatus: {
+ 1: "寰呭懡",
+ 2: "鍙栬揣瀹屾垚",
+ 3: "鍙栬揣涓�",
+ 5: "鏀捐揣涓�",
+ 6: "浠诲姟鎵ц閿欒",
+ 7: "鏈煡",
+ 9: "浠诲姟瀹屾垚",
+ },
+ },
+ x: 0, // 鍒濆x鍊�
+ dialogVisible: false,
+ timer1: null,
+ yL_DB: {
+ R_PP_Status: "",
+ YL_Status: "",
+ YL_AutoStatus: "",
+ YL_TaskNum: "",
+ YL_WorkStatus: "",
+ YL_WorkType: "",
+ YL_Row: "",
+ YL_Column: "",
+ YL_Layer: "",
+ StackerAlarm: "",
+ CurrentColumn: "1"
+ },
+ form: {
+ TaskType: "",
+ SourceAddress: "",
+ TargetAddress: "",
+ DeviceCode: "",
+ },
+ };
+ },
+
+ props: {
+ equipNo: {
+ type: String,
+ default: "0",
+ },
+ },
+ computed: {
+ dotPosition() {
+ return this.x;
+ },
+ // 璁惧鐘舵�佹枃瀛楅鑹�
+ statusClass() {
+ const status = this.yL_DB.YL_Status;
+ if (status === '涓嶅湪绾�') {
+ return 'status-red';
+ } else if (status === '鍦ㄧ嚎') {
+ return 'status-green';
+ }
+ return '';
+ },
+ // 宸ヤ綔妯″紡鏂囧瓧棰滆壊
+ autoStatusClass() {
+ const status = this.yL_DB.YL_AutoStatus;
+ if (status === '鑷姩' || status === '鍗婅嚜鍔�') {
+ return 'status-green';
+ } else if (status === '鎵嬪姩') {
+ return 'status-blue';
+ } else if (status === '鑴辨満') {
+ return 'status-red';
+ }
+ return '';
+ }
+ },
+ mounted() {
+ // 鍒濆鍖栨椂浼犻�掔┖瀵硅薄锛岄伩鍏嶇被鍨嬩笉鍖归厤閿欒
+ this.moveDot({});
+ // 鍚姩瀹氭椂鍣紝姣忕鏇存柊涓�娆℃暟鎹�
+ this.timer1 = setInterval(() => {
+ this.updateData();
+ }, 1000);
+ },
+ beforeUnmount() {
+ // 娓呴櫎瀹氭椂鍣�
+ if (this.timer1) {
+ clearInterval(this.timer1);
+ this.timer1 = null;
+ }
+ },
+ watch: {
+ '$root.stackerData': {
+ handler() {
+ this.updateData();
+ },
+ deep: true
+ }
+ },
+ methods: {
+ updateData() {
+ const equipNoStr = String(this.equipNo);
+ if (this.$root.stackerData && this.$root.stackerData[equipNoStr]) {
+ const stackerData = this.$root.stackerData[equipNoStr];
+ this.moveDot(stackerData);
+ }
+ },
+ // 璁$畻鎸囩ず鍣ㄤ綅缃�
+ calculateDotPosition() {
+ // 鏈敹鍒颁俊鎭垨CurrentColumn涓�0锛屾寚绀哄櫒鍦ㄥ闈�
+ if (!this.yL_DB.CurrentColumn || this.yL_DB.CurrentColumn == "0") {
+ return -30; // 鏄剧ず鍦ㄨ揣浣嶅尯鍩熷乏渚у闈�
+ }
+
+ // 璁$畻鎸囩ず鍣ㄤ綅缃紝纭繚涓庡搴斿垪瀵归綈
+ const currentColumn = parseInt(this.yL_DB.CurrentColumn);
+ // 瀹為檯鍒�10瀵瑰簲妯℃澘涓粠宸﹀埌鍙崇56鍒�(66-10=56)
+ // 姣忓垪瀹藉害璁$畻锛歭ine-container瀹藉害1950px / 65鍒� = 30px/鍒�
+ // 鎸囩ず鍣ㄥ搴�25px锛岄渶瑕佸眳涓樉绀哄湪鍒椾腑
+ const columnWidth = 1950 / 65; // 30px
+ const dotWidth = 25; // 鎸囩ず鍣ㄥ搴�
+ // 璁$畻浣嶇疆锛�(鍒楃储寮� * 鍒楀搴�) + (鍒楀搴�/2) - (鎸囩ず鍣ㄥ搴�/2)
+ const position = (currentColumn - 1) * columnWidth + (columnWidth / 2) - (dotWidth / 2);
+ return position;
+ },
+
+ moveDot(x) {
+ // 鏄犲皠宸ヤ綔妯″紡
+ const autoStatusCode = x.YL_AutoStatus;
+ if (autoStatusCode !== undefined) {
+ this.yL_DB.YL_AutoStatus = this.YLDBMap.YL_AutoStatus[autoStatusCode] || autoStatusCode;
+ } else {
+ this.yL_DB.YL_AutoStatus = "鏃�";
+ }
+
+ // 鏄犲皠璁惧鐘舵��
+ const statusCode = parseInt(x.YL_Status);
+ if (!isNaN(statusCode)) {
+ this.yL_DB.YL_Status = this.YLDBMap.YL_Status[statusCode] || statusCode.toString();
+ } else {
+ this.yL_DB.YL_Status = "鏃�";
+ }
+
+ // 鏄犲皠宸ヤ綔鐘舵��
+ const workStatusCode = x.YL_WorkStatus;
+ if (workStatusCode !== undefined) {
+ this.yL_DB.YL_WorkStatus = this.YLDBMap.YL_WorkStatus[workStatusCode] || workStatusCode;
+ } else {
+ this.yL_DB.YL_WorkStatus = "鏃�";
+ }
+
+ // 鍏朵粬鏁版嵁璧嬪��
+ this.yL_DB.R_PP_Status = x.DeviceCode || "鏃�";
+ this.yL_DB.YL_WorkType = x.YL_WorkType || "鏃�";
+ this.yL_DB.YL_TaskNum = x.YL_TaskNum || "鏃�";
+
+ // 鎴愬搧搴擄細鐩存帴浣跨敤灏忚揣浣嶅彿浣滀负鍒楀彿锛屼笉鍚堝苟
+ const smallColumn = parseInt(x.YL_Column);
+ let column;
+
+ // 澶勭悊琛屽彿
+ const rowValue = parseInt(x.YL_Row);
+
+ // 澶勭悊灞傚彿
+ const layerValue = parseInt(x.YL_Layer);
+
+ if (!isNaN(smallColumn) && smallColumn > 0) {
+ // 鎴愬搧搴撴墍鏈夊爢鍨涙満閮戒笉鍚堝苟灏忚揣浣嶏紝鐩存帴浣跨敤灏忚揣浣嶅彿
+ column = smallColumn;
+ this.yL_DB.YL_Row = (!isNaN(rowValue) && rowValue > 0) ? rowValue.toString() : "0";
+ this.yL_DB.YL_Layer = (!isNaN(layerValue) && layerValue > 0) ? layerValue.toString() : "0";
+ } else {
+ // 娌℃湁鏀跺埌淇℃伅锛屾寚绀哄櫒鍦ㄥ闈�
+ column = 0;
+ this.yL_DB.YL_Row = "0";
+ this.yL_DB.YL_Layer = "0";
+ }
+
+ // 鐩存帴浣跨敤瀹為檯鍒楀彿浣滀负鏄剧ず鍒楀彿锛岀‘淇濆疄闄呭垪10瀵瑰簲妯℃澘涓樉绀虹殑绗�10鍒�
+ // 鐢ㄦ埛鏈熸湜鎸囩ず鍣ㄥ榻愬埌妯℃澘涓樉绀虹殑瀵瑰簲鍒楀彿
+ const displayColumn = column > 0 ? (66 - column) : 0;
+
+ // 澶勭悊鍒楀彿
+ this.yL_DB.YL_Column = (!isNaN(smallColumn) && smallColumn > 0) ? smallColumn.toString() : "0";
+ this.yL_DB.StackerAlarm = x.StackerAlarm || "鏃�";
+ this.yL_DB.CurrentColumn = displayColumn.toString();
+
+ console.log('鎴愬搧搴撳皬璐т綅:', smallColumn, '瀵瑰簲鍒�:', column, '鏄剧ず鍒�:', displayColumn);
+ this.form.DeviceCode = x.DeviceCode || "";
+ },
+ update() {
+ // 鑾峰彇StackerAlarm鐨勫�硷紝杞崲涓哄瓧绗︿覆杩涜姣旇緝
+ const alarmValue = String(this.yL_DB.StackerAlarm).trim();
+ // 褰揝tackerAlarm瀛楁鐨勫�间笉涓�0鎴栫┖鏃讹紝灏辨晠闅滄姤璀︼紙鏄剧ず绾㈣壊锛�
+ if (alarmValue !== '' && alarmValue !== '0' && alarmValue !== '鏃�') {
+ return 'dot-Fault ';
+ }
+ if (this.yL_DB.YL_Status == "鍦ㄧ嚎" && (this.yL_DB.YL_AutoStatus == "鑷姩" || this.yL_DB.YL_AutoStatus == "鍗婅嚜鍔�")) {
+ return 'dot-Automatic ';
+ }
+ else if (this.yL_DB.YL_Status == "鍦ㄧ嚎" && this.yL_DB.YL_AutoStatus == "鎵嬪姩") {
+ return 'dot-Running ';
+ } else {
+ return 'dot-Fault ';
+ }
+ },
+ mouseClick() {
+ this.fullscreenLoading = true;
+ this.dialogVisible = true;
+ this.fullscreenLoading = false;
+ },
+ },
+};
+</script>
+
+<style scoped>
+.line-container {
+ position: relative;
+ height: 25px;
+ background-color: #ecf5ff;
+ width: 1950px; /* 65鍒� * 30px姣忓垪 */
+}
+
+.line {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 0px;
+ background-color: #a0cfff;
+}
+
+.dot-Running {
+ position: absolute;
+ top: 0px;
+ width: 25px;
+ height: 25px;
+ border-radius: 50%;
+ background-color: #409eff;
+ transition: transform 0.3s ease;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 9px;
+ font-weight: bold;
+ font-family: 'Microsoft YaHei', Arial, sans-serif;
+ color: #ffffff;
+}
+
+.dot-Automatic {
+ position: absolute;
+ top: 0px;
+ width: 25px;
+ height: 25px;
+ border-radius: 50%;
+ background-color: #0df705;
+ transition: transform 0.3s ease;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 9px;
+ font-weight: bold;
+ font-family: 'Microsoft YaHei', Arial, sans-serif;
+ color: #ffffff;
+}
+
+.dot-Fault {
+ position: absolute;
+ top: 0px;
+ width: 25px;
+ height: 25px;
+ border-radius: 50%;
+ background-color: #f80410;
+ transition: transform 0.3s ease;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 9px;
+ font-weight: bold;
+ font-family: 'Microsoft YaHei', Arial, sans-serif;
+ color: #ffffff;
+}
+
+img {
+ width: 30px;
+ height: 30px;
+}
+
+.image-text {
+ position: absolute;
+ top: 5px;
+ color: #000000;
+ font-size: 12px;
+ font-weight: bold;
+ font-family: 'Microsoft YaHei', Arial, sans-serif;
+ margin-left: 5px;
+}
+
+.modern-dialog {
+ border-radius: 16px !important;
+ overflow: hidden;
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
+}
+
+.modern-dialog .el-dialog__header {
+ display: none;
+}
+
+.modern-dialog .el-dialog__body {
+ padding: 0;
+ margin: 0;
+}
+
+.dialog-header {
+ background: linear-gradient(135deg, #409eff 0%, #67c23a 100%);
+ padding: 20px 24px;
+ text-align: center;
+}
+
+.dialog-title {
+ color: #fff;
+ font-size: 18px;
+ font-weight: 600;
+ margin: 0;
+ letter-spacing: 2px;
+}
+
+.dialog-content {
+ padding: 28px;
+ background: #f8fafc;
+ display: flex;
+ justify-content: center;
+}
+
+.info-list {
+ width: 100%;
+ max-width: 420px;
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+}
+
+.info-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 16px 20px;
+ background: #fff;
+ border-radius: 12px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
+ transition: all 0.3s ease;
+}
+
+.info-item:hover {
+ transform: translateX(4px);
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
+}
+
+.item-label {
+ font-size: 14px;
+ color: #6b7280;
+ font-weight: 500;
+ min-width: 80px;
+ text-align: left;
+}
+
+.item-value {
+ font-size: 15px;
+ color: #1f2937;
+ font-weight: 500;
+ text-align: right;
+ flex: 1;
+ margin-left: 20px;
+ word-break: break-all;
+ padding-left: 20px;
+ border-left: 1px solid #e5e7eb;
+}
+
+.status-blue {
+ color: #409eff !important;
+ font-weight: 600;
+}
+
+.status-green {
+ color: #67c23a !important;
+ font-weight: 600;
+}
+
+.status-red {
+ color: #f56c6c !important;
+ font-weight: 600;
+}
+</style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineInfo.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineInfo.vue"
index 0f2cf01..4c275ae 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineInfo.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineInfo.vue"
@@ -1,100 +1,42 @@
<template>
- <div :class="update()" :style="{ left: left, top: top, marginBottom: 0 + 'px', marginTop: 0 + 'px' }"
+ <div :class="update" :style="{ left: left, top: top, marginBottom: 0 + 'px', marginTop: 15 + 'px' }"
@click="mouseClick" v-loading.fullscreen.lock="fullscreenLoading">
<img v-if="imgType === '2'" src="../../public/lines.png" />
<img v-if="imgType === '1'" src="../../public/lines2.png" />
<label v-if="equipNo" class="equip-no">{{ equipNo }}</label>
</div>
- <el-dialog v-model="dialogVisible" title="杈撻�佺嚎淇℃伅鏌ョ湅" :before-close="handleClose">
- <el-form ref="$form" :model="lineItemInfo" label-position="left" label-width="100px" size="medium">
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="璁惧缂栧彿锛�">
- <j-el-description :value="equipNo" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="鏄惁鏈夌洏:">
- <j-el-description :value="lineItemInfo.inStock" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="浠诲姟鍙�:">
- <j-el-description :value="lineItemInfo.taskNumm" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="鎶ヨ浠g爜锛�">
- <j-el-description :value="lineItemInfo.alarm" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- </el-row>
-
- </el-form><el-divider />
- <h4 style="margin-bottom: 20px;">鎵嬪姩鎿嶄綔</h4>
- <el-form ref="form" :model="form" label-width="100px">
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="浠� 鍔� 鍛� 浠�" prop="TargetAddress">
- <el-select size="large" v-model="form.TaskType" placeholder="璇烽�夋嫨浠诲姟鍛戒护">
- <el-option label="鍏ュ簱" value="1" />
- <el-option label="鍑哄簱" value="2" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="涓嬩竴鐩爣鍦板潃:">
- <el-input size="large" v-model="form.TargetAddress" placeholder="璇疯緭鍏ヤ笅涓�鐩爣鍦板潃" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-divider />
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="primary" size="small" plain @click="SendCommand">
- <i class="el-icon-check">鍙戦�佸懡浠�</i>
- </el-button>
- </el-col>
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="warning" size="small" plain @click="ConveyorLineReset">
- <i class="el-icon-check">澶嶄綅</i>
- </el-button>
-
- </el-col>
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="danger" size="small" plain @click="ConveyorLineEmergencyStop">
- <i class="el-icon-check">鍋滄</i>
- </el-button>
- </el-col>
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="danger" size="small" plain @click="ConveyorLineReturn">
- <i class="el-icon-check">閫�鍥�</i>
- </el-button>
- </el-col>
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="danger" size="small" plain @click="ConveyorLineCancel">
- <i class="el-icon-check">鍙栨秷浠诲姟</i>
- </el-button>
- </el-col>
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="danger" size="small" plain @click="ConveyorLineInitialize">
- <i class="el-icon-check">宸ヤ綅鍒濆鍖�</i>
- </el-button>
- </el-col>
- </el-row>
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="dialogVisible = false">鍙栨秷</el-button>
- <el-button type="primary" @click="dialogVisible = false">
- 纭
- </el-button>
+ <el-dialog v-model="dialogVisible" :before-close="handleClose" width="520px" class="modern-dialog">
+ <div class="dialog-header">
+ <h3 class="dialog-title">杈撻�佺嚎淇℃伅</h3>
+ </div>
+ <div class="dialog-content">
+ <div class="info-list">
+ <div class="info-item">
+ <span class="item-label">璁惧缂栧彿</span>
+ <span class="item-value">{{ equipNo || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">浠诲姟鍙�</span>
+ <span class="item-value">{{ ConveyorLineInfo.TaskNum || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">鏄惁鏈夌洏</span>
+ <span class="item-value">{{ ConveyorLineInfo.HasGoods || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">鎵樼洏鏉$爜</span>
+ <span class="item-value">{{ ConveyorLineInfo.PalletCode || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">鐘舵��</span>
+ <span :class="['item-value', statusClass]">{{ ConveyorLineInfo.Status || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">鍛戒护</span>
+ <span class="item-value">{{ ConveyorLineInfo.Command || '鏃�' }}</span>
+ </div>
</div>
- </template>
+ </div>
</el-dialog>
</template>
@@ -140,143 +82,288 @@
left: "500px",
top: "400px",
dialogVisible: false,
- lineItemInfo: {
- inStock: "",
- taskNum: "",
- alarm: "",
+ fullscreenLoading: false,
+ timer1: null,
+ hasGoods: false,
+ isAlarm: false,
+ ConveyorLineInfo: {
+ TaskNum: "",
+ HasGoods: "",
+ Status: "",
+ Command: "",
+ PalletCode: "",
},
form: {
TaskType: "",
TargetAddress: "",
DeviceCode: "",
},
+ Map: {
+ Command: {
+ 0: "鏃犲懡浠�",
+ 1: "闈炲氨缁紙涓嶆墽琛屼笅鍙戝懡浠わ級",
+ 2: "鍙栬揣绔欏彴宸ヤ綅灏辩华锛堟湁鏂欙級",
+ 3: "鏀捐揣绔欏彴宸ヤ綅灏辩华锛堟棤鏂欙級",
+ 4: "鏀捐揣绔欏彴宸ヤ綅灏辩华锛堟湁鏂欙級",
+ 5: "鎵爜宸ヤ綅灏辩华",
+ 6: "浠诲姟宸ヤ綅灏辩华",
+ 7: "鐢宠鏂欐",
+ 8: "鏂欐鍒颁綅",
+ 9: "鎵ц鍛戒护涓�"
+ },
+ Status: {
+ 0: "鑴辨満涓�",
+ 1: "鎵嬪姩寰呮満",
+ 2: "鑷姩寰呮満",
+ 3: "璁惧杩愯",
+ 4: "璁惧鏁呴殰"
+ }
+ },
};
},
mounted() {
- const axisX = (this.positionX - 1) * 40 + 100;
+ const axisX = (this.positionX - 1) * 60 + 100;
const axisY = (this.positionY - 1) + 50;
this.$nextTick(() => {
this.left = `${axisX}px`;
this.top = `${axisY}px`;
});
+ // 鍚姩瀹氭椂鍣紝姣忕鏇存柊涓�娆℃暟鎹�
+ this.timer1 = setInterval(() => {
+ this.updateAlarmStatus();
+ }, 1000);
+ },
+ beforeUnmount() {
+ // 娓呴櫎瀹氭椂鍣�
+ if (this.timer1) {
+ clearInterval(this.timer1);
+ this.timer1 = null;
+ }
+ },
+ watch: {
+ '$root.conveyorLineDetails': {
+ handler() {
+ this.updateAlarmStatus();
+ },
+ deep: true,
+ immediate: true
+ }
},
methods: {
+ updateAlarmStatus() {
+ const equipNoStr = String(this.equipNo);
+ if (this.$root.conveyorLineDetails && this.$root.conveyorLineDetails[equipNoStr]) {
+ const rawData = this.$root.conveyorLineDetails[equipNoStr];
+ this.hasGoods = rawData.inStock === '鏄�' || false;
+ // 浣跨敤Home.vue涓凡缁忚绠楀ソ鐨刬sAlarm鍊硷紝鎴栬�呮牴鎹姸鎬佸垽鏂�
+ this.isAlarm = rawData.isAlarm || (rawData.status === 4) || false;
+ // 瀹炴椂鏇存柊瀵硅瘽妗嗕腑鐨勬暟鎹�
+ this.ConveyorLineInfo = {
+ TaskNum: rawData.taskNum || rawData.TaskNum || '鏃�',
+ HasGoods: (rawData.taskNum && rawData.taskNum !== '鏃�' && rawData.taskNum !== '0') ? '鏄�' : '鍚�',
+ Status: rawData.status || rawData.Status || '鏃�',
+ Command: rawData.command || rawData.Command || '鏃�',
+ PalletCode: rawData.palletCode || rawData.PalletCode || '鏃�',
+ };
+ // 灏嗗懡浠や唬鐮佽浆鎹负瀵瑰簲鐨勪腑鏂囨弿杩�
+ if (this.ConveyorLineInfo.Command !== '' && this.ConveyorLineInfo.Command !== '鏃�') {
+ const commandCode = parseInt(this.ConveyorLineInfo.Command);
+ if (!isNaN(commandCode) && this.Map.Command && this.Map.Command[commandCode] !== undefined) {
+ this.ConveyorLineInfo.Command = this.Map.Command[commandCode];
+ }
+ }
+ // 灏嗙姸鎬佷唬鐮佽浆鎹负瀵瑰簲鐨勪腑鏂囨弿杩�
+ if (this.ConveyorLineInfo.Status !== '' && this.ConveyorLineInfo.Status !== '鏃�') {
+ const statusCode = parseInt(this.ConveyorLineInfo.Status);
+ if (!isNaN(statusCode) && this.Map.Status && this.Map.Status[statusCode] !== undefined) {
+ this.ConveyorLineInfo.Status = this.Map.Status[statusCode];
+ }
+ }
+ } else {
+ this.hasGoods = false;
+ this.isAlarm = false;
+ }
+ },
mouseClick() {
this.fullscreenLoading = true;
this.dialogVisible = true;
- // 澶勭悊鐐瑰嚮浜嬩欢
- this.http.post("api/DeviceInfo/GetConveyorLineInfo?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (x.status) {
- this.lineItemInfo = x.data;
- } else {
- this.$message({
- type: "error",
- message: x.message,
- });
- }
- });
+ // 浠庡叏灞�鍙橀噺涓幏鍙栬緭閫佺嚎璇︾粏淇℃伅
+ if (this.$root.conveyorLineDetails && this.$root.conveyorLineDetails[this.equipNo]) {
+ // 鍏堣幏鍙栧師濮嬫暟鎹�
+ const rawData = this.$root.conveyorLineDetails[this.equipNo];
+ // 澶嶅埗鏁版嵁鍒癈onveyorLineInfo锛堟ā鏉夸腑缁戝畾鐨勫璞★級
+ this.ConveyorLineInfo = {
+ TaskNum: rawData.taskNum || rawData.TaskNum || '鏃�',
+ HasGoods: (rawData.taskNum && rawData.taskNum !== '鏃�' && rawData.taskNum !== '0') ? '鏄�' : '鍚�',
+ Status: rawData.status || rawData.Status || '鏃�',
+ Command: rawData.command || rawData.Command || '鏃�',
+ PalletCode: rawData.palletCode || rawData.PalletCode || '鏃�',
+ };
+
+ // 灏嗗懡浠や唬鐮佽浆鎹负瀵瑰簲鐨勪腑鏂囨弿杩�
+ if (this.ConveyorLineInfo.Command !== '' && this.ConveyorLineInfo.Command !== '鏃�') {
+ const commandCode = parseInt(this.ConveyorLineInfo.Command);
+ if (!isNaN(commandCode) && this.Map.Command && this.Map.Command[commandCode] !== undefined) {
+ this.ConveyorLineInfo.Command = this.Map.Command[commandCode];
+ }
+ }
+
+ // 灏嗙姸鎬佷唬鐮佽浆鎹负瀵瑰簲鐨勪腑鏂囨弿杩�
+ if (this.ConveyorLineInfo.Status !== '' && this.ConveyorLineInfo.Status !== '鏃�') {
+ const statusCode = parseInt(this.ConveyorLineInfo.Status);
+ if (!isNaN(statusCode) && this.Map.Status && this.Map.Status[statusCode] !== undefined) {
+ this.ConveyorLineInfo.Status = this.Map.Status[statusCode];
+ }
+ }
+
+ // 灏嗘姤璀︿唬鐮佽浆鎹负瀵瑰簲鐨勪腑鏂囨弿杩�
+ if (rawData.alarm !== '' && rawData.alarm !== '鏃�') {
+ const alarmCode = parseInt(rawData.alarm);
+ if (!isNaN(alarmCode) && this.Map.ErrorCode && this.Map.ErrorCode[alarmCode] !== undefined) {
+ this.ConveyorLineInfo.Alarm = this.Map.ErrorCode[alarmCode];
+ }
+ }
+ } else {
+ // 濡傛灉娌℃湁鏁版嵁锛屼娇鐢ㄩ粯璁ゅ��
+ this.ConveyorLineInfo = {
+ TaskNum: '',
+ HasGoods: '',
+ Status: '',
+ Command: '',
+ PalletCode: '',
+ };
+ }
+ this.fullscreenLoading = false;
+ },
+ handleClose() {
+ this.dialogVisible = false;
this.fullscreenLoading = false;
},
- SendCommand() {
- this.fullscreenLoading = true;
- this.form.DeviceCode=this.equipNo;
- this.http.post("api/DeviceInfo/ConveyorLineHandTask" ,this.form)
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- ConveyorLineReset() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/ConveyorLineReset?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
+ // SendCommand() {
+ // this.fullscreenLoading = true;
+ // this.form.DeviceCode=this.equipNo;
+ // this.http.post("api/DeviceInfo/ConveyorLineHandTask" ,this.form)
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // ConveyorLineReset() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/ConveyorLineReset?DeviceChildCode=" + this.equipNo, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- ConveyorLineEmergencyStop() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/ConveyorLineEmergencyStop?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // ConveyorLineEmergencyStop() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/ConveyorLineEmergencyStop?DeviceChildCode=" + this.equipNo, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- ConveyorLineReturn() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/ConveyorLineReturn?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- ConveyorLineCancel() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/ConveyorLineCancel?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- ConveyorLineInitialize() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/ConveyorLineInitialize?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- update() {
- return !this.condition ? 'custom-img' : 'custom-img-color'
- },
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // ConveyorLineReturn() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/ConveyorLineReturn?DeviceChildCode=" + this.equipNo, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // ConveyorLineCancel() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/ConveyorLineCancel?DeviceChildCode=" + this.equipNo, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // ConveyorLineInitialize() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/ConveyorLineInitialize?DeviceChildCode=" + this.equipNo, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ //},
startTimer() {
// 寮�鍚畾鏃跺櫒锛屾瘡3绉掓墽琛屼竴娆�
this.timer1 = setInterval(() => {
- update();
- }, 500);
+ this.updateAlarmStatus();
+ }, 1000);
},
},
+ computed: {
+ update() {
+ if (this.isAlarm) {
+ return 'custom-img-alarm';
+ }
+ // 浣跨敤涓枃鐘舵�佸�煎垽鏂�
+ const statusText = this.ConveyorLineInfo.Status;
+ // 鐘舵�佷负鎵嬪姩寰呮満鏃讹紝鏃犺鏈夋棤鐩橀兘鏄剧ず钃濊壊
+ if (statusText === '鎵嬪姩寰呮満') {
+ return 'custom-img-blue';
+ }
+ // 鐘舵�佷负鑷姩寰呮満鎴栬澶囪繍琛屼笖鏈夌洏鏃舵樉绀虹豢鑹�
+ if ((statusText === '鑷姩寰呮満' || statusText === '璁惧杩愯') && (this.hasGoods || this.ConveyorLineInfo.HasGoods === '鏄�')) {
+ return 'custom-img-color';
+ }
+ return 'custom-img';
+ },
+ statusClass() {
+ const statusText = this.ConveyorLineInfo.Status;
+ if (statusText === '鎵嬪姩寰呮満') {
+ return 'status-blue';
+ } else if (statusText === '鑷姩寰呮満' || statusText === '璁惧杩愯') {
+ return 'status-green';
+ } else if (statusText === '璁惧鏁呴殰') {
+ return 'status-red';
+ }
+ return '';
+ }
+ }
});
</script>
@@ -295,6 +382,42 @@
text-align: center;
}
+.custom-img-alarm {
+ position: relative;
+ display: inline-block;
+ background-color: #ff0000;
+ color: white;
+ text-align: center;
+}
+
+.custom-img-blue {
+ position: relative;
+ display: inline-block;
+ background-color: #409eff;
+ color: white;
+ text-align: center;
+}
+
+.custom-img-blue img {
+ width: 80px;
+ height: 50px;
+}
+
+.custom-img-alarm img {
+ width: 80px;
+ height: 50px;
+}
+
+.custom-img img {
+ width: 80px;
+ height: 50px;
+}
+
+.custom-img-color img {
+ width: 80px;
+ height: 50px;
+}
+
/* .custom-img-color::before {
content: "";
position: absolute;
@@ -307,19 +430,117 @@
} */
.custom-img img {
- width: 40px;
- height: 40px;
+ width: 80px;
+ height: 50px;
}
.custom-img-color img {
- width: 40px;
- height: 40px;
+ width: 80px;
+ height: 50px;
}
.equip-no {
position: absolute;
- top: 15px;
- font-size: 12px;
- margin-left: -35px;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: 25px;
+ text-align: center;
+ width: 100%;
+}
+
+.modern-dialog {
+ border-radius: 16px !important;
+ overflow: hidden;
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
+}
+
+.modern-dialog .el-dialog__header {
+ display: none;
+}
+
+.modern-dialog .el-dialog__body {
+ padding: 0;
+ margin: 0;
+}
+
+.dialog-header {
+ background: linear-gradient(135deg, #409eff 0%, #67c23a 100%);
+ padding: 20px 24px;
+ text-align: center;
+}
+
+.dialog-title {
+ color: #fff;
+ font-size: 18px;
+ font-weight: 600;
+ margin: 0;
+ letter-spacing: 2px;
+}
+
+.dialog-content {
+ padding: 28px;
+ background: #f8fafc;
+ display: flex;
+ justify-content: center;
+}
+
+.info-list {
+ width: 100%;
+ max-width: 420px;
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+}
+
+.info-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 16px 20px;
+ background: #fff;
+ border-radius: 12px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
+ transition: all 0.3s ease;
+}
+
+.info-item:hover {
+ transform: translateX(4px);
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
+}
+
+.item-label {
+ font-size: 14px;
+ color: #6b7280;
+ font-weight: 500;
+ min-width: 80px;
+ text-align: left;
+}
+
+.item-value {
+ font-size: 15px;
+ color: #1f2937;
+ font-weight: 500;
+ text-align: right;
+ flex: 1;
+ margin-left: 20px;
+ word-break: break-all;
+ padding-left: 20px;
+ border-left: 1px solid #e5e7eb;
+}
+
+.status-blue {
+ color: #409eff !important;
+ font-weight: 600;
+}
+
+.status-green {
+ color: #67c23a !important;
+ font-weight: 600;
+}
+
+.status-red {
+ color: #f56c6c !important;
+ font-weight: 600;
}
</style>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineInfocopy.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineInfocopy.vue"
index 338a8f0..47cceb6 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineInfocopy.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSClient/src/views/LineInfocopy.vue"
@@ -5,96 +5,46 @@
<img v-if="imgType === '1'" src="../../public/lines2.png" />
<label v-if="equipNo" class="equip-no">{{ equipNo }}</label>
</div>
- <el-dialog v-model="dialogVisible" title="杈撻�佺嚎淇℃伅鏌ョ湅" :before-close="handleClose">
- <el-form ref="$form" :model="lineItemInfo" label-position="left" label-width="100px" size="medium">
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="璁惧缂栧彿锛�">
- <j-el-description :value="equipNo" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="鏄惁鏈夌洏:">
- <j-el-description :value="lineItemInfo.inStock" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="浠诲姟鍙�:">
- <j-el-description :value="lineItemInfo.taskNum" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="鎶ヨ浠g爜锛�">
- <j-el-description :value="lineItemInfo.alarm" type="primary" ellipsis></j-el-description>
- </el-form-item>
- </el-col>
- </el-row>
-
- </el-form><el-divider />
- <h4 style="margin-bottom: 20px;">鎵嬪姩鎿嶄綔</h4>
- <el-form ref="form" :model="form" label-width="100px">
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="浠� 鍔� 鍛� 浠�" prop="TargetAddress">
- <el-select size="large" v-model="form.TaskType" placeholder="璇烽�夋嫨浠诲姟鍛戒护">
- <el-option label="鍏ュ簱" value="1" />
- <el-option label="鍑哄簱" value="2" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div">
- <el-form-item label="涓嬩竴鐩爣鍦板潃:">
- <el-input size="large" v-model="form.TargetAddress" placeholder="璇疯緭鍏ヤ笅涓�鐩爣鍦板潃" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-divider />
- <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="primary" size="small" plain @click="SendCommand">
- <i class="el-icon-check">鍙戦�佸懡浠�</i>
- </el-button>
- </el-col>
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="warning" size="small" plain @click="ConveyorLineReset">
- <i class="el-icon-check">澶嶄綅</i>
- </el-button>
-
- </el-col>
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="danger" size="small" plain @click="ConveyorLineEmergencyStop">
- <i class="el-icon-check">鍋滄</i>
- </el-button>
- </el-col>
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="danger" size="small" plain @click="ConveyorLineReturn">
- <i class="el-icon-check">閫�鍥�</i>
- </el-button>
- </el-col>
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="danger" size="small" plain @click="ConveyorLineCancel">
- <i class="el-icon-check">鍙栨秷浠诲姟</i>
- </el-button>
- </el-col>
- <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
- <el-button type="danger" size="small" plain @click="ConveyorLineInitialize">
- <i class="el-icon-check">宸ヤ綅鍒濆鍖�</i>
- </el-button>
- </el-col>
- </el-row>
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="dialogVisible = false">鍙栨秷</el-button>
- <el-button type="primary" @click="dialogVisible = false">
- 纭
- </el-button>
+ <el-dialog v-model="dialogVisible" :before-close="handleClose" width="520px" class="modern-dialog">
+ <div class="dialog-header">
+ <h3 class="dialog-title">杈撻�佺嚎淇℃伅</h3>
+ </div>
+ <div class="dialog-content">
+ <div class="info-list">
+ <div class="info-item">
+ <span class="item-label">璁惧缂栧彿</span>
+ <span class="item-value">{{ equipNo || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">浠诲姟鍙�</span>
+ <span class="item-value">{{ lineItemInfo.taskNum || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">鏄惁鏈夌洏</span>
+ <span class="item-value">{{ lineItemInfo.inStock || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">RFID</span>
+ <span class="item-value">{{ lineItemInfo.rfid || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">鐢宠</span>
+ <span class="item-value">{{ lineItemInfo.request || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">鐢宠鍙嶉</span>
+ <span class="item-value">{{ lineItemInfo.reresult || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">绾稿嵎骞呭</span>
+ <span class="item-value">{{ lineItemInfo.width || '鏃�' }}</span>
+ </div>
+ <div class="info-item">
+ <span class="item-label">鎶ヨ淇℃伅</span>
+ <span class="item-value">{{ lineItemInfo.error || '鏃�' }}</span>
+ </div>
</div>
- </template>
+ </div>
</el-dialog>
</template>
@@ -119,11 +69,11 @@
default: "1",
},
positionX: {
- type: Int32Array,
+ type: Number,
default: 1,
},
positionY: {
- type: Int32Array,
+ type: Number,
default: 1,
},
url: {
@@ -136,144 +86,284 @@
},
},
data() {
- return {
- left: "500px",
- top: "400px",
- dialogVisible: false,
- lineItemInfo: {
- inStock: "",
- taskNum: "",
- alarm: "",
- },
- form: {
- TaskType: "",
- TargetAddress: "",
- DeviceCode: "",
- },
- };
+ return {
+ left: "500px",
+ top: "400px",
+ dialogVisible: false,
+ fullscreenLoading: false,
+ isAlarm: false,
+ lineItemInfo: {
+ inStock: "",
+ taskNum: "",
+ rfid: "",
+ width: "",
+ request: "",
+ reresult: "",
+ error: "",
+ },
+ // 鐢宠鍙嶉鐘舵�佽窡韪�
+ feedbackTracking: {
+ currentTaskNum: "", // 褰撳墠浠诲姟鍙�
+ hasFeedback: false, // 鏄惁宸插弽棣堣繃
+ lastFeedbackValue: "" // 涓婃鍙嶉鐨勫��
+ },
+ form: {
+ TaskType: "",
+ TargetAddress: "",
+ DeviceCode: "",
+ },
+ };
},
mounted() {
- const axisX = (this.positionX - 1) * 40 + 100;
+ const axisX = (this.positionX - 1) * 60 + 100;
const axisY = (this.positionY - 1) + 50;
this.$nextTick(() => {
this.left = `${axisX}px`;
this.top = `${axisY}px`;
});
+
+ // 鐩戝惉鍏ㄥ眬conveyorLineDetails鐨勫彉鍖�
+ this.$watch(
+ () => this.$root.conveyorLineDetails,
+ () => {
+ this.updateAlarmStatus();
+ },
+ { deep: true, immediate: true }
+ );
+
+ // 寮�鍚畾鏃跺櫒锛屽畾鏈熸鏌ユ暟鎹彉鍖�
+ this.timer = setInterval(() => {
+ this.updateAlarmStatus();
+ }, 1000); // 姣�1绉掓鏌ヤ竴娆�
},
methods: {
+ // 鏇存柊鎶ヨ鐘舵��
+ updateAlarmStatus() {
+ const equipNoStr = String(this.equipNo);
+ if (this.$root.conveyorLineDetails && this.$root.conveyorLineDetails[equipNoStr]) {
+ const rawData = this.$root.conveyorLineDetails[equipNoStr];
+ this.isAlarm = rawData.isAlarm || false;
+
+ // 鑾峰彇褰撳墠浠诲姟鍙�
+ const currentTaskNum = rawData.taskNum || '鏃�';
+
+ // 妫�鏌ヤ换鍔″彿鏄惁鍙樺寲
+ if (currentTaskNum !== this.feedbackTracking.currentTaskNum) {
+ // 浠诲姟鍙峰彉鍖栵紝閲嶇疆鍙嶉鐘舵��
+ this.feedbackTracking.currentTaskNum = currentTaskNum;
+ this.feedbackTracking.hasFeedback = false;
+ this.feedbackTracking.lastFeedbackValue = "";
+ }
+
+ // 澶勭悊鐢宠鍙嶉閫昏緫
+ let reresultValue = rawData.reresult || '鏃�';
+
+ // 濡傛灉鏀跺埌浜嗗弽棣堝�硷紙闈炵┖闈炴棤锛変笖杩樻病鏈夊弽棣堣繃
+ if ((reresultValue !== '鏃�' && reresultValue !== '' && reresultValue !== undefined) && !this.feedbackTracking.hasFeedback) {
+ // 璁板綍宸插弽棣�
+ this.feedbackTracking.hasFeedback = true;
+ this.feedbackTracking.lastFeedbackValue = reresultValue;
+ }
+
+ // 濡傛灉宸茬粡鍙嶉杩囷紝鏄剧ず"宸插弽棣�"
+ if (this.feedbackTracking.hasFeedback) {
+ reresultValue = '宸插弽棣�';
+ }
+
+ // 鏇存柊lineItemInfo鏁版嵁
+ this.lineItemInfo = {
+ taskNum: currentTaskNum,
+ inStock: rawData.inStock || '鏃�',
+ rfid: rawData.rfid || '鏃�',
+ width: rawData.width || '鏃�',
+ request: rawData.request || '鏃�',
+ reresult: reresultValue,
+ error: rawData.error || '鏃�',
+ };
+ } else {
+ this.isAlarm = false;
+ this.lineItemInfo = {
+ taskNum: '',
+ inStock: '',
+ rfid: '',
+ width: '',
+ request: '',
+ reresult: '',
+ error: ''
+ };
+ }
+ },
+ // 缁勪欢閿�姣佹椂娓呴櫎瀹氭椂鍣�
+ beforeUnmount() {
+ if (this.timer) {
+ clearInterval(this.timer);
+ }
+ },
mouseClick() {
this.fullscreenLoading = true;
this.dialogVisible = true;
- // 澶勭悊鐐瑰嚮浜嬩欢
- this.http.post("api/DeviceInfo/GetConveyorLineInfo?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (x.status) {
- this.lineItemInfo = x.data;
- } else {
- this.$message({
- type: "error",
- message: x.message,
- });
- }
- });
+ // 浠庡叏灞�鍙橀噺涓幏鍙栬緭閫佺嚎璇︾粏淇℃伅
+ const equipNoStr = String(this.equipNo);
+ if (this.$root.conveyorLineDetails && this.$root.conveyorLineDetails[equipNoStr]) {
+ // 鍏堣幏鍙栧師濮嬫暟鎹�
+ const rawData = this.$root.conveyorLineDetails[equipNoStr];
+
+ // 鑾峰彇褰撳墠浠诲姟鍙�
+ const currentTaskNum = rawData.taskNum || '鏃�';
+
+ // 妫�鏌ヤ换鍔″彿鏄惁鍙樺寲锛堜笌updateAlarmStatus淇濇寔涓�鑷达級
+ if (currentTaskNum !== this.feedbackTracking.currentTaskNum) {
+ this.feedbackTracking.currentTaskNum = currentTaskNum;
+ this.feedbackTracking.hasFeedback = false;
+ this.feedbackTracking.lastFeedbackValue = "";
+ }
+
+ // 澶勭悊鐢宠鍙嶉閫昏緫
+ let reresultValue = rawData.reresult || '鏃�';
+
+ // 濡傛灉鏀跺埌浜嗗弽棣堝�硷紙闈炵┖闈炴棤锛変笖杩樻病鏈夊弽棣堣繃
+ if ((reresultValue !== '鏃�' && reresultValue !== '' && reresultValue !== undefined) && !this.feedbackTracking.hasFeedback) {
+ this.feedbackTracking.hasFeedback = true;
+ this.feedbackTracking.lastFeedbackValue = reresultValue;
+ }
+
+ // 濡傛灉宸茬粡鍙嶉杩囷紝鏄剧ず"宸插弽棣�"
+ if (this.feedbackTracking.hasFeedback) {
+ reresultValue = '宸插弽棣�';
+ }
+ // 澶嶅埗鏁版嵁鍒發ineItemInfo锛堟ā鏉夸腑缁戝畾鐨勫璞★級
+ this.lineItemInfo = {
+ taskNum: currentTaskNum,
+ inStock: rawData.inStock || '鏃�',
+ rfid: rawData.rfid || '鏃�',
+ width: rawData.width || '鏃�',
+ request: rawData.request || '鏃�',
+ reresult: reresultValue,
+ error: rawData.error || '鏃�',
+ };
+ // 淇濆瓨鎶ヨ鐘舵��
+ this.isAlarm = rawData.isAlarm || false;
+ } else {
+ // 濡傛灉娌℃湁鏁版嵁锛屼娇鐢ㄩ粯璁ゅ��
+ this.lineItemInfo = {
+ taskNum: '',
+ inStock: '',
+ rfid: '',
+ width: '',
+ request: '',
+ reresult: '',
+ error: ''
+ };
+ this.isAlarm = false;
+ }
+ this.fullscreenLoading = false;
+ },
+ handleClose() {
+ this.dialogVisible = false;
this.fullscreenLoading = false;
},
- SendCommand() {
- this.fullscreenLoading = true;
- this.form.DeviceCode=this.equipNo;
- this.http.post("api/DeviceInfo/ConveyorLineHandTask" ,this.form)
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- ConveyorLineReset() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/ConveyorLineReset?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
+ // SendCommand() {
+ // this.fullscreenLoading = true;
+ // this.form.DeviceCode=this.equipNo;
+ // this.http.post("api/DeviceInfo/ConveyorLineHandTask" ,this.form)
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // ConveyorLineReset() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/ConveyorLineReset?DeviceChildCode=" + this.equipNo, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- ConveyorLineEmergencyStop() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/ConveyorLineEmergencyStop?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // ConveyorLineEmergencyStop() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/ConveyorLineEmergencyStop?DeviceChildCode=" + this.equipNo, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- ConveyorLineReturn() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/ConveyorLineReturn?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- ConveyorLineCancel() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/ConveyorLineCancel?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
- ConveyorLineInitialize() {
- this.fullscreenLoading = true;
- this.http.post("api/DeviceInfo/ConveyorLineInitialize?DeviceChildCode=" + this.equipNo, null, "")
- .then((x) => {
- if (!x.status) {
- this.$message.error(x.message);
- } else {
- this.$Message.success(x.message);
- }
- })
- .finally(() => {
- this.fullscreenLoading = false;
- });
- },
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // ConveyorLineReturn() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/ConveyorLineReturn?DeviceChildCode=" + this.equipNo, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // ConveyorLineCancel() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/ConveyorLineCancel?DeviceChildCode=" + this.equipNo, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
+ // ConveyorLineInitialize() {
+ // this.fullscreenLoading = true;
+ // this.http.post("api/DeviceInfo/ConveyorLineInitialize?DeviceChildCode=" + this.equipNo, null, "")
+ // .then((x) => {
+ // if (!x.status) {
+ // this.$message.error(x.message);
+ // } else {
+ // this.$Message.success(x.message);
+ // }
+ // })
+ // .finally(() => {
+ // this.fullscreenLoading = false;
+ // });
+ // },
update() {
- return !this.condition ? 'custom-img' : 'custom-img-color'
+ if (this.isAlarm) {
+ return 'custom-img-alarm';
+ } else if (this.lineItemInfo.inStock === '鏄�') {
+ return 'custom-img-color';
+ } else {
+ return 'custom-img';
+ }
},
startTimer() {
// 寮�鍚畾鏃跺櫒锛屾瘡3绉掓墽琛屼竴娆�
this.timer1 = setInterval(() => {
- update();
+ this.update();
}, 500);
},
},
@@ -284,13 +374,20 @@
.custom-img {
position: relative;
display: inline-block;
- /* background-color: #d9ecff ; */
}
.custom-img-color {
position: relative;
display: inline-block;
background-color: #05fa7f;
+ color: white;
+ text-align: center;
+}
+
+.custom-img-alarm {
+ position: relative;
+ display: inline-block;
+ background-color: #ff4d4f;
color: white;
text-align: center;
}
@@ -307,19 +404,107 @@
} */
.custom-img img {
- width: 40px;
- height: 40px;
+ width: 80px;
+ height: 50px;
}
.custom-img-color img {
- width: 40px;
- height: 40px;
+ width: 80px;
+ height: 50px;
+}
+
+.custom-img-alarm img {
+ width: 80px;
+ height: 50px;
}
.equip-no {
position: absolute;
- top: 15px;
- font-size: 12px;
- margin-left: -35px;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: 25px;
+ text-align: center;
+ width: 100%;
+}
+
+.modern-dialog {
+ border-radius: 16px !important;
+ overflow: hidden;
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
+}
+
+.modern-dialog .el-dialog__header {
+ display: none;
+}
+
+.modern-dialog .el-dialog__body {
+ padding: 0;
+ margin: 0;
+}
+
+.dialog-header {
+ background: linear-gradient(135deg, #409eff 0%, #67c23a 100%);
+ padding: 20px 24px;
+ text-align: center;
+}
+
+.dialog-title {
+ color: #fff;
+ font-size: 18px;
+ font-weight: 600;
+ margin: 0;
+ letter-spacing: 2px;
+}
+
+.dialog-content {
+ padding: 28px;
+ background: #f8fafc;
+ display: flex;
+ justify-content: center;
+}
+
+.info-list {
+ width: 100%;
+ max-width: 420px;
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+}
+
+.info-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 16px 20px;
+ background: #fff;
+ border-radius: 12px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
+ transition: all 0.3s ease;
+}
+
+.info-item:hover {
+ transform: translateX(4px);
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
+}
+
+.item-label {
+ font-size: 14px;
+ color: #6b7280;
+ font-weight: 500;
+ min-width: 80px;
+ text-align: left;
+}
+
+.item-value {
+ font-size: 15px;
+ color: #1f2937;
+ font-weight: 500;
+ text-align: right;
+ flex: 1;
+ margin-left: 20px;
+ word-break: break-all;
+ padding-left: 20px;
+ border-left: 1px solid #e5e7eb;
}
</style>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj"
index f7db65f..3d20eac 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj"
@@ -16,6 +16,10 @@
</ItemGroup>
<ItemGroup>
+ <Compile Remove="ConveyorLineJob\LineMonitoring.cs" />
+ </ItemGroup>
+
+ <ItemGroup>
<PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.13" />
<PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.9" />
</ItemGroup>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/ConveyorLineJob_YL1ndFloor.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/ConveyorLineJob_YL1ndFloor.cs"
index 41be831..91f2273 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/ConveyorLineJob_YL1ndFloor.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/ConveyorLineJob_YL1ndFloor.cs"
@@ -1,4 +1,5 @@
-锘縰sing Microsoft.AspNetCore.Components.Routing;
+锘縰sing HslCommunication.WebSocket;
+using Microsoft.AspNetCore.Components.Routing;
using Newtonsoft.Json;
using Quartz;
using System;
@@ -7,6 +8,7 @@
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
+using HslCommunication.WebSocket;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Communicator;
@@ -38,9 +40,10 @@
private readonly IRouterRepository _routerRepository;
private readonly IRouterService _routerService;
private readonly IRouterExtension _routerExtension;
+ private readonly WebSocketServer _webSocketServer;
private readonly List<Dt_WarehouseDevice> warehouseDevices;
- public ConveyorLineJob_YL1ndFloor(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension)
+ public ConveyorLineJob_YL1ndFloor(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension, WebSocketServer webSocketServer)
{
_cacheService = cacheService;
_taskService = taskService;
@@ -50,6 +53,7 @@
_routerRepository = routerRepository;
_routerService = routerService;
_routerExtension = routerExtension;
+ _webSocketServer = webSocketServer;
string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice));
if (!string.IsNullOrEmpty(warehouseDevicesStr))
@@ -71,13 +75,23 @@
//鑾峰彇鎵�鏈夊崗璁殑杈撻�佺嚎绔欏彴
List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList();
List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode);
+
+ // 鍒涘缓杈撻�佺嚎鏁版嵁瀵硅薄锛岀敤浜嶹ebSocket鍙戦��
+ var conveyorLineCPData = new Dictionary<string, object>();
+ conveyorLineCPData["璁惧缂栧彿"] = device.DeviceCode;
+ conveyorLineCPData["璁惧鍚嶇О"] = "鍘熸枡搴撲竴妤艰緭閫佺嚎";
+ conveyorLineCPData["ConveyorLineInfo"] = new Dictionary<string, Dictionary<string, object>>();
foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode)))
{
DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(WR_CLineYLDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
DeviceProDTO? deviceErrRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ErrorYLDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
+ R_ConveyorLineYLInfo conveyorLineInfoRead = new R_ConveyorLineYLInfo();
+ R_ErrorYLDB errorYLDB = new R_ErrorYLDB();
+ var simplifiedInfo = new Dictionary<string, object>();
if (deviceProRead != null)
{
- R_ConveyorLineYLInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineYLInfo>(deviceProRead.DeviceProAddress);
+ conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineYLInfo>(deviceProRead.DeviceProAddress);
+
if (conveyorLineInfoRead != null && item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && conveyorLineInfoRead.WR_ToHode <= 0 && conveyorLineInfoRead.WR_Request == 86 && !string.IsNullOrEmpty(conveyorLineInfoRead.WR_TMID)) //涓�妤兼潵鏂欑О閲嶇珯鍙板厑璁稿叆搴撶敵璇�
{
WebResponseContent content = _taskService.YLPurchaseBoxing(conveyorLineInfoRead.WR_TMID, weight: conveyorLineInfoRead.WR_Weight, thickness: conveyorLineInfoRead.WR_Height, wide: conveyorLineInfoRead.WR_Width);
@@ -222,10 +236,23 @@
WriteInfo(item.StationCode, $"浠诲姟鍙�:{task.TaskNum}锛孯IFD{task.RfidCode}涓�妤煎嚭搴撹嚦鑰佸巶鎴垮畬鎴�");
}
}
+ // 灏嗗綋鍓嶇珯鍙扮殑杈撻�佺嚎淇℃伅娣诲姞鍒版暟鎹璞★紝鍙寘鍚渶瑕佺殑瀛楁
+ if (conveyorLineInfoRead != null)
+ {
+ simplifiedInfo["LineCode"] = device.DeviceCode;
+ simplifiedInfo["TaskNum"] = conveyorLineInfoRead.WR_Task; // 浠诲姟鍙�
+ simplifiedInfo["RFID"] = conveyorLineInfoRead.WR_TMID;//RFID
+ simplifiedInfo["Width"] = conveyorLineInfoRead.WR_Width;//绾稿嵎骞呭
+ simplifiedInfo["Request"] = conveyorLineInfoRead.WR_Request;//鐢宠
+ simplifiedInfo["Reresult"] = conveyorLineInfoRead.WR_Reresult;//鐢宠鍙嶉
+ simplifiedInfo["HasGoods"] = conveyorLineInfoRead.WR_ToHode > 0; // 鏄惁鏈夎揣
+ ((Dictionary<string, Dictionary<string, object>>)conveyorLineCPData["ConveyorLineInfo"])[item.StationCode] = simplifiedInfo;
+ }
}
else if (deviceErrRead!=null)
{
- R_ErrorYLDB errorYLDB = device.Communicator.ReadCustomer<R_ErrorYLDB>(deviceErrRead.DeviceProAddress);
+
+ errorYLDB = device.Communicator.ReadCustomer<R_ErrorYLDB>(deviceErrRead.DeviceProAddress);
if (errorYLDB != null && errorYLDB.R_Error==2)
{
ErrorDeviceInfo? errorDeviceInfo = RoadwayError.Roadways.FirstOrDefault(x=>x.Code==item.StationCode);
@@ -242,12 +269,25 @@
RoadwayError.Roadways.Remove(deviceInfo);
}
}
+ if (errorYLDB != null)
+ {
+ simplifiedInfo["Error"] = errorYLDB.R_Error;
+ ((Dictionary<string, Dictionary<string, object>>)conveyorLineCPData["ConveyorLineInfo"])[item.StationCode] = simplifiedInfo;
+ }
}
else
{
WriteError(item.StationName, $"鏈壘鍒拌澶囧瓙缂栧彿{item.StationCode}鐨勫崗璁俊鎭�");
}
}
+
+ // 閫氳繃WebSocket鍙戦�佽緭閫佺嚎鏁版嵁鍒板墠绔�
+ // 搴忓垪鍖栨暟鎹�
+ string jsonData = JsonConvert.SerializeObject(conveyorLineCPData);
+ // 鍙戦�佹暟鎹埌鎵�鏈夊鎴风
+ _webSocketServer.PublishAllClientPayload(jsonData);
+ // 璁板綍鍙戦�佹棩蹇�
+ WriteInfo(device.DeviceCode, $"WebSocket鍙戦�佽緭閫佺嚎鏁版嵁锛歿jsonData}");
}
return Task.CompletedTask;
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC2.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC2.cs"
index 7d2d674..76f7d93 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC2.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC2.cs"
@@ -1,4 +1,6 @@
-锘縰sing Microsoft.AspNetCore.Components.Routing;
+锘縰sing HslCommunication.WebSocket;
+using Microsoft.AspNetCore.Components.Routing;
+using Newtonsoft.Json;
using Quartz;
using System;
using System.Collections.Generic;
@@ -7,25 +9,30 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Enums;
+using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_DTO.Equipment;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
+using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.Models;
+using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_QuartzJob.Service;
+using WIDESEAWCS_QuartzJob.StackerCrane;
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
-using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_Tasks;
-using WIDESEAWCS_Core;
-using SqlSugar.Extensions;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.StackerCrane;
+using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_DTO.TaskInfo;
+using WIDESEAWCS_Tasks.鍘熸枡搴�;
namespace WIDESEAWCS_Tasks
{
@@ -38,8 +45,9 @@
private readonly IRouterService _routerService;
private readonly IRouterRepository _routerRepository;
private readonly IStationMangerRepository _stationMangerRepository;
+ private WebSocketServer _webSocketServer;
- public StackerCraneJob_YLSC2(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository)
+ public StackerCraneJob_YLSC2(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, WebSocketServer webSocketServer)
{
_taskService = taskService;
_taskExecuteDetailService = taskExecuteDetailService;
@@ -47,6 +55,7 @@
_routerService = routerService;
_stationMangerRepository = stationMangerRepository;
_routerRepository = routerRepository;
+ _webSocketServer = webSocketServer;
}
public Task Execute(IJobExecutionContext context)
@@ -106,6 +115,63 @@
}
}
}
+ // 璁剧疆璁惧缂栧彿锛屽墠绔敤浜庤瘑鍒爢鍨涙満
+ YL_DB yL_DB = new YL_DB();
+ yL_DB.R_PP_Status = commonStackerCrane.DeviceCode;
+ // 璁剧疆鍫嗗灈鏈虹姸鎬�
+ yL_DB.YL_Status = commonStackerCrane.StackerCraneStatusValue switch
+ {
+ StackerCraneStatus.Fault => 0,
+ StackerCraneStatus.Normal => 1,
+ StackerCraneStatus.EmergencyStop => 2,
+ StackerCraneStatus.Unkonw => 3,
+ };
+ yL_DB.YL_AutoStatus = commonStackerCrane.StackerCraneAutoStatusValue switch
+ {
+ StackerCraneAutoStatus.SemiAutomatic => 1,
+ StackerCraneAutoStatus.Maintenance => 2,
+ StackerCraneAutoStatus.Automatic => 3,
+ StackerCraneAutoStatus.Manual => 4,
+ StackerCraneAutoStatus.Unkonw => 5,
+ };
+ yL_DB.YL_WorkStatus = commonStackerCrane.StackerCraneWorkStatusValue switch
+ {
+ StackerCraneWorkStatus.Standby => 1,
+ StackerCraneWorkStatus.PickUpCompleted => 2,
+ StackerCraneWorkStatus.PickUp => 3,
+ StackerCraneWorkStatus.Putting => 5,
+ StackerCraneWorkStatus.WorkCompleted => 9,
+ };
+ yL_DB.YL_TaskNum = commonStackerCrane.CurrentTaskNum;
+ yL_DB.YL_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType);
+ yL_DB.YL_Row = commonStackerCrane.Communicator.Read<short>("DB1000.46");
+ yL_DB.YL_Column = commonStackerCrane.Communicator.Read<short>("DB1000.48.0");
+ yL_DB.YL_Layer = commonStackerCrane.Communicator.Read<short>("DB1000.50.0");
+ // 璇诲彇鎶ヨ淇℃伅
+ short stackerError2 = commonStackerCrane.Communicator.Read<short>("DB1000.54.0");
+ yL_DB.StackerAlarm = stackerError2 == 0 ? "鏃�" : $"鎶ヨ浠g爜: {stackerError2}";
+ // 搴忓垪鍖栧苟鍙戦�佹暟鎹�
+ string ylDB = JsonConvert.SerializeObject(yL_DB);
+ _webSocketServer.PublishAllClientPayload(ylDB);
+
+ #region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
+
+ EquipmentDTO equipmentDTO = new EquipmentDTO();
+ object obj = new
+ {
+ commonStackerCrane.DeviceName,
+ commonStackerCrane.DeviceCode,
+ StackerCraneAutoStatus.Automatic,
+ StackerCraneStatus.Normal,
+ StackerCraneWorkStatus.Standby,
+ TaskNum = commonStackerCrane.CurrentTaskNum,
+ WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType),
+ StackerAlarm = commonStackerCrane.Communicator.Read<short>("DB1000.54.0"),
+ };
+ equipmentDTO.StackerDataJson = obj.Serialize();
+ _webSocketServer.PublishAllClientPayload(equipmentDTO.Serialize());
+
+ #endregion
}
}
catch (Exception ex)
@@ -151,7 +217,7 @@
return WebResponseContent.Instance.Error($"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
}
bool depth = false;
- if (task.Grade>0 && task.TaskType==TaskTypeEnum.PrintYLOutbound.ObjToInt())
+ if (task.Grade > 0 && task.TaskType==TaskTypeEnum.PrintYLOutbound.ObjToInt())
{
depth = true;
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs"
index eb621f9..9177082 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs"
@@ -1,4 +1,6 @@
-锘縰sing Microsoft.AspNetCore.Components.Routing;
+锘縰sing HslCommunication.WebSocket;
+using Microsoft.AspNetCore.Components.Routing;
+using Newtonsoft.Json;
using Quartz;
using System;
using System.Collections.Generic;
@@ -7,7 +9,10 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Enums;
+using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_DTO.Equipment;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
@@ -15,18 +20,20 @@
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.Models;
+using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_QuartzJob.Service;
+using WIDESEAWCS_QuartzJob.StackerCrane;
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
-using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_Tasks;
-using WIDESEAWCS_Core;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_Core.Helper;
using HslCommunication.WebSocket;
using WIDESEAWCS_DTO.Equipment;
using WIDESEAWCS_QuartzJob.StackerCrane;
+using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_DTO.TaskInfo;
+using WIDESEAWCS_Tasks.鍘熸枡搴�;
namespace WIDESEAWCS_Tasks
{
@@ -40,7 +47,7 @@
private readonly IRouterService _routerService;
private readonly IRouterRepository _routerRepository;
private readonly IStationMangerRepository _stationMangerRepository;
- private WebSocketServer _webSocketServer;
+ private readonly WebSocketServer _webSocketServer;
public StackerCraneJob_YLSC3(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository,WebSocketServer webSocketServer)
{
@@ -111,6 +118,44 @@
}
}
}
+ // 璁剧疆璁惧缂栧彿锛屽墠绔敤浜庤瘑鍒爢鍨涙満
+ YL_DB yL_DB = new YL_DB();
+ yL_DB.R_PP_Status = commonStackerCrane.DeviceCode;
+ // 璁剧疆鍫嗗灈鏈虹姸鎬�
+ yL_DB.YL_Status = commonStackerCrane.StackerCraneStatusValue switch
+ {
+ StackerCraneStatus.Fault => 0,
+ StackerCraneStatus.Normal => 1,
+ StackerCraneStatus.EmergencyStop => 2,
+ StackerCraneStatus.Unkonw => 3,
+ };
+ yL_DB.YL_AutoStatus = commonStackerCrane.StackerCraneAutoStatusValue switch
+ {
+ StackerCraneAutoStatus.SemiAutomatic => 1,
+ StackerCraneAutoStatus.Maintenance => 2,
+ StackerCraneAutoStatus.Automatic => 3,
+ StackerCraneAutoStatus.Manual => 4,
+ StackerCraneAutoStatus.Unkonw => 5,
+ };
+ yL_DB.YL_WorkStatus = commonStackerCrane.StackerCraneWorkStatusValue switch
+ {
+ StackerCraneWorkStatus.Standby => 1,
+ StackerCraneWorkStatus.PickUpCompleted => 2,
+ StackerCraneWorkStatus.PickUp => 3,
+ StackerCraneWorkStatus.Putting => 5,
+ StackerCraneWorkStatus.WorkCompleted => 9,
+ };
+ yL_DB.YL_TaskNum = commonStackerCrane.CurrentTaskNum;
+ yL_DB.YL_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType);
+ yL_DB.YL_Row = commonStackerCrane.Communicator.Read<short>("DB1000.46");
+ yL_DB.YL_Column = commonStackerCrane.Communicator.Read<short>("DB1000.48.0");
+ yL_DB.YL_Layer = commonStackerCrane.Communicator.Read<short>("DB1000.50.0");
+ // 璇诲彇鎶ヨ淇℃伅
+ short stackerError2 = commonStackerCrane.Communicator.Read<short>("DB1000.54.0");
+ yL_DB.StackerAlarm = stackerError2 == 0 ? "鏃�" : $"鎶ヨ浠g爜: {stackerError2}";
+ // 搴忓垪鍖栧苟鍙戦�佹暟鎹�
+ string ylDB = JsonConvert.SerializeObject(yL_DB);
+ _webSocketServer.PublishAllClientPayload(ylDB);
#region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
@@ -413,7 +458,7 @@
YLStackerCraneTaskCommand stackerCraneTaskCommand = new YLStackerCraneTaskCommand();
stackerCraneTaskCommand.PalletType = Convert.ToInt16(task.PalletType);
- if (task.TaskLength>=1160 && task.TaskLength<1630)
+ if (task.TaskLength>=1200 && task.TaskLength<1630)
{
stackerCraneTaskCommand.PalletType = 3;
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/YL_DB.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/YL_DB.cs"
new file mode 100644
index 0000000..f300224
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/YL_DB.cs"
@@ -0,0 +1,62 @@
+锘匡豢using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEAWCS_Tasks.鍘熸枡搴�
+{
+ public class YL_DB
+ {
+ /// <summary>
+ /// 璁惧缂栧彿锛屽墠绔敤浜庤瘑鍒爢鍨涙満
+ /// </summary>
+ public string R_PP_Status;
+
+ /// <summary>
+ /// 鍫嗗灈鏈虹姸鎬�
+ /// </summary>
+ public short YL_Status;
+
+ /// <summary>
+ /// 鍫嗗灈鏈烘墜鑷姩鐘舵��
+ /// </summary>
+ public short YL_AutoStatus;
+
+ /// <summary>
+ /// 褰撳墠姝e湪鎵ц鐨勪换鍔″彿
+ /// </summary>
+ public int YL_TaskNum;
+
+ /// <summary>
+ /// 鍫嗗灈鏈哄伐浣滅姸鎬�
+ /// </summary>
+ public short YL_WorkStatus;
+
+ /// <summary>
+ /// 浣滀笟绫诲瀷
+ /// </summary>
+ public short YL_WorkType;
+
+ /// <summary>
+ /// 褰撳墠鎺�
+ /// </summary>
+ public short YL_Row;
+
+ /// <summary>
+ /// 褰撳墠鍒�
+ /// </summary>
+ public short YL_Column;
+
+ /// <summary>
+ /// 褰撳墠灞�
+ /// </summary>
+ public short YL_Layer;
+
+ /// <summary>
+ /// 鎶ヨ淇℃伅
+ /// </summary>
+ public string StackerAlarm;
+ }
+}
+
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPD.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPD.cs"
index 8583fe5..b80f145 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPD.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPD.cs"
@@ -1,4 +1,4 @@
-锘縰sing Microsoft.AspNetCore.Components.Routing;
+using Microsoft.AspNetCore.Components.Routing;
using Newtonsoft.Json;
using Quartz;
using SqlSugar.Extensions;
@@ -20,6 +20,7 @@
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_Tasks.ConveyorLineJob;
+using HslCommunication.WebSocket;
using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
namespace WIDESEAWCS_Tasks
@@ -35,9 +36,10 @@
private readonly IRouterRepository _routerRepository;
private readonly IRouterService _routerService;
private readonly IRouterExtension _routerExtension;
+ private readonly WebSocketServer _webSocketServer;
private readonly List<Dt_WarehouseDevice> warehouseDevices;
- public ConveyorLineJob_CPD(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension)
+ public ConveyorLineJob_CPD(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension, WebSocketServer webSocketServer)
{
_cacheService = cacheService;
_taskService = taskService;
@@ -47,6 +49,7 @@
_routerRepository = routerRepository;
_routerService = routerService;
_routerExtension = routerExtension;
+ _webSocketServer = webSocketServer;
string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice));
if (!string.IsNullOrEmpty(warehouseDevicesStr))
@@ -67,117 +70,143 @@
if (flag && value != null)
{
OtherDevice device = (OtherDevice)value;
+ //鑾峰彇鎵�鏈夊崗璁殑杈撻�佺嚎绔欏彴
List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).Distinct().ToList();
List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode);
+
+ // 鍒涘缓杈撻�佺嚎鏁版嵁瀵硅薄锛岀敤浜嶹ebSocket鍙戦��
+ var conveyorLineCPData = new Dictionary<string, object>();
+ conveyorLineCPData["璁惧缂栧彿"] = device.DeviceCode;
+ conveyorLineCPData["璁惧鍚嶇О"] = "鎴愬搧搴撲竴妤艰緭閫佺嚎";
+ conveyorLineCPData["ConveyorLineCPInfo"] = new Dictionary<string, Dictionary<string, object>>();
foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode)))
{
DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineCPDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(W_ConveyorLineCPDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
- if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && deviceProRead != null && deviceProWrite != null)
+
+ // 鍏堣鍙栨墍鏈夌被鍨嬬珯鍙扮殑璁惧淇℃伅骞舵坊鍔犲埌WebSocket鏁版嵁涓�
+ if (deviceProRead != null)
{
- R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
- //鎴愬搧涓�妤煎叆搴撳彛鍐欏叆瀵瑰簲鍏ュ簱绔欏彴鍦板潃
- if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0)
- {
- Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.AGV_Finish.ObjToInt() && x.DeviceCode == device.DeviceCode);
- if (task != null)
- {
- //鍒嗛厤宸烽亾 瀛樺叆鎵樼洏鏁版嵁
- List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, task.Roadway, task.TaskType);
- Dt_Router? router = routers.FirstOrDefault();
- if (routers == null || routers.Count == 0 || router == null)
- {
- WriteError(item.StationName, $"鏈壘鍒板搴旇矾鐢变俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
- continue;
- }
- if (routers.Count > 1)
- {
- WriteError(item.StationName, $"璺敱淇℃伅閰嶇疆閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
- continue;
- }
- //鍐欏叆鍏ュ簱绾夸綋鍦板潃
- device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode);
- device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode);
- device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
- //鏇存柊浠诲姟淇℃伅
- task.CurrentAddress = item.StationCode;
- task.NextAddress = router.NextPosi;
- _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
- WriteInfo(item.StationName, $"浠诲姟鍙穥conveyorLineInfoRead.TaskNo}涓嬩竴姝�");
- }
- }
- else if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0)//涓�妤煎嚭搴撳彛鍒ゆ柇鐢熸垚AGV鍙栨枡浠诲姟
- {
- Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode);
- if (task != null)
- {
- //鍒嗛厤宸烽亾 瀛樺叆鎵樼洏鏁版嵁
- List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.NextAddress == x.StartPosi);
- Dt_Router router = routers.FirstOrDefault();
- if (router == null)
- {
- WriteError(item.StationName, $"浠诲姟鍙�:{task.TaskNum}鏈壘鍒拌矾鐢遍厤缃俊鎭�");
- return Task.CompletedTask;
- }
- //鏇存柊浠诲姟淇℃伅
- task.CurrentAddress = router.StartPosi;
- task.NextAddress = task.TargetAddress;
- task.DeviceCode = router.NextPosi;
- _taskService.UpdateTask(task, TaskStatusEnum.AGV_Execute);
- WriteInfo(item.StationName, $"浠诲姟鍙穥conveyorLineInfoRead.TaskNo}涓嬩竴姝�");
- }
- }
- }
- else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null)
- {
- //鍏ュ簱绔欏彴鍒嗛厤璐т綅鍑嗗鍫嗗灈鍏ュ簱
R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
- if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0)
+ // 鐒跺悗鏍规嵁涓嶅悓鐨勭珯鍙扮被鍨嬫墽琛屼笉鍚岀殑涓氬姟閫昏緫
+ if (conveyorLineInfoRead != null)
{
- Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode);
- if (task != null)
+ // 鎴愬搧涓�妤煎叆搴撳彛鍐欏叆瀵瑰簲鍏ュ簱绔欏彴鍦板潃
+ if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && deviceProRead != null && deviceProWrite != null)
{
- //鍒嗛厤璐т綅
- string? local = _taskService.RequestAssignLocation(task.TaskNum, task.Roadway);
- if (!string.IsNullOrEmpty(local))
+ if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0)
{
- task.CurrentAddress = item.StackerCraneStationCode;
- task.TargetAddress = local;
- task.NextAddress = local;
- task.DeviceCode = item.StackerCraneCode;
- _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute);
- WriteInfo(item.StationName, $"浠诲姟鍙�:{task.TaskNum}杩涜鍫嗗灈鏈哄叆搴�");
+ Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.AGV_Finish.ObjToInt() && x.DeviceCode == device.DeviceCode);
+ if (task != null)
+ {
+ //鍒嗛厤宸烽亾 瀛樺叆鎵樼洏鏁版嵁
+ List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, task.Roadway, task.TaskType);
+ Dt_Router? router = routers.FirstOrDefault();
+ if (routers == null || routers.Count == 0 || router == null)
+ {
+ WriteError(item.StationName, $"鏈壘鍒板搴旇矾鐢变俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
+ continue;
+ }
+ if (routers.Count > 1)
+ {
+ WriteError(item.StationName, $"璺敱淇℃伅閰嶇疆閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
+ continue;
+ }
+ //鍐欏叆鍏ュ簱绾夸綋鍦板潃
+ device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode);
+ device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode);
+ device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
+ //鏇存柊浠诲姟淇℃伅
+ task.CurrentAddress = item.StationCode;
+ task.NextAddress = router.NextPosi;
+ _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
+ WriteInfo(item.StationName, $"浠诲姟鍙穥conveyorLineInfoRead.TaskNo}涓嬩竴姝�");
+ }
+ }
+ // 涓�妤煎嚭搴撳彛鍒ゆ柇鐢熸垚AGV鍙栨枡浠诲姟
+ else if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0)//涓�妤煎嚭搴撳彛鍒ゆ柇鐢熸垚AGV鍙栨枡浠诲姟
+ {
+ Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode);
+ if (task != null)
+ {
+ //鍒嗛厤宸烽亾 瀛樺叆鎵樼洏鏁版嵁
+ List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.NextAddress == x.StartPosi);
+ Dt_Router router = routers.FirstOrDefault();
+ if (router == null)
+ {
+ WriteError(item.StationName, $"浠诲姟鍙�:{task.TaskNum}鏈壘鍒拌矾鐢遍厤缃俊鎭�");
+ return Task.CompletedTask;
+ }
+ //鏇存柊浠诲姟淇℃伅
+ task.CurrentAddress = router.StartPosi;
+ task.NextAddress = task.TargetAddress;
+ task.DeviceCode = router.NextPosi;
+ _taskService.UpdateTask(task, TaskStatusEnum.AGV_Execute);
+ WriteInfo(item.StationName, $"浠诲姟鍙穥conveyorLineInfoRead.TaskNo}涓嬩竴姝�");
+ }
}
}
- }
- }
- else if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && deviceProRead != null && deviceProWrite != null)
- {
- //鍑哄簱绔欏彴鍒嗛厤鍑哄簱瀵瑰簲鐩爣鍑哄簱鍙e湴鍧�
- R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
-
- if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0)
- {
- //鑾峰彇鍑哄簱绔欏彴鏄惁瀛樺湪鍑哄簱寰呮墽琛屼换鍔�
- Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType)
- && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == device.DeviceCode);
- if (task != null)
+ // 鍏ュ簱绔欏彴鍒嗛厤璐т綅鍑嗗鍫嗗灈鍏ュ簱
+ else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null)
{
- //鑾峰彇璺敱閰嶇疆
- List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.CurrentAddress == x.StartPosi);
- Dt_Router router = routers.FirstOrDefault();
- if (router == null)
+ if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0)
{
- WriteError(item.StationName, $"浠诲姟鍙�:{task.TaskNum}鏈壘鍒拌矾鐢遍厤缃俊鎭�");
- return Task.CompletedTask;
+ Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode);
+ if (task != null)
+ {
+ //鍒嗛厤璐т綅
+ string? local = _taskService.RequestAssignLocation(task.TaskNum, task.Roadway);
+ if (!string.IsNullOrEmpty(local))
+ {
+ task.CurrentAddress = item.StackerCraneStationCode;
+ task.TargetAddress = local;
+ task.NextAddress = local;
+ task.DeviceCode = item.StackerCraneCode;
+ _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute);
+ WriteInfo(item.StationName, $"浠诲姟鍙�:{task.TaskNum}杩涜鍫嗗灈鏈哄叆搴�");
+ }
+ }
}
- //鍐欏叆鍑哄簱绾夸綋鍦板潃
- device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode);
- device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode);
- device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
- _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
- WriteInfo(item.StationName, $"浠诲姟鍙�:{task.TaskNum}杩涜绾夸綋鍑哄簱");
+ }
+ else if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && deviceProRead != null && deviceProWrite != null)
+ {
+ //鍑哄簱绔欏彴鍒嗛厤鍑哄簱瀵瑰簲鐩爣鍑哄簱鍙e湴鍧�
+ if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0)
+ {
+ //鑾峰彇鍑哄簱绔欏彴鏄惁瀛樺湪鍑哄簱寰呮墽琛屼换鍔�
+ Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType)
+ && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == device.DeviceCode);
+ if (task != null)
+ {
+ //鑾峰彇璺敱閰嶇疆
+ List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.CurrentAddress == x.StartPosi);
+ Dt_Router router = routers.FirstOrDefault();
+ if (router == null)
+ {
+ WriteError(item.StationName, $"浠诲姟鍙�:{task.TaskNum}鏈壘鍒拌矾鐢遍厤缃俊鎭�");
+ return Task.CompletedTask;
+ }
+ //鍐欏叆鍑哄簱绾夸綋鍦板潃
+ device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode);
+ device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode);
+ device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
+ _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
+ WriteInfo(item.StationName, $"浠诲姟鍙�:{task.TaskNum}杩涜绾夸綋鍑哄簱");
+ }
+ }
+ }
+ // 灏嗗綋鍓嶇珯鍙扮殑杈撻�佺嚎淇℃伅娣诲姞鍒版暟鎹璞★紝鍙寘鍚渶瑕佺殑瀛楁
+ if (conveyorLineInfoRead != null)
+ {
+ var simplifiedInfo = new Dictionary<string, object>();
+ simplifiedInfo["LineCode"] = device.DeviceCode;
+ simplifiedInfo["TaskNum"] = conveyorLineInfoRead.TaskNo; // 浠诲姟鍙�
+ simplifiedInfo["PalletCode"] = conveyorLineInfoRead.PalletCode;// 鎵樼洏鏉$爜
+ simplifiedInfo["HasGoods"] = conveyorLineInfoRead.TaskNo > 0; // 鏄惁鏈夎揣
+ simplifiedInfo["Status"] = conveyorLineInfoRead.StatusPV;// 鐘舵��
+ simplifiedInfo["Command"] = conveyorLineInfoRead.Command; // 鍛戒护
+ ((Dictionary<string, Dictionary<string, object>>)conveyorLineCPData["ConveyorLineCPInfo"])[item.StationCode] = simplifiedInfo;
}
}
}
@@ -186,6 +215,13 @@
WriteError(item.StationName, $"鏈壘鍒拌澶囧瓙缂栧彿{item.StationCode}鐨勫崗璁俊鎭�");
}
}
+ // 閫氳繃WebSocket鍙戦�佽緭閫佺嚎鏁版嵁鍒板墠绔�
+ // 搴忓垪鍖栨暟鎹�
+ string jsonData = JsonConvert.SerializeObject(conveyorLineCPData);
+ // 鍙戦�佹暟鎹埌鎵�鏈夊鎴风
+ _webSocketServer.PublishAllClientPayload(jsonData);
+ // 璁板綍鍙戦�佹棩蹇�
+ WriteInfo(device.DeviceCode, $"WebSocket鍙戦�佽緭閫佺嚎鏁版嵁锛歿jsonData}");
}
}
catch (Exception ex)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/StackerCraneJob_CP.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/StackerCraneJob_CP.cs"
index f7a83e6..0171d3c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/StackerCraneJob_CP.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/StackerCraneJob_CP.cs"
@@ -1,5 +1,8 @@
-锘縰sing Microsoft.AspNetCore.Components.Routing;
+锘縰sing HslCommunication.WebSocket;
+using Microsoft.AspNetCore.Components.Routing;
+using Newtonsoft.Json;
using Quartz;
+using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@@ -7,6 +10,7 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
@@ -15,15 +19,14 @@
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.Models;
-using WIDESEAWCS_QuartzJob.Service;
-using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
-using WIDESEAWCS_Tasks.StackerCraneJob;
-using WIDESEAWCS_Tasks;
-using WIDESEAWCS_Core;
-using SqlSugar.Extensions;
-using WIDESEAWCS_Tasks.ConveyorLineJob;
using WIDESEAWCS_QuartzJob.Repository;
+using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_QuartzJob.StackerCrane;
+using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
+using WIDESEAWCS_Tasks;
+using WIDESEAWCS_Tasks.ConveyorLineJob;
+using WIDESEAWCS_Tasks.StackerCraneJob;
+using WIDESEAWCS_Tasks.鍘熸枡搴�;
namespace WIDESEAWCS_Tasks
{
@@ -36,8 +39,9 @@
private readonly IRouterService _routerService;
private readonly IRouterRepository _routerRepository;
private readonly IStationMangerRepository _stationMangerRepository;
+ private readonly WebSocketServer _webSocketServer;
- public StackerCraneJob_CP(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository,IRouterRepository routerRepository)
+ public StackerCraneJob_CP(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository,IRouterRepository routerRepository, WebSocketServer webSocketServer)
{
_taskService = taskService;
_taskExecuteDetailService = taskExecuteDetailService;
@@ -45,6 +49,7 @@
_routerService = routerService;
_stationMangerRepository = stationMangerRepository;
_routerRepository = routerRepository;
+ _webSocketServer = webSocketServer;
}
public Task Execute(IJobExecutionContext context)
@@ -90,6 +95,44 @@
}
}
}
+ // 璁剧疆璁惧缂栧彿锛屽墠绔敤浜庤瘑鍒爢鍨涙満
+ YL_DB yL_DB = new YL_DB();
+ yL_DB.R_PP_Status = commonStackerCrane.DeviceCode;
+ // 璁剧疆鍫嗗灈鏈虹姸鎬�
+ yL_DB.YL_Status = commonStackerCrane.StackerCraneStatusValue switch
+ {
+ StackerCraneStatus.Fault => 0,
+ StackerCraneStatus.Normal => 1,
+ StackerCraneStatus.EmergencyStop => 2,
+ StackerCraneStatus.Unkonw => 3,
+ };
+ yL_DB.YL_AutoStatus = commonStackerCrane.StackerCraneAutoStatusValue switch
+ {
+ StackerCraneAutoStatus.SemiAutomatic => 1,
+ StackerCraneAutoStatus.Maintenance => 2,
+ StackerCraneAutoStatus.Automatic => 3,
+ StackerCraneAutoStatus.Manual => 4,
+ StackerCraneAutoStatus.Unkonw => 5,
+ };
+ yL_DB.YL_WorkStatus = commonStackerCrane.StackerCraneWorkStatusValue switch
+ {
+ StackerCraneWorkStatus.Standby => 1,
+ StackerCraneWorkStatus.PickUpCompleted => 2,
+ StackerCraneWorkStatus.PickUp => 3,
+ StackerCraneWorkStatus.Putting => 5,
+ StackerCraneWorkStatus.WorkCompleted => 9,
+ };
+ yL_DB.YL_TaskNum = commonStackerCrane.CurrentTaskNum;
+ yL_DB.YL_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType);
+ yL_DB.YL_Row = commonStackerCrane.Communicator.Read<short>("DB1000.46");
+ yL_DB.YL_Column = commonStackerCrane.Communicator.Read<short>("DB1000.48.0");
+ yL_DB.YL_Layer = commonStackerCrane.Communicator.Read<short>("DB1000.50.0");
+ // 璇诲彇鎶ヨ淇℃伅
+ short stackerError2 = commonStackerCrane.Communicator.Read<short>("DB1000.54.0");
+ yL_DB.StackerAlarm = stackerError2 == 0 ? "鏃�" : $"鎶ヨ浠g爜: {stackerError2}";
+ // 搴忓垪鍖栧苟鍙戦�佹暟鎹�
+ string ylDB = JsonConvert.SerializeObject(yL_DB);
+ _webSocketServer.PublishAllClientPayload(ylDB);
}
}
catch (Exception ex)
--
Gitblit v1.9.3