diff --git a/packages/amis-core/src/types.ts b/packages/amis-core/src/types.ts index c47c34502..d287b85a4 100644 --- a/packages/amis-core/src/types.ts +++ b/packages/amis-core/src/types.ts @@ -382,6 +382,7 @@ export type FunctionPropertyNames = { export type JSONSchema = JSONSchema7 & { group?: string; // 分组 + typeLabel?: string; // 类型说明 }; // export type Omit = Pick>; diff --git a/packages/amis-core/src/utils/DataScope.ts b/packages/amis-core/src/utils/DataScope.ts index 130d3c107..8f4618f38 100644 --- a/packages/amis-core/src/utils/DataScope.ts +++ b/packages/amis-core/src/utils/DataScope.ts @@ -1,6 +1,15 @@ import {JSONSchema} from '../types'; import {guid, keyToPath, mapTree} from './helper'; +const TYPE_MAP: {[type: string]: string} = { + boolean: '布尔', + integer: '整数', + number: '数字', + string: '文本', + array: '数组', + object: '对象' +}; + export class DataScope { // 指向父级 parent?: DataScope; @@ -213,7 +222,7 @@ export class DataScope { value: schema.title === '成员' ? '' : path.value, path: schema.title === '成员' ? '' : path.label, type: schema.type, - tag: schema.type, + tag: schema.typeLabel ?? TYPE_MAP[schema.type as string] ?? schema.type, description: schema.description, isMember, disabled: schema.title === '成员'