@me-framework/me-ui-antdv-next 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.en.md +82 -0
- package/README.md +82 -0
- package/dist/components/body/index.d.ts +4 -0
- package/dist/components/body/index.vue.d.ts +176 -0
- package/dist/components/body/types.d.ts +30 -0
- package/dist/components/box/index.d.ts +4 -0
- package/dist/components/box/index.vue.d.ts +120 -0
- package/dist/components/box/types.d.ts +34 -0
- package/dist/components/breadcrumb/index.d.ts +4 -0
- package/dist/components/breadcrumb/index.vue.d.ts +31 -0
- package/dist/components/breadcrumb/types.d.ts +76 -0
- package/dist/components/icon/index.d.ts +16 -0
- package/dist/components/icon/index.vue.d.ts +129 -0
- package/dist/components/icon/types.d.ts +32 -0
- package/dist/components/input-gps/index.d.ts +4 -0
- package/dist/components/input-gps/index.vue.d.ts +19 -0
- package/dist/components/input-gps/map.vue.d.ts +21 -0
- package/dist/components/input-gps/types.d.ts +44 -0
- package/dist/components/input-icon-selector/index.d.ts +4 -0
- package/dist/components/input-icon-selector/index.vue.d.ts +33 -0
- package/dist/components/input-icon-selector/types.d.ts +39 -0
- package/dist/components/input-radio/index.d.ts +4 -0
- package/dist/components/input-radio/index.vue.d.ts +106 -0
- package/dist/components/input-radio/types.d.ts +23 -0
- package/dist/components/menu/MenuTreeItem.vue.d.ts +14 -0
- package/dist/components/menu/index.d.ts +4 -0
- package/dist/components/menu/index.vue.d.ts +50 -0
- package/dist/components/menu/types.d.ts +270 -0
- package/dist/components/message/index.d.ts +16 -0
- package/dist/components/message/index.vue.d.ts +39 -0
- package/dist/components/message/types.d.ts +97 -0
- package/dist/components/modal/index.d.ts +4 -0
- package/dist/components/modal/index.vue.d.ts +36 -0
- package/dist/components/modal/types.d.ts +24 -0
- package/dist/components/nav/index.d.ts +4 -0
- package/dist/components/nav/index.vue.d.ts +37 -0
- package/dist/components/nav/types.d.ts +102 -0
- package/dist/components/tree-menu/TreeMenuActions.vue.d.ts +35 -0
- package/dist/components/tree-menu/TreeMenuCard.vue.d.ts +40 -0
- package/dist/components/tree-menu/TreeMenuEdit.vue.d.ts +127 -0
- package/dist/components/tree-menu/TreeMenuNode.vue.d.ts +40 -0
- package/dist/components/tree-menu/index.d.ts +4 -0
- package/dist/components/tree-menu/index.vue.d.ts +345 -0
- package/dist/components/tree-menu/types.d.ts +133 -0
- package/dist/composables/useColor.d.ts +8 -0
- package/dist/data/menu.json +3686 -0
- package/dist/icons/me-icon-test.svg +3 -0
- package/dist/images/bg/0.jpg +0 -0
- package/dist/images/logo/0.svg +24 -0
- package/dist/index.d.ts +35 -0
- package/dist/me-ui-antdv-next.css +2 -0
- package/dist/me-ui-antdv-next.js +90528 -0
- package/dist/me-ui-antdv-next.umd.cjs +262 -0
- package/dist/shims-vue.d.ts +25 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/utils/index.d.ts +16 -0
- package/dist/vite.svg +10 -0
- package/package.json +99 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare var __VLS_15: {}, __VLS_17: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
'header-right'?: (props: typeof __VLS_15) => any;
|
|
4
|
+
} & {
|
|
5
|
+
default?: (props: typeof __VLS_17) => any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
8
|
+
/** 卡片标题 */
|
|
9
|
+
title: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
/** 标题图标名称 */
|
|
14
|
+
icon: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
19
|
+
/** 卡片标题 */
|
|
20
|
+
title: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
/** 标题图标名称 */
|
|
25
|
+
icon: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
}>> & Readonly<{}>, {
|
|
30
|
+
title: string;
|
|
31
|
+
icon: string;
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
33
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { MeTreeMenuData, MeTreeMenuTitleType, MeInputIconSelectorSource } from './types';
|
|
3
|
+
declare var __VLS_9: {}, __VLS_134: {}, __VLS_170: {}, __VLS_218: {};
|
|
4
|
+
type __VLS_Slots = {} & {
|
|
5
|
+
'header-submit'?: (props: typeof __VLS_9) => any;
|
|
6
|
+
} & {
|
|
7
|
+
'edit-icon-selector'?: (props: typeof __VLS_134) => any;
|
|
8
|
+
} & {
|
|
9
|
+
'edit-cover'?: (props: typeof __VLS_170) => any;
|
|
10
|
+
} & {
|
|
11
|
+
default?: (props: typeof __VLS_218) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
14
|
+
/** 树节点数据列表(用于上级选择) */
|
|
15
|
+
list: {
|
|
16
|
+
type: PropType<MeTreeMenuData[]>;
|
|
17
|
+
default: () => MeTreeMenuData[];
|
|
18
|
+
};
|
|
19
|
+
/** 表单数据 */
|
|
20
|
+
form: {
|
|
21
|
+
type: PropType<MeTreeMenuData>;
|
|
22
|
+
default: () => MeTreeMenuData;
|
|
23
|
+
};
|
|
24
|
+
/** 编辑类型:create / create-child / edit / copy */
|
|
25
|
+
titleType: {
|
|
26
|
+
type: PropType<MeTreeMenuTitleType>;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
/** 节点标签名称,用于标题拼接 */
|
|
30
|
+
label: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
/** 编辑面板标题(优先级高于自动生成) */
|
|
35
|
+
editTitle: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
/** 表单校验规则 */
|
|
40
|
+
rules: {
|
|
41
|
+
type: PropType<Record<string, any[]>>;
|
|
42
|
+
default: () => Record<string, any[]>;
|
|
43
|
+
};
|
|
44
|
+
/** 表单组件尺寸 */
|
|
45
|
+
size: {
|
|
46
|
+
type: PropType<"large" | "middle" | "small">;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
49
|
+
/** 图标选择器可选来源 */
|
|
50
|
+
iconSources: {
|
|
51
|
+
type: PropType<MeInputIconSelectorSource[]>;
|
|
52
|
+
default: () => MeInputIconSelectorSource[];
|
|
53
|
+
};
|
|
54
|
+
/** iconfont 图标数据列表 */
|
|
55
|
+
iconfontData: {
|
|
56
|
+
type: PropType<string[]>;
|
|
57
|
+
default: () => string[];
|
|
58
|
+
};
|
|
59
|
+
}>, {
|
|
60
|
+
open: () => void;
|
|
61
|
+
close: () => void;
|
|
62
|
+
validate: () => Promise<boolean>;
|
|
63
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
64
|
+
/** 树节点数据列表(用于上级选择) */
|
|
65
|
+
list: {
|
|
66
|
+
type: PropType<MeTreeMenuData[]>;
|
|
67
|
+
default: () => MeTreeMenuData[];
|
|
68
|
+
};
|
|
69
|
+
/** 表单数据 */
|
|
70
|
+
form: {
|
|
71
|
+
type: PropType<MeTreeMenuData>;
|
|
72
|
+
default: () => MeTreeMenuData;
|
|
73
|
+
};
|
|
74
|
+
/** 编辑类型:create / create-child / edit / copy */
|
|
75
|
+
titleType: {
|
|
76
|
+
type: PropType<MeTreeMenuTitleType>;
|
|
77
|
+
default: string;
|
|
78
|
+
};
|
|
79
|
+
/** 节点标签名称,用于标题拼接 */
|
|
80
|
+
label: {
|
|
81
|
+
type: StringConstructor;
|
|
82
|
+
default: string;
|
|
83
|
+
};
|
|
84
|
+
/** 编辑面板标题(优先级高于自动生成) */
|
|
85
|
+
editTitle: {
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
default: string;
|
|
88
|
+
};
|
|
89
|
+
/** 表单校验规则 */
|
|
90
|
+
rules: {
|
|
91
|
+
type: PropType<Record<string, any[]>>;
|
|
92
|
+
default: () => Record<string, any[]>;
|
|
93
|
+
};
|
|
94
|
+
/** 表单组件尺寸 */
|
|
95
|
+
size: {
|
|
96
|
+
type: PropType<"large" | "middle" | "small">;
|
|
97
|
+
default: string;
|
|
98
|
+
};
|
|
99
|
+
/** 图标选择器可选来源 */
|
|
100
|
+
iconSources: {
|
|
101
|
+
type: PropType<MeInputIconSelectorSource[]>;
|
|
102
|
+
default: () => MeInputIconSelectorSource[];
|
|
103
|
+
};
|
|
104
|
+
/** iconfont 图标数据列表 */
|
|
105
|
+
iconfontData: {
|
|
106
|
+
type: PropType<string[]>;
|
|
107
|
+
default: () => string[];
|
|
108
|
+
};
|
|
109
|
+
}>> & Readonly<{}>, {
|
|
110
|
+
size: "small" | "large" | "middle";
|
|
111
|
+
form: MeTreeMenuData;
|
|
112
|
+
label: string;
|
|
113
|
+
iconfontData: string[];
|
|
114
|
+
list: MeTreeMenuData[];
|
|
115
|
+
titleType: MeTreeMenuTitleType;
|
|
116
|
+
editTitle: string;
|
|
117
|
+
rules: Record<string, any[]>;
|
|
118
|
+
iconSources: MeInputIconSelectorSource[];
|
|
119
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
120
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
121
|
+
declare const _default: typeof __VLS_export;
|
|
122
|
+
export default _default;
|
|
123
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
124
|
+
new (): {
|
|
125
|
+
$slots: S;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { MeTreeMenuAction, MeTreeMenuData } from './types';
|
|
3
|
+
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
/** 动作标签配置列表 */
|
|
5
|
+
actions: {
|
|
6
|
+
type: PropType<MeTreeMenuAction[]>;
|
|
7
|
+
default: () => MeTreeMenuAction[];
|
|
8
|
+
};
|
|
9
|
+
/** 节点标题 */
|
|
10
|
+
nodeTitle: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
/** 节点数据 */
|
|
15
|
+
data: {
|
|
16
|
+
type: PropType<MeTreeMenuData>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
/** 动作标签配置列表 */
|
|
21
|
+
actions: {
|
|
22
|
+
type: PropType<MeTreeMenuAction[]>;
|
|
23
|
+
default: () => MeTreeMenuAction[];
|
|
24
|
+
};
|
|
25
|
+
/** 节点标题 */
|
|
26
|
+
nodeTitle: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
/** 节点数据 */
|
|
31
|
+
data: {
|
|
32
|
+
type: PropType<MeTreeMenuData>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{}>, {
|
|
36
|
+
actions: MeTreeMenuAction[];
|
|
37
|
+
nodeTitle: string;
|
|
38
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
39
|
+
declare const _default: typeof __VLS_export;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { MeTreeMenuData, MeTreeMenuAction, MeTreeMenuInstance, MeTreeMenuItem, MeTreeMenuMoveConfirm, MeInputIconSelectorSource } from './types';
|
|
3
|
+
declare var __VLS_13: {}, __VLS_33: {}, __VLS_61: {
|
|
4
|
+
data: import('antdv-next').TreeDataNode;
|
|
5
|
+
}, __VLS_89: {}, __VLS_109: {}, __VLS_112: {}, __VLS_115: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
header?: (props: typeof __VLS_13) => any;
|
|
8
|
+
} & {
|
|
9
|
+
'dropdown-item'?: (props: typeof __VLS_33) => any;
|
|
10
|
+
} & {
|
|
11
|
+
label?: (props: typeof __VLS_61) => any;
|
|
12
|
+
} & {
|
|
13
|
+
right?: (props: typeof __VLS_89) => any;
|
|
14
|
+
} & {
|
|
15
|
+
'edit-icon-selector'?: (props: typeof __VLS_109) => any;
|
|
16
|
+
} & {
|
|
17
|
+
'edit-cover'?: (props: typeof __VLS_112) => any;
|
|
18
|
+
} & {
|
|
19
|
+
edit?: (props: typeof __VLS_115) => any;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
22
|
+
/** 树节点数据列表 */
|
|
23
|
+
list: {
|
|
24
|
+
type: PropType<MeTreeMenuData[]>;
|
|
25
|
+
default: () => MeTreeMenuData[];
|
|
26
|
+
};
|
|
27
|
+
/** 是否显示复选框 */
|
|
28
|
+
showCheckbox: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
/** 是否开启拖拽 */
|
|
33
|
+
draggable: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
/** 是否显示搜索框 */
|
|
38
|
+
showFilter: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
/** 是否显示树连接线 */
|
|
43
|
+
showLine: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: boolean;
|
|
46
|
+
};
|
|
47
|
+
/** 树节点缩进(px) */
|
|
48
|
+
indent: {
|
|
49
|
+
type: NumberConstructor;
|
|
50
|
+
default: number;
|
|
51
|
+
};
|
|
52
|
+
/** 左侧面板宽度(px 或 CSS 值) */
|
|
53
|
+
leftWidth: {
|
|
54
|
+
type: PropType<number | string>;
|
|
55
|
+
default: number;
|
|
56
|
+
};
|
|
57
|
+
/** 搜索防抖时间(ms) */
|
|
58
|
+
filterDebounce: {
|
|
59
|
+
type: NumberConstructor;
|
|
60
|
+
default: number;
|
|
61
|
+
};
|
|
62
|
+
/** 树节点配置(对应 a-tree 的 fieldNames) */
|
|
63
|
+
treeProps: {
|
|
64
|
+
type: PropType<{
|
|
65
|
+
title?: string;
|
|
66
|
+
key?: string;
|
|
67
|
+
children?: string;
|
|
68
|
+
}>;
|
|
69
|
+
default: () => {
|
|
70
|
+
title?: string;
|
|
71
|
+
key?: string;
|
|
72
|
+
children?: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
/** 节点唯一标识字段 */
|
|
76
|
+
nodeKey: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
default: string;
|
|
79
|
+
};
|
|
80
|
+
/** 节点标签名称,用于右键菜单文案拼接(如"菜单"、"分类") */
|
|
81
|
+
label: {
|
|
82
|
+
type: StringConstructor;
|
|
83
|
+
default: string;
|
|
84
|
+
};
|
|
85
|
+
/** 表单数据(右侧编辑区使用) */
|
|
86
|
+
form: {
|
|
87
|
+
type: PropType<MeTreeMenuData>;
|
|
88
|
+
default: () => MeTreeMenuData;
|
|
89
|
+
};
|
|
90
|
+
/** 动作标签配置(v-model:actions) */
|
|
91
|
+
actions: {
|
|
92
|
+
type: PropType<MeTreeMenuAction[]>;
|
|
93
|
+
default: () => MeTreeMenuAction[];
|
|
94
|
+
};
|
|
95
|
+
/** 初始展开的节点 key */
|
|
96
|
+
expandKeys: {
|
|
97
|
+
type: PropType<string[] | string>;
|
|
98
|
+
default: () => string[];
|
|
99
|
+
};
|
|
100
|
+
/** 编辑区标题(优先级高于自动生成) */
|
|
101
|
+
editTitle: {
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
default: string;
|
|
104
|
+
};
|
|
105
|
+
/** 节点移动 API 方法 */
|
|
106
|
+
apiMoveHandle: {
|
|
107
|
+
type: PropType<(data?: any) => Promise<any>>;
|
|
108
|
+
default: undefined;
|
|
109
|
+
};
|
|
110
|
+
/** 重新获取数据方法 */
|
|
111
|
+
fetchDataHandle: {
|
|
112
|
+
type: PropType<(data?: any) => void>;
|
|
113
|
+
default: undefined;
|
|
114
|
+
};
|
|
115
|
+
/** 打开编辑面板方法(不传则使用内置逻辑) */
|
|
116
|
+
openHandle: {
|
|
117
|
+
type: PropType<() => void>;
|
|
118
|
+
default: undefined;
|
|
119
|
+
};
|
|
120
|
+
/** 自定义右键菜单项生成方法 */
|
|
121
|
+
nodeMenuItemHandle: {
|
|
122
|
+
type: PropType<(data: MeTreeMenuData) => MeTreeMenuItem[]>;
|
|
123
|
+
default: undefined;
|
|
124
|
+
};
|
|
125
|
+
/** 自定义节点过滤方法,不传则按 title 字段过滤 */
|
|
126
|
+
filterNodeMethod: {
|
|
127
|
+
type: PropType<(value: string, data: MeTreeMenuData) => boolean>;
|
|
128
|
+
default: undefined;
|
|
129
|
+
};
|
|
130
|
+
/** 节点移动确认配置 */
|
|
131
|
+
moveConfirm: {
|
|
132
|
+
type: PropType<MeTreeMenuMoveConfirm>;
|
|
133
|
+
default: () => MeTreeMenuMoveConfirm;
|
|
134
|
+
};
|
|
135
|
+
/** 是否显示节点移动确认框 */
|
|
136
|
+
showMoveConfirm: {
|
|
137
|
+
type: BooleanConstructor;
|
|
138
|
+
default: boolean;
|
|
139
|
+
};
|
|
140
|
+
/** 表单组件尺寸 */
|
|
141
|
+
formSize: {
|
|
142
|
+
type: PropType<"large" | "middle" | "small">;
|
|
143
|
+
default: string;
|
|
144
|
+
};
|
|
145
|
+
/** 图标选择器可选来源 */
|
|
146
|
+
iconSources: {
|
|
147
|
+
type: PropType<MeInputIconSelectorSource[]>;
|
|
148
|
+
default: () => MeInputIconSelectorSource[];
|
|
149
|
+
};
|
|
150
|
+
/** iconfont 图标数据列表 */
|
|
151
|
+
iconfontData: {
|
|
152
|
+
type: PropType<string[]>;
|
|
153
|
+
default: () => string[];
|
|
154
|
+
};
|
|
155
|
+
}>, MeTreeMenuInstance, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
156
|
+
create: () => any;
|
|
157
|
+
"node-click": (data: MeTreeMenuData) => any;
|
|
158
|
+
"context-menu-add": (data: MeTreeMenuData) => any;
|
|
159
|
+
"context-menu-edit": (data: MeTreeMenuData) => any;
|
|
160
|
+
"context-menu-remove": (data: MeTreeMenuData) => any;
|
|
161
|
+
"context-menu-copy": (data: MeTreeMenuData) => any;
|
|
162
|
+
update: (form: MeTreeMenuData) => any;
|
|
163
|
+
"update:actions": (actions: MeTreeMenuAction[]) => any;
|
|
164
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
165
|
+
/** 树节点数据列表 */
|
|
166
|
+
list: {
|
|
167
|
+
type: PropType<MeTreeMenuData[]>;
|
|
168
|
+
default: () => MeTreeMenuData[];
|
|
169
|
+
};
|
|
170
|
+
/** 是否显示复选框 */
|
|
171
|
+
showCheckbox: {
|
|
172
|
+
type: BooleanConstructor;
|
|
173
|
+
default: boolean;
|
|
174
|
+
};
|
|
175
|
+
/** 是否开启拖拽 */
|
|
176
|
+
draggable: {
|
|
177
|
+
type: BooleanConstructor;
|
|
178
|
+
default: boolean;
|
|
179
|
+
};
|
|
180
|
+
/** 是否显示搜索框 */
|
|
181
|
+
showFilter: {
|
|
182
|
+
type: BooleanConstructor;
|
|
183
|
+
default: boolean;
|
|
184
|
+
};
|
|
185
|
+
/** 是否显示树连接线 */
|
|
186
|
+
showLine: {
|
|
187
|
+
type: BooleanConstructor;
|
|
188
|
+
default: boolean;
|
|
189
|
+
};
|
|
190
|
+
/** 树节点缩进(px) */
|
|
191
|
+
indent: {
|
|
192
|
+
type: NumberConstructor;
|
|
193
|
+
default: number;
|
|
194
|
+
};
|
|
195
|
+
/** 左侧面板宽度(px 或 CSS 值) */
|
|
196
|
+
leftWidth: {
|
|
197
|
+
type: PropType<number | string>;
|
|
198
|
+
default: number;
|
|
199
|
+
};
|
|
200
|
+
/** 搜索防抖时间(ms) */
|
|
201
|
+
filterDebounce: {
|
|
202
|
+
type: NumberConstructor;
|
|
203
|
+
default: number;
|
|
204
|
+
};
|
|
205
|
+
/** 树节点配置(对应 a-tree 的 fieldNames) */
|
|
206
|
+
treeProps: {
|
|
207
|
+
type: PropType<{
|
|
208
|
+
title?: string;
|
|
209
|
+
key?: string;
|
|
210
|
+
children?: string;
|
|
211
|
+
}>;
|
|
212
|
+
default: () => {
|
|
213
|
+
title?: string;
|
|
214
|
+
key?: string;
|
|
215
|
+
children?: string;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
/** 节点唯一标识字段 */
|
|
219
|
+
nodeKey: {
|
|
220
|
+
type: StringConstructor;
|
|
221
|
+
default: string;
|
|
222
|
+
};
|
|
223
|
+
/** 节点标签名称,用于右键菜单文案拼接(如"菜单"、"分类") */
|
|
224
|
+
label: {
|
|
225
|
+
type: StringConstructor;
|
|
226
|
+
default: string;
|
|
227
|
+
};
|
|
228
|
+
/** 表单数据(右侧编辑区使用) */
|
|
229
|
+
form: {
|
|
230
|
+
type: PropType<MeTreeMenuData>;
|
|
231
|
+
default: () => MeTreeMenuData;
|
|
232
|
+
};
|
|
233
|
+
/** 动作标签配置(v-model:actions) */
|
|
234
|
+
actions: {
|
|
235
|
+
type: PropType<MeTreeMenuAction[]>;
|
|
236
|
+
default: () => MeTreeMenuAction[];
|
|
237
|
+
};
|
|
238
|
+
/** 初始展开的节点 key */
|
|
239
|
+
expandKeys: {
|
|
240
|
+
type: PropType<string[] | string>;
|
|
241
|
+
default: () => string[];
|
|
242
|
+
};
|
|
243
|
+
/** 编辑区标题(优先级高于自动生成) */
|
|
244
|
+
editTitle: {
|
|
245
|
+
type: StringConstructor;
|
|
246
|
+
default: string;
|
|
247
|
+
};
|
|
248
|
+
/** 节点移动 API 方法 */
|
|
249
|
+
apiMoveHandle: {
|
|
250
|
+
type: PropType<(data?: any) => Promise<any>>;
|
|
251
|
+
default: undefined;
|
|
252
|
+
};
|
|
253
|
+
/** 重新获取数据方法 */
|
|
254
|
+
fetchDataHandle: {
|
|
255
|
+
type: PropType<(data?: any) => void>;
|
|
256
|
+
default: undefined;
|
|
257
|
+
};
|
|
258
|
+
/** 打开编辑面板方法(不传则使用内置逻辑) */
|
|
259
|
+
openHandle: {
|
|
260
|
+
type: PropType<() => void>;
|
|
261
|
+
default: undefined;
|
|
262
|
+
};
|
|
263
|
+
/** 自定义右键菜单项生成方法 */
|
|
264
|
+
nodeMenuItemHandle: {
|
|
265
|
+
type: PropType<(data: MeTreeMenuData) => MeTreeMenuItem[]>;
|
|
266
|
+
default: undefined;
|
|
267
|
+
};
|
|
268
|
+
/** 自定义节点过滤方法,不传则按 title 字段过滤 */
|
|
269
|
+
filterNodeMethod: {
|
|
270
|
+
type: PropType<(value: string, data: MeTreeMenuData) => boolean>;
|
|
271
|
+
default: undefined;
|
|
272
|
+
};
|
|
273
|
+
/** 节点移动确认配置 */
|
|
274
|
+
moveConfirm: {
|
|
275
|
+
type: PropType<MeTreeMenuMoveConfirm>;
|
|
276
|
+
default: () => MeTreeMenuMoveConfirm;
|
|
277
|
+
};
|
|
278
|
+
/** 是否显示节点移动确认框 */
|
|
279
|
+
showMoveConfirm: {
|
|
280
|
+
type: BooleanConstructor;
|
|
281
|
+
default: boolean;
|
|
282
|
+
};
|
|
283
|
+
/** 表单组件尺寸 */
|
|
284
|
+
formSize: {
|
|
285
|
+
type: PropType<"large" | "middle" | "small">;
|
|
286
|
+
default: string;
|
|
287
|
+
};
|
|
288
|
+
/** 图标选择器可选来源 */
|
|
289
|
+
iconSources: {
|
|
290
|
+
type: PropType<MeInputIconSelectorSource[]>;
|
|
291
|
+
default: () => MeInputIconSelectorSource[];
|
|
292
|
+
};
|
|
293
|
+
/** iconfont 图标数据列表 */
|
|
294
|
+
iconfontData: {
|
|
295
|
+
type: PropType<string[]>;
|
|
296
|
+
default: () => string[];
|
|
297
|
+
};
|
|
298
|
+
}>> & Readonly<{
|
|
299
|
+
onCreate?: (() => any) | undefined;
|
|
300
|
+
"onNode-click"?: ((data: MeTreeMenuData) => any) | undefined;
|
|
301
|
+
"onContext-menu-add"?: ((data: MeTreeMenuData) => any) | undefined;
|
|
302
|
+
"onContext-menu-edit"?: ((data: MeTreeMenuData) => any) | undefined;
|
|
303
|
+
"onContext-menu-remove"?: ((data: MeTreeMenuData) => any) | undefined;
|
|
304
|
+
"onContext-menu-copy"?: ((data: MeTreeMenuData) => any) | undefined;
|
|
305
|
+
onUpdate?: ((form: MeTreeMenuData) => any) | undefined;
|
|
306
|
+
"onUpdate:actions"?: ((actions: MeTreeMenuAction[]) => any) | undefined;
|
|
307
|
+
}>, {
|
|
308
|
+
form: MeTreeMenuData;
|
|
309
|
+
label: string;
|
|
310
|
+
leftWidth: string | number;
|
|
311
|
+
iconfontData: string[];
|
|
312
|
+
showLine: boolean;
|
|
313
|
+
draggable: boolean;
|
|
314
|
+
actions: MeTreeMenuAction[];
|
|
315
|
+
list: MeTreeMenuData[];
|
|
316
|
+
editTitle: string;
|
|
317
|
+
iconSources: MeInputIconSelectorSource[];
|
|
318
|
+
showCheckbox: boolean;
|
|
319
|
+
showFilter: boolean;
|
|
320
|
+
indent: number;
|
|
321
|
+
filterDebounce: number;
|
|
322
|
+
treeProps: {
|
|
323
|
+
title?: string;
|
|
324
|
+
key?: string;
|
|
325
|
+
children?: string;
|
|
326
|
+
};
|
|
327
|
+
nodeKey: string;
|
|
328
|
+
expandKeys: string | string[];
|
|
329
|
+
apiMoveHandle: (data?: any) => Promise<any>;
|
|
330
|
+
fetchDataHandle: (data?: any) => void;
|
|
331
|
+
openHandle: () => void;
|
|
332
|
+
nodeMenuItemHandle: (data: MeTreeMenuData) => MeTreeMenuItem[];
|
|
333
|
+
filterNodeMethod: (value: string, data: MeTreeMenuData) => boolean;
|
|
334
|
+
moveConfirm: MeTreeMenuMoveConfirm;
|
|
335
|
+
showMoveConfirm: boolean;
|
|
336
|
+
formSize: "small" | "large" | "middle";
|
|
337
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
338
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
339
|
+
declare const _default: typeof __VLS_export;
|
|
340
|
+
export default _default;
|
|
341
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
342
|
+
new (): {
|
|
343
|
+
$slots: S;
|
|
344
|
+
};
|
|
345
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Tree } from 'antdv-next';
|
|
2
|
+
import { MeInputIconSelectorSource } from '../input-icon-selector/types';
|
|
3
|
+
export type { MeInputIconSelectorSource };
|
|
4
|
+
/** Tree 实例类型 */
|
|
5
|
+
export type AntTreeInstance = InstanceType<typeof Tree>;
|
|
6
|
+
/** 树节点数据(通用结构) */
|
|
7
|
+
export interface MeTreeMenuData {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
/** 动作标签配置 */
|
|
11
|
+
export interface MeTreeMenuAction {
|
|
12
|
+
/** 唯一标识,支持 meta.xxx 形式读取 meta 字段 */
|
|
13
|
+
key: string;
|
|
14
|
+
/** 标签显示文本 */
|
|
15
|
+
tagLabel?: string;
|
|
16
|
+
/** 标签图标名称 */
|
|
17
|
+
tagIcon?: string;
|
|
18
|
+
/** 标签类型 */
|
|
19
|
+
type?: 'primary' | 'success' | 'warning' | 'info' | 'error';
|
|
20
|
+
/** 显示文本 */
|
|
21
|
+
label?: string;
|
|
22
|
+
/** 当前状态是否启用 */
|
|
23
|
+
status?: boolean;
|
|
24
|
+
/** 匹配的值 */
|
|
25
|
+
value?: any;
|
|
26
|
+
}
|
|
27
|
+
/** 右键菜单项 */
|
|
28
|
+
export interface MeTreeMenuItem {
|
|
29
|
+
/** 菜单项标签 */
|
|
30
|
+
label: string;
|
|
31
|
+
/** 图标名称 */
|
|
32
|
+
icon?: string;
|
|
33
|
+
/** 点击回调 */
|
|
34
|
+
onClick: (data: MeTreeMenuData) => void;
|
|
35
|
+
/** 是否禁用 */
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** 编辑面板类型 */
|
|
39
|
+
export type MeTreeMenuTitleType = '' | 'create' | 'create-child' | 'edit' | 'copy' | 'delete';
|
|
40
|
+
/** 节点移动确认配置 */
|
|
41
|
+
export interface MeTreeMenuMoveConfirm {
|
|
42
|
+
/** 确认框标题 */
|
|
43
|
+
title?: string;
|
|
44
|
+
/** 确认框内容 */
|
|
45
|
+
message?: string;
|
|
46
|
+
/** 确认框类型 */
|
|
47
|
+
type?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'default';
|
|
48
|
+
}
|
|
49
|
+
/** MeTreeMenu Props */
|
|
50
|
+
export interface MeTreeMenuProps {
|
|
51
|
+
/** 树节点数据列表 */
|
|
52
|
+
list?: MeTreeMenuData[];
|
|
53
|
+
/** 是否显示复选框 */
|
|
54
|
+
showCheckbox?: boolean;
|
|
55
|
+
/** 是否开启拖拽,默认 true */
|
|
56
|
+
draggable?: boolean;
|
|
57
|
+
/** 是否显示搜索框,默认 true */
|
|
58
|
+
showFilter?: boolean;
|
|
59
|
+
/** 树节点缩进(px),默认 20 */
|
|
60
|
+
indent?: number;
|
|
61
|
+
/** 左侧面板宽度(px),默认 400 */
|
|
62
|
+
leftWidth?: number | string;
|
|
63
|
+
/** 搜索防抖时间(ms),默认 200 */
|
|
64
|
+
filterDebounce?: number;
|
|
65
|
+
/** 树节点配置(对应 a-tree 的 fieldNames) */
|
|
66
|
+
treeProps?: {
|
|
67
|
+
title?: string;
|
|
68
|
+
key?: string;
|
|
69
|
+
children?: string;
|
|
70
|
+
};
|
|
71
|
+
/** 节点唯一标识字段 */
|
|
72
|
+
nodeKey?: string;
|
|
73
|
+
/** 节点标签名称,用于右键菜单文案拼接(如"菜单"、"分类") */
|
|
74
|
+
label?: string;
|
|
75
|
+
/** 表单数据(右侧编辑区使用) */
|
|
76
|
+
form?: MeTreeMenuData;
|
|
77
|
+
/** 动作标签配置(v-model:actions) */
|
|
78
|
+
actions?: MeTreeMenuAction[];
|
|
79
|
+
/** 初始展开的节点 key */
|
|
80
|
+
expandKeys?: string[] | string;
|
|
81
|
+
/** 编辑区标题(优先级高于自动生成) */
|
|
82
|
+
editTitle?: string;
|
|
83
|
+
/** 节点移动 API 方法 */
|
|
84
|
+
apiMoveHandle?: (data?: any) => Promise<any>;
|
|
85
|
+
/** 重新获取数据方法 */
|
|
86
|
+
fetchDataHandle?: (data?: any) => void;
|
|
87
|
+
/** 打开编辑面板方法(不传则使用内置逻辑) */
|
|
88
|
+
openHandle?: () => void;
|
|
89
|
+
/** 自定义右键菜单项生成方法 */
|
|
90
|
+
nodeMenuItemHandle?: (data: MeTreeMenuData) => MeTreeMenuItem[];
|
|
91
|
+
/** 自定义节点过滤方法,不传则按 title 字段过滤 */
|
|
92
|
+
filterNodeMethod?: (value: string, data: MeTreeMenuData) => boolean;
|
|
93
|
+
/** 节点移动确认配置 */
|
|
94
|
+
moveConfirm?: MeTreeMenuMoveConfirm;
|
|
95
|
+
/** 是否显示节点移动确认框,默认 true */
|
|
96
|
+
showMoveConfirm?: boolean;
|
|
97
|
+
/** 表单组件尺寸,统一控制编辑面板内表单元素尺寸 */
|
|
98
|
+
formSize?: 'large' | 'middle' | 'small';
|
|
99
|
+
/** 图标选择器可选来源 */
|
|
100
|
+
iconSources?: MeInputIconSelectorSource[];
|
|
101
|
+
/** iconfont 图标数据列表 */
|
|
102
|
+
iconfontData?: string[];
|
|
103
|
+
}
|
|
104
|
+
/** MeTreeMenu Events */
|
|
105
|
+
export interface MeTreeMenuEmits {
|
|
106
|
+
/** 节点点击事件 */
|
|
107
|
+
(e: 'node-click', data: MeTreeMenuData): void;
|
|
108
|
+
/** 右键菜单 - 添加子节点 */
|
|
109
|
+
(e: 'context-menu-add', data: MeTreeMenuData): void;
|
|
110
|
+
/** 右键菜单 - 编辑节点 */
|
|
111
|
+
(e: 'context-menu-edit', data: MeTreeMenuData): void;
|
|
112
|
+
/** 右键菜单 - 删除节点 */
|
|
113
|
+
(e: 'context-menu-remove', data: MeTreeMenuData): void;
|
|
114
|
+
/** 右键菜单 - 复制节点 */
|
|
115
|
+
(e: 'context-menu-copy', data: MeTreeMenuData): void;
|
|
116
|
+
/** 表单更新/保存事件 */
|
|
117
|
+
(e: 'update', form: MeTreeMenuData): void;
|
|
118
|
+
/** 新建按钮点击事件 */
|
|
119
|
+
(e: 'create'): void;
|
|
120
|
+
/** actions 更新事件(v-model:actions) */
|
|
121
|
+
(e: 'update:actions', actions: MeTreeMenuAction[]): void;
|
|
122
|
+
}
|
|
123
|
+
/** MeTreeMenu 实例方法 */
|
|
124
|
+
export interface MeTreeMenuInstance {
|
|
125
|
+
/** 打开编辑面板 */
|
|
126
|
+
open: () => void;
|
|
127
|
+
/** 关闭编辑面板 */
|
|
128
|
+
close: () => void;
|
|
129
|
+
/** 设置展开的节点 */
|
|
130
|
+
setExpandKeys: (keys: string | string[], flag?: boolean) => void;
|
|
131
|
+
/** 获取当前展开的节点 keys */
|
|
132
|
+
getExpandKeys: () => string[] | undefined;
|
|
133
|
+
}
|