修改产品物模型管理按钮,更新nswag接口信息
This commit is contained in:
parent
28479396f9
commit
fdc07134a8
12
.vscode/settings.json
vendored
12
.vscode/settings.json
vendored
@ -237,5 +237,15 @@
|
||||
"nolebase",
|
||||
"rollup",
|
||||
"vitest"
|
||||
]
|
||||
],
|
||||
"editor.gotoLocation.alternativeDeclarationCommand": "editor.action.revealDefinition",
|
||||
"editor.gotoLocation.alternativeDefinitionCommand": "editor.action.revealDefinition",
|
||||
"editor.gotoLocation.alternativeTypeDefinitionCommand": "editor.action.revealDefinition",
|
||||
"editor.selectionHighlight": false,
|
||||
"files.autoSave": "onFocusChange",
|
||||
"editor.quickSuggestions": {
|
||||
"other": "on",
|
||||
"comments": "off",
|
||||
"strings": "on"
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -172,6 +172,38 @@ export type BatchCreateDeviceAggregationInput = {
|
||||
deviceSourceTypeEnum?: DeviceSourceTypeEnum;
|
||||
};
|
||||
|
||||
/**
|
||||
* 构建物模型脚本输入
|
||||
*/
|
||||
export type BuildAnalysisScriptInput = {
|
||||
/**
|
||||
* 物模型数据Id
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* 脚本函数名称
|
||||
*/
|
||||
scriptName?: (string) | null;
|
||||
/**
|
||||
* 脚本函数体
|
||||
*/
|
||||
functionScript?: (string) | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* 构建物模型脚本输出
|
||||
*/
|
||||
export type BuildAnalysisScriptOutput = {
|
||||
/**
|
||||
* 函数名称
|
||||
*/
|
||||
functionName?: (string) | null;
|
||||
/**
|
||||
* 函数代码
|
||||
*/
|
||||
functionCode?: (string) | null;
|
||||
};
|
||||
|
||||
export type ChangePasswordInput = {
|
||||
currentPassword?: (string) | null;
|
||||
newPassword: string;
|
||||
@ -200,6 +232,21 @@ export type ControllerInterfaceApiDescriptionModel = {
|
||||
methods?: Array<InterfaceMethodApiDescriptionModel> | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* 复制已存在设备物模型信息
|
||||
*/
|
||||
export type CopyAnotherDeviceInput = {
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 当前设备端物模型数据Id
|
||||
*/
|
||||
deviceThingModelId?: string;
|
||||
/**
|
||||
* 源设备模型数据ID
|
||||
*/
|
||||
sourceProductId?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* 复制已存在产品设备物模型信息
|
||||
*/
|
||||
@ -983,13 +1030,13 @@ export type DeleteTextTemplateInput = {
|
||||
* 设备命令
|
||||
*/
|
||||
export type DeviceCommandForApiInput = {
|
||||
id?: string;
|
||||
id: string;
|
||||
/**
|
||||
* 设备在物联网平台中发送的命令内容,JSON格式
|
||||
* 设备在物联网平台中属性设置的参数键值对
|
||||
*/
|
||||
commandContent: string;
|
||||
deviceType?: DeviceTypeEnum;
|
||||
telemetryType?: DeviceTelemetryCommandTypeEnum;
|
||||
commandContent: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
};
|
||||
|
||||
export type DeviceManagementInfoDto = {
|
||||
@ -1095,10 +1142,14 @@ export type DeviceManagementInfoDto = {
|
||||
* 设备类型,与业务系统无关
|
||||
*/
|
||||
readonly deviceTypeName?: (string) | null;
|
||||
/**
|
||||
* 是否需要配置设备模型,默认false
|
||||
*/
|
||||
isNeedConfigDevicMdoel?: boolean;
|
||||
/**
|
||||
* 设备物模型数据Id
|
||||
*/
|
||||
deviceThingModelDataId?: string;
|
||||
deviceThingModelDataId?: (string) | null;
|
||||
};
|
||||
|
||||
export type DeviceManagementInfoDtoPagedResultDto = {
|
||||
@ -1208,9 +1259,545 @@ export type DeviceTableModelDataInfoPageOutputPagedResultDto = {
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备数据包命令类型枚举
|
||||
* 设备物模型指令详情创建输入
|
||||
*/
|
||||
export type DeviceTelemetryCommandTypeEnum = 1 | 2;
|
||||
export type DeviceThingModelCommandInfoCreateInput = {
|
||||
/**
|
||||
* 设备端物模型Id
|
||||
*/
|
||||
deviceThingModelId: string;
|
||||
/**
|
||||
* 指令名称
|
||||
*/
|
||||
commandName: string;
|
||||
/**
|
||||
* 完整的单个下发指令
|
||||
*/
|
||||
issueCommand: string;
|
||||
/**
|
||||
* 指令设备端物模型的属性名称集合,JSON格式字符串数组,一个指令的返回报文包含多个属性标识的数据
|
||||
*/
|
||||
propertyArray: Array<(string)>;
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备端透传指令详情,如果透抄的地址不连续,则会有多个指令记录
|
||||
*/
|
||||
export type DeviceThingModelCommandInfoDto = {
|
||||
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;
|
||||
/**
|
||||
* 设备端物模型Id
|
||||
*/
|
||||
deviceThingModelId?: string;
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 指令名称
|
||||
*/
|
||||
commandName?: (string) | null;
|
||||
/**
|
||||
* 完整的单个下发指令
|
||||
*/
|
||||
issueCommand?: (string) | null;
|
||||
/**
|
||||
* 指令设备端物模型的属性名称集合,JSON格式字符串数组,一个指令的返回报文包含多个属性标识的数据
|
||||
*/
|
||||
propertyArray?: Array<(string)> | null;
|
||||
};
|
||||
|
||||
export type DeviceThingModelCommandInfoDtoPagedResultDto = {
|
||||
items?: Array<DeviceThingModelCommandInfoDto> | null;
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备物模型指令详情分页
|
||||
*/
|
||||
export type DeviceThingModelCommandInfoPageInput = {
|
||||
/**
|
||||
* 当前页面.默认从1开始
|
||||
*/
|
||||
pageIndex?: number;
|
||||
/**
|
||||
* 每页多少条.每页显示多少记录
|
||||
*/
|
||||
pageSize?: number;
|
||||
/**
|
||||
* 跳过多少条
|
||||
*/
|
||||
readonly skipCount?: number;
|
||||
/**
|
||||
* 排序
|
||||
* <example>
|
||||
* name desc
|
||||
* </example>
|
||||
*/
|
||||
sorting?: (string) | null;
|
||||
/**
|
||||
* 设备端物模型Id
|
||||
*/
|
||||
deviceThingModelId: string;
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 搜索关键字
|
||||
*/
|
||||
searchKeyWords?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 是否分页
|
||||
*/
|
||||
isPage?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备物模型指令详情更新输入
|
||||
*/
|
||||
export type DeviceThingModelCommandInfoUpdateInput = {
|
||||
/**
|
||||
* 设备端物模型Id
|
||||
*/
|
||||
deviceThingModelId: string;
|
||||
/**
|
||||
* 指令名称
|
||||
*/
|
||||
commandName: string;
|
||||
/**
|
||||
* 完整的单个下发指令
|
||||
*/
|
||||
issueCommand: string;
|
||||
/**
|
||||
* 指令设备端物模型的属性名称集合,JSON格式字符串数组,一个指令的返回报文包含多个属性标识的数据
|
||||
*/
|
||||
propertyArray: Array<(string)>;
|
||||
id: string;
|
||||
};
|
||||
|
||||
export type DeviceThingModelCreateInput = {
|
||||
/**
|
||||
* 设备端物模型名称
|
||||
*/
|
||||
deviceModelName?: (string) | null;
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 脚本函数名称
|
||||
*/
|
||||
scriptName?: (string) | null;
|
||||
/**
|
||||
* 脚本函数体
|
||||
*/
|
||||
functionScript?: (string) | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备端物模型管理
|
||||
*/
|
||||
export type DeviceThingModelManagementDto = {
|
||||
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;
|
||||
/**
|
||||
* 设备端物模型名称
|
||||
*/
|
||||
deviceModelName?: (string) | null;
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 脚本函数名称
|
||||
*/
|
||||
scriptName?: (string) | null;
|
||||
/**
|
||||
* 脚本函数体
|
||||
*/
|
||||
functionScript?: (string) | null;
|
||||
parsingSequence?: ParsingSequenceTypeEnum;
|
||||
/**
|
||||
* 函数解析标记,默认为false, 不能解析
|
||||
*/
|
||||
functionAnalysisFlag?: boolean;
|
||||
/**
|
||||
* 属性信息
|
||||
*/
|
||||
propertyInfos?: Array<DeviceThingModelPropertyInfoDto> | null;
|
||||
/**
|
||||
* 指令信息
|
||||
*/
|
||||
commandInfos?: Array<DeviceThingModelCommandInfoDto> | null;
|
||||
};
|
||||
|
||||
export type DeviceThingModelManagementDtoPagedResultDto = {
|
||||
items?: Array<DeviceThingModelManagementDto> | null;
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
export type DeviceThingModelPageInput = {
|
||||
/**
|
||||
* 当前页面.默认从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;
|
||||
/**
|
||||
* 是否分页
|
||||
*/
|
||||
isPage?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备物模型属性创建输入
|
||||
*/
|
||||
export type DeviceThingModelPropertyCreateInput = {
|
||||
/**
|
||||
* 设备端物模型Id
|
||||
*/
|
||||
deviceThingModelId: string;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||
*/
|
||||
ioTPlatformRawFieldName: string;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件数据类型,JiShe.ServicePro.Core.OneNETAllThingModel
|
||||
*/
|
||||
ioTPlatformRawFieldDataType: string;
|
||||
/**
|
||||
* 管理后台产品标准的物模型属性或者事件名称
|
||||
*/
|
||||
standardFieldName: string;
|
||||
/**
|
||||
* 标准物模型字段值类型
|
||||
*/
|
||||
standardFieldValueType: string;
|
||||
/**
|
||||
* 标准物模型字段显示名称
|
||||
*/
|
||||
standardFieldDisplayName: string;
|
||||
/**
|
||||
* 是否需要值类型转换
|
||||
*/
|
||||
isValueNeedConvert?: boolean;
|
||||
/**
|
||||
* 跳过数量
|
||||
*/
|
||||
skipNumber?: number;
|
||||
/**
|
||||
* 获取数量
|
||||
*/
|
||||
takeNumber?: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备端物模型属性信息,是指设备端支持的属性或者事件
|
||||
*/
|
||||
export type DeviceThingModelPropertyInfoDto = {
|
||||
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;
|
||||
/**
|
||||
* 设备端物模型Id
|
||||
*/
|
||||
deviceThingModelId?: string;
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||
*/
|
||||
ioTPlatformRawFieldName?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件数据类型,JiShe.ServicePro.Core.OneNETAllThingModel
|
||||
*/
|
||||
ioTPlatformRawFieldDataType?: (string) | null;
|
||||
/**
|
||||
* 管理后台产品标准的物模型属性或者事件名称
|
||||
*/
|
||||
standardFieldName?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段值类型
|
||||
*/
|
||||
standardFieldValueType?: (string) | null;
|
||||
/**
|
||||
* 标准物模型字段显示名称
|
||||
*/
|
||||
standardFieldDisplayName?: (string) | null;
|
||||
/**
|
||||
* 是否需要值类型转换
|
||||
*/
|
||||
isValueNeedConvert?: boolean;
|
||||
/**
|
||||
* 跳过数量
|
||||
*/
|
||||
skipNumber?: number;
|
||||
/**
|
||||
* 获取数量
|
||||
*/
|
||||
takeNumber?: number;
|
||||
};
|
||||
|
||||
export type DeviceThingModelPropertyInfoDtoPagedResultDto = {
|
||||
items?: Array<DeviceThingModelPropertyInfoDto> | null;
|
||||
totalCount?: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备物模型属性分页
|
||||
*/
|
||||
export type DeviceThingModelPropertyPageInput = {
|
||||
/**
|
||||
* 当前页面.默认从1开始
|
||||
*/
|
||||
pageIndex?: number;
|
||||
/**
|
||||
* 每页多少条.每页显示多少记录
|
||||
*/
|
||||
pageSize?: number;
|
||||
/**
|
||||
* 跳过多少条
|
||||
*/
|
||||
readonly skipCount?: number;
|
||||
/**
|
||||
* 排序
|
||||
* <example>
|
||||
* name desc
|
||||
* </example>
|
||||
*/
|
||||
sorting?: (string) | null;
|
||||
/**
|
||||
* 设备端物模型Id
|
||||
*/
|
||||
deviceThingModelId: string;
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 搜索关键字
|
||||
*/
|
||||
searchKeyWords?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 是否分页
|
||||
*/
|
||||
isPage?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备物模型属性更新输入
|
||||
*/
|
||||
export type DeviceThingModelPropertyUpdateInput = {
|
||||
/**
|
||||
* 设备端物模型Id
|
||||
*/
|
||||
deviceThingModelId: string;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
||||
*/
|
||||
filedType?: (string) | null;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||
*/
|
||||
ioTPlatformRawFieldName: string;
|
||||
/**
|
||||
* 物联网平台中对应的产品物模型属性或者事件数据类型,JiShe.ServicePro.Core.OneNETAllThingModel
|
||||
*/
|
||||
ioTPlatformRawFieldDataType: string;
|
||||
/**
|
||||
* 管理后台产品标准的物模型属性或者事件名称
|
||||
*/
|
||||
standardFieldName: string;
|
||||
/**
|
||||
* 标准物模型字段值类型
|
||||
*/
|
||||
standardFieldValueType: string;
|
||||
/**
|
||||
* 标准物模型字段显示名称
|
||||
*/
|
||||
standardFieldDisplayName: string;
|
||||
/**
|
||||
* 是否需要值类型转换
|
||||
*/
|
||||
isValueNeedConvert?: boolean;
|
||||
/**
|
||||
* 跳过数量
|
||||
*/
|
||||
skipNumber?: number;
|
||||
/**
|
||||
* 获取数量
|
||||
*/
|
||||
takeNumber?: number;
|
||||
id: string;
|
||||
};
|
||||
|
||||
export type DeviceThingModelUpdateInput = {
|
||||
/**
|
||||
* 设备端物模型名称
|
||||
*/
|
||||
deviceModelName?: (string) | null;
|
||||
ioTPlatform?: IoTPlatformTypeEnum;
|
||||
/**
|
||||
* 物联网平台中对应的产品Id
|
||||
*/
|
||||
ioTPlatformProductId?: (string) | null;
|
||||
/**
|
||||
* 脚本函数名称
|
||||
*/
|
||||
scriptName?: (string) | null;
|
||||
/**
|
||||
* 脚本函数体
|
||||
*/
|
||||
functionScript?: (string) | null;
|
||||
id?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* 设备树模型数据信息查询入参
|
||||
@ -1958,7 +2545,7 @@ export type IdentityUserUpdateDto = {
|
||||
};
|
||||
|
||||
export type IdInput = {
|
||||
id?: string;
|
||||
id: string;
|
||||
};
|
||||
|
||||
export type InterfaceMethodApiDescriptionModel = {
|
||||
@ -2077,6 +2664,10 @@ export type IoTPlatformThingModelInfoDto = {
|
||||
* 是否是特殊物模型标识符
|
||||
*/
|
||||
isSpecialIdentifier?: boolean;
|
||||
/**
|
||||
* 物联网平台中对应产品物模型标识符扩展,用于扩展结构体类型
|
||||
*/
|
||||
ioTPlatformRawFieldExtension?: (string) | null;
|
||||
};
|
||||
|
||||
export type IoTPlatformThingModelInfoDtoPagedResultDto = {
|
||||
@ -2251,6 +2842,26 @@ export type LoginResultType = 1 | 2 | 3 | 4 | 5;
|
||||
*/
|
||||
export type MenuType = 10 | 20;
|
||||
|
||||
/**
|
||||
* 测试消息解析
|
||||
*/
|
||||
export type MessageAnalysisTestInput = {
|
||||
/**
|
||||
* 函数名称
|
||||
*/
|
||||
functionName?: (string) | null;
|
||||
/**
|
||||
* 函数代码
|
||||
*/
|
||||
functionCode?: (string) | null;
|
||||
/**
|
||||
* 函数参数
|
||||
*/
|
||||
parameters?: {
|
||||
[key: string]: unknown;
|
||||
} | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* 消息等级
|
||||
*/
|
||||
@ -2772,7 +3383,7 @@ export type OneNETProductInfoDto = {
|
||||
*/
|
||||
communicationAddressTLS?: (string) | null;
|
||||
/**
|
||||
* 物模型信息
|
||||
* 平台物模型信息
|
||||
*/
|
||||
thingModelInfos?: (string) | null;
|
||||
};
|
||||
@ -3436,6 +4047,9 @@ export type PagingAuditLogInput = {
|
||||
readonly skipCount?: number;
|
||||
/**
|
||||
* 排序
|
||||
* <example>
|
||||
* name desc
|
||||
* </example>
|
||||
*/
|
||||
sorting?: (string) | null;
|
||||
/**
|
||||
@ -4015,6 +4629,11 @@ export type ParameterApiDescriptionModel = {
|
||||
descriptorName?: (string) | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* 解析顺序枚举
|
||||
*/
|
||||
export type ParsingSequenceTypeEnum = 1 | 2;
|
||||
|
||||
export type PermissionOutput = {
|
||||
grants?: Array<(string)> | null;
|
||||
allGrants?: Array<(string)> | null;
|
||||
@ -4571,7 +5190,7 @@ export type SettingOutput = {
|
||||
};
|
||||
|
||||
export type StringIdInput = {
|
||||
id?: (string) | null;
|
||||
id: string;
|
||||
};
|
||||
|
||||
export type StringStringFromSelector = {
|
||||
@ -5254,6 +5873,242 @@ export type PostDeviceInfoCacheDeviceDataToRedisResponse = (boolean);
|
||||
|
||||
export type PostDeviceInfoCacheDeviceDataToRedisError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementCreateAsyncData = {
|
||||
query?: {
|
||||
input?: DeviceThingModelCreateInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementCreateAsyncResponse = (DeviceThingModelManagementDto);
|
||||
|
||||
export type PostDeviceThingModelManagementCreateAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementUpdateAsyncData = {
|
||||
query?: {
|
||||
input?: DeviceThingModelUpdateInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementUpdateAsyncResponse = (DeviceThingModelManagementDto);
|
||||
|
||||
export type PostDeviceThingModelManagementUpdateAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementDeleteAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementDeleteAsyncResponse = (boolean);
|
||||
|
||||
export type PostDeviceThingModelManagementDeleteAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementFindByIdAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementFindByIdAsyncResponse = (DeviceThingModelManagementDto);
|
||||
|
||||
export type PostDeviceThingModelManagementFindByIdAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementGetDeviceThingModelAllInfoByIdAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementGetDeviceThingModelAllInfoByIdAsyncResponse = (DeviceThingModelManagementDto);
|
||||
|
||||
export type PostDeviceThingModelManagementGetDeviceThingModelAllInfoByIdAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementBuildAnalysisScriptByIdAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementBuildAnalysisScriptByIdAsyncResponse = (BuildAnalysisScriptOutput);
|
||||
|
||||
export type PostDeviceThingModelManagementBuildAnalysisScriptByIdAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementBuildAnalysisScriptAsyncData = {
|
||||
query?: {
|
||||
input?: BuildAnalysisScriptInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementBuildAnalysisScriptAsyncResponse = (boolean);
|
||||
|
||||
export type PostDeviceThingModelManagementBuildAnalysisScriptAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementUpdateAnalysisScriptByIdAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementUpdateAnalysisScriptByIdAsyncResponse = (boolean);
|
||||
|
||||
export type PostDeviceThingModelManagementUpdateAnalysisScriptByIdAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementMessageAnalysisTestAsyncData = {
|
||||
query?: {
|
||||
input?: MessageAnalysisTestInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementMessageAnalysisTestAsyncResponse = ({
|
||||
[key: string]: unknown;
|
||||
});
|
||||
|
||||
export type PostDeviceThingModelManagementMessageAnalysisTestAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementFindByPlatformProductIdAsyncData = {
|
||||
query?: {
|
||||
input?: StringIdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementFindByPlatformProductIdAsyncResponse = (Array<DeviceThingModelManagementDto>);
|
||||
|
||||
export type PostDeviceThingModelManagementFindByPlatformProductIdAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementCopyAnotherThingModelAsyncData = {
|
||||
query?: {
|
||||
input?: CopyAnotherDeviceInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementCopyAnotherThingModelAsyncResponse = (boolean);
|
||||
|
||||
export type PostDeviceThingModelManagementCopyAnotherThingModelAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementPageAsyncData = {
|
||||
query?: {
|
||||
input?: DeviceThingModelPageInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementPageAsyncResponse = (DeviceThingModelManagementDtoPagedResultDto);
|
||||
|
||||
export type PostDeviceThingModelManagementPageAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyCreateAsyncData = {
|
||||
query?: {
|
||||
input?: DeviceThingModelPropertyCreateInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyCreateAsyncResponse = (DeviceThingModelPropertyInfoDto);
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyCreateAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyUpdateAsyncData = {
|
||||
query?: {
|
||||
input?: DeviceThingModelPropertyUpdateInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyUpdateAsyncResponse = (DeviceThingModelPropertyInfoDto);
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyUpdateAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyDeleteAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyDeleteAsyncResponse = (boolean);
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyDeleteAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyFindByIdAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyFindByIdAsyncResponse = (DeviceThingModelPropertyInfoDto);
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyFindByIdAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyPageAsyncData = {
|
||||
query?: {
|
||||
input?: DeviceThingModelPropertyPageInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyPageAsyncResponse = (DeviceThingModelPropertyInfoDtoPagedResultDto);
|
||||
|
||||
export type PostDeviceThingModelManagementPropertyPageAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementCommandCreateAsyncData = {
|
||||
query?: {
|
||||
input?: DeviceThingModelCommandInfoCreateInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementCommandCreateAsyncResponse = (DeviceThingModelCommandInfoDto);
|
||||
|
||||
export type PostDeviceThingModelManagementCommandCreateAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementCommandUpdateAsyncData = {
|
||||
query?: {
|
||||
input?: DeviceThingModelCommandInfoUpdateInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementCommandUpdateAsyncResponse = (DeviceThingModelCommandInfoDto);
|
||||
|
||||
export type PostDeviceThingModelManagementCommandUpdateAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementCommandDeleteAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementCommandDeleteAsyncResponse = (boolean);
|
||||
|
||||
export type PostDeviceThingModelManagementCommandDeleteAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementCommandFindByIdAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementCommandFindByIdAsyncResponse = (DeviceThingModelCommandInfoDto);
|
||||
|
||||
export type PostDeviceThingModelManagementCommandFindByIdAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementCommandPageAsyncData = {
|
||||
query?: {
|
||||
input?: DeviceThingModelCommandInfoPageInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementCommandPageAsyncResponse = (DeviceThingModelCommandInfoDtoPagedResultDto);
|
||||
|
||||
export type PostDeviceThingModelManagementCommandPageAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementCacheDeviceThingModelToRedisAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostDeviceThingModelManagementCacheDeviceThingModelToRedisAsyncResponse = (boolean);
|
||||
|
||||
export type PostDeviceThingModelManagementCacheDeviceThingModelToRedisAsyncError = unknown;
|
||||
|
||||
export type PostDeviceThingModelManagementCacheAllDeviceThingModelToRedisAsyncResponse = (boolean);
|
||||
|
||||
export type PostDeviceThingModelManagementCacheAllDeviceThingModelToRedisAsyncError = unknown;
|
||||
|
||||
export type PostFeaturesListData = {
|
||||
body?: GetFeatureListResultInput;
|
||||
};
|
||||
@ -5694,6 +6549,16 @@ export type PostOneNetProductProductStatusChangeAsyncResponse = (OneNETProductIn
|
||||
|
||||
export type PostOneNetProductProductStatusChangeAsyncError = unknown;
|
||||
|
||||
export type PostOneNetProductUpdateThingModelAsyncData = {
|
||||
query?: {
|
||||
input?: IdInput;
|
||||
};
|
||||
};
|
||||
|
||||
export type PostOneNetProductUpdateThingModelAsyncResponse = (OneNETProductInfoDto);
|
||||
|
||||
export type PostOneNetProductUpdateThingModelAsyncError = unknown;
|
||||
|
||||
export type PostOneNetProductListAsyncData = {
|
||||
query?: {
|
||||
input?: OneNetProductInfoListInput;
|
||||
|
||||
@ -23,8 +23,6 @@ import {
|
||||
import { TableAction } from '#/components/table-action';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import ThingModelInfoModal from '#/views/thingmodelinfo/ioTPlatformThingModelInfo/index.vue';
|
||||
|
||||
import {
|
||||
addProductFormSchema,
|
||||
editProductFormSchemaEdit,
|
||||
@ -78,10 +76,6 @@ const editRow: Record<string, any> = ref({});
|
||||
// 声明文件变量,用于存储选择的文件
|
||||
let selectedFile: File | null = null;
|
||||
|
||||
// 物模型模态框相关状态
|
||||
const thingModelModalVisible = ref(false);
|
||||
const currentProductInfo = ref<any>({});
|
||||
|
||||
// 设置文件选择回调
|
||||
setFileSelectedCallback((file) => {
|
||||
selectedFile = file;
|
||||
@ -330,22 +324,15 @@ function onDeviceManagement(record: any) {
|
||||
// 物模型管理函数
|
||||
function onThingModelManagement(record: any) {
|
||||
console.log('物模型管理按钮被点击', record);
|
||||
// 设置当前产品信息
|
||||
currentProductInfo.value = {
|
||||
productId: record.ioTPlatformProductId,
|
||||
// 跳转到物模型管理页面,传递平台类型和平台产品ID作为参数
|
||||
router.push({
|
||||
path: '/thingmodelinfo/ioTPlatformThingModelInfo',
|
||||
query: {
|
||||
productId: record.ioTPlatformProductId, // 平台产品ID
|
||||
productName: record.productName,
|
||||
ioTPlatform: '2', // OneNET平台类型为2
|
||||
};
|
||||
console.log('设置产品信息:', currentProductInfo.value);
|
||||
// 打开物模型模态框
|
||||
thingModelModalVisible.value = true;
|
||||
console.log('模态框状态设置为:', thingModelModalVisible.value);
|
||||
}
|
||||
|
||||
// 关闭物模型模态框
|
||||
function closeThingModelModal() {
|
||||
thingModelModalVisible.value = false;
|
||||
currentProductInfo.value = {};
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -428,14 +415,5 @@ function closeThingModelModal() {
|
||||
<UserModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
|
||||
<component :is="editRow.id ? EditForm : AddForm" />
|
||||
</UserModal>
|
||||
|
||||
<!-- 物模型信息模态框 -->
|
||||
<ThingModelInfoModal
|
||||
v-model:visible="thingModelModalVisible"
|
||||
:product-id="currentProductInfo.productId"
|
||||
:product-name="currentProductInfo.productName"
|
||||
:io-t-platform="currentProductInfo.ioTPlatform"
|
||||
@close="closeThingModelModal"
|
||||
/>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
@ -2,11 +2,12 @@
|
||||
import type { VbenFormProps } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
import { h, nextTick, ref, watch } from 'vue';
|
||||
import { h, nextTick, onMounted, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message as Message, Modal, Tag } from 'ant-design-vue';
|
||||
import { message as Message, Tag } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
@ -30,29 +31,15 @@ import {
|
||||
} from './schema';
|
||||
|
||||
defineOptions({
|
||||
name: 'ThingModelInfoModal',
|
||||
name: 'IoTPlatformThingModelInfo',
|
||||
});
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
visible: false,
|
||||
productId: '',
|
||||
productName: '',
|
||||
ioTPlatform: '2',
|
||||
});
|
||||
const route = useRoute();
|
||||
|
||||
// 定义emits
|
||||
const emit = defineEmits<{
|
||||
close: [];
|
||||
'update:visible': [value: boolean];
|
||||
}>();
|
||||
|
||||
// 定义props
|
||||
interface Props {
|
||||
visible?: boolean;
|
||||
productId?: string;
|
||||
productName?: string;
|
||||
ioTPlatform?: string;
|
||||
}
|
||||
// 从路由参数获取产品信息
|
||||
const productId = ref<string>((route.query.productId as string) || '');
|
||||
const productName = ref<string>((route.query.productName as string) || '');
|
||||
const ioTPlatform = ref<string>((route.query.ioTPlatform as string) || '2');
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
schema: querySchema.value,
|
||||
@ -76,20 +63,38 @@ const gridOptions: VxeGridProps<any> = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
// 如果没有产品ID,直接返回空数据,让表格正常显示空白状态
|
||||
if (!productId.value) {
|
||||
hasData.value = false;
|
||||
return {
|
||||
items: [],
|
||||
totalCount: 0,
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const { data } = await postIoTplatformThingModelInfoPageAsync({
|
||||
query: {
|
||||
input: {
|
||||
pageIndex: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
ioTPlatform: Number.parseInt(props.ioTPlatform) as 1 | 2,
|
||||
ioTPlatformProductId: props.productId,
|
||||
ioTPlatform: Number.parseInt(ioTPlatform.value) as 1 | 2,
|
||||
ioTPlatformProductId: productId.value,
|
||||
...(formValues?.SearchKeyWords && { searchKeyWords: formValues.SearchKeyWords }),
|
||||
},
|
||||
},
|
||||
});
|
||||
// 更新数据状态,检查是否有数据
|
||||
hasData.value = data?.items && data.items.length > 0;
|
||||
return data;
|
||||
return data || { items: [], totalCount: 0 };
|
||||
} catch (error) {
|
||||
console.error('查询物模型信息失败:', error);
|
||||
hasData.value = false;
|
||||
return {
|
||||
items: [],
|
||||
totalCount: 0,
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -183,41 +188,69 @@ const [CopyForm, copyFormApi] = useVbenForm({
|
||||
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) {
|
||||
() => [route.query.productId, route.query.ioTPlatform],
|
||||
async ([newProductId, newIoTPlatform]) => {
|
||||
if (newProductId) {
|
||||
productId.value = newProductId as string;
|
||||
}
|
||||
if (newIoTPlatform) {
|
||||
ioTPlatform.value = newIoTPlatform as string;
|
||||
}
|
||||
if (route.query.productName) {
|
||||
productName.value = route.query.productName as string;
|
||||
}
|
||||
|
||||
// 延迟执行,确保组件完全初始化
|
||||
if (gridApi) {
|
||||
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);
|
||||
console.error('加载数据时出错:', error);
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
{ immediate: false },
|
||||
);
|
||||
|
||||
// 页面初始化时加载数据
|
||||
onMounted(async () => {
|
||||
// 从路由参数初始化
|
||||
if (route.query.productId) {
|
||||
productId.value = route.query.productId as string;
|
||||
}
|
||||
if (route.query.productName) {
|
||||
productName.value = route.query.productName as string;
|
||||
}
|
||||
if (route.query.ioTPlatform) {
|
||||
ioTPlatform.value = route.query.ioTPlatform as string;
|
||||
}
|
||||
|
||||
// 延迟加载数据,确保表格已初始化
|
||||
// 即使没有 productId,也要触发一次查询,让表格显示空白状态
|
||||
await nextTick();
|
||||
setTimeout(async () => {
|
||||
if (gridApi && gridApi.reload) {
|
||||
try {
|
||||
await gridApi.reload();
|
||||
} catch (error) {
|
||||
console.error('初始化加载数据时出错:', error);
|
||||
}
|
||||
}
|
||||
}, 300);
|
||||
});
|
||||
|
||||
// 新增和编辑提交的逻辑
|
||||
async function submit() {
|
||||
// 检查是否有产品ID
|
||||
if (!productId.value) {
|
||||
Message.error('产品ID不存在,无法保存物模型信息');
|
||||
return;
|
||||
}
|
||||
|
||||
const isEdit = !!editRow.value.id;
|
||||
const formApi = isEdit ? editFormApi : addFormApi;
|
||||
const api = isEdit
|
||||
@ -230,8 +263,8 @@ async function submit() {
|
||||
const fetchParams: any = {
|
||||
...formValues,
|
||||
// 自动添加平台和产品信息
|
||||
ioTPlatform: Number.parseInt(props.ioTPlatform) as 1 | 2,
|
||||
ioTPlatformProductId: props.productId,
|
||||
ioTPlatform: Number.parseInt(ioTPlatform.value) as 1 | 2,
|
||||
ioTPlatformProductId: productId.value,
|
||||
// 编辑时需要添加ID
|
||||
...(isEdit && { id: editRow.value.id }),
|
||||
};
|
||||
@ -270,16 +303,22 @@ const openAddModal = async () => {
|
||||
|
||||
// 打开复制已有模型模态框
|
||||
const openCopyAnotherThingModelModal = async () => {
|
||||
console.log('打开复制模态框,当前props:', {
|
||||
productId: props.productId,
|
||||
productName: props.productName,
|
||||
ioTPlatform: props.ioTPlatform,
|
||||
console.log('打开复制模态框,当前参数:', {
|
||||
productId: productId.value,
|
||||
productName: productName.value,
|
||||
ioTPlatform: ioTPlatform.value,
|
||||
});
|
||||
copyModalApi.open();
|
||||
};
|
||||
|
||||
// 复制提交逻辑
|
||||
async function submitCopy() {
|
||||
// 检查是否有产品ID
|
||||
if (!productId.value) {
|
||||
Message.error('产品ID不存在,无法复制物模型信息');
|
||||
return;
|
||||
}
|
||||
|
||||
const { valid } = await copyFormApi.validate();
|
||||
if (!valid) return;
|
||||
|
||||
@ -287,10 +326,10 @@ async function submitCopy() {
|
||||
|
||||
console.log('复制提交参数:', {
|
||||
formValues,
|
||||
props: {
|
||||
productId: props.productId,
|
||||
productName: props.productName,
|
||||
ioTPlatform: props.ioTPlatform,
|
||||
params: {
|
||||
productId: productId.value,
|
||||
productName: productName.value,
|
||||
ioTPlatform: ioTPlatform.value,
|
||||
},
|
||||
});
|
||||
|
||||
@ -298,8 +337,8 @@ async function submitCopy() {
|
||||
const resp = await postIoTplatformThingModelInfoCopyAnotherThingModelAsync({
|
||||
query: {
|
||||
input: {
|
||||
ioTPlatform: Number.parseInt(props.ioTPlatform) as 1 | 2,
|
||||
ioTPlatformProductId: props.productId,
|
||||
ioTPlatform: Number.parseInt(ioTPlatform.value) as 1 | 2,
|
||||
ioTPlatformProductId: productId.value,
|
||||
sourceProductId: formValues.ioTPlatformProductId,
|
||||
},
|
||||
},
|
||||
@ -340,12 +379,18 @@ async function onDel(record: any) {
|
||||
|
||||
// 复制标准模型函数
|
||||
async function copyStandardThingModel() {
|
||||
// 检查是否有产品ID
|
||||
if (!productId.value) {
|
||||
Message.error('产品ID不存在,无法复制标准模型');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const resp = await postIoTplatformThingModelInfoCopyStandardThingModel({
|
||||
query: {
|
||||
input: {
|
||||
ioTPlatform: Number.parseInt(props.ioTPlatform) as 1 | 2,
|
||||
ioTPlatformProductId: props.productId,
|
||||
ioTPlatform: Number.parseInt(ioTPlatform.value) as 1 | 2,
|
||||
ioTPlatformProductId: productId.value,
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -360,20 +405,11 @@ async function copyStandardThingModel() {
|
||||
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">
|
||||
<Page auto-content-height>
|
||||
<Grid>
|
||||
<template #toolbar-actions>
|
||||
<TableAction :actions="[
|
||||
{
|
||||
@ -382,6 +418,7 @@ function closeModal() {
|
||||
icon: 'ant-design:plus-outlined',
|
||||
onClick: openAddModal.bind(null),
|
||||
auth: ['AbpIdentity.Users.Create'],
|
||||
disabled: !productId,
|
||||
},
|
||||
{
|
||||
label: $t('abp.thingModelInfos.copyStandardThingModel'),
|
||||
@ -389,6 +426,7 @@ function closeModal() {
|
||||
icon: 'ant-design:copy-outlined',
|
||||
onClick: copyStandardThingModel,
|
||||
auth: ['AbpIdentity.Users.Create'],
|
||||
disabled: !productId,
|
||||
},
|
||||
{
|
||||
label: $t('abp.thingModelInfos.copyAnotherThingModelModal'),
|
||||
@ -397,6 +435,7 @@ function closeModal() {
|
||||
onClick: openCopyAnotherThingModelModal,
|
||||
auth: ['AbpIdentity.Users.Create'],
|
||||
ifShow: !hasData,
|
||||
disabled: !productId,
|
||||
},
|
||||
]" />
|
||||
</template>
|
||||
@ -433,7 +472,6 @@ function closeModal() {
|
||||
]" />
|
||||
</template>
|
||||
</Grid>
|
||||
</div>
|
||||
<ThingModelModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
|
||||
<component :is="editRow.id ? EditForm : AddForm" />
|
||||
</ThingModelModal>
|
||||
@ -442,5 +480,5 @@ function closeModal() {
|
||||
<CopyModal title="复制已有模型" class="w-[600px]">
|
||||
<CopyForm />
|
||||
</CopyModal>
|
||||
</Modal>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user