|
|
|
|
@ -508,7 +508,6 @@ 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 |
|
|
|
|
@ -623,7 +622,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)
|
|
|
|
|
@ -747,15 +746,15 @@ class MapDrawing extends EventEmitter { |
|
|
|
|
/** |
|
|
|
|
* 绘制仓库 |
|
|
|
|
*/ |
|
|
|
|
async drawWarehouses () { |
|
|
|
|
drawWarehouses () { |
|
|
|
|
// console.log('我不知道我调用了几次');
|
|
|
|
|
//调用一次
|
|
|
|
|
let self = this |
|
|
|
|
await Promise.all(Object.keys(this.property.warehouseInfo.storageRack).map(storageRackId => { |
|
|
|
|
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, |
|
|
|
|
@ -783,7 +782,7 @@ class MapDrawing extends EventEmitter { |
|
|
|
|
console.log(2222); |
|
|
|
|
storageRack.childNodes = self.drawRactangleInParent(storageRackInfo, freightSpaces, dictionary) |
|
|
|
|
} |
|
|
|
|
})) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
filterFreightSpace (rowIndex, columnIndex, levelIndex) { |
|
|
|
|
@ -806,10 +805,9 @@ class MapDrawing extends EventEmitter { |
|
|
|
|
/** |
|
|
|
|
* 绘制四向车通路 |
|
|
|
|
*/ |
|
|
|
|
async drawRoad () { |
|
|
|
|
drawRoad () { |
|
|
|
|
let self = this |
|
|
|
|
await Promise.all(Object.keys(this.property.warehouseInfo.fourwayCarRoad).map(fourwayCarRoadId => { |
|
|
|
|
// console.log('通道')
|
|
|
|
|
Object.keys(this.property.warehouseInfo.fourwayCarRoad).map(fourwayCarRoadId => { |
|
|
|
|
let fourwayCarRoad = this.property.warehouseInfo.fourwayCarRoad[fourwayCarRoadId] |
|
|
|
|
let stateDictionary = this.property.config.roadStateDictionary[this.property.config.roadStateDictionary.hasOwnProperty(fourwayCarRoad.state) ? fourwayCarRoad.state : '0'] |
|
|
|
|
|
|
|
|
|
@ -836,7 +834,7 @@ class MapDrawing extends EventEmitter { |
|
|
|
|
} else { |
|
|
|
|
fourwayCarRoad.childNodes = self.drawRactangleInParent(fourwayCarRoadInfo, children, dictionary) |
|
|
|
|
} |
|
|
|
|
})) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -1721,25 +1719,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 |
|
|
|
|
|