From 173db89e601e5f92c45206a6f61546862b49b623 Mon Sep 17 00:00:00 2001 From: zhaoxiaomin <1912125868@qq.com> Date: Fri, 26 Apr 2024 17:27:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=9C=B0=E5=9B=BE=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/util/mapDrawing.js | 32 ++++++++-------- src/router/index.js | 5 +++ src/views/libraryManage/mapRouter/index.vue | 28 ++++++++++++++ .../libraryManage/warehouseMap/index.vue | 37 +++++++------------ 4 files changed, 63 insertions(+), 39 deletions(-) create mode 100644 src/views/libraryManage/mapRouter/index.vue diff --git a/src/api/util/mapDrawing.js b/src/api/util/mapDrawing.js index 07bc1ca..3bd013a 100644 --- a/src/api/util/mapDrawing.js +++ b/src/api/util/mapDrawing.js @@ -508,6 +508,7 @@ class MapDrawing extends EventEmitter { var gubeMaterial = new THREE.MeshMatcapMaterial({ color: self.loadColor(info.color) }) + var gubeMesh = new THREE.Mesh(gube, gubeMaterial) // gubeMesh.position.set(info.p3[0], info.p3[1], info.p3[2]) gubeMesh.nodeId = info.id @@ -622,7 +623,7 @@ class MapDrawing extends EventEmitter { canvas.height = info.height // 设置文字 ctx.fillStyle = 'transparent' - + ctx.fillRect(0, 0, info.width, info.height) rows.map((row, index) => { // if(latticeForPiler1) @@ -746,15 +747,15 @@ class MapDrawing extends EventEmitter { /** * 绘制仓库 */ - drawWarehouses () { + async drawWarehouses () { // console.log('我不知道我调用了几次'); //调用一次 let self = this - Object.keys(this.property.warehouseInfo.storageRack).map(storageRackId => { + await Promise.all(Object.keys(this.property.warehouseInfo.storageRack).map(storageRackId => { let storageRack = this.property.warehouseInfo.storageRack[storageRackId] let stateDictionary = this.property.config.tileStateDictionary[this.property.config.tileStateDictionary.hasOwnProperty(storageRack.state) ? storageRack.state : '0'] //疑似仓库地图 点位`1 - console.log(this.property.layer.levels.nowLevel); + // console.log('仓库',this.property.layer.levels.nowLevel); let storageRackInfo = { id: storageRack.id, @@ -782,7 +783,7 @@ class MapDrawing extends EventEmitter { console.log(2222); storageRack.childNodes = self.drawRactangleInParent(storageRackInfo, freightSpaces, dictionary) } - }) + })) } filterFreightSpace (rowIndex, columnIndex, levelIndex) { @@ -805,9 +806,10 @@ class MapDrawing extends EventEmitter { /** * 绘制四向车通路 */ - drawRoad () { + async drawRoad () { let self = this - Object.keys(this.property.warehouseInfo.fourwayCarRoad).map(fourwayCarRoadId => { + await Promise.all(Object.keys(this.property.warehouseInfo.fourwayCarRoad).map(fourwayCarRoadId => { + // console.log('通道') let fourwayCarRoad = this.property.warehouseInfo.fourwayCarRoad[fourwayCarRoadId] let stateDictionary = this.property.config.roadStateDictionary[this.property.config.roadStateDictionary.hasOwnProperty(fourwayCarRoad.state) ? fourwayCarRoad.state : '0'] @@ -834,7 +836,7 @@ class MapDrawing extends EventEmitter { } else { fourwayCarRoad.childNodes = self.drawRactangleInParent(fourwayCarRoadInfo, children, dictionary) } - }) + })) } /** @@ -1719,25 +1721,25 @@ class MapDrawing extends EventEmitter { } } - initWarehouse () { + initWarehouse () { if (this.property.warehouseInfo) { - this.drawWarehouses() + if (this.property.config.vehicleType === 1) { - // this.drawPilers() - // this.drawBelt() + } else { this.drawRoad() } + this.drawWarehouses() // this.drawCars() } else { this.initLight() } this.animate() this.initEvent() - // if (this.property.grid) { - // this.initGrid(this.property.grid.width, this.property.grid.height, this.property.grid.singleWidth, this.property.grid.singleHeight) - // } + } + + } export default MapDrawing diff --git a/src/router/index.js b/src/router/index.js index 7b3e1e1..2270638 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -106,6 +106,11 @@ export const constantRoutes = [ }, ], }, + { + path: "/mapRouter", + component: () => import("@/views/libraryManage/mapRouter/index.vue"), + hidden: true, + }, // { // path: "/", // component: Layout, diff --git a/src/views/libraryManage/mapRouter/index.vue b/src/views/libraryManage/mapRouter/index.vue new file mode 100644 index 0000000..e516b65 --- /dev/null +++ b/src/views/libraryManage/mapRouter/index.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/src/views/libraryManage/warehouseMap/index.vue b/src/views/libraryManage/warehouseMap/index.vue index 7a5d192..afe5e08 100644 --- a/src/views/libraryManage/warehouseMap/index.vue +++ b/src/views/libraryManage/warehouseMap/index.vue @@ -1,6 +1,8 @@