编辑路线添加 出发点序号 结束点序号
This commit is contained in:
parent
b9edaf6469
commit
56953f77d1
@ -167,4 +167,9 @@ export const getRobotByFloorAndArea = async (params) => {
|
|||||||
return await request.post({ url: `/system/robot/information/getRobotByFloorAndArea`, params })
|
return await request.post({ url: `/system/robot/information/getRobotByFloorAndArea`, params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//根据点位获取库位信息列表
|
||||||
|
export const getByMapItemId = async (mapId, mapItemId) => {
|
||||||
|
return await request.get({
|
||||||
|
url: `/system/ware/house-location/getByMapItemId?mapItemId=${mapItemId}&mapId=${mapId}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -37,7 +37,13 @@
|
|||||||
class="location-selection-map-item"
|
class="location-selection-map-item"
|
||||||
>
|
>
|
||||||
<template v-if="locationTypeNumber == 1">
|
<template v-if="locationTypeNumber == 1">
|
||||||
<el-popover placement="top" trigger="click" :popper-style="{ padding: '0px' }">
|
<el-popover
|
||||||
|
placement="top"
|
||||||
|
trigger="click"
|
||||||
|
:popper-style="{ padding: '0px' }"
|
||||||
|
@before-enter="getByMapItemId(item, index)"
|
||||||
|
width="230"
|
||||||
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<img
|
<img
|
||||||
src="https://api.znkjfw.com/admin-api/infra/file/4/get/库位库存_png_179_1739326653035.png"
|
src="https://api.znkjfw.com/admin-api/infra/file/4/get/库位库存_png_179_1739326653035.png"
|
||||||
@ -52,16 +58,22 @@
|
|||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<div class="drop-down-menu">
|
<div class="current-item-list">
|
||||||
<!-- 楼层展开 -->
|
<!-- 楼层展开 -->
|
||||||
<div
|
<div
|
||||||
v-for="(floor, floorIndex) in item.dataList"
|
v-for="(floor, floorIndex) in currentMapItemList"
|
||||||
:key="floorIndex"
|
:key="floorIndex"
|
||||||
class="drop-down-menu-item"
|
class="current-item"
|
||||||
:class="currentItem && currentItem.id == floor.id ? 'tool-active' : ''"
|
:class="currentItem && currentItem.id == floor.id ? 'tool-active' : ''"
|
||||||
@click="choosePoint(floor)"
|
@click="chooseLocationPoint(floor)"
|
||||||
>
|
>
|
||||||
{{ floor.locationNo }}
|
<div>层数: 第{{ floorIndex + 1 }}层</div>
|
||||||
|
<div class="mt-4px">库位号: {{ floor.locationNo }}</div>
|
||||||
|
<div class="mt-4px"
|
||||||
|
>库位状态: {{ floor.locationEnable === 1 ? '启用' : '禁用' }} /
|
||||||
|
{{ floor.locationLock === 1 ? '正常' : '锁定' }} /
|
||||||
|
{{ floor.locationUseStatus === 1 ? '占用' : '空闲' }}</div
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
@ -245,7 +257,7 @@ const getAllNodeList = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//线库 laneId
|
//线库 laneId
|
||||||
if (locationTypeNumber.value == 2 && item.laneId !== null) {
|
if (item.type === 2 && locationTypeNumber.value == 2 && item.laneId !== null) {
|
||||||
item.locationX = Number(item.locationX) * (imgBgObj.showWidth / imgBgObj.width)
|
item.locationX = Number(item.locationX) * (imgBgObj.showWidth / imgBgObj.width)
|
||||||
item.locationY = Number(item.locationY) * (imgBgObj.showWidth / imgBgObj.width)
|
item.locationY = Number(item.locationY) * (imgBgObj.showWidth / imgBgObj.width)
|
||||||
item.dataList = JSONBigInt({ storeAsString: true }).parse(item.dataJson)
|
item.dataList = JSONBigInt({ storeAsString: true }).parse(item.dataJson)
|
||||||
@ -263,7 +275,7 @@ const getAllNodeList = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//区域 areaId
|
//区域 areaId
|
||||||
if (locationTypeNumber.value == 3 && item?.areaId !== null) {
|
if (item.type === 2 && locationTypeNumber.value == 3 && item?.areaId !== null) {
|
||||||
item.locationX = Number(item.locationX) * (imgBgObj.showWidth / imgBgObj.width)
|
item.locationX = Number(item.locationX) * (imgBgObj.showWidth / imgBgObj.width)
|
||||||
item.locationY = Number(item.locationY) * (imgBgObj.showWidth / imgBgObj.width)
|
item.locationY = Number(item.locationY) * (imgBgObj.showWidth / imgBgObj.width)
|
||||||
item.dataList = JSONBigInt({ storeAsString: true }).parse(item.dataJson)
|
item.dataList = JSONBigInt({ storeAsString: true }).parse(item.dataJson)
|
||||||
@ -285,6 +297,13 @@ const getAllNodeList = async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//库位
|
||||||
|
const currentMapItemList = ref([])
|
||||||
|
const getByMapItemId = async (item, index) => {
|
||||||
|
let list = await MapApi.getByMapItemId(imgBgObj.positionMapId, item.id)
|
||||||
|
currentMapItemList.value = list.reverse()
|
||||||
|
}
|
||||||
|
|
||||||
//将节点实际宽高cm转换成px
|
//将节点实际宽高cm转换成px
|
||||||
const cmConversionPx = (cWidth, cHeight) => {
|
const cmConversionPx = (cWidth, cHeight) => {
|
||||||
let pWidth = (Number(cWidth) / imgBgObj.resolution / 100) * (imgBgObj.showWidth / imgBgObj.width)
|
let pWidth = (Number(cWidth) / imgBgObj.resolution / 100) * (imgBgObj.showWidth / imgBgObj.width)
|
||||||
@ -301,6 +320,18 @@ const choosePoint = (item) => {
|
|||||||
currentItem.value = item
|
currentItem.value = item
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const chooseLocationPoint = (item) => {
|
||||||
|
if (item.locationEnable === 0) {
|
||||||
|
message.warning('该库位已被禁用')
|
||||||
|
} else if (item.locationLock === 0) {
|
||||||
|
message.warning('该库位已被锁定')
|
||||||
|
} else if (item.locationUseStatus === 1) {
|
||||||
|
message.warning('该库位已被占用')
|
||||||
|
} else {
|
||||||
|
currentItem.value = item
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const submitAddForm = () => {
|
const submitAddForm = () => {
|
||||||
if (currentItem.value) {
|
if (currentItem.value) {
|
||||||
emit('locationSelectionDialogSuccess', currentItem.value)
|
emit('locationSelectionDialogSuccess', currentItem.value)
|
||||||
@ -389,6 +420,23 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.current-item-list {
|
||||||
|
.current-item {
|
||||||
|
width: 230px;
|
||||||
|
font-family:
|
||||||
|
PingFangSC,
|
||||||
|
PingFang SC;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #606266;
|
||||||
|
cursor: pointer;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0);
|
||||||
|
position: relative;
|
||||||
|
border-bottom: 1px solid #e9e9e9;
|
||||||
|
padding: 12px 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.tool-active {
|
.tool-active {
|
||||||
background: #ebf1ff !important;
|
background: #ebf1ff !important;
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,28 @@
|
|||||||
@close="dialogClose"
|
@close="dialogClose"
|
||||||
>
|
>
|
||||||
<el-form :model="form" label-width="120" ref="ruleFormRef" :rules="rules">
|
<el-form :model="form" label-width="120" ref="ruleFormRef" :rules="rules">
|
||||||
|
<el-row :gutter="30">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="开始点位序号" prop="startingSortNum" required>
|
||||||
|
<el-input
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="form.startingSortNum"
|
||||||
|
:min="0"
|
||||||
|
:disabled="true"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="开始点位序号" prop="endPointSortNum" required>
|
||||||
|
<el-input
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="form.endPointSortNum"
|
||||||
|
:min="0"
|
||||||
|
:disabled="true"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<el-row :gutter="30">
|
<el-row :gutter="30">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="开始点位x轴" prop="startPointX" required>
|
<el-form-item label="开始点位x轴" prop="startPointX" required>
|
||||||
|
@ -459,7 +459,7 @@
|
|||||||
:x2="Number(state.currentDrawX)"
|
:x2="Number(state.currentDrawX)"
|
||||||
:y2="Number(state.currentDrawY)"
|
:y2="Number(state.currentDrawY)"
|
||||||
stroke="#00329F"
|
stroke="#00329F"
|
||||||
stroke-width="3"
|
stroke-width="4"
|
||||||
/>
|
/>
|
||||||
<template v-if="state.mapRouteList.length > 0">
|
<template v-if="state.mapRouteList.length > 0">
|
||||||
<template v-for="(curve, index) in state.mapRouteList" :key="index">
|
<template v-for="(curve, index) in state.mapRouteList" :key="index">
|
||||||
@ -498,7 +498,7 @@
|
|||||||
:x2="Number(curve.endPointX)"
|
:x2="Number(curve.endPointX)"
|
||||||
:y2="Number(curve.endPointY)"
|
:y2="Number(curve.endPointY)"
|
||||||
:stroke="curve.isSelected ? '#f48924' : '#00329F'"
|
:stroke="curve.isSelected ? '#f48924' : '#00329F'"
|
||||||
stroke-width="3"
|
stroke-width="4"
|
||||||
@click="handleChooseRoute(curve, index)"
|
@click="handleChooseRoute(curve, index)"
|
||||||
@dblclick="handleEditRoute(curve, index)"
|
@dblclick="handleEditRoute(curve, index)"
|
||||||
/>
|
/>
|
||||||
@ -517,7 +517,7 @@
|
|||||||
:d="getLineMidArrowPath(curve)"
|
:d="getLineMidArrowPath(curve)"
|
||||||
stroke="none"
|
stroke="none"
|
||||||
fill="black"
|
fill="black"
|
||||||
stroke-width="3"
|
stroke-width="4"
|
||||||
:marker-start="curve.direction === 2 ? 'url(#backward-arrow)' : ''"
|
:marker-start="curve.direction === 2 ? 'url(#backward-arrow)' : ''"
|
||||||
:marker-end="
|
:marker-end="
|
||||||
curve.direction === 2 ? 'url(#forward-arrow)' : 'url(#forward-arrow)'
|
curve.direction === 2 ? 'url(#forward-arrow)' : 'url(#forward-arrow)'
|
||||||
@ -530,7 +530,7 @@
|
|||||||
id="curvePath"
|
id="curvePath"
|
||||||
:d="getCurvePath(curve)"
|
:d="getCurvePath(curve)"
|
||||||
:stroke="curve.isSelected ? '#f48924' : '#00329F'"
|
:stroke="curve.isSelected ? '#f48924' : '#00329F'"
|
||||||
stroke-width="3"
|
stroke-width="4"
|
||||||
fill="none"
|
fill="none"
|
||||||
@click="handleChooseRoute(curve, index)"
|
@click="handleChooseRoute(curve, index)"
|
||||||
@dblclick="handleEditRoute(curve, index)"
|
@dblclick="handleEditRoute(curve, index)"
|
||||||
@ -551,7 +551,7 @@
|
|||||||
:d="getBezierMidArrowPath(curve)"
|
:d="getBezierMidArrowPath(curve)"
|
||||||
stroke="none"
|
stroke="none"
|
||||||
fill="black"
|
fill="black"
|
||||||
stroke-width="3"
|
stroke-width="4"
|
||||||
:marker-start="curve.direction === 2 ? 'url(#backward-arrow)' : ''"
|
:marker-start="curve.direction === 2 ? 'url(#backward-arrow)' : ''"
|
||||||
:marker-end="
|
:marker-end="
|
||||||
curve.direction === 2 ? 'url(#forward-arrow)' : 'url(#forward-arrow)'
|
curve.direction === 2 ? 'url(#forward-arrow)' : 'url(#forward-arrow)'
|
||||||
@ -1936,7 +1936,9 @@ const endDrawSelection = (event) => {
|
|||||||
beginWidth: state.startDrawPoint.locationWidePx, //起点宽
|
beginWidth: state.startDrawPoint.locationWidePx, //起点宽
|
||||||
beginHigh: state.startDrawPoint.locationDeepPx, // 起点高
|
beginHigh: state.startDrawPoint.locationDeepPx, // 起点高
|
||||||
endWidth: endPoint.locationWidePx, // 终点宽
|
endWidth: endPoint.locationWidePx, // 终点宽
|
||||||
endHigh: endPoint.locationDeepPx // 终点高
|
endHigh: endPoint.locationDeepPx, // 终点高
|
||||||
|
startingSortNum: state.startDrawPoint.sortNum,
|
||||||
|
endPointSortNum: endPoint.sortNum
|
||||||
})
|
})
|
||||||
addEditHistory()
|
addEditHistory()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user