Compare commits
No commits in common. "2f10b684430f5d4c0a908c7065a40913a826b9c4" and "2b19953855753c4e7c91eeab89867d2c66dcda41" have entirely different histories.
2f10b68443
...
2b19953855
@ -112,7 +112,6 @@ export type ComponentType =
|
|||||||
| 'DatePicker'
|
| 'DatePicker'
|
||||||
| 'DefaultButton'
|
| 'DefaultButton'
|
||||||
| 'DeviceSelect'
|
| 'DeviceSelect'
|
||||||
| 'StandardThingModelCodeSelect'
|
|
||||||
| 'Divider'
|
| 'Divider'
|
||||||
| 'IconPicker'
|
| 'IconPicker'
|
||||||
| 'Input'
|
| 'Input'
|
||||||
@ -172,11 +171,8 @@ async function initComponentAdapter() {
|
|||||||
DatePicker,
|
DatePicker,
|
||||||
// 自定义设备选择组件
|
// 自定义设备选择组件
|
||||||
DeviceSelect: defineAsyncComponent(
|
DeviceSelect: defineAsyncComponent(
|
||||||
() => import('#/views/iotdbdatamanagement/deviceData/DeviceSelect.vue') as any,
|
() =>
|
||||||
),
|
import('../../views/iotdbdatamanagement/deviceData/DeviceSelect.vue'),
|
||||||
// 自定义标准物模型编码选择组件(分页搜索)
|
|
||||||
StandardThingModelCodeSelect: defineAsyncComponent(
|
|
||||||
() => import('#/views/devicemanagement/thingmodelinfo/StandardThingModelCodeSelect.vue') as any,
|
|
||||||
),
|
),
|
||||||
// 自定义默认按钮
|
// 自定义默认按钮
|
||||||
DefaultButton: (props, { attrs, slots }) => {
|
DefaultButton: (props, { attrs, slots }) => {
|
||||||
|
|||||||
@ -1183,12 +1183,14 @@ export const ControllerInterfaceApiDescriptionModelSchema = {
|
|||||||
export const CopyAnotherProductInputSchema = {
|
export const CopyAnotherProductInputSchema = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
ioTPlatform: {
|
pendingCopyDataId: {
|
||||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
type: 'string',
|
||||||
|
description: '待复制设备物模型数据ID',
|
||||||
|
format: 'uuid'
|
||||||
},
|
},
|
||||||
ioTPlatformProductId: {
|
ioTPlatformProductId: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: '平台产品ID',
|
description: '产品ID',
|
||||||
nullable: true
|
nullable: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1196,35 +1198,6 @@ export const CopyAnotherProductInputSchema = {
|
|||||||
description: '根据数据ID复制已存在物模型信息'
|
description: '根据数据ID复制已存在物模型信息'
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const CopyStandardThingModelInputSchema = {
|
|
||||||
type: 'object',
|
|
||||||
properties: {
|
|
||||||
filedType: {
|
|
||||||
type: 'string',
|
|
||||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
ioTPlatform: {
|
|
||||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
|
||||||
},
|
|
||||||
ioTPlatformProductId: {
|
|
||||||
type: 'string',
|
|
||||||
description: '平台产品ID',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
dataDictionaries: {
|
|
||||||
type: 'array',
|
|
||||||
items: {
|
|
||||||
'$ref': '#/components/schemas/DataDictionaryDetailInfoDto'
|
|
||||||
},
|
|
||||||
description: '标准物模型集合',
|
|
||||||
nullable: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
additionalProperties: false,
|
|
||||||
description: '复制标准物模型'
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export const CreateDataDictinaryDetailInputSchema = {
|
export const CreateDataDictinaryDetailInputSchema = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
@ -1499,7 +1472,7 @@ export const CreateThingModelInputSchema = {
|
|||||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||||
nullable: true
|
nullable: true
|
||||||
},
|
},
|
||||||
ioTPlatformRawFieldName: {
|
rawFieldName: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
||||||
nullable: true
|
nullable: true
|
||||||
@ -1509,16 +1482,6 @@ export const CreateThingModelInputSchema = {
|
|||||||
description: '管理后台产品标准的物模型属性或者事件名称',
|
description: '管理后台产品标准的物模型属性或者事件名称',
|
||||||
nullable: true
|
nullable: true
|
||||||
},
|
},
|
||||||
standardFieldValueType: {
|
|
||||||
type: 'string',
|
|
||||||
description: '标准物模型字段值类型',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
standardFieldDisplayName: {
|
|
||||||
type: 'string',
|
|
||||||
description: '标准物模型字段显示名称',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
isValueNeedConvert: {
|
isValueNeedConvert: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: '是否需要值类型转换'
|
description: '是否需要值类型转换'
|
||||||
@ -1662,58 +1625,6 @@ export const CurrentUserDtoSchema = {
|
|||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const DataDictionaryDetailInfoDtoSchema = {
|
|
||||||
type: 'object',
|
|
||||||
properties: {
|
|
||||||
dataDictionaryId: {
|
|
||||||
type: 'string',
|
|
||||||
description: '所属字典Id',
|
|
||||||
format: 'uuid'
|
|
||||||
},
|
|
||||||
dataDictionaryName: {
|
|
||||||
type: 'string',
|
|
||||||
description: '所属字典名称',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
dataDictionaryCode: {
|
|
||||||
type: 'string',
|
|
||||||
description: '字典编码',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
code: {
|
|
||||||
type: 'string',
|
|
||||||
description: '字典明细编码',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
order: {
|
|
||||||
type: 'integer',
|
|
||||||
description: '展现列表时排序用',
|
|
||||||
format: 'int32'
|
|
||||||
},
|
|
||||||
displayText: {
|
|
||||||
type: 'string',
|
|
||||||
description: '显示名',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
type: 'string',
|
|
||||||
description: '描述',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
isEnabled: {
|
|
||||||
type: 'boolean',
|
|
||||||
description: '启/停用(默认启用)'
|
|
||||||
},
|
|
||||||
extendedAttribute: {
|
|
||||||
type: 'string',
|
|
||||||
description: '扩展属性',
|
|
||||||
nullable: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
additionalProperties: false,
|
|
||||||
description: '数据字典详情信息'
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export const DataEncryptionEnumSchema = {
|
export const DataEncryptionEnumSchema = {
|
||||||
enum: [1, 2, 3, 4, 5, 6],
|
enum: [1, 2, 3, 4, 5, 6],
|
||||||
type: 'integer',
|
type: 'integer',
|
||||||
@ -2315,7 +2226,7 @@ export const DeviceThingModelInfoDtoSchema = {
|
|||||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||||
nullable: true
|
nullable: true
|
||||||
},
|
},
|
||||||
ioTPlatformRawFieldName: {
|
rawFieldName: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
||||||
nullable: true
|
nullable: true
|
||||||
@ -2325,16 +2236,6 @@ export const DeviceThingModelInfoDtoSchema = {
|
|||||||
description: '管理后台产品标准的物模型属性或者事件名称',
|
description: '管理后台产品标准的物模型属性或者事件名称',
|
||||||
nullable: true
|
nullable: true
|
||||||
},
|
},
|
||||||
standardFieldValueType: {
|
|
||||||
type: 'string',
|
|
||||||
description: '标准物模型字段值类型',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
standardFieldDisplayName: {
|
|
||||||
type: 'string',
|
|
||||||
description: '标准物模型字段显示名称',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
isValueNeedConvert: {
|
isValueNeedConvert: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: '是否需要值类型转换'
|
description: '是否需要值类型转换'
|
||||||
@ -5660,11 +5561,6 @@ export const PageDeviceInputSchema = {
|
|||||||
ioTPlatform: {
|
ioTPlatform: {
|
||||||
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
|
||||||
},
|
},
|
||||||
ioTPlatformDeviceOpenInfo: {
|
|
||||||
type: 'string',
|
|
||||||
description: '物联网平台中对应的设备Id或者名称',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
searchKeyword: {
|
searchKeyword: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: '搜索关键字',
|
description: '搜索关键字',
|
||||||
@ -6482,9 +6378,9 @@ export const PageThingModelInputSchema = {
|
|||||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||||
nullable: true
|
nullable: true
|
||||||
},
|
},
|
||||||
searchKeyWords: {
|
rawFieldName: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: '搜索关键词',
|
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
||||||
nullable: true
|
nullable: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -6823,11 +6719,6 @@ export const PagingDataDictionaryDetailOutputSchema = {
|
|||||||
description: '描述',
|
description: '描述',
|
||||||
nullable: true
|
nullable: true
|
||||||
},
|
},
|
||||||
extendedAttribute: {
|
|
||||||
type: 'string',
|
|
||||||
description: '扩展属性',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
isEnabled: {
|
isEnabled: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: '启/停用(默认启用)'
|
description: '启/停用(默认启用)'
|
||||||
@ -8399,49 +8290,6 @@ export const ReturnValueApiDescriptionModelSchema = {
|
|||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const SelectDataDictionaryDetailInputSchema = {
|
|
||||||
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
|
|
||||||
},
|
|
||||||
dataDictionaryId: {
|
|
||||||
type: 'string',
|
|
||||||
format: 'uuid'
|
|
||||||
},
|
|
||||||
filter: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
typeCode: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
additionalProperties: false
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export const SelectResultSchema = {
|
export const SelectResultSchema = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
@ -9229,7 +9077,7 @@ export const UpdateThingModelInputSchema = {
|
|||||||
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
description: '物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst',
|
||||||
nullable: true
|
nullable: true
|
||||||
},
|
},
|
||||||
ioTPlatformRawFieldName: {
|
rawFieldName: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
description: '物联网平台中对应的产品物模型属性或者事件名称',
|
||||||
nullable: true
|
nullable: true
|
||||||
@ -9239,16 +9087,6 @@ export const UpdateThingModelInputSchema = {
|
|||||||
description: '管理后台产品标准的物模型属性或者事件名称',
|
description: '管理后台产品标准的物模型属性或者事件名称',
|
||||||
nullable: true
|
nullable: true
|
||||||
},
|
},
|
||||||
standardFieldValueType: {
|
|
||||||
type: 'string',
|
|
||||||
description: '标准物模型字段值类型',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
standardFieldDisplayName: {
|
|
||||||
type: 'string',
|
|
||||||
description: '标准物模型字段显示名称',
|
|
||||||
nullable: true
|
|
||||||
},
|
|
||||||
isValueNeedConvert: {
|
isValueNeedConvert: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: '是否需要值类型转换'
|
description: '是否需要值类型转换'
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -204,32 +204,16 @@ export type ControllerInterfaceApiDescriptionModel = {
|
|||||||
* 根据数据ID复制已存在物模型信息
|
* 根据数据ID复制已存在物模型信息
|
||||||
*/
|
*/
|
||||||
export type CopyAnotherProductInput = {
|
export type CopyAnotherProductInput = {
|
||||||
ioTPlatform?: IoTPlatformTypeEnum;
|
|
||||||
/**
|
/**
|
||||||
* 平台产品ID
|
* 待复制设备物模型数据ID
|
||||||
|
*/
|
||||||
|
pendingCopyDataId?: string;
|
||||||
|
/**
|
||||||
|
* 产品ID
|
||||||
*/
|
*/
|
||||||
ioTPlatformProductId?: (string) | null;
|
ioTPlatformProductId?: (string) | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* 复制标准物模型
|
|
||||||
*/
|
|
||||||
export type CopyStandardThingModelInput = {
|
|
||||||
/**
|
|
||||||
* 物联网平台中对应产品物模型属性或者事件类型 JiShe.ServicePro.Core.DataDictionaryTypeConst
|
|
||||||
*/
|
|
||||||
filedType?: (string) | null;
|
|
||||||
ioTPlatform?: IoTPlatformTypeEnum;
|
|
||||||
/**
|
|
||||||
* 平台产品ID
|
|
||||||
*/
|
|
||||||
ioTPlatformProductId?: (string) | null;
|
|
||||||
/**
|
|
||||||
* 标准物模型集合
|
|
||||||
*/
|
|
||||||
dataDictionaries?: Array<DataDictionaryDetailInfoDto> | null;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type CreateDataDictinaryDetailInput = {
|
export type CreateDataDictinaryDetailInput = {
|
||||||
id?: string;
|
id?: string;
|
||||||
code?: (string) | null;
|
code?: (string) | null;
|
||||||
@ -409,19 +393,11 @@ export type CreateThingModelInput = {
|
|||||||
/**
|
/**
|
||||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||||
*/
|
*/
|
||||||
ioTPlatformRawFieldName?: (string) | null;
|
rawFieldName?: (string) | null;
|
||||||
/**
|
/**
|
||||||
* 管理后台产品标准的物模型属性或者事件名称
|
* 管理后台产品标准的物模型属性或者事件名称
|
||||||
*/
|
*/
|
||||||
standardFieldName?: (string) | null;
|
standardFieldName?: (string) | null;
|
||||||
/**
|
|
||||||
* 标准物模型字段值类型
|
|
||||||
*/
|
|
||||||
standardFieldValueType?: (string) | null;
|
|
||||||
/**
|
|
||||||
* 标准物模型字段显示名称
|
|
||||||
*/
|
|
||||||
standardFieldDisplayName?: (string) | null;
|
|
||||||
/**
|
/**
|
||||||
* 是否需要值类型转换
|
* 是否需要值类型转换
|
||||||
*/
|
*/
|
||||||
@ -881,48 +857,6 @@ export type CurrentUserDto = {
|
|||||||
sessionId?: (string) | null;
|
sessionId?: (string) | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据字典详情信息
|
|
||||||
*/
|
|
||||||
export type DataDictionaryDetailInfoDto = {
|
|
||||||
/**
|
|
||||||
* 所属字典Id
|
|
||||||
*/
|
|
||||||
dataDictionaryId?: string;
|
|
||||||
/**
|
|
||||||
* 所属字典名称
|
|
||||||
*/
|
|
||||||
dataDictionaryName?: (string) | null;
|
|
||||||
/**
|
|
||||||
* 字典编码
|
|
||||||
*/
|
|
||||||
dataDictionaryCode?: (string) | null;
|
|
||||||
/**
|
|
||||||
* 字典明细编码
|
|
||||||
*/
|
|
||||||
code?: (string) | null;
|
|
||||||
/**
|
|
||||||
* 展现列表时排序用
|
|
||||||
*/
|
|
||||||
order?: number;
|
|
||||||
/**
|
|
||||||
* 显示名
|
|
||||||
*/
|
|
||||||
displayText?: (string) | null;
|
|
||||||
/**
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
description?: (string) | null;
|
|
||||||
/**
|
|
||||||
* 启/停用(默认启用)
|
|
||||||
*/
|
|
||||||
isEnabled?: boolean;
|
|
||||||
/**
|
|
||||||
* 扩展属性
|
|
||||||
*/
|
|
||||||
extendedAttribute?: (string) | null;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据加密方式
|
* 数据加密方式
|
||||||
*/
|
*/
|
||||||
@ -1272,19 +1206,11 @@ export type DeviceThingModelInfoDto = {
|
|||||||
/**
|
/**
|
||||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||||
*/
|
*/
|
||||||
ioTPlatformRawFieldName?: (string) | null;
|
rawFieldName?: (string) | null;
|
||||||
/**
|
/**
|
||||||
* 管理后台产品标准的物模型属性或者事件名称
|
* 管理后台产品标准的物模型属性或者事件名称
|
||||||
*/
|
*/
|
||||||
standardFieldName?: (string) | null;
|
standardFieldName?: (string) | null;
|
||||||
/**
|
|
||||||
* 标准物模型字段值类型
|
|
||||||
*/
|
|
||||||
standardFieldValueType?: (string) | null;
|
|
||||||
/**
|
|
||||||
* 标准物模型字段显示名称
|
|
||||||
*/
|
|
||||||
standardFieldDisplayName?: (string) | null;
|
|
||||||
/**
|
/**
|
||||||
* 是否需要值类型转换
|
* 是否需要值类型转换
|
||||||
*/
|
*/
|
||||||
@ -2834,10 +2760,6 @@ export type PageDeviceInput = {
|
|||||||
*/
|
*/
|
||||||
deviceAddress?: (string) | null;
|
deviceAddress?: (string) | null;
|
||||||
ioTPlatform?: IoTPlatformTypeEnum;
|
ioTPlatform?: IoTPlatformTypeEnum;
|
||||||
/**
|
|
||||||
* 物联网平台中对应的设备Id或者名称
|
|
||||||
*/
|
|
||||||
ioTPlatformDeviceOpenInfo?: (string) | null;
|
|
||||||
/**
|
/**
|
||||||
* 搜索关键字
|
* 搜索关键字
|
||||||
*/
|
*/
|
||||||
@ -3338,9 +3260,9 @@ export type PageThingModelInput = {
|
|||||||
*/
|
*/
|
||||||
filedType?: (string) | null;
|
filedType?: (string) | null;
|
||||||
/**
|
/**
|
||||||
* 搜索关键词
|
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||||
*/
|
*/
|
||||||
searchKeyWords?: (string) | null;
|
rawFieldName?: (string) | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PagingAuditLogActionOutput = {
|
export type PagingAuditLogActionOutput = {
|
||||||
@ -3500,10 +3422,6 @@ export type PagingDataDictionaryDetailOutput = {
|
|||||||
* 描述
|
* 描述
|
||||||
*/
|
*/
|
||||||
description?: (string) | null;
|
description?: (string) | null;
|
||||||
/**
|
|
||||||
* 扩展属性
|
|
||||||
*/
|
|
||||||
extendedAttribute?: (string) | null;
|
|
||||||
/**
|
/**
|
||||||
* 启/停用(默认启用)
|
* 启/停用(默认启用)
|
||||||
*/
|
*/
|
||||||
@ -4351,31 +4269,6 @@ export type ReturnValueApiDescriptionModel = {
|
|||||||
typeSimple?: (string) | null;
|
typeSimple?: (string) | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SelectDataDictionaryDetailInput = {
|
|
||||||
/**
|
|
||||||
* 当前页面.默认从1开始
|
|
||||||
*/
|
|
||||||
pageIndex?: number;
|
|
||||||
/**
|
|
||||||
* 每页多少条.每页显示多少记录
|
|
||||||
*/
|
|
||||||
pageSize?: number;
|
|
||||||
/**
|
|
||||||
* 跳过多少条
|
|
||||||
*/
|
|
||||||
readonly skipCount?: number;
|
|
||||||
/**
|
|
||||||
* 排序
|
|
||||||
* <example>
|
|
||||||
* name desc
|
|
||||||
* </example>
|
|
||||||
*/
|
|
||||||
sorting?: (string) | null;
|
|
||||||
dataDictionaryId?: string;
|
|
||||||
filter?: (string) | null;
|
|
||||||
typeCode?: (string) | null;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下拉框选项元素
|
* 下拉框选项元素
|
||||||
*/
|
*/
|
||||||
@ -4767,19 +4660,11 @@ export type UpdateThingModelInput = {
|
|||||||
/**
|
/**
|
||||||
* 物联网平台中对应的产品物模型属性或者事件名称
|
* 物联网平台中对应的产品物模型属性或者事件名称
|
||||||
*/
|
*/
|
||||||
ioTPlatformRawFieldName?: (string) | null;
|
rawFieldName?: (string) | null;
|
||||||
/**
|
/**
|
||||||
* 管理后台产品标准的物模型属性或者事件名称
|
* 管理后台产品标准的物模型属性或者事件名称
|
||||||
*/
|
*/
|
||||||
standardFieldName?: (string) | null;
|
standardFieldName?: (string) | null;
|
||||||
/**
|
|
||||||
* 标准物模型字段值类型
|
|
||||||
*/
|
|
||||||
standardFieldValueType?: (string) | null;
|
|
||||||
/**
|
|
||||||
* 标准物模型字段显示名称
|
|
||||||
*/
|
|
||||||
standardFieldDisplayName?: (string) | null;
|
|
||||||
/**
|
/**
|
||||||
* 是否需要值类型转换
|
* 是否需要值类型转换
|
||||||
*/
|
*/
|
||||||
@ -5061,14 +4946,6 @@ export type PostDataDictionaryPageDetailResponse = (PagingDataDictionaryDetailOu
|
|||||||
|
|
||||||
export type PostDataDictionaryPageDetailError = (RemoteServiceErrorResponse);
|
export type PostDataDictionaryPageDetailError = (RemoteServiceErrorResponse);
|
||||||
|
|
||||||
export type PostDataDictionarySelectDetailData = {
|
|
||||||
body?: SelectDataDictionaryDetailInput;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type PostDataDictionarySelectDetailResponse = (PagingDataDictionaryDetailOutputPagedResultDto);
|
|
||||||
|
|
||||||
export type PostDataDictionarySelectDetailError = (RemoteServiceErrorResponse);
|
|
||||||
|
|
||||||
export type PostDataDictionaryCreateData = {
|
export type PostDataDictionaryCreateData = {
|
||||||
body?: CreateDataDictinaryInput;
|
body?: CreateDataDictinaryInput;
|
||||||
};
|
};
|
||||||
@ -5255,7 +5132,7 @@ export type PostThingModelInfoFindByPlatformProductIdAsyncData = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PostThingModelInfoFindByPlatformProductIdAsyncResponse = (Array<DeviceThingModelInfoDto>);
|
export type PostThingModelInfoFindByPlatformProductIdAsyncResponse = (DeviceThingModelInfoDto);
|
||||||
|
|
||||||
export type PostThingModelInfoFindByPlatformProductIdAsyncError = unknown;
|
export type PostThingModelInfoFindByPlatformProductIdAsyncError = unknown;
|
||||||
|
|
||||||
@ -5265,33 +5142,29 @@ export type PostThingModelInfoCopyAnotherThingModelAsyncData = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PostThingModelInfoCopyAnotherThingModelAsyncResponse = (boolean);
|
export type PostThingModelInfoCopyAnotherThingModelAsyncResponse = (DeviceThingModelInfoDto);
|
||||||
|
|
||||||
export type PostThingModelInfoCopyAnotherThingModelAsyncError = unknown;
|
export type PostThingModelInfoCopyAnotherThingModelAsyncError = unknown;
|
||||||
|
|
||||||
export type PostThingModelInfoCopyStandardThingModelData = {
|
export type PostThingModelInfoCopyStandardThingModelData = {
|
||||||
query?: {
|
query?: {
|
||||||
input?: CopyStandardThingModelInput;
|
input?: StringIdInput;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PostThingModelInfoCopyStandardThingModelResponse = (boolean);
|
export type PostThingModelInfoCopyStandardThingModelResponse = (DeviceThingModelInfoDto);
|
||||||
|
|
||||||
export type PostThingModelInfoCopyStandardThingModelError = unknown;
|
export type PostThingModelInfoCopyStandardThingModelError = unknown;
|
||||||
|
|
||||||
export type PostThingModelInfoPageAsyncData = {
|
export type PostThingModelInfoPageData = {
|
||||||
query?: {
|
query?: {
|
||||||
input?: PageThingModelInput;
|
input?: PageThingModelInput;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PostThingModelInfoPageAsyncResponse = (DeviceThingModelInfoDtoPagedResultDto);
|
export type PostThingModelInfoPageResponse = (DeviceThingModelInfoDtoPagedResultDto);
|
||||||
|
|
||||||
export type PostThingModelInfoPageAsyncError = unknown;
|
export type PostThingModelInfoPageError = unknown;
|
||||||
|
|
||||||
export type PostThingModelInfoStandardThingModelPageAsyncResponse = (Array<DataDictionaryDetailInfoDto>);
|
|
||||||
|
|
||||||
export type PostThingModelInfoStandardThingModelPageAsyncError = unknown;
|
|
||||||
|
|
||||||
export type PostFeaturesListData = {
|
export type PostFeaturesListData = {
|
||||||
body?: GetFeatureListResultInput;
|
body?: GetFeatureListResultInput;
|
||||||
|
|||||||
@ -218,14 +218,6 @@
|
|||||||
"deviceInfoManage": "DeviceInfoManage",
|
"deviceInfoManage": "DeviceInfoManage",
|
||||||
"thingModelInfoManage": "ThingModelInfoManage"
|
"thingModelInfoManage": "ThingModelInfoManage"
|
||||||
},
|
},
|
||||||
"thingModelInfos": {
|
|
||||||
"FiledType": "FiledType",
|
|
||||||
"IoTPlatformRawFieldName": "IoTPlatformRawFieldName",
|
|
||||||
"StandardFieldName": "StandardFieldName",
|
|
||||||
"StandardFieldDisplayName": "StandardFieldDisplayName",
|
|
||||||
"IsValueNeedConvert": "IsValueNeedConvert",
|
|
||||||
"StandardFieldValueType": "StandardFieldValueType"
|
|
||||||
},
|
|
||||||
"IoTDBBase": {
|
"IoTDBBase": {
|
||||||
"IoTDataType": "IoTDataType",
|
"IoTDataType": "IoTDataType",
|
||||||
"DataBaseName": "DataBaseName",
|
"DataBaseName": "DataBaseName",
|
||||||
|
|||||||
@ -66,7 +66,5 @@
|
|||||||
"AppSecret": "AppSecret",
|
"AppSecret": "AppSecret",
|
||||||
"operationSuccess": "OperationSuccess",
|
"operationSuccess": "OperationSuccess",
|
||||||
"operationFailed": "OperationFailed",
|
"operationFailed": "OperationFailed",
|
||||||
"required": "Required",
|
|
||||||
"SearchKeyWords": "搜索关键字",
|
|
||||||
"loading": "Loading"
|
"loading": "Loading"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -211,14 +211,6 @@
|
|||||||
"deviceInfoManage": "设备管理",
|
"deviceInfoManage": "设备管理",
|
||||||
"thingModelInfoManage": "物模型管理"
|
"thingModelInfoManage": "物模型管理"
|
||||||
},
|
},
|
||||||
"thingModelInfos": {
|
|
||||||
"FiledType": "物模型类型",
|
|
||||||
"IoTPlatformRawFieldName": "平台物模型编码",
|
|
||||||
"StandardFieldName": "标准物模型编码",
|
|
||||||
"StandardFieldDisplayName": "标准物模型名称",
|
|
||||||
"IsValueNeedConvert": "是否需要值类型转换",
|
|
||||||
"StandardFieldValueType": "标准物模型值类型"
|
|
||||||
},
|
|
||||||
"IoTDBBase": {
|
"IoTDBBase": {
|
||||||
"IoTDataType": "数据类型",
|
"IoTDataType": "数据类型",
|
||||||
"DataBaseName": "所属数据库",
|
"DataBaseName": "所属数据库",
|
||||||
|
|||||||
@ -67,7 +67,5 @@
|
|||||||
"AppSecret": "应用Secret",
|
"AppSecret": "应用Secret",
|
||||||
"operationSuccess": "操作成功",
|
"operationSuccess": "操作成功",
|
||||||
"operationFailed": "操作失败",
|
"operationFailed": "操作失败",
|
||||||
"required": "必填",
|
|
||||||
"SearchKeyWords": "搜索关键字",
|
|
||||||
"loading": "正在处理"
|
"loading": "正在处理"
|
||||||
}
|
}
|
||||||
|
|||||||
7
apps/web-antd/src/types/vue-shim.d.ts
vendored
7
apps/web-antd/src/types/vue-shim.d.ts
vendored
@ -1,7 +0,0 @@
|
|||||||
declare module '*.vue' {
|
|
||||||
import type { DefineComponent } from 'vue';
|
|
||||||
const component: DefineComponent<{}, {}, any>;
|
|
||||||
export default component;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@ -23,8 +23,6 @@ import {
|
|||||||
import { TableAction } from '#/components/table-action';
|
import { TableAction } from '#/components/table-action';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import ThingModelInfoModal from '#/views/devicemanagement/thingmodelinfo/index.vue';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addProductFormSchema,
|
addProductFormSchema,
|
||||||
editProductFormSchemaEdit,
|
editProductFormSchemaEdit,
|
||||||
@ -78,10 +76,6 @@ const editRow: Record<string, any> = ref({});
|
|||||||
// 声明文件变量,用于存储选择的文件
|
// 声明文件变量,用于存储选择的文件
|
||||||
let selectedFile: File | null = null;
|
let selectedFile: File | null = null;
|
||||||
|
|
||||||
// 物模型模态框相关状态
|
|
||||||
const thingModelModalVisible = ref(false);
|
|
||||||
const currentProductInfo = ref<any>({});
|
|
||||||
|
|
||||||
// 设置文件选择回调
|
// 设置文件选择回调
|
||||||
setFileSelectedCallback((file) => {
|
setFileSelectedCallback((file) => {
|
||||||
selectedFile = file;
|
selectedFile = file;
|
||||||
@ -311,25 +305,6 @@ async function onStatusChange(record: any) {
|
|||||||
Message.error(record.isEnabled ? '禁用失败' : '启用失败');
|
Message.error(record.isEnabled ? '禁用失败' : '启用失败');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 物模型管理函数
|
|
||||||
function onThingModelManagement(record: any) {
|
|
||||||
console.log('物模型管理按钮被点击', record);
|
|
||||||
// 设置当前产品信息
|
|
||||||
currentProductInfo.value = {
|
|
||||||
productId: record.ioTPlatformProductId,
|
|
||||||
productName: record.productName,
|
|
||||||
ioTPlatform: '1', // CTWing平台类型为1
|
|
||||||
};
|
|
||||||
// 打开物模型模态框
|
|
||||||
thingModelModalVisible.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 关闭物模型模态框
|
|
||||||
function closeThingModelModal() {
|
|
||||||
thingModelModalVisible.value = false;
|
|
||||||
currentProductInfo.value = {};
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -371,12 +346,6 @@ function closeThingModelModal() {
|
|||||||
auth: ['AbpIdentity.Users.Update'],
|
auth: ['AbpIdentity.Users.Update'],
|
||||||
onClick: onEdit.bind(null, row),
|
onClick: onEdit.bind(null, row),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: $t('abp.deviceInfos.thingModelInfoManage'),
|
|
||||||
type: 'link',
|
|
||||||
size: 'small',
|
|
||||||
onClick: onThingModelManagement.bind(null, row),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: row.isEnabled ? '禁用' : '启用',
|
label: row.isEnabled ? '禁用' : '启用',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
@ -405,14 +374,5 @@ function closeThingModelModal() {
|
|||||||
<UserModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
|
<UserModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
|
||||||
<component :is="editRow.id ? EditForm : AddForm" />
|
<component :is="editRow.id ? EditForm : AddForm" />
|
||||||
</UserModal>
|
</UserModal>
|
||||||
|
|
||||||
<!-- 物模型信息模态框 -->
|
|
||||||
<ThingModelInfoModal
|
|
||||||
v-model:visible="thingModelModalVisible"
|
|
||||||
:product-id="currentProductInfo.productId"
|
|
||||||
:product-name="currentProductInfo.productName"
|
|
||||||
:io-t-platform="currentProductInfo.ioTPlatform"
|
|
||||||
@close="closeThingModelModal"
|
|
||||||
/>
|
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -1,155 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { ref, watch, computed } 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 = (_: any, { attrs }: any) => attrs.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 : [];
|
|
||||||
options.value = items.map((item: any) => ({
|
|
||||||
label: item.displayText,
|
|
||||||
value: item.code,
|
|
||||||
...item,
|
|
||||||
}));
|
|
||||||
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);
|
|
||||||
} else {
|
|
||||||
emit('item-change', 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;
|
|
||||||
},
|
|
||||||
{ 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>
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,351 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import type { VbenFormProps } from '#/adapter/form';
|
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
|
||||||
|
|
||||||
import { computed, h, nextTick, ref, watch } from 'vue';
|
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
|
||||||
|
|
||||||
import { message as Message, Tag, Modal } from 'ant-design-vue';
|
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
||||||
import {
|
|
||||||
postThingModelInfoPageAsync,
|
|
||||||
postThingModelInfoDeleteAsync,
|
|
||||||
postThingModelInfoCreateAsync,
|
|
||||||
postThingModelInfoUpdateAsync,
|
|
||||||
postThingModelInfoCopyStandardThingModel,
|
|
||||||
} from '#/api-client';
|
|
||||||
import { TableAction } from '#/components/table-action';
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
import {
|
|
||||||
addThingModelFormSchema,
|
|
||||||
editThingModelFormSchema,
|
|
||||||
querySchema,
|
|
||||||
tableSchema,
|
|
||||||
} from './schema';
|
|
||||||
|
|
||||||
defineOptions({
|
|
||||||
name: 'ThingModelInfoModal',
|
|
||||||
});
|
|
||||||
|
|
||||||
// 定义props
|
|
||||||
interface Props {
|
|
||||||
visible?: boolean;
|
|
||||||
productId?: string;
|
|
||||||
productName?: string;
|
|
||||||
ioTPlatform?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
|
||||||
visible: false,
|
|
||||||
productId: '',
|
|
||||||
productName: '',
|
|
||||||
ioTPlatform: '2',
|
|
||||||
});
|
|
||||||
|
|
||||||
// 定义emits
|
|
||||||
const emit = defineEmits<{
|
|
||||||
'update:visible': [value: boolean];
|
|
||||||
'close': [];
|
|
||||||
}>();
|
|
||||||
|
|
||||||
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 postThingModelInfoPageAsync({
|
|
||||||
body: {
|
|
||||||
pageIndex: page.currentPage,
|
|
||||||
pageSize: page.pageSize,
|
|
||||||
...formValues,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({ formOptions, gridOptions });
|
|
||||||
|
|
||||||
const editRow: Record<string, any> = ref({});
|
|
||||||
|
|
||||||
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 [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',
|
|
||||||
});
|
|
||||||
|
|
||||||
// 监听props变化,自动设置筛选条件
|
|
||||||
watch(
|
|
||||||
() => [props.visible, props.productId, props.ioTPlatform],
|
|
||||||
async ([visible, productId, ioTPlatform]) => {
|
|
||||||
console.log('物模型模态框props变化:', { visible, productId, ioTPlatform });
|
|
||||||
if (visible && productId) {
|
|
||||||
// 延迟执行,确保组件完全初始化
|
|
||||||
setTimeout(async () => {
|
|
||||||
try {
|
|
||||||
// 设置表单筛选条件
|
|
||||||
const filterValues: any = {};
|
|
||||||
|
|
||||||
if (ioTPlatform) {
|
|
||||||
filterValues.ioTPlatform = ioTPlatform;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (productId) {
|
|
||||||
filterValues.oneNETProductId = productId;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('设置筛选条件:', filterValues);
|
|
||||||
|
|
||||||
// 设置筛选表单的值
|
|
||||||
if (Object.keys(filterValues).length > 0) {
|
|
||||||
await gridApi.formApi.setValues(filterValues);
|
|
||||||
// 重新加载数据
|
|
||||||
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
|
|
||||||
? postThingModelInfoUpdateAsync
|
|
||||||
: postThingModelInfoCreateAsync;
|
|
||||||
const { valid } = await formApi.validate();
|
|
||||||
if (!valid) return;
|
|
||||||
|
|
||||||
const formValues = await formApi.getValues();
|
|
||||||
|
|
||||||
const fetchParams: any = {
|
|
||||||
query: {
|
|
||||||
input: {
|
|
||||||
...formValues,
|
|
||||||
// 自动添加平台和产品信息
|
|
||||||
ioTPlatform: parseInt(props.ioTPlatform) as 1 | 2,
|
|
||||||
ioTPlatformProductId: props.productId,
|
|
||||||
// 编辑时需要添加ID
|
|
||||||
...(isEdit && { id: editRow.value.id }),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
const resp = await api({ body: 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();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 删除函数
|
|
||||||
async function onDel(record: any) {
|
|
||||||
try {
|
|
||||||
const resp = await postThingModelInfoDeleteAsync({
|
|
||||||
body: { 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 postThingModelInfoCopyStandardThingModel({
|
|
||||||
body: {
|
|
||||||
ioTPlatform: props.ioTPlatform,
|
|
||||||
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="`物模型管理 - ${productName || '产品'}`"
|
|
||||||
width="90%"
|
|
||||||
:footer="null"
|
|
||||||
@cancel="closeModal"
|
|
||||||
@ok="closeModal"
|
|
||||||
:body-style="{ height: '70vh', overflow: 'hidden' }"
|
|
||||||
>
|
|
||||||
<div style="height: 100%; display: flex; flex-direction: column;">
|
|
||||||
<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: '复制标准模型',
|
|
||||||
type: 'default',
|
|
||||||
icon: 'ant-design:copy-outlined',
|
|
||||||
onClick: copyStandardThingModel,
|
|
||||||
auth: ['AbpIdentity.Users.Create'],
|
|
||||||
},
|
|
||||||
]" />
|
|
||||||
</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),
|
|
||||||
},
|
|
||||||
]" :drop-down-actions="[
|
|
||||||
{
|
|
||||||
label: $t('common.delete'),
|
|
||||||
icon: 'ant-design:delete-outlined',
|
|
||||||
type: 'primary',
|
|
||||||
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>
|
|
||||||
</Modal>
|
|
||||||
</template>
|
|
||||||
@ -1,311 +0,0 @@
|
|||||||
import { computed } from 'vue';
|
|
||||||
|
|
||||||
import { z } from '@vben/common-ui';
|
|
||||||
|
|
||||||
import dayjs from 'dayjs';
|
|
||||||
|
|
||||||
import { getCommonGetSelectList } 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: 'standardFieldName',
|
|
||||||
label: $t('abp.thingModelInfos.StandardFieldName'),
|
|
||||||
rules: z.preprocess((v) => (v == null ? '' : v), z.string().min(1, $t('common.required'))),
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return !!values?.filedType;
|
|
||||||
},
|
|
||||||
triggerFields: ['filedType'],
|
|
||||||
},
|
|
||||||
componentProps: {
|
|
||||||
// 传入联动的类型编码
|
|
||||||
typeCode: (formValues: any) => formValues?.filedType,
|
|
||||||
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',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
labelField: 'value',
|
|
||||||
valueField: 'secondValue',
|
|
||||||
optionsPropName: 'options',
|
|
||||||
immediate: 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: 'Input',
|
|
||||||
fieldName: 'standardFieldDisplayName',
|
|
||||||
label: $t('abp.thingModelInfos.StandardFieldDisplayName'),
|
|
||||||
rules: z.preprocess((v) => (v == null ? '' : v), z.string().min(1, $t('common.required'))),
|
|
||||||
componentProps: {
|
|
||||||
placeholder:
|
|
||||||
$t('common.pleaseInput') +
|
|
||||||
$t('abp.thingModelInfos.StandardFieldDisplayName'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
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: 'value',
|
|
||||||
optionsPropName: 'options',
|
|
||||||
immediate: true,
|
|
||||||
placeholder: $t('abp.thingModelInfos.PleaseSelectFiledType'),
|
|
||||||
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('abp.thingModelInfos.PleaseInputIoTPlatformRawFieldName'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'StandardThingModelCodeSelect',
|
|
||||||
fieldName: 'standardFieldName',
|
|
||||||
label: $t('abp.thingModelInfos.StandardFieldName'),
|
|
||||||
rules: z.preprocess((v) => (v == null ? '' : v), z.string().min(1, $t('common.required'))),
|
|
||||||
dependencies: {
|
|
||||||
show(values: any) {
|
|
||||||
return !!values?.filedType;
|
|
||||||
},
|
|
||||||
triggerFields: ['filedType'],
|
|
||||||
},
|
|
||||||
componentProps: {
|
|
||||||
typeCode: (formValues: any) => formValues?.filedType,
|
|
||||||
placeholder: $t('abp.thingModelInfos.PleaseSelectStandardFieldName'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'ApiSelect',
|
|
||||||
fieldName: 'standardFieldValueType',
|
|
||||||
label: $t('abp.thingModelInfos.StandardFieldValueType'),
|
|
||||||
rules: z.string().min(1, $t('common.required')),
|
|
||||||
componentProps: {
|
|
||||||
api: getCommonGetSelectList,
|
|
||||||
params: {
|
|
||||||
query: {
|
|
||||||
typeName: 'StandardThingModelDataTypeEnum',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
labelField: 'value',
|
|
||||||
valueField: 'value',
|
|
||||||
optionsPropName: 'options',
|
|
||||||
immediate: true,
|
|
||||||
placeholder: $t('abp.thingModelInfos.PleaseSelectStandardFieldValueType'),
|
|
||||||
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: 'standardFieldDisplayName',
|
|
||||||
label: $t('abp.thingModelInfos.StandardFieldDisplayName'),
|
|
||||||
rules: z.string().min(1, $t('common.required')),
|
|
||||||
componentProps: {
|
|
||||||
placeholder: $t(
|
|
||||||
'abp.thingModelInfos.PleaseInputStandardFieldDisplayName',
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Switch',
|
|
||||||
fieldName: 'isValueNeedConvert',
|
|
||||||
label: $t('abp.thingModelInfos.IsValueNeedConvert'),
|
|
||||||
componentProps: {
|
|
||||||
style: { width: 'auto' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
@ -23,8 +23,6 @@ import {
|
|||||||
import { TableAction } from '#/components/table-action';
|
import { TableAction } from '#/components/table-action';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import ThingModelInfoModal from '#/views/devicemanagement/thingmodelinfo/index.vue';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addProductFormSchema,
|
addProductFormSchema,
|
||||||
editProductFormSchemaEdit,
|
editProductFormSchemaEdit,
|
||||||
@ -78,10 +76,6 @@ const editRow: Record<string, any> = ref({});
|
|||||||
// 声明文件变量,用于存储选择的文件
|
// 声明文件变量,用于存储选择的文件
|
||||||
let selectedFile: File | null = null;
|
let selectedFile: File | null = null;
|
||||||
|
|
||||||
// 物模型模态框相关状态
|
|
||||||
const thingModelModalVisible = ref(false);
|
|
||||||
const currentProductInfo = ref<any>({});
|
|
||||||
|
|
||||||
// 设置文件选择回调
|
// 设置文件选择回调
|
||||||
setFileSelectedCallback((file) => {
|
setFileSelectedCallback((file) => {
|
||||||
selectedFile = file;
|
selectedFile = file;
|
||||||
@ -330,22 +324,15 @@ function onDeviceManagement(record: any) {
|
|||||||
// 物模型管理函数
|
// 物模型管理函数
|
||||||
function onThingModelManagement(record: any) {
|
function onThingModelManagement(record: any) {
|
||||||
console.log('物模型管理按钮被点击', record);
|
console.log('物模型管理按钮被点击', record);
|
||||||
// 设置当前产品信息
|
// 跳转到物模型管理页面,传递产品ID作为参数
|
||||||
currentProductInfo.value = {
|
router.push({
|
||||||
productId: record.ioTPlatformProductId,
|
path: '/devicemanagement/thingmodelinfo',
|
||||||
productName: record.productName,
|
query: {
|
||||||
ioTPlatform: '2', // OneNET平台类型为2
|
ioTPlatform: '2', // OneNET平台类型为2
|
||||||
};
|
ioTPlatformDeviceOpenInfo: record.ioTPlatformProductId, // 平台产品ID
|
||||||
console.log('设置产品信息:', currentProductInfo.value);
|
productName: record.productName,
|
||||||
// 打开物模型模态框
|
},
|
||||||
thingModelModalVisible.value = true;
|
});
|
||||||
console.log('模态框状态设置为:', thingModelModalVisible.value);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 关闭物模型模态框
|
|
||||||
function closeThingModelModal() {
|
|
||||||
thingModelModalVisible.value = false;
|
|
||||||
currentProductInfo.value = {};
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -428,14 +415,5 @@ function closeThingModelModal() {
|
|||||||
<UserModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
|
<UserModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
|
||||||
<component :is="editRow.id ? EditForm : AddForm" />
|
<component :is="editRow.id ? EditForm : AddForm" />
|
||||||
</UserModal>
|
</UserModal>
|
||||||
|
|
||||||
<!-- 物模型信息模态框 -->
|
|
||||||
<ThingModelInfoModal
|
|
||||||
v-model:visible="thingModelModalVisible"
|
|
||||||
:product-id="currentProductInfo.productId"
|
|
||||||
:product-name="currentProductInfo.productName"
|
|
||||||
:io-t-platform="currentProductInfo.ioTPlatform"
|
|
||||||
@close="closeThingModelModal"
|
|
||||||
/>
|
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user