Compare commits

...

2 Commits

Author SHA1 Message Date
yyy
4a5ab7d8ad 合并 2025-03-28 14:23:06 +08:00
yyy
63eb72848f bug修改 2025-03-28 14:22:29 +08:00
9 changed files with 153 additions and 54 deletions

View File

@ -4,9 +4,9 @@ NODE_ENV=development
VITE_DEV=true
# 请求路径
VITE_BASE_URL='http://192.168.0.74:48080'
# VITE_BASE_URL='http://192.168.0.226:48080'
# VITE_BASE_URL='http://192.168.0.45:48080'
# VITE_BASE_URL='http://192.168.0.74:48080'
# VITE_BASE_URL='http://192.168.0.153:48080'
VITE_BASE_URL='http://192.168.0.45:48080'
# 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务
VITE_UPLOAD_TYPE=server

View File

@ -22,6 +22,7 @@
:disabled="false"
placeholder="请输入设备编号(25字以内)"
maxlength="25"
show-word-limit
/>
</el-form-item>
<el-form-item label="Mac地址" prop="macAddress">

View File

@ -303,7 +303,10 @@ const submit = async (formEl) => {
item.id = String(form.value.dataList[index].id)
item.locationNo = form.value.dataList[index].locationNo
item.mapItemId = form.value.dataList[index].mapItemId
item.laneId = form.value.dataList[index].laneId
item.areaId = form.value.dataList[index].areaId || ''
item.areaName = form.value.dataList[index].areaName || ''
item.laneId = form.value.dataList[index].laneId || ''
item.laneName = form.value.dataList[index].laneName || ''
}
list.push(item)
}
@ -381,34 +384,28 @@ const typeChange = (type) => {
form.value.locationWidePx = 8
} else if (type === 2) {
form.value.locationNumber = null
if (!form.value.id) {
form.value.locationDeep = 150
form.value.locationWide = 150
form.value.locationDeepPx = 30
form.value.locationWidePx = 30
}
form.value.locationDeep = 150
form.value.locationWide = 150
form.value.locationDeepPx = 30
form.value.locationWidePx = 30
} else if (type === 3) {
form.value.direction = null
form.value.inDirection = null
form.value.outDirection = null
form.value.locationNumber = null
if (!form.value.id) {
form.value.locationDeep = 150
form.value.locationWide = 150
form.value.locationDeepPx = 30
form.value.locationWidePx = 30
}
form.value.locationDeep = 150
form.value.locationWide = 150
form.value.locationDeepPx = 30
form.value.locationWidePx = 30
} else if (type === 4) {
form.value.direction = null
form.value.inDirection = null
form.value.outDirection = null
form.value.locationNumber = null
if (!form.value.id) {
form.value.locationDeep = 150
form.value.locationWide = 150
form.value.locationDeepPx = 30
form.value.locationWidePx = 30
}
form.value.locationDeep = 150
form.value.locationWide = 150
form.value.locationDeepPx = 30
form.value.locationWidePx = 30
} else if (type === 5) {
form.value.layersNumber = null
form.value.direction = null

View File

@ -9,7 +9,9 @@
<div class="device-list">
<div class="device-item" v-for="(item, index) in deviceList" :key="index">
<img class="img" :src="item.url" />
<div class="name">{{ item.deviceNo }}</div>
<span class="name" :title="item.deviceNo">
{{ item.deviceNo }}
</span>
<el-icon color="#f56c6c" class="delete-icon" @click="deleteDeviceItem(item, index)"
><DeleteFilled
/></el-icon>
@ -213,8 +215,15 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
font-size: 14px;
color: #91929e;
line-height: 20px;
text-align: left;
text-align: center;
font-style: normal;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 164px;
padding: 0 10px;
box-sizing: border-box;
display: inline-block;
}
.delete-icon {

View File

@ -13,14 +13,12 @@
v-loading="loading"
>
<el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column prop="areaName" label="物料区域名称" align="center" />
<el-table-column prop="skuInfo" label="物料信息" align="center" />
<el-table-column prop="areaName" label="物料区域名称" align="center" show-overflow-tooltip />
<el-table-column prop="skuInfo" label="物料信息" align="center" show-overflow-tooltip />
<el-table-column label="操作" align="center" width="140">
<template #default="scope">
<el-button size="small" type="primary" @click="handleEdit(scope.row)"> 编辑 </el-button>
<el-button size="small" type="danger" @click="handleDelete(scope.row.id)">
删除
</el-button>
<el-button size="small" type="danger" @click="handleDelete(scope.row)"> 删除 </el-button>
</template>
</el-table-column>
</el-table>
@ -74,7 +72,7 @@ const open = () => {
getWareHouseList()
}
const emit = defineEmits(['addEventListener'])
const emit = defineEmits(['addEventListener', 'itemAreaManagementDelete', 'itemAreaManagementEdit'])
const dialogClose = () => {
emit('addEventListener')
}
@ -99,13 +97,14 @@ const getWareHouseList = async () => {
}
}
const handleDelete = async (id) => {
const handleDelete = async (item) => {
try {
//
await message.delConfirm('请确认是否删除该物料区域?')
//
await MapApi.deleteWareHouseArea(id)
await MapApi.deleteWareHouseArea(item.id)
message.success('删除成功')
emit('itemAreaManagementDelete', item.mapItemIds)
//
await getWareHouseList()
} catch {}
@ -133,6 +132,7 @@ const editSubmit = async () => {
await getWareHouseList()
editDialogFormVisible.value = false
message.success('编辑成功')
emit('itemAreaManagementEdit', editForm.value)
}
})
}

