更新接口

This commit is contained in:
ChenYi 2025-07-29 17:32:30 +08:00
parent 57d65c7e77
commit c6b8339a02
4 changed files with 60 additions and 53 deletions

View File

@ -585,7 +585,7 @@ export const CreateDataDictinaryInputSchema = {
} as const; } as const;
export const CreateDeviceAggregationInputSchema = { export const CreateDeviceAggregationInputSchema = {
required: ['deviceAddress', 'ioTPlatform', 'ioTPlatformProductId', 'platformPassword'], required: ['deviceAddress', 'ioTPlatform', 'ioTPlatformProductId'],
type: 'object', type: 'object',
properties: { properties: {
deviceAddress: { deviceAddress: {
@ -596,25 +596,10 @@ export const CreateDeviceAggregationInputSchema = {
ioTPlatform: { ioTPlatform: {
'$ref': '#/components/schemas/IoTPlatformTypeEnum' '$ref': '#/components/schemas/IoTPlatformTypeEnum'
}, },
platformPassword: {
minLength: 1,
type: 'string',
description: '电表密码'
},
ioTPlatformProductId: { ioTPlatformProductId: {
minLength: 1, minLength: 1,
type: 'string', type: 'string',
description: '集中器在物联网平台中对应的产品Id' description: '集中器在物联网平台中对应的产品Id'
},
ioTPlatformDeviceOpenInfo: {
type: 'string',
description: '集中器在物联网平台中对应的设备Id或者名称',
nullable: true
},
ioTPlatformAccountId: {
type: 'string',
description: '物联网平台中对应的账号Id',
nullable: true
} }
}, },
additionalProperties: false, additionalProperties: false,
@ -1216,6 +1201,10 @@ export const DeviceManagementInfoDtoSchema = {
type: 'string', type: 'string',
description: '物联网平台返回的响应信息', description: '物联网平台返回的响应信息',
nullable: true nullable: true
},
isPlatformPushSuccess: {
type: 'boolean',
description: '物联网平台推送是否成功'
} }
}, },
additionalProperties: false additionalProperties: false

File diff suppressed because one or more lines are too long

View File

@ -215,22 +215,10 @@ export type CreateDeviceAggregationInput = {
*/ */
deviceAddress: string; deviceAddress: string;
ioTPlatform: IoTPlatformTypeEnum; ioTPlatform: IoTPlatformTypeEnum;
/**
*
*/
platformPassword: string;
/** /**
* Id * Id
*/ */
ioTPlatformProductId: string; ioTPlatformProductId: string;
/**
* Id或者名称
*/
ioTPlatformDeviceOpenInfo?: (string) | null;
/**
* Id
*/
ioTPlatformAccountId?: (string) | null;
}; };
/** /**
@ -557,6 +545,10 @@ export type DeviceManagementInfoDto = {
* *
*/ */
ioTPlatformResponse?: (string) | null; ioTPlatformResponse?: (string) | null;
/**
*
*/
isPlatformPushSuccess?: boolean;
}; };
export type DeviceManagementInfoDtoPagedResultDto = { export type DeviceManagementInfoDtoPagedResultDto = {
@ -4522,6 +4514,16 @@ export type PostAggregationDeviceFindByIdAsyncResponse = (DeviceManagementInfoDt
export type PostAggregationDeviceFindByIdAsyncError = unknown; export type PostAggregationDeviceFindByIdAsyncError = unknown;
export type PostAggregationDeviceRepushDeviceInfoToIoTplatformData = {
query?: {
input?: IdInput;
};
};
export type PostAggregationDeviceRepushDeviceInfoToIoTplatformResponse = (DeviceManagementInfoDto);
export type PostAggregationDeviceRepushDeviceInfoToIoTplatformError = unknown;
export type PostDeviceInfoFindByDeviceAddressData = { export type PostDeviceInfoFindByDeviceAddressData = {
query?: { query?: {
deviceAddress?: string; deviceAddress?: string;

View File

@ -137,7 +137,7 @@ export const addDeviceFormSchema: any = computed(() => [
pageSize: 1000, pageSize: 1000,
}, },
}, },
labelField: 'ProductName', labelField: 'label',
valueField: 'ioTPlatformProductId', valueField: 'ioTPlatformProductId',
immediate: true, immediate: true,
afterFetch: (res: any) => { afterFetch: (res: any) => {
@ -146,26 +146,29 @@ export const addDeviceFormSchema: any = computed(() => [
const data = res.data; const data = res.data;
// 确保返回的是数组格式 // 确保返回的是数组格式
let items = [];
if (Array.isArray(data)) { if (Array.isArray(data)) {
return data; items = data;
} } else if (data && Array.isArray(data.items)) {
// 如果是包装在 items 中的,提取出来 items = data.items;
if (data && Array.isArray(data.items)) { } else if (data && Array.isArray(data.data)) {
return data.items; items = data.data;
}
// 如果是包装在 data 中的,提取出来
if (data && Array.isArray(data.data)) {
return data.data;
} }
// 为每个产品项添加组合标签
return items.map((item: any) => ({
...item,
label: `${item.productName || item.ProductName || ''} (${item.ioTPlatformProductId || ''})`,
}));
} }
// 如果都不是,返回空数组 // 如果都不是,返回空数组
return []; return [];
}, },
placeholder: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.BelongingAccountName')}`, placeholder: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.BelongingProductName')}`,
}, },
rules: z.string().min(1, { rules: z.string().min(1, {
message: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.BelongingAccountName')}`, message: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.BelongingProductName')}`,
}), }),
}, },
{ {
@ -224,7 +227,7 @@ export const editDeviceFormSchemaEdit: any = computed(() => [
pageSize: 1000, pageSize: 1000,
}, },
}, },
labelField: 'ProductName', labelField: 'label',
valueField: 'ioTPlatformProductId', valueField: 'ioTPlatformProductId',
immediate: true, immediate: true,
afterFetch: (res: any) => { afterFetch: (res: any) => {
@ -233,26 +236,29 @@ export const editDeviceFormSchemaEdit: any = computed(() => [
const data = res.data; const data = res.data;
// 确保返回的是数组格式 // 确保返回的是数组格式
let items = [];
if (Array.isArray(data)) { if (Array.isArray(data)) {
return data; items = data;
} } else if (data && Array.isArray(data.items)) {
// 如果是包装在 items 中的,提取出来 items = data.items;
if (data && Array.isArray(data.items)) { } else if (data && Array.isArray(data.data)) {
return data.items; items = data.data;
}
// 如果是包装在 data 中的,提取出来
if (data && Array.isArray(data.data)) {
return data.data;
} }
// 为每个产品项添加组合标签
return items.map((item: any) => ({
...item,
label: `${item.productName || item.ProductName || ''} (${item.ioTPlatformProductId || ''})`,
}));
} }
// 如果都不是,返回空数组 // 如果都不是,返回空数组
return []; return [];
}, },
placeholder: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.BelongingAccountName')}`, placeholder: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.BelongingProductName')}`,
}, },
rules: z.string().min(1, { rules: z.string().min(1, {
message: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.BelongingAccountName')}`, message: `${$t('common.pleaseSelect')}${$t('abp.OneNETManagement.BelongingProductName')}`,
}), }),
}, },
{ {