| | |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../static/vue/element/element.js"></script> |
| | | <style> |
| | | |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div id="app"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <!--输出小车--> |
| | | <div v-for="(car,idx) in currentLevShuttleList" |
| | | :style="{ |
| | | left: getCarPosition(car.wcsPoint.x,car.wcsPoint.y)[1] |
| | | ,top: getCarPosition(car.wcsPoint.x,car.wcsPoint.y)[0] |
| | | ,color: shuttleColorList[car.shuttleNo] |
| | | }" |
| | | class="sxcar" :id="'sxcar-' + car.shuttleNo"> |
| | | {{car.shuttleNo}} |
| | | <div |
| | | v-for="(car, idx) in currentLevShuttleList" |
| | | :style="{ |
| | | '--x-pos': getCarPosition(car.point.x, car.point.y)[1], |
| | | '--y-pos': getCarPosition(car.point.x, car.point.y)[0], |
| | | color: shuttleColorList[car.shuttleNo] |
| | | }" |
| | | class="sxcar" |
| | | :id="'sxcar-' + car.shuttleNo" |
| | | > |
| | | {{ car.shuttleNo }} |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | </div> |
| | | <div> |
| | | <!-- <el-button @click="testMove()">测试移动车</el-button>--> |
| | | <el-button @click="resetMap()">重置地图</el-button> |
| | | <!-- <el-button @click="resetMap()">重置地图</el-button>--> |
| | | <!-- <el-button @click="initLoc()">初始化库位</el-button>--> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <span class="lift-offline">离线</span> |
| | | </div> |
| | | </div> |
| | | <!-- 输送线状态 --> |
| | | <div class="line-status"> |
| | | <div class="body-head">输送线状态</div> |
| | | <div class="state states"> |
| | | <span>运输线总数</span> |
| | | <span class="line-ss">9</span> |
| | | </div> |
| | | <div class="allStatus"><span>所有状态</span></div> |
| | | <div class="allStatus item-group"> |
| | | <span class="site-auto-run-id">自动+有物+ID</span> |
| | | <span class="site-auto-run">自动+有物</span> |
| | | <span class="site-auto-id">自动+ID</span> |
| | | <span class="site-auto">自动</span> |
| | | <span class="site-unauto">非自动/手动</span> |
| | | </div> |
| | | </div> |
| | | <!-- 条码表格 --> |
| | | <div class="bar-code"> |
| | | <div class="body-head" id="code">条码扫描器</div> |
| | | <div class="tablebox"> |
| | | <div class="table-head"> |
| | | <li><span>条码名称</span><span class="right">扫码时间</span></li> |
| | | </div> |
| | | <div id="barcode1" class="table-body"> |
| | | <li v-for="(item,index) in codeList1" :key="index"><span>{{item.barcode}}</span><span class="right">{{item.time}}</span></li> |
| | | </div> |
| | | </div> |
| | | <div class="tablebox"> |
| | | <div class="table-head"> |
| | | <li><span>条码名称</span><span class="right">扫码时间</span></li> |
| | | </div> |
| | | <div id="barcode2" class="table-body"> |
| | | <li v-for="(item,index) in codeList2" :key="index"><span>{{item.barcode}}</span><span class="right">{{item.time}}</span></li> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <!– 输送线状态 –>--> |
| | | <!-- <div class="line-status">--> |
| | | <!-- <div class="body-head">输送线状态</div>--> |
| | | <!-- <div class="state states">--> |
| | | <!-- <span>运输线总数</span>--> |
| | | <!-- <span class="line-ss">9</span>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="allStatus"><span>所有状态</span></div>--> |
| | | <!-- <div class="allStatus item-group">--> |
| | | <!-- <span class="site-auto-run-id">自动+有物+ID</span>--> |
| | | <!-- <span class="site-auto-run">自动+有物</span>--> |
| | | <!-- <span class="site-auto-id">自动+ID</span>--> |
| | | <!-- <span class="site-auto">自动</span>--> |
| | | <!-- <span class="site-unauto">非自动/手动</span>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <!– 条码表格 –>--> |
| | | <!-- <div class="bar-code">--> |
| | | <!-- <div class="body-head" id="code">条码扫描器</div>--> |
| | | <!-- <div class="tablebox">--> |
| | | <!-- <div class="table-head">--> |
| | | <!-- <li><span>条码名称</span><span class="right">扫码时间</span></li>--> |
| | | <!-- </div>--> |
| | | <!-- <div id="barcode1" class="table-body">--> |
| | | <!-- <li v-for="(item,index) in codeList1" :key="index"><span>{{item.barcode}}</span><span class="right">{{item.time}}</span></li>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="tablebox">--> |
| | | <!-- <div class="table-head">--> |
| | | <!-- <li><span>条码名称</span><span class="right">扫码时间</span></li>--> |
| | | <!-- </div>--> |
| | | <!-- <div id="barcode2" class="table-body">--> |
| | | <!-- <li v-for="(item,index) in codeList2" :key="index"><span>{{item.barcode}}</span><span class="right">{{item.time}}</span></li>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- 输送设备弹窗 --> |
| | | <div id="siteWindow" :style="{display:siteWindow?'block':'none'}" class="animate__animated animate__fadeIn"> |
| | |
| | | map: [],//地图数据 |
| | | currentLev: 1,//地图当前楼层 |
| | | siteWindow: false, //站点弹窗显示默认不显示 |
| | | floorList: [1, 2, 3], //当前项目楼层 |
| | | floorList: [], //当前项目楼层 |
| | | shuttleList: [], //四向穿梭车集合 |
| | | currentLevShuttleList: [],//当前楼层四向穿梭车集合 |
| | | shuttleColorList: [],//四向穿梭车颜色集合 |
| | |
| | | }, |
| | | methods: { |
| | | init() { |
| | | this.ws = new WebSocket("ws://" + window.location.host + baseUrl + "/console/websocket"); |
| | | this.ws.onopen = this.webSocketOnOpen |
| | | this.ws.onerror = this.webSocketOnError |
| | | this.ws.onmessage = this.webSocketOnMessage |
| | | this.ws.onclose = this.webSocketClose |
| | | |
| | | this.getMap(this.currentLev) |
| | | this.getSystemRunningStatus() //获取系统运行状态 |
| | | this.initLev()//初始化楼层信息 |
| | | |
| | | this.consoleInterval = setInterval(() => { |
| | | this.websocketConnect() |
| | | |
| | | this.getShuttleStateInfo() //获取四向穿梭车信息 |
| | | this.getLiftStateInfo() //获取提升机信息 |
| | | this.getSiteInfo() //获取输送站点数据 |
| | |
| | | let tmp = null |
| | | tmp = setInterval(() => { |
| | | if (index < res.length) { |
| | | that.currentLevShuttleList[0].wcsPoint.y = res[index].y |
| | | that.currentLevShuttleList[0].wcsPoint.x = res[index].x |
| | | that.currentLevShuttleList[0].point.y = res[index].y |
| | | that.currentLevShuttleList[0].point.x = res[index].x |
| | | index++ |
| | | }else { |
| | | clearInterval(tmp) |
| | |
| | | } |
| | | }) |
| | | }, |
| | | initLev(){ |
| | | let that = this |
| | | $.ajax({ |
| | | url: baseUrl + "/console/map/lev/list", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | data: {}, |
| | | method: 'get', |
| | | success: function(res) { |
| | | if (res.code === 200) { |
| | | that.floorList = res.data; |
| | | } else if (res.code === 403) { |
| | | parent.location.href = baseUrl + "/login"; |
| | | } else { |
| | | that.$message({ |
| | | message: res.msg, |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | getCodeData(){ |
| | | this.sendWs(JSON.stringify({ |
| | | "url": "/console/barcode/output/site", |
| | |
| | | } |
| | | } |
| | | }, |
| | | websocketConnect() { |
| | | if (this.ws == null) { |
| | | this.ws = new WebSocket("ws://" + window.location.host + baseUrl + "/console/websocket"); |
| | | this.ws.onopen = this.webSocketOnOpen |
| | | this.ws.onerror = this.webSocketOnError |
| | | this.ws.onmessage = this.webSocketOnMessage |
| | | this.ws.onclose = this.webSocketClose |
| | | } |
| | | }, |
| | | webSocketOnOpen(e) { |
| | | console.log("open"); |
| | | }, |
| | | webSocketOnError(e) { |
| | | this.ws = null; |
| | | console.log(e); |
| | | }, |
| | | webSocketOnMessage(e) { |
| | |
| | | } |
| | | }, |
| | | webSocketClose(e) { |
| | | this.ws = null; |
| | | console.log("close"); |
| | | }, |
| | | sendWs(message) { |
| | | if (this.ws == null) { |
| | | return; |
| | | } |
| | | |
| | | if (this.ws.readyState == WebSocket.OPEN) { |
| | | this.ws.send(message) |
| | | this.ws.send(message); |
| | | } |
| | | } |
| | | } |