物模型文件
This commit is contained in:
parent
6bcf006709
commit
ca55e50c9c
@ -36,9 +36,9 @@ VITE_REFRESH_ROLE = true
|
||||
|
||||
# 后端接口地址
|
||||
#VITE_APP_API_ADDRESS=http://47.110.53.196:28080
|
||||
VITE_APP_API_ADDRESS=http://10.10.90.3:10500
|
||||
VITE_APP_API_ADDRESS=http://10.10.90.12:10500
|
||||
|
||||
# websocket地址
|
||||
VITE_WEBSOCKET_URL=http://10.10.90.3:10500/signalr/notification
|
||||
VITE_WEBSOCKET_URL=http://10.10.90.12:10500/signalr/notification
|
||||
|
||||
|
||||
|
||||
@ -1488,50 +1488,6 @@ export const CreateTextTemplateInputSchema = {
|
||||
description: '创建模板'
|
||||
} as const;
|
||||
|
||||
export const CreateThingModelInputSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
ioTPlatform: {
|
||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
||||
},
|
||||
ioTPlatformProductId: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品Id',
|
||||
nullable: true
|
||||
},
|
||||
filedType: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatformRawFieldName: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldName: {
|
||||
type: 'string',
|
||||
description: '管理后台产品标准的物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldValueType: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段值类型',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldDisplayName: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段显示名称',
|
||||
nullable: true
|
||||
},
|
||||
isValueNeedConvert: {
|
||||
type: 'boolean',
|
||||
description: '是否需要值类型转换'
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const CurrentCultureDtoSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
@ -2063,6 +2019,20 @@ export const DeviceManagementInfoDtoSchema = {
|
||||
description: '设备来源类型',
|
||||
nullable: true,
|
||||
readOnly: true
|
||||
},
|
||||
deviceType: {
|
||||
'$ref': '#/components/schemas/DeviceTypeEnum'
|
||||
},
|
||||
deviceTypeName: {
|
||||
type: 'string',
|
||||
description: '设备类型,与业务系统无关',
|
||||
nullable: true,
|
||||
readOnly: true
|
||||
},
|
||||
deviceThingModelDataId: {
|
||||
type: 'string',
|
||||
description: '设备物模型数据Id',
|
||||
format: 'uuid'
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
@ -2131,7 +2101,8 @@ export const DeviceTableModelDataInfoPageInputSchema = {
|
||||
},
|
||||
ioTDataType: {
|
||||
type: 'string',
|
||||
description: '数据类型',
|
||||
description: `数据类型,用于构建存储路径
|
||||
JiShe.ServicePro.Consts.IoTDBDataTypeConst`,
|
||||
nullable: true
|
||||
},
|
||||
deviceType: {
|
||||
@ -2139,7 +2110,7 @@ export const DeviceTableModelDataInfoPageInputSchema = {
|
||||
},
|
||||
deviceAddress: {
|
||||
type: 'string',
|
||||
description: '设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等',
|
||||
description: '通信设备地址、用于构建存储路径',
|
||||
nullable: true
|
||||
},
|
||||
startCreationTime: {
|
||||
@ -2178,12 +2149,18 @@ export const DeviceTableModelDataInfoPageOutputSchema = {
|
||||
},
|
||||
deviceType: {
|
||||
type: 'string',
|
||||
description: '设备类型集中器、电表、水表、流量计、传感器等',
|
||||
description: `设备类型
|
||||
JiShe.ServicePro.Enums.DeviceTypeEnum`,
|
||||
nullable: true
|
||||
},
|
||||
deviceId: {
|
||||
deviceAddress: {
|
||||
type: 'string',
|
||||
description: '设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等',
|
||||
description: '通信设备地址、用于构建存储路径',
|
||||
nullable: true
|
||||
},
|
||||
subDevice: {
|
||||
type: 'string',
|
||||
description: '子设备',
|
||||
nullable: true
|
||||
},
|
||||
timestamps: {
|
||||
@ -2233,139 +2210,6 @@ export const DeviceTelemetryCommandTypeEnumSchema = {
|
||||
'说明:': '阀控=1,抄读=2'
|
||||
} as const;
|
||||
|
||||
export const DeviceThingModelInfoDtoSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {
|
||||
type: 'string',
|
||||
format: 'uuid'
|
||||
},
|
||||
creationTime: {
|
||||
type: 'string',
|
||||
format: 'date-time'
|
||||
},
|
||||
creatorId: {
|
||||
type: 'string',
|
||||
format: 'uuid',
|
||||
nullable: true
|
||||
},
|
||||
lastModificationTime: {
|
||||
type: 'string',
|
||||
format: 'date-time',
|
||||
nullable: true
|
||||
},
|
||||
lastModifierId: {
|
||||
type: 'string',
|
||||
format: 'uuid',
|
||||
nullable: true
|
||||
},
|
||||
isDeleted: {
|
||||
type: 'boolean'
|
||||
},
|
||||
deleterId: {
|
||||
type: 'string',
|
||||
format: 'uuid',
|
||||
nullable: true
|
||||
},
|
||||
deletionTime: {
|
||||
type: 'string',
|
||||
format: 'date-time',
|
||||
nullable: true
|
||||
},
|
||||
tenantId: {
|
||||
type: 'string',
|
||||
description: '租户Id',
|
||||
format: 'uuid',
|
||||
nullable: true
|
||||
},
|
||||
remark: {
|
||||
type: 'string',
|
||||
description: '备注',
|
||||
nullable: true
|
||||
},
|
||||
osaCreatorId: {
|
||||
type: 'integer',
|
||||
description: '旧系统授权创建者Id',
|
||||
format: 'int32',
|
||||
nullable: true
|
||||
},
|
||||
osaLastModifierId: {
|
||||
type: 'integer',
|
||||
description: '旧系统授权最后修改者Id',
|
||||
format: 'int32',
|
||||
nullable: true
|
||||
},
|
||||
osaDeleterId: {
|
||||
type: 'integer',
|
||||
description: '旧系统授权最后删除者Id',
|
||||
format: 'int32',
|
||||
nullable: true
|
||||
},
|
||||
extraProperties: {
|
||||
type: 'object',
|
||||
additionalProperties: {},
|
||||
description: '扩展属性,用于存储自定义字段,JSON格式',
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatform: {
|
||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
||||
},
|
||||
ioTPlatformProductId: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品Id',
|
||||
nullable: true
|
||||
},
|
||||
filedType: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatformRawFieldName: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldName: {
|
||||
type: 'string',
|
||||
description: '管理后台产品标准的物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldValueType: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段值类型',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldDisplayName: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段显示名称',
|
||||
nullable: true
|
||||
},
|
||||
isValueNeedConvert: {
|
||||
type: 'boolean',
|
||||
description: '是否需要值类型转换'
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const DeviceThingModelInfoDtoPagedResultDtoSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
items: {
|
||||
type: 'array',
|
||||
items: {
|
||||
'$ref': '#/components/schemas/DeviceThingModelInfoDto'
|
||||
},
|
||||
nullable: true
|
||||
},
|
||||
totalCount: {
|
||||
type: 'integer',
|
||||
format: 'int64'
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const DeviceTreeModelDataInfoInputSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
@ -2395,7 +2239,8 @@ export const DeviceTreeModelDataInfoInputSchema = {
|
||||
},
|
||||
ioTDataType: {
|
||||
type: 'string',
|
||||
description: '数据类型',
|
||||
description: `数据类型,用于构建存储路径
|
||||
JiShe.ServicePro.Consts.IoTDBDataTypeConst`,
|
||||
nullable: true
|
||||
},
|
||||
deviceType: {
|
||||
@ -2403,7 +2248,7 @@ export const DeviceTreeModelDataInfoInputSchema = {
|
||||
},
|
||||
deviceAddress: {
|
||||
type: 'string',
|
||||
description: '设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等',
|
||||
description: '通信设备地址、用于构建存储路径',
|
||||
nullable: true
|
||||
},
|
||||
startCreationTime: {
|
||||
@ -2428,12 +2273,11 @@ export const DeviceTreeModelDataInfoInputSchema = {
|
||||
} as const;
|
||||
|
||||
export const DeviceTypeEnumSchema = {
|
||||
enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
|
||||
enum: [0, 1, 2, 3],
|
||||
type: 'integer',
|
||||
description: `表计类型
|
||||
电表= 1,水表= 2,燃气表= 3,热能表= 4,水表流量计=5,燃气表流量计=6`,
|
||||
description: '设备类型,与业务系统无关',
|
||||
format: 'int32',
|
||||
'说明:': '电表=1,水表=2,燃气表=3,热能表=4,水表流量计=5,燃气表流量计=6,特殊电表=7,传感器=8,采集器=9,集中器=10,电机保护器=11'
|
||||
'说明:': '未知=0,网关设备=1,直连设备=2,子设备=3'
|
||||
} as const;
|
||||
|
||||
export const DisabledTwoFactorInputSchema = {
|
||||
@ -4406,6 +4250,285 @@ export const IoTDBDynamicObjectPagedResultDtoSchema = {
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const IoTPlatformThingModelCreateInputSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
ioTPlatform: {
|
||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
||||
},
|
||||
ioTPlatformProductId: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品Id',
|
||||
nullable: true
|
||||
},
|
||||
filedType: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatformRawFieldName: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldName: {
|
||||
type: 'string',
|
||||
description: '管理后台产品标准的物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldValueType: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段值类型',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldDisplayName: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段显示名称',
|
||||
nullable: true
|
||||
},
|
||||
isValueNeedConvert: {
|
||||
type: 'boolean',
|
||||
description: '是否需要值类型转换'
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const IoTPlatformThingModelInfoDtoSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {
|
||||
type: 'string',
|
||||
format: 'uuid'
|
||||
},
|
||||
creationTime: {
|
||||
type: 'string',
|
||||
format: 'date-time'
|
||||
},
|
||||
creatorId: {
|
||||
type: 'string',
|
||||
format: 'uuid',
|
||||
nullable: true
|
||||
},
|
||||
lastModificationTime: {
|
||||
type: 'string',
|
||||
format: 'date-time',
|
||||
nullable: true
|
||||
},
|
||||
lastModifierId: {
|
||||
type: 'string',
|
||||
format: 'uuid',
|
||||
nullable: true
|
||||
},
|
||||
isDeleted: {
|
||||
type: 'boolean'
|
||||
},
|
||||
deleterId: {
|
||||
type: 'string',
|
||||
format: 'uuid',
|
||||
nullable: true
|
||||
},
|
||||
deletionTime: {
|
||||
type: 'string',
|
||||
format: 'date-time',
|
||||
nullable: true
|
||||
},
|
||||
tenantId: {
|
||||
type: 'string',
|
||||
description: '租户Id',
|
||||
format: 'uuid',
|
||||
nullable: true
|
||||
},
|
||||
remark: {
|
||||
type: 'string',
|
||||
description: '备注',
|
||||
nullable: true
|
||||
},
|
||||
osaCreatorId: {
|
||||
type: 'integer',
|
||||
description: '旧系统授权创建者Id',
|
||||
format: 'int32',
|
||||
nullable: true
|
||||
},
|
||||
osaLastModifierId: {
|
||||
type: 'integer',
|
||||
description: '旧系统授权最后修改者Id',
|
||||
format: 'int32',
|
||||
nullable: true
|
||||
},
|
||||
osaDeleterId: {
|
||||
type: 'integer',
|
||||
description: '旧系统授权最后删除者Id',
|
||||
format: 'int32',
|
||||
nullable: true
|
||||
},
|
||||
extraProperties: {
|
||||
type: 'object',
|
||||
additionalProperties: {},
|
||||
description: '扩展属性,用于存储自定义字段,JSON格式',
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatform: {
|
||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
||||
},
|
||||
ioTPlatformProductId: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品Id',
|
||||
nullable: true
|
||||
},
|
||||
filedType: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatformRawFieldName: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldName: {
|
||||
type: 'string',
|
||||
description: '管理后台产品标准的物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldValueType: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段值类型',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldDisplayName: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段显示名称',
|
||||
nullable: true
|
||||
},
|
||||
isValueNeedConvert: {
|
||||
type: 'boolean',
|
||||
description: '是否需要值类型转换'
|
||||
},
|
||||
isSpecialIdentifier: {
|
||||
type: 'boolean',
|
||||
description: '是否是特殊物模型标识符'
|
||||
}
|
||||
},
|
||||
additionalProperties: false,
|
||||
description: '平台端物模型信息'
|
||||
} as const;
|
||||
|
||||
export const IoTPlatformThingModelInfoDtoPagedResultDtoSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
items: {
|
||||
type: 'array',
|
||||
items: {
|
||||
'$ref': '#/components/schemas/IoTPlatformThingModelInfoDto'
|
||||
},
|
||||
nullable: true
|
||||
},
|
||||
totalCount: {
|
||||
type: 'integer',
|
||||
format: 'int64'
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const IoTPlatformThingModelPageInputSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
pageIndex: {
|
||||
type: 'integer',
|
||||
description: '当前页面.默认从1开始',
|
||||
format: 'int32'
|
||||
},
|
||||
pageSize: {
|
||||
type: 'integer',
|
||||
description: '每页多少条.每页显示多少记录',
|
||||
format: 'int32'
|
||||
},
|
||||
skipCount: {
|
||||
type: 'integer',
|
||||
description: '跳过多少条',
|
||||
format: 'int32',
|
||||
readOnly: true
|
||||
},
|
||||
sorting: {
|
||||
type: 'string',
|
||||
description: `排序
|
||||
<example>
|
||||
name desc
|
||||
</example>`,
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatform: {
|
||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
||||
},
|
||||
searchKeyWords: {
|
||||
type: 'string',
|
||||
description: '搜索关键字',
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatformProductId: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品Id',
|
||||
nullable: true
|
||||
},
|
||||
filedType: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||
nullable: true
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const IoTPlatformThingModelUpdateInputSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
ioTPlatform: {
|
||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
||||
},
|
||||
ioTPlatformProductId: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品Id',
|
||||
nullable: true
|
||||
},
|
||||
filedType: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatformRawFieldName: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldName: {
|
||||
type: 'string',
|
||||
description: '管理后台产品标准的物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldValueType: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段值类型',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldDisplayName: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段显示名称',
|
||||
nullable: true
|
||||
},
|
||||
isValueNeedConvert: {
|
||||
type: 'boolean',
|
||||
description: '是否需要值类型转换'
|
||||
},
|
||||
id: {
|
||||
type: 'string',
|
||||
format: 'uuid'
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const IoTPlatformTypeEnumSchema = {
|
||||
enum: [1, 2],
|
||||
type: 'integer',
|
||||
@ -4621,7 +4744,8 @@ export const MeterReadingPacketInfoPageInputSchema = {
|
||||
},
|
||||
ioTDataType: {
|
||||
type: 'string',
|
||||
description: '数据类型',
|
||||
description: `数据类型,用于构建存储路径
|
||||
JiShe.ServicePro.Consts.IoTDBDataTypeConst`,
|
||||
nullable: true
|
||||
},
|
||||
deviceType: {
|
||||
@ -4629,7 +4753,7 @@ export const MeterReadingPacketInfoPageInputSchema = {
|
||||
},
|
||||
deviceAddress: {
|
||||
type: 'string',
|
||||
description: '设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等',
|
||||
description: '通信设备地址、用于构建存储路径',
|
||||
nullable: true
|
||||
},
|
||||
startCreationTime: {
|
||||
@ -4674,13 +4798,18 @@ export const MeterReadingPacketInfoPageOutputSchema = {
|
||||
},
|
||||
deviceType: {
|
||||
type: 'string',
|
||||
description: `设备类型集中器、电表、水表、流量计、传感器等,用于构建存储路径
|
||||
description: `设备类型,用于构建存储路径
|
||||
JiShe.ServicePro.Enums.DeviceTypeEnum`,
|
||||
nullable: true
|
||||
},
|
||||
deviceAddress: {
|
||||
type: 'string',
|
||||
description: '设备地址,数据生成者,例如集中器地址,电表地址、水表地址、流量计地址、传感器地址等',
|
||||
description: '通信设备地址、用于构建存储路径',
|
||||
nullable: true
|
||||
},
|
||||
subDevice: {
|
||||
type: 'string',
|
||||
description: '子设备',
|
||||
nullable: true
|
||||
},
|
||||
timestamps: {
|
||||
@ -5334,6 +5463,11 @@ export const OneNETProductInfoDtoSchema = {
|
||||
type: 'string',
|
||||
description: 'TLS通讯服务地址',
|
||||
nullable: true
|
||||
},
|
||||
thingModelInfos: {
|
||||
type: 'string',
|
||||
description: '物模型信息',
|
||||
nullable: true
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
@ -6442,60 +6576,6 @@ export const PageTextTemplateOutputPagedResultDtoSchema = {
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const PageThingModelInputSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
pageIndex: {
|
||||
type: 'integer',
|
||||
description: '当前页面.默认从1开始',
|
||||
format: 'int32'
|
||||
},
|
||||
pageSize: {
|
||||
type: 'integer',
|
||||
description: '每页多少条.每页显示多少记录',
|
||||
format: 'int32'
|
||||
},
|
||||
skipCount: {
|
||||
type: 'integer',
|
||||
description: '跳过多少条',
|
||||
format: 'int32',
|
||||
readOnly: true
|
||||
},
|
||||
sorting: {
|
||||
type: 'string',
|
||||
description: `排序
|
||||
<example>
|
||||
name desc
|
||||
</example>`,
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatform: {
|
||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
||||
},
|
||||
searchKeyword: {
|
||||
type: 'string',
|
||||
description: '搜索关键字',
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatformProductId: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品Id',
|
||||
nullable: true
|
||||
},
|
||||
filedType: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||
nullable: true
|
||||
},
|
||||
searchKeyWords: {
|
||||
type: 'string',
|
||||
description: '搜索关键词',
|
||||
nullable: true
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const PagingAuditLogActionOutputSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
@ -7831,7 +7911,8 @@ export const QueryCTWingAepReceiveMessageInputSchema = {
|
||||
},
|
||||
ioTDataType: {
|
||||
type: 'string',
|
||||
description: '数据类型',
|
||||
description: `数据类型,用于构建存储路径
|
||||
JiShe.ServicePro.Consts.IoTDBDataTypeConst`,
|
||||
nullable: true
|
||||
},
|
||||
deviceType: {
|
||||
@ -7839,7 +7920,7 @@ export const QueryCTWingAepReceiveMessageInputSchema = {
|
||||
},
|
||||
deviceAddress: {
|
||||
type: 'string',
|
||||
description: '设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等',
|
||||
description: '通信设备地址、用于构建存储路径',
|
||||
nullable: true
|
||||
},
|
||||
startCreationTime: {
|
||||
@ -7884,13 +7965,18 @@ export const QueryCTWingAepReceiveMessageOutputSchema = {
|
||||
},
|
||||
deviceType: {
|
||||
type: 'string',
|
||||
description: `设备类型集中器、电表、水表、流量计、传感器等,用于构建存储路径
|
||||
description: `设备类型,用于构建存储路径
|
||||
JiShe.ServicePro.Enums.DeviceTypeEnum`,
|
||||
nullable: true
|
||||
},
|
||||
deviceAddress: {
|
||||
type: 'string',
|
||||
description: '设备地址,数据生成者,例如集中器地址,电表地址、水表地址、流量计地址、传感器地址等',
|
||||
description: '通信设备地址、用于构建存储路径',
|
||||
nullable: true
|
||||
},
|
||||
subDevice: {
|
||||
type: 'string',
|
||||
description: '子设备',
|
||||
nullable: true
|
||||
},
|
||||
timestamps: {
|
||||
@ -8038,7 +8124,8 @@ export const QueryOneNETReceiveMessageInputSchema = {
|
||||
},
|
||||
ioTDataType: {
|
||||
type: 'string',
|
||||
description: '数据类型',
|
||||
description: `数据类型,用于构建存储路径
|
||||
JiShe.ServicePro.Consts.IoTDBDataTypeConst`,
|
||||
nullable: true
|
||||
},
|
||||
deviceType: {
|
||||
@ -8046,7 +8133,7 @@ export const QueryOneNETReceiveMessageInputSchema = {
|
||||
},
|
||||
deviceAddress: {
|
||||
type: 'string',
|
||||
description: '设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等',
|
||||
description: '通信设备地址、用于构建存储路径',
|
||||
nullable: true
|
||||
},
|
||||
startCreationTime: {
|
||||
@ -8091,13 +8178,18 @@ export const QueryOneNETReceiveMessageOutputSchema = {
|
||||
},
|
||||
deviceType: {
|
||||
type: 'string',
|
||||
description: `设备类型集中器、电表、水表、流量计、传感器等,用于构建存储路径
|
||||
description: `设备类型,用于构建存储路径
|
||||
JiShe.ServicePro.Enums.DeviceTypeEnum`,
|
||||
nullable: true
|
||||
},
|
||||
deviceAddress: {
|
||||
type: 'string',
|
||||
description: '设备地址,数据生成者,例如集中器地址,电表地址、水表地址、流量计地址、传感器地址等',
|
||||
description: '通信设备地址、用于构建存储路径',
|
||||
nullable: true
|
||||
},
|
||||
subDevice: {
|
||||
type: 'string',
|
||||
description: '子设备',
|
||||
nullable: true
|
||||
},
|
||||
timestamps: {
|
||||
@ -9223,54 +9315,6 @@ export const UpdateTextTemplateInputSchema = {
|
||||
description: '更新模板'
|
||||
} as const;
|
||||
|
||||
export const UpdateThingModelInputSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
ioTPlatform: {
|
||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
||||
},
|
||||
ioTPlatformProductId: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品Id',
|
||||
nullable: true
|
||||
},
|
||||
filedType: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||
nullable: true
|
||||
},
|
||||
ioTPlatformRawFieldName: {
|
||||
type: 'string',
|
||||
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldName: {
|
||||
type: 'string',
|
||||
description: '管理后台产品标准的物模型属性或者事件名称',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldValueType: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段值类型',
|
||||
nullable: true
|
||||
},
|
||||
standardFieldDisplayName: {
|
||||
type: 'string',
|
||||
description: '标准物模型字段显示名称',
|
||||
nullable: true
|
||||
},
|
||||
isValueNeedConvert: {
|
||||
type: 'boolean',
|
||||
description: '是否需要值类型转换'
|
||||
},
|
||||
id: {
|
||||
type: 'string',
|
||||
format: 'uuid'
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
} as const;
|
||||
|
||||
export const UpdateUserInputSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -400,38 +400,6 @@ export type CreateTextTemplateInput = {
|
||||
cultureName: string;
|
||||
};
|
||||
|
||||
export type CreateThingModelInput = {
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||
*/
|
||||
ioTPlatformRawFieldName?: (string) | null;
|
||||
/**
|
||||
* 管理后台产品标准的物模型属性或者事件名称
|
||||
*/
|
||||
standardFieldName?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段值类型
|
||||
*/
|
||||
standardFieldValueType?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段显示名称
|
||||
*/
|
||||
standardFieldDisplayName?: (string) | null;
|
||||
/**
|
||||
* 是否需要值类型转换
|
||||
*/
|
||||
isValueNeedConvert?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* CTWing账号信息
|
||||
*/
|
||||
@ -1122,6 +1090,15 @@ export type DeviceManagementInfoDto = {
|
||||
* 设备来源类型
|
||||
*/
|
||||
readonly deviceSourceTypeName?: (string) | null;
|
||||
deviceType?: DeviceTypeEnum;
|
||||
/**
|
||||
* 设备类型,与业务系统无关
|
||||
*/
|
||||
readonly deviceTypeName?: (string) | null;
|
||||
/**
|
||||
* 设备物模型数据Id
|
||||
*/
|
||||
deviceThingModelDataId?: string;
|
||||
};
|
||||
|
||||
export type DeviceManagementInfoDtoPagedResultDto = {
|
||||
@ -1163,12 +1140,13 @@ export type DeviceTableModelDataInfoPageInput = {
|
||||
*/
|
||||
sorting?: (string) | null;
|
||||
/**
|
||||
* 数据类型
|
||||
* 数据类型,用于构建存储路径
|
||||
* JiShe.ServicePro.Consts.IoTDBDataTypeConst
|
||||
*/
|
||||
ioTDataType?: (string) | null;
|
||||
deviceType?: DeviceTypeEnum;
|
||||
/**
|
||||
* 设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等
|
||||
* 通信设备地址、用于构建存储路径
|
||||
*/
|
||||
deviceAddress?: (string) | null;
|
||||
/**
|
||||
@ -1198,13 +1176,18 @@ export type DeviceTableModelDataInfoPageOutput = {
|
||||
*/
|
||||
ioTDataType?: (string) | null;
|
||||
/**
|
||||
* 设备类型集中器、电表、水表、流量计、传感器等
|
||||
* 设备类型
|
||||
* JiShe.ServicePro.Enums.DeviceTypeEnum
|
||||
*/
|
||||
deviceType?: (string) | null;
|
||||
/**
|
||||
* 设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等
|
||||
* 通信设备地址、用于构建存储路径
|
||||
*/
|
||||
deviceId?: (string) | null;
|
||||
deviceAddress?: (string) | null;
|
||||
/**
|
||||
* 子设备
|
||||
*/
|
||||
subDevice?: (string) | null;
|
||||
/**
|
||||
* 时标
|
||||
*/
|
||||
@ -1229,77 +1212,6 @@ export type DeviceTableModelDataInfoPageOutputPagedResultDto = {
|
||||
*/
|
||||
export type DeviceTelemetryCommandTypeEnum = 1 | 2;
|
||||
|
||||
export type DeviceThingModelInfoDto = {
|
||||
id?: string;
|
||||
creationTime?: string;
|
||||
creatorId?: (string) | null;
|
||||
lastModificationTime?: (string) | null;
|
||||
lastModifierId?: (string) | null;
|
||||
isDeleted?: boolean;
|
||||
deleterId?: (string) | null;
|
||||
deletionTime?: (string) | null;
|
||||
/**
|
||||
* 租户Id
|
||||
*/
|
||||
tenantId?: (string) | null;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: (string) | null;
|
||||
/**
|
||||
* 旧系统授权创建者Id
|
||||
*/
|
||||
osaCreatorId?: (number) | null;
|
||||
/**
|
||||
* 旧系统授权最后修改者Id
|
||||
*/
|
||||
osaLastModifierId?: (number) | null;
|
||||
/**
|
||||
* 旧系统授权最后删除者Id
|
||||
*/
|
||||
osaDeleterId?: (number) | null;
|
||||
/**
|
||||
* 扩展属性,用于存储自定义字段,JSON格式
|
||||
*/
|
||||
extraProperties?: {
|
||||
[key: string]: unknown;
|
||||
} | null;
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||
*/
|
||||
ioTPlatformRawFieldName?: (string) | null;
|
||||
/**
|
||||
* 管理后台产品标准的物模型属性或者事件名称
|
||||
*/
|
||||
standardFieldName?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段值类型
|
||||
*/
|
||||
standardFieldValueType?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段显示名称
|
||||
*/
|
||||
standardFieldDisplayName?: (string) | null;
|
||||
/**
|
||||
* 是否需要值类型转换
|
||||
*/
|
||||
isValueNeedConvert?: boolean;
|
||||
};
|
||||
|
||||
export type DeviceThingModelInfoDtoPagedResultDto = {
|
||||
items?: Array<DeviceThingModelInfoDto> | null;
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备树模型数据信息查询入参
|
||||
*/
|
||||
@ -1324,12 +1236,13 @@ export type DeviceTreeModelDataInfoInput = {
|
||||
*/
|
||||
sorting?: (string) | null;
|
||||
/**
|
||||
* 数据类型
|
||||
* 数据类型,用于构建存储路径
|
||||
* JiShe.ServicePro.Consts.IoTDBDataTypeConst
|
||||
*/
|
||||
ioTDataType?: (string) | null;
|
||||
deviceType?: DeviceTypeEnum;
|
||||
/**
|
||||
* 设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等
|
||||
* 通信设备地址、用于构建存储路径
|
||||
*/
|
||||
deviceAddress?: (string) | null;
|
||||
/**
|
||||
@ -1347,10 +1260,9 @@ export type DeviceTreeModelDataInfoInput = {
|
||||
};
|
||||
|
||||
/**
|
||||
* 表计类型
|
||||
* 电表= 1,水表= 2,燃气表= 3,热能表= 4,水表流量计=5,燃气表流量计=6
|
||||
* 设备类型,与业务系统无关
|
||||
*/
|
||||
export type DeviceTypeEnum = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
|
||||
export type DeviceTypeEnum = 0 | 1 | 2 | 3;
|
||||
|
||||
export type DisabledTwoFactorInput = {
|
||||
/**
|
||||
@ -2062,6 +1974,184 @@ export type IoTDBDynamicObjectPagedResultDto = {
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
export type IoTPlatformThingModelCreateInput = {
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||
*/
|
||||
ioTPlatformRawFieldName?: (string) | null;
|
||||
/**
|
||||
* 管理后台产品标准的物模型属性或者事件名称
|
||||
*/
|
||||
standardFieldName?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段值类型
|
||||
*/
|
||||
standardFieldValueType?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段显示名称
|
||||
*/
|
||||
standardFieldDisplayName?: (string) | null;
|
||||
/**
|
||||
* 是否需要值类型转换
|
||||
*/
|
||||
isValueNeedConvert?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* 平台端物模型信息
|
||||
*/
|
||||
export type IoTPlatformThingModelInfoDto = {
|
||||
id?: string;
|
||||
creationTime?: string;
|
||||
creatorId?: (string) | null;
|
||||
lastModificationTime?: (string) | null;
|
||||
lastModifierId?: (string) | null;
|
||||
isDeleted?: boolean;
|
||||
deleterId?: (string) | null;
|
||||
deletionTime?: (string) | null;
|
||||
/**
|
||||
* 租户Id
|
||||
*/
|
||||
tenantId?: (string) | null;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: (string) | null;
|
||||
/**
|
||||
* 旧系统授权创建者Id
|
||||
*/
|
||||
osaCreatorId?: (number) | null;
|
||||
/**
|
||||
* 旧系统授权最后修改者Id
|
||||
*/
|
||||
osaLastModifierId?: (number) | null;
|
||||
/**
|
||||
* 旧系统授权最后删除者Id
|
||||
*/
|
||||
osaDeleterId?: (number) | null;
|
||||
/**
|
||||
* 扩展属性,用于存储自定义字段,JSON格式
|
||||
*/
|
||||
extraProperties?: {
|
||||
[key: string]: unknown;
|
||||
} | null;
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||
*/
|
||||
ioTPlatformRawFieldName?: (string) | null;
|
||||
/**
|
||||
* 管理后台产品标准的物模型属性或者事件名称
|
||||
*/
|
||||
standardFieldName?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段值类型
|
||||
*/
|
||||
standardFieldValueType?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段显示名称
|
||||
*/
|
||||
standardFieldDisplayName?: (string) | null;
|
||||
/**
|
||||
* 是否需要值类型转换
|
||||
*/
|
||||
isValueNeedConvert?: boolean;
|
||||
/**
|
||||
* 是否是特殊物模型标识符
|
||||
*/
|
||||
isSpecialIdentifier?: boolean;
|
||||
};
|
||||
|
||||
export type IoTPlatformThingModelInfoDtoPagedResultDto = {
|
||||
items?: Array<IoTPlatformThingModelInfoDto> | null;
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
export type IoTPlatformThingModelPageInput = {
|
||||
/**
|
||||
* 当前页面.默认从1开始
|
||||
*/
|
||||
pageIndex?: number;
|
||||
/**
|
||||
* 每页多少条.每页显示多少记录
|
||||
*/
|
||||
pageSize?: number;
|
||||
/**
|
||||
* 跳过多少条
|
||||
*/
|
||||
readonly skipCount?: number;
|
||||
/**
|
||||
* 排序
|
||||
* <example>
|
||||
* name desc
|
||||
* </example>
|
||||
*/
|
||||
sorting?: (string) | null;
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 搜索关键字
|
||||
*/
|
||||
searchKeyWords?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
};
|
||||
|
||||
export type IoTPlatformThingModelUpdateInput = {
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||
*/
|
||||
ioTPlatformRawFieldName?: (string) | null;
|
||||
/**
|
||||
* 管理后台产品标准的物模型属性或者事件名称
|
||||
*/
|
||||
standardFieldName?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段值类型
|
||||
*/
|
||||
standardFieldValueType?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段显示名称
|
||||
*/
|
||||
standardFieldDisplayName?: (string) | null;
|
||||
/**
|
||||
* 是否需要值类型转换
|
||||
*/
|
||||
isValueNeedConvert?: boolean;
|
||||
id?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* 物联网平台类型枚举
|
||||
*/
|
||||
@ -2195,12 +2285,13 @@ export type MeterReadingPacketInfoPageInput = {
|
||||
*/
|
||||
sorting?: (string) | null;
|
||||
/**
|
||||
* 数据类型
|
||||
* 数据类型,用于构建存储路径
|
||||
* JiShe.ServicePro.Consts.IoTDBDataTypeConst
|
||||
*/
|
||||
ioTDataType?: (string) | null;
|
||||
deviceType?: DeviceTypeEnum;
|
||||
/**
|
||||
* 设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等
|
||||
* 通信设备地址、用于构建存储路径
|
||||
*/
|
||||
deviceAddress?: (string) | null;
|
||||
/**
|
||||
@ -2235,14 +2326,18 @@ export type MeterReadingPacketInfoPageOutput = {
|
||||
*/
|
||||
ioTDataType?: (string) | null;
|
||||
/**
|
||||
* 设备类型集中器、电表、水表、流量计、传感器等,用于构建存储路径
|
||||
* 设备类型,用于构建存储路径
|
||||
* JiShe.ServicePro.Enums.DeviceTypeEnum
|
||||
*/
|
||||
deviceType?: (string) | null;
|
||||
/**
|
||||
* 设备地址,数据生成者,例如集中器地址,电表地址、水表地址、流量计地址、传感器地址等
|
||||
* 通信设备地址、用于构建存储路径
|
||||
*/
|
||||
deviceAddress?: (string) | null;
|
||||
/**
|
||||
* 子设备
|
||||
*/
|
||||
subDevice?: (string) | null;
|
||||
/**
|
||||
* 时标,也就是业务时间戳,单位毫秒,必须通过DateTimeOffset获取
|
||||
*/
|
||||
@ -2676,6 +2771,10 @@ export type OneNETProductInfoDto = {
|
||||
* TLS通讯服务地址
|
||||
*/
|
||||
communicationAddressTLS?: (string) | null;
|
||||
/**
|
||||
* 物模型信息
|
||||
*/
|
||||
thingModelInfos?: (string) | null;
|
||||
};
|
||||
|
||||
export type OneNETProductInfoDtoPagedResultDto = {
|
||||
@ -3308,45 +3407,6 @@ export type PageTextTemplateOutputPagedResultDto = {
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
export type PageThingModelInput = {
|
||||
/**
|
||||
* 当前页面.默认从1开始
|
||||
*/
|
||||
pageIndex?: number;
|
||||
/**
|
||||
* 每页多少条.每页显示多少记录
|
||||
*/
|
||||
pageSize?: number;
|
||||
/**
|
||||
* 跳过多少条
|
||||
*/
|
||||
readonly skipCount?: number;
|
||||
/**
|
||||
* 排序
|
||||
* <example>
|
||||
* name desc
|
||||
* </example>
|
||||
*/
|
||||
sorting?: (string) | null;
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 搜索关键字
|
||||
*/
|
||||
searchKeyword?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 搜索关键词
|
||||
*/
|
||||
searchKeyWords?: (string) | null;
|
||||
};
|
||||
|
||||
export type PagingAuditLogActionOutput = {
|
||||
id?: string;
|
||||
tenantId?: (string) | null;
|
||||
@ -4019,12 +4079,13 @@ export type QueryCTWingAepReceiveMessageInput = {
|
||||
*/
|
||||
sorting?: (string) | null;
|
||||
/**
|
||||
* 数据类型
|
||||
* 数据类型,用于构建存储路径
|
||||
* JiShe.ServicePro.Consts.IoTDBDataTypeConst
|
||||
*/
|
||||
ioTDataType?: (string) | null;
|
||||
deviceType?: DeviceTypeEnum;
|
||||
/**
|
||||
* 设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等
|
||||
* 通信设备地址、用于构建存储路径
|
||||
*/
|
||||
deviceAddress?: (string) | null;
|
||||
/**
|
||||
@ -4059,14 +4120,18 @@ export type QueryCTWingAepReceiveMessageOutput = {
|
||||
*/
|
||||
ioTDataType?: (string) | null;
|
||||
/**
|
||||
* 设备类型集中器、电表、水表、流量计、传感器等,用于构建存储路径
|
||||
* 设备类型,用于构建存储路径
|
||||
* JiShe.ServicePro.Enums.DeviceTypeEnum
|
||||
*/
|
||||
deviceType?: (string) | null;
|
||||
/**
|
||||
* 设备地址,数据生成者,例如集中器地址,电表地址、水表地址、流量计地址、传感器地址等
|
||||
* 通信设备地址、用于构建存储路径
|
||||
*/
|
||||
deviceAddress?: (string) | null;
|
||||
/**
|
||||
* 子设备
|
||||
*/
|
||||
subDevice?: (string) | null;
|
||||
/**
|
||||
* 时标,也就是业务时间戳,单位毫秒,必须通过DateTimeOffset获取
|
||||
*/
|
||||
@ -4170,12 +4235,13 @@ export type QueryOneNETReceiveMessageInput = {
|
||||
*/
|
||||
sorting?: (string) | null;
|
||||
/**
|
||||
* 数据类型
|
||||
* 数据类型,用于构建存储路径
|
||||
* JiShe.ServicePro.Consts.IoTDBDataTypeConst
|
||||
*/
|
||||
ioTDataType?: (string) | null;
|
||||
deviceType?: DeviceTypeEnum;
|
||||
/**
|
||||
* 设备ID,数据生成者,例如集中器ID,电表ID、水表ID、流量计ID、传感器ID等
|
||||
* 通信设备地址、用于构建存储路径
|
||||
*/
|
||||
deviceAddress?: (string) | null;
|
||||
/**
|
||||
@ -4210,14 +4276,18 @@ export type QueryOneNETReceiveMessageOutput = {
|
||||
*/
|
||||
ioTDataType?: (string) | null;
|
||||
/**
|
||||
* 设备类型集中器、电表、水表、流量计、传感器等,用于构建存储路径
|
||||
* 设备类型,用于构建存储路径
|
||||
* JiShe.ServicePro.Enums.DeviceTypeEnum
|
||||
*/
|
||||
deviceType?: (string) | null;
|
||||
/**
|
||||
* 设备地址,数据生成者,例如集中器地址,电表地址、水表地址、流量计地址、传感器地址等
|
||||
* 通信设备地址、用于构建存储路径
|
||||
*/
|
||||
deviceAddress?: (string) | null;
|
||||
/**
|
||||
* 子设备
|
||||
*/
|
||||
subDevice?: (string) | null;
|
||||
/**
|
||||
* 时标,也就是业务时间戳,单位毫秒,必须通过DateTimeOffset获取
|
||||
*/
|
||||
@ -4762,39 +4832,6 @@ export type UpdateTextTemplateInput = {
|
||||
cultureName: string;
|
||||
};
|
||||
|
||||
export type UpdateThingModelInput = {
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||
*/
|
||||
ioTPlatformRawFieldName?: (string) | null;
|
||||
/**
|
||||
* 管理后台产品标准的物模型属性或者事件名称
|
||||
*/
|
||||
standardFieldName?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段值类型
|
||||
*/
|
||||
standardFieldValueType?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段显示名称
|
||||
*/
|
||||
standardFieldDisplayName?: (string) | null;
|
||||
/**
|
||||
* 是否需要值类型转换
|
||||
*/
|
||||
isValueNeedConvert?: boolean;
|
||||
id?: string;
|
||||
};
|
||||
|
||||
export type UpdateUserInput = {
|
||||
userId?: string;
|
||||
userInfo?: IdentityUserUpdateDto;
|
||||
@ -5217,90 +5254,6 @@ export type PostDeviceInfoCacheDeviceDataToRedisResponse = (boolean);
|
||||
|
||||
export type PostDeviceInfoCacheDeviceDataToRedisError = unknown;
|
||||
|
||||
export type PostThingModelInfoCreateAsyncData = {
|
||||
query?: {
|
||||
input?: CreateThingModelInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostThingModelInfoCreateAsyncResponse = (DeviceThingModelInfoDto);
|
||||
|
||||
export type PostThingModelInfoCreateAsyncError = unknown;
|
||||
|
||||
export type PostThingModelInfoUpdateAsyncData = {
|
||||
query?: {
|
||||
input?: UpdateThingModelInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostThingModelInfoUpdateAsyncResponse = (DeviceThingModelInfoDto);
|
||||
|
||||
export type PostThingModelInfoUpdateAsyncError = unknown;
|
||||
|
||||
export type PostThingModelInfoDeleteAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostThingModelInfoDeleteAsyncResponse = (boolean);
|
||||
|
||||
export type PostThingModelInfoDeleteAsyncError = unknown;
|
||||
|
||||
export type PostThingModelInfoFindByIdAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostThingModelInfoFindByIdAsyncResponse = (DeviceThingModelInfoDto);
|
||||
|
||||
export type PostThingModelInfoFindByIdAsyncError = unknown;
|
||||
|
||||
export type PostThingModelInfoFindByPlatformProductIdAsyncData = {
|
||||
query?: {
|
||||
input?: StringIdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostThingModelInfoFindByPlatformProductIdAsyncResponse = (Array<DeviceThingModelInfoDto>);
|
||||
|
||||
export type PostThingModelInfoFindByPlatformProductIdAsyncError = unknown;
|
||||
|
||||
export type PostThingModelInfoCopyAnotherThingModelAsyncData = {
|
||||
query?: {
|
||||
input?: CopyAnotherProductInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostThingModelInfoCopyAnotherThingModelAsyncResponse = (boolean);
|
||||
|
||||
export type PostThingModelInfoCopyAnotherThingModelAsyncError = unknown;
|
||||
|
||||
export type PostThingModelInfoCopyStandardThingModelData = {
|
||||
query?: {
|
||||
input?: CopyStandardThingModelInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostThingModelInfoCopyStandardThingModelResponse = (boolean);
|
||||
|
||||
export type PostThingModelInfoCopyStandardThingModelError = unknown;
|
||||
|
||||
export type PostThingModelInfoPageAsyncData = {
|
||||
query?: {
|
||||
input?: PageThingModelInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostThingModelInfoPageAsyncResponse = (DeviceThingModelInfoDtoPagedResultDto);
|
||||
|
||||
export type PostThingModelInfoPageAsyncError = unknown;
|
||||
|
||||
export type PostThingModelInfoStandardThingModelPageAsyncResponse = (Array<DataDictionaryDetailInfoDto>);
|
||||
|
||||
export type PostThingModelInfoStandardThingModelPageAsyncError = unknown;
|
||||
|
||||
export type PostFeaturesListData = {
|
||||
body?: GetFeatureListResultInput;
|
||||
};
|
||||
@ -5367,6 +5320,90 @@ export type PostIdentitySecurityLogsPageResponse = (PagingIdentitySecurityLogOut
|
||||
|
||||
export type PostIdentitySecurityLogsPageError = (RemoteServiceErrorResponse);
|
||||
|
||||
export type PostIoTplatformThingModelInfoCreateAsyncData = {
|
||||
query?: {
|
||||
input?: IoTPlatformThingModelCreateInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostIoTplatformThingModelInfoCreateAsyncResponse = (IoTPlatformThingModelInfoDto);
|
||||
|
||||
export type PostIoTplatformThingModelInfoCreateAsyncError = unknown;
|
||||
|
||||
export type PostIoTplatformThingModelInfoUpdateAsyncData = {
|
||||
query?: {
|
||||
input?: IoTPlatformThingModelUpdateInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostIoTplatformThingModelInfoUpdateAsyncResponse = (IoTPlatformThingModelInfoDto);
|
||||
|
||||
export type PostIoTplatformThingModelInfoUpdateAsyncError = unknown;
|
||||
|
||||
export type PostIoTplatformThingModelInfoDeleteAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostIoTplatformThingModelInfoDeleteAsyncResponse = (boolean);
|
||||
|
||||
export type PostIoTplatformThingModelInfoDeleteAsyncError = unknown;
|
||||
|
||||
export type PostIoTplatformThingModelInfoFindByIdAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostIoTplatformThingModelInfoFindByIdAsyncResponse = (IoTPlatformThingModelInfoDto);
|
||||
|
||||
export type PostIoTplatformThingModelInfoFindByIdAsyncError = unknown;
|
||||
|
||||
export type PostIoTplatformThingModelInfoFindByPlatformProductIdAsyncData = {
|
||||
query?: {
|
||||
input?: StringIdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostIoTplatformThingModelInfoFindByPlatformProductIdAsyncResponse = (Array<IoTPlatformThingModelInfoDto>);
|
||||
|
||||
export type PostIoTplatformThingModelInfoFindByPlatformProductIdAsyncError = unknown;
|
||||
|
||||
export type PostIoTplatformThingModelInfoCopyAnotherThingModelAsyncData = {
|
||||
query?: {
|
||||
input?: CopyAnotherProductInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostIoTplatformThingModelInfoCopyAnotherThingModelAsyncResponse = (boolean);
|
||||
|
||||
export type PostIoTplatformThingModelInfoCopyAnotherThingModelAsyncError = unknown;
|
||||
|
||||
export type PostIoTplatformThingModelInfoCopyStandardThingModelData = {
|
||||
query?: {
|
||||
input?: CopyStandardThingModelInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostIoTplatformThingModelInfoCopyStandardThingModelResponse = (boolean);
|
||||
|
||||
export type PostIoTplatformThingModelInfoCopyStandardThingModelError = unknown;
|
||||
|
||||
export type PostIoTplatformThingModelInfoPageAsyncData = {
|
||||
query?: {
|
||||
input?: IoTPlatformThingModelPageInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostIoTplatformThingModelInfoPageAsyncResponse = (IoTPlatformThingModelInfoDtoPagedResultDto);
|
||||
|
||||
export type PostIoTplatformThingModelInfoPageAsyncError = unknown;
|
||||
|
||||
export type PostIoTplatformThingModelInfoStandardThingModelPageAsyncResponse = (Array<DataDictionaryDetailInfoDto>);
|
||||
|
||||
export type PostIoTplatformThingModelInfoStandardThingModelPageAsyncError = unknown;
|
||||
|
||||
export type PostLanguagesAllResponse = (Array<PageLanguageOutput>);
|
||||
|
||||
export type PostLanguagesAllError = (RemoteServiceErrorResponse);
|
||||
@ -5715,6 +5752,16 @@ export type GetOneNetServiceReceiveCiphertextDataChangeResponse = (unknown);
|
||||
|
||||
export type GetOneNetServiceReceiveCiphertextDataChangeError = unknown;
|
||||
|
||||
export type GetOneNetServiceCheckLocalMemroyData = {
|
||||
query?: {
|
||||
key?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type GetOneNetServiceCheckLocalMemroyResponse = (unknown);
|
||||
|
||||
export type GetOneNetServiceCheckLocalMemroyError = unknown;
|
||||
|
||||
export type PostOrganizationUnitsTreeResponse = (Array<TreeOutput>);
|
||||
|
||||
export type PostOrganizationUnitsTreeError = (RemoteServiceErrorResponse);
|
||||
|
||||
@ -124,7 +124,7 @@ const routes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
title: $t('abp.menu.notification'),
|
||||
authority: ['AbpIdentity.NotificationSubscriptionManagement'],
|
||||
icon: 'ant-design:comment-outlined',
|
||||
icon: 'ant-design:medium-square-filled',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@ -11,12 +11,12 @@ import { message as Message, Modal, Tag } from 'ant-design-vue';
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
postThingModelInfoCopyAnotherThingModelAsync,
|
||||
postThingModelInfoCopyStandardThingModel,
|
||||
postThingModelInfoCreateAsync,
|
||||
postThingModelInfoDeleteAsync,
|
||||
postThingModelInfoPageAsync,
|
||||
postThingModelInfoUpdateAsync,
|
||||
postIoTplatformThingModelInfoCopyAnotherThingModelAsync,
|
||||
postIoTplatformThingModelInfoCopyStandardThingModel,
|
||||
postIoTplatformThingModelInfoCreateAsync,
|
||||
postIoTplatformThingModelInfoDeleteAsync,
|
||||
postIoTplatformThingModelInfoPageAsync,
|
||||
postIoTplatformThingModelInfoUpdateAsync,
|
||||
} from '#/api-client';
|
||||
import { TableAction } from '#/components/table-action';
|
||||
import { $t } from '#/locales';
|
||||
@ -76,13 +76,15 @@ const gridOptions: VxeGridProps<any> = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
const { data } = await postThingModelInfoPageAsync({
|
||||
const { data } = await postIoTplatformThingModelInfoPageAsync({
|
||||
query: {
|
||||
input: {
|
||||
pageIndex: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
ioTPlatform: Number.parseInt(props.ioTPlatform) as 1 | 2,
|
||||
ioTPlatformProductId: props.productId,
|
||||
...formValues,
|
||||
...(formValues?.SearchKeyWords && { searchKeyWords: formValues.SearchKeyWords }),
|
||||
},
|
||||
},
|
||||
});
|
||||
// 更新数据状态,检查是否有数据
|
||||
@ -191,25 +193,20 @@ watch(
|
||||
// 延迟执行,确保组件完全初始化
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
// 设置表单筛选条件
|
||||
// 设置表单筛选条件(如果有搜索关键词等筛选字段)
|
||||
const filterValues: any = {};
|
||||
|
||||
if (ioTPlatform) {
|
||||
filterValues.ioTPlatform = ioTPlatform;
|
||||
}
|
||||
|
||||
if (productId) {
|
||||
filterValues.oneNETProductId = productId;
|
||||
}
|
||||
// 注意:ioTPlatformProductId 已经在 API 调用中通过 props.productId 传递
|
||||
// 这里只需要设置查询表单中存在的字段(如 SearchKeyWords)
|
||||
|
||||
console.log('设置筛选条件:', filterValues);
|
||||
|
||||
// 设置筛选表单的值
|
||||
if (Object.keys(filterValues).length > 0) {
|
||||
await gridApi.formApi.setValues(filterValues);
|
||||
// 重新加载数据
|
||||
await gridApi.reload();
|
||||
}
|
||||
// 重新加载数据(即使没有筛选条件也要重新加载,因为 productId 可能已变化)
|
||||
await gridApi.reload();
|
||||
} catch (error) {
|
||||
console.error('设置筛选条件时出错:', error);
|
||||
}
|
||||
@ -224,8 +221,8 @@ async function submit() {
|
||||
const isEdit = !!editRow.value.id;
|
||||
const formApi = isEdit ? editFormApi : addFormApi;
|
||||
const api = isEdit
|
||||
? postThingModelInfoUpdateAsync
|
||||
: postThingModelInfoCreateAsync;
|
||||
? postIoTplatformThingModelInfoUpdateAsync
|
||||
: postIoTplatformThingModelInfoCreateAsync;
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) return;
|
||||
|
||||
@ -240,7 +237,7 @@ async function submit() {
|
||||
};
|
||||
|
||||
try {
|
||||
const resp = await api({ body: fetchParams });
|
||||
const resp = await api({ query: { input: fetchParams } });
|
||||
if (resp.data) {
|
||||
Message.success(
|
||||
editRow.value.id ? $t('common.editSuccess') : $t('common.addSuccess'),
|
||||
@ -298,12 +295,14 @@ async function submitCopy() {
|
||||
});
|
||||
|
||||
try {
|
||||
const resp = await postThingModelInfoCopyAnotherThingModelAsync({
|
||||
body: {
|
||||
const resp = await postIoTplatformThingModelInfoCopyAnotherThingModelAsync({
|
||||
query: {
|
||||
input: {
|
||||
ioTPlatform: Number.parseInt(props.ioTPlatform) as 1 | 2,
|
||||
ioTPlatformProductId: props.productId,
|
||||
sourceProductId: formValues.ioTPlatformProductId,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (resp.data) {
|
||||
@ -322,8 +321,10 @@ async function submitCopy() {
|
||||
// 删除函数
|
||||
async function onDel(record: any) {
|
||||
try {
|
||||
const resp = await postThingModelInfoDeleteAsync({
|
||||
body: { id: record.id },
|
||||
const resp = await postIoTplatformThingModelInfoDeleteAsync({
|
||||
query: {
|
||||
input: { id: record.id },
|
||||
},
|
||||
});
|
||||
if (resp.data) {
|
||||
Message.success($t('common.deleteSuccess'));
|
||||
@ -340,11 +341,13 @@ async function onDel(record: any) {
|
||||
// 复制标准模型函数
|
||||
async function copyStandardThingModel() {
|
||||
try {
|
||||
const resp = await postThingModelInfoCopyStandardThingModel({
|
||||
body: {
|
||||
ioTPlatform: props.ioTPlatform,
|
||||
const resp = await postIoTplatformThingModelInfoCopyStandardThingModel({
|
||||
query: {
|
||||
input: {
|
||||
ioTPlatform: Number.parseInt(props.ioTPlatform) as 1 | 2,
|
||||
ioTPlatformProductId: props.productId,
|
||||
},
|
||||
},
|
||||
});
|
||||
if (resp.data) {
|
||||
Message.success('复制标准模型成功');
|
||||
@ -0,0 +1,188 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, computed, h } from 'vue';
|
||||
import { Select, Divider, Row } from 'ant-design-vue';
|
||||
import { ChevronLeft, ChevronRight } from '@vben/icons';
|
||||
import { postDataDictionarySelectDetail } from '#/api-client';
|
||||
import { $t } from '#/locales';
|
||||
import { useDebounceFn } from '@vueuse/core';
|
||||
|
||||
interface Props {
|
||||
value?: string;
|
||||
typeCode?: string | number | null;
|
||||
placeholder?: string;
|
||||
disabled?: boolean;
|
||||
allowClear?: boolean;
|
||||
onResolve?: (item: any | null) => void;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
placeholder: $t('common.pleaseSelect') + $t('abp.thingModelInfos.StandardFieldName'),
|
||||
disabled: false,
|
||||
allowClear: true,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:value': [string | undefined];
|
||||
change: [string | undefined];
|
||||
'item-change': [any | null];
|
||||
}>();
|
||||
|
||||
const VNodes = (props: any) => {
|
||||
return props.vnodes;
|
||||
};
|
||||
|
||||
const options = ref<any[]>([]);
|
||||
const total = ref(0);
|
||||
const loading = ref<boolean>(false);
|
||||
const query = ref({
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
filter: '',
|
||||
});
|
||||
|
||||
const maxPage = computed(() => Math.ceil((total.value || 0) / query.value.pageSize) || 1);
|
||||
|
||||
const fetchData = async () => {
|
||||
if (!props.typeCode) {
|
||||
options.value = [];
|
||||
total.value = 0;
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
try {
|
||||
const { data } = await postDataDictionarySelectDetail({
|
||||
body: {
|
||||
filter: query.value.filter,
|
||||
typeCode: String(props.typeCode),
|
||||
pageIndex: query.value.pageIndex,
|
||||
pageSize: query.value.pageSize,
|
||||
} as any,
|
||||
});
|
||||
const items = Array.isArray(data?.items) ? data!.items : [];
|
||||
const mappedItems = items.map((item: any) => ({
|
||||
label: `${item.displayText}`,
|
||||
value: item.code,
|
||||
...item,
|
||||
}));
|
||||
|
||||
// 如果有当前值但不在当前页的选项中,需要添加当前值到选项中
|
||||
if (props.value && props.value.trim() !== '' && !mappedItems.find(item => item.value === props.value)) {
|
||||
// 如果当前值不在选项中,添加一个占位项
|
||||
mappedItems.unshift({
|
||||
label: `当前值: ${props.value}`,
|
||||
value: props.value,
|
||||
displayText: props.value,
|
||||
code: props.value,
|
||||
});
|
||||
}
|
||||
|
||||
options.value = mappedItems;
|
||||
total.value = (data as any)?.totalCount || 0;
|
||||
} catch (err) {
|
||||
console.error('获取标准物模型编码失败:', err);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const changePage = (next: number) => {
|
||||
if (next === 1) {
|
||||
if (query.value.pageIndex >= maxPage.value) return;
|
||||
query.value.pageIndex += 1;
|
||||
} else {
|
||||
if (query.value.pageIndex <= 1) return;
|
||||
query.value.pageIndex -= 1;
|
||||
}
|
||||
fetchData();
|
||||
};
|
||||
|
||||
const onSearch = useDebounceFn((kw: string) => {
|
||||
query.value.pageIndex = 1;
|
||||
query.value.filter = kw;
|
||||
fetchData();
|
||||
}, 400);
|
||||
|
||||
const onChange = (val?: string) => {
|
||||
emit('update:value', val);
|
||||
emit('change', val);
|
||||
if (val) {
|
||||
const found = options.value.find((o) => o.value === val) || null;
|
||||
emit('item-change', found);
|
||||
props.onResolve && props.onResolve(found);
|
||||
} else {
|
||||
emit('item-change', null);
|
||||
props.onResolve && props.onResolve(null);
|
||||
}
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.typeCode,
|
||||
() => {
|
||||
// reset when type changes, do not auto-fetch until user searches
|
||||
query.value.pageIndex = 1;
|
||||
query.value.filter = '';
|
||||
options.value = [];
|
||||
total.value = 0;
|
||||
if (props.typeCode) {
|
||||
fetchData();
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
// 监听初始值变化,确保编辑时能正确显示
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
if (newValue && newValue.trim() !== '' && props.typeCode && !options.value.find(item => item.value === newValue)) {
|
||||
// 如果有值但不在当前选项中,重新获取数据
|
||||
fetchData();
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Select
|
||||
:value="value"
|
||||
:showSearch="true"
|
||||
:filter-option="false"
|
||||
:options="options"
|
||||
:placeholder="placeholder"
|
||||
:disabled="disabled"
|
||||
:allowClear="allowClear"
|
||||
:loading="loading"
|
||||
@search="onSearch"
|
||||
@change="onChange"
|
||||
>
|
||||
<template #dropdownRender="{ menuNode: menu }">
|
||||
<v-nodes :vnodes="menu" />
|
||||
<Divider style="margin: 4px 0" />
|
||||
<div @mousedown="(e) => e.preventDefault()">
|
||||
<Row type="flex" justify="space-around" align="middle">
|
||||
<ChevronLeft
|
||||
@click="changePage(0)"
|
||||
:class="{ 'text-gray-400': query.pageIndex <= 1 }"
|
||||
style="cursor: pointer; width: 16px; height: 16px;"
|
||||
/>
|
||||
<div>{{ `${query.pageIndex}/${maxPage}` }}</div>
|
||||
<ChevronRight
|
||||
@click="changePage(1)"
|
||||
:class="{ 'text-gray-400': query.pageIndex >= maxPage }"
|
||||
style="cursor: pointer; width: 16px; height: 16px;"
|
||||
/>
|
||||
</Row>
|
||||
</div>
|
||||
</template>
|
||||
</Select>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.text-gray-400 {
|
||||
color: #9ca3af;
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -0,0 +1,446 @@
|
||||
<script setup lang="ts">
|
||||
import type { VbenFormProps } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
import { h, nextTick, ref, watch } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message as Message, Modal, Tag } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
postIoTplatformThingModelInfoCopyAnotherThingModelAsync,
|
||||
postIoTplatformThingModelInfoCopyStandardThingModel,
|
||||
postIoTplatformThingModelInfoCreateAsync,
|
||||
postIoTplatformThingModelInfoDeleteAsync,
|
||||
postIoTplatformThingModelInfoPageAsync,
|
||||
postIoTplatformThingModelInfoUpdateAsync,
|
||||
} from '#/api-client';
|
||||
import { TableAction } from '#/components/table-action';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import {
|
||||
addThingModelFormSchema,
|
||||
copyThingModelFormSchema,
|
||||
editThingModelFormSchema,
|
||||
querySchema,
|
||||
tableSchema,
|
||||
} from './schema';
|
||||
|
||||
defineOptions({
|
||||
name: 'ThingModelInfoModal',
|
||||
});
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
visible: false,
|
||||
productId: '',
|
||||
productName: '',
|
||||
ioTPlatform: '2',
|
||||
});
|
||||
|
||||
// 定义emits
|
||||
const emit = defineEmits<{
|
||||
close: [];
|
||||
'update:visible': [value: boolean];
|
||||
}>();
|
||||
|
||||
// 定义props
|
||||
interface Props {
|
||||
visible?: boolean;
|
||||
productId?: string;
|
||||
productName?: string;
|
||||
ioTPlatform?: string;
|
||||
}
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
schema: querySchema.value,
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps<any> = {
|
||||
checkboxConfig: {
|
||||
highlight: true,
|
||||
labelField: 'thingModelName',
|
||||
},
|
||||
columns: tableSchema.value,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
toolbarConfig: {
|
||||
custom: true,
|
||||
},
|
||||
customConfig: {
|
||||
storage: true,
|
||||
},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
const { data } = await postIoTplatformThingModelInfoPageAsync({
|
||||
query: {
|
||||
input: {
|
||||
pageIndex: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
ioTPlatform: Number.parseInt(props.ioTPlatform) as 1 | 2,
|
||||
ioTPlatformProductId: props.productId,
|
||||
...(formValues?.SearchKeyWords && { searchKeyWords: formValues.SearchKeyWords }),
|
||||
},
|
||||
},
|
||||
});
|
||||
// 更新数据状态,检查是否有数据
|
||||
hasData.value = data?.items && data.items.length > 0;
|
||||
return data;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({ formOptions, gridOptions });
|
||||
|
||||
const editRow: Record<string, any> = ref({});
|
||||
|
||||
// 跟踪数据状态,用于控制按钮显示
|
||||
const hasData = ref(true);
|
||||
|
||||
const [ThingModelModal, thingModelModalApi] = useVbenModal({
|
||||
draggable: true,
|
||||
footer: true,
|
||||
showCancelButton: true,
|
||||
showConfirmButton: true,
|
||||
onConfirm: submit,
|
||||
onBeforeClose: () => {
|
||||
return true;
|
||||
},
|
||||
onOpenChange: (isOpen: boolean) => {
|
||||
if (isOpen && editRow.value.id) {
|
||||
// 编辑模式下,模态框打开后设置表单值
|
||||
nextTick(() => {
|
||||
editFormApi.setValues({ ...editRow.value });
|
||||
});
|
||||
}
|
||||
},
|
||||
onCancel: () => {
|
||||
thingModelModalApi.close();
|
||||
},
|
||||
});
|
||||
|
||||
const [CopyModal, copyModalApi] = useVbenModal({
|
||||
draggable: true,
|
||||
footer: true,
|
||||
showCancelButton: true,
|
||||
showConfirmButton: true,
|
||||
onConfirm: submitCopy,
|
||||
onBeforeClose: () => {
|
||||
return true;
|
||||
},
|
||||
onCancel: () => {
|
||||
copyModalApi.close();
|
||||
},
|
||||
});
|
||||
|
||||
const [AddForm, addFormApi] = useVbenForm({
|
||||
collapsed: false,
|
||||
commonConfig: {
|
||||
labelWidth: 110,
|
||||
componentProps: {
|
||||
class: 'w-4/5',
|
||||
},
|
||||
},
|
||||
layout: 'horizontal',
|
||||
schema: addThingModelFormSchema.value,
|
||||
showCollapseButton: false,
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const [EditForm, editFormApi] = useVbenForm({
|
||||
collapsed: false,
|
||||
commonConfig: {
|
||||
labelWidth: 110,
|
||||
componentProps: {
|
||||
class: 'w-4/5',
|
||||
},
|
||||
},
|
||||
layout: 'horizontal',
|
||||
schema: editThingModelFormSchema.value,
|
||||
showCollapseButton: false,
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const [CopyForm, copyFormApi] = useVbenForm({
|
||||
collapsed: false,
|
||||
commonConfig: {
|
||||
labelWidth: 110,
|
||||
componentProps: {
|
||||
class: 'w-4/5',
|
||||
},
|
||||
},
|
||||
layout: 'horizontal',
|
||||
schema: copyThingModelFormSchema.value,
|
||||
showCollapseButton: false,
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
// 监听props变化,自动设置筛选条件
|
||||
watch(
|
||||
() => [props.visible, props.productId, props.ioTPlatform],
|
||||
async ([visible, productId, ioTPlatform]) => {
|
||||
console.log('物模型模态框props变化:', { visible, productId, ioTPlatform });
|
||||
console.log('所有props:', props);
|
||||
if (visible && productId) {
|
||||
// 延迟执行,确保组件完全初始化
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
// 设置表单筛选条件(如果有搜索关键词等筛选字段)
|
||||
const filterValues: any = {};
|
||||
|
||||
// 注意:ioTPlatformProductId 已经在 API 调用中通过 props.productId 传递
|
||||
// 这里只需要设置查询表单中存在的字段(如 SearchKeyWords)
|
||||
|
||||
console.log('设置筛选条件:', filterValues);
|
||||
|
||||
// 设置筛选表单的值
|
||||
if (Object.keys(filterValues).length > 0) {
|
||||
await gridApi.formApi.setValues(filterValues);
|
||||
}
|
||||
// 重新加载数据(即使没有筛选条件也要重新加载,因为 productId 可能已变化)
|
||||
await gridApi.reload();
|
||||
} catch (error) {
|
||||
console.error('设置筛选条件时出错:', error);
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
// 新增和编辑提交的逻辑
|
||||
async function submit() {
|
||||
const isEdit = !!editRow.value.id;
|
||||
const formApi = isEdit ? editFormApi : addFormApi;
|
||||
const api = isEdit
|
||||
? postIoTplatformThingModelInfoUpdateAsync
|
||||
: postIoTplatformThingModelInfoCreateAsync;
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) return;
|
||||
|
||||
const formValues = await formApi.getValues();
|
||||
const fetchParams: any = {
|
||||
...formValues,
|
||||
// 自动添加平台和产品信息
|
||||
ioTPlatform: Number.parseInt(props.ioTPlatform) as 1 | 2,
|
||||
ioTPlatformProductId: props.productId,
|
||||
// 编辑时需要添加ID
|
||||
...(isEdit && { id: editRow.value.id }),
|
||||
};
|
||||
|
||||
try {
|
||||
const resp = await api({ query: { input: fetchParams } });
|
||||
if (resp.data) {
|
||||
Message.success(
|
||||
editRow.value.id ? $t('common.editSuccess') : $t('common.addSuccess'),
|
||||
);
|
||||
thingModelModalApi.close();
|
||||
editRow.value = {};
|
||||
gridApi.reload();
|
||||
} else {
|
||||
Message.error(
|
||||
editRow.value.id ? $t('common.editFail') : $t('common.addFail'),
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
Message.error(
|
||||
editRow.value.id ? $t('common.editFail') : $t('common.addFail'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async function onEdit(record: any) {
|
||||
editRow.value = record;
|
||||
thingModelModalApi.open();
|
||||
}
|
||||
|
||||
const openAddModal = async () => {
|
||||
editRow.value = {};
|
||||
thingModelModalApi.open();
|
||||
};
|
||||
|
||||
// 打开复制已有模型模态框
|
||||
const openCopyAnotherThingModelModal = async () => {
|
||||
console.log('打开复制模态框,当前props:', {
|
||||
productId: props.productId,
|
||||
productName: props.productName,
|
||||
ioTPlatform: props.ioTPlatform,
|
||||
});
|
||||
copyModalApi.open();
|
||||
};
|
||||
|
||||
// 复制提交逻辑
|
||||
async function submitCopy() {
|
||||
const { valid } = await copyFormApi.validate();
|
||||
if (!valid) return;
|
||||
|
||||
const formValues = await copyFormApi.getValues();
|
||||
|
||||
console.log('复制提交参数:', {
|
||||
formValues,
|
||||
props: {
|
||||
productId: props.productId,
|
||||
productName: props.productName,
|
||||
ioTPlatform: props.ioTPlatform,
|
||||
},
|
||||
});
|
||||
|
||||
try {
|
||||
const resp = await postIoTplatformThingModelInfoCopyAnotherThingModelAsync({
|
||||
query: {
|
||||
input: {
|
||||
ioTPlatform: Number.parseInt(props.ioTPlatform) as 1 | 2,
|
||||
ioTPlatformProductId: props.productId,
|
||||
sourceProductId: formValues.ioTPlatformProductId,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (resp.data) {
|
||||
Message.success('复制模型成功');
|
||||
copyModalApi.close();
|
||||
gridApi.reload();
|
||||
} else {
|
||||
Message.error('复制模型失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('复制模型失败:', error);
|
||||
Message.error('复制模型失败');
|
||||
}
|
||||
}
|
||||
|
||||
// 删除函数
|
||||
async function onDel(record: any) {
|
||||
try {
|
||||
const resp = await postIoTplatformThingModelInfoDeleteAsync({
|
||||
query: {
|
||||
input: { id: record.id },
|
||||
},
|
||||
});
|
||||
if (resp.data) {
|
||||
Message.success($t('common.deleteSuccess'));
|
||||
gridApi.reload();
|
||||
} else {
|
||||
Message.error($t('common.deleteFail'));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('删除失败:', error);
|
||||
Message.error($t('common.deleteFail'));
|
||||
}
|
||||
}
|
||||
|
||||
// 复制标准模型函数
|
||||
async function copyStandardThingModel() {
|
||||
try {
|
||||
const resp = await postIoTplatformThingModelInfoCopyStandardThingModel({
|
||||
query: {
|
||||
input: {
|
||||
ioTPlatform: Number.parseInt(props.ioTPlatform) as 1 | 2,
|
||||
ioTPlatformProductId: props.productId,
|
||||
},
|
||||
},
|
||||
});
|
||||
if (resp.data) {
|
||||
Message.success('复制标准模型成功');
|
||||
gridApi.reload();
|
||||
} else {
|
||||
Message.error('复制标准模型失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('复制标准模型失败:', error);
|
||||
Message.error('复制标准模型失败');
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭模态框
|
||||
function closeModal() {
|
||||
emit('update:visible', false);
|
||||
emit('close');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal :open="visible" :title="`${props.ioTPlatform === 1 ? 'CTWing' : 'OneNET'}物模型管理 - ${productName || '产品'}`"
|
||||
width="90%" :footer="null" @cancel="closeModal" @ok="closeModal"
|
||||
:body-style="{ height: '70vh', overflow: 'hidden' }">
|
||||
<div style="display: flex; flex-direction: column; height: 100%">
|
||||
<Grid style="flex: 1; overflow: hidden">
|
||||
<template #toolbar-actions>
|
||||
<TableAction :actions="[
|
||||
{
|
||||
label: $t('common.add'),
|
||||
type: 'primary',
|
||||
icon: 'ant-design:plus-outlined',
|
||||
onClick: openAddModal.bind(null),
|
||||
auth: ['AbpIdentity.Users.Create'],
|
||||
},
|
||||
{
|
||||
label: $t('abp.thingModelInfos.copyStandardThingModel'),
|
||||
type: 'default',
|
||||
icon: 'ant-design:copy-outlined',
|
||||
onClick: copyStandardThingModel,
|
||||
auth: ['AbpIdentity.Users.Create'],
|
||||
},
|
||||
{
|
||||
label: $t('abp.thingModelInfos.copyAnotherThingModelModal'),
|
||||
type: 'default',
|
||||
icon: 'ant-design:copy-outlined',
|
||||
onClick: openCopyAnotherThingModelModal,
|
||||
auth: ['AbpIdentity.Users.Create'],
|
||||
ifShow: !hasData,
|
||||
},
|
||||
]" />
|
||||
</template>
|
||||
|
||||
<template #isValueNeedConvert="{ row }">
|
||||
<component :is="h(
|
||||
Tag,
|
||||
{ color: row.isValueNeedConvert ? 'blue' : 'default' },
|
||||
() => (row.isValueNeedConvert ? '是' : '否'),
|
||||
)
|
||||
" />
|
||||
</template>
|
||||
|
||||
<template #action="{ row }">
|
||||
<TableAction :actions="[
|
||||
{
|
||||
label: $t('common.edit'),
|
||||
type: 'link',
|
||||
size: 'small',
|
||||
auth: ['AbpIdentity.Users.Update'],
|
||||
onClick: onEdit.bind(null, row),
|
||||
},
|
||||
{
|
||||
label: $t('common.delete'),
|
||||
icon: 'ant-design:delete-outlined',
|
||||
type: 'link',
|
||||
size: 'small',
|
||||
auth: ['AbpIdentity.Users.Delete'],
|
||||
popConfirm: {
|
||||
title: $t('common.askConfirmDelete'),
|
||||
confirm: onDel.bind(null, row),
|
||||
},
|
||||
},
|
||||
]" />
|
||||
</template>
|
||||
</Grid>
|
||||
</div>
|
||||
<ThingModelModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
|
||||
<component :is="editRow.id ? EditForm : AddForm" />
|
||||
</ThingModelModal>
|
||||
|
||||
<!-- 复制已有模型模态框 -->
|
||||
<CopyModal title="复制已有模型" class="w-[600px]">
|
||||
<CopyForm />
|
||||
</CopyModal>
|
||||
</Modal>
|
||||
</template>
|
||||
@ -0,0 +1,416 @@
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { z } from '@vben/common-ui';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
getCommonGetSelectList,
|
||||
postOneNetProductListAsync,
|
||||
} from '#/api-client';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
export const querySchema = computed(() => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'SearchKeyWords',
|
||||
label: $t('common.SearchKeyWords'),
|
||||
},
|
||||
]);
|
||||
|
||||
export const tableSchema = computed(() => [
|
||||
{
|
||||
field: 'filedType',
|
||||
title: $t('abp.thingModelInfos.FiledType'),
|
||||
minWidth: 120,
|
||||
showOverflow: 'tooltip',
|
||||
formatter: ({ cellValue }: { cellValue: any }) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
Property: '属性',
|
||||
Service: '服务',
|
||||
Event: '事件',
|
||||
};
|
||||
return typeMap[cellValue] || cellValue;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'ioTPlatformRawFieldName',
|
||||
title: $t('abp.thingModelInfos.IoTPlatformRawFieldName'),
|
||||
minWidth: 150,
|
||||
showOverflow: 'tooltip',
|
||||
},
|
||||
{
|
||||
field: 'standardFieldName',
|
||||
title: $t('abp.thingModelInfos.StandardFieldName'),
|
||||
minWidth: 150,
|
||||
showOverflow: 'tooltip',
|
||||
},
|
||||
{
|
||||
field: 'standardFieldDisplayName',
|
||||
title: $t('abp.thingModelInfos.StandardFieldDisplayName'),
|
||||
minWidth: 150,
|
||||
showOverflow: 'tooltip',
|
||||
},
|
||||
{
|
||||
field: 'standardFieldValueType',
|
||||
title: $t('abp.thingModelInfos.StandardFieldValueType'),
|
||||
minWidth: 120,
|
||||
showOverflow: 'tooltip',
|
||||
formatter: ({ cellValue }: { cellValue: any }) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
String: '字符串',
|
||||
Int32: '整数',
|
||||
Int64: '长整数',
|
||||
Float: '浮点数',
|
||||
Double: '双精度',
|
||||
Boolean: '布尔值',
|
||||
DateTime: '日期时间',
|
||||
Object: 'JSON对象',
|
||||
Array: '数组',
|
||||
};
|
||||
return typeMap[cellValue] || cellValue;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'isValueNeedConvert',
|
||||
title: $t('abp.thingModelInfos.IsValueNeedConvert'),
|
||||
minWidth: 120,
|
||||
slots: { default: 'isValueNeedConvert' },
|
||||
},
|
||||
{
|
||||
field: 'creationTime',
|
||||
title: $t('common.creationTime'),
|
||||
minWidth: 180,
|
||||
formatter: ({ cellValue }: { cellValue: any }) => {
|
||||
return cellValue ? dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') : '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
title: $t('common.action'),
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
},
|
||||
]);
|
||||
|
||||
// 添加物模型表单schema
|
||||
export const addThingModelFormSchema = computed(() => [
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'filedType',
|
||||
label: $t('abp.thingModelInfos.FiledType'),
|
||||
rules: z.preprocess(
|
||||
(v) => (v == null ? '' : v),
|
||||
z.string().min(1, $t('common.required')),
|
||||
),
|
||||
componentProps: {
|
||||
api: getCommonGetSelectList,
|
||||
params: {
|
||||
query: {
|
||||
typeName: 'DataDictionaryTypeConst',
|
||||
},
|
||||
},
|
||||
labelField: 'value',
|
||||
valueField: 'key',
|
||||
optionsPropName: 'options',
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
placeholder:
|
||||
$t('common.pleaseSelect') + $t('abp.thingModelInfos.FiledType'),
|
||||
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 [];
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'ioTPlatformRawFieldName',
|
||||
label: $t('abp.thingModelInfos.IoTPlatformRawFieldName'),
|
||||
rules: z.preprocess(
|
||||
(v) => (v == null ? '' : v),
|
||||
z.string().min(1, $t('common.required')),
|
||||
),
|
||||
componentProps: {
|
||||
placeholder:
|
||||
$t('common.pleaseInput') +
|
||||
$t('abp.thingModelInfos.IoTPlatformRawFieldName'),
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'StandardThingModelCodeSelect',
|
||||
fieldName: 'standardFieldDisplayName',
|
||||
label: $t('abp.thingModelInfos.StandardFieldDisplayName'),
|
||||
rules: z.preprocess(
|
||||
(v) => (v == null ? '' : v),
|
||||
z.string().min(1, $t('common.required')),
|
||||
),
|
||||
componentProps: (formValues: any) => ({
|
||||
// 传入联动的类型编码(运行时具体值)
|
||||
typeCode: formValues?.filedType ?? null,
|
||||
onResolve: (item: any | null) => {
|
||||
// 选择后自动回填:名称=displayText,值类型=extendedAttribute(转大写)
|
||||
formValues.standardFieldDisplayName = item?.displayText ?? '';
|
||||
formValues.standardFieldName = item?.code ?? '';
|
||||
formValues.standardFieldValueType = (item?.extendedAttribute ?? '')
|
||||
.toString()
|
||||
.toUpperCase();
|
||||
},
|
||||
placeholder:
|
||||
$t('common.pleaseSelect') + $t('abp.thingModelInfos.StandardFieldName'),
|
||||
}),
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'standardFieldName',
|
||||
label: $t('abp.thingModelInfos.StandardFieldName'),
|
||||
rules: z.preprocess(
|
||||
(v) => (v == null ? '' : v),
|
||||
z.string().min(1, $t('common.required')),
|
||||
),
|
||||
componentProps: {
|
||||
placeholder:
|
||||
$t('common.pleaseInput') +
|
||||
$t('abp.thingModelInfos.StandardFieldDisplayName'),
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'standardFieldValueType',
|
||||
label: $t('abp.thingModelInfos.StandardFieldValueType'),
|
||||
rules: z.preprocess(
|
||||
(v) => (v == null ? '' : v),
|
||||
z.string().min(1, $t('common.required')),
|
||||
),
|
||||
componentProps: {
|
||||
api: getCommonGetSelectList,
|
||||
params: {
|
||||
query: {
|
||||
typeName: 'StandardThingModelDataTypeEnum',
|
||||
},
|
||||
},
|
||||
labelField: 'value',
|
||||
valueField: 'secondValue',
|
||||
optionsPropName: 'options',
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
placeholder:
|
||||
$t('common.pleaseSelect') +
|
||||
$t('abp.thingModelInfos.StandardFieldValueType'),
|
||||
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 [];
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Switch',
|
||||
fieldName: 'isValueNeedConvert',
|
||||
label: $t('abp.thingModelInfos.IsValueNeedConvert'),
|
||||
defaultValue: false,
|
||||
componentProps: {
|
||||
style: { width: 'auto' },
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
// 编辑物模型表单schema
|
||||
export const editThingModelFormSchema = computed(() => [
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'filedType',
|
||||
label: $t('abp.thingModelInfos.FiledType'),
|
||||
rules: z.preprocess(
|
||||
(v) => (v == null ? '' : v),
|
||||
z.string().min(1, $t('common.required')),
|
||||
),
|
||||
componentProps: {
|
||||
api: getCommonGetSelectList,
|
||||
params: {
|
||||
query: {
|
||||
typeName: 'DataDictionaryTypeConst',
|
||||
},
|
||||
},
|
||||
labelField: 'value',
|
||||
valueField: 'key',
|
||||
optionsPropName: 'options',
|
||||
immediate: true,
|
||||
disabled: true, // 编辑时禁用
|
||||
placeholder:
|
||||
$t('common.pleaseSelect') + $t('abp.thingModelInfos.FiledType'),
|
||||
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 [];
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'ioTPlatformRawFieldName',
|
||||
label: $t('abp.thingModelInfos.IoTPlatformRawFieldName'),
|
||||
rules: z.preprocess(
|
||||
(v) => (v == null ? '' : v),
|
||||
z.string().min(1, $t('common.required')),
|
||||
),
|
||||
componentProps: {
|
||||
// disabled: true, // 编辑时禁用
|
||||
placeholder:
|
||||
$t('common.pleaseInput') +
|
||||
$t('abp.thingModelInfos.IoTPlatformRawFieldName'),
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'StandardThingModelCodeSelect',
|
||||
fieldName: 'standardFieldDisplayName',
|
||||
label: $t('abp.thingModelInfos.StandardFieldDisplayName'),
|
||||
rules: z.preprocess(
|
||||
(v) => (v == null ? '' : v),
|
||||
z.string().min(1, $t('common.required')),
|
||||
),
|
||||
componentProps: (formValues: any) => ({
|
||||
typeCode: formValues?.filedType ?? null,
|
||||
disabled: true, // 编辑时禁用
|
||||
onResolve: (item: any | null) => {
|
||||
formValues.standardFieldDisplayName = item?.displayText ?? '';
|
||||
formValues.standardFieldValueType = (item?.extendedAttribute ?? '')
|
||||
.toString()
|
||||
.toUpperCase();
|
||||
},
|
||||
placeholder:
|
||||
$t('common.pleaseInput') +
|
||||
$t('abp.thingModelInfos.StandardFieldDisplayName'),
|
||||
}),
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'standardFieldName',
|
||||
label: $t('abp.thingModelInfos.StandardFieldName'),
|
||||
rules: z.string().min(1, $t('common.required')),
|
||||
componentProps: {
|
||||
disabled: true, // 编辑时禁用
|
||||
placeholder:
|
||||
$t('common.pleaseSelect') + $t('abp.thingModelInfos.StandardFieldName'),
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'standardFieldValueType',
|
||||
label: $t('abp.thingModelInfos.StandardFieldValueType'),
|
||||
rules: z.preprocess(
|
||||
(v) => (v == null ? '' : v),
|
||||
z.string().min(1, $t('common.required')),
|
||||
),
|
||||
componentProps: {
|
||||
api: getCommonGetSelectList,
|
||||
params: {
|
||||
query: {
|
||||
typeName: 'StandardThingModelDataTypeEnum',
|
||||
},
|
||||
},
|
||||
optionsPropName: 'options',
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
disabled: true, // 编辑时禁用
|
||||
placeholder:
|
||||
$t('common.pleaseSelect') +
|
||||
$t('abp.thingModelInfos.StandardFieldValueType'),
|
||||
afterFetch: (res: any) => {
|
||||
let items = [];
|
||||
if (Array.isArray(res)) {
|
||||
items = res;
|
||||
} else if (res && Array.isArray(res.items)) {
|
||||
items = res.items;
|
||||
} else if (res && Array.isArray(res.data)) {
|
||||
items = res.data;
|
||||
}
|
||||
// 转换选项值以匹配列表中的小写值
|
||||
return items.map((item: any) => ({
|
||||
...item,
|
||||
// 使用secondValue的小写版本作为value,保持label为原始value
|
||||
value: item.secondValue || item.value,
|
||||
label: item.value, // 显示文本
|
||||
}));
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Switch',
|
||||
fieldName: 'isValueNeedConvert',
|
||||
label: $t('abp.thingModelInfos.IsValueNeedConvert'),
|
||||
componentProps: {
|
||||
style: { width: 'auto' },
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
// 复制已有模型表单schema
|
||||
export const copyThingModelFormSchema = computed(() => [
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'ioTPlatformProductId',
|
||||
label: '选择要复制的产品',
|
||||
rules: z.preprocess(
|
||||
(v) => (v == null ? '' : v),
|
||||
z.string().min(1, '请选择要复制的产品'),
|
||||
),
|
||||
componentProps: {
|
||||
api: postOneNetProductListAsync,
|
||||
params: {
|
||||
query: {
|
||||
pageIndex: 1,
|
||||
pageSize: 1000,
|
||||
},
|
||||
},
|
||||
labelField: 'productName',
|
||||
valueField: 'ioTPlatformProductId',
|
||||
optionsPropName: 'options',
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
placeholder: '请选择产品',
|
||||
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;
|
||||
}
|
||||
if (res && Array.isArray(res.data.items)) {
|
||||
return res.data.items;
|
||||
}
|
||||
return [];
|
||||
},
|
||||
},
|
||||
},
|
||||
]);
|
||||
Loading…
x
Reference in New Issue
Block a user