Compare commits

..

No commits in common. 'ab4f63608b67393d3d751fe46148ac113d33335a' and '773da525f07a3e15485038705196b444b1e7a4de' have entirely different histories.

  1. 32
      src/api/util/mapDrawing.js
  2. 5
      src/router/index.js
  3. 28
      src/views/libraryManage/mapRouter/index.vue
  4. 37
      src/views/libraryManage/warehouseMap/index.vue

@ -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

@ -106,11 +106,6 @@ export const constantRoutes = [
},
],
},
{
path: "/mapRouter",
component: () => import("@/views/libraryManage/mapRouter/index.vue"),
hidden: true,
},
// {
// path: "/",
// component: Layout,

@ -1,28 +0,0 @@
<script setup>
export default {
name: "mapRouter",
data() {
return {}
},
created() {
this.$router.replace('/libraryManage/warehouseMap');
},
// 使 watch
watch: {
'$route': function(to, from) {
// console.log('////')
this.$router.replace('/libraryManage/warehouseMap');
}
},
}
</script>
<template>
<div>
</div>
</template>
<style scoped lang="scss">
</style>

@ -1,8 +1,6 @@
<template>
<div class="app-container"
v-loading="loading"
>
<div class="app-container">
<div
class="dataContainer"
@ -379,8 +377,7 @@ export default {
num2: '',
num3: '',
num4: ''
},
loading: false
}
}
},
mounted() {
@ -391,12 +388,25 @@ export default {
}
var layerId1 = localStorage.getItem('level') || 'level-1'
this.mapControl.layerControl(layerId1, this.layer[layerId1], layerId1.slice(6, 7))
// this.init('piler')
// var layerId1 = localStorage.getItem('level') || 'level-1'
// this.mapControl.layerControl(layerId1, this.layer[layerId1], layerId1.slice(6, 7))
// console.log(layerId1, this.layer[layerId1], layerId1.slice(6, 7), this.layer)
// getLogicalAreaList({ pageNum: 1, pageSize: 999 }).then((response) => {
// this.LogicalAreaList = response.rows
// // this.paging.total = response.total
// this.loading = false
// })
// // clearInterval(timer)
// var timer = setInterval(() => {
// this.startMap()
// // console.log(2222)
// }, 30000)
},
methods: {
init(type) {
let self = this
this.type = type
this.config=JSON.parse(JSON.stringify(sysConfig))
switch (type) {
case 'fourwayCar':
this.config.mutiLayer = true
@ -410,14 +420,12 @@ export default {
this.config.warehouseType = 1
break
}
let container=null
container = document.getElementById('mapContainer')
let container = document.getElementById('mapContainer')
if (container) {
this.config.mapWidth = this.config.columnCount * this.config.standardXLength
this.config.mapHeight = this.config.rowCount * this.config.standardYLength
this.config.leftOffset = this.config.leftOffset - this.config.mapWidth / 2 - this.config.standardXLength / 2 - this.config.standardXLength * this.config.leftOffsetCell
this.config.topOffset = this.config.topOffset - this.config.mapHeight / 2 - this.config.standardYLength / 2 - this.config.standardYLength * this.config.topOffsetCell
this.mapControl =null
this.mapControl = new MapDrawing('mapContainer', {
width: container.offsetWidth - 10,
height: window.innerHeight - 10,
@ -485,7 +493,6 @@ export default {
}
}
this.mapControl.initWarehouse()
} else {
this.init()
}
@ -891,9 +898,13 @@ export default {
}
})
localStorage.setItem('layerItem', JSON.stringify(this.layer))
// location.reload()
this.$router.replace('/mapRouter');
// }
// this.layer[layerId1]
// this.layer[layerId] = !this.layer[layerId]
// this.mapControl.layerControl(layerId1, this.layer[layerId1], layerId1.slice(6, 7))
// this.mapControl.initWarehouse()
// console.log(this.layer[layerId]);
location.reload()
},
getPointPosition(tileData) {
// x

Loading…
Cancel
Save