mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
Merge pull request #7259 from hsm-lv/feat-dataschema
feat:dataschema增加typeLabel
This commit is contained in:
commit
597a257c98
@ -382,6 +382,7 @@ export type FunctionPropertyNames<T> = {
|
|||||||
|
|
||||||
export type JSONSchema = JSONSchema7 & {
|
export type JSONSchema = JSONSchema7 & {
|
||||||
group?: string; // 分组
|
group?: string; // 分组
|
||||||
|
typeLabel?: string; // 类型说明
|
||||||
};
|
};
|
||||||
|
|
||||||
// export type Omit<T, K extends keyof T & any> = Pick<T, Exclude<keyof T, K>>;
|
// export type Omit<T, K extends keyof T & any> = Pick<T, Exclude<keyof T, K>>;
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
import {JSONSchema} from '../types';
|
import {JSONSchema} from '../types';
|
||||||
import {guid, keyToPath, mapTree} from './helper';
|
import {guid, keyToPath, mapTree} from './helper';
|
||||||
|
|
||||||
|
const TYPE_MAP: {[type: string]: string} = {
|
||||||
|
boolean: '布尔',
|
||||||
|
integer: '整数',
|
||||||
|
number: '数字',
|
||||||
|
string: '文本',
|
||||||
|
array: '数组',
|
||||||
|
object: '对象'
|
||||||
|
};
|
||||||
|
|
||||||
export class DataScope {
|
export class DataScope {
|
||||||
// 指向父级
|
// 指向父级
|
||||||
parent?: DataScope;
|
parent?: DataScope;
|
||||||
@ -213,7 +222,7 @@ export class DataScope {
|
|||||||
value: schema.title === '成员' ? '' : path.value,
|
value: schema.title === '成员' ? '' : path.value,
|
||||||
path: schema.title === '成员' ? '' : path.label,
|
path: schema.title === '成员' ? '' : path.label,
|
||||||
type: schema.type,
|
type: schema.type,
|
||||||
tag: schema.type,
|
tag: schema.typeLabel ?? TYPE_MAP[schema.type as string] ?? schema.type,
|
||||||
description: schema.description,
|
description: schema.description,
|
||||||
isMember,
|
isMember,
|
||||||
disabled: schema.title === '成员'
|
disabled: schema.title === '成员'
|
||||||
|
Loading…
Reference in New Issue
Block a user