liulijun
16 小时以前 5270308151082506e0e6df2c72d278d2976ec860
WCS设备监控

WCS设备监控
已添加2个文件
已修改13个文件
4430 ■■■■ 文件已修改
项目代码/WCS/WCSClient/babel.config.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSClient/src/uitils/websocket.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSClient/src/views/Home.vue 1628 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSClient/src/views/Index.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSClient/src/views/LineComponent.vue 693 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSClient/src/views/LineComponentCP.vue 474 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSClient/src/views/LineInfo.vue 629 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSClient/src/views/LineInfocopy.vue 585 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/原料库/ConveyorLineJob_YL1ndFloor.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/原料库/StackerCraneJob_YLSC2.cs 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/原料库/StackerCraneJob_YLSC3.cs 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/原料库/YL_DB.cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/ConveyorLineJob_CPD.cs 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/StackerCraneJob_CP.cs 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WCS/WCSClient/babel.config.js
@@ -1,5 +1,8 @@
module.exports = {
  presets: [
    '@vue/cli-plugin-babel/preset'
  ],
  plugins: [
    '@babel/plugin-transform-optional-chaining'
  ]
}
ÏîÄ¿´úÂë/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
  };
};
ÏîÄ¿´úÂë/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,369 +114,809 @@
            <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>
            </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,
                },
@@ -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",
                };
                // å…ˆæ”¶é›†æ‰€æœ‰Error信息
                    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;
                    // éåŽ†æ‰€æœ‰linescopy数组,查找对应的站台
                    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 = "正常";
                                        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 = "正常";
                                    } 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",
                            };
                            // éåŽ†æ‰€æœ‰linescopy数组,查找对应的站台
                            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 = "正常";
                                                                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 = "正常";
                                                                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('输送线数据解析失败', 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('消息解析失败', 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>
}
</style>
ÏîÄ¿´úÂë/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;
ÏîÄ¿´úÂë/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>
    </template>
    <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>
@@ -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: "",
      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个el-col显示90,第90个el-col显示1
      // å½“前列号为currentColumn,对应的索引为 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();
      // å½“StackerAlarm字段的值不为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("成功.");
    // 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;
        });
    },
    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;
        });
    }
    //       }
    //     })
    //     .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;
}
.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>
ÏîÄ¿´úÂë/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)
      // æ¯åˆ—宽度计算:line-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();
      // å½“StackerAlarm字段的值不为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>
ÏîÄ¿´úÂë/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="报警代码:">
                        <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>
        </template>
        <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>
        </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中已经计算好的isAlarm值,或者根据状态判断
                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];
                // å¤åˆ¶æ•°æ®åˆ°ConveyorLineInfo(模板中绑定的对象)
                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>
ÏîÄ¿´úÂë/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="报警代码:">
                        <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>
        </template>
        <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>
        </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: {
@@ -140,10 +90,22 @@
            left: "500px",
            top: "400px",
            dialogVisible: false,
                fullscreenLoading: false,
                isAlarm: false,
            lineItemInfo: {
                inStock: "",
                taskNum: "",
                alarm: "",
                    rfid: "",
                    width: "",
                    request: "",
                    reresult: "",
                    error: "",
                },
                // ç”³è¯·åé¦ˆçŠ¶æ€è·Ÿè¸ª
                feedbackTracking: {
                    currentTaskNum: "", // å½“前任务号
                    hasFeedback: false, // æ˜¯å¦å·²åé¦ˆè¿‡
                    lastFeedbackValue: "" // ä¸Šæ¬¡åé¦ˆçš„值
            },
            form: {
                TaskType: "",
@@ -153,127 +115,255 @@
        };
    },
    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 = '已反馈';
                }
                // å¤åˆ¶æ•°æ®åˆ°lineItemInfo(模板中绑定的对象)
                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>
ÏîÄ¿´úÂë/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>
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/Ô­ÁÏ¿â/ConveyorLineJob_YL1ndFloor.cs
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components.Routing;
using 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);
                // åˆ›å»ºè¾“送线数据对象,用于WebSocket发送
                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},RIFD{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;
        }
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/Ô­ÁÏ¿â/StackerCraneJob_YLSC2.cs
@@ -1,4 +1,6 @@
using Microsoft.AspNetCore.Components.Routing;
using 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 ? "无" : $"报警代码: {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)
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/Ô­ÁÏ¿â/StackerCraneJob_YLSC3.cs
@@ -1,4 +1,6 @@
using Microsoft.AspNetCore.Components.Routing;
using 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 ? "无" : $"报警代码: {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;
            }
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/Ô­ÁÏ¿â/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>
        /// å½“前正在执行的任务号
        /// </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;
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/³ÉÆ·²Ö/ConveyorLineJob_CPD.cs
@@ -1,4 +1,4 @@
using 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,16 +70,31 @@
                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);
                    // åˆ›å»ºè¾“送线数据对象,用于WebSocket发送
                    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)
                            {
                            //成品一楼入库口写入对应入库站台地址
                                if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && deviceProRead != null && deviceProWrite != null)
                                {
                            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);
@@ -106,6 +124,7 @@
                                    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);
@@ -128,11 +147,9 @@
                                }
                            }
                        }
                                // å…¥åº“站台分配货位准备堆垛入库
                        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)
                            {
                                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);
@@ -155,8 +172,6 @@
                        else if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && deviceProRead != null && deviceProWrite != null)
                        {
                            //出库站台分配出库对应目标出库口地址
                            R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
                            if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0)
                            {
                                //获取出库站台是否存在出库待执行任务
@@ -181,11 +196,32 @@
                                }
                            }
                        }
                                // å°†å½“前站台的输送线信息添加到数据对象,只包含需要的字段
                                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;
                                }
                            }
                        }
                        else
                        {
                            WriteError(item.StationName, $"未找到设备子编号{item.StationCode}的协议信息");
                        }
                    }
                    // é€šè¿‡WebSocket发送输送线数据到前端
                    // åºåˆ—化数据
                    string jsonData = JsonConvert.SerializeObject(conveyorLineCPData);
                    // å‘送数据到所有客户端
                    _webSocketServer.PublishAllClientPayload(jsonData);
                    // è®°å½•发送日志
                    WriteInfo(device.DeviceCode, $"WebSocket发送输送线数据:{jsonData}");
                }
            }
            catch (Exception ex)
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/³ÉÆ·²Ö/StackerCraneJob_CP.cs
@@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Components.Routing;
using 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 ? "无" : $"报警代码: {stackerError2}";
                    // åºåˆ—化并发送数据
                    string ylDB = JsonConvert.SerializeObject(yL_DB);
                    _webSocketServer.PublishAllClientPayload(ylDB);
                }
            }
            catch (Exception ex)