Compare commits

..

No commits in common. "4a5ab7d8ada09b2659fb06d9ef22131151625dbc" and "671ae72c5282658175709ae653f1d40efe626abe" have entirely different histories.

9 changed files with 54 additions and 153 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.153: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.45:48080'
# 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务 # 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务
VITE_UPLOAD_TYPE=server VITE_UPLOAD_TYPE=server

View File

@ -22,7 +22,6 @@
: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,10 +303,7 @@ 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.areaId = form.value.dataList[index].areaId || '' item.laneId = form.value.dataList[index].laneId
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)
} }
@ -384,28 +381,34 @@ 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
form.value.locationDeep = 150 if (!form.value.id) {
form.value.locationWide = 150 form.value.locationDeep = 150
form.value.locationDeepPx = 30 form.value.locationWide = 150
form.value.locationWidePx = 30 form.value.locationDeepPx = 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
form.value.locationDeep = 150 if (!form.value.id) {
form.value.locationWide = 150 form.value.locationDeep = 150
form.value.locationDeepPx = 30 form.value.locationWide = 150
form.value.locationWidePx = 30 form.value.locationDeepPx = 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
form.value.locationDeep = 150 if (!form.value.id) {
form.value.locationWide = 150 form.value.locationDeep = 150
form.value.locationDeepPx = 30 form.value.locationWide = 150
form.value.locationWidePx = 30 form.value.locationDeepPx = 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,9 +9,7 @@
<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" />
<span class="name" :title="item.deviceNo"> <div class="name">{{ item.deviceNo }}</div>
{{ 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>
@ -215,15 +213,8 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
font-size: 14px; font-size: 14px;
color: #91929e; color: #91929e;
line-height: 20px; line-height: 20px;
text-align: center; text-align: left;
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,12 +13,14 @@
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" show-overflow-tooltip /> <el-table-column prop="areaName" label="物料区域名称" align="center" />
<el-table-column prop="skuInfo" label="物料信息" align="center" show-overflow-tooltip /> <el-table-column prop="skuInfo" label="物料信息" align="center" />
<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)"> 删除 </el-button> <el-button size="small" type="danger" @click="handleDelete(scope.row.id)">
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -72,7 +74,7 @@ const open = () => {
getWareHouseList() getWareHouseList()
} }
const emit = defineEmits(['addEventListener', 'itemAreaManagementDelete', 'itemAreaManagementEdit']) const emit = defineEmits(['addEventListener'])
const dialogClose = () => { const dialogClose = () => {
emit('addEventListener') emit('addEventListener')
} }
@ -97,14 +99,13 @@ const getWareHouseList = async () => {
} }
} }
const handleDelete = async (item) => { const handleDelete = async (id) => {
try { try {
// //
await message.delConfirm('请确认是否删除该物料区域?') await message.delConfirm('请确认是否删除该物料区域?')
// //
await MapApi.deleteWareHouseArea(item.id) await MapApi.deleteWareHouseArea(id)
message.success('删除成功') message.success('删除成功')
emit('itemAreaManagementDelete', item.mapItemIds)
// //
await getWareHouseList() await getWareHouseList()
} catch {} } catch {}
@ -132,7 +133,6 @@ 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', 'itemAreaSettingSubmitSuccess']) const emit = defineEmits(['addEventListener'])
const dialogClose = () => { const dialogClose = () => {
emit('addEventListener') emit('addEventListener')
} }
@ -87,13 +87,9 @@ 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
let res = await MapApi.createOrEditOrDelHouseArea(form.value) 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,11 +13,13 @@
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" show-overflow-tooltip /> <el-table-column prop="laneName" label="线库名称" align="center" />
<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)"> 删除 </el-button> <el-button size="small" type="danger" @click="handleDelete(scope.row.id)">
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -68,11 +70,7 @@ const open = () => {
getLineLibraryList() getLineLibraryList()
} }
const emit = defineEmits([ const emit = defineEmits(['addEventListener'])
'addEventListener',
'lineLibraryManagementDelete',
'lineLibraryManagementEdit'
])
const dialogClose = () => { const dialogClose = () => {
emit('addEventListener') emit('addEventListener')
} }
@ -97,14 +95,13 @@ const getLineLibraryList = async () => {
} }
} }
const handleDelete = async (item) => { const handleDelete = async (id) => {
try { try {
// //
await message.delConfirm('请确认是否删除该线库?') await message.delConfirm('请确认是否删除该线库?')
// //
await MapApi.deleteWareLaneArea(item.id) await MapApi.deleteWareLaneArea(id)
message.success('删除成功') message.success('删除成功')
emit('lineLibraryManagementDelete', item.mapItemIds)
// //
await getLineLibraryList() await getLineLibraryList()
} catch {} } catch {}
@ -128,7 +125,6 @@ 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,6 +58,7 @@ 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) => {
@ -66,7 +67,7 @@ const open = (list) => {
form.value.laneName = '' form.value.laneName = ''
} }
const emit = defineEmits(['addEventListener', 'submitLineLibraryFormSuccess']) const emit = defineEmits(['addEventListener'])
const dialogClose = () => { const dialogClose = () => {
emit('addEventListener') emit('addEventListener')
} }
@ -75,13 +76,9 @@ 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
let res = await MapApi.createOrEditOrDelHouseLane(form.value) 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,14 +673,12 @@
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
@ -695,16 +693,12 @@
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>
@ -927,7 +921,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
@ -1187,7 +1181,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
}, },
@ -1199,7 +1193,7 @@ const state = reactive({
}, },
{ {
switchType: 'clickDrawRoute', switchType: 'clickDrawRoute',
name: '新增路线', name: '绘制路线',
icon: 'ep:semi-select', icon: 'ep:semi-select',
isActive: false isActive: false
}, },
@ -1261,7 +1255,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
@ -1520,13 +1514,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':
// 线 // 线
@ -1964,10 +1958,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
}) })
@ -2661,81 +2655,6 @@ 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) => {