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) {
" />
-
-
+
- {{ row.deviceThingModelFileName }}
+ {{ row.thingModelFileName }}
- {{ row.deviceThingModelFileName || '-' }}
+ {{ row.thingModelFileName || '-' }}
diff --git a/apps/web-antd/src/views/onenetmanagement/privateProduct/schema.ts b/apps/web-antd/src/views/onenetmanagement/privateProduct/schema.ts
index 05b82be..c4cf464 100644
--- a/apps/web-antd/src/views/onenetmanagement/privateProduct/schema.ts
+++ b/apps/web-antd/src/views/onenetmanagement/privateProduct/schema.ts
@@ -50,10 +50,10 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [
minWidth: '150',
},
{
- field: 'deviceThingModelFileName',
- title: $t('abp.OneNETManagement.DeviceThingModelFileName'),
+ field: 'thingModelFileName',
+ title: $t('abp.OneNETManagement.ThingModelFileName'),
minWidth: '150',
- slots: { default: 'deviceThingModelFileName' },
+ slots: { default: 'thingModelFileName' },
},
{
field: 'productCreateTime',
@@ -190,8 +190,8 @@ export const addProductFormSchema: any = computed(() => [
},
{
component: 'Input',
- fieldName: 'deviceThingModelFileName',
- label: $t('abp.OneNETManagement.DeviceThingModelFileName'),
+ fieldName: 'thingModelFileName',
+ label: $t('abp.OneNETManagement.ThingModelFileName'),
componentProps: {
placeholder: '请选择文件',
readonly: true,
@@ -245,12 +245,12 @@ export const addProductFormSchema: any = computed(() => [
),
},
rules: z.string().min(1, {
- message: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.DeviceThingModelFileName')}`,
+ message: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.ThingModelFileName')}`,
}),
},
{
component: 'Input',
- fieldName: 'deviceThingModelFileId',
+ fieldName: 'thingModelFileId',
label: '',
componentProps: {
type: 'hidden',
@@ -345,8 +345,8 @@ export const editProductFormSchemaEdit: any = computed(() => [
},
{
component: 'Input',
- fieldName: 'deviceThingModelFileName',
- label: $t('abp.OneNETManagement.DeviceThingModelFileName'),
+ fieldName: 'thingModelFileName',
+ label: $t('abp.OneNETManagement.ThingModelFileName'),
componentProps: {
placeholder: '请选择文件',
readonly: true,
@@ -400,12 +400,12 @@ export const editProductFormSchemaEdit: any = computed(() => [
),
},
rules: z.string().min(1, {
- message: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.DeviceThingModelFileName')}`,
+ message: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.ThingModelFileName')}`,
}),
},
{
component: 'Input',
- fieldName: 'deviceThingModelFileId',
+ fieldName: 'thingModelFileId',
label: '',
componentProps: {
type: 'hidden',
diff --git a/apps/web-antd/src/views/thingmodelinfo/deviceThingModelManagement/DeviceThingModelPropertyModal.vue b/apps/web-antd/src/views/thingmodelinfo/deviceThingModelManagement/DeviceThingModelPropertyModal.vue
index 027dfb3..26e827d 100644
--- a/apps/web-antd/src/views/thingmodelinfo/deviceThingModelManagement/DeviceThingModelPropertyModal.vue
+++ b/apps/web-antd/src/views/thingmodelinfo/deviceThingModelManagement/DeviceThingModelPropertyModal.vue
@@ -688,6 +688,37 @@ const [CopyPropertyForm, copyPropertyFormApi] = useVbenForm({
};
},
},
+ {
+ component: 'ApiSelect',
+ fieldName: 'filedTypes',
+ label: '平台物模型类型',
+ rules: z.preprocess(
+ (v) => (v == null ? [] : v),
+ z.array(z.string()).min(1, '请至少选择一个物模型类型'),
+ ),
+ componentProps: {
+ api: getCommonGetSelectList,
+ params: {
+ query: {
+ typeName: 'DataDictionaryTypeConst',
+ },
+ },
+ labelField: 'value',
+ valueField: 'key',
+ optionsPropName: 'options',
+ immediate: true,
+ allowClear: true,
+ mode: 'multiple',
+ placeholder: '请选择要复制的物模型类型(可多选)',
+ maxTagCount: 'responsive',
+ afterFetch: (res: any) => {
+ if (Array.isArray(res)) return res;
+ if (res && Array.isArray(res.items)) return res.items;
+ if (res && Array.isArray(res.data)) return res.data;
+ return [];
+ },
+ },
+ },
],
showCollapseButton: false,
showDefaultActions: false,
@@ -919,6 +950,11 @@ async function submitCopyProperty() {
return;
}
+ if (!formValues.filedTypes || formValues.filedTypes.length === 0) {
+ Message.warning('请至少选择一个物模型类型');
+ return;
+ }
+
try {
const resp =
await postDeviceThingModelManagementCopyIoTplatformThingModelToDeviceAsync(
@@ -929,6 +965,7 @@ async function submitCopyProperty() {
| 2,
ioTPlatformProductId: String(formValues.ioTPlatformProductId),
deviceThingModelId: deviceThingModelId.value,
+ filedTypes: formValues.filedTypes || [],
},
},
);
diff --git a/apps/web-antd/src/views/thingmodelinfo/ioTPlatformThingModelInfo/schema.ts b/apps/web-antd/src/views/thingmodelinfo/ioTPlatformThingModelInfo/schema.ts
index db00c58..255b82a 100644
--- a/apps/web-antd/src/views/thingmodelinfo/ioTPlatformThingModelInfo/schema.ts
+++ b/apps/web-antd/src/views/thingmodelinfo/ioTPlatformThingModelInfo/schema.ts
@@ -307,11 +307,12 @@ export const getAddThingModelFormSchema = (
z.string().min(1, $t('common.required')),
),
dependencies: {
- triggerFields: ['_ioTPlatform', '_ioTPlatformProductId'],
+ triggerFields: ['_ioTPlatform', '_ioTPlatformProductId', 'filedType'],
componentProps: (formValues: any) => {
// 优先从表单值获取(这是最可靠的方式,因为值是在打开弹窗时设置的)
let platform = formValues?._ioTPlatform;
let productId = formValues?._ioTPlatformProductId;
+ let filedType = formValues?.filedType;
// 如果表单值中没有,尝试从其他字段获取
if (!platform && formValues?.ioTPlatform) {
@@ -350,12 +351,14 @@ export const getAddThingModelFormSchema = (
console.log('平台物模型编码下拉框配置:', {
platform,
productId,
+ filedType,
hasApi: !!(platform && productId),
fromForm: {
_ioTPlatform: formValues?._ioTPlatform,
_ioTPlatformProductId: formValues?._ioTPlatformProductId,
ioTPlatform: formValues?.ioTPlatform,
ioTPlatformProductId: formValues?.ioTPlatformProductId,
+ filedType: formValues?.filedType,
},
});
@@ -373,6 +376,7 @@ export const getAddThingModelFormSchema = (
? Number.parseInt(platform)
: platform,
ioTPlatformProductId: String(productId),
+ ...(filedType ? { filedType: String(filedType) } : {}),
},
}
: {},
@@ -381,6 +385,7 @@ export const getAddThingModelFormSchema = (
optionsPropName: 'options',
immediate: !!(platform && productId), // 当有平台和产品ID时立即加载
allowClear: true,
+ showSearch: true,
placeholder:
$t('common.pleaseSelect') +
$t('abp.thingModelInfos.IoTPlatformRawFieldName'),
@@ -614,11 +619,12 @@ export const getEditThingModelFormSchema = (
z.string().min(1, $t('common.required')),
),
dependencies: {
- triggerFields: ['_ioTPlatform', '_ioTPlatformProductId'],
+ triggerFields: ['_ioTPlatform', '_ioTPlatformProductId', 'filedType'],
componentProps: (formValues: any) => {
// 优先从表单值获取(这是最可靠的方式,因为值是在打开弹窗时设置的)
let platform = formValues?._ioTPlatform;
let productId = formValues?._ioTPlatformProductId;
+ let filedType = formValues?.filedType;
// 如果表单值中没有,尝试从其他字段获取
if (!platform && formValues?.ioTPlatform) {
@@ -657,12 +663,14 @@ export const getEditThingModelFormSchema = (
console.log('平台物模型编码下拉框配置:', {
platform,
productId,
+ filedType,
hasApi: !!(platform && productId),
fromForm: {
_ioTPlatform: formValues?._ioTPlatform,
_ioTPlatformProductId: formValues?._ioTPlatformProductId,
ioTPlatform: formValues?.ioTPlatform,
ioTPlatformProductId: formValues?.ioTPlatformProductId,
+ filedType: formValues?.filedType,
},
});
@@ -680,6 +688,7 @@ export const getEditThingModelFormSchema = (
? Number.parseInt(platform)
: platform,
ioTPlatformProductId: String(productId),
+ ...(filedType ? { filedType: String(filedType) } : {}),
},
}
: {},
@@ -688,6 +697,7 @@ export const getEditThingModelFormSchema = (
optionsPropName: 'options',
immediate: !!(platform && productId), // 当有平台和产品ID时立即加载
allowClear: true,
+ showSearch: true,
placeholder:
$t('common.pleaseSelect') +
$t('abp.thingModelInfos.IoTPlatformRawFieldName'),