diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index f873f45..b5592bf 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -263,7 +263,7 @@ import { useAuthStore } from "@/stores/modules/auth"; import { useDownload } from '@/hooks/useDownload' import {downloadDevData} from '@/api/plan/plan.ts' import {documentedPqDev} from "@/api/device/device"; - +import { getPqDev } from '@/api/device/device/index.ts' const dictStore = useDictStore() const checkStore = useCheckStore() const webMsgSend = ref();//webSocket推送的数据 @@ -331,6 +331,18 @@ isTimeCheck: { } }) + +// 存储设备类型选项 +const devTypeOptions = ref<{ + id: string; + name: string , + icd:string , + power:string, + devVolt:number, + devCurr:number, + devChns:number, + }[]>([]) + //下拉框数据 interface Dict { id: string; @@ -454,8 +466,11 @@ const columns = reactive[]>([ prop: 'devType', label: '设备类型', minWidth: 100, - enum: dictStore.getDictData('Dev_Type'), - fieldNames: { label: 'name', value: 'id' }, + render: (scope) => { + // 查找设备类型名称 + const name = devTypeOptions.value.find(option => option.id === scope.row.devType); + return {name?.name} + }, }, { prop: 'devChns', @@ -952,6 +967,7 @@ const handleTest = async (val:string) => { webMsgSend.value = res } }); + channelsTest.value?.open(channelsSelection.value,props.plan); return; } @@ -1059,7 +1075,18 @@ watch( { immediate: true } // 立即执行一次 ); - +onBeforeMount(async () => { + const response = await getPqDev() + devTypeOptions.value = response.data.map(item => ({ + id: item.id, + name: item.name, + icd: item.icd, + power: item.power, + devVolt: item.devVolt, + devCurr: item.devCurr, + devChns: item.devChns + })) +}) defineExpose({ changeActiveTabs });