From cfbe8f4df0449c9e142a7bf25573158327f5ab44 Mon Sep 17 00:00:00 2001 From: ChenYi <296215406@outlook.com> Date: Fri, 19 Dec 2025 16:54:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=89=A9=E6=A8=A1=E5=9E=8BID?= =?UTF-8?q?=E5=B0=86=E8=A7=A3=E6=9E=90=E8=84=9A=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/table-action/table-action.vue | 16 +- .../deviceThingModelManagement/index.vue | 279 ++++++++++++------ .../deviceThingModelManagement/schema.ts | 62 ++-- 3 files changed, 232 insertions(+), 125 deletions(-) diff --git a/apps/web-antd/src/components/table-action/table-action.vue b/apps/web-antd/src/components/table-action/table-action.vue index 438e6e6..4ca0590 100644 --- a/apps/web-antd/src/components/table-action/table-action.vue +++ b/apps/web-antd/src/components/table-action/table-action.vue @@ -171,11 +171,13 @@ const handleMenuClick = (e: any) => {
{{ action.text }} @@ -184,11 +186,13 @@ const handleMenuClick = (e: any) => { - - diff --git a/apps/web-antd/src/views/thingmodelinfo/deviceThingModelManagement/schema.ts b/apps/web-antd/src/views/thingmodelinfo/deviceThingModelManagement/schema.ts index 25251f7..787c1d5 100644 --- a/apps/web-antd/src/views/thingmodelinfo/deviceThingModelManagement/schema.ts +++ b/apps/web-antd/src/views/thingmodelinfo/deviceThingModelManagement/schema.ts @@ -116,7 +116,7 @@ export const tableSchema = computed(() => [ minWidth: 120, showOverflow: 'tooltip', formatter: ({ cellValue }: { cellValue: any }) => { - const map: Record = { + const map: Record = { 1: 'CTWing', 2: 'OneNET', }; @@ -152,7 +152,7 @@ export const tableSchema = computed(() => [ { field: 'action', title: $t('common.action'), - width: 360, + width: 160, fixed: 'right', slots: { default: 'action' }, }, @@ -164,18 +164,22 @@ export const addDeviceThingModelFormSchema = computed(() => [ component: 'Input', fieldName: 'deviceModelName', label: '设备端物模型名称', - rules: z - .preprocess((v) => (v == null ? '' : v), z.string().min(1, $t('common.required'))), + rules: z.preprocess( + (v) => (v == null ? '' : v), + z.string().min(1, $t('common.required')), + ), componentProps: { - placeholder: $t('common.pleaseInput') + '设备端物模型名称', + placeholder: `${$t('common.pleaseInput')}设备端物模型名称`, }, }, { component: 'ApiSelect', fieldName: 'ioTPlatform', label: $t('abp.deviceInfos.ioTPlatform'), - rules: z - .preprocess((v) => (v == null ? '' : v), z.string().min(1, $t('common.required'))), + rules: z.preprocess( + (v) => (v == null ? '' : v), + z.string().min(1, $t('common.required')), + ), componentProps: { api: getCommonGetSelectList, params: { @@ -208,8 +212,10 @@ export const addDeviceThingModelFormSchema = computed(() => [ component: 'ApiSelect', fieldName: 'ioTPlatformProductId', label: $t('common.BelongingProductName'), - rules: z - .preprocess((v) => (v == null ? '' : v), z.string().min(1, $t('common.required'))), + rules: z.preprocess( + (v) => (v == null ? '' : v), + z.string().min(1, $t('common.required')), + ), componentProps: (formValues: any) => { const platform = formValues?.ioTPlatform; @@ -254,10 +260,12 @@ export const addDeviceThingModelFormSchema = computed(() => [ component: 'Input', fieldName: 'scriptName', label: '脚本函数名称', - rules: z - .preprocess((v) => (v == null ? '' : v), z.string().min(1, $t('common.required'))), + rules: z.preprocess( + (v) => (v == null ? '' : v), + z.string().min(1, $t('common.required')), + ), componentProps: { - placeholder: $t('common.pleaseInput') + '脚本函数名称', + placeholder: `${$t('common.pleaseInput')}脚本函数名称`, }, }, { @@ -277,18 +285,22 @@ export const editDeviceThingModelFormSchema = computed(() => [ component: 'Input', fieldName: 'deviceModelName', label: '设备端物模型名称', - rules: z - .preprocess((v) => (v == null ? '' : v), z.string().min(1, $t('common.required'))), + rules: z.preprocess( + (v) => (v == null ? '' : v), + z.string().min(1, $t('common.required')), + ), componentProps: { - placeholder: $t('common.pleaseInput') + '设备端物模型名称', + placeholder: `${$t('common.pleaseInput')}设备端物模型名称`, }, }, { component: 'ApiSelect', fieldName: 'ioTPlatform', label: $t('abp.deviceInfos.ioTPlatform'), - rules: z - .preprocess((v) => (v == null ? '' : v), z.string().min(1, $t('common.required'))), + rules: z.preprocess( + (v) => (v == null ? '' : v), + z.string().min(1, $t('common.required')), + ), componentProps: { api: getCommonGetSelectList, params: { @@ -322,8 +334,10 @@ export const editDeviceThingModelFormSchema = computed(() => [ component: 'ApiSelect', fieldName: 'ioTPlatformProductId', label: $t('common.BelongingProductName'), - rules: z - .preprocess((v) => (v == null ? '' : v), z.string().min(1, $t('common.required'))), + rules: z.preprocess( + (v) => (v == null ? '' : v), + z.string().min(1, $t('common.required')), + ), componentProps: (formValues: any) => { const platform = formValues?.ioTPlatform; @@ -369,10 +383,12 @@ export const editDeviceThingModelFormSchema = computed(() => [ component: 'Input', fieldName: 'scriptName', label: '脚本函数名称', - rules: z - .preprocess((v) => (v == null ? '' : v), z.string().min(1, $t('common.required'))), + rules: z.preprocess( + (v) => (v == null ? '' : v), + z.string().min(1, $t('common.required')), + ), componentProps: { - placeholder: $t('common.pleaseInput') + '脚本函数名称', + placeholder: `${$t('common.pleaseInput')}脚本函数名称`, }, }, { @@ -385,5 +401,3 @@ export const editDeviceThingModelFormSchema = computed(() => [ }, }, ]); - -