up.
This commit is contained in:
parent
d936c9f26c
commit
12cc7a78ff
54
z_ele/src/enum/config-item-type.ts
Normal file
54
z_ele/src/enum/config-item-type.ts
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 配置类型
|
||||
*/
|
||||
export enum ItemType {
|
||||
SEPARATOR = "-",
|
||||
ALERT = "alert",
|
||||
CARD = "card",
|
||||
COLLAPSE = "collapse",
|
||||
TABS = "tabs",
|
||||
TEXT = "text",
|
||||
TEXTAREA = "textarea",
|
||||
PASSWORD = "password",
|
||||
CHECKBOX = "checkbox",
|
||||
RADIO = "radio",
|
||||
DATE = "date",
|
||||
DATETIME = "datetime",
|
||||
TIME = "time",
|
||||
SWITCH = "switch",
|
||||
HIDDEN = "hidden",
|
||||
TIME_SECOND = "time", // 注意:第二个 time 使用不同名称
|
||||
RANGE = "range",
|
||||
DATE_RANGE = "date_range",
|
||||
DATETIME_RANGE = "datetime_range",
|
||||
TIME_RANGE = "time_range",
|
||||
NUMBER = "number"
|
||||
}
|
||||
|
||||
export const ItemLabels: Record<ItemType, string> = {
|
||||
[ItemType.SEPARATOR]: "分割线",
|
||||
[ItemType.ALERT]: "提示",
|
||||
[ItemType.CARD]: "卡片",
|
||||
[ItemType.COLLAPSE]: "折叠面板",
|
||||
[ItemType.TABS]: "Tabs",
|
||||
[ItemType.TEXT]: "单行文本",
|
||||
[ItemType.TEXTAREA]: "多行文本",
|
||||
[ItemType.PASSWORD]: "密码",
|
||||
[ItemType.CHECKBOX]: "复选框",
|
||||
[ItemType.RADIO]: "单选按钮",
|
||||
[ItemType.DATE]: "日期",
|
||||
[ItemType.DATETIME]: "日期+时间",
|
||||
[ItemType.TIME]: "时间",
|
||||
[ItemType.SWITCH]: "开关",
|
||||
[ItemType.HIDDEN]: "隐藏",
|
||||
[ItemType.TIME_SECOND]: "时间",
|
||||
[ItemType.RANGE]: "范围",
|
||||
[ItemType.DATE_RANGE]: "日期范围",
|
||||
[ItemType.DATETIME_RANGE]: "日期时间范围",
|
||||
[ItemType.TIME_RANGE]: "时间范围",
|
||||
[ItemType.NUMBER]: "数字",
|
||||
};
|
||||
|
||||
export function getItemLabel(type: ComponentType): string {
|
||||
return ItemLabels[type] || type.toString();
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user