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_DEV=true
# 请求路径 # 请求路径
VITE_BASE_URL='http://192.168.0.74:48080' # 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.153:48080'
# VITE_BASE_URL='http://192.168.0.45:48080' VITE_BASE_URL='http://192.168.0.45:48080'
# 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务 # 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务
VITE_UPLOAD_TYPE=server VITE_UPLOAD_TYPE=server

View File

@ -22,6 +22,7 @@
:disabled="false" :disabled="false"
placeholder="请输入设备编号(25字以内)" placeholder="请输入设备编号(25字以内)"
maxlength="25" maxlength="25"
show-word-limit
/> />
</el-form-item> </el-form-item>
<el-form-item label="Mac地址" prop="macAddress"> <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.id = String(form.value.dataList[index].id)
item.locationNo = form.value.dataList[index].locationNo item.locationNo = form.value.dataList[index].locationNo
item.mapItemId = form.value.dataList[index].mapItemId 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) list.push(item)
} }
@ -381,34 +384,28 @@ const typeChange = (type) => {
form.value.locationWidePx = 8 form.value.locationWidePx = 8
} else if (type === 2) { } else if (type === 2) {
form.value.locationNumber = null form.value.locationNumber = null
if (!form.value.id) { form.value.locationDeep = 150
form.value.locationDeep = 150 form.value.locationWide = 150
form.value.locationWide = 150 form.value.locationDeepPx = 30
form.value.locationDeepPx = 30 form.value.locationWidePx = 30
form.value.locationWidePx = 30
}
} else if (type === 3) { } else if (type === 3) {
form.value.direction = null form.value.direction = null
form.value.inDirection = null form.value.inDirection = null
form.value.outDirection = null form.value.outDirection = null
form.value.locationNumber = null form.value.locationNumber = null
if (!form.value.id) { form.value.locationDeep = 150
form.value.locationDeep = 150 form.value.locationWide = 150
form.value.locationWide = 150 form.value.locationDeepPx = 30
form.value.locationDeepPx = 30 form.value.locationWidePx = 30
form.value.locationWidePx = 30
}
} else if (type === 4) { } else if (type === 4) {
form.value.direction = null form.value.direction = null
form.value.inDirection = null form.value.inDirection = null
form.value.outDirection = null form.value.outDirection = null
form.value.locationNumber = null form.value.locationNumber = null
if (!form.value.id) { form.value.locationDeep = 150
form.value.locationDeep = 150 form.value.locationWide = 150
form.value.locationWide = 150 form.value.locationDeepPx = 30
form.value.locationDeepPx = 30 form.value.locationWidePx = 30
form.value.locationWidePx = 30
}
} else if (type === 5) { } else if (type === 5) {
form.value.layersNumber = null form.value.layersNumber = null
form.value.direction = null form.value.direction = null

View File

@ -9,7 +9,9 @@
<div class="device-list"> <div class="device-list">
<div class="device-item" v-for="(item, index) in deviceList" :key="index"> <div class="device-item" v-for="(item, index) in deviceList" :key="index">
<img class="img" :src="item.url" /> <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)" <el-icon color="#f56c6c" class="delete-icon" @click="deleteDeviceItem(item, index)"
><DeleteFilled ><DeleteFilled
/></el-icon> /></el-icon>
@ -213,8 +215,15 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
font-size: 14px; font-size: 14px;
color: #91929e; color: #91929e;
line-height: 20px; line-height: 20px;
text-align: left; text-align: center;
font-style: normal; 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 { .delete-icon {

View File

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

View File

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

View File

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

View File

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

View File

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