From f6033177615f25e6d13b1ea39f32893740f82a06 Mon Sep 17 00:00:00 2001 From: Ironsp <1522278303@qq.com> Date: Fri, 29 May 2026 15:02:41 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E4=B8=8B=E6=8B=89=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot --- src/store/modules/equipmentList.ts | 2 +- src/views/WarningList/list.vue | 21 +++++++++++++++++---- src/views/fileList/list.vue | 28 +++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/store/modules/equipmentList.ts b/src/store/modules/equipmentList.ts index 91c6e96..b131dcf 100644 --- a/src/store/modules/equipmentList.ts +++ b/src/store/modules/equipmentList.ts @@ -16,7 +16,7 @@ export const useDeviceStore = defineStore('devices', () => { try { const response = await getDevicetList(query); console.log('获取设备列表:', response); - deviceList.value = response.data; + deviceList.value = response.rows; } catch (error) { console.error('获取设备列表失败', error); } diff --git a/src/views/WarningList/list.vue b/src/views/WarningList/list.vue index a6e71dd..de3157c 100644 --- a/src/views/WarningList/list.vue +++ b/src/views/WarningList/list.vue @@ -7,9 +7,9 @@ - - - + + + @@ -260,8 +260,21 @@ const submitForm = async () => { } }; +//获取设备名称-搜索_设备选择 +const deviceInfo = ref([]); +const getDeviceName = async () => { + try { + await getdeviceList(); + deviceInfo.value = deviceList.value; + console.log('设备列表:', deviceInfo.value); + } catch (error) { + proxy?.$modal.msgError('获取设备列表失败'); + } + // const res = await getdeviceList(); + // deviceInfo.value = res?.rows; +}; onMounted(() => { getList(); - getdeviceList(); + getDeviceName(); }); diff --git a/src/views/fileList/list.vue b/src/views/fileList/list.vue index b023261..e167b7b 100644 --- a/src/views/fileList/list.vue +++ b/src/views/fileList/list.vue @@ -4,9 +4,9 @@
- - - + + + @@ -91,6 +91,11 @@ import { listDemo, getDemo, delDemo, addDemo, updateDemo } from '@/api/fileList/ import { download } from '@/utils/request'; import { onBeforeRouteLeave } from 'vue-router'; //import { DemoVO, DemoQuery, DemoForm } from '@/api/demo/demo/types'; +import { useDeviceStore } from '@/store/modules/equipmentList'; +import { storeToRefs } from 'pinia'; +const deviceStore = useDeviceStore(); +const { deviceList } = storeToRefs(deviceStore); +const { getdeviceList } = deviceStore; const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -272,6 +277,23 @@ onBeforeRouteLeave(() => { dialog.visible = false; monitorVideoUrl.value = ''; }); + +//获取设备名称-搜索_设备选择 +const deviceInfo = ref([]); +const getDeviceName = async () => { + try { + await getdeviceList(); + deviceInfo.value = deviceList.value; + console.log('设备列表:', deviceInfo.value); + } catch (error) { + proxy?.$modal.msgError('获取设备列表失败'); + } + // const res = await getdeviceList(); + // deviceInfo.value = res?.rows; +}; +onMounted(() => { + getDeviceName(); +});