完善平台端物模型
This commit is contained in:
parent
f61f46a69b
commit
9197411c7b
@ -3693,6 +3693,11 @@ export const DeviceUpgradeRecordDtoSchema = {
|
|||||||
description: '扩展属性,用于存储自定义字段,JSON格式',
|
description: '扩展属性,用于存储自定义字段,JSON格式',
|
||||||
nullable: true
|
nullable: true
|
||||||
},
|
},
|
||||||
|
deviceDataId: {
|
||||||
|
type: 'string',
|
||||||
|
description: '设备数据Id',
|
||||||
|
format: 'uuid'
|
||||||
|
},
|
||||||
deviceName: {
|
deviceName: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: '设备名称',
|
description: '设备名称',
|
||||||
@ -5958,6 +5963,9 @@ export const IoTPlatformThingModelCreateInputSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
description: '物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode',
|
description: '物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode',
|
||||||
nullable: true
|
nullable: true
|
||||||
|
},
|
||||||
|
identifierType: {
|
||||||
|
'$ref': '#/components/schemas/ThingModelIdentifierTypeEnum'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
@ -6101,6 +6109,9 @@ export const IoTPlatformThingModelInfoDtoSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
description: '物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode',
|
description: '物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode',
|
||||||
nullable: true
|
nullable: true
|
||||||
|
},
|
||||||
|
identifierType: {
|
||||||
|
'$ref': '#/components/schemas/ThingModelIdentifierTypeEnum'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
additionalProperties: false,
|
additionalProperties: false,
|
||||||
@ -6178,6 +6189,14 @@ export const IoTPlatformThingModelPageInputSchema = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: '是否可操作标识符',
|
description: '是否可操作标识符',
|
||||||
nullable: true
|
nullable: true
|
||||||
|
},
|
||||||
|
accessMode: {
|
||||||
|
type: 'string',
|
||||||
|
description: '物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode',
|
||||||
|
nullable: true
|
||||||
|
},
|
||||||
|
identifierType: {
|
||||||
|
'$ref': '#/components/schemas/ThingModelIdentifierTypeEnum'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
@ -6246,6 +6265,9 @@ export const IoTPlatformThingModelUpdateInputSchema = {
|
|||||||
description: '物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode',
|
description: '物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode',
|
||||||
nullable: true
|
nullable: true
|
||||||
},
|
},
|
||||||
|
identifierType: {
|
||||||
|
'$ref': '#/components/schemas/ThingModelIdentifierTypeEnum'
|
||||||
|
},
|
||||||
id: {
|
id: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
format: 'uuid'
|
format: 'uuid'
|
||||||
@ -10860,6 +10882,14 @@ export const TenantDtoPagedResultDtoSchema = {
|
|||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
export const ThingModelIdentifierTypeEnumSchema = {
|
||||||
|
enum: [1, 2],
|
||||||
|
type: 'integer',
|
||||||
|
description: '设备物模型标识符类型枚举',
|
||||||
|
format: 'int32',
|
||||||
|
'说明:': '数据标识符=1,属性标识符=2'
|
||||||
|
} as const;
|
||||||
|
|
||||||
export const TimeZoneSchema = {
|
export const TimeZoneSchema = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
|
|||||||
@ -2151,6 +2151,10 @@ export type DeviceUpgradeRecordDto = {
|
|||||||
extraProperties?: {
|
extraProperties?: {
|
||||||
[key: string]: unknown;
|
[key: string]: unknown;
|
||||||
} | null;
|
} | null;
|
||||||
|
/**
|
||||||
|
* 设备数据Id
|
||||||
|
*/
|
||||||
|
deviceDataId?: string;
|
||||||
/**
|
/**
|
||||||
* 设备名称
|
* 设备名称
|
||||||
*/
|
*/
|
||||||
@ -3067,6 +3071,7 @@ export type IoTPlatformThingModelCreateInput = {
|
|||||||
* 物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode
|
* 物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode
|
||||||
*/
|
*/
|
||||||
accessMode?: (string) | null;
|
accessMode?: (string) | null;
|
||||||
|
identifierType?: ThingModelIdentifierTypeEnum;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3160,6 +3165,7 @@ export type IoTPlatformThingModelInfoDto = {
|
|||||||
* 物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode
|
* 物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode
|
||||||
*/
|
*/
|
||||||
accessMode?: (string) | null;
|
accessMode?: (string) | null;
|
||||||
|
identifierType?: ThingModelIdentifierTypeEnum;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type IoTPlatformThingModelInfoDtoPagedResultDto = {
|
export type IoTPlatformThingModelInfoDtoPagedResultDto = {
|
||||||
@ -3208,6 +3214,11 @@ export type IoTPlatformThingModelPageInput = {
|
|||||||
* 是否可操作标识符
|
* 是否可操作标识符
|
||||||
*/
|
*/
|
||||||
isOperableIdentifier?: (boolean) | null;
|
isOperableIdentifier?: (boolean) | null;
|
||||||
|
/**
|
||||||
|
* 物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode
|
||||||
|
*/
|
||||||
|
accessMode?: (string) | null;
|
||||||
|
identifierType?: ThingModelIdentifierTypeEnum;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type IoTPlatformThingModelUpdateInput = {
|
export type IoTPlatformThingModelUpdateInput = {
|
||||||
@ -3260,6 +3271,7 @@ export type IoTPlatformThingModelUpdateInput = {
|
|||||||
* 物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode
|
* 物模型标识符访问模式 JiShe.ServicePro.Core.DevicePropertyAccessMode
|
||||||
*/
|
*/
|
||||||
accessMode?: (string) | null;
|
accessMode?: (string) | null;
|
||||||
|
identifierType?: ThingModelIdentifierTypeEnum;
|
||||||
id?: string;
|
id?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -5949,6 +5961,11 @@ export type TenantDtoPagedResultDto = {
|
|||||||
totalCount?: number;
|
totalCount?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备物模型标识符类型枚举
|
||||||
|
*/
|
||||||
|
export type ThingModelIdentifierTypeEnum = 1 | 2;
|
||||||
|
|
||||||
export type TimeZone = {
|
export type TimeZone = {
|
||||||
iana?: IanaTimeZone;
|
iana?: IanaTimeZone;
|
||||||
windows?: WindowsTimeZone;
|
windows?: WindowsTimeZone;
|
||||||
|
|||||||
@ -228,10 +228,12 @@
|
|||||||
"StandardFieldDisplayName": "StandardFieldDisplayName",
|
"StandardFieldDisplayName": "StandardFieldDisplayName",
|
||||||
"IsValueNeedConvert": "IsValueNeedConvert",
|
"IsValueNeedConvert": "IsValueNeedConvert",
|
||||||
"AccessMode": "AccessMode",
|
"AccessMode": "AccessMode",
|
||||||
|
"IdentifierType": "IdentifierType",
|
||||||
"IsOperableIdentifier": "IsOperableIdentifier",
|
"IsOperableIdentifier": "IsOperableIdentifier",
|
||||||
"StandardFieldValueType": "StandardFieldValueType",
|
"StandardFieldValueType": "StandardFieldValueType",
|
||||||
"copyStandardThingModel": "CopyStandardThingModel",
|
"copyStandardThingModel": "CopyStandardThingModel",
|
||||||
"copyAnotherThingModelModal": "CopyAnotherThingModelModal"
|
"copyAnotherThingModelModal": "CopyAnotherThingModelModal",
|
||||||
|
"ioTPlatformProduct": "IoTPlatformProduct"
|
||||||
},
|
},
|
||||||
"IoTDBBase": {
|
"IoTDBBase": {
|
||||||
"IoTDataType": "IoTDataType",
|
"IoTDataType": "IoTDataType",
|
||||||
|
|||||||
@ -219,12 +219,14 @@
|
|||||||
"IoTPlatformRawFieldName": "平台物模型编码",
|
"IoTPlatformRawFieldName": "平台物模型编码",
|
||||||
"StandardFieldName": "标准物模型编码",
|
"StandardFieldName": "标准物模型编码",
|
||||||
"StandardFieldDisplayName": "标准物模型名称",
|
"StandardFieldDisplayName": "标准物模型名称",
|
||||||
"IsValueNeedConvert": "是否需要值类型转换",
|
"IsValueNeedConvert": "是否值类型转换",
|
||||||
"AccessMode": "访问模式",
|
"AccessMode": "访问模式",
|
||||||
"IsOperableIdentifier": "是否可操作物模型标识符",
|
"IdentifierType": "标识符类型",
|
||||||
|
"IsOperableIdentifier": "是否可操作标识符",
|
||||||
"StandardFieldValueType": "标准物模型值类型",
|
"StandardFieldValueType": "标准物模型值类型",
|
||||||
"copyStandardThingModel": "复制标准模型",
|
"copyStandardThingModel": "复制标准模型",
|
||||||
"copyAnotherThingModelModal": "复制已有模型"
|
"copyAnotherThingModelModal": "复制已有模型",
|
||||||
|
"ioTPlatformProduct": "所属产品"
|
||||||
},
|
},
|
||||||
"IoTDBBase": {
|
"IoTDBBase": {
|
||||||
"IoTDataType": "数据类型",
|
"IoTDataType": "数据类型",
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import { message as Message, Tag } from 'ant-design-vue';
|
|||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
|
getCommonGetSelectList,
|
||||||
postIoTplatformThingModelInfoCopyAnotherThingModelAsync,
|
postIoTplatformThingModelInfoCopyAnotherThingModelAsync,
|
||||||
postIoTplatformThingModelInfoCopyStandardThingModel,
|
postIoTplatformThingModelInfoCopyStandardThingModel,
|
||||||
postIoTplatformThingModelInfoCreateAsync,
|
postIoTplatformThingModelInfoCreateAsync,
|
||||||
@ -42,6 +43,41 @@ const productId = ref<string>((route.query.productId as string) || '');
|
|||||||
const productName = ref<string>((route.query.productName as string) || '');
|
const productName = ref<string>((route.query.productName as string) || '');
|
||||||
const ioTPlatform = ref<string>((route.query.ioTPlatform as string) || '2');
|
const ioTPlatform = ref<string>((route.query.ioTPlatform as string) || '2');
|
||||||
|
|
||||||
|
// 标识符类型选项映射
|
||||||
|
const identifierTypeMap = ref<Record<number | string, string>>({});
|
||||||
|
|
||||||
|
// 获取标识符类型选项
|
||||||
|
const loadIdentifierTypeOptions = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getCommonGetSelectList({
|
||||||
|
query: {
|
||||||
|
typeName: 'ThingModelIdentifierTypeEnum',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const items = Array.isArray(res.data)
|
||||||
|
? res.data
|
||||||
|
: Array.isArray(res.data?.items)
|
||||||
|
? res.data.items
|
||||||
|
: Array.isArray(res.data?.data)
|
||||||
|
? res.data.data
|
||||||
|
: [];
|
||||||
|
const map: Record<number | string, string> = {};
|
||||||
|
items.forEach((item: any) => {
|
||||||
|
if (item.key !== undefined && item.value) {
|
||||||
|
map[item.key] = item.value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
identifierTypeMap.value = map;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取标识符类型选项失败:', error);
|
||||||
|
// 使用默认映射
|
||||||
|
identifierTypeMap.value = {
|
||||||
|
1: '数据标识符',
|
||||||
|
2: '属性标识符',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const formOptions: VbenFormProps = {
|
const formOptions: VbenFormProps = {
|
||||||
schema: querySchema.value,
|
schema: querySchema.value,
|
||||||
initialValues: {
|
initialValues: {
|
||||||
@ -148,6 +184,21 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
queryParams.ioTPlatformProductId = String(currentProductId);
|
queryParams.ioTPlatformProductId = String(currentProductId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加访问模式参数
|
||||||
|
if (finalFormValues?.accessMode) {
|
||||||
|
queryParams.accessMode = finalFormValues.accessMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加标识符类型参数
|
||||||
|
if (
|
||||||
|
finalFormValues?.identifierType !== undefined &&
|
||||||
|
finalFormValues?.identifierType !== null
|
||||||
|
) {
|
||||||
|
queryParams.identifierType = Number.parseInt(
|
||||||
|
String(finalFormValues.identifierType),
|
||||||
|
) as 1 | 2;
|
||||||
|
}
|
||||||
|
|
||||||
const { data } = await postIoTplatformThingModelInfoPageAsync({
|
const { data } = await postIoTplatformThingModelInfoPageAsync({
|
||||||
body: queryParams,
|
body: queryParams,
|
||||||
});
|
});
|
||||||
@ -237,6 +288,12 @@ const [ThingModelModal, thingModelModalApi] = useVbenModal({
|
|||||||
...(isEdit ? editRow.value : {}),
|
...(isEdit ? editRow.value : {}),
|
||||||
_ioTPlatform: platformValue,
|
_ioTPlatform: platformValue,
|
||||||
_ioTPlatformProductId: productIdValue,
|
_ioTPlatformProductId: productIdValue,
|
||||||
|
// 确保 identifierType 转换为字符串格式,以便与下拉框的 key 匹配
|
||||||
|
...(isEdit &&
|
||||||
|
editRow.value.identifierType !== undefined &&
|
||||||
|
editRow.value.identifierType !== null && {
|
||||||
|
identifierType: String(editRow.value.identifierType),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 手动触发平台物模型编码字段的重新加载
|
// 手动触发平台物模型编码字段的重新加载
|
||||||
@ -423,6 +480,9 @@ watch(
|
|||||||
|
|
||||||
// 页面初始化时加载数据
|
// 页面初始化时加载数据
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
// 加载标识符类型选项
|
||||||
|
await loadIdentifierTypeOptions();
|
||||||
|
|
||||||
// 从路由参数初始化
|
// 从路由参数初始化
|
||||||
if (route.query.productId) {
|
if (route.query.productId) {
|
||||||
productId.value = route.query.productId as string;
|
productId.value = route.query.productId as string;
|
||||||
@ -483,9 +543,7 @@ async function submit() {
|
|||||||
? await gridApi.formApi.getValues()
|
? await gridApi.formApi.getValues()
|
||||||
: {};
|
: {};
|
||||||
finalProductId =
|
finalProductId =
|
||||||
searchFormValues.ioTPlatformProductId ||
|
searchFormValues.ioTPlatformProductId || productId.value || undefined;
|
||||||
productId.value ||
|
|
||||||
undefined;
|
|
||||||
if (finalProductId) {
|
if (finalProductId) {
|
||||||
finalProductId = String(finalProductId);
|
finalProductId = String(finalProductId);
|
||||||
}
|
}
|
||||||
@ -521,6 +579,13 @@ async function submit() {
|
|||||||
// 自动添加平台和产品信息
|
// 自动添加平台和产品信息
|
||||||
ioTPlatform: finalPlatform,
|
ioTPlatform: finalPlatform,
|
||||||
ioTPlatformProductId: finalProductId,
|
ioTPlatformProductId: finalProductId,
|
||||||
|
// 转换标识符类型为数字类型(如果存在)
|
||||||
|
...(formValues.identifierType !== undefined &&
|
||||||
|
formValues.identifierType !== null && {
|
||||||
|
identifierType: Number.parseInt(
|
||||||
|
String(formValues.identifierType),
|
||||||
|
) as 1 | 2,
|
||||||
|
}),
|
||||||
// 编辑时需要添加ID
|
// 编辑时需要添加ID
|
||||||
...(isEdit && { id: editRow.value.id }),
|
...(isEdit && { id: editRow.value.id }),
|
||||||
};
|
};
|
||||||
@ -562,6 +627,11 @@ async function onEdit(record: any) {
|
|||||||
...record,
|
...record,
|
||||||
_ioTPlatform: platformValue,
|
_ioTPlatform: platformValue,
|
||||||
_ioTPlatformProductId: productIdValue,
|
_ioTPlatformProductId: productIdValue,
|
||||||
|
// 确保 identifierType 转换为字符串格式,以便与下拉框的 key 匹配
|
||||||
|
...(record.identifierType !== undefined &&
|
||||||
|
record.identifierType !== null && {
|
||||||
|
identifierType: String(record.identifierType),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 手动触发平台物模型编码字段的重新加载
|
// 手动触发平台物模型编码字段的重新加载
|
||||||
@ -793,6 +863,35 @@ async function onDel(record: any) {
|
|||||||
" />
|
" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template #accessMode="{ row }">
|
||||||
|
<component :is="h(
|
||||||
|
Tag,
|
||||||
|
{
|
||||||
|
color:
|
||||||
|
row.accessMode === 'rw'
|
||||||
|
? 'green'
|
||||||
|
: row.accessMode === 'r'
|
||||||
|
? 'orange'
|
||||||
|
: row.accessMode === 'w'
|
||||||
|
? 'red'
|
||||||
|
: 'default',
|
||||||
|
},
|
||||||
|
() =>
|
||||||
|
row.accessMode === 'rw'
|
||||||
|
? '读写模式'
|
||||||
|
: row.accessMode === 'r'
|
||||||
|
? '只读模式'
|
||||||
|
: row.accessMode === 'w'
|
||||||
|
? '只写模式'
|
||||||
|
: '-',
|
||||||
|
)
|
||||||
|
" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #identifierType="{ row }">
|
||||||
|
{{ identifierTypeMap[row.identifierType] || '-' }}
|
||||||
|
</template>
|
||||||
|
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<TableAction :actions="[
|
<TableAction :actions="[
|
||||||
{
|
{
|
||||||
|
|||||||
@ -96,6 +96,70 @@ export const querySchema = computed(() => [
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
component: 'ApiSelect',
|
||||||
|
fieldName: 'accessMode',
|
||||||
|
label: $t('abp.thingModelInfos.AccessMode'),
|
||||||
|
componentProps: {
|
||||||
|
api: getCommonGetSelectList,
|
||||||
|
params: {
|
||||||
|
query: {
|
||||||
|
typeName: 'DevicePropertyAccessMode',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
labelField: 'value',
|
||||||
|
valueField: 'key',
|
||||||
|
optionsPropName: 'options',
|
||||||
|
immediate: true,
|
||||||
|
allowClear: true,
|
||||||
|
placeholder: `${$t('common.pleaseSelect')}${$t('abp.thingModelInfos.AccessMode')}`,
|
||||||
|
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: 'ApiSelect',
|
||||||
|
fieldName: 'identifierType',
|
||||||
|
label: $t('abp.thingModelInfos.IdentifierType'),
|
||||||
|
componentProps: {
|
||||||
|
api: getCommonGetSelectList,
|
||||||
|
params: {
|
||||||
|
query: {
|
||||||
|
typeName: 'ThingModelIdentifierTypeEnum',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
labelField: 'value',
|
||||||
|
valueField: 'key',
|
||||||
|
optionsPropName: 'options',
|
||||||
|
immediate: true,
|
||||||
|
allowClear: true,
|
||||||
|
placeholder: `${$t('common.pleaseSelect')}${$t('abp.thingModelInfos.IdentifierType')}`,
|
||||||
|
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',
|
component: 'Input',
|
||||||
fieldName: 'SearchKeyWords',
|
fieldName: 'SearchKeyWords',
|
||||||
@ -104,6 +168,13 @@ export const querySchema = computed(() => [
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
export const tableSchema = computed(() => [
|
export const tableSchema = computed(() => [
|
||||||
|
{
|
||||||
|
field: 'ioTPlatformProductId',
|
||||||
|
title: $t('abp.thingModelInfos.ioTPlatformProduct'),
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflow: 'tooltip',
|
||||||
|
fixed: 'left',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'filedTypeName',
|
field: 'filedTypeName',
|
||||||
title: $t('abp.thingModelInfos.FiledType'),
|
title: $t('abp.thingModelInfos.FiledType'),
|
||||||
@ -167,13 +238,14 @@ export const tableSchema = computed(() => [
|
|||||||
field: 'accessMode',
|
field: 'accessMode',
|
||||||
title: $t('abp.thingModelInfos.AccessMode'),
|
title: $t('abp.thingModelInfos.AccessMode'),
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
formatter: ({ cellValue }: { cellValue: any }) => {
|
slots: { default: 'accessMode' },
|
||||||
return cellValue === 'rw'
|
|
||||||
? '读写模式'
|
|
||||||
: cellValue === 'r'
|
|
||||||
? '只读模式'
|
|
||||||
: '只写模式';
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'identifierType',
|
||||||
|
title: $t('abp.thingModelInfos.IdentifierType'),
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflow: 'tooltip',
|
||||||
|
slots: { default: 'identifierType' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'isOperableIdentifier',
|
field: 'isOperableIdentifier',
|
||||||
@ -511,6 +583,39 @@ export const getAddThingModelFormSchema = (
|
|||||||
style: { width: 'auto' },
|
style: { width: 'auto' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
component: 'ApiSelect',
|
||||||
|
fieldName: 'identifierType',
|
||||||
|
label: $t('abp.thingModelInfos.IdentifierType'),
|
||||||
|
componentProps: {
|
||||||
|
api: getCommonGetSelectList,
|
||||||
|
params: {
|
||||||
|
query: {
|
||||||
|
typeName: 'ThingModelIdentifierTypeEnum',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
labelField: 'value',
|
||||||
|
valueField: 'key',
|
||||||
|
optionsPropName: 'options',
|
||||||
|
immediate: true,
|
||||||
|
allowClear: true,
|
||||||
|
placeholder:
|
||||||
|
$t('common.pleaseSelect') + $t('abp.thingModelInfos.IdentifierType'),
|
||||||
|
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: 'ApiSelect',
|
component: 'ApiSelect',
|
||||||
fieldName: 'ioTPlatformRawFieldDataType',
|
fieldName: 'ioTPlatformRawFieldDataType',
|
||||||
@ -872,6 +977,39 @@ export const getEditThingModelFormSchema = (
|
|||||||
style: { width: 'auto' },
|
style: { width: 'auto' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
component: 'ApiSelect',
|
||||||
|
fieldName: 'identifierType',
|
||||||
|
label: $t('abp.thingModelInfos.IdentifierType'),
|
||||||
|
componentProps: {
|
||||||
|
api: getCommonGetSelectList,
|
||||||
|
params: {
|
||||||
|
query: {
|
||||||
|
typeName: 'ThingModelIdentifierTypeEnum',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
labelField: 'value',
|
||||||
|
valueField: 'key',
|
||||||
|
optionsPropName: 'options',
|
||||||
|
immediate: true,
|
||||||
|
allowClear: true,
|
||||||
|
placeholder:
|
||||||
|
$t('common.pleaseSelect') + $t('abp.thingModelInfos.IdentifierType'),
|
||||||
|
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: 'ApiSelect',
|
component: 'ApiSelect',
|
||||||
fieldName: 'ioTPlatformRawFieldDataType',
|
fieldName: 'ioTPlatformRawFieldDataType',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user