| | |
| | | module.exports = { |
| | | presets: [ |
| | | '@vue/cli-plugin-babel/preset' |
| | | ], |
| | | plugins: [ |
| | | '@babel/plugin-transform-optional-chaining' |
| | | ] |
| | | } |
| | |
| | | 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, |
| | |
| | | |
| | | // äºä»¶çå¬ |
| | | const connect = () => { |
| | | // å建æ°çWebSocketå®ä¾ï¼ä½¿ç¨é
ç½®æä»¶ä¸é
ç½®çç«¯å£ |
| | | ws = new WebSocket("ws://localhost:9260/", protocols); |
| | | ws.onopen = () => { |
| | | status.isConnected = true; |
| | | console.log('WebSocket è¿æ¥æå'); |
| | |
| | | |
| | | // åéæ¶æ¯æ¹æ³ |
| | | const send = (data) => { |
| | | if (status.isConnected) { |
| | | if (status.isConnected && ws) { |
| | | ws.send(JSON.stringify(data)); |
| | | } |
| | | }; |
| | |
| | | messages, |
| | | status, |
| | | send, |
| | | close: () => ws.close() |
| | | close: () => ws && ws.close(), |
| | | reconnect: connect |
| | | }; |
| | | }; |
| | |
| | | <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"> |
| | |
| | | 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" |
| | |
| | | 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" |
| | |
| | | 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" |
| | |
| | | :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" |
| | |
| | | :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" |
| | |
| | | <el-col :span="8"> |
| | | <!-- å åæº --> |
| | | <div style="position: relative; top: 50px;"> |
| | | <!-- <div style="margin-top: 33px;"></div> --> |
| | | <div class="stackerDiv"> |
| | | <div class="stackDivName">ä¸å·å åæº</div> |
| | | <LineComponent :x="xValue1" ref="stacker1" :equipNo="SC01"></LineComponent> |
| | | <div class="stackDivName" style="text-align: left;">äºå·å åæº</div> |
| | | <LineComponent :x="xValue1" ref="stacker5" :equipNo="SC05"></LineComponent> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <div class="stackerDiv"> |
| | | <div class="stackDivName">äºå·å åæº</div> |
| | | <LineComponent :x="xValue2" ref="stacker2" :equipNo="SC02"></LineComponent> |
| | | <div class="stackDivName" style="text-align: left;">åå·å åæº</div> |
| | | <LineComponent :x="xValue2" ref="stacker4" :equipNo="SC04"></LineComponent> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <!-- <div style="margin-top: 85px;"></div> --> |
| | | <div class="stackerDiv"> |
| | | <div class="stackDivName">ä¸å·å åæº</div> |
| | | <div class="stackDivName" style="text-align: left;">ä¸å·å åæº</div> |
| | | <LineComponent :x="xValue3" ref="stacker3" :equipNo="SC03"></LineComponent> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <!-- <div style="margin-top: 55px;"></div> --> |
| | | <div class="stackerDiv"> |
| | | <div class="stackDivName">åå·å åæº</div> |
| | | <LineComponent :x="xValue4" ref="stacker4" :equipNo="SC04"></LineComponent> |
| | | <div class="stackDivName" style="text-align: left;">äºå·å åæº</div> |
| | | <LineComponent :x="xValue4" ref="stacker2" :equipNo="SC02"></LineComponent> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <!-- <div style="margin-top: 35px;"></div> --> |
| | | <div class="stackerDiv"> |
| | | <div class="stackDivName">äºå·å åæº</div> |
| | | <LineComponent :x="xValue5" ref="stacker5" :equipNo="SC05"></LineComponent> |
| | | <div class="stackDivName" style="text-align: left;">ä¸å·å åæº</div> |
| | | <LineComponent :x="xValue5" ref="stacker1" :equipNo="SC01"></LineComponent> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <div class="stackerDiv"> |
| | | <div class="stackDivName">å
å·å åæº</div> |
| | | <LineComponent :x="xValue6" ref="stacker6" :equipNo="SC06"></LineComponent> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <el-row :gutter="0" style="width:400px;"> |
| | | <el-col :span="16"> |
| | | <span style="position: absolute; top: 10px; left: 30px;"> |
| | | <h2>䏿¥¼æååºè®¾å¤çæ§</h2> |
| | | </span> |
| | | <el-row :gutter="20" style="height:1000px; width:100%;"> |
| | | <el-col :span="24"> |
| | | <div> |
| | | <div v-for="(group, index) in groupedLines(linescopyCP1)" :key="index"> |
| | | <div class="positionY-group"> |
| | | <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex" |
| | | :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" |
| | | :positionY="line.positionY" :condition="line.condition" |
| | | url="api/Equipment/GetLineInfoByNo" /> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top: 20px;"></div> |
| | | <div v-for="(group, index) in groupedLines(linescopyCP2)" :key="index"> |
| | | <div class="positionY-group"> |
| | | <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex" |
| | | :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" |
| | | :positionY="line.positionY" :condition="line.condition" |
| | | url="api/Equipment/GetLineInfoByNo" /> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top:40px;"></div> |
| | | <div v-for="(group, index) in groupedLines(linescopyCP3)" :key="index"> |
| | | <div class="positionY-group"> |
| | | <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex" |
| | | :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" |
| | | :positionY="line.positionY" :condition="line.condition" |
| | | url="api/Equipment/GetLineInfoByNo" /> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top: 20px;"></div> |
| | | <div v-for="(group, index) in groupedLines(linescopyCP4)" :key="index"> |
| | | <div class="positionY-group"> |
| | | <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex" |
| | | :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" |
| | | :positionY="line.positionY" :condition="line.condition" /> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top: 50px;"></div> |
| | | <div v-for="(group, index) in groupedLines(linescopyCP5)" :key="index"> |
| | | <div class="positionY-group"> |
| | | <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex" |
| | | :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" |
| | | :positionY="line.positionY" :condition="line.condition" /> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top: 30px;"></div> |
| | | <div v-for="(group, index) in groupedLines(linescopyCP6)" :key="index"> |
| | | <div class="positionY-group"> |
| | | <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex" |
| | | :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" |
| | | :positionY="line.positionY" :condition="line.condition" /> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top: 50px;"></div> |
| | | <div v-for="(group, index) in groupedLines(linescopyCP7)" :key="index"> |
| | | <div class="positionY-group"> |
| | | <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex" |
| | | :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" |
| | | :positionY="line.positionY" :condition="line.condition" /> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top: 30px;"></div> |
| | | <div v-for="(group, index) in groupedLines(linescopyCP8)" :key="index"> |
| | | <div class="positionY-group"> |
| | | <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex" |
| | | :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" |
| | | :positionY="line.positionY" :condition="line.condition" /> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top: 50px;"></div> |
| | | <div v-for="(group, index) in groupedLines(linescopyCP9)" :key="index"> |
| | | <div class="positionY-group"> |
| | | <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex" |
| | | :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" |
| | | :positionY="line.positionY" :condition="line.condition" /> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top: 30px;"></div> |
| | | <div v-for="(group, index) in groupedLines(linescopyCP10)" :key="index"> |
| | | <div class="positionY-group"> |
| | | <LineInfo v-for="(line, lineIndex) in group.lines" :key="lineIndex" |
| | | :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" |
| | | :positionY="line.positionY" :condition="line.condition" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <!-- å åæº --> |
| | | <div style="position: relative; top: 50px;"> |
| | | <!-- <div style="margin-top: 33px;"></div> --> |
| | | <div class="stackerDivCP"> |
| | | <div class="stackDivName" style="text-align: left;">äºå·å åæº</div> |
| | | <LineComponentCP :x="xValue1" ref="stackerCP5" :equipNo="SC05CP"></LineComponentCP> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <div class="stackerDivCP"> |
| | | <div class="stackDivName" style="text-align: left;">åå·å åæº</div> |
| | | <LineComponentCP :x="xValue2" ref="stackerCP4" :equipNo="SC04CP"></LineComponentCP> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <!-- <div style="margin-top: 85px;"></div> --> |
| | | <div class="stackerDivCP"> |
| | | <div class="stackDivName" style="text-align: left;">ä¸å·å åæº</div> |
| | | <LineComponentCP :x="xValue3" ref="stackerCP3" :equipNo="SC03CP"></LineComponentCP> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <!-- <div style="margin-top: 55px;"></div> --> |
| | | <div class="stackerDivCP"> |
| | | <div class="stackDivName" style="text-align: left;">äºå·å åæº</div> |
| | | <LineComponentCP :x="xValue4" ref="stackerCP2" :equipNo="SC02CP"></LineComponentCP> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <!-- <div style="margin-top: 35px;"></div> --> |
| | | <div class="stackerDivCP"> |
| | | <div class="stackDivName" style="text-align: left;">ä¸å·å åæº</div> |
| | | <LineComponentCP :x="xValue5" ref="stackerCP1" :equipNo="SC01CP"></LineComponentCP> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | |
| | | |
| | | <script> |
| | | import { onMounted, ref, reactive } from "vue"; |
| | | import LineInfo from "./LineInfo.vue"; |
| | | import LineInfoCopy from "./LineInfocopy.vue"; |
| | | import LineComponent from './LineComponent.vue'; |
| | | import LineComponentCP from './LineComponentCP.vue'; |
| | | import JElDescription from "./JElDescription"; |
| | | import { useWebSocket } from '@/uitils/websocket'; |
| | | |
| | | |
| | | export default { |
| | | setup() { |
| | | // 使ç¨ä¿®å¤åçWebSocketé©å彿° |
| | | const { ws, messages, status, send, reconnect } = useWebSocket(); |
| | | |
| | | return { |
| | | ws, |
| | | messages, |
| | | status, |
| | | send, |
| | | reconnect |
| | | }; |
| | | }, |
| | | data() { |
| | | return { |
| | | ws: null, // WebSocketå®ä¾ |
| | | messages: [], // æ¶æ¯å表 |
| | | status: { // è¿æ¥ç¶æ |
| | | isConnected: false, |
| | | error: null |
| | | }, |
| | | // å åæºè®¾å¤ç¼å·é
ç½® |
| | | SC01: "SC01_YL", |
| | | SC02: "SC02_YL", |
| | | SC03: "SC03_YLDual", |
| | | SC04: "SC04_YLDual", |
| | | SC05: "SC05_YLDual", |
| | | SC01CP: "SC01_CP", |
| | | SC02CP: "SC02_CP", |
| | | SC03CP: "SC03_CP", |
| | | SC04CP: "SC04_CP", |
| | | SC05CP: "SC05_CP", |
| | | linescopy1: [ |
| | | // { |
| | | // equipNo: "101", |
| | | // imgType: "1", |
| | | // positionX: 0, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "102", |
| | | // imgType: "1", |
| | | // positionX: 0, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "103", |
| | | // imgType: "1", |
| | | // positionX: 0, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "109", |
| | | // imgType: "1", |
| | | // positionX: 0.5, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "200", |
| | | // imgType: "1", |
| | | // positionX: 1, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "202", |
| | | // imgType: "1", |
| | | // positionX: 1, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "204", |
| | | // imgType: "1", |
| | | // positionX: 1, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "206", |
| | | // imgType: "1", |
| | | // positionX: 1, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "208", |
| | | // imgType: "1", |
| | | // positionX: 1, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "210", |
| | | // imgType: "1", |
| | | // positionX: 1, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "212", |
| | | // imgType: "1", |
| | | // positionX: 1, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "302", |
| | | // imgType: "1", |
| | | // positionX: 1, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "304", |
| | | // imgType: "1", |
| | | // positionX: 1, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "306", |
| | | // imgType: "1", |
| | | // positionX: 1, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "309", |
| | | // imgType: "1", |
| | | // positionX: 1.5, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "310", |
| | | // imgType: "1", |
| | | // positionX: 2, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "313", |
| | | // imgType: "1", |
| | | // positionX: 2.5, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "314", |
| | | // imgType: "1", |
| | | // positionX: 3, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | { |
| | | equipNo: "1005", |
| | | equipNo: "320", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1006", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | |
| | | { |
| | | equipNo: "1007", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1008", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | //positionX: 3, |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | } |
| | | ], |
| | | linescopy2: [ |
| | | // { |
| | | // equipNo: "104", |
| | | // imgType: "1", |
| | | // positionX: 0, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "106", |
| | | // imgType: "1", |
| | | // positionX: 0, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "108", |
| | | // imgType: "1", |
| | | // positionX: 0, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "200.1", |
| | | // imgType: "1", |
| | | // positionX: 2.325, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "201", |
| | | // imgType: "1", |
| | | // positionX: 2.325, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "203", |
| | | // imgType: "1", |
| | | // positionX: 2.325, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "205", |
| | | // imgType: "1", |
| | | // positionX: 2.325, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "207", |
| | | // imgType: "1", |
| | | // positionX: 2.325, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "209", |
| | | // imgType: "1", |
| | | // positionX: 2.325, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "211", |
| | | // imgType: "1", |
| | | // positionX: 2.325, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "301", |
| | | // imgType: "1", |
| | | // positionX: 2.325, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "303", |
| | | // imgType: "1", |
| | | // positionX: 2.325, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "305", |
| | | // imgType: "1", |
| | | // positionX: 2.325, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "311", |
| | | // imgType: "1", |
| | | // positionX: 4.65, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "315", |
| | | // imgType: "1", |
| | | // positionX: 6.975, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | { |
| | | equipNo: "1009", |
| | | equipNo: "321", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1010", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | |
| | | { |
| | | equipNo: "1011", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1025", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 21, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1012", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | //positionX: 6.975, |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | } |
| | | ], |
| | | linescopy3: [ |
| | | // { |
| | | // equipNo: "309.1", |
| | | // imgType: "1", |
| | | // positionX: 20.175, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "312", |
| | | // imgType: "1", |
| | | // positionX: 20.65, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "316", |
| | | // imgType: "1", |
| | | // positionX: 25.65, |
| | | // positionY: 0, |
| | | // condition: false, |
| | | // }, |
| | | { |
| | | equipNo: "1017", |
| | | equipNo: "322", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1018", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | |
| | | { |
| | | equipNo: "1019", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1026", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 21, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1020", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | //positionX: 25.65, |
| | | positionX: 0, |
| | | positionY: 0, |
| | | condition: false, |
| | | } |
| | | ], |
| | | linescopy4: [ |
| | | // { |
| | | // equipNo: "413", |
| | | // imgType: "1", |
| | | // positionX: 22, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "317", |
| | | // imgType: "1", |
| | | // positionX: 25.65, |
| | | // positionY: 0, |
| | | // condition: false, |
| | | // }, |
| | | { |
| | | equipNo: "1021", |
| | | equipNo: "323", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1022", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | |
| | | { |
| | | equipNo: "1023", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1024", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | //positionX: 25.65, |
| | | positionX: 0, |
| | | positionY: 0, |
| | | condition: false, |
| | | } |
| | | ], |
| | | linescopy5: [ |
| | | // { |
| | | // equipNo: "410", |
| | | // imgType: "1", |
| | | // positionX: 17.525, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "411", |
| | | // imgType: "1", |
| | | // positionX: 17.525, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "412", |
| | | // imgType: "1", |
| | | // positionX: 17.525, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "318", |
| | | // imgType: "1", |
| | | // positionX: 21.65, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | { |
| | | equipNo: "1031", |
| | | equipNo: "324", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1032", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | |
| | | { |
| | | equipNo: "1033", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1034", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | //positionX: 21.65, |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | } |
| | | ], |
| | | linescopy6: [ |
| | | // { |
| | | // equipNo: "414", |
| | | // imgType: "1", |
| | | // positionX: 22, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "319", |
| | | // imgType: "1", |
| | | // positionX: 24.3, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | { |
| | | equipNo: "1035", |
| | | equipNo: "325", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1036", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | |
| | | { |
| | | equipNo: "1037", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1038", |
| | | imgType: "1", |
| | | positionX: 0.6, |
| | | positionY: 20, |
| | | //positionX: 24.3, |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | } |
| | | ], |
| | | linescopy7: [ |
| | | //{ |
| | | // equipNo: "409", |
| | | // imgType: "2", |
| | | // positionX: 17.525, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "415", |
| | | // imgType: "2", |
| | | // positionX: 18.9, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | { |
| | | equipNo: "1001", |
| | | imgType: "1", |
| | | positionX: 5, |
| | | positionY: 8, |
| | | equipNo: "424", |
| | | imgType: "2", |
| | | //positionX: 19.3, |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1002", |
| | | imgType: "1", |
| | | positionX: 5, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | |
| | | { |
| | | equipNo: "1003", |
| | | imgType: "1", |
| | | positionX: 5, |
| | | positionY: 20, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1004", |
| | | imgType: "1", |
| | | positionX: 5, |
| | | positionY: 20, |
| | | condition: false, |
| | | }, |
| | | // { |
| | | // equipNo: "424.1", |
| | | // imgType: "2", |
| | | // positionX: 21.7, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | ], |
| | | linescopy8: [ |
| | | { |
| | | equipNo: "1039", |
| | | imgType: "1", |
| | | positionX: 6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1040", |
| | | imgType: "1", |
| | | positionX: 6, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | // { |
| | | // equipNo: "408", |
| | | // imgType: "2", |
| | | // positionX: 17.525, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "416", |
| | | // imgType: "2", |
| | | // positionX: 18.9, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "423", |
| | | // imgType: "2", |
| | | // positionX: 19.3, |
| | | // positionX: 0, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | ], |
| | | linescopy9: [ |
| | | // { |
| | | // equipNo: "407", |
| | | // imgType: "2", |
| | | // positionX: 17.525, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | { |
| | | equipNo: "1013", |
| | | imgType: "1", |
| | | positionX: 6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1014", |
| | | imgType: "1", |
| | | positionX: 6, |
| | | equipNo: "422", |
| | | imgType: "2", |
| | | //positionX: 20.65, |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | // { |
| | | // equipNo: "422.1", |
| | | // imgType: "2", |
| | | // positionX: 23.05, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | ], |
| | | linescopy10: [ |
| | | // { |
| | | // equipNo: "406", |
| | | // imgType: "2", |
| | | // positionX: 17.525, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | { |
| | | equipNo: "1015", |
| | | imgType: "1", |
| | | positionX: 6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1016", |
| | | imgType: "1", |
| | | positionX: 6, |
| | | equipNo: "425", |
| | | imgType: "2", |
| | | //positionX: 24.4, |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | ], |
| | | linescopy11: [ |
| | | { |
| | | equipNo: "1027", |
| | | imgType: "1", |
| | | positionX: 6, |
| | | positionY: 8, |
| | | condition: false, |
| | | }, |
| | | { |
| | | equipNo: "1028", |
| | | imgType: "1", |
| | | positionX: 6, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | // { |
| | | // equipNo: "404", |
| | | // imgType: "2", |
| | | // positionX: 17.525, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "418", |
| | | // imgType: "2", |
| | | // positionX: 18.9, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | // { |
| | | // equipNo: "421", |
| | | // imgType: "2", |
| | | // positionX: 19.3, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | |
| | | ], |
| | | linescopy12: [ |
| | | // { |
| | | // equipNo: "403", |
| | | // imgType: "2", |
| | | // positionX: 17.525, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | { |
| | | equipNo: "1029", |
| | | imgType: "1", |
| | | positionX: 6, |
| | | positionY: 8, |
| | | equipNo: "419", |
| | | imgType: "2", |
| | | //positionX: 18.9, |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | // { |
| | | // equipNo: "419.1", |
| | | // imgType: "2", |
| | | // positionX: 23.1, |
| | | // positionY: 16, |
| | | // condition: false, |
| | | // }, |
| | | ], |
| | | linescopyCP1: [ |
| | | { |
| | | equipNo: "1030", |
| | | equipNo: "1003", |
| | | imgType: "1", |
| | | positionX: 6, |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | ], |
| | | |
| | | linescopyCP2: [ |
| | | { |
| | | equipNo: "1008", |
| | | imgType: "1", |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | ], |
| | | linescopyCP3: [ |
| | | { |
| | | equipNo: "1007", |
| | | imgType: "1", |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | ], |
| | | linescopyCP4: [ |
| | | { |
| | | equipNo: "1012", |
| | | imgType: "1", |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | ], |
| | | linescopyCP5: [ |
| | | { |
| | | equipNo: "1013", |
| | | imgType: "1", |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | ], |
| | | linescopyCP6: [ |
| | | { |
| | | equipNo: "1018", |
| | | imgType: "1", |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | ], |
| | | linescopyCP7: [ |
| | | { |
| | | equipNo: "1017", |
| | | imgType: "1", |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | ], |
| | | linescopyCP8: [ |
| | | { |
| | | equipNo: "1022", |
| | | imgType: "1", |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | ], |
| | | linescopyCP9: [ |
| | | { |
| | | equipNo: "1023", |
| | | imgType: "1", |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | ], |
| | | linescopyCP10: [ |
| | | { |
| | | equipNo: "1026", |
| | | imgType: "1", |
| | | positionX: 0, |
| | | positionY: 16, |
| | | condition: false, |
| | | }, |
| | | ], |
| | | |
| | | StackerCrane: { |
| | | Automatic: "", |
| | | Fault: "", |
| | |
| | | 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) => { |
| | |
| | | }); |
| | | }, |
| | | }, |
| | | 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> |
| | | |
| | |
| | | margin-bottom: 10px; |
| | | } */ |
| | | .title { |
| | | height: 1800px; |
| | | height: auto; |
| | | margin-bottom: 50px; |
| | | } |
| | | |
| | | .cardWidth { |
| | |
| | | |
| | | .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; |
| | | } |
| | | |
| | |
| | | height: 1px; |
| | | /* margin-top:180px; */ |
| | | background-color: #a0cfff; |
| | | }</style> |
| | | } |
| | | </style> |
| | |
| | | <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> |
| | |
| | | }); |
| | | }; |
| | | |
| | | 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; |
| | |
| | | <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> |
| | |
| | | </div> |
| | | <div class="line-container"> |
| | | <div class="line"></div> |
| | | <!-- <div class="dot" :style="{ right: dotPosition + 'px' }" ref="childDot" @click="mouseClick"></div> --> |
| | | <div :class="update()" |
| | | :style="{ transform: `translateX(${StackerCrane.CurrentColumn < 33 ? StackerCrane.CurrentColumn * 30 - 59 : 0}px)` }" |
| | | <div :class="update()" :style="{ transform: `translateX(${calculateDotPosition()}px)` }" |
| | | ref="childDot" @click="mouseClick"></div> |
| | | </div> |
| | | <div> |
| | | <el-row style="padding-top: 5px;"> |
| | | <template v-for="item in 32" :key="item"> |
| | | <el-col :span="0.9"> |
| | | <span class="image-text"></span> |
| | | <template v-for="item in columnCount" :key="item"> |
| | | <el-col :span="columnWidth"> |
| | | <span class="image-text">{{ 91-item }}</span> |
| | | <img src="../../public/è´§æ¶.jpeg" /> |
| | | </el-col> |
| | | </template> |
| | | </el-row> |
| | | <el-row style="padding-bottom: 5px;"> |
| | | <template v-for="item in 32" :key="item"> |
| | | <el-col :span="0.9"> |
| | | <span class="image-text"></span> |
| | | <img src="../../public/è´§æ¶.jpeg" /> |
| | | </el-col> |
| | | </template> |
| | | <div style="margin-top: 60px;"></div> |
| | | </el-row> |
| | | </div> |
| | | |
| | | <el-dialog v-model="dialogVisible" title="å åæºä¿¡æ¯æ¥ç" :before-close="handleClose"> |
| | | <el-form ref="$form" :model="StackerCrane" label-position="left" label-width="120px" size="medium"> |
| | | <el-row :gutter="20" type="flex" justify="start" align="top" tag="div"> |
| | | <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-form-item label="设å¤ç¼å·ï¼"> |
| | | <j-el-description :value="StackerCrane.DeviceName" type="primary" ellipsis></j-el-description> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-form-item label="设å¤ç¶æ:"> |
| | | <j-el-description :value="StackerCrane.Fault" type="primary" ellipsis></j-el-description> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" type="flex" justify="start" align="top" tag="div"> |
| | | <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-form-item label="工使¨¡å¼:"> |
| | | <j-el-description :value="StackerCrane.Automatic" type="primary" ellipsis></j-el-description> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-form-item label="ä»»å¡å·ï¼"> |
| | | <j-el-description :value="StackerCrane.CurrentTaskNum" type="primary" ellipsis></j-el-description> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" type="flex" justify="start" align="top" tag="div" style="margin-bottom: 10px;"> |
| | | <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-form-item label="ä½ä¸ç¶æ:"> |
| | | <j-el-description :value="StackerCrane.Running" type="primary" ellipsis></j-el-description> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-form-item label="å½åè¡åå±ï¼"> |
| | | <j-el-description |
| | | :value="StackerCrane.CurrentRow + '-' + StackerCrane.CurrentLayer + '-' + StackerCrane.CurrentColumn " |
| | | type="primary" ellipsis></j-el-description> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" type="flex" justify="start" align="top" tag="div" style="margin-bottom: 10px;"> |
| | | <el-col :span="24" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-form-item label="æ¥è¦ä¿¡æ¯:"> |
| | | <j-el-description :value="StackerCrane.StackerAlarm" type="primary" ellipsis></j-el-description> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-divider /> |
| | | <h4 style="margin-bottom: 20px;">æå¨æä½</h4> |
| | | <el-form ref="form" :model="form" label-width="90px"> |
| | | <el-row :gutter="20" type="flex" justify="start" align="top" tag="div"> |
| | | <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-form-item label="ä»»å¡å½ä»¤" prop="TargetAddress"> |
| | | <el-select size="large" v-model="form.TaskType" placeholder="è¯·éæ©ä»»å¡å½ä»¤"> |
| | | <el-option label="å
¥åº" value="17" /> |
| | | <el-option label="åºåº" value="18" /> |
| | | <el-option label="ç§»åº" value="20" /> |
| | | <el-option label="åè´§" value="24" /> |
| | | <el-option label="æ¾è´§" value="48" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" type="flex" justify="start" align="top" tag="div"> |
| | | <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-form-item label="èµ·ç¹è¡åå±:"> |
| | | <el-input size="large" v-model="form.SourceAddress" style="width: 800px" placeholder="请è¾å
¥èµ·ç¹è¡åå±" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" type="flex" justify="start" align="top" tag="div"> |
| | | <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-form-item label="ç»ç¹è¡åå±:"> |
| | | <el-input size="large" v-model="form.TargetAddress" style="width: 800px" placeholder="请è¾å
¥ç»ç¹è¡åå±" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-divider /> |
| | | <el-row :gutter="20" type="flex" justify="start" align="top" tag="div"> |
| | | <el-col :span="5" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-button type="primary" size="small" plain @click="start"> |
| | | <i class="el-icon-check">å¯å¨</i> |
| | | </el-button> |
| | | |
| | | </el-col> |
| | | <el-col :span="5" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-button type="warning" size="small" plain @click="reset"> |
| | | <i class="el-icon-check">å¤ä½</i> |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="5" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-button type="danger" size="small" plain @click="disconnected"> |
| | | <i class="el-icon-check">䏿</i> |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="5" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-button type="danger" size="small" plain @click="emergencyStop"> |
| | | <i class="el-icon-check">æ¥å</i> |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div"> |
| | | <el-button type="danger" size="small" plain @click="StackerRecall"> |
| | | <i class="el-icon-check">å¬å</i> |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false"> |
| | | 确认 |
| | | </el-button> |
| | | <el-dialog v-model="dialogVisible" :before-close="handleClose" width="520px" class="modern-dialog"> |
| | | <div class="dialog-header"> |
| | | <h3 class="dialog-title">å åæºä¿¡æ¯</h3> |
| | | </div> |
| | | <div class="dialog-content"> |
| | | <div class="info-list"> |
| | | <div class="info-item"> |
| | | <span class="item-label">设å¤ç¼å·</span> |
| | | <span class="item-value">{{ yL_DB.R_PP_Status || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">设å¤ç¶æ</span> |
| | | <span :class="['item-value', statusClass]">{{ yL_DB.YL_Status || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">工使¨¡å¼</span> |
| | | <span :class="['item-value', autoStatusClass]">{{ yL_DB.YL_AutoStatus || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">ä»»å¡å·</span> |
| | | <span class="item-value">{{ yL_DB.YL_TaskNum || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">ä½ä¸ç¶æ</span> |
| | | <span class="item-value">{{ yL_DB.YL_WorkStatus || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">å½åè¡åå±</span> |
| | | <span class="item-value">{{ yL_DB.YL_Row + '-' + yL_DB.YL_Column + '-' + yL_DB.YL_Layer || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">æ¥è¦ä¿¡æ¯</span> |
| | | <span class="item-value">{{ yL_DB.StackerAlarm || 'æ ' }}</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | YLDBMap: { |
| | | YL_Status: { |
| | | 0: "ä¸å¨çº¿", |
| | | 1: "å¨çº¿", |
| | | 2: "æ¥å", |
| | | 3: "æªç¥", |
| | | }, |
| | | YL_AutoStatus: { |
| | | 1: "åèªå¨", |
| | | 2: "忥", |
| | | 3: "èªå¨", |
| | | 4: "æå¨", |
| | | 5: "è±æº", |
| | | }, |
| | | YL_WorkStatus: { |
| | | 1: "å¾
å½", |
| | | 2: "åè´§å®æ", |
| | | 3: "åè´§ä¸", |
| | | 5: "æ¾è´§ä¸", |
| | | 6: "任塿§è¡é误", |
| | | 7: "æªç¥", |
| | | 9: "ä»»å¡å®æ", |
| | | }, |
| | | }, |
| | | x: 0, // åå§xå¼ |
| | | url: "api/Equipment/GetStackerInfoByNo", |
| | | dialogVisible: false, |
| | | StackerCrane: { |
| | | Automatic: "", |
| | | Fault: "", |
| | | CurrentLayer: "1", |
| | | CurrentRow: "1", |
| | | CurrentColumn: "1", |
| | | CurrentTaskNum: "", |
| | | Running: "", |
| | | DeviceName: "", |
| | | DeviceCode: "", |
| | | StackerAlarm:"", |
| | | timer1: null, |
| | | yL_DB: { |
| | | R_PP_Status: "", |
| | | YL_Status: "", |
| | | YL_AutoStatus: "", |
| | | YL_TaskNum: "", |
| | | YL_WorkStatus: "", |
| | | YL_WorkType: "", |
| | | YL_Row: "", |
| | | YL_Column: "", |
| | | YL_Layer: "", |
| | | StackerAlarm: "", |
| | | CurrentColumn: "1" |
| | | }, |
| | | form: { |
| | | TaskType: "", |
| | |
| | | }, |
| | | }; |
| | | }, |
| | | |
| | | props: { |
| | | equipNo: { |
| | | type: String, |
| | |
| | | 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() { |
| | |
| | | this.dialogVisible = true; |
| | | this.fullscreenLoading = false; |
| | | }, |
| | | start() { |
| | | this.fullscreenLoading = true; |
| | | this.http.post("api/DeviceInfo/StackerHandTask", this.form) |
| | | .then((x) => { |
| | | if (!x.status) { |
| | | this.$message.error(x.message); |
| | | } else { |
| | | this.$Message.success("å åæºå½ä»¤å·²ä¸å"); |
| | | // $vue.success("æå."); |
| | | this.show = false; |
| | | $vue.refresh(); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.fullscreenLoading = false; |
| | | }); |
| | | }, reset() { |
| | | this.fullscreenLoading = true; |
| | | this.http.post("api/DeviceInfo/StackerReset?DeviceCode=" + this.form.DeviceCode) |
| | | .then((x) => { |
| | | if (!x.status) { |
| | | this.$message.error(x.message); |
| | | } else { |
| | | this.$Message.success("å¤ä½æå"); |
| | | // $vue.success("æå."); |
| | | this.show = false; |
| | | $vue.refresh(); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.fullscreenLoading = false; |
| | | }); |
| | | }, |
| | | |
| | | emergencyStop() { |
| | | this.fullscreenLoading = true; |
| | | this.http.post("api/DeviceInfo/StackerEmergencyStop?DeviceCode=" + this.form.DeviceCode) |
| | | .then((x) => { |
| | | if (!x.status) { |
| | | this.$message.error(x.message); |
| | | } else { |
| | | this.$Message.success("æ¥åå·²æä¸"); |
| | | // $vue.success("æå."); |
| | | // this.show = false; |
| | | // $vue.refresh(); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.fullscreenLoading = false; |
| | | }); |
| | | }, |
| | | disconnected() { |
| | | this.fullscreenLoading = true; |
| | | this.http.post("api/DeviceInfo/StackerDisconnected?DeviceCode=" + this.form.DeviceCode) |
| | | .then((x) => { |
| | | if (!x.status) { |
| | | this.$message.error(x.message); |
| | | } else { |
| | | this.$Message.success("䏿å åæºä»»å¡"); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.fullscreenLoading = false; |
| | | }); |
| | | }, |
| | | StackerRecall() { |
| | | this.fullscreenLoading = true; |
| | | this.http.post("api/DeviceInfo/StackerRecall?DeviceCode=" + this.form.DeviceCode) |
| | | .then((x) => { |
| | | if (!x.status) { |
| | | this.$message.error(x.message); |
| | | } else { |
| | | this.$Message.success("å¬åå åæº"); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.fullscreenLoading = false; |
| | | }); |
| | | } |
| | | // start() { |
| | | // this.fullscreenLoading = true; |
| | | // this.http.post("api/DeviceInfo/StackerHandTask", this.form) |
| | | // .then((x) => { |
| | | // if (!x.status) { |
| | | // this.$message.error(x.message); |
| | | // } else { |
| | | // this.$Message.success("å åæºå½ä»¤å·²ä¸å"); |
| | | // // $vue.success("æå."); |
| | | // this.show = false; |
| | | // $vue.refresh(); |
| | | // } |
| | | // }) |
| | | // .finally(() => { |
| | | // this.fullscreenLoading = false; |
| | | // }); |
| | | // }, reset() { |
| | | // this.fullscreenLoading = true; |
| | | // this.http.post("api/DeviceInfo/StackerReset?DeviceCode=" + this.form.DeviceCode) |
| | | // .then((x) => { |
| | | // if (!x.status) { |
| | | // this.$message.error(x.message); |
| | | // } else { |
| | | // this.$Message.success("å¤ä½æå"); |
| | | // // $vue.success("æå."); |
| | | // this.show = false; |
| | | // $vue.refresh(); |
| | | // } |
| | | // }) |
| | | // .finally(() => { |
| | | // this.fullscreenLoading = false; |
| | | // }); |
| | | // }, |
| | | |
| | | // emergencyStop() { |
| | | // this.fullscreenLoading = true; |
| | | // this.http.post("api/DeviceInfo/StackerEmergencyStop?DeviceCode=" + this.form.DeviceCode) |
| | | // .then((x) => { |
| | | // if (!x.status) { |
| | | // this.$message.error(x.message); |
| | | // } else { |
| | | // this.$Message.success("æ¥åå·²æä¸"); |
| | | // // $vue.success("æå."); |
| | | // // this.show = false; |
| | | // // $vue.refresh(); |
| | | // } |
| | | // }) |
| | | // .finally(() => { |
| | | // this.fullscreenLoading = false; |
| | | // }); |
| | | // }, |
| | | // disconnected() { |
| | | // this.fullscreenLoading = true; |
| | | // this.http.post("api/DeviceInfo/StackerDisconnected?DeviceCode=" + this.form.DeviceCode) |
| | | // .then((x) => { |
| | | // if (!x.status) { |
| | | // this.$message.error(x.message); |
| | | // } else { |
| | | // this.$Message.success("䏿å åæºä»»å¡"); |
| | | // } |
| | | // }) |
| | | // .finally(() => { |
| | | // this.fullscreenLoading = false; |
| | | // }); |
| | | // }, |
| | | // StackerRecall() { |
| | | // this.fullscreenLoading = true; |
| | | // this.http.post("api/DeviceInfo/StackerRecall?DeviceCode=" + this.form.DeviceCode) |
| | | // .then((x) => { |
| | | // if (!x.status) { |
| | | // this.$message.error(x.message); |
| | | // } else { |
| | | // this.$Message.success("å¬åå åæº"); |
| | | // } |
| | | // }) |
| | | // .finally(() => { |
| | | // this.fullscreenLoading = false; |
| | | // }); |
| | | // } |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | <style scoped> |
| | | .line-container { |
| | | position: relative; |
| | | height: 20px; |
| | | height: 25px; |
| | | background-color: #ecf5ff; |
| | | width: 960px; |
| | | width: 2720px; |
| | | /* 90å * 30pxæ¯å */ |
| | | } |
| | | |
| | | .line { |
| | |
| | | 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%; |
| | |
| | | |
| | | .dot-Automatic { |
| | | position: absolute; |
| | | top: -5px; |
| | | top: 0px; |
| | | width: 25px; |
| | | height: 25px; |
| | | border-radius: 50%; |
| | |
| | | |
| | | .dot-Fault { |
| | | position: absolute; |
| | | top: -5px; |
| | | top: 0px; |
| | | width: 25px; |
| | | height: 25px; |
| | | border-radius: 50%; |
| | |
| | | |
| | | img { |
| | | width: 30px; |
| | | height: 25px; |
| | | height: 30px; |
| | | } |
| | | |
| | | .image-text { |
| | | position: absolute; |
| | | top: 5px; |
| | | /* left: 10px; */ |
| | | color: white; |
| | | /* æåé¢è² */ |
| | | color: #000000; |
| | | font-size: 12px; |
| | | /* åå·å¤§å° */ |
| | | font-weight: bold; |
| | | /* åä½ç²ç» */ |
| | | font-family: 'Microsoft YaHei', Arial, sans-serif; |
| | | margin-left: 5px; |
| | | } |
| | | </style> |
| | | |
| | | .modern-dialog { |
| | | border-radius: 16px !important; |
| | | overflow: hidden; |
| | | box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15); |
| | | } |
| | | |
| | | .modern-dialog .el-dialog__header { |
| | | display: none; |
| | | } |
| | | |
| | | .modern-dialog .el-dialog__body { |
| | | padding: 0; |
| | | margin: 0; |
| | | } |
| | | |
| | | .dialog-header { |
| | | background: linear-gradient(135deg, #409eff 0%, #67c23a 100%); |
| | | padding: 20px 24px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .dialog-title { |
| | | color: #fff; |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | margin: 0; |
| | | letter-spacing: 2px; |
| | | } |
| | | |
| | | .dialog-content { |
| | | padding: 28px; |
| | | background: #f8fafc; |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .info-list { |
| | | width: 100%; |
| | | max-width: 420px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 12px; |
| | | } |
| | | |
| | | .info-item { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | padding: 16px 20px; |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .info-item:hover { |
| | | transform: translateX(4px); |
| | | box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .item-label { |
| | | font-size: 14px; |
| | | color: #6b7280; |
| | | font-weight: 500; |
| | | min-width: 80px; |
| | | text-align: left; |
| | | } |
| | | |
| | | .item-value { |
| | | font-size: 15px; |
| | | color: #1f2937; |
| | | font-weight: 500; |
| | | text-align: right; |
| | | flex: 1; |
| | | margin-left: 20px; |
| | | word-break: break-all; |
| | | padding-left: 20px; |
| | | border-left: 1px solid #e5e7eb; |
| | | } |
| | | |
| | | .status-blue { |
| | | color: #409eff !important; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .status-green { |
| | | color: #67c23a !important; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .status-red { |
| | | color: #f56c6c !important; |
| | | font-weight: 600; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | |
| | | <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> |
| | | <div class="dialog-content"> |
| | | <div class="info-list"> |
| | | <div class="info-item"> |
| | | <span class="item-label">设å¤ç¼å·</span> |
| | | <span class="item-value">{{ equipNo || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">ä»»å¡å·</span> |
| | | <span class="item-value">{{ ConveyorLineInfo.TaskNum || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">æ¯å¦æç</span> |
| | | <span class="item-value">{{ ConveyorLineInfo.HasGoods || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">æçæ¡ç </span> |
| | | <span class="item-value">{{ ConveyorLineInfo.PalletCode || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">ç¶æ</span> |
| | | <span :class="['item-value', statusClass]">{{ ConveyorLineInfo.Status || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">å½ä»¤</span> |
| | | <span class="item-value">{{ ConveyorLineInfo.Command || 'æ ' }}</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | |
| | | 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> |
| | | |
| | |
| | | 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; |
| | |
| | | } */ |
| | | |
| | | .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> |
| | |
| | | <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> |
| | | <div class="dialog-content"> |
| | | <div class="info-list"> |
| | | <div class="info-item"> |
| | | <span class="item-label">设å¤ç¼å·</span> |
| | | <span class="item-value">{{ equipNo || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">ä»»å¡å·</span> |
| | | <span class="item-value">{{ lineItemInfo.taskNum || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">æ¯å¦æç</span> |
| | | <span class="item-value">{{ lineItemInfo.inStock || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">RFID</span> |
| | | <span class="item-value">{{ lineItemInfo.rfid || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">ç³è¯·</span> |
| | | <span class="item-value">{{ lineItemInfo.request || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">ç³è¯·åé¦</span> |
| | | <span class="item-value">{{ lineItemInfo.reresult || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">纸å·å¹
宽</span> |
| | | <span class="item-value">{{ lineItemInfo.width || 'æ ' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="item-label">æ¥è¦ä¿¡æ¯</span> |
| | | <span class="item-value">{{ lineItemInfo.error || 'æ ' }}</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | |
| | | default: "1", |
| | | }, |
| | | positionX: { |
| | | type: Int32Array, |
| | | type: Number, |
| | | default: 1, |
| | | }, |
| | | positionY: { |
| | | type: Int32Array, |
| | | type: Number, |
| | | default: 1, |
| | | }, |
| | | url: { |
| | |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | left: "500px", |
| | | top: "400px", |
| | | dialogVisible: false, |
| | | lineItemInfo: { |
| | | inStock: "", |
| | | taskNum: "", |
| | | alarm: "", |
| | | }, |
| | | form: { |
| | | TaskType: "", |
| | | TargetAddress: "", |
| | | DeviceCode: "", |
| | | }, |
| | | }; |
| | | return { |
| | | left: "500px", |
| | | top: "400px", |
| | | dialogVisible: false, |
| | | fullscreenLoading: false, |
| | | isAlarm: false, |
| | | lineItemInfo: { |
| | | inStock: "", |
| | | taskNum: "", |
| | | rfid: "", |
| | | width: "", |
| | | request: "", |
| | | reresult: "", |
| | | error: "", |
| | | }, |
| | | // ç³è¯·åé¦ç¶æè·è¸ª |
| | | feedbackTracking: { |
| | | currentTaskNum: "", // å½åä»»å¡å· |
| | | hasFeedback: false, // æ¯å¦å·²åé¦è¿ |
| | | lastFeedbackValue: "" // 䏿¬¡åé¦çå¼ |
| | | }, |
| | | form: { |
| | | TaskType: "", |
| | | TargetAddress: "", |
| | | DeviceCode: "", |
| | | }, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | const axisX = (this.positionX - 1) * 40 + 100; |
| | | const axisX = (this.positionX - 1) * 60 + 100; |
| | | const axisY = (this.positionY - 1) + 50; |
| | | this.$nextTick(() => { |
| | | this.left = `${axisX}px`; |
| | | this.top = `${axisY}px`; |
| | | }); |
| | | |
| | | // çå¬å
¨å±conveyorLineDetailsçåå |
| | | this.$watch( |
| | | () => this.$root.conveyorLineDetails, |
| | | () => { |
| | | this.updateAlarmStatus(); |
| | | }, |
| | | { deep: true, immediate: true } |
| | | ); |
| | | |
| | | // å¼å¯å®æ¶å¨ï¼å®ææ£æ¥æ°æ®åå |
| | | this.timer = setInterval(() => { |
| | | this.updateAlarmStatus(); |
| | | }, 1000); // æ¯1ç§æ£æ¥ä¸æ¬¡ |
| | | }, |
| | | methods: { |
| | | // æ´æ°æ¥è¦ç¶æ |
| | | updateAlarmStatus() { |
| | | const equipNoStr = String(this.equipNo); |
| | | if (this.$root.conveyorLineDetails && this.$root.conveyorLineDetails[equipNoStr]) { |
| | | const rawData = this.$root.conveyorLineDetails[equipNoStr]; |
| | | this.isAlarm = rawData.isAlarm || false; |
| | | |
| | | // è·åå½åä»»å¡å· |
| | | const currentTaskNum = rawData.taskNum || 'æ '; |
| | | |
| | | // æ£æ¥ä»»å¡å·æ¯å¦åå |
| | | if (currentTaskNum !== this.feedbackTracking.currentTaskNum) { |
| | | // ä»»å¡å·ååï¼éç½®åé¦ç¶æ |
| | | this.feedbackTracking.currentTaskNum = currentTaskNum; |
| | | this.feedbackTracking.hasFeedback = false; |
| | | this.feedbackTracking.lastFeedbackValue = ""; |
| | | } |
| | | |
| | | // å¤çç³è¯·åé¦é»è¾ |
| | | let reresultValue = rawData.reresult || 'æ '; |
| | | |
| | | // 妿æ¶å°äºåé¦å¼ï¼éç©ºéæ ï¼ä¸è¿æ²¡æåé¦è¿ |
| | | if ((reresultValue !== 'æ ' && reresultValue !== '' && reresultValue !== undefined) && !this.feedbackTracking.hasFeedback) { |
| | | // è®°å½å·²åé¦ |
| | | this.feedbackTracking.hasFeedback = true; |
| | | this.feedbackTracking.lastFeedbackValue = reresultValue; |
| | | } |
| | | |
| | | // 妿已ç»åé¦è¿ï¼æ¾ç¤º"å·²åé¦" |
| | | if (this.feedbackTracking.hasFeedback) { |
| | | reresultValue = 'å·²åé¦'; |
| | | } |
| | | |
| | | // æ´æ°lineItemInfoæ°æ® |
| | | this.lineItemInfo = { |
| | | taskNum: currentTaskNum, |
| | | inStock: rawData.inStock || 'æ ', |
| | | rfid: rawData.rfid || 'æ ', |
| | | width: rawData.width || 'æ ', |
| | | request: rawData.request || 'æ ', |
| | | reresult: reresultValue, |
| | | error: rawData.error || 'æ ', |
| | | }; |
| | | } else { |
| | | this.isAlarm = false; |
| | | this.lineItemInfo = { |
| | | taskNum: '', |
| | | inStock: '', |
| | | rfid: '', |
| | | width: '', |
| | | request: '', |
| | | reresult: '', |
| | | error: '' |
| | | }; |
| | | } |
| | | }, |
| | | // ç»ä»¶éæ¯æ¶æ¸
é¤å®æ¶å¨ |
| | | beforeUnmount() { |
| | | if (this.timer) { |
| | | clearInterval(this.timer); |
| | | } |
| | | }, |
| | | mouseClick() { |
| | | this.fullscreenLoading = true; |
| | | this.dialogVisible = true; |
| | | // å¤çç¹å»äºä»¶ |
| | | this.http.post("api/DeviceInfo/GetConveyorLineInfo?DeviceChildCode=" + this.equipNo, null, "") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.lineItemInfo = x.data; |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: x.message, |
| | | }); |
| | | } |
| | | }); |
| | | // ä»å
¨å±åéä¸è·åè¾é线详ç»ä¿¡æ¯ |
| | | const equipNoStr = String(this.equipNo); |
| | | if (this.$root.conveyorLineDetails && this.$root.conveyorLineDetails[equipNoStr]) { |
| | | // å
è·ååå§æ°æ® |
| | | const rawData = this.$root.conveyorLineDetails[equipNoStr]; |
| | | |
| | | // è·åå½åä»»å¡å· |
| | | const currentTaskNum = rawData.taskNum || 'æ '; |
| | | |
| | | // æ£æ¥ä»»å¡å·æ¯å¦ååï¼ä¸updateAlarmStatusä¿æä¸è´ï¼ |
| | | if (currentTaskNum !== this.feedbackTracking.currentTaskNum) { |
| | | this.feedbackTracking.currentTaskNum = currentTaskNum; |
| | | this.feedbackTracking.hasFeedback = false; |
| | | this.feedbackTracking.lastFeedbackValue = ""; |
| | | } |
| | | |
| | | // å¤çç³è¯·åé¦é»è¾ |
| | | let reresultValue = rawData.reresult || 'æ '; |
| | | |
| | | // 妿æ¶å°äºåé¦å¼ï¼éç©ºéæ ï¼ä¸è¿æ²¡æåé¦è¿ |
| | | if ((reresultValue !== 'æ ' && reresultValue !== '' && reresultValue !== undefined) && !this.feedbackTracking.hasFeedback) { |
| | | this.feedbackTracking.hasFeedback = true; |
| | | this.feedbackTracking.lastFeedbackValue = reresultValue; |
| | | } |
| | | |
| | | // 妿已ç»åé¦è¿ï¼æ¾ç¤º"å·²åé¦" |
| | | if (this.feedbackTracking.hasFeedback) { |
| | | reresultValue = 'å·²åé¦'; |
| | | } |
| | | |
| | | // å¤å¶æ°æ®å°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); |
| | | }, |
| | | }, |
| | |
| | | .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; |
| | | } |
| | |
| | | } */ |
| | | |
| | | .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> |
| | |
| | | </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> |
| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System; |
| | |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using HslCommunication.WebSocket; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Communicator; |
| | |
| | | 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; |
| | |
| | | _routerRepository = routerRepository; |
| | | _routerService = routerService; |
| | | _routerExtension = routerExtension; |
| | | _webSocketServer = webSocketServer; |
| | | |
| | | string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice)); |
| | | if (!string.IsNullOrEmpty(warehouseDevicesStr)) |
| | |
| | | //è·åææåè®®çè¾é线ç«å° |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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; |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | 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 |
| | | { |
| | |
| | | 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; |
| | |
| | | _routerService = routerService; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _routerRepository = routerRepository; |
| | | _webSocketServer = webSocketServer; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | } |
| | | } |
| | | } |
| | | // 设置设å¤ç¼å·ï¼å端ç¨äºè¯å«å åæº |
| | | 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) |
| | |
| | | return WebResponseContent.Instance.Error($"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | } |
| | | bool depth = false; |
| | | if (task.Grade>0 && task.TaskType==TaskTypeEnum.PrintYLOutbound.ObjToInt()) |
| | | if (task.Grade > 0 && task.TaskType==TaskTypeEnum.PrintYLOutbound.ObjToInt()) |
| | | { |
| | | depth = true; |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | 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_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 |
| | | { |
| | |
| | | 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) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | // 设置设å¤ç¼å·ï¼å端ç¨äºè¯å«å åæº |
| | | 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 è°ç¨äºä»¶æ»çº¿éç¥å端 |
| | | |
| | |
| | | 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; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using SqlSugar.Extensions; |
| | |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using HslCommunication.WebSocket; |
| | | using ICacheService = WIDESEAWCS_Core.Caches.ICacheService; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | |
| | | 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; |
| | |
| | | _routerRepository = routerRepository; |
| | | _routerService = routerService; |
| | | _routerExtension = routerExtension; |
| | | _webSocketServer = webSocketServer; |
| | | |
| | | string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice)); |
| | | if (!string.IsNullOrEmpty(warehouseDevicesStr)) |
| | |
| | | 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 && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.AGV_Finish.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | | if (task != null) |
| | | { |
| | | //åé
å··é åå
¥æçæ°æ® |
| | | List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, task.Roadway, task.TaskType); |
| | | Dt_Router? router = routers.FirstOrDefault(); |
| | | if (routers == null || routers.Count == 0 || router == null) |
| | | { |
| | | WriteError(item.StationName, $"æªæ¾å°å¯¹åºè·¯ç±ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | if (routers.Count > 1) |
| | | { |
| | | WriteError(item.StationName, $"è·¯ç±ä¿¡æ¯é
ç½®é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | //åå
¥å
¥åºçº¿ä½å°å |
| | | device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode); |
| | | //æ´æ°ä»»å¡ä¿¡æ¯ |
| | | task.CurrentAddress = item.StationCode; |
| | | task.NextAddress = router.NextPosi; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·{conveyorLineInfoRead.TaskNo}ä¸ä¸æ¥"); |
| | | } |
| | | } |
| | | else if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0)//䏿¥¼åºåºå£å¤æçæAGVåæä»»å¡ |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | | if (task != null) |
| | | { |
| | | //åé
å··é åå
¥æçæ°æ® |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.NextAddress == x.StartPosi); |
| | | Dt_Router router = routers.FirstOrDefault(); |
| | | if (router == null) |
| | | { |
| | | WriteError(item.StationName, $"ä»»å¡å·:{task.TaskNum}æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | return Task.CompletedTask; |
| | | } |
| | | //æ´æ°ä»»å¡ä¿¡æ¯ |
| | | task.CurrentAddress = router.StartPosi; |
| | | task.NextAddress = task.TargetAddress; |
| | | task.DeviceCode = router.NextPosi; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Execute); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·{conveyorLineInfoRead.TaskNo}ä¸ä¸æ¥"); |
| | | } |
| | | } |
| | | } |
| | | else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null) |
| | | { |
| | | //å
¥åºç«å°åé
è´§ä½åå¤å åå
¥åº |
| | | R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress); |
| | | |
| | | if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0) |
| | | // ç¶åæ ¹æ®ä¸åçç«å°ç±»åæ§è¡ä¸åçä¸å¡é»è¾ |
| | | if (conveyorLineInfoRead != null) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | | if (task != null) |
| | | // æå䏿¥¼å
¥åºå£åå
¥å¯¹åºå
¥åºç«å°å°å |
| | | if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && deviceProRead != null && deviceProWrite != null) |
| | | { |
| | | //åé
è´§ä½ |
| | | string? local = _taskService.RequestAssignLocation(task.TaskNum, task.Roadway); |
| | | if (!string.IsNullOrEmpty(local)) |
| | | if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0) |
| | | { |
| | | task.CurrentAddress = item.StackerCraneStationCode; |
| | | task.TargetAddress = local; |
| | | task.NextAddress = local; |
| | | task.DeviceCode = item.StackerCraneCode; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·:{task.TaskNum}è¿è¡å åæºå
¥åº"); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.AGV_Finish.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | | if (task != null) |
| | | { |
| | | //åé
å··é åå
¥æçæ°æ® |
| | | List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, task.Roadway, task.TaskType); |
| | | Dt_Router? router = routers.FirstOrDefault(); |
| | | if (routers == null || routers.Count == 0 || router == null) |
| | | { |
| | | WriteError(item.StationName, $"æªæ¾å°å¯¹åºè·¯ç±ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | if (routers.Count > 1) |
| | | { |
| | | WriteError(item.StationName, $"è·¯ç±ä¿¡æ¯é
ç½®é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | //åå
¥å
¥åºçº¿ä½å°å |
| | | device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode); |
| | | //æ´æ°ä»»å¡ä¿¡æ¯ |
| | | task.CurrentAddress = item.StationCode; |
| | | task.NextAddress = router.NextPosi; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·{conveyorLineInfoRead.TaskNo}ä¸ä¸æ¥"); |
| | | } |
| | | } |
| | | // 䏿¥¼åºåºå£å¤æçæAGVåæä»»å¡ |
| | | else if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0)//䏿¥¼åºåºå£å¤æçæAGVåæä»»å¡ |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | | if (task != null) |
| | | { |
| | | //åé
å··é åå
¥æçæ°æ® |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.NextAddress == x.StartPosi); |
| | | Dt_Router router = routers.FirstOrDefault(); |
| | | if (router == null) |
| | | { |
| | | WriteError(item.StationName, $"ä»»å¡å·:{task.TaskNum}æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | return Task.CompletedTask; |
| | | } |
| | | //æ´æ°ä»»å¡ä¿¡æ¯ |
| | | task.CurrentAddress = router.StartPosi; |
| | | task.NextAddress = task.TargetAddress; |
| | | task.DeviceCode = router.NextPosi; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Execute); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·{conveyorLineInfoRead.TaskNo}ä¸ä¸æ¥"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && deviceProRead != null && deviceProWrite != null) |
| | | { |
| | | //åºåºç«å°åé
åºåºå¯¹åºç®æ åºåºå£å°å |
| | | R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress); |
| | | |
| | | if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0) |
| | | { |
| | | //è·ååºåºç«å°æ¯å¦åå¨åºåºå¾
æ§è¡ä»»å¡ |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) |
| | | && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | | if (task != null) |
| | | // å
¥åºç«å°åé
è´§ä½åå¤å åå
¥åº |
| | | else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null) |
| | | { |
| | | //è·åè·¯ç±é
ç½® |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.CurrentAddress == x.StartPosi); |
| | | Dt_Router router = routers.FirstOrDefault(); |
| | | if (router == null) |
| | | if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0) |
| | | { |
| | | WriteError(item.StationName, $"ä»»å¡å·:{task.TaskNum}æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | return Task.CompletedTask; |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | | if (task != null) |
| | | { |
| | | //åé
è´§ä½ |
| | | string? local = _taskService.RequestAssignLocation(task.TaskNum, task.Roadway); |
| | | if (!string.IsNullOrEmpty(local)) |
| | | { |
| | | task.CurrentAddress = item.StackerCraneStationCode; |
| | | task.TargetAddress = local; |
| | | task.NextAddress = local; |
| | | task.DeviceCode = item.StackerCraneCode; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·:{task.TaskNum}è¿è¡å åæºå
¥åº"); |
| | | } |
| | | } |
| | | } |
| | | //åå
¥åºåºçº¿ä½å°å |
| | | device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·:{task.TaskNum}è¿è¡çº¿ä½åºåº"); |
| | | } |
| | | else if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && deviceProRead != null && deviceProWrite != null) |
| | | { |
| | | //åºåºç«å°åé
åºåºå¯¹åºç®æ åºåºå£å°å |
| | | if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0) |
| | | { |
| | | //è·ååºåºç«å°æ¯å¦åå¨åºåºå¾
æ§è¡ä»»å¡ |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) |
| | | && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | | if (task != null) |
| | | { |
| | | //è·åè·¯ç±é
ç½® |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.CurrentAddress == x.StartPosi); |
| | | Dt_Router router = routers.FirstOrDefault(); |
| | | if (router == null) |
| | | { |
| | | WriteError(item.StationName, $"ä»»å¡å·:{task.TaskNum}æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | return Task.CompletedTask; |
| | | } |
| | | //åå
¥åºåºçº¿ä½å°å |
| | | device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·:{task.TaskNum}è¿è¡çº¿ä½åºåº"); |
| | | } |
| | | } |
| | | } |
| | | // å°å½åç«å°çè¾éçº¿ä¿¡æ¯æ·»å å°æ°æ®å¯¹è±¡ï¼åªå
å«éè¦çåæ®µ |
| | | if (conveyorLineInfoRead != null) |
| | | { |
| | | var simplifiedInfo = new Dictionary<string, object>(); |
| | | simplifiedInfo["LineCode"] = device.DeviceCode; |
| | | simplifiedInfo["TaskNum"] = conveyorLineInfoRead.TaskNo; // ä»»å¡å· |
| | | simplifiedInfo["PalletCode"] = conveyorLineInfoRead.PalletCode;// æçæ¡ç |
| | | simplifiedInfo["HasGoods"] = conveyorLineInfoRead.TaskNo > 0; // æ¯å¦æè´§ |
| | | simplifiedInfo["Status"] = conveyorLineInfoRead.StatusPV;// ç¶æ |
| | | simplifiedInfo["Command"] = conveyorLineInfoRead.Command; // å½ä»¤ |
| | | ((Dictionary<string, Dictionary<string, object>>)conveyorLineCPData["ConveyorLineCPInfo"])[item.StationCode] = simplifiedInfo; |
| | | } |
| | | } |
| | | } |
| | |
| | | WriteError(item.StationName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | } |
| | | } |
| | | // éè¿WebSocketåéè¾éçº¿æ°æ®å°å端 |
| | | // åºååæ°æ® |
| | | string jsonData = JsonConvert.SerializeObject(conveyorLineCPData); |
| | | // åéæ°æ®å°ææå®¢æ·ç«¯ |
| | | _webSocketServer.PublishAllClientPayload(jsonData); |
| | | // è®°å½åéæ¥å¿ |
| | | WriteInfo(device.DeviceCode, $"WebSocketåéè¾éçº¿æ°æ®ï¼{jsonData}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | 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; |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | |
| | | 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 |
| | | { |
| | |
| | | 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; |
| | |
| | | _routerService = routerService; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _routerRepository = routerRepository; |
| | | _webSocketServer = webSocketServer; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | } |
| | | } |
| | | } |
| | | // 设置设å¤ç¼å·ï¼å端ç¨äºè¯å«å åæº |
| | | 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) |