From 3782f73215a506ec10c02ba1cb442206efb15891 Mon Sep 17 00:00:00 2001 From: fengerli <528575642@qq.com> Date: Mon, 1 Sep 2025 17:02:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 2 +- src/api/controlCenter/controlPanel/types.ts | 7 +-- .../controlPanel/components/map.vue | 5 +- src/views/equipmentAlarmRecord/index.vue | 38 +++++++-------- .../equipmentManagement/deviceType/index.vue | 46 +++++++++++++------ 6 files changed, 59 insertions(+), 41 deletions(-) diff --git a/.env.development b/.env.development index f3bdb65..c3a3bd4 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VITE_APP_TITLE = 云平台管理系统 VITE_APP_ENV = 'development' # 开发环境 -VITE_APP_BASE_API = 'http://192.168.2.34:8000' +VITE_APP_BASE_API = 'http://47.120.79.150/backend' # 应用访问路径 例如使用前缀 /admin/ VITE_APP_CONTEXT_PATH = '/' diff --git a/.env.production b/.env.production index cb8d349..97df1b8 100644 --- a/.env.production +++ b/.env.production @@ -11,7 +11,7 @@ VITE_APP_ENV = 'https://fuyuanshen.com/backend' VITE_APP_CONTEXT_PATH = '/jingquan/' # 应用访问路径 富源晟2 -#VITE_APP_CONTEXT_PATH = '/sys/' +#VITE_APP_CONTEXT_PATH = '/sys/' # 监控地址 VITE_APP_MONITOR_ADMIN = '/admin/applications' diff --git a/src/api/controlCenter/controlPanel/types.ts b/src/api/controlCenter/controlPanel/types.ts index 570f261..bf11a91 100644 --- a/src/api/controlCenter/controlPanel/types.ts +++ b/src/api/controlCenter/controlPanel/types.ts @@ -14,12 +14,13 @@ export interface deviceQuery { } export interface deviceVO { - id: number; // 设备ID - deviceName: string; // 设备名称(对应子组件的device.name) + id: string; // 设备ID + deviceName?: string | Number; // 设备名称(对应子组件的device.name) typeName: string; // 设备类型/型号(对应子组件的device.model) onlineStatus: 0 | 1; // 设备状态(0=失效/离线,1=正常/在线,对应子组件的device.status) lng?: number; // 经度(地图打点用) - lat?: number; // 纬度(地图打点用) + lat?: number; // 纬度(地图打点用 + // 其他字段... } // 1. 定义设备详情的类型(根据接口返回字段调整!关键:和后端返回的字段名一致) diff --git a/src/views/controlCenter/controlPanel/components/map.vue b/src/views/controlCenter/controlPanel/components/map.vue index 3d1ba57..317c849 100644 --- a/src/views/controlCenter/controlPanel/components/map.vue +++ b/src/views/controlCenter/controlPanel/components/map.vue @@ -39,9 +39,10 @@ diff --git a/src/views/equipmentManagement/deviceType/index.vue b/src/views/equipmentManagement/deviceType/index.vue index ee12015..eb8e5ad 100644 --- a/src/views/equipmentManagement/deviceType/index.vue +++ b/src/views/equipmentManagement/deviceType/index.vue @@ -98,15 +98,15 @@ - - - + + - - - + + @@ -169,6 +169,8 @@ interface deviceTypeVO { isSupportBle: boolean; locateMode: number; modelDictionary: string; + appModelDictionary: string; + pcModelDictionary: string; communicationMode: number; createTime: string; createByName: string; @@ -197,7 +199,9 @@ const initFormData: DeviceTypeForm = { typeName: '', isSupportBle: false, locateMode: 0, - modelDictionary: '', + // modelDictionary: '', + appModelDictionary: '', + pcModelDictionary: '', communicationMode: 0, id: '', createTime: '', @@ -215,7 +219,7 @@ const initData = { typeName: [ { required: true, message: '请输入设备类型名称', trigger: 'blur' }, ], - modelDictionary: [ + appModelDictionary: [ { required: true, message: '请选择类型code', trigger: 'blur' }, ], locateMode: [ @@ -262,6 +266,22 @@ const resetQuery = () => { queryParams.value.pageNum = 1; getList(); }; +// PC路由变化时,同步对应APP路由 +const handlePcRouteChange = (pcDictValue: string) => { + const selectedPcItem = appmodelDictionaryOptions.value.find( + item => item.dictValue === pcDictValue + ); + if (!selectedPcItem) return; + const matchedAppItem = pcmodelDictionaryOptions.value.find( + item => item.dictLabel === selectedPcItem.dictLabel + ); + if (matchedAppItem) { + form.value.pcModelDictionary = matchedAppItem.dictValue; + } else { + form.value.pcModelDictionary = ''; + console.warn(`没有找到dictLabel为${selectedPcItem.dictLabel}的APP路由`); + } +}; /** 删除按钮操作 */ const handleDelete = async (row?: deviceTypeVO) => { @@ -313,7 +333,8 @@ const handleUpdate = async (row?: DeviceTypeForm) => { const deviceData = row || ids.value[0]; Object.assign(form.value, deviceData); // 确保数据类型正确 - form.value.modelDictionary = String(form.value.modelDictionary || ''); + form.value.appModelDictionary = String(form.value.appModelDictionary || ''); + form.value.pcModelDictionary = String(form.value.pcModelDictionary || ''); form.value.locateMode = Number(form.value.locateMode) || 0; form.value.communicationMode = Number(form.value.communicationMode) || 0; } catch (error) { @@ -329,9 +350,9 @@ const submitForm = () => { try { const payload = { ...form.value, - appModelDictionary: form.value.modelDictionary, - pcModelDictionary:form.value.modelDictionary, - + appModelDictionary: form.value.appModelDictionary, + pcModelDictionary: form.value.pcModelDictionary, + locateMode: Number(form.value.locateMode), communicationMode: Number(form.value.communicationMode) }; @@ -368,5 +389,4 @@ onMounted(() => { getDict(); pcgetDict() //pc跳转 }); -