From bc75b20ab85a8908396a8f45f9d895d39e29b5e4 Mon Sep 17 00:00:00 2001 From: hwj Date: Thu, 28 May 2026 16:00:32 +0800 Subject: [PATCH] =?UTF-8?q?style=EF=BC=9A=E7=82=B9=E6=A3=80=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1-=E6=B7=BB=E5=8A=A0=E8=AE=BE=E5=A4=87=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/taskManagement/index.vue | 60 +++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/src/views/mes/taskManagement/index.vue b/src/views/mes/taskManagement/index.vue index b3f2246c..6974a430 100644 --- a/src/views/mes/taskManagement/index.vue +++ b/src/views/mes/taskManagement/index.vue @@ -38,6 +38,25 @@ + + + + + @@ -86,6 +105,16 @@ prop="name" min-width="200" sortable /> + + + ([]) +const deviceOptions = ref<{ id: number; label: string; raw?: DeviceLedgerVO }[]>([]) const queryParams = reactive({ pageNo: 1, pageSize: 10, name: undefined as string | undefined, taskType: undefined as number | undefined, - projectForm: [] as string[] + projectForm: [] as string[], + deviceIds: [] as number[] }) const queryFormRef = ref() @@ -263,6 +295,30 @@ const ensurePlanOptionsLoaded = async () => { planOptions.value = (planRes?.list ?? []) as PlanOption[] } +const ensureDeviceOptionsLoaded = async () => { + const deviceRes = await DeviceLedgerApi.getDeviceLedgerList() + const rows = (Array.isArray(deviceRes) ? deviceRes : deviceRes?.list ?? deviceRes?.data ?? []) as DeviceLedgerVO[] + deviceOptions.value = rows + .filter((item) => typeof item?.id === 'number') + .map((item) => ({ + id: item.id, + label: `${item.deviceCode ?? ''} ${item.deviceName ?? ''}`.trim() || String(item.id), + raw: item + })) +} + +const getDeviceNames = (value: any) => { + const ids = parseIdsValue(value) + if (!ids.length) return '-' + const names = ids + .map((id) => { + const option = deviceOptions.value.find((item) => String(item.id) === id) + return option?.raw?.deviceName ?? option?.label?.split(' ').slice(1).join(' ') ?? id + }) + .filter(Boolean) + return names.length ? names.join(',') : '-' +} + const buildQueryParams = () => { return { ...queryParams, @@ -370,6 +426,6 @@ const handleExport = async () => { } onMounted(() => { - Promise.all([ensurePlanOptionsLoaded(), getList()]) + Promise.all([ensurePlanOptionsLoaded(), ensureDeviceOptionsLoaded(), getList()]) })