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(); +});