View File

@ -77,7 +77,7 @@ const open = (list) => {
form.value.skuInfo = ''
}
const emit = defineEmits(['addEventListener'])
const emit = defineEmits(['addEventListener', 'itemAreaSettingSubmitSuccess'])
const dialogClose = () => {
emit('addEventListener')
}
@ -87,9 +87,13 @@ const submitForm = async (formEl) => {
await formEl.validate(async (valid, fields) => {
if (valid) {
form.value.positionMapId = props.positionMapId
await MapApi.createOrEditOrDelHouseArea(form.value)
let res = await MapApi.createOrEditOrDelHouseArea(form.value)
dialogFormVisible.value = false
message.success('设置成功')
emit('itemAreaSettingSubmitSuccess', {
...res,
mapItemIds: form.value.mapItemIds
})
}
})
}

View File

@ -13,13 +13,11 @@
v-loading="loading"
>
<el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column prop="laneName" label="线库名称" align="center" />
<el-table-column prop="laneName" label="线库名称" align="center" show-overflow-tooltip />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button size="small" type="primary" @click="handleEdit(scope.row)"> 编辑 </el-button>
<el-button size="small" type="danger" @click="handleDelete(scope.row.id)">
删除
</el-button>
<el-button size="small" type="danger" @click="handleDelete(scope.row)"> 删除 </el-button>
</template>
</el-table-column>
</el-table>
@ -70,7 +68,11 @@ const open = () => {
getLineLibraryList()
}
const emit = defineEmits(['addEventListener'])
const emit = defineEmits([
'addEventListener',
'lineLibraryManagementDelete',
'lineLibraryManagementEdit'
])
const dialogClose = () => {
emit('addEventListener')
}
@ -95,13 +97,14 @@ const getLineLibraryList = async () => {
}
}
const handleDelete = async (id) => {
const handleDelete = async (item) => {
try {
//
await message.delConfirm('请确认是否删除该线库?')
//
await MapApi.deleteWareLaneArea(id)
await MapApi.deleteWareLaneArea(item.id)
message.success('删除成功')
emit('lineLibraryManagementDelete', item.mapItemIds)
//
await getLineLibraryList()
} catch {}
@ -125,6 +128,7 @@ const editSubmit = async () => {
if (valid) {
await MapApi.createOrEditOrDelHouseLane(editForm.value)
await getLineLibraryList()
emit('lineLibraryManagementEdit', editForm.value)
editDialogFormVisible.value = false
message.success('编辑成功')
}

View File

@ -58,7 +58,6 @@ const form = ref({
})
const open = (list) => {
console.log(list)
dialogFormVisible.value = true
form.value.mapItemIds = list.map((item) => item.id)
form.value.areaNumber = list.reduce((sum, item) => {
@ -67,7 +66,7 @@ const open = (list) => {
form.value.laneName = ''
}
const emit = defineEmits(['addEventListener'])
const emit = defineEmits(['addEventListener', 'submitLineLibraryFormSuccess'])
const dialogClose = () => {
emit('addEventListener')
}
@ -76,9 +75,13 @@ const submitLineLibraryForm = async () => {
await lineFormRef.value.validate(async (valid, fields) => {
if (valid) {
form.value.positionMapId = props.positionMapId
await MapApi.createOrEditOrDelHouseLane(form.value)
let res = await MapApi.createOrEditOrDelHouseLane(form.value)
dialogFormVisible.value = false
message.success('设置成功')
emit('submitLineLibraryFormSuccess', {
...res,
mapItemIds: form.value.mapItemIds
})
}
})
}

View File

@ -673,12 +673,14 @@
ref="itemAreaSettingDialogRef"
:positionMapId="imgBgObj.positionMapId"
@addEventListener="addEventListener"
@itemAreaSettingSubmitSuccess="itemAreaSettingSubmitSuccess"
/>
<!-- 线库设置 -->
<lineLibrarySettingDialog
ref="lineLibrarySettingDialogRef"
:positionMapId="imgBgObj.positionMapId"
@addEventListener="addEventListener"
@submitLineLibraryFormSuccess="submitLineLibraryFormSuccess"
/>
<!-- 编辑地图路线 -->
<editMapRouteDialog
@ -693,12 +695,16 @@
ref="lineLibraryManagementDialogRef"
:positionMapId="imgBgObj.positionMapId"
@addEventListener="addEventListener"
@lineLibraryManagementDelete="lineLibraryManagementDelete"
@lineLibraryManagementEdit="lineLibraryManagementEdit"
/>
<!-- 区域管理 -->
<itemAreaManagementDialog
ref="itemAreaManagementDialogRef"
:positionMapId="imgBgObj.positionMapId"
@addEventListener="addEventListener"
@itemAreaManagementDelete="itemAreaManagementDelete"
@itemAreaManagementEdit="itemAreaManagementEdit"
/>
</div>
</template>
@ -921,7 +927,7 @@ const mapClick = (e) => {
const actualLocationX = disposeEventPoints(e).actualLocationX
const actualLocationY = disposeEventPoints(e).actualLocationY
//
//
if (toolbarSwitchType.value === 'drawNodes') {
state.allMapPointInfo.push({
positionMapId: imgBgObj.positionMapId, //id
@ -1181,7 +1187,7 @@ const state = reactive({
rightToolList: [
{
switchType: 'drawNodes',
name: '绘制节点',
name: '新增节点',
icon: 'ep:circle-plus-filled',
isActive: false
},
@ -1193,7 +1199,7 @@ const state = reactive({
},
{
switchType: 'clickDrawRoute',
name: '绘制路线',
name: '新增路线',
icon: 'ep:semi-select',
isActive: false
},
@ -1255,7 +1261,7 @@ const state = reactive({
}, //
selectedCurve: '', // 线
startDrawPointIndex: -1, //
startDrawPoint: null, //线
startDrawPoint: null, //线
isDrawing: false, //
currentDrawX: 0, //x
currentDrawY: 0, //y
@ -1514,13 +1520,13 @@ const toolbarClick = async (item) => {
backNextStep()
break
case 'drawNodes':
//
//
break
case 'editNode':
//
break
case 'drawRoute':
//线
//线
break
case 'editRoute':
// 线
@ -1958,10 +1964,10 @@ const clickDrawSelectionArea = () => {
message.warning('至少选择两个库位')
return
}
if (!isStraightLine(binLocation)) {
message.warning('您选择的库位不在一条直线上')
return
}
// if (!isStraightLine(binLocation)) {
// message.warning('线')
// return
// }
let isHaveId = binLocation.every((item) => {
return item.id
})
@ -2655,6 +2661,81 @@ const saveNodeList = async () => {
const saveMapRoute = async () => {
await MapApi.createOrEditOrDelPositionMapLine(imgBgObj.positionMapId, state.mapRouteList)
}
//线 线
const submitLineLibraryFormSuccess = (obj) => {
state.allMapPointInfo.forEach((item) => {
if (obj.mapItemIds.includes(item.id)) {
item.laneId = obj.id
item.dataList.forEach((node) => {
node.laneName = obj.laneName
node.laneId = obj.id
})
}
})
}
//
const itemAreaSettingSubmitSuccess = (obj) => {
state.allMapPointInfo.forEach((item) => {
if (obj.mapItemIds.includes(item.id)) {
item.areaId = obj.id
item.dataList.forEach((node) => {
node.areaName = obj.areaName
node.areaId = obj.id
})
}
})
}
//线 线
const lineLibraryManagementDelete = (mapItemIds) => {
state.allMapPointInfo.forEach((item) => {
if (mapItemIds.includes(item.id)) {
item.laneId = undefined
item.dataList.forEach((node) => {
node.laneName = undefined
node.laneId = undefined
})
}
})
}
//
const itemAreaManagementDelete = (mapItemIds) => {
state.allMapPointInfo.forEach((item) => {
if (mapItemIds.includes(item.id)) {
item.areaId = undefined
item.dataList.forEach((node) => {
node.areaName = undefined
node.areaId = undefined
})
}
})
}
//线 线
const lineLibraryManagementEdit = (obj) => {
console.log(obj)
state.allMapPointInfo.forEach((item) => {
if (obj.mapItemIds.includes(item.id)) {
item.laneId = obj.id
item.dataList.forEach((node) => {
node.laneName = obj.laneName
node.laneId = obj.id
})
}
})
}
//
const itemAreaManagementEdit = (obj) => {
console.log(obj)
state.allMapPointInfo.forEach((item) => {
if (obj.mapItemIds.includes(item.id)) {
item.areaId = obj.id
item.dataList.forEach((node) => {
node.areaName = obj.areaName
node.areaId = obj.id
})
}
})
}
//
const layerSelectionSuccess = (typeList) => {
state.allMapPointInfo.forEach((item) => {