From 4c19068eb4f7cc3fe40fbe9f80ce9d961d9d0081 Mon Sep 17 00:00:00 2001 From: xhf <1424913779@qq.com> Date: Mon, 24 Mar 2025 15:49:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.local | 4 ++-- src/api/device/index.ts | 6 +++++- src/views/board/device/createEditDialog.vue | 21 ++++++++++++++++++--- src/views/mapPage/logList/index.vue | 11 ++++++++++- 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/.env.local b/.env.local index 846499c4..b62d369a 100644 --- a/.env.local +++ b/.env.local @@ -4,9 +4,9 @@ NODE_ENV=development VITE_DEV=true # 请求路径 -# VITE_BASE_URL='http://192.168.0.74:48080' +VITE_BASE_URL='http://192.168.0.74:48080' # VITE_BASE_URL='http://192.168.0.226:48080' -VITE_BASE_URL='http://192.168.0.45:48080' +# VITE_BASE_URL='http://192.168.0.45:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务 VITE_UPLOAD_TYPE=server diff --git a/src/api/device/index.ts b/src/api/device/index.ts index b8afebec..372ed225 100644 --- a/src/api/device/index.ts +++ b/src/api/device/index.ts @@ -36,4 +36,8 @@ export const deviceNumber = async (params) => { // 获取设备列表 新不分页 export const deviceGetInformationList = async (params) => { return await request.get({ url: `/system/device/information/getInformationList`, params }) -} \ No newline at end of file +} +// 获取设备列表 +export const getMapDeviceImageUrl = async (params) => { + return await request.get({ url: `/system/device/information/getMapImageUrl`, params }) +} diff --git a/src/views/board/device/createEditDialog.vue b/src/views/board/device/createEditDialog.vue index b61c2f58..bb75c797 100644 --- a/src/views/board/device/createEditDialog.vue +++ b/src/views/board/device/createEditDialog.vue @@ -2,7 +2,7 @@ - + { 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 + }) + } console.log(data) } else { title.value = '新建' @@ -153,7 +160,15 @@ const submitForm = async () => { formLoading.value = false } } - +// 设备类型切换 +const deviceTypeChange = (e) => { + DeviceApi.getMapDeviceImageUrl({ + deviceType: e + }).then(res=>{ + // console.log(res) + formData.value.mapImageUrl = res?res:undefined + }) +} //前往任务管理页面 const { push } = useRouter() const taskManagement = () => { diff --git a/src/views/mapPage/logList/index.vue b/src/views/mapPage/logList/index.vue index ce051036..1377906e 100644 --- a/src/views/mapPage/logList/index.vue +++ b/src/views/mapPage/logList/index.vue @@ -86,13 +86,22 @@ - --> +