| | |
| | | <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.point.x,car.point.y)[1] |
| | | ,top: getCarPosition(car.point.x,car.point.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> |
| | |
| | | }, |
| | | 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() //获取输送站点数据 |
| | |
| | | } |
| | | } |
| | | }, |
| | | 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); |
| | | } |
| | | } |
| | | } |