This commit is contained in:
xhf 2025-03-31 15:59:31 +08:00
commit d6f2a7cf30
20 changed files with 499 additions and 215 deletions

View File

@ -5,7 +5,7 @@ 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 服务

View File

@ -27,6 +27,11 @@ export const deleteTask = (id: number) => {
// 更新机器人任务主表 // 更新机器人任务主表
export const updateTask = (data) => { export const updateTask = (data) => {
return request.post({ url: '/system/robot/task-detail/manuallyCompleted?id=' + data.id })
}
// 更新机器人任务主表
export const closeTask = (data) => {
return request.put({ url: '/system/robot/task/close', data }) return request.put({ url: '/system/robot/task/close', data })
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 B

View File

@ -15,7 +15,7 @@ const list = ref<any[]>([]) // 消息列表
const getList = async () => { const getList = async () => {
// list.value = await NotifyMessageApi.getUnreadNotifyMessageList() // list.value = await NotifyMessageApi.getUnreadNotifyMessageList()
list.value = await NotifyMessageApi.warnMsgReadPage() list.value = await NotifyMessageApi.warnMsgReadPage()
console.log(list.value ) console.log(list.value)
// unreadCount 0 // unreadCount 0
unreadCount.value = 0 unreadCount.value = 0
} }
@ -26,14 +26,15 @@ const getUnreadCount = async () => {
// unreadCount.value = data // unreadCount.value = data
// }) // })
NotifyMessageApi.warnMsgReadPage().then((data) => { NotifyMessageApi.warnMsgReadPage().then((data) => {
// console.log(data) // console.log(data)
unreadCount.value = data&&data.length?data.length:0 unreadCount.value = data && data.length ? data.length : 0
}) })
} }
// //
const popoverRef = ref()
const goMyList = () => { const goMyList = () => {
popoverRef.value.hide()
push({ push({
name: 'SystemCarError' name: 'SystemCarError'
}) })
@ -58,7 +59,7 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="message"> <div class="message">
<ElPopover :width="400" placement="bottom" trigger="click"> <ElPopover ref="popoverRef" :width="400" placement="bottom" trigger="click">
<template #reference> <template #reference>
<ElBadge :is-dot="unreadCount > 0" class="item"> <ElBadge :is-dot="unreadCount > 0" class="item">
<Icon <Icon
@ -74,10 +75,9 @@ onMounted(() => {
<ElTabPane label="我的站内信" name="notice"> <ElTabPane label="我的站内信" name="notice">
<el-scrollbar class="message-list"> <el-scrollbar class="message-list">
<template v-for="item in list" :key="item.id"> <template v-for="item in list" :key="item.id">
<div class="message-item"> <div class="message-item">
<!-- <img alt="" class="message-icon" src="@/assets/imgs/avatar.gif" /> --> <!-- <img alt="" class="message-icon" src="@/assets/imgs/avatar.gif" /> -->
<div class="message-content"> <div class="message-content">
<!-- <div style="margin-bottom: 5px;">异常等级{{ item.warnLevel }}</div> --> <!-- <div style="margin-bottom: 5px;">异常等级{{ item.warnLevel }}</div> -->
<span class="message-title"> <span class="message-title">

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

@ -6,7 +6,7 @@
:model="queryParams" :model="queryParams"
ref="queryFormRef" ref="queryFormRef"
:inline="true" :inline="true"
label-width="120px" label-width="80px"
> >
<el-form-item label="ID号" prop="warnCode"> <el-form-item label="ID号" prop="warnCode">
<el-input <el-input
@ -176,6 +176,12 @@ const getList = async () => {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
queryParams.pageNo = 1 queryParams.pageNo = 1
if (queryParams.warnCode) {
queryParams.warnCode = queryParams.warnCode.replace(/\s/g, '')
}
if (queryParams.robotNo) {
queryParams.robotNo = queryParams.robotNo.replace(/\s/g, '')
}
getList() getList()
} }

View File

@ -79,6 +79,7 @@
style="width: 100%" style="width: 100%"
row-class-name="table-row-class" row-class-name="table-row-class"
:header-cell-style="{ backgroundColor: '#EBF1FF', padding: '13px 0' }" :header-cell-style="{ backgroundColor: '#EBF1FF', padding: '13px 0' }"
show-overflow-tooltip
> >
<el-table-column label="序号" type="index" align="center" width="60" /> <el-table-column label="序号" type="index" align="center" width="60" />
<el-table-column label="库位号" align="center" prop="locationNo" /> <el-table-column label="库位号" align="center" prop="locationNo" />
@ -148,7 +149,8 @@ const queryParams = reactive({
taskStage: null, taskStage: null,
laneName: null, laneName: null,
areaName: null, areaName: null,
skuInfo: null skuInfo: null,
locationNo: null
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
@ -176,6 +178,20 @@ const submitSuccess = () => {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
queryParams.pageNo = 1 queryParams.pageNo = 1
if (queryParams.locationNo) {
queryParams.locationNo = queryParams.locationNo.replace(/\s/g, '')
}
if (queryParams.laneName) {
queryParams.laneName = queryParams.laneName.replace(/\s/g, '')
}
if (queryParams.areaName) {
queryParams.areaName = queryParams.areaName.replace(/\s/g, '')
}
if (queryParams.skuInfo) {
queryParams.skuInfo = queryParams.skuInfo.replace(/\s/g, '')
}
getList() getList()
} }

View File

@ -189,6 +189,27 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="任务阶段" prop="taskStage">
<el-select
v-model="taskLogParams.taskStage"
class="!w-240px"
clearable
placeholder="请选择任务阶段"
@change="handleQuery()"
>
<el-option label="待执行" :value="0" />
<el-option label="前往取货" :value="1" />
<el-option label="取货中" :value="2" />
<el-option label="前往放货" :value="3" />
<el-option label="放货中" :value="4" />
<el-option label="结束" :value="5" />
<el-option label="移动中" :value="6" />
<el-option label="正在充电" :value="7" />
<el-option label="取消" :value="8" />
<el-option label="人工完成" :value="9" />
<el-option label="异常" :value="10" />
</el-select>
</el-form-item>
<!-- <el-form-item label="开始时间" prop="startTime" :formatter="dateFormatter"> <!-- <el-form-item label="开始时间" prop="startTime" :formatter="dateFormatter">
<el-date-picker <el-date-picker
class="!w-240px" class="!w-240px"
@ -210,7 +231,7 @@
/> />
</el-form-item> --> </el-form-item> -->
<el-form-item label="时间" prop="endTime" :formatter="dateFormatter"> <el-form-item label="时间" prop="endTime" :formatter="dateFormatter">
<el-date-picker <el-date-picker
v-model="taskLogParams.createTime" v-model="taskLogParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
type="daterange" type="daterange"
@ -260,6 +281,21 @@
<dict-tag :type="DICT_TYPE.ROBOT_TASK_STATUS" :value="scope.row.taskStatus" /> <dict-tag :type="DICT_TYPE.ROBOT_TASK_STATUS" :value="scope.row.taskStatus" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="taskStage" label="任务阶段" align="center" width="120">
<template #default="scope">
<el-text v-if="scope.row.taskStage == 0">待执行</el-text>
<el-text v-if="scope.row.taskStage == 1">前往取货</el-text>
<el-text v-if="scope.row.taskStage == 2">取货中</el-text>
<el-text v-if="scope.row.taskStage == 3">前往放货</el-text>
<el-text v-if="scope.row.taskStage == 4">放货中</el-text>
<el-text v-if="scope.row.taskStage == 5">结束</el-text>
<el-text v-if="scope.row.taskStage == 6">移动中</el-text>
<el-text v-if="scope.row.taskStage == 7">正在充电</el-text>
<el-text v-if="scope.row.taskStage == 8">取消</el-text>
<el-text v-if="scope.row.taskStage == 9">人工完成</el-text>
<el-text v-if="scope.row.taskStage == 10">异常</el-text>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="startTime" prop="startTime"
label="开始时间" label="开始时间"
@ -295,7 +331,6 @@ import * as MapTaskAPi from '@/api/map/mapTask'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
defineOptions({ name: 'mapLogQueriesList' }) defineOptions({ name: 'mapLogQueriesList' })
const message = useMessage() // const message = useMessage() //
@ -348,6 +383,7 @@ const taskLogParams = reactive({
taskNo: null, // taskNo: null, //
taskType: null, // taskType: null, //
taskStatus: null, // taskStatus: null, //
taskStage: null, //
startTime: null, // startTime: null, //
endTime: null, // endTime: null, //
createTime: [] createTime: []
@ -386,6 +422,9 @@ const handleQuery = () => {
getCarLogList() getCarLogList()
} else if (activeName.value == 3) { } else if (activeName.value == 3) {
taskLogParams.pageNo = 1 taskLogParams.pageNo = 1
if (taskLogParams.taskNo) {
taskLogParams.taskNo = taskLogParams.taskNo.replace(/\s/g, '')
}
getTaskLogList() getTaskLogList()
} }
} }

View File

@ -0,0 +1,100 @@
<template>
<!-- 新增设备 -->
<Dialog
v-model="dialogFormVisible"
title="生成直线"
width="500"
class="generate-straight-lines-dialog"
@close="dialogClose"
>
<el-form :model="form" label-width="70" ref="ruleFormRef" :rules="rules">
<el-form-item label="开始点" prop="startPointId" required>
<el-select v-model="form.startPointId" placeholder="请选择" style="width: 100%">
<el-option
v-for="item in pointList"
:key="item.id"
:label="item.sortNum"
:value="item.id"
:disabled="item.id == form.endPointId"
/>
</el-select>
</el-form-item>
<el-form-item label="结束点" prop="endPointId" required>
<el-select v-model="form.endPointId" placeholder="请选择" style="width: 100%">
<el-option
v-for="item in pointList"
:key="item.id"
:label="item.sortNum"
:value="item.id"
:disabled="item.id == form.startPointId"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="submitForm(ruleFormRef)"> 确定 </el-button>
</div>
</template>
</Dialog>
</template>
<script setup>
import { reactive, ref } from 'vue'
import * as MapApi from '@/api/map/map'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
const message = useMessage() //
const ruleFormRef = ref()
const dialogFormVisible = ref(false) //
const rules = reactive({
startPointId: [{ required: true, message: '请选择开始点', trigger: 'blur' }],
endPointId: [{ required: true, message: '请选择结束点', trigger: 'blur' }]
})
//
const form = ref({
startPointId: '',
endPointId: ''
})
const pointList = ref([])
const open = (list) => {
dialogFormVisible.value = true
pointList.value = list
form.value.startPointId = ''
form.value.endPointId = ''
}
const emit = defineEmits(['addEventListener', 'GenerateStraightLinesSubmit'])
const dialogClose = () => {
emit('addEventListener')
}
const submitForm = async (formEl) => {
if (!formEl) return
await formEl.validate(async (valid, fields) => {
if (valid) {
dialogFormVisible.value = false
message.success('设置成功')
emit('GenerateStraightLinesSubmit', pointList.value, form.value)
}
})
}
defineExpose({ open }) // open
</script>
<style lang="scss">
.generate-straight-lines-dialog {
padding: 0px;
.el-dialog__footer {
padding: 0px 20px 20px 0;
border-top: none !important;
}
}
</style>

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,15 +97,16 @@ 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('删除成功')
// //
await getWareHouseList() await getWareHouseList()
emit('itemAreaManagementDelete', item.mapItemIds)
} 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,15 +97,16 @@ 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('删除成功')
// //
await getLineLibraryList() await getLineLibraryList()
emit('lineLibraryManagementDelete', item.mapItemIds)
} catch {} } catch {}
} }
@ -127,6 +130,7 @@ const editSubmit = async () => {
await getLineLibraryList() await getLineLibraryList()
editDialogFormVisible.value = false editDialogFormVisible.value = false
message.success('编辑成功') message.success('编辑成功')
emit('lineLibraryManagementEdit', editForm.value)
} }
}) })
} }

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

