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_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'
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'
# 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务
VITE_UPLOAD_TYPE=server

View File

@ -22,7 +22,6 @@
:disabled="false"
placeholder="请输入设备编号(25字以内)"
maxlength="25"
show-word-limit
/>
</el-form-item>
<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.locationNo = form.value.dataList[index].locationNo
item.mapItemId = form.value.dataList[index].mapItemId
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 || ''
item.laneId = form.value.dataList[index].laneId
}
list.push(item)
}
@ -384,28 +381,34 @@ const typeChange = (type) => {
form.value.locationWidePx = 8
} else if (type === 2) {
form.value.locationNumber = null
form.value.locationDeep = 150
form.value.locationWide = 150
form.value.locationDeepPx = 30
form.value.locationWidePx = 30
if (!form.value.id) {
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
form.value.locationDeep = 150
form.value.locationWide = 150
form.value.locationDeepPx = 30
form.value.locationWidePx = 30
if (!form.value.id) {
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
form.value.locationDeep = 150
form.value.locationWide = 150
form.value.locationDeepPx = 30
form.value.locationWidePx = 30
if (!form.value.id) {
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,9 +9,7 @@
<div class="device-list">
<div class="device-item" v-for="(item, index) in deviceList" :key="index">
<img class="img" :src="item.url" />
<span class="name" :title="item.deviceNo">
{{ item.deviceNo }}
</span>
<div class="name">{{ item.deviceNo }}</div>
<el-icon color="#f56c6c" class="delete-icon" @click="deleteDeviceItem(item, index)"
><DeleteFilled
/></el-icon>
@ -215,15 +213,8 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
font-size: 14px;
color: #91929e;
line-height: 20px;
text-align: center;
text-align: left;
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,12 +13,14 @@
v-loading="loading"
>
<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="skuInfo" label="物料信息" align="center" show-overflow-tooltip />
<el-table-column prop="areaName" label="物料区域名称" align="center" />
<el-table-column prop="skuInfo" label="物料信息" align="center" />
<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)"> 删除 </el-button>
<el-button size="small" type="danger" @click="handleDelete(scope.row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
@ -72,7 +74,7 @@ const open = () => {
getWareHouseList()
}
const emit = defineEmits(['addEventListener', 'itemAreaManagementDelete', 'itemAreaManagementEdit'])
const emit = defineEmits(['addEventListener'])
const dialogClose = () => {
emit('addEventListener')
}
@ -97,14 +99,13 @@ const getWareHouseList = async () => {
}
}
const handleDelete = async (item) => {
const handleDelete = async (id) => {
try {
//
await message.delConfirm('请确认是否删除该物料区域?')
//
await MapApi.deleteWareHouseArea(item.id)
await MapApi.deleteWareHouseArea(id)
message.success('删除成功')
emit('itemAreaManagementDelete', item.mapItemIds)
//
await getWareHouseList()
} catch {}
@ -132,7 +133,6 @@ 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', 'itemAreaSettingSubmitSuccess'])
const emit = defineEmits(['addEventListener'])
const dialogClose = () => {
emit('addEventListener')
}
@ -87,13 +87,9 @@ const submitForm = async (formEl) => {
await formEl.validate(async (valid, fields) => {
if (valid) {
form.value.positionMapId = props.positionMapId
let res = await MapApi.createOrEditOrDelHouseArea(form.value)
await MapApi.createOrEditOrDelHouseArea(form.value)
dialogFormVisible.value = false
message.success('设置成功')
emit('itemAreaSettingSubmitSuccess', {
...res,
mapItemIds: form.value.mapItemIds
})
}
})
}

View File

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

View File

@ -58,6 +58,7 @@ 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) => {
@ -66,7 +67,7 @@ const open = (list) => {
form.value.laneName = ''
}
const emit = defineEmits(['addEventListener', 'submitLineLibraryFormSuccess'])
const emit = defineEmits(['addEventListener'])
const dialogClose = () => {
emit('addEventListener')
}
@ -75,13 +76,9 @@ const submitLineLibraryForm = async () => {
await lineFormRef.value.validate(async (valid, fields) => {
if (valid) {
form.value.positionMapId = props.positionMapId
let res = await MapApi.createOrEditOrDelHouseLane(form.value)
await MapApi.createOrEditOrDelHouseLane(form.value)
dialogFormVisible.value = false
message.success('设置成功')
emit('submitLineLibraryFormSuccess', {
...res,
mapItemIds: form.value.mapItemIds
})
}
})
}

View File

@ -673,14 +673,12 @@
ref="itemAreaSettingDialogRef"
:positionMapId="imgBgObj.positionMapId"
@addEventListener="addEventListener"
@itemAreaSettingSubmitSuccess="itemAreaSettingSubmitSuccess"
/>
<!-- 线库设置 -->
<lineLibrarySettingDialog
ref="lineLibrarySettingDialogRef"
:positionMapId="imgBgObj.positionMapId"
@addEventListener="addEventListener"
@submitLineLibraryFormSuccess="submitLineLibraryFormSuccess"
/>
<!-- 编辑地图路线 -->
<editMapRouteDialog
@ -695,16 +693,12 @@
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>
@ -927,7 +921,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
@ -1187,7 +1181,7 @@ const state = reactive({
rightToolList: [
{
switchType: 'drawNodes',
name: '新增节点',
name: '绘制节点',
icon: 'ep:circle-plus-filled',
isActive: false
},
@ -1199,7 +1193,7 @@ const state = reactive({
},
{
switchType: 'clickDrawRoute',
name: '新增路线',
name: '绘制路线',
icon: 'ep:semi-select',
isActive: false
},
@ -1261,7 +1255,7 @@ const state = reactive({
}, //
selectedCurve: '', // 线
startDrawPointIndex: -1, //
startDrawPoint: null, //线
startDrawPoint: null, //线
isDrawing: false, //
currentDrawX: 0, //x
currentDrawY: 0, //y
@ -1520,13 +1514,13 @@ const toolbarClick = async (item) => {
backNextStep()
break
case 'drawNodes':
//
//
break
case 'editNode':
//
break
case 'drawRoute':
//线
//线
break
case 'editRoute':
// 线
@ -1964,10 +1958,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
})
@ -2661,81 +2655,6 @@ 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) => {