From f23e0326aa05a1c5b47d4aec4c06e73d0d86b8e7 Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期二, 29 七月 2025 17:43:15 +0800 Subject: [PATCH] 代码提交 --- 项目代码/WCS/WIDESEAWCS_Client/src/views/Home.vue | 859 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 823 insertions(+), 36 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/Home.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/Home.vue" index 000c4e7..0ad79c8 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/Home.vue" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/Home.vue" @@ -1,51 +1,838 @@ <template> - <div class="title"></div> - <el-container> - <!-- <el-header >杩愯鏃ュ織</el-header> --> - <el-main> - <el-card v-for="(log, index) in logs" :key="index" class="log-card" :style="{ color: log.color }"> - <div :style="{ color: log.color }">{{ log.logEntry }}</div> - <div :style="{ color: log.color }">{{ log.time }}</div> - </el-card> - </el-main> - </el-container> + <div> + 111 + </div> + <div class="title"> + <el-row :gutter="20" style="height:100%"> + <el-col :span="8"> + <span style="position: relative; top: 100px;left: 30px;">绗竴灞�</span> + <el-row :gutter="20" style="height:1000px"> + <el-col :span="8"></el-col> + <el-col :span="8"> + <div class="line-container"> + <div class="RGVline"></div> + <div :class="updateRGVOne()" :style="{ marginTop: RGV01.LevelPoint + 'px' }" ref="childDot" @click="mouseClick">1</div> + <div :class="updateRGVTwo()" :style="{ marginTop: RGV02.LevelPoint + 'px' }" ref="childDot" @click="mouseClick">2</div> + </div> + </el-col> + <el-col :span="8"> + <div> + <div v-for="(group, index) in groupedLines(linescopy1)" :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: 118px;"></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" + :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" + :positionY="line.positionY" :condition="line.condition" /> + </div> + </div> + <div style="margin-top: 115px;"></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" + :equipNo="line.equipNo" :imgType="line.imgType" :positionX="line.positionX" + :positionY="line.positionY" :condition="line.condition" /> + </div> + </div> + <div style="margin-top: 112px;"></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" + :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(linescopy5)" :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(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> + </el-col> + </el-row> + + </el-col> + <el-col :span="8"> + <!-- 鍫嗗灈鏈� --> + <div style="position: relative; top: 50px;"> + <div class="stackerDiv"> + <div class="stackDivName">涓�鍙峰爢鍨涙満</div> + <LineComponent :x="xValue1" ref="stacker1" :equipNo="SC01"></LineComponent> + </div> + <el-divider></el-divider> + <div class="stackerDiv"> + <div class="stackDivName">浜屽彿鍫嗗灈鏈�</div> + <LineComponent :x="xValue2" ref="stacker2" :equipNo="SC02"></LineComponent> + </div> + <el-divider></el-divider> + <div class="stackerDiv"> + <div class="stackDivName">涓夊彿鍫嗗灈鏈�</div> + <LineComponent :x="xValue3" ref="stacker3" :equipNo="SC03"></LineComponent> + </div> + <el-divider></el-divider> + <div class="stackerDiv"> + <div class="stackDivName">鍥涘彿鍫嗗灈鏈�</div> + <LineComponent :x="xValue4" ref="stacker4" :equipNo="SC04"></LineComponent> + </div> + <el-divider></el-divider> + <div class="stackerDiv"> + <div class="stackDivName">浜斿彿鍫嗗灈鏈�</div> + <LineComponent :x="xValue5" ref="stacker5" :equipNo="SC05"></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-col :span="8"> + <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" :equipNo="line.equipNo" + :imgType="line.imgType" :positionX="line.positionX" :positionY="line.positionY" + url="api/Equipment/GetLineInfoByNo" :condition="line.condition" /> + </div> + </div> + <div style="margin-top: 105px;"></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" :equipNo="line.equipNo" + :imgType="line.imgType" :positionX="line.positionX" :positionY="line.positionY" + url="api/Equipment/GetLineInfoByNo" :condition="line.condition" /> + </div> + </div> + <div style="margin-top: 105px;"></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" :equipNo="line.equipNo" + :imgType="line.imgType" :positionX="line.positionX" :positionY="line.positionY" + url="api/Equipment/GetLineInfoByNo" :condition="line.condition" /> + </div> + </div> + <div style="margin-top: 105px;"></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" :equipNo="line.equipNo" + :imgType="line.imgType" :positionX="line.positionX" :positionY="line.positionY" + url="api/Equipment/GetLineInfoByNo" :condition="line.condition" /> + </div> + </div> + <div style="margin-top: 100px;"></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" :equipNo="line.equipNo" + :imgType="line.imgType" :positionX="line.positionX" :positionY="line.positionY" + url="api/Equipment/GetLineInfoByNo" :condition="line.condition" /> + </div> + </div> + <div style="margin-top: 100px;"></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" :equipNo="line.equipNo" + :imgType="line.imgType" :positionX="line.positionX" :positionY="line.positionY" + url="api/Equipment/GetLineInfoByNo" :condition="line.condition" /> + </div> + </div> + </div> + </el-col> --> + </el-row> + <el-row :gutter="20" class="cardWidthrow"> + <el-col :span="12"> + <div> + <span style="position: relative; top: 120px;left: 30px;">绗簩灞�</span> + <div v-for="(group, index) in groupedLines(linescopy4)" :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" + url="api/Equipment/GetLineInfoByNo" :condition="line.condition" /> + </div> + </div> + </div> + </el-col> + + </el-row> + + </div> + </template> <script> -import { ref, onMounted } from 'vue' -import eventBus from "@/uitils/eventBus"; +import { onMounted, ref, reactive } from "vue"; +// import StackerInfo from "./StackerInfo.vue"; +// import LineInfo from "./LineInfo.vue"; +import LineInfoCopy from "./LineInfocopy.vue"; +import LineComponent from './LineComponent.vue'; +import eventBus from "../uitils/eventBus"; + export default { - setup() { - const logs = ref([]); - onMounted(() => { - eventBus.on('Logs', eventData => { - if (logs.value.length > 500) { - logs.value = []; + data() { + return { + linescopy1: [ + { + equipNo: "1005", + 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, + condition: false, + }, { + equipNo: "2002", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + { + equipNo: "2001", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + + { + equipNo: "2004", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + { + equipNo: "2003", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + ], + linescopy2: [ + { + equipNo: "1009", + 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: "1012", + imgType: "1", + positionX: 0.6, + positionY: 20, + condition: false, + }, { + equipNo: "2006", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + { + equipNo: "2005", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + { + equipNo: "2008", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + { + equipNo: "2007", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + ], + linescopy3: [ + { + equipNo: "1017", + 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: "1020", + imgType: "1", + positionX: 0.6, + positionY: 20, + condition: false, + }, { + equipNo: "2010", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + { + equipNo: "2009", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + { + equipNo: "2012", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + { + equipNo: "2011", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + ], + linescopy4: [ + { + equipNo: "1021", + 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, + condition: false, + }, { + equipNo: "2014", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + { + equipNo: "2013", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + { + equipNo: "2016", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + { + equipNo: "2015", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + ], + linescopy5: [ + { + equipNo: "1031", + 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, + condition: false, + }, { + equipNo: "2018", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + { + equipNo: "2017", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + { + equipNo: "2020", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + { + equipNo: "2019", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + ], + linescopy6: [ + { + equipNo: "1035", + 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, + condition: false, + }, { + equipNo: "2022", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + { + equipNo: "2021", + imgType: "1", + positionX: 26, + positionY: 8, + condition: false, + }, + { + equipNo: "2024", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + { + equipNo: "2023", + imgType: "1", + positionX: 26, + positionY: 20, + condition: false, + }, + ], + StackerCrane: { + Automatic: "", + Fault: "", + CurrentLayer: "", + CurrentRow: "1", + CurrentColumn: "", + CurrentTaskNum: "", + Running: "", + DeviceName: "", + }, + xValue1: 0, + xValue2: 0, + xValue3: 0, + xValue4: 0, + xValue5: 0, + xValue6: 0, + timer1: null, // 瀹氭椂鍣ㄥ彉閲� + timer2: null, // 瀹氭椂鍣ㄥ彉閲� + RGV01:{ + Automatic: "", + Fault: "", + LevelPoint:0, + CurrentTaskNum: "", + Running: "", + DeviceName: "", + DeviceCode:"RGV01", + }, + RGV02:{ + Automatic: "", + Fault: "", + LevelPoint:1280, + CurrentTaskNum: "", + Running: "", + DeviceName: "", + DeviceCode:"RGV02", + }, + RGV03:{ + Automatic: "", + Fault: "", + LevelPoint:0, + CurrentTaskNum: "", + Running: "", + DeviceName: "", + DeviceCode:"", + }, + }; + }, + components: { + LineInfoCopy, + LineComponent, + }, + 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); + }, + updateRGVOne(){ + if(this.RGV01.Automatic=="鑱旀満妯″紡"&&this.RGV01.Fault!="鏁呴殰"&&this.RGV01.Running=="寰呮満"){ + return 'dot-Automatic '; } - const logEntry = "鏃ュ織淇℃伅锛�" + eventData.log - const time = "鏃堕棿锛�" + eventData.time - logs.value.unshift({ logEntry: logEntry, time: time, color: eventData.color }); - - // logs.value.unshift(logEntry); - }); - }); - return { - logs - } - } -} + else if(this.RGV01.Automatic=="鑱旀満妯″紡"&&this.RGV01.Fault!="鏁呴殰"&&this.RGV01.Running=="杩愯涓�"){ + return 'dot-Running '; + }else if(this.RGV01.Fault=="鏁呴殰"){ + return 'dot-Fault '; + }else{ + return 'dot-Fault '; + } + }, + updateRGVTwo(){ + if(this.RGV02.Automatic=="鑱旀満妯″紡"&&this.RGV02.Fault!="鏁呴殰"&&this.RGV02.Running=="寰呮満"){ + return 'dot-Automatic '; + } + else if(this.RGV02.Automatic=="鑱旀満妯″紡"&&this.RGV01.Fault!="鏁呴殰"&&this.RGV02.Running=="杩愯涓�"){ + return 'dot-Running '; + }else if(this.RGV02.Fault=="鏁呴殰"){ + return 'dot-Fault '; + }else{ + return 'dot-Fault '; + } + }, + updateRGV03(){ + if(this.RGV03.Automatic=="鑱旀満妯″紡"&&this.RGV03.Fault!="鏁呴殰"&&this.RGV03.Running=="寰呮満"){ + return 'dot-Automatic '; + } + else if(this.RGV03.Automatic=="鑱旀満妯″紡"&&this.RGV03.Fault!="鏁呴殰"&&this.RGV03.Running=="杩愯涓�"){ + return 'dot-Running '; + }else if(this.RGV03.Fault=="鏁呴殰"){ + return 'dot-Fault '; + }else{ + return 'dot-Fault '; + } + }, + }, + computed: { + + }, + mounted() { + }, + created() { + eventBus.on('stackerData', eventData => { + + const stackerComponentsMap = { + "SC01": 'stacker1', + "SC02": 'stacker2', + "SC03": 'stacker3', + "SC04": 'stacker4', + "SC05": 'stacker5', + "SC06": 'stacker6', + }; + const componentKey = stackerComponentsMap[eventData.data.deviceCode]; + if (componentKey) { + this.StackerCrane.Automatic=eventData.data.automatic; + this.StackerCrane.Fault=eventData.data.fault; + this.StackerCrane.Running=eventData.data.running; + this.StackerCrane.CurrentColumn=eventData.data.currentColumn; + this.StackerCrane.CurrentLayer=eventData.data.currentLayer; + this.StackerCrane.LevelPoint=eventData.data.levelPoint; + this.StackerCrane.DeviceName=eventData.data.deviceName; + this.$nextTick(() => { + this.$refs[componentKey].moveDot(this.StackerCrane); + }); + } + }); + + eventBus.on('RGVData', eventData => { + + if(eventData.data.deviceCode=="RGV01"){ + this.RGV01.Automatic=eventData.data.automatic; + this.RGV01.Fault=eventData.data.fault; + this.RGV01.Running=eventData.data.running; + this.RGV01.LevelPoint=eventData.data.levelPoint; + this.RGV01.DeviceName=eventData.data.deviceName; + console.log(this.RGV01.LevelPoint) + }else if(eventData.data.deviceCode=="RGV02"){ + this.RGV02.Automatic=eventData.data.automatic; + this.RGV02.Fault=eventData.data.fault; + this.RGV02.Running=eventData.data.running; + this.RGV02.LevelPoint=eventData.data.levelPoint; + this.RGV02.DeviceName=eventData.data.deviceName; + }else if(eventData.data.deviceCode=="RGV03"){ + this.RGV03.Automatic=eventData.data.automatic; + this.RGV03.Fault=eventData.data.fault; + this.RGV03.Running=eventData.data.running; + this.RGV03.LevelPoint=eventData.data.levelPoint; + this.RGV03.DeviceName=eventData.data.deviceName; + } + + }); + + eventBus.on("LineData", eventData => { + const stationMap = { + "SC01": this.linescopy1, + "SC02": this.linescopy2, + "SC03": this.linescopy3, + "SC04": this.linescopy4, + "SC05": this.linescopy5, + "SC06": this.linescopy6, + "SC07": this.linescopy7, + }; + + var station = eventData.stationChildCode; + if (stationMap[eventData.roadway]) { + stationMap[eventData.roadway].forEach((line) => { + if (line.equipNo === station) { + line.condition = eventData.inStock; + } + }) + } + }) + }, +}; </script> <style scoped> +/* .positionY-group { + margin-bottom: 10px; +} */ .title { - line-height: 70vh; - text-align: center; - font-size: 28px; - color: orange; + height: 1500px; } -.log-card { - margin-bottom: 10px; +.cardWidth { + height: 100%; + width: 100%; + box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04); +} + +.cardWidthrow { + height: 40%; + width: 100%; + margin-top: 10px; + box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04); +} + +.divider { + top: 50px; +} + +.layerSize { + position: absolute; + top: 100px; + left: 30px; + color: fuchsi +} + +.stackerDiv { + border: 1px solid rgba(0, 195, 255, 0.822); + width: 980px; + padding-left: 3px; +} + +.stackDivName { + text-align: center; + color: rgba(0, 195, 255, 0.822); + margin-bottom: 12px; +} +.dot-Running { + position: absolute; + top: -5px; + width: 20px; + height: 20px; + 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; + color: white; +} +.dot-Automatic { + position: absolute; + top: -5px; + width: 20px; + height: 20px; + 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; + color: white; +} + +.dot-Fault { + position: absolute; + top: -5px; + width: 20px; + height: 20px; + /* right:0px; */ + 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; + color: white; +} + + +.line-container { + position: relative; + height: 1280px; + background-color: #ecf5ff; + width: 20px; + top:30px; + left:200px +} +.RGVline { + position: absolute; + top: 0; + left: 0; + right: 0; + height: 2px; + background-color: #a0cfff; +} +.line { + position: absolute; + top: 0; + left: 0; + right: 0; + height: 2px; + background-color: #a0cfff; } </style> \ No newline at end of file -- Gitblit v1.9.3