@ -1,5 +1,5 @@
<template> <template>
<Dialog v-model="dialogVisible" title="库位信息" width="545" class="task-dialog"> <Dialog v-model="dialogVisible" title="库位信息" width="660" class="task-dialog">
<div class="store-dialog"> <div class="store-dialog">
<div class="store-dialog-left"> <div class="store-dialog-left">
<div <div
@ -13,16 +13,9 @@
}" }"
> >
{{ item.locationNo || '--' }} {{ item.locationNo || '--' }}
<img
src="@/assets/imgs/jinyong-2.png"
alt=""
class="store-dialog-left-item-img-jinyong"
v-if="item.locationEnable === 0"
/>
<img src="@/assets/imgs/suoding.png" alt="" class="store-dialog-left-item-img-suoding" />
</div> </div>
</div> </div>
<div style="flex: 1"> <div>
<el-form :model="formData" label-width="auto" ref="formRef" :rules="formRules"> <el-form :model="formData" label-width="auto" ref="formRef" :rules="formRules">
<el-form-item label="库位编号"> <el-form-item label="库位编号">
<el-input v-model="formData.locationNo" :disabled="true" /> <el-input v-model="formData.locationNo" :disabled="true" />
@ -75,12 +68,11 @@ const formRef = ref() // 表单 Ref
const storeData = ref([]) const storeData = ref([])
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (data) => { const open = async (data) => {
console.log(data)
resetForm() resetForm()
if (data && data.length) { if (data && data.length) {
storeData.value = data.reverse() storeData.value = data.reverse()
console.log(storeData.value)
selectIndex.value = 0 selectIndex.value = 0
console.log(data)
formData.value = JSON.parse(JSON.stringify(data[0])) formData.value = JSON.parse(JSON.stringify(data[0]))
} }
dialogVisible.value = true dialogVisible.value = true
@ -127,17 +119,7 @@ const resetForm = () => {
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.task-dialog {
.el-dialog__header {
border-bottom: none;
}
.el-dialog__footer {
border-top: none !important;
}
}
.task-tips { .task-tips {
display: flex; display: flex;
align-items: center; align-items: center;
@ -198,43 +180,30 @@ const resetForm = () => {
.store-dialog-left { .store-dialog-left {
margin-right: 24px; margin-right: 24px;
flex-shrink: 0; flex-shrink: 0;
padding-bottom: 20px;
} .store-dialog-left-item {
.store-dialog-left-item { width: 132px;
width: 132px; height: 50px;
height: 50px; text-align: center;
text-align: center; margin-top: 1px;
margin-top: 1px; font-family:
font-family: PingFangSC,
PingFangSC, PingFang SC;
PingFang SC; font-weight: 500;
font-weight: 500; font-size: 18px;
font-size: 18px; color: #0d162a;
color: #0d162a; vertical-align: middle;
vertical-align: middle; cursor: pointer;
cursor: pointer; border: 1px solid rgba(0, 0, 0, 0);
border: 1px solid rgba(0, 0, 0, 0); position: relative;
position: relative; }
}
.ellipsis { .ellipsis {
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.store-dialog-left-item-img-jinyong {
position: absolute;
left: -3px;
top: -4px;
width: 25px;
height: 25px;
}
.store-dialog-left-item-img-suoding {
position: absolute;
left: 0;
bottom: 0;
width: 20px;
height: 20px;
} }
</style> </style>

View File

@ -340,12 +340,44 @@
:style="{ width: item.locationWidePx + 'px', height: item.locationDeepPx + 'px' }" :style="{ width: item.locationWidePx + 'px', height: item.locationDeepPx + 'px' }"
> >
<!-- 1 路径点 --> <!-- 1 路径点 -->
<el-tooltip <el-tooltip effect="dark" placement="top" trigger="click">
effect="dark" <template #content>
:content="item.sortNum || '节点未保存'" <div v-if="item.type === 1">
placement="top" <div>序号{{ item.sortNum || '节点未保存' }}</div>
trigger="click" </div>
> <div v-else-if="item.type === 2">
<div>序号{{ item.sortNum || '节点未保存' }}</div>
<div class="item-tooltip-name" v-if="item.laneId && item.laneName">
所属线库{{ item.laneName }}
</div>
<div class="item-tooltip-name" v-if="item.areaId && item.areaName">
所属线库{{ item.areaName }}
</div>
</div>
<div v-else-if="item.type === 3">
<div>序号{{ item.sortNum || '节点未保存' }}</div>
<div class="item-tooltip-name" v-if="item.deviceType">
设备类型{{ getDeviceTypeName(item.deviceType) }}
</div>
<div class="item-tooltip-name" v-if="item.deviceNo">
设备编号{{ item.deviceNo }}
</div>
</div>
<div v-else>
<div>序号{{ item.sortNum || '节点未保存' }}</div>
<div class="item-tooltip-name">
节点类型{{
item.type == 4
? '停车点'
: item.type == 5
? '区域变更点'
: item.type == 6
? '等待点'
: ''
}}
</div>
</div>
</template>
<div <div
v-if="item.type === 1 && item.layerSelectionShow" v-if="item.type === 1 && item.layerSelectionShow"
:style="{ :style="{
@ -673,12 +705,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 +727,21 @@
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"
/>
<!-- 生成直线 选择开始点和结束点 -->
<GenerateStraightLinesDialog
ref="GenerateStraightLinesDialogRef"
@GenerateStraightLinesSubmit="GenerateStraightLinesSubmit"
/> />
</div> </div>
</template> </template>
@ -716,13 +759,16 @@ import lineLibrarySettingDialog from './components-tool/lineLibrarySettingDialog
import layerSelectionToolDialog from './components-tool/layerSelectionToolDialog.vue' import layerSelectionToolDialog from './components-tool/layerSelectionToolDialog.vue'
import itemAreaManagementDialog from './components-tool/itemAreaManagementDialog.vue' import itemAreaManagementDialog from './components-tool/itemAreaManagementDialog.vue'
import lineLibraryManagementDialog from './components-tool/lineLibraryManagementDialog.vue' import lineLibraryManagementDialog from './components-tool/lineLibraryManagementDialog.vue'
import GenerateStraightLinesDialog from './components-tool/GenerateStraightLinesDialog.vue'
import mapScaleTool from './components-tool/map-scale-tool.vue' import mapScaleTool from './components-tool/map-scale-tool.vue'
import * as MapApi from '@/api/map/map' import * as MapApi from '@/api/map/map'
import cursorCollection from './cursorCollection' import cursorCollection from './cursorCollection'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
defineOptions({ name: 'editMapPageRealTimeMap' }) defineOptions({ name: 'editMapPageRealTimeMap' })
const GenerateStraightLinesDialogRef = ref() //线
const lineLibraryManagementDialogRef = ref() //线 const lineLibraryManagementDialogRef = ref() //线
const itemAreaManagementDialogRef = ref() // const itemAreaManagementDialogRef = ref() //
const lineLibrarySettingDialogRef = ref() //线 const lineLibrarySettingDialogRef = ref() //线
@ -921,7 +967,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 +1227,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 +1239,7 @@ const state = reactive({
}, },
{ {
switchType: 'clickDrawRoute', switchType: 'clickDrawRoute',
name: '绘制路线', name: '新增路线',
icon: 'ep:semi-select', icon: 'ep:semi-select',
isActive: false isActive: false
}, },
@ -1255,7 +1301,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 +1560,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 +2004,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
}) })
@ -2052,96 +2098,85 @@ const clickDrawSelectionArea = () => {
message.warning('您选择的路径点存在未保存的') message.warning('您选择的路径点存在未保存的')
return return
} }
const list = mapPointsToLine(routeList) GenerateStraightLinesDialogRef.value.open(routeList)
const idNameMap = {}
list.forEach((item) => {
idNameMap[item.id] = item
})
// name
state.allMapPointInfo.forEach((item) => {
if (idNameMap[item.id]) {
let actualPoint = disposeEventPoint(
idNameMap[item.id].locationX,
idNameMap[item.id].locationY
)
item.locationX = idNameMap[item.id].locationX
item.locationY = idNameMap[item.id].locationY
item.actualLocationX = actualPoint.actualLocationX
item.actualLocationY = actualPoint.actualLocationY
}
})
state.mapRouteList.forEach((item) => {
if (idNameMap[item.startingPointId]) {
let actualPoint = disposeEventPoint(
idNameMap[item.startingPointId].locationX,
idNameMap[item.startingPointId].locationY
)
item.startPointX = idNameMap[item.startingPointId].locationX
item.startPointY = idNameMap[item.startingPointId].locationY
item.actualStartPointX = actualPoint.actualLocationX
item.actualStartPointY = actualPoint.actualLocationY
}
if (idNameMap[item.endPointId]) {
let actualPoint = disposeEventPoint(
idNameMap[item.endPointId].locationX,
idNameMap[item.endPointId].locationY
)
item.endPointX = idNameMap[item.endPointId].locationX
item.endPointY = idNameMap[item.endPointId].locationY
item.actualEndPointX = actualPoint.actualLocationX
item.actualEndPointY = actualPoint.actualLocationY
}
})
addEditHistory()
} }
} }
// 线 //线
const mapPointsToLine = (points) => { const GenerateStraightLinesSubmit = (pointList, form) => {
// locationX const list = mapPointsToLine(pointList, form.startPointId, form.endPointId)
// let minXPoint = points[0] const idNameMap = {}
// let maxXPoint = points[0] list.forEach((item) => {
// points.forEach((point) => { idNameMap[item.id] = item
// if (point.locationX < minXPoint.locationX) { })
// minXPoint = point // name
// } state.allMapPointInfo.forEach((item) => {
// if (point.locationX > maxXPoint.locationX) { if (idNameMap[item.id]) {
// maxXPoint = point let actualPoint = disposeEventPoint(
// } idNameMap[item.id].locationX,
// }) idNameMap[item.id].locationY
)
item.locationX = idNameMap[item.id].locationX
item.locationY = idNameMap[item.id].locationY
item.actualLocationX = actualPoint.actualLocationX
item.actualLocationY = actualPoint.actualLocationY
}
})
state.mapRouteList.forEach((item) => {
if (idNameMap[item.startingPointId]) {
let actualPoint = disposeEventPoint(
idNameMap[item.startingPointId].locationX,
idNameMap[item.startingPointId].locationY
)
item.startPointX = idNameMap[item.startingPointId].locationX
item.startPointY = idNameMap[item.startingPointId].locationY
item.actualStartPointX = actualPoint.actualLocationX
item.actualStartPointY = actualPoint.actualLocationY
}
if (idNameMap[item.endPointId]) {
let actualPoint = disposeEventPoint(
idNameMap[item.endPointId].locationX,
idNameMap[item.endPointId].locationY
)
item.endPointX = idNameMap[item.endPointId].locationX
item.endPointY = idNameMap[item.endPointId].locationY
item.actualEndPointX = actualPoint.actualLocationX
item.actualEndPointY = actualPoint.actualLocationY
}
})
addEditHistory()
}
// sortNum // 线
let minXPoint = points[0] const mapPointsToLine = (points, startPointId, endPointId) => {
let maxXPoint = points[0] const startPoint = points.find((point) => point.id === startPointId)
for (let i = 1; i < points.length; i++) { const endPoint = points.find((point) => point.id === endPointId)
if (points[i].sortNum < minXPoint.sortNum) {
minXPoint = points[i] if (!startPoint || !endPoint) {
} message.warning('选择的点位有误')
if (points[i].sortNum > maxXPoint.sortNum) { return
maxXPoint = points[i]
}
} }
const dx = maxXPoint.locationX - minXPoint.locationX const dx = startPoint.locationX - endPoint.locationX
const dy = maxXPoint.locationY - minXPoint.locationY const dy = startPoint.locationY - endPoint.locationY
// 线 // 线
if (dx === 0) { if (dx === 0) {
return points.map((point) => { return points.map((point) => {
if (point === minXPoint || point === maxXPoint) { if (point === endPoint || point === startPoint) {
return point return point
} }
return { return {
...point, ...point,
locationX: minXPoint.locationX locationX: endPoint.locationX
} }
}) })
} }
const slope = dy / dx const slope = dy / dx
const intercept = minXPoint.locationY - slope * minXPoint.locationX const intercept = endPoint.locationY - slope * endPoint.locationX
return points.map((point) => { return points.map((point) => {
if (point === minXPoint || point === maxXPoint) { if (point === endPoint || point === startPoint) {
return point return point
} }
const newY = slope * point.locationX + intercept const newY = slope * point.locationX + intercept
@ -2151,6 +2186,7 @@ const mapPointsToLine = (points) => {
} }
}) })
} }
//线 //线
const isStraightLine = (binLocation) => { const isStraightLine = (binLocation) => {
if (binLocation.length <= 2) { if (binLocation.length <= 2) {
@ -2523,6 +2559,8 @@ const getAllNodeList = async () => {
item.dataList = JSONBigInt({ storeAsString: true }).parse(item.dataJson) item.dataList = JSONBigInt({ storeAsString: true }).parse(item.dataJson)
item.locationDeep = item.dataList[0].locationDeep item.locationDeep = item.dataList[0].locationDeep
item.locationWide = item.dataList[0].locationWide item.locationWide = item.dataList[0].locationWide
item.areaName = item.dataList[0].areaName || undefined
item.laneName = item.dataList[0].laneName || undefined
item.draggable = true item.draggable = true
item.resizable = true item.resizable = true
item.rotatable = false item.rotatable = false
@ -2534,6 +2572,7 @@ const getAllNodeList = async () => {
item.locationWide = item.dataObj.locationWide item.locationWide = item.dataObj.locationWide
item.deviceId = item.dataObj.id item.deviceId = item.dataObj.id
item.deviceNo = item.dataObj.deviceNo item.deviceNo = item.dataObj.deviceNo
item.deviceType = item.dataObj.deviceType
item.mapImageUrl = item.dataObj.mapImageUrl item.mapImageUrl = item.dataObj.mapImageUrl
item.draggable = true item.draggable = true
item.resizable = true item.resizable = true
@ -2582,6 +2621,14 @@ const getAllMapRoute = async () => {
mapRouteList: JSON.parse(JSON.stringify(state.mapRouteList)) mapRouteList: JSON.parse(JSON.stringify(state.mapRouteList))
} }
} }
//
const getDeviceTypeName = (deviceType) => {
let list = getIntDictOptions(DICT_TYPE.DEVICE_TYPE)
let deviceItem = list.find((item) => {
return item.value == deviceType
})
return deviceItem.label
}
// //
const saveMap = async () => { const saveMap = async () => {
// //
@ -2655,6 +2702,82 @@ 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) => {
@ -2872,6 +2995,13 @@ onUnmounted(() => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.item-tooltip-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 200px;
}
.edit-map-page { .edit-map-page {
.map-container { .map-container {
position: relative; position: relative;

View File

@ -130,11 +130,11 @@ const handleChangeMap = async (e) => {
indexPageRef.value.getMapData(item) indexPageRef.value.getMapData(item)
console.log(item) console.log(item)
router.replace({ router.replace({
name: 'MapPageRealTimeMap', name: 'MapPageRealTimeMap',
query: { query: {
mapId: item.id mapId: item.id
} }
}) })
} }
// //
const createTaskDialogRef = ref() const createTaskDialogRef = ref()
@ -142,13 +142,16 @@ const createTask = async () => {
ElMessageBox.confirm('是否发起拼接任务?', '提示', { ElMessageBox.confirm('是否发起拼接任务?', '提示', {
confirmButtonText: '是', confirmButtonText: '是',
cancelButtonText: '否', cancelButtonText: '否',
type: 'warning' type: 'warning',
distinguishCancelAndClose: true
}) })
.then(() => { .then(() => {
push({ name: 'taskManagementCreateTask' }) push({ name: 'taskManagementCreateTask' })
}) })
.catch(() => { .catch((action) => {
createTaskDialogRef.value.open() if (action === 'cancel') {
createTaskDialogRef.value.open()
}
}) })
} }

View File

@ -162,7 +162,6 @@
/> />
</div> </div>
</el-popover> </el-popover>
<el-button <el-button
type="primary" type="primary"
@click="finishTask(props.row, scope.row)" @click="finishTask(props.row, scope.row)"
@ -275,7 +274,7 @@ const getRowspan = (key, rowIndex, list) => {
const cancelTask = async (mainItem, item) => { const cancelTask = async (mainItem, item) => {
try { try {
await message.delConfirm('请确认是否取消所有任务?') await message.delConfirm('请确认是否取消所有任务?')
await MapTaskAPi.updateTask({ await MapTaskAPi.closeTask({
id: mainItem.id, id: mainItem.id,
priority: mainItem.priority, priority: mainItem.priority,
montageTask: mainItem.montageTask, montageTask: mainItem.montageTask,
@ -292,13 +291,9 @@ const finishTask = async (mainItem, item) => {
try { try {
await message.delConfirm('请确认是否人工完成任务?') await message.delConfirm('请确认是否人工完成任务?')
await MapTaskAPi.updateTask({ await MapTaskAPi.updateTask({
id: mainItem.id, id: item.id
priority: mainItem.priority,
montageTask: mainItem.montageTask,
montageNumber: mainItem.montageNumber,
taskStatus: 5
}) })
message.success('已取消') message.success('已完成')
await getList() await getList()
} catch {} } catch {}
} }
@ -324,6 +319,9 @@ const priorityNumChange = async (mainItem, item) => {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
queryParams.pageNo = 1 queryParams.pageNo = 1
if (queryParams.taskNo) {
queryParams.taskNo = queryParams.taskNo.replace(/\s/g, '')
}
getList() getList()
} }