| | |
| | | <button class="floorBtn btn-16" onclick="changFloor(this,2)" style="margin-top: 200px">2F</button> |
| | | <button class="floorBtn btn-16" onclick="changFloor(this,3)" style="margin-top: 250px">3F</button> |
| | | <button class="floorBtn btn-16" onclick="changFloor(this,4)" style="margin-top: 300px">4F</button> |
| | | <button class="floorBtn btn-16" onclick="changFloor(this,5)" style="margin-top: 350px">5F</button> |
| | | <button class="floorBtn btn-16" onclick="changFloor(this,6)" style="margin-top: 400px">6F</button> |
| | | <button class="floorBtn btn-16" onclick="changFloor(this,7)" style="margin-top: 450px">7F</button> |
| | | <button class="floorBtn btn-16" onclick="changFloor(this,8)" style="margin-top: 500px">8F</button> |
| | | <button class="floorBtn btn-16" onclick="changFloor(this,9)" style="margin-top: 550px">9F</button> |
| | | <button class="floorBtn btn-16" onclick="changFloor(this,10)" style="margin-top: 600px">10F</button> |
| | | </div> |
| | | <button class="floorBtn btn-16" onclick="testMove()" style="margin-top: 350px;font-size: 14px;">测试移动车</button> |
| | | <button class="floorBtn btn-16" onclick="resetMap()" style="margin-top: 400px;font-size: 14px;">重置地图</button> |
| | | <button class="floorBtn btn-16" onclick="resetMap()" style="margin-top: 650px;font-size: 14px;">重置地图</button> |
| | | <button class="floorBtn btn-16" onclick="testMove()" style="margin-top: 700px;font-size: 14px;">测试移动车</button> |
| | | |
| | | <!-- 货架 + 堆垛机 + 入库站点 --> |
| | | <div class="main-part"> |
| | | <!-- 第一组 --> |
| | | <div class="lane" id="mapDataId" style="margin-bottom: 280px"> |
| | | <div class="main-part" id="mapDataId"> |
| | | <!-- <!– 第一组 –>--> |
| | | <!-- <div class="lane" id="mapDataId" style="margin-bottom: 280px">--> |
| | | |
| | | </div> |
| | | <!-- </div>--> |
| | | </div> |
| | | </main> |
| | | <footer class="footer"> |
| | |
| | | <!-- 四向穿梭车状态 --> |
| | | <div class="line-status"> |
| | | <div class="body-head">穿梭车状态</div> |
| | | <div id="shuttle-status-box"> |
| | | <div id="shuttle-status-box" style="height: 100px;overflow-y: scroll;overflow-x: hidden;"> |
| | | </div> |
| | | <div class="button"><span>所有状态</span></div> |
| | | <div class="button item-group"> |
| | |
| | | <!-- 提升机状态 --> |
| | | <div class="line-status"> |
| | | <div class="body-head">提升机状态</div> |
| | | <div id="lift-status-box"> |
| | | <div id="lift-status-box" style="height: 120px;overflow-y: scroll;overflow-x: hidden;"> |
| | | |
| | | </div> |
| | | <div class="button"><span>所有状态</span></div> |
| | |
| | | $("#lift-status-box").empty() |
| | | res.data.forEach((item,index) => { |
| | | let liftStatusClass = "lift-idle" |
| | | switch (item.status) { |
| | | switch (item.protocolStatus) { |
| | | case 1://空闲 |
| | | liftStatusClass = "lift-idle"; |
| | | break |
| | |
| | | $("#shuttle-status-box").empty() |
| | | res.data.forEach((item,index) => { |
| | | let shuttleStatusClass = "shuttle-idle" |
| | | switch (item.status) { |
| | | switch (item.protocolStatus) { |
| | | case 1://空闲 |
| | | shuttleStatusClass = "shuttle-idle"; |
| | | break |
| | |
| | | } |
| | | let shuttleStatus = '<div class="state">' + |
| | | '<span>四向穿梭车 ' + item.shuttleNo + '</span>' + |
| | | '<span class="state-ss ' + shuttleStatusClass + '">' + item.status$ + '</span></div>'; |
| | | '<span class="state-ss ' + shuttleStatusClass + '">' + item.protocolStatus$ + '</span></div>'; |
| | | $("#shuttle-status-box").append(shuttleStatus) |
| | | |
| | | if(item.locNoLev != currentLev){ |
| | | if(item.wcsPoint.z != currentLev){ |
| | | //四向穿梭车楼层和当前地图楼层不一致,删除该车辆 |
| | | $("#sxcar-" + item.shuttleNo).remove() |
| | | }else { |
| | | //移动四向穿梭车 |
| | | moveCar(item.shuttleNo,item.locNoX,item.locNoY) |
| | | moveCar(item.shuttleNo,item.wcsPoint.x,item.wcsPoint.y) |
| | | } |
| | | }) |
| | | } |
| | |
| | | //计算四向穿梭车图标位置 |
| | | function getCarPosition(x,y) { |
| | | let top = (x * 35 - 35) + "px" //需要减去小车自己所占高度 |
| | | let left = (y * 70 - 70) + "px" //需要减去小车自己所占宽度 |
| | | let left = (y * 35 - 35) + "px" //需要减去小车自己所占宽度 |
| | | return [top,left]; |
| | | } |
| | | |
| | |
| | | method: 'POST', |
| | | success: function (res) { |
| | | res.data.forEach((item,index) => { |
| | | if(lev == item.locNoLev){ |
| | | let carBox = '<div class="sxcar" id="sxcar-' + item.shuttleNo + '"></div>' |
| | | if(lev == item.wcsPoint.z){ |
| | | let carBox = '<div class="sxcar" id="sxcar-' + item.shuttleNo + '">' + item.shuttleNo + '</div>' |
| | | $("#mapDataId").append(carBox) |
| | | } |
| | | }) |
| | |
| | | case 4: |
| | | //站点 |
| | | var data = colData.data; |
| | | col = '<div id="site-' + data + '" class="site">' + data + '(9991)</div>'; |
| | | col = '<div id="site-' + data + '" class="site">' + data + '</div>'; |
| | | break; |
| | | case 5: |
| | | //充电桩 |
| | | col = '<button class="item" style="font-size: 24px">⚡</button>'; |
| | | break; |
| | | default: |
| | | col = '<button class="item">' + idx + '</button>'; |
| | | let val = idx; |
| | | if (colData.data.length > 0) { |
| | | val = colData.data |
| | | } |
| | | col = '<button class="item">' + val + '</button>'; |
| | | } |
| | | |
| | | if(rowData.length - 2 == idx){ |
| | |
| | | |
| | | function testMove() { |
| | | getMap2TwoArr()//测试地图数据转换是否正常 |
| | | let json = "[{\n" + |
| | | "\t\t\"x\": 5,\n" + |
| | | "\t\t\"y\": 5\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 6,\n" + |
| | | "\t\t\"y\": 5\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 7,\n" + |
| | | "\t\t\"y\": 5\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 8,\n" + |
| | | "\t\t\"y\": 5\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 9,\n" + |
| | | "\t\t\"y\": 5\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 10,\n" + |
| | | "\t\t\"y\": 5\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 11,\n" + |
| | | "\t\t\"y\": 5\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 11,\n" + |
| | | "\t\t\"y\": 6\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 12,\n" + |
| | | "\t\t\"y\": 6\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 13,\n" + |
| | | "\t\t\"y\": 6\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 14,\n" + |
| | | "\t\t\"y\": 6\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 15,\n" + |
| | | "\t\t\"y\": 6\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 16,\n" + |
| | | "\t\t\"y\": 6\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 17,\n" + |
| | | "\t\t\"y\": 6\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 18,\n" + |
| | | "\t\t\"y\": 6\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 19,\n" + |
| | | "\t\t\"y\": 6\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 19,\n" + |
| | | "\t\t\"y\": 7\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 19,\n" + |
| | | "\t\t\"y\": 8\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 20,\n" + |
| | | "\t\t\"y\": 8\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 21,\n" + |
| | | "\t\t\"y\": 8\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 22,\n" + |
| | | "\t\t\"y\": 8\n" + |
| | | "\t},\n" + |
| | | "\t{\n" + |
| | | "\t\t\"x\": 23,\n" + |
| | | "\t\t\"y\": 8\n" + |
| | | "\t}\n" + |
| | | "]"; |
| | | let json = "[{\"x\":5,\"y\":5},{\"x\":6,\"y\":5},{\"x\":7,\"y\":5},{\"x\":8,\"y\":5},{\"x\":9,\"y\":5},{\"x\":10,\"y\":5},{\"x\":11,\"y\":5},{\"x\":11,\"y\":6},{\"x\":12,\"y\":6},{\"x\":13,\"y\":6},{\"x\":14,\"y\":6},{\"x\":15,\"y\":6},{\"x\":16,\"y\":6}]"; |
| | | json = JSON.parse(json) |
| | | json.forEach((item,index) => { |
| | | moveCar(1, item.x, item.y); |
| | | }) |
| | | |
| | | } |
| | | |
| | | /** |