From 292277b6350f1f12a695a47436ebfa4dc438302e Mon Sep 17 00:00:00 2001 From: ChenYi <296215406@outlook.com> Date: Sun, 4 Jan 2026 15:40:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=BE=E5=A4=87=E7=89=A9?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api-client/schemas.gen.ts | 69 +++++++++++-------- apps/web-antd/src/api-client/types.gen.ts | 64 +++++++++-------- .../web-antd/src/locales/langs/en-US/abp.json | 4 +- .../web-antd/src/locales/langs/zh-CN/abp.json | 4 +- .../ctwingmanagement/privateProduct/schema.ts | 42 +++++------ .../onenetmanagement/privateProduct/index.vue | 14 ++-- .../onenetmanagement/privateProduct/schema.ts | 22 +++--- .../DeviceThingModelPropertyModal.vue | 37 ++++++++++ .../ioTPlatformThingModelInfo/schema.ts | 14 +++- 9 files changed, 169 insertions(+), 101 deletions(-) diff --git a/apps/web-antd/src/api-client/schemas.gen.ts b/apps/web-antd/src/api-client/schemas.gen.ts index e0b2b32..00c5e20 100644 --- a/apps/web-antd/src/api-client/schemas.gen.ts +++ b/apps/web-antd/src/api-client/schemas.gen.ts @@ -993,15 +993,15 @@ export const CTWingPrivateProductInfoDtoSchema = { description: '设备数量', format: 'int32' }, - deviceThingModelFileId: { + thingModelFileId: { type: 'string', - description: '设备物模型文件Id', + description: '物模型文件Id', format: 'uuid', nullable: true }, - deviceThingModelFileName: { + thingModelFileName: { type: 'string', - description: '设备物模型文件名称', + description: '物模型文件名称', nullable: true }, isEnabled: { @@ -1049,15 +1049,15 @@ export const CTWingPrivateProductInfoInsertInputSchema = { description: '必填,产品描述', nullable: true }, - deviceThingModelFileId: { + thingModelFileId: { type: 'string', - description: '设备物模型文件Id', + description: '物模型文件Id', format: 'uuid', nullable: true }, - deviceThingModelFileName: { + thingModelFileName: { type: 'string', - description: '设备物模型文件名称', + description: '物模型文件名称', nullable: true }, tupDeviceModel: { @@ -1138,15 +1138,15 @@ export const CTWingPrivateProductInfoModifyInputSchema = { description: '必填,产品描述', nullable: true }, - deviceThingModelFileId: { + thingModelFileId: { type: 'string', - description: '设备物模型文件Id', + description: '物模型文件Id', format: 'uuid', nullable: true }, - deviceThingModelFileName: { + thingModelFileName: { type: 'string', - description: '设备物模型文件名称', + description: '物模型文件名称', nullable: true }, tupDeviceModel: { @@ -1302,15 +1302,23 @@ export const CopyAnotherProductInputSchema = { } as const; export const CopyIoTPlatformThingModelToDeviceInputSchema = { + required: ['deviceThingModelId', 'filedTypes', 'ioTPlatform', 'ioTPlatformProductId'], type: 'object', properties: { ioTPlatform: { '$ref': '#/components/schemas/IoTPlatformTypeEnum' }, + filedTypes: { + type: 'array', + items: { + type: 'string' + }, + description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst' + }, ioTPlatformProductId: { + minLength: 1, type: 'string', - description: '物联网平台中对应的产品Id', - nullable: true + description: '物联网平台中对应的产品Id' }, deviceThingModelId: { type: 'string', @@ -3715,11 +3723,11 @@ export const DeviceUpgradeSourceTypeEnumSchema = { } as const; export const DeviceUpgradeStatusTypeEnumSchema = { - enum: [1, 2, 3, 4], + enum: [1, 2, 3, 4, 5], type: 'integer', description: '设备升级状态枚举', format: 'int32', - '说明:': '未升级=1,升级中=2,升级成功=3,升级失败=4' + '说明:': '未升级=1,升级中=2,固件下载中=3,升级成功=4,升级失败=5' } as const; export const DisabledTwoFactorInputSchema = { @@ -5792,6 +5800,11 @@ export const IoTPlatformProductPropertyInfoInputSchema = { ioTPlatformType: { '$ref': '#/components/schemas/IoTPlatformTypeEnum' }, + filedType: { + type: 'string', + description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst', + nullable: true + }, ioTPlatformProductId: { minLength: 1, type: 'string', @@ -7003,15 +7016,15 @@ export const OneNETProductInfoDtoSchema = { description: '产品访问密钥', nullable: true }, - deviceThingModelFileId: { + thingModelFileId: { type: 'string', - description: '设备物模型文件Id', + description: '物模型文件Id', format: 'uuid', nullable: true }, - deviceThingModelFileName: { + thingModelFileName: { type: 'string', - description: '设备物模型文件名称', + description: '物模型文件名称', nullable: true }, isEnabled: { @@ -7253,15 +7266,15 @@ export const OneNetProductInfoInsertInputSchema = { description: 'TLS通讯服务地址', nullable: true }, - deviceThingModelFileId: { + thingModelFileId: { type: 'string', - description: '设备物模型文件Id', + description: '物模型文件Id', format: 'uuid', nullable: true }, - deviceThingModelFileName: { + thingModelFileName: { type: 'string', - description: '设备物模型文件名称', + description: '物模型文件名称', nullable: true } }, @@ -7352,15 +7365,15 @@ export const OneNetProductInfoModifyInputSchema = { description: 'TLS通讯服务地址', nullable: true }, - deviceThingModelFileId: { + thingModelFileId: { type: 'string', - description: '设备物模型文件Id', + description: '物模型文件Id', format: 'uuid', nullable: true }, - deviceThingModelFileName: { + thingModelFileName: { type: 'string', - description: '设备物模型文件名称', + description: '物模型文件名称', nullable: true } }, diff --git a/apps/web-antd/src/api-client/types.gen.ts b/apps/web-antd/src/api-client/types.gen.ts index 84da0ec..08149b9 100644 --- a/apps/web-antd/src/api-client/types.gen.ts +++ b/apps/web-antd/src/api-client/types.gen.ts @@ -284,15 +284,19 @@ export type CopyAnotherProductInput = { * 通过平台端物模型快速创建设备端物模型信息 */ export type CopyIoTPlatformThingModelToDeviceInput = { - ioTPlatform?: IoTPlatformTypeEnum; + ioTPlatform: IoTPlatformTypeEnum; + /** + * 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst + */ + filedTypes: Array<(string)>; /** * 物联网平台中对应的产品Id */ - ioTPlatformProductId?: (string) | null; + ioTPlatformProductId: string; /** * 当前设备端物模型数据Id */ - deviceThingModelId?: string; + deviceThingModelId: string; }; /** @@ -819,13 +823,13 @@ export type CTWingPrivateProductInfoDto = { */ deviceCount?: number; /** - * 设备物模型文件Id + * 物模型文件Id */ - deviceThingModelFileId?: (string) | null; + thingModelFileId?: (string) | null; /** - * 设备物模型文件名称 + * 物模型文件名称 */ - deviceThingModelFileName?: (string) | null; + thingModelFileName?: (string) | null; /** * 是否启用 */ @@ -854,13 +858,13 @@ export type CTWingPrivateProductInfoInsertInput = { */ productDesc?: (string) | null; /** - * 设备物模型文件Id + * 物模型文件Id */ - deviceThingModelFileId?: (string) | null; + thingModelFileId?: (string) | null; /** - * 设备物模型文件名称 + * 物模型文件名称 */ - deviceThingModelFileName?: (string) | null; + thingModelFileName?: (string) | null; /** * 必填,设备型号 */ @@ -922,13 +926,13 @@ export type CTWingPrivateProductInfoModifyInput = { */ productDesc?: (string) | null; /** - * 设备物模型文件Id + * 物模型文件Id */ - deviceThingModelFileId?: (string) | null; + thingModelFileId?: (string) | null; /** - * 设备物模型文件名称 + * 物模型文件名称 */ - deviceThingModelFileName?: (string) | null; + thingModelFileName?: (string) | null; /** * 必填,设备型号 */ @@ -2169,7 +2173,7 @@ export type DeviceUpgradeSourceTypeEnum = 1 | 2; /** * 设备升级状态枚举 */ -export type DeviceUpgradeStatusTypeEnum = 1 | 2 | 3 | 4; +export type DeviceUpgradeStatusTypeEnum = 1 | 2 | 3 | 4 | 5; export type DisabledTwoFactorInput = { /** @@ -2954,6 +2958,10 @@ export type IoTPlatformProductInfoOutput = { */ export type IoTPlatformProductPropertyInfoInput = { ioTPlatformType: IoTPlatformTypeEnum; + /** + * 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst + */ + filedType?: (string) | null; /** * 物联网平台中对应的产品Id */ @@ -3756,13 +3764,13 @@ export type OneNETProductInfoDto = { */ productAccesskey?: (string) | null; /** - * 设备物模型文件Id + * 物模型文件Id */ - deviceThingModelFileId?: (string) | null; + thingModelFileId?: (string) | null; /** - * 设备物模型文件名称 + * 物模型文件名称 */ - deviceThingModelFileName?: (string) | null; + thingModelFileName?: (string) | null; /** * 是否启用 */ @@ -3858,13 +3866,13 @@ export type OneNetProductInfoInsertInput = { */ communicationAddressTLS?: (string) | null; /** - * 设备物模型文件Id + * 物模型文件Id */ - deviceThingModelFileId?: (string) | null; + thingModelFileId?: (string) | null; /** - * 设备物模型文件名称 + * 物模型文件名称 */ - deviceThingModelFileName?: (string) | null; + thingModelFileName?: (string) | null; }; export type OneNetProductInfoListInput = { @@ -3934,13 +3942,13 @@ export type OneNetProductInfoModifyInput = { */ communicationAddressTLS?: (string) | null; /** - * 设备物模型文件Id + * 物模型文件Id */ - deviceThingModelFileId?: (string) | null; + thingModelFileId?: (string) | null; /** - * 设备物模型文件名称 + * 物模型文件名称 */ - deviceThingModelFileName?: (string) | null; + thingModelFileName?: (string) | null; }; /** diff --git a/apps/web-antd/src/locales/langs/en-US/abp.json b/apps/web-antd/src/locales/langs/en-US/abp.json index 8523b9d..1a46753 100644 --- a/apps/web-antd/src/locales/langs/en-US/abp.json +++ b/apps/web-antd/src/locales/langs/en-US/abp.json @@ -300,7 +300,7 @@ "IsEncrypted": "IsEncrypted", "CommunicationAddress": "Communication Address", "CommunicationAddressTLS": "TLS Communication Address", - "DeviceThingModelFileName": "DeviceThingModelFileName", + "ThingModelFileName": "ThingModelFileName", "IoTPlatformProductUpdateTime": "ProductUpdateTime", "IoTPlatformProductCreateTime": "ProductCreateTime", "CreationTime": "CreationTime", @@ -320,7 +320,7 @@ "IsEncrypted": "IsEncrypted", "CommunicationAddress": "Communication Address", "CommunicationAddressTLS": "TLS Communication Address", - "DeviceThingModelFileName": "DeviceThingModelFileName", + "ThingModelFileName": "ThingModelFileName", "IoTPlatformProductUpdateTime": "ProductUpdateTime", "IoTPlatformProductCreateTime": "ProductCreateTime", "CreationTime": "CreationTime", diff --git a/apps/web-antd/src/locales/langs/zh-CN/abp.json b/apps/web-antd/src/locales/langs/zh-CN/abp.json index c1f00dc..ed7e04e 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/abp.json +++ b/apps/web-antd/src/locales/langs/zh-CN/abp.json @@ -295,7 +295,7 @@ "IsEncrypted": "是否加密", "CommunicationAddress": "通讯地址", "CommunicationAddressTLS": "TLS通讯地址", - "DeviceThingModelFileName": "物模型文件", + "ThingModelFileName": "物模型文件", "IoTPlatformProductUpdateTime": "平台更新时间", "IoTPlatformProductCreateTime": "平台创建时间", "CreationTime": "创建时间", @@ -315,7 +315,7 @@ "IsEncrypted": "是否加密", "CommunicationAddress": "通讯地址", "CommunicationAddressTLS": "TLS通讯地址", - "DeviceThingModelFileName": "物模型文件", + "ThingModelFileName": "物模型文件", "IoTPlatformProductUpdateTime": "平台更新时间", "IoTPlatformProductCreateTime": "平台创建时间", "CreationTime": "创建时间", diff --git a/apps/web-antd/src/views/ctwingmanagement/privateProduct/schema.ts b/apps/web-antd/src/views/ctwingmanagement/privateProduct/schema.ts index cad83ff..dc97ea5 100644 --- a/apps/web-antd/src/views/ctwingmanagement/privateProduct/schema.ts +++ b/apps/web-antd/src/views/ctwingmanagement/privateProduct/schema.ts @@ -48,10 +48,10 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [ minWidth: '150', }, { - field: 'deviceThingModelFileName', - title: $t('abp.CTWingManagement.DeviceThingModelFileName'), + field: 'thingModelFileName', + title: $t('abp.CTWingManagement.ThingModelFileName'), minWidth: '150', - slots: { default: 'deviceThingModelFileName' }, + slots: { default: 'thingModelFileName' }, }, { field: 'creationTime', @@ -124,7 +124,7 @@ export const addProductFormSchema: any = computed(() => [ { component: 'ApiSelect', fieldName: 'ctWingAccountId', - label: $t('abp.CTWingManagement.BelongingAccountName'), + label: $t('abp.CTWingManagement.AccountName'), componentProps: { api: postCtWingAccountListAsync, params: { @@ -158,10 +158,10 @@ export const addProductFormSchema: any = computed(() => [ // 如果都不是,返回空数组 return []; }, - placeholder: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.BelongingAccountName')}`, + placeholder: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.AccountName')}`, }, rules: z.string().min(1, { - message: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.BelongingAccountName')}`, + message: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.AccountName')}`, }), }, { @@ -175,9 +175,9 @@ export const addProductFormSchema: any = computed(() => [ { component: 'Input', fieldName: 'productAccesskey', - label: $t('abp.CTWingManagement.ProductAccesskey'), + label: $t('abp.CTWingManagement.MasterKey'), rules: z.string().min(1, { - message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.CTWingManagement.ProductAccesskey')}`, + message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.CTWingManagement.MasterKey')}`, }), }, { @@ -198,8 +198,8 @@ export const addProductFormSchema: any = computed(() => [ }, { component: 'Input', - fieldName: 'deviceThingModelFileName', - label: $t('abp.CTWingManagement.DeviceThingModelFileName'), + fieldName: 'thingModelFileName', + label: $t('abp.CTWingManagement.ThingModelFileName'), componentProps: { placeholder: '请选择文件', readonly: true, @@ -253,12 +253,12 @@ export const addProductFormSchema: any = computed(() => [ ), }, rules: z.string().min(1, { - message: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.DeviceThingModelFileName')}`, + message: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.ThingModelFileName')}`, }), }, { component: 'Input', - fieldName: 'deviceThingModelFileId', + fieldName: 'thingModelFileId', label: '', componentProps: { type: 'hidden', @@ -270,7 +270,7 @@ export const editProductFormSchemaEdit: any = computed(() => [ { component: 'ApiSelect', fieldName: 'ctWingAccountId', - label: $t('abp.CTWingManagement.BelongingAccountName'), + label: $t('abp.CTWingManagement.AccountName'), componentProps: { api: postCtWingAccountListAsync, params: { @@ -305,10 +305,10 @@ export const editProductFormSchemaEdit: any = computed(() => [ // 如果都不是,返回空数组 return []; }, - placeholder: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.BelongingAccountName')}`, + placeholder: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.AccountName')}`, }, rules: z.string().min(1, { - message: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.BelongingAccountName')}`, + message: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.AccountName')}`, }), }, { @@ -326,13 +326,13 @@ export const editProductFormSchemaEdit: any = computed(() => [ { component: 'Input', fieldName: 'productAccesskey', - label: $t('abp.CTWingManagement.ProductAccesskey'), + label: $t('abp.CTWingManagement.MasterKey'), disabled: true, componentProps: { readonly: true, // 编辑时只读 }, rules: z.string().min(1, { - message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.CTWingManagement.ProductAccesskey')}`, + message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.CTWingManagement.MasterKey')}`, }), }, { @@ -353,8 +353,8 @@ export const editProductFormSchemaEdit: any = computed(() => [ }, { component: 'Input', - fieldName: 'deviceThingModelFileName', - label: $t('abp.CTWingManagement.DeviceThingModelFileName'), + fieldName: 'thingModelFileName', + label: $t('abp.CTWingManagement.ThingModelFileName'), componentProps: { placeholder: '请选择文件', readonly: true, @@ -408,12 +408,12 @@ export const editProductFormSchemaEdit: any = computed(() => [ ), }, rules: z.string().min(1, { - message: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.DeviceThingModelFileName')}`, + message: `${$t('common.pleaseSelect')}${$t('abp.CTWingManagement.ThingModelFileName')}`, }), }, { component: 'Input', - fieldName: 'deviceThingModelFileId', + fieldName: 'thingModelFileId', label: '', componentProps: { type: 'hidden', diff --git a/apps/web-antd/src/views/onenetmanagement/privateProduct/index.vue b/apps/web-antd/src/views/onenetmanagement/privateProduct/index.vue index 700317e..8009489 100644 --- a/apps/web-antd/src/views/onenetmanagement/privateProduct/index.vue +++ b/apps/web-antd/src/views/onenetmanagement/privateProduct/index.vue @@ -159,7 +159,7 @@ async function submit() { const formValues = await formApi.getValues(); // 提交前校验 - if (!formValues.deviceThingModelFileName) { + if (!formValues.thingModelFileName) { Message.error('请选择设备模型文件'); return; } @@ -174,7 +174,7 @@ async function submit() { if (fileInfo && fileInfo.id) { formValues.deviceThingModelFileId = fileInfo.id; // 设置文件名 - formValues.deviceThingModelFileName = + formValues.thingModelFileName = fileInfo.fileName || selectedFile.name; } else { Message.error('文件上传成功但未获取到文件ID'); @@ -276,7 +276,7 @@ async function onDownloadFile(record: any) { link.href = url; link.setAttribute( 'download', - record.deviceThingModelFileName || 'device-model-file', + record.thingModelFileName || 'device-model-file', ); document.body.append(link); link.click(); @@ -383,12 +383,12 @@ async function onThingModelUpdate(record: any) { " /> -