实时地图增加取放货点

This commit is contained in:
yyy 2025-07-18 15:21:28 +08:00
parent 44b4935aa4
commit f62e0b5f0a

View File

@ -152,19 +152,39 @@
</div>
</div>
</div>
<div v-else-if="item.type === 8">
<div class="indexpage-popover-item">
<div> 节点类型 </div>
<div>取放货点</div>
<div>
{{ item.sortNum || '' }}
</div>
</div>
<div class="indexpage-popover-item">
<div>
<div
v-for="(location, locationIndex) in item.dataList"
:key="locationIndex"
>
<span style="margin-right: 10px"
>节点名称{{ location.pointName || '' }}
</span>
<span>托盘高度{{ location.trayHeight || '' }}</span>
</div>
</div>
</div>
</div>
<div v-else>
<div class="indexpage-popover-item">
<div> 节点类型 </div>
<div>{{
item.type == 1
? '路径点'
: item.type == 4
? '停车点'
: item.type == 5
? '区域变更点'
: item.type == 6
? '等待点'
: ''
item.type == 4
? '停车点'
: item.type == 5
? '区域变更点'
: item.type == 6
? '等待点'
: ''
}}</div>
<div>
{{ item.sortNum || '' }}
@ -173,18 +193,24 @@
</div>
</template>
<div>
<div
v-if="
item.type !== 1 &&
legendObj.sortNumberShow &&
item.sortNum &&
sortNumberShow
"
class="sort-num-location"
:style="getSortNumLocationStyle(item, index)"
>
{{ item.sortNum }}
</div>
<!-- sortNum -->
<template v-if="legendObj.sortNumberShow && item.sortNum && sortNumberShow">
<div
v-if="item.type === 8"
class="sort-num"
:style="getSortNumStyle(item, index)"
>
{{ item.sortNum }}
</div>
<div
v-else
class="sort-num-location"
:style="getSortNumLocationStyle(item, index)"
>
{{ item.sortNum }}
</div>
</template>
<!-- 库位点 -->
<img
v-if="item.type === 2"
@ -220,6 +246,16 @@
style="background: #fff"
:style="nodeStyle(item, index)"
/>
<!-- 取货点 -->
<div
v-else-if="item.type === 8"
:style="{
width: Number(item.locationWidePx) * Number(radio) + 'px',
height: Number(item.locationDeepPx) * Number(radio) + 'px',
backgroundColor: '#000',
borderRadius: '50%'
}"
></div>
</div>
</el-tooltip>
</div>
@ -347,7 +383,33 @@ const nodeStyle = (item, index) => {
borderRadius: '3px'
}
}
//sortNum
const getSortNumStyle = (item, index) => {
let leftNum = 0
if (item.sortNum.toString().length === 1) {
leftNum = 3
} else if (item.sortNum.toString().length === 2) {
leftNum = 7
} else if (item.sortNum.toString().length === 3) {
leftNum = 10
} else if (item.sortNum.toString().length === 4) {
leftNum = 14
} else if (item.sortNum.toString().length === 5) {
leftNum = 18
} else if (item.sortNum.toString().length === 6) {
leftNum = 21
} else if (item.sortNum.toString().length === 7) {
leftNum = 25
} else if (item.sortNum.toString().length === 8) {
leftNum = 28
} else if (item.sortNum.toString().length === 9) {
leftNum = 31
}
return {
left: Number(item.locationWidePx) / 2 - leftNum + 'px',
top: 6 + 'px'
}
}
//sortNum
const getSortNumLocationStyle = (item, index) => {
let leftNum = 0
@ -823,6 +885,11 @@ const getAllNodeList = async (positionMapId) => {
item.dataObj = JSONBigInt({ storeAsString: true }).parse(item.dataJson)
item.locationDeep = item.dataObj.locationDeep
item.locationWide = item.dataObj.locationWide
} else if (item.type === 8) {
item.dataObj = {}
item.dataList = item.dataJson ? JSONBigInt({ storeAsString: true }).parse(item.dataJson) : []
item.locationDeep = 40
item.locationWide = 40
}
//cmpx
if (item.locationWide && item.locationDeep) {