Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
606a735aa5 | ||
![]() |
d8f6929190 | ||
![]() |
f62e0b5f0a | ||
![]() |
44b4935aa4 | ||
![]() |
39c2a529a8 | ||
![]() |
5847c3eaa4 | ||
![]() |
09d2a03b9e | ||
![]() |
922eb8bdbe | ||
![]() |
f99e5d0ff4 | ||
![]() |
ce338fce96 | ||
![]() |
52a73b43e1 | ||
![]() |
6dcda7cdd4 | ||
![]() |
b5785e88e1 |
@ -1,7 +1,5 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
|
||||
|
||||
//分页查询设备列表 看板信息设备目前用的是这个
|
||||
export const deviceInformationPage = async (params) => {
|
||||
return await request.get({ url: `/system/device/information/page`, params })
|
||||
@ -41,3 +39,6 @@ export const deviceGetInformationList = async (params) => {
|
||||
export const getMapDeviceImageUrl = async (params) => {
|
||||
return await request.get({ url: `/system/device/information/getMapImageUrl`, params })
|
||||
}
|
||||
export const getWareHouseTakePointList = async (data) => {
|
||||
return await request.post({ url: `/system/ware/house-take-point/list`, data })
|
||||
}
|
||||
|
@ -265,6 +265,7 @@
|
||||
<div
|
||||
class="item-inner-left-bottom-btn"
|
||||
:style="{ color: item.onlineStatus == 0 ? '#CCCCCC' : '#0D162A' }"
|
||||
@click="viewDeviceLog"
|
||||
>
|
||||
日志查看
|
||||
</div>
|
||||
@ -556,12 +557,26 @@ const clockCar = (item) => {
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
//前往地图定位
|
||||
const goToMap = (item) => {
|
||||
//地图定位
|
||||
const goMap = (item) => {
|
||||
if (!item.floor || !item.area) {
|
||||
message.warning('该车辆未配置地图信息')
|
||||
return
|
||||
}
|
||||
router.push({
|
||||
name: 'MapPageRealTimeMap',
|
||||
query: {
|
||||
id: item.id
|
||||
floor: item.floor,
|
||||
area: item.area
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const viewDeviceLog = () => {
|
||||
router.push({
|
||||
name: 'MapLogQueriesList',
|
||||
query: {
|
||||
activeTab: 2 // 指定打开车辆日志标签页
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -945,6 +960,7 @@ input::input-placeholder {
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.popover-menu-item:hover {
|
||||
background: #f5f5f5;
|
||||
background-color: #f5f7fa;
|
||||
color: #1677ff;
|
||||
}
|
||||
</style>
|
||||
|
@ -44,10 +44,24 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备IP" v-if="formData.deviceType !== 9">
|
||||
<el-input v-model="formData.deviceIp" :disabled="false" show-word-limit placeholder="请输入设备ip" maxlength="20" @input="formData.deviceIp=formData.deviceIp.replace(/[^\d.]/g,'')" />
|
||||
<el-input
|
||||
v-model="formData.deviceIp"
|
||||
:disabled="false"
|
||||
show-word-limit
|
||||
placeholder="请输入设备ip"
|
||||
maxlength="20"
|
||||
@input="formData.deviceIp = formData.deviceIp.replace(/[^\d.]/g, '')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="端口" v-if="formData.deviceType !== 9">
|
||||
<el-input v-model="formData.devicePort" :disabled="false" show-word-limit placeholder="请输入端口" maxlength="10" @input="formData.devicePort=formData.devicePort.replace(/[\u4E00-\u9FA5]/g,'')"/>
|
||||
<el-input
|
||||
v-model="formData.devicePort"
|
||||
:disabled="false"
|
||||
show-word-limit
|
||||
placeholder="请输入端口"
|
||||
maxlength="10"
|
||||
@input="formData.devicePort = formData.devicePort.replace(/[\u4E00-\u9FA5]/g, '')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="充电桩类型" prop="deviceAttribute" v-if="formData.deviceType == 1">
|
||||
<el-select v-model="formData.deviceAttribute" clearable placeholder="请选择设备类型">
|
||||
@ -78,6 +92,31 @@
|
||||
<el-option :label="'启用'" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备取放货点位" v-if="formData.deviceType == 10" required>
|
||||
<el-select v-model="formData.takePointId" filterable placeholder="请输入取放货点位">
|
||||
<el-option
|
||||
v-for="item in takePointList"
|
||||
:key="item.id"
|
||||
:label="item.pointName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测区点位" v-if="formData.deviceType == 10" required>
|
||||
<el-select
|
||||
v-model="formData.checkPointIds"
|
||||
multiple
|
||||
filterable
|
||||
placeholder="请选择检测区点位"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in checkPointList"
|
||||
:key="item.id"
|
||||
:label="item.pointName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备图标">
|
||||
<UploadImg v-model="formData.mapImageUrl" :limit="1" />
|
||||
</el-form-item>
|
||||
@ -104,9 +143,9 @@
|
||||
<script lang="ts" setup>
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
import * as MapTaskAPi from '@/api/map/mapTask'
|
||||
import * as DeviceApi from '@/api/device/index'
|
||||
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const title = ref('新建') // form表单
|
||||
@ -121,11 +160,38 @@ const formData = ref({
|
||||
deviceEnable: undefined, //设备启用禁用 设备启用禁用(0:禁用、1:启用)
|
||||
devicePort: undefined, //端口
|
||||
deviceIp: undefined, //设备IP
|
||||
cameraType:undefined, //摄像头类型
|
||||
deviceLocation:undefined, //设备位置
|
||||
cameraCode:undefined //摄像头编号
|
||||
cameraType: undefined, //摄像头类型
|
||||
deviceLocation: undefined, //设备位置
|
||||
cameraCode: undefined, //摄像头编号
|
||||
takePointId: undefined, //取放货点位
|
||||
checkPointIds: [] //检测区点位
|
||||
})
|
||||
|
||||
// 取放货点位列表
|
||||
const takePointList = ref([])
|
||||
// 检测区点位列表
|
||||
const checkPointList = ref([])
|
||||
|
||||
// 获取取放货点位列表
|
||||
const getTakePointList = async () => {
|
||||
try {
|
||||
takePointList.value = await DeviceApi.getWareHouseTakePointList({ pointType: 0 })
|
||||
} catch (error) {
|
||||
console.error('获取取放货点位失败:', error)
|
||||
takePointList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
// 获取检测区点位列表
|
||||
const getCheckPointList = async () => {
|
||||
try {
|
||||
checkPointList.value = await DeviceApi.getWareHouseTakePointList({ pointType: 1 })
|
||||
} catch (error) {
|
||||
console.error('获取检测区点位失败:', error)
|
||||
checkPointList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const formRules = reactive({
|
||||
deviceType: [{ required: true, message: '设备类型不能为空', trigger: 'blur' }],
|
||||
deviceNo: [{ required: true, message: '设备编号不能为空', trigger: 'blur' }],
|
||||
@ -137,35 +203,46 @@ const formRules = reactive({
|
||||
deviceEnable: [{ required: true, message: '是否启用不能为空', trigger: 'blur' }],
|
||||
cameraType: [{ required: true, message: '摄像头类型不能为空', trigger: 'blur' }],
|
||||
cameraCode: [{ required: true, message: '摄像头编号不能为空', trigger: 'blur' }],
|
||||
takePointId: [{ required: true, message: '取放货点位不能为空', trigger: 'blur' }],
|
||||
checkPointIds: [{ required: true, message: '检测点不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type, id) => {
|
||||
// console.log(getDictOptions(DICT_TYPE.DEVICE_TYPE))
|
||||
dialogVisible.value = true
|
||||
resetForm()
|
||||
if (id) {
|
||||
title.value = '编辑'
|
||||
const data = await DeviceApi.deviceInformationGet({ id })
|
||||
formData.value = data
|
||||
if (!formData.value.mapImageUrl) {
|
||||
DeviceApi.getMapDeviceImageUrl({
|
||||
deviceType: formData.value.deviceType
|
||||
}).then((res) => {
|
||||
// console.log(res)
|
||||
formData.value.mapImageUrl = res ? res : undefined
|
||||
})
|
||||
}
|
||||
// 根据设备类型设置 cameraType
|
||||
if (formData.value.deviceType !== 9) {
|
||||
formData.value.cameraType = undefined;
|
||||
}
|
||||
await loadDeviceDetail(id)
|
||||
} else {
|
||||
title.value = '新建'
|
||||
}
|
||||
// getCanUseRobotList()
|
||||
// getTaskNo()
|
||||
}
|
||||
|
||||
/** 加载设备详情 */
|
||||
const loadDeviceDetail = async (id) => {
|
||||
const data = await DeviceApi.deviceInformationGet({ id })
|
||||
formData.value = data
|
||||
|
||||
if (!formData.value.mapImageUrl) {
|
||||
DeviceApi.getMapDeviceImageUrl({
|
||||
deviceType: formData.value.deviceType
|
||||
}).then((res) => {
|
||||
formData.value.mapImageUrl = res ? res : undefined
|
||||
})
|
||||
}
|
||||
|
||||
// 根据设备类型设置 cameraType
|
||||
if (formData.value.deviceType !== 9) {
|
||||
formData.value.cameraType = undefined
|
||||
}
|
||||
|
||||
// 如果是翻转机,获取点位列表
|
||||
if (formData.value.deviceType === 10) {
|
||||
await getTakePointList()
|
||||
await getCheckPointList()
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
@ -196,76 +273,46 @@ const submitForm = async () => {
|
||||
}
|
||||
}
|
||||
// 设备类型切换
|
||||
const deviceTypeChange = (e) => {
|
||||
const deviceTypeChange = async (e) => {
|
||||
DeviceApi.getMapDeviceImageUrl({
|
||||
deviceType: e
|
||||
}).then((res) => {
|
||||
// console.log(res)
|
||||
formData.value.mapImageUrl = res ? res : undefined
|
||||
})
|
||||
if (e === 9) {
|
||||
formData.value.cameraType = '1';
|
||||
formData.value.cameraType = '1'
|
||||
} else {
|
||||
formData.value.cameraType = undefined;
|
||||
formData.value.cameraType = undefined
|
||||
}
|
||||
}
|
||||
//前往任务管理页面
|
||||
const { push } = useRouter()
|
||||
const taskManagement = () => {
|
||||
push({ name: 'taskManagementCreateTask' })
|
||||
}
|
||||
|
||||
//查询能用的车辆
|
||||
const robotList = ref([])
|
||||
const getCanUseRobotList = async () => {
|
||||
robotList.value = await MapTaskAPi.getCanUseRobot()
|
||||
}
|
||||
|
||||
//获取任务号
|
||||
const getTaskNo = async () => {
|
||||
formData.value.taskNo = await MapTaskAPi.getTaskNo()
|
||||
}
|
||||
|
||||
//获取取货位置可选的列表
|
||||
const getLocationList = async (type, locationNo) => {
|
||||
return await MapTaskAPi.getLocationByName({
|
||||
type, // 放货类型(1:库位、2:线库、 3:区域)
|
||||
locationNo
|
||||
})
|
||||
}
|
||||
//放货的选择列表
|
||||
const loading = ref(false)
|
||||
const releaseRemoteMethod = async (query, item) => {
|
||||
if (query) {
|
||||
loading.value = true
|
||||
item.releaseList = await getLocationList(item.releaseType, query)
|
||||
loading.value = false
|
||||
} else {
|
||||
item.releaseList = []
|
||||
}
|
||||
}
|
||||
//取货的选择列表
|
||||
const takeRemoteMethod = async (query, item) => {
|
||||
if (query) {
|
||||
item.takeList = await getLocationList(item.takeType, query)
|
||||
} else {
|
||||
item.takeList = []
|
||||
// 当设备类型为翻转机(10)时,获取点位列表
|
||||
if (e === 10) {
|
||||
await getTakePointList()
|
||||
await getCheckPointList()
|
||||
// 重置点位选择
|
||||
formData.value.takePointId = undefined
|
||||
formData.value.checkPointIds = []
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
deviceType: undefined, //车辆类型id
|
||||
deviceType: undefined, //设备类型
|
||||
deviceNo: undefined, //车辆编号
|
||||
macAddress: undefined, //mac地址
|
||||
mapImageUrl: undefined, //设备在地图上图标
|
||||
pictureConfig: undefined, // 图片设置(1:默认图片、2:上传图片、 3:不显示图片)
|
||||
url: undefined, //上传图片附件
|
||||
deviceAttribute: undefined,//充电桩类型
|
||||
cameraType:undefined, //摄像头类型
|
||||
deviceLocation:undefined, //设备位置
|
||||
cameraCode:undefined, //摄像头编号
|
||||
deviceAttribute: undefined,
|
||||
deviceEnable: undefined, //设备启用禁用 设备启用禁用(0:禁用、1:启用)
|
||||
devicePort: undefined, //端口
|
||||
deviceIp: undefined, //设备IP
|
||||
cameraType: undefined, //摄像头类型
|
||||
deviceLocation: undefined, //设备位置
|
||||
cameraCode: undefined, //摄像头编号
|
||||
takePointId: undefined, //取放货点位
|
||||
checkPointIds: [] //检测区点位
|
||||
}
|
||||
|
||||
formRef.value?.resetFields()
|
||||
|
@ -43,91 +43,118 @@
|
||||
</div>
|
||||
</ContentWrap>
|
||||
<div class="new-list-box-all">
|
||||
<div class="new-list-box">
|
||||
<div class="item" v-for="(item, index) in list" :key="index">
|
||||
<div class="item-top">
|
||||
<div class="item-inner-left-name">
|
||||
<div class="item-inner-left-name-inner">
|
||||
{{ filterTypeFun(item.deviceType, typeList) }} {{ item.deviceNo }}
|
||||
<el-skeleton :rows="6" animated :loading="loading" :throttle="500">
|
||||
<template #template>
|
||||
<div style="padding: 20px">
|
||||
<el-skeleton-item variant="h1" style="width: 50%" />
|
||||
<div style="display: flex; justify-content: space-between; margin-top: 20px">
|
||||
<div style="width: 30%">
|
||||
<el-skeleton-item variant="image" style="width: 100%; height: 150px" />
|
||||
</div>
|
||||
<div style="width: 65%">
|
||||
<el-skeleton-item variant="text" style="width: 100%; margin-bottom: 10px" />
|
||||
<el-skeleton-item variant="text" style="width: 100%; margin-bottom: 10px" />
|
||||
<el-skeleton-item variant="text" style="width: 100%; margin-bottom: 10px" />
|
||||
<el-skeleton-item variant="text" style="width: 100%" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-inner-right-top">
|
||||
<div class="swiper-item-box-top-msg">
|
||||
<el-dropdown>
|
||||
<div style="flex-shrink: 0">
|
||||
<el-icon size="20px"><MoreFilled /></el-icon>
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<div class="new-list-box">
|
||||
<div class="item" v-for="(item, index) in list" :key="index">
|
||||
<div class="item-top">
|
||||
<div class="item-inner-left-name">
|
||||
<div class="item-inner-left-name-inner">
|
||||
{{ filterTypeFun(item.deviceType, typeList) }} {{ item.deviceNo }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-inner-right-top">
|
||||
<div class="swiper-item-box-top-msg">
|
||||
<el-popover placement="bottom" trigger="click">
|
||||
<template #reference>
|
||||
<div style="flex-shrink: 0; cursor: pointer">
|
||||
<el-icon size="20px"><MoreFilled /></el-icon>
|
||||
</div>
|
||||
</template>
|
||||
<div class="popover-menu">
|
||||
<div
|
||||
class="popover-menu-item"
|
||||
@click="openForm('update', item.id)"
|
||||
v-hasPermi="['device:index:edit']"
|
||||
>编辑</div
|
||||
>
|
||||
<div
|
||||
class="popover-menu-item"
|
||||
@click="clockDevice(item)"
|
||||
v-hasPermi="['device:index:lock']"
|
||||
>{{ item.deviceEnable == 0 ? '启用' : '禁用' }}</div
|
||||
>
|
||||
<div
|
||||
class="popover-menu-item"
|
||||
@click="deleteCar(item.id)"
|
||||
v-hasPermi="['device:index:delete']"
|
||||
>删除</div
|
||||
>
|
||||
</div>
|
||||
</el-popover>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item
|
||||
@click="openForm('update', item.id)"
|
||||
v-hasPermi="['device:index:edit']"
|
||||
>编辑</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
@click="clockDevice(item)"
|
||||
v-hasPermi="['device:index:lock']"
|
||||
>{{ item.deviceEnable == 0 ? '启用' : '禁用' }}</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
@click="deleteCar(item.id)"
|
||||
v-hasPermi="['device:index:delete']"
|
||||
>删除</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-inner-left">
|
||||
<div class="item-inner-left-img-box">
|
||||
<el-image
|
||||
style="width: 100%; height: 100%"
|
||||
:src="item.url"
|
||||
:fit="'fill'"
|
||||
v-if="item.pictureConfig != 3"
|
||||
/>
|
||||
<div class="item-inner-left-img-box-no" v-else>
|
||||
<span>不显示图片</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-inner-left-bottom">
|
||||
<div class="item-inner-left-bottom-btn" @click="goMap(item)"> 地图定位 </div>
|
||||
<div class="item-inner-left-bottom-btn"> 日志查看 </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-inner-right-msg">
|
||||
<div class="item-inner-right-msg-item m-b-10">
|
||||
<div class="item-inner-right-msg-item-name">编号</div>
|
||||
<div class="item-inner-right-msg-item-value overhide">{{ item.deviceNo || '' }}</div>
|
||||
</div>
|
||||
<div class="item-inner-right-msg-item m-b-10">
|
||||
<div class="item-inner-right-msg-item-name overhide">是否启用</div>
|
||||
<div class="item-inner-right-msg-item-value">
|
||||
<span v-if="item.deviceEnable == 0" style="color: #c60606">禁用</span>
|
||||
<span v-if="item.deviceEnable == 1" style="color: #4dc606">启用</span>
|
||||
<div class="item-inner">
|
||||
<div class="item-inner-left">
|
||||
<div class="item-inner-left-img-box">
|
||||
<el-image
|
||||
style="width: 100%; height: 100%"
|
||||
:src="item.url"
|
||||
:fit="'fill'"
|
||||
v-if="item.pictureConfig != 3"
|
||||
/>
|
||||
<div class="item-inner-left-img-box-no" v-else>
|
||||
<span>不显示图片</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-inner-left-bottom">
|
||||
<div class="item-inner-left-bottom-btn" @click="goMap(item)"> 地图定位 </div>
|
||||
<div class="item-inner-left-bottom-btn" @click="viewDeviceLog(item)">
|
||||
日志查看
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-inner-right-msg-item m-b-10">
|
||||
<div class="item-inner-right-msg-item-name">位置</div>
|
||||
<div class="item-inner-right-msg-item-value" v-if="item.deviceLocation !== null"
|
||||
>{{ item.deviceLocation || '' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-inner-right-msg-item">
|
||||
<div class="item-inner-right-msg-item-name overhide">最后通讯时间</div>
|
||||
<div
|
||||
class="item-inner-right-msg-item-value overhide"
|
||||
v-if="item.deviceLastTime !== null"
|
||||
>{{ item.deviceLastTime || '' }}
|
||||
<div class="item-inner-right-msg">
|
||||
<div class="item-inner-right-msg-item m-b-10">
|
||||
<div class="item-inner-right-msg-item-name">编号</div>
|
||||
<div class="item-inner-right-msg-item-value overhide">{{
|
||||
item.deviceNo || ''
|
||||
}}</div>
|
||||
</div>
|
||||
<div class="item-inner-right-msg-item m-b-10">
|
||||
<div class="item-inner-right-msg-item-name overhide">是否启用</div>
|
||||
<div class="item-inner-right-msg-item-value">
|
||||
<span v-if="item.deviceEnable == 0" style="color: #c60606">禁用</span>
|
||||
<span v-if="item.deviceEnable == 1" style="color: #4dc606">启用</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-inner-right-msg-item m-b-10">
|
||||
<div class="item-inner-right-msg-item-name">位置</div>
|
||||
<div class="item-inner-right-msg-item-value" v-if="item.deviceLocation !== null"
|
||||
>{{ item.deviceLocation || '' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-inner-right-msg-item">
|
||||
<div class="item-inner-right-msg-item-name overhide">最后通讯时间</div>
|
||||
<div
|
||||
class="item-inner-right-msg-item-value overhide"
|
||||
v-if="item.deviceLastTime !== null"
|
||||
>{{ item.deviceLastTime || '' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
<createEditDialog ref="createEditDialogRef" @success="initFun()" />
|
||||
</template>
|
||||
@ -149,6 +176,7 @@ const message = useMessage() // 消息弹窗
|
||||
const router = useRouter() // 路由对象
|
||||
const createEditDialogRef = ref(null)
|
||||
const list = ref([])
|
||||
const loading = ref(true) // 添加loading状态
|
||||
const queryParams = reactive({
|
||||
deviceNo: undefined,
|
||||
deviceType: undefined
|
||||
@ -160,21 +188,6 @@ const handleClick = (tab, event) => {
|
||||
getCarList()
|
||||
}
|
||||
|
||||
const typeList = ref([])
|
||||
const typeListCache = new Map()
|
||||
|
||||
const getTypeList = () => {
|
||||
const cacheKey = 'device_type_list'
|
||||
if (typeListCache.has(cacheKey)) {
|
||||
typeList.value = typeListCache.get(cacheKey)
|
||||
} else {
|
||||
const options = getDictOptions(DICT_TYPE.DEVICE_TYPE) || []
|
||||
typeList.value = [{ label: '全部', value: '-1' }, ...options]
|
||||
typeListCache.set(cacheKey, typeList.value)
|
||||
}
|
||||
getRobotInformationStatistics()
|
||||
}
|
||||
|
||||
//根据type和列表返回对应中文
|
||||
const filterTypeFun = (type, list) => {
|
||||
if (!list?.length) return type
|
||||
@ -189,7 +202,7 @@ const goMap = (item) => {
|
||||
return
|
||||
}
|
||||
router.push({
|
||||
path: '/mapPage/realTimeMap',
|
||||
name: 'MapPageRealTimeMap',
|
||||
query: {
|
||||
floorArea: JSON.stringify([item.floor, item.positionMapId])
|
||||
}
|
||||
@ -199,22 +212,29 @@ const goMap = (item) => {
|
||||
const timerRef = ref(null)
|
||||
//查询车辆列表
|
||||
const getCarList = debounce(async () => {
|
||||
loading.value = true // 查询前显示loading
|
||||
try {
|
||||
list.value = await DeviceApi.deviceGetInformationList(queryParams)
|
||||
} catch (error) {
|
||||
console.error('获取设备列表失败:', error)
|
||||
} finally {
|
||||
loading.value = false // 无论成功失败都关闭loading
|
||||
}
|
||||
}, 300)
|
||||
|
||||
const carStatistics = ref({
|
||||
standby: 0,
|
||||
inTask: 0,
|
||||
doLock: 0,
|
||||
offline: 0,
|
||||
fault: 0,
|
||||
charge: 0,
|
||||
total: 0
|
||||
})
|
||||
const typeList = ref([])
|
||||
|
||||
const getTypeList = () => {
|
||||
const res = getDictOptions(DICT_TYPE.DEVICE_TYPE) || []
|
||||
const options = res.map((item) => {
|
||||
return {
|
||||
label: item.label,
|
||||
value: item.value
|
||||
}
|
||||
})
|
||||
typeList.value = [{ label: '全部', value: '-1' }, ...options]
|
||||
getRobotInformationStatistics()
|
||||
}
|
||||
|
||||
//查询车辆统计
|
||||
const getRobotInformationStatistics = async () => {
|
||||
@ -227,7 +247,8 @@ const getRobotInformationStatistics = async () => {
|
||||
|
||||
let total = 0
|
||||
typeList.value.forEach((item) => {
|
||||
const matchItem = res.find((resItem) => item.value === resItem.deviceType)
|
||||
// 将字符串类型的value转为数字进行比较,或将接口返回的deviceType转为字符串进行比较
|
||||
const matchItem = res.find((resItem) => String(resItem.deviceType) === item.value)
|
||||
item.number = matchItem ? Number(matchItem.number) : 0
|
||||
if (item.value !== '-1') {
|
||||
total += item.number
|
||||
@ -238,6 +259,7 @@ const getRobotInformationStatistics = async () => {
|
||||
console.error('获取设备统计失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
const clockDevice = (item) => {
|
||||
let valueStr = item.deviceEnable == 1 ? '禁用' : '启用'
|
||||
let data = JSON.parse(JSON.stringify(item))
|
||||
@ -248,12 +270,16 @@ const clockDevice = (item) => {
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
loading.value = true // 操作前显示loading
|
||||
DeviceApi.deviceInformationUpdate(data).then((res) => {
|
||||
initFun()
|
||||
message.success(`${valueStr}成功`)
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
loading.value = false // 操作后关闭loading
|
||||
})
|
||||
}
|
||||
//新建编辑车辆
|
||||
const openForm = (type, id) => {
|
||||
@ -267,30 +293,16 @@ const deleteCar = (id) => {
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
loading.value = true // 操作前显示loading
|
||||
DeviceApi.deleteDeviceInformation(id).then((res) => {
|
||||
initFun()
|
||||
message.success('删除成功')
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
const clockCar = (item) => {
|
||||
// let valueStr = item.robotTaskModel == 1 ? '锁定' : '解锁'
|
||||
// let data = JSON.parse(JSON.stringify(item))
|
||||
// data.robotTaskModel = item.robotTaskModel == 1 ? 0 : 1
|
||||
// ElMessageBox.confirm(`您确定要${valueStr}此车辆吗?`, '提示', {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
// type: 'warning'
|
||||
// })
|
||||
// .then(() => {
|
||||
// DeviceApi.robotInformationUpdate(data).then((res) => {
|
||||
// getCarList()
|
||||
// message.success(`${valueStr}成功`)
|
||||
// })
|
||||
// })
|
||||
// .catch(() => {})
|
||||
.finally(() => {
|
||||
loading.value = false // 操作后关闭loading
|
||||
})
|
||||
}
|
||||
|
||||
//前往地图定位
|
||||
@ -303,7 +315,14 @@ const goToMap = (item) => {
|
||||
})
|
||||
}
|
||||
|
||||
const viewDeviceLog = (item) => {
|
||||
router.push({
|
||||
name: 'MapLogQueriesList'
|
||||
})
|
||||
}
|
||||
|
||||
const initFun = () => {
|
||||
loading.value = true // 初始化前显示loading
|
||||
getCarList()
|
||||
getTypeList()
|
||||
}
|
||||
@ -364,6 +383,23 @@ onBeforeRouteLeave((to, from, next) => {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
/* popover菜单样式 */
|
||||
.popover-menu {
|
||||
padding: 5px 0;
|
||||
}
|
||||
.popover-menu-item {
|
||||
padding: 8px 12px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
transition: background-color 0.3s;
|
||||
|
||||
&:hover {
|
||||
background-color: #f5f7fa;
|
||||
color: #1677ff;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-container {
|
||||
width: calc(100% - 60px);
|
||||
padding: 0 30px;
|
||||
|
@ -101,7 +101,7 @@
|
||||
</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-else-if="locationTypeNumber == 2 || locationTypeNumber == 3">
|
||||
<el-popover placement="top" trigger="click" :popper-style="{ padding: '0px' }">
|
||||
<template #reference>
|
||||
<img
|
||||
@ -135,6 +135,30 @@
|
||||
</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
<template v-else-if="locationTypeNumber == 4">
|
||||
<el-popover placement="top" trigger="hover" :popper-style="{ padding: '0px' }">
|
||||
<template #reference>
|
||||
<div
|
||||
@click="choosePoint(item)"
|
||||
:style="{
|
||||
position: 'absolute',
|
||||
left: Number(item.locationX) - Number(item.locationWidePx) / 2 + 'px',
|
||||
top: Number(item.locationY) - Number(item.locationDeepPx) / 2 + 'px',
|
||||
width: item.locationWidePx + 'px',
|
||||
height: item.locationDeepPx + 'px',
|
||||
zIndex: 999,
|
||||
backgroundColor: item.id == currentItem?.id ? '#5ecc62' : '#000',
|
||||
borderRadius: '50%'
|
||||
}"
|
||||
></div>
|
||||
</template>
|
||||
<div class="drop-down-menu">
|
||||
<div class="drop-down-menu">
|
||||
<div class="drop-down-menu-item"> 取放货点:{{ item.sortNum }} </div>
|
||||
</div>
|
||||
</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -271,8 +295,9 @@ const getAllNodeList = async () => {
|
||||
positionMapId: imgBgObj.positionMapId
|
||||
})
|
||||
allMapPointInfo.value = []
|
||||
|
||||
list.forEach((item) => {
|
||||
item.locationX = convertActualToBrowser(item.actualLocationX, item.actualLocationY).x
|
||||
item.locationY = convertActualToBrowser(item.actualLocationX, item.actualLocationY).y
|
||||
//只要库位
|
||||
if (locationTypeNumber.value == 1 && item.type === 2) {
|
||||
item.locationX = Number(item.locationX) * (imgBgObj.showWidth / imgBgObj.width)
|
||||
@ -288,10 +313,11 @@ const getAllNodeList = async () => {
|
||||
item.locationDeepPx = pxObj.pHeight
|
||||
}
|
||||
allMapPointInfo.value.push(item)
|
||||
return
|
||||
}
|
||||
|
||||
//线库 laneId
|
||||
if (item.type === 2 && locationTypeNumber.value == 2 && item.laneId !== null) {
|
||||
if (locationTypeNumber.value == 2 && item.type === 2 && item.laneId !== null) {
|
||||
item.locationX = Number(item.locationX) * (imgBgObj.showWidth / imgBgObj.width)
|
||||
item.locationY = Number(item.locationY) * (imgBgObj.showWidth / imgBgObj.width)
|
||||
item.dataList = JSONBigInt({ storeAsString: true }).parse(item.dataJson)
|
||||
@ -306,10 +332,11 @@ const getAllNodeList = async () => {
|
||||
item.locationDeepPx = pxObj.pHeight
|
||||
}
|
||||
allMapPointInfo.value.push(item)
|
||||
return
|
||||
}
|
||||
|
||||
//区域 areaId
|
||||
if (item.type === 2 && locationTypeNumber.value == 3 && item?.areaId !== null) {
|
||||
if (locationTypeNumber.value == 3 && item.type === 2 && item?.areaId !== null) {
|
||||
item.locationX = Number(item.locationX) * (imgBgObj.showWidth / imgBgObj.width)
|
||||
item.locationY = Number(item.locationY) * (imgBgObj.showWidth / imgBgObj.width)
|
||||
item.dataList = JSONBigInt({ storeAsString: true }).parse(item.dataJson)
|
||||
@ -324,6 +351,24 @@ const getAllNodeList = async () => {
|
||||
item.locationDeepPx = pxObj.pHeight
|
||||
}
|
||||
allMapPointInfo.value.push(item)
|
||||
return
|
||||
}
|
||||
|
||||
if (item.type === 8 && locationTypeNumber.value == 4) {
|
||||
item.locationX = Number(item.locationX) * (imgBgObj.showWidth / imgBgObj.width)
|
||||
item.locationY = Number(item.locationY) * (imgBgObj.showWidth / imgBgObj.width)
|
||||
item.dataList = item.dataJson ? JSONBigInt({ storeAsString: true }).parse(item.dataJson) : []
|
||||
item.locationDeepPx = 8
|
||||
item.locationWidePx = 8
|
||||
|
||||
//要将实际的cm改成px
|
||||
if (item.locationWide && item.locationDeep) {
|
||||
let pxObj = cmConversionPx(item.locationWide, item.locationDeep)
|
||||
item.locationWidePx = pxObj.pWidth
|
||||
item.locationDeepPx = pxObj.pHeight
|
||||
}
|
||||
allMapPointInfo.value.push(item)
|
||||
return
|
||||
}
|
||||
|
||||
if (item.dataList && item.dataList.length > 0) {
|
||||
@ -420,6 +465,23 @@ const handleWheel = (event) => {
|
||||
|
||||
const emit = defineEmits(['locationSelectionDialogSuccess'])
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
// 传入实际现场的数据,转换成浏览器坐标的数据
|
||||
const convertActualToBrowser = (pointX, pointY) => {
|
||||
const y1 = Number(imgBgObj.origin[1]) + Number(imgBgObj.height) * Number(imgBgObj.resolution)
|
||||
let x =
|
||||
Math.round(
|
||||
(Math.max(Number(pointX) - Number(imgBgObj.origin[0]), 0) / Number(imgBgObj.resolution)) *
|
||||
10000
|
||||
) / 10000
|
||||
let y =
|
||||
Math.round((Math.max(y1 - Number(pointY), 0) / Number(imgBgObj.resolution)) * 10000) / 10000
|
||||
|
||||
return {
|
||||
x,
|
||||
y
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
@ -336,6 +336,7 @@ import { dateFormatter } from '@/utils/formatTime'
|
||||
defineOptions({ name: 'MapLogQueriesList' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const route = useRoute() // 路由对象
|
||||
|
||||
const activeName = ref('1') //tab栏
|
||||
|
||||
@ -459,9 +460,30 @@ const getCanUseRobotList = async () => {
|
||||
robotList.value = await MapTaskAPi.getCanUseRobot()
|
||||
}
|
||||
|
||||
// 处理URL参数
|
||||
const handleRouteParams = () => {
|
||||
const { query } = route
|
||||
|
||||
// 处理标签页切换
|
||||
if (query.activeTab) {
|
||||
activeName.value = query.activeTab
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getOperationLogList()
|
||||
// 处理URL参数
|
||||
handleRouteParams()
|
||||
|
||||
// 根据当前标签页加载对应数据
|
||||
if (activeName.value === '1') {
|
||||
getOperationLogList()
|
||||
} else if (activeName.value === '2') {
|
||||
getCarLogList()
|
||||
} else if (activeName.value === '3') {
|
||||
getTaskLogList()
|
||||
}
|
||||
|
||||
getCanUseRobotList()
|
||||
})
|
||||
</script>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<Dialog
|
||||
v-model="dialogFormVisible"
|
||||
title="节点属性"
|
||||
width="650"
|
||||
width="700"
|
||||
class="node-form-dialog"
|
||||
@close="dialogClose"
|
||||
>
|
||||
@ -70,11 +70,13 @@
|
||||
<el-option label="停车点" :value="4" />
|
||||
<el-option label="区域变更点" :value="5" />
|
||||
<el-option label="等待点" :value="6" />
|
||||
<el-option label="取放货点" :value="8" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="弧度" prop="locationYaw" required>
|
||||
<el-input-number
|
||||
class="!w-300px"
|
||||
class="!w-18.75rem"
|
||||
v-model="form.locationYaw"
|
||||
:min="-MathPI"
|
||||
:max="MathPI"
|
||||
@ -86,7 +88,7 @@
|
||||
<div v-if="form.type === 2 || form.type === 3 || form.type === 4">
|
||||
<el-form-item label="层数" prop="layersNumber" required v-if="form.type === 2">
|
||||
<el-input-number
|
||||
class="!w-300px"
|
||||
class="!w-18.75rem"
|
||||
v-model="form.layersNumber"
|
||||
:min="1"
|
||||
:max="4"
|
||||
@ -97,14 +99,14 @@
|
||||
<el-text class="mx-1">(最大层数:4)</el-text>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="locationNumber" v-if="form.type === 2" required>
|
||||
<el-input-number class="!w-300px" v-model="form.locationNumber" :min="1" />
|
||||
<el-input-number class="!w-18.75rem" v-model="form.locationNumber" :min="1" />
|
||||
<el-text class="mx-1">(最大值:10000000)</el-text>
|
||||
</el-form-item>
|
||||
<el-form-item label="编号" prop="deviceId" required v-if="form.type === 3">
|
||||
<div>
|
||||
<el-select
|
||||
v-model="deviceInfo.deviceType"
|
||||
class="!w-160px"
|
||||
class="!w-10rem"
|
||||
clearable
|
||||
placeholder="请选择设备类型"
|
||||
@change="deviceTypeChange()"
|
||||
@ -118,7 +120,7 @@
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="form.deviceId"
|
||||
class="!w-160px ml-4"
|
||||
class="!w-10rem ml-4"
|
||||
clearable
|
||||
placeholder="请选择设备编号"
|
||||
@change="deviceChange"
|
||||
@ -133,10 +135,9 @@
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="库位类型" required prop="locationTypeId" v-if="form.type === 2">
|
||||
<el-select
|
||||
class="!w-300px"
|
||||
class="!w-18.75rem"
|
||||
v-model="form.locationTypeId"
|
||||
clearable
|
||||
placeholder="请选择库位类型"
|
||||
@ -150,11 +151,10 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="库位长度" prop="locationDeep" required>
|
||||
<div style="display: flex">
|
||||
<el-input-number
|
||||
class="!w-300px"
|
||||
class="!w-18.75rem"
|
||||
placeholder="请输入"
|
||||
v-model="form.locationDeep"
|
||||
:min="10"
|
||||
@ -166,7 +166,7 @@
|
||||
<el-form-item label="库位宽度" prop="locationWide" required>
|
||||
<div style="display: flex">
|
||||
<el-input-number
|
||||
class="!w-300px"
|
||||
class="!w-18.75rem"
|
||||
placeholder="请输入"
|
||||
v-model="form.locationWide"
|
||||
:min="10"
|
||||
@ -175,35 +175,6 @@
|
||||
<span class="ml-2">cm</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <div v-if="form.type === 2 || form.type === 4">
|
||||
<el-form-item label="库位方向" prop="direction">
|
||||
<el-select
|
||||
v-model="form.direction"
|
||||
placeholder="请选择库位方向"
|
||||
@change="directionChange"
|
||||
>
|
||||
<el-option label="单向" :value="1" />
|
||||
<el-option label="双向" :value="2" />
|
||||
<el-option label="三向" :value="3" />
|
||||
<el-option label="四向" :value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div v-if="form.direction !== 1">
|
||||
<el-form-item label="进入方向" prop="inDirection">
|
||||
<el-select v-model="form.inDirection" placeholder="请选择进入方向">
|
||||
<el-option label="尾入" :value="0" />
|
||||
<el-option label="头入" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="离开方向" prop="outDirection">
|
||||
<el-select v-model="form.outDirection" placeholder="请选择离开方向">
|
||||
<el-option label="尾出" :value="0" />
|
||||
<el-option label="头出" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<el-form-item label="区域变更点绑定" label-width="130" v-if="form.type === 5 && form.id">
|
||||
@ -226,6 +197,31 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<div v-if="form.type === 8">
|
||||
<el-button type="primary" class="ml-9 mb-4 mt-2" @click="addPointInfo"
|
||||
>添加点位信息</el-button
|
||||
>
|
||||
<div v-for="(item, index) in form.dataList" :key="index">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="名称" :prop="`dataList.${index}.pointName`">
|
||||
<el-input v-model="item.pointName" style="width: 100%" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="托盘高度" :prop="`dataList.${index}.trayHeight`">
|
||||
<div class="flex-center">
|
||||
<el-input v-model="item.trayHeight" style="width: 100%" placeholder="请输入" />
|
||||
<el-icon size="20" class="ml-2" color="#ff4c4c" @click="deletePointInfo(index)"
|
||||
><CircleCloseFilled
|
||||
/></el-icon>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
@ -412,6 +408,8 @@ const submit = async (formEl) => {
|
||||
form.value.dataJson = JSON.stringify(form.value.dataObj)
|
||||
} else if (form.value.type === 5) {
|
||||
form.value.dataJson = JSON.stringify(form.value.dataObj)
|
||||
} else if (form.value.type === 8) {
|
||||
form.value.dataJson = JSON.stringify(form.value.dataList)
|
||||
} else {
|
||||
//类型为路径点位 区域变更点 等待点 值为对象
|
||||
form.value.dataObj.positionMapId = props.positionMapId
|
||||
@ -475,63 +473,41 @@ const typeChange = (type) => {
|
||||
form.value.dataObj = {}
|
||||
form.value.dataList = []
|
||||
form.value.locationTypeId = null
|
||||
if (type === 1) {
|
||||
form.value.layersNumber = null
|
||||
form.value.direction = null
|
||||
form.value.inDirection = null
|
||||
form.value.outDirection = null
|
||||
form.value.locationNumber = null
|
||||
form.value.locationDeep = 40
|
||||
form.value.locationWide = 40
|
||||
form.value.locationDeepPx = 8
|
||||
form.value.locationWidePx = 8
|
||||
} else if (type === 2) {
|
||||
if (type === 2) {
|
||||
form.value.locationNumber = null
|
||||
//选一个默认的库位
|
||||
let firstItem = houseLocationTypeList.value[0]
|
||||
form.value.locationTypeId = firstItem.id
|
||||
form.value.locationDeep = Number(firstItem.locationDeep)
|
||||
form.value.locationWide = Number(firstItem.locationWide)
|
||||
} 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
|
||||
} 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
|
||||
} else if (type === 5) {
|
||||
} else {
|
||||
if (type === 1 || type === 8) {
|
||||
form.value.locationDeep = 40
|
||||
form.value.locationWide = 40
|
||||
form.value.locationDeepPx = 8
|
||||
form.value.locationWidePx = 8
|
||||
} else {
|
||||
form.value.locationDeep = 150
|
||||
form.value.locationWide = 150
|
||||
form.value.locationDeepPx = 30
|
||||
form.value.locationWidePx = 30
|
||||
}
|
||||
form.value.layersNumber = null
|
||||
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
|
||||
} else if (type === 6) {
|
||||
form.value.layersNumber = null
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
const addPointInfo = () => {
|
||||
form.value.dataList.push({ pointName: '', trayHeight: '' })
|
||||
}
|
||||
|
||||
const deletePointInfo = (index) => {
|
||||
form.value.dataList.splice(index, 1)
|
||||
}
|
||||
|
||||
//设备切换
|
||||
const deviceChange = (deviceId) => {
|
||||
deviceList.value.forEach((item) => {
|
||||
@ -541,13 +517,7 @@ const deviceChange = (deviceId) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
//方向改变
|
||||
const directionChange = (e) => {
|
||||
if (e === 1) {
|
||||
form.value.inDirection = undefined
|
||||
form.value.outDirection = undefined
|
||||
}
|
||||
}
|
||||
|
||||
//设备信息
|
||||
const deviceInfo = ref({
|
||||
positionMapId: '',
|
||||
|
@ -53,6 +53,11 @@ const list = ref([
|
||||
category: 'nodeImage',
|
||||
name: '库位图片',
|
||||
isShow: true
|
||||
},
|
||||
{
|
||||
category: 'checkLine',
|
||||
name: '校准线',
|
||||
isShow: false
|
||||
}
|
||||
])
|
||||
|
||||
|
@ -151,19 +151,39 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="item.type === 8">
|
||||
<div class="indexpage-popover-item">
|
||||
<div> 节点类型: </div>
|
||||
<div>取放货点</div>
|
||||
<div>
|
||||
{{ item.sortNum || '' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="indexpage-popover-item">
|
||||
<div>
|
||||
<div
|
||||
v-for="(location, locationIndex) in item.dataList"
|
||||
:key="locationIndex"
|
||||
>
|
||||
<span style="margin-right: 10px"
|
||||
>节点名称:{{ location.pointName || '' }}
|
||||
</span>
|
||||
<span>托盘高度:{{ location.trayHeight || '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="indexpage-popover-item">
|
||||
<div> 节点类型: </div>
|
||||
<div>{{
|
||||
item.type == 1
|
||||
? '路径点'
|
||||
: item.type == 4
|
||||
? '停车点'
|
||||
: item.type == 5
|
||||
? '区域变更点'
|
||||
: item.type == 6
|
||||
? '等待点'
|
||||
: ''
|
||||
item.type == 4
|
||||
? '停车点'
|
||||
: item.type == 5
|
||||
? '区域变更点'
|
||||
: item.type == 6
|
||||
? '等待点'
|
||||
: ''
|
||||
}}</div>
|
||||
<div>
|
||||
{{ item.sortNum || '' }}
|
||||
@ -172,43 +192,27 @@
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<div
|
||||
v-if="
|
||||
item.type === 1 &&
|
||||
legendObj.sortNumberShow &&
|
||||
item.sortNum &&
|
||||
sortNumberShow
|
||||
"
|
||||
class="sort-num"
|
||||
:style="getSortNumStyle(item, index)"
|
||||
>
|
||||
{{ item.sortNum }}
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
item.type !== 1 &&
|
||||
legendObj.sortNumberShow &&
|
||||
item.sortNum &&
|
||||
sortNumberShow
|
||||
"
|
||||
class="sort-num-location"
|
||||
:style="getSortNumLocationStyle(item, index)"
|
||||
>
|
||||
{{ item.sortNum }}
|
||||
</div>
|
||||
<div
|
||||
v-if="item.type === 1"
|
||||
:style="{
|
||||
width: Number(item.locationWidePx) * Number(radio) + 'px',
|
||||
height: Number(item.locationDeepPx) * Number(radio) + 'px',
|
||||
backgroundColor: '#000',
|
||||
borderRadius: '50%'
|
||||
}"
|
||||
>
|
||||
</div>
|
||||
<!-- sortNum -->
|
||||
<template v-if="legendObj.sortNumberShow && item.sortNum && sortNumberShow">
|
||||
<div
|
||||
v-if="item.type === 8"
|
||||
class="sort-num"
|
||||
:style="getSortNumStyle(item, index)"
|
||||
>
|
||||
{{ item.sortNum }}
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
class="sort-num-location"
|
||||
:style="getSortNumLocationStyle(item, index)"
|
||||
>
|
||||
{{ item.sortNum }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 库位点 -->
|
||||
<img
|
||||
v-else-if="item.type === 2"
|
||||
v-if="item.type === 2"
|
||||
src="@/assets/imgs/indexPage/bin-location.png"
|
||||
:style="nodeStyle(item, index)"
|
||||
@dblclick="storeClick(item)"
|
||||
@ -241,6 +245,16 @@
|
||||
style="background: #fff"
|
||||
:style="nodeStyle(item, index)"
|
||||
/>
|
||||
<!-- 取货点 -->
|
||||
<div
|
||||
v-else-if="item.type === 8"
|
||||
:style="{
|
||||
width: Number(item.locationWidePx) * Number(radio) + 'px',
|
||||
height: Number(item.locationDeepPx) * Number(radio) + 'px',
|
||||
backgroundColor: '#000',
|
||||
borderRadius: '50%'
|
||||
}"
|
||||
></div>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
@ -331,6 +345,7 @@ import { propTypes } from '@/utils/propTypes'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import dayjs from 'dayjs'
|
||||
import { throttle, debounce } from 'lodash-es'
|
||||
import { ElLoading } from 'element-plus'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@ -435,12 +450,15 @@ const filterTypeFun = (deviceType) => {
|
||||
const convertActualCarToBrowser = (pointX, pointY) => {
|
||||
const resolution = Number(imgBgObj.resolution)
|
||||
const [originX, originY] = imgBgObj.origin.map(Number)
|
||||
const imgHeight = Number(imgBgObj.height)
|
||||
// 使用原始高度计算,不使用可能已经被radio.value缩放过的imgBgObj.height
|
||||
const originalHeight = props.isFullScreen
|
||||
? Number(imgBgObj.height) / Number(radio.value)
|
||||
: Number(imgBgObj.height)
|
||||
const carW = Number(carWidth.value)
|
||||
const carH = Number(carHeight.value)
|
||||
|
||||
// 地图原点在左下角,y轴向上,需转换为浏览器坐标系(左上角,y轴向下)
|
||||
const yBottom = originY + imgHeight * resolution
|
||||
const yBottom = originY + originalHeight * resolution
|
||||
const xPx = Math.max(Number(pointX) - originX, 0) / resolution
|
||||
const yPx = Math.max(yBottom - Number(pointY), 0) / resolution
|
||||
|
||||
@ -480,15 +498,6 @@ const changeIsDrag = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取曲线的路径
|
||||
const getCurvePath = (curve) => {
|
||||
let startPointX = Number(curve.startPointX) * radio.value
|
||||
let startPointY = Number(curve.startPointY) * radio.value
|
||||
let endPointX = Number(curve.endPointX) * radio.value
|
||||
let endPointY = Number(curve.endPointY) * radio.value
|
||||
return `M ${startPointX} ${startPointY} C ${curve.beginControlX * radio.value} ${curve.beginControlY * radio.value}, ${curve.endControlX * radio.value} ${curve.endControlY * radio.value}, ${endPointX} ${endPointY}`
|
||||
}
|
||||
|
||||
//放大缩小
|
||||
const isSizeRadio = ref(1)
|
||||
const changeSize = (type) => {
|
||||
@ -643,14 +652,12 @@ const initWebsocket = () => {
|
||||
if (jsonMsg.type == 'map_push') {
|
||||
requestAnimationFrame(() => {
|
||||
let data = JSON.parse(jsonMsg.content)
|
||||
// console.log(data)
|
||||
// console.log(data, dayjs().format('HH:mm:ss SSS'))
|
||||
|
||||
let dataList = Object.entries(data).map(([key, value]) => ({
|
||||
macAddress: key,
|
||||
data: JSON.parse(value)
|
||||
}))
|
||||
testCarList.value = throttledUpdateCarList(testCarList.value, dataList, imgBgObj)
|
||||
// console.log(data, dayjs().format('HH:mm:ss SSS'))
|
||||
})
|
||||
}
|
||||
//告警信息
|
||||
@ -719,14 +726,12 @@ const mergeArraysWithoutDelete = (arr1, arr2) => {
|
||||
|
||||
// 优化车辆位置计算
|
||||
const processCarData = (car, mapInfo) => {
|
||||
// 保存原始分辨率信息用于调试
|
||||
const originalResolution = mapInfo.resolution
|
||||
const browserPos = convertActualCarToBrowser(car.data.pose2d.x, car.data.pose2d.y)
|
||||
|
||||
return {
|
||||
...car,
|
||||
originWidth: mapInfo.width,
|
||||
originHeight: mapInfo.height,
|
||||
origin: mapInfo.origin,
|
||||
realX: browserPos.x,
|
||||
realY: browserPos.y,
|
||||
robotNo: car.data.pose2d.robotNo,
|
||||
style: {
|
||||
left: browserPos.x * radio.value + 'px',
|
||||
@ -770,17 +775,14 @@ const computedRatio = () => {
|
||||
if (props.isFullScreen) {
|
||||
let width = getElementWidthByClass('index-page-container')
|
||||
|
||||
testCarList.value.forEach((item) => {
|
||||
item.originWidth = imgBgObj.width
|
||||
item.originHeight = imgBgObj.height
|
||||
item.origin = imgBgObj.origin
|
||||
item.realX = convertActualCarToBrowser(item.data.pose2d.x, item.data.pose2d.y).x
|
||||
item.realY = convertActualCarToBrowser(item.data.pose2d.x, item.data.pose2d.y).y
|
||||
})
|
||||
|
||||
// 记录原始尺寸和新的缩放比例
|
||||
const originalWidth = imgBgObj.width
|
||||
const originalHeight = imgBgObj.height
|
||||
radio.value = width / imgBgObj.width
|
||||
imgBgObj.width = imgBgObj.width * radio.value
|
||||
imgBgObj.height = imgBgObj.height * radio.value
|
||||
|
||||
// 只在视觉上应用缩放,但保留原始尺寸用于坐标计算
|
||||
imgBgObj.width = originalWidth * radio.value
|
||||
imgBgObj.height = originalHeight * radio.value
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -818,7 +820,7 @@ const getMapData = async (item) => {
|
||||
imgBgObj.origin = yamlJson.origin
|
||||
imgBgObj.resolution = yamlJson.resolution
|
||||
//获取地图
|
||||
getMapDownloadPng(imgBgObj)
|
||||
await getMapDownloadPng(imgBgObj)
|
||||
//初始化Websocket
|
||||
initWebsocket()
|
||||
}
|
||||
@ -830,10 +832,24 @@ const getMapDownloadPng = async (mapInfo) => {
|
||||
imgBgObj.imgUrl = data
|
||||
|
||||
//获取节点 路径等信息
|
||||
await getAllNodeList()
|
||||
await getAllMapRoute()
|
||||
await computedRatio()
|
||||
await getRobotByFloorAndAreaList()
|
||||
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '地图数据加载中',
|
||||
background: 'rgba(255, 255, 255, 0.7)'
|
||||
})
|
||||
try {
|
||||
await getAllNodeList()
|
||||
await getAllMapRoute()
|
||||
await computedRatio()
|
||||
await getRobotByFloorAndAreaList()
|
||||
//关闭loading
|
||||
loading.close()
|
||||
} catch (error) {
|
||||
loading.close()
|
||||
} finally {
|
||||
loading.close()
|
||||
}
|
||||
}
|
||||
// 获取地图连线
|
||||
const getAllMapRoute = async () => {
|
||||
@ -868,6 +884,11 @@ const getAllNodeList = async (positionMapId) => {
|
||||
item.dataObj = JSONBigInt({ storeAsString: true }).parse(item.dataJson)
|
||||
item.locationDeep = item.dataObj.locationDeep
|
||||
item.locationWide = item.dataObj.locationWide
|
||||
} else if (item.type === 8) {
|
||||
item.dataObj = {}
|
||||
item.dataList = item.dataJson ? JSONBigInt({ storeAsString: true }).parse(item.dataJson) : []
|
||||
item.locationDeep = 40
|
||||
item.locationWide = 40
|
||||
}
|
||||
//要将实际的cm改成px
|
||||
if (item.locationWide && item.locationDeep) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -64,16 +64,41 @@ const getList = async () => {
|
||||
}))
|
||||
}))
|
||||
|
||||
if (query.mapId) {
|
||||
// 处理从设备看板传来的floorArea参数
|
||||
const { query } = route
|
||||
if (query.floorArea) {
|
||||
try {
|
||||
const [floor, mapId] = JSON.parse(query.floorArea)
|
||||
if (floor && mapId) {
|
||||
mapValue.value = [String(floor), String(mapId)]
|
||||
handleChangeMap(mapValue.value)
|
||||
return
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('解析floorArea参数失败:', error)
|
||||
}
|
||||
} else if (query.floor && query.area) {
|
||||
// 处理从车辆看板传来的floor和area参数
|
||||
// 查找对应的地图ID
|
||||
const floorItem = list.value.find((item) => item.floor === query.floor)
|
||||
if (floorItem && floorItem.children) {
|
||||
const areaItem = floorItem.children.find((item) => item.area === query.area)
|
||||
if (areaItem) {
|
||||
mapValue.value = [String(query.floor), String(areaItem.id)]
|
||||
handleChangeMap(mapValue.value)
|
||||
return
|
||||
}
|
||||
}
|
||||
} else if (query.mapId) {
|
||||
// 处理mapId参数
|
||||
let item = findItemById(query.mapId)
|
||||
if (item) {
|
||||
mapValue.value = [String(item.floor), String(item.id)]
|
||||
handleChangeMap(mapValue.value)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (mapValue.value.length) {
|
||||
handleChangeMap(mapValue.value)
|
||||
} else {
|
||||
} else if (list.value.length > 0 && list.value[0].children && list.value[0].children.length > 0) {
|
||||
// 如果没有参数或参数无效,使用默认值
|
||||
mapValue.value = [list.value[0].value, list.value[0].children[0].value]
|
||||
indexPageRef.value.getMapData(JSON.parse(JSON.stringify(list.value[0].children[0])))
|
||||
}
|
||||
@ -83,13 +108,11 @@ const getList = async () => {
|
||||
|
||||
const handleChangeMap = async (e) => {
|
||||
let item = findItemById(e[1])
|
||||
indexPageRef.value.getMapData(item)
|
||||
router.replace({
|
||||
name: 'MapPageRealTimeMap',
|
||||
query: {
|
||||
mapId: item.id
|
||||
}
|
||||
})
|
||||
if (item) {
|
||||
indexPageRef.value.getMapData(item)
|
||||
} else {
|
||||
message.warning('未找到对应地图')
|
||||
}
|
||||
}
|
||||
|
||||
//新建任务
|
||||
@ -125,6 +148,8 @@ const emergencyStop = async () => {
|
||||
}
|
||||
|
||||
const getStopOrRestore = async () => {
|
||||
if (!mapValue.value || mapValue.value.length < 2) return
|
||||
|
||||
let res = await MapApi.getMapIsStop({
|
||||
id: mapValue.value[1]
|
||||
})
|
||||
@ -167,7 +192,6 @@ function findItemById(targetId) {
|
||||
return null
|
||||
}
|
||||
|
||||
const { query } = useRoute() // 查询参数
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
@ -196,6 +196,7 @@
|
||||
<el-option label="库位" :value="1" />
|
||||
<el-option label="线库" :value="2" />
|
||||
<el-option label="区域" :value="3" />
|
||||
<el-option label="取放货点" :value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -224,7 +225,7 @@
|
||||
<el-option
|
||||
v-for="item in detailItem.takeList"
|
||||
:key="item.id"
|
||||
:label="item.locationNo"
|
||||
:label="detailItem.takeType == 4 ? item.pointName : item.locationNo"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
@ -255,6 +256,7 @@
|
||||
<el-option label="库位" :value="1" />
|
||||
<el-option label="线库" :value="2" />
|
||||
<el-option label="区域" :value="3" />
|
||||
<el-option label="取放货点" :value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -283,7 +285,7 @@
|
||||
<el-option
|
||||
v-for="item in detailItem.releaseList"
|
||||
:key="item.id"
|
||||
:label="item.locationNo"
|
||||
:label="detailItem.releaseType == 4 ? item.pointName : item.locationNo"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
@ -440,7 +442,7 @@
|
||||
<el-option
|
||||
v-for="item in detailItem.releaseList"
|
||||
:key="item.id"
|
||||
:label="item.locationNo"
|
||||
:label="detailItem.releaseType == 4 ? item.pointName : item.locationNo"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
@ -466,6 +468,7 @@
|
||||
<el-option label="库位" :value="1" />
|
||||
<el-option label="线库" :value="2" />
|
||||
<el-option label="区域" :value="3" />
|
||||
<el-option label="取放货点" :value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -494,7 +497,7 @@
|
||||
<el-option
|
||||
v-for="item in detailItem.takeList"
|
||||
:key="item.id"
|
||||
:label="item.locationNo"
|
||||
:label="detailItem.takeType == 4 ? item.pointName : item.locationNo"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
@ -551,6 +554,7 @@
|
||||
<el-option label="库位" :value="1" />
|
||||
<el-option label="线库" :value="2" />
|
||||
<el-option label="区域" :value="3" />
|
||||
<el-option label="取放货点" :value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -579,7 +583,7 @@
|
||||
<el-option
|
||||
v-for="item in detailItem.releaseList"
|
||||
:key="item.id"
|
||||
:label="item.locationNo"
|
||||
:label="detailItem.releaseType == 4 ? item.pointName : item.locationNo"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
@ -669,117 +673,12 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<!-- 扫描码 -->
|
||||
<!-- <div v-if="detailItem.taskType === 7">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
required
|
||||
label="车辆编号"
|
||||
:prop="`taskDetailList[${index}].robotNo`"
|
||||
:rules="{ required: true, message: '车辆不能为空', trigger: 'change' }"
|
||||
>
|
||||
<el-select v-model="detailItem.robotNo" placeholder="请选择车辆">
|
||||
<el-option
|
||||
v-for="car in robotList"
|
||||
:key="car.id"
|
||||
:label="car.robotList"
|
||||
:value="car.robotNo"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
required
|
||||
label="放货位置"
|
||||
:prop="`taskDetailList[${index}].releaseId`"
|
||||
:rules="{ required: true, message: '放货位置不能为空', trigger: 'change' }"
|
||||
>
|
||||
<el-select
|
||||
:disabled="!detailItem.releaseType"
|
||||
v-model="detailItem.releaseId"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入放货位置"
|
||||
:remote-method="
|
||||
(query) => {
|
||||
releaseRemoteMethod(query, detailItem)
|
||||
}
|
||||
"
|
||||
:loading="loading"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in detailItem.releaseList"
|
||||
:key="item.id"
|
||||
:label="item.locationNo"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div> -->
|
||||
<!-- 检测托盘类型 -->
|
||||
<!-- <div v-if="detailItem.taskType === 8">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
required
|
||||
label="车辆编号"
|
||||
:prop="`taskDetailList[${index}].robotNo`"
|
||||
:rules="{ required: true, message: '车辆不能为空', trigger: 'change' }"
|
||||
>
|
||||
<el-select v-model="detailItem.robotNo" placeholder="请选择车辆">
|
||||
<el-option
|
||||
v-for="car in robotList"
|
||||
:key="car.id"
|
||||
:label="car.robotList"
|
||||
:value="car.robotNo"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
required
|
||||
label="检测位置"
|
||||
:prop="`taskDetailList[${index}].releaseId`"
|
||||
:rules="{ required: true, message: '检测位置不能为空', trigger: 'change' }"
|
||||
>
|
||||
<el-select
|
||||
:disabled="!detailItem.releaseType"
|
||||
v-model="detailItem.releaseId"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入检测位置"
|
||||
:remote-method="
|
||||
(query) => {
|
||||
releaseRemoteMethod(query, detailItem)
|
||||
}
|
||||
"
|
||||
:loading="loading"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in detailItem.releaseList"
|
||||
:key="item.id"
|
||||
:label="item.locationNo"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-form>
|
||||
|
||||
<locationSelectionDialog
|
||||
:positionMapId="null"
|
||||
ref="locationSelectionDialogRef"
|
||||
@location-selection-dialog-success="locationSelectionDialogSuccess"
|
||||
/>
|
||||
@ -790,6 +689,7 @@
|
||||
import { reactive } from 'vue'
|
||||
import { RefreshRight, Position } from '@element-plus/icons-vue'
|
||||
import * as MapTaskAPi from '@/api/map/mapTask'
|
||||
import * as DeviceApi from '@/api/device/index'
|
||||
import locationSelectionDialog from '../components/locationSelectionDialog.vue'
|
||||
|
||||
defineOptions({ name: 'TaskManagementCreateTask' })
|
||||
@ -816,7 +716,7 @@ const formData = ref({
|
||||
{
|
||||
taskType: 1, //任务类型(1:取放货、2:停车、 3:充电、4:移动、5:仅取货、6:仅放货、7:扫描码、8:检测托盘类型)
|
||||
releaseType: 1, //放货类型 1:库位、2:线库、 3:区域
|
||||
takeType: 1, //取货类型(1:库位、2:线库、 3:区域)
|
||||
takeType: 1, //取货类型(1:库位、2:线库、 3:区域 4.取放货点)
|
||||
releaseId: undefined, //放货位置的id
|
||||
releaseList: [], //放货的名称的列表
|
||||
takeId: undefined, //取货位置的id
|
||||
@ -860,7 +760,7 @@ const resetFormData = () => {
|
||||
{
|
||||
taskType: 1, //任务类型(1:取放货、2:停车、 3:充电、4:移动、5:仅取货、6:仅放货、7:扫描码、8:检测托盘类型)
|
||||
releaseType: 1, //放货类型 1:库位、2:线库、 3:区域 4:点位
|
||||
takeType: 1, //取货类型(1:库位、2:线库、 3:区域)
|
||||
takeType: 1, //取货类型(1:库位、2:线库、 3:区域 4.取放货点)
|
||||
releaseId: undefined, //放货位置的id
|
||||
releaseList: [], //放货的名称的列表
|
||||
takeId: undefined, //取货位置的id
|
||||
@ -905,10 +805,14 @@ const getTaskNo = async () => {
|
||||
|
||||
//获取取货位置可选的列表
|
||||
const getLocationList = async (type, locationNo) => {
|
||||
return await MapTaskAPi.getLocationByName({
|
||||
type, // 放货类型(1:库位、2:线库、 3:区域)
|
||||
locationNo
|
||||
})
|
||||
if (type == 4) {
|
||||
return await DeviceApi.getWareHouseTakePointList({ pointType: 1 })
|
||||
} else {
|
||||
return await MapTaskAPi.getLocationByName({
|
||||
type, // 放货类型(1:库位、2:线库、 3:区域)
|
||||
locationNo
|
||||
})
|
||||
}
|
||||
}
|
||||
//放货的选择列表
|
||||
const loading = ref(false)
|
||||
@ -1306,7 +1210,7 @@ const chooseLocation = (type, item, index) => {
|
||||
const locationSelectionDialogSuccess = (item) => {
|
||||
if (chooseLocationType.value == 'take') {
|
||||
//取货
|
||||
if (locationTypeNumber.value == 1) {
|
||||
if (locationTypeNumber.value == 1 || locationTypeNumber.value == 4) {
|
||||
// 1库位
|
||||
takeRemoteMethod(item.locationNo, formData.value.taskDetailList[currentItemIndex.value])
|
||||
formData.value.taskDetailList[currentItemIndex.value].takeId = item.id
|
||||
@ -1314,14 +1218,14 @@ const locationSelectionDialogSuccess = (item) => {
|
||||
// 2线库
|
||||
takeRemoteMethod(item.laneName, formData.value.taskDetailList[currentItemIndex.value])
|
||||
formData.value.taskDetailList[currentItemIndex.value].takeId = item.laneId
|
||||
} else {
|
||||
} else if (locationTypeNumber.value == 3) {
|
||||
// 3区域
|
||||
takeRemoteMethod(item.areaName, formData.value.taskDetailList[currentItemIndex.value])
|
||||
formData.value.taskDetailList[currentItemIndex.value].takeId = item.areaId
|
||||
}
|
||||
} else if (chooseLocationType.value == 'release') {
|
||||
//放货
|
||||
if (locationTypeNumber.value == 1) {
|
||||
if (locationTypeNumber.value == 1 || locationTypeNumber.value == 4) {
|
||||
// 1库位
|
||||
releaseRemoteMethod(item.locationNo, formData.value.taskDetailList[currentItemIndex.value])
|
||||
formData.value.taskDetailList[currentItemIndex.value].releaseId = item.id
|
||||
@ -1329,7 +1233,7 @@ const locationSelectionDialogSuccess = (item) => {
|
||||
// 2线库
|
||||
releaseRemoteMethod(item.laneName, formData.value.taskDetailList[currentItemIndex.value])
|
||||
formData.value.taskDetailList[currentItemIndex.value].releaseId = item.laneId
|
||||
} else {
|
||||
} else if (locationTypeNumber.value == 3) {
|
||||
// 3区域
|
||||
releaseRemoteMethod(item.areaName, formData.value.taskDetailList[currentItemIndex.value])
|
||||
formData.value.taskDetailList[currentItemIndex.value].releaseId = item.areaId
|
||||
|
Loading…
Reference in New Issue
Block a user