| | |
| | | <div class="floorBtnBox" v-for="(lev,idx) in floorList"> |
| | | <el-button :style="{background:currentLev === lev ? '#7DCDFF':''}" @click="changeFloor(lev)">{{lev}}F</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button @click="testMove()">测试移动车</el-button> |
| | | </div> |
| | | <div style="margin-top: 10px;"> |
| | | <el-button @click="resetMap()">重置地图</el-button> |
| | | </div> |
| | |
| | | data: { |
| | | map: [], |
| | | currentLev: 1, |
| | | floorList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], //当前项目楼层 |
| | | floorList: [1, 2, 3], //当前项目楼层 |
| | | currentLevShuttleList: [],//当前楼层四向穿梭车集合 |
| | | shuttleColorList: [],//四向穿梭车颜色集合 |
| | | drawer: false, |
| | |
| | | deep: true, |
| | | handler(val) { |
| | | if (!val) { |
| | | var sprite = pixiStageList[this.drawerLocNoData.x][this.drawerLocNoData.y]; |
| | | var sprite = pixiStageList[this.drawerLocNoData.x - 1][this.drawerLocNoData.y]; |
| | | updateColor(sprite, 0xFFFFFF);//恢复颜色 |
| | | } |
| | | } |
| | |
| | | this.getShuttleStateInfo() //获取四向穿梭车信息 |
| | | this.getLiftStateInfo() //获取提升机信息 |
| | | this.getSiteInfo() //获取输送站点数据 |
| | | // this.getCodeData()//获取条码 |
| | | }, 1000) |
| | | |
| | | }, |
| | |
| | | } |
| | | |
| | | if (val.value == -999) { |
| | | pixiShuttleLockPathMap.set(this.getLocNoByXYZ(index + 1, idx, this.currentLev), sprite); |
| | | pixiShuttleLockPathMap.set(this.getLocNoByXYZ(val.row, val.bay, this.currentLev), sprite); |
| | | objectsContainer3.addChild(sprite); |
| | | }else { |
| | | objectsContainer.addChild(sprite); |
| | |
| | | pixiStageList[index][idx] = sprite |
| | | } |
| | | }); |
| | | |
| | | //视角居中 |
| | | let containerWidth = (pixiApp.view.width - objectsContainer.width) / 2; |
| | | let containerHeight = (pixiApp.view.height - objectsContainer.height) / 2; |
| | | pixiApp.stage.position.set(containerWidth, containerHeight); |
| | | }else { |
| | | let diff = this.findDiffList(this.map, map); |
| | | diff.forEach((item, index) => { |
| | |
| | | }); |
| | | |
| | | return flag; |
| | | }, |
| | | findShuttlePathDiffList(list1, list2) { |
| | | //检测集合1里面的小车预计路径是否在集合2中有变动 |
| | | if (list1.length == 0) { |
| | | return false;//集合为空 |
| | | } |
| | | if (list1.length != list2.length) { |
| | | return false;//两个集合长度不一致 |
| | | } |
| | | |
| | | for (var index = 0; index < list1.length; index++) { |
| | | let item = list1[index]; |
| | | for (var i = 0; i < list2.length; i++) { |
| | | if (item.shuttleNo != list2[i].shuttleNo) { |
| | | continue;//找不到小车号 |
| | | } |
| | | |
| | | if (item.moveAdvancePath == null) { |
| | | item.moveAdvancePath = []; |
| | | } |
| | | |
| | | if (list2[i].moveAdvancePath == null) { |
| | | list2[i].moveAdvancePath = []; |
| | | } |
| | | |
| | | if (!(item.moveAdvancePath.length == list2[i].moveAdvancePath.length)) { |
| | | return false;//小车预计路径长度不一致 |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | }, |
| | | checkStaInListDiff(sta, list) { |
| | | //检测站点是否在集合中有变动 |
| | |
| | | } |
| | | }, |
| | | getLocNoByXYZ(x, y, z) { |
| | | let locNo = ""; |
| | | if (x < 10) { |
| | | locNo += "0" + x; |
| | | }else { |
| | | locNo += x; |
| | | } |
| | | |
| | | if (y < 100) { |
| | | locNo += "0" + y; |
| | | }else if (y < 10) { |
| | | locNo += "00" + y; |
| | | }else { |
| | | locNo += y; |
| | | } |
| | | |
| | | if (z < 10) { |
| | | locNo += "0" + z; |
| | | }else { |
| | | locNo += z; |
| | | } |
| | | let locNo = x + "-" + y + "-" + z; |
| | | return locNo; |
| | | }, |
| | | addMoveAdvancePath(moveAdvancePath, shuttleNo) {//添加预计路径 |
| | |
| | | }) |
| | | } |
| | | }, |
| | | resetMap() { |
| | | //重置地图 |
| | | let that = this |
| | | $.ajax({ |
| | | url:baseUrl+"/console/map/resetMap/" + this.currentLev, |
| | | headers:{ |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | data:{}, |
| | | method:'get', |
| | | success:function (res) { |
| | | that.$message({ |
| | | message: that.currentLev + '层地图重置完成', |
| | | type: 'success' |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | }) |
| | | |