diff --git a/apps/web-antd/src/router/routes/modules/iot.ts b/apps/web-antd/src/router/routes/modules/iot.ts index 2bc6d32b2..ec0191863 100644 --- a/apps/web-antd/src/router/routes/modules/iot.ts +++ b/apps/web-antd/src/router/routes/modules/iot.ts @@ -37,7 +37,7 @@ const routes: RouteRecordRaw[] = [ activePath: '/iot/ota', }, component: () => - import('#/views/iot/ota/modules/firmware-detail/index.vue'), + import('#/views/iot/ota/firmware/detail/index.vue'), }, ], }, diff --git a/apps/web-antd/src/views/iot/ota/firmware/data.ts b/apps/web-antd/src/views/iot/ota/firmware/data.ts index befa885b3..e05633330 100644 --- a/apps/web-antd/src/views/iot/ota/firmware/data.ts +++ b/apps/web-antd/src/views/iot/ota/firmware/data.ts @@ -124,7 +124,9 @@ export function useGridFormSchema(): VbenFormSchema[] { } /** 列表的字段 */ -export function useGridColumns(): VxeTableGridOptions['columns'] { +export function useGridColumns( + getProductName?: (productId: number) => string | undefined, +): VxeTableGridOptions['columns'] { return [ { type: 'checkbox', width: 40 }, { @@ -147,13 +149,13 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { title: '固件描述', minWidth: 200, }, - // TODO DONE @AI:vben 用 row.productName(后端 VO 已返回);vue3 + ep 用 getProductName(productId) 本地查表;vben 更直接,且 IoTOtaFirmwareApi.Firmware.productName 已是 API 契约 - // TODO @AI:实际后端没读取哈。看看怎么对齐下 vue3 + ep + // TODO DONE @AI:后端 firmware 没返回 productName,formatter 调 getProductName resolver;resolver + productList 反应式状态由 index.vue 注入(对齐 infra/codegen 模式) { - field: 'productName', + field: 'productId', title: '所属产品', minWidth: 150, - formatter: ({ row }) => row.productName || '未知产品', + formatter: ({ cellValue }) => + getProductName?.(cellValue) || (cellValue ? '加载中...' : '-'), }, { field: 'fileUrl', diff --git a/apps/web-antd/src/views/iot/ota/firmware/detail/index.vue b/apps/web-antd/src/views/iot/ota/firmware/detail/index.vue index 0fc0b789a..937ca8c24 100644 --- a/apps/web-antd/src/views/iot/ota/firmware/detail/index.vue +++ b/apps/web-antd/src/views/iot/ota/firmware/detail/index.vue @@ -4,11 +4,13 @@ import type { IoTOtaFirmwareApi } from '#/api/iot/ota/firmware'; import { onMounted, ref } from 'vue'; import { useRoute } from 'vue-router'; +import { Page } from '@vben/common-ui'; + import { getOtaFirmware } from '#/api/iot/ota/firmware'; import { getOtaTaskRecordStatusStatistics } from '#/api/iot/ota/task/record'; import OtaTaskList from '../../task/modules/list.vue'; -import UpgradeStatistics from '../../task/modules/upgrade-statistics.vue'; +import UpgradeStatistics from '../../task/modules/statistics.vue'; import FirmwareInfo from './modules/info.vue'; const route = useRoute(); @@ -50,23 +52,23 @@ onMounted(() => { diff --git a/apps/web-antd/src/views/iot/ota/firmware/detail/modules/info.vue b/apps/web-antd/src/views/iot/ota/firmware/detail/modules/info.vue new file mode 100644 index 000000000..6d1d4a682 --- /dev/null +++ b/apps/web-antd/src/views/iot/ota/firmware/detail/modules/info.vue @@ -0,0 +1,28 @@ + + + diff --git a/apps/web-antd/src/views/iot/ota/firmware/index.vue b/apps/web-antd/src/views/iot/ota/firmware/index.vue index 6d0d6789b..400869c6a 100644 --- a/apps/web-antd/src/views/iot/ota/firmware/index.vue +++ b/apps/web-antd/src/views/iot/ota/firmware/index.vue @@ -1,7 +1,9 @@