easy-ep-ui 0.1.1 → 0.2.0
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 +172 -0
- package/README.md +29 -14
- package/dist/easy-ep-ui.js +1 -1
- package/dist/style.css +1 -1
- package/es/charts/BaseBar/index.d.ts +2 -0
- package/es/charts/BaseBar/src/index.vue.d.ts +45 -0
- package/es/charts/BaseLine/index.d.ts +2 -0
- package/es/charts/BaseLine/src/index.vue.d.ts +47 -0
- package/es/charts/BasePie/index.d.ts +2 -0
- package/es/charts/BasePie/src/index.vue.d.ts +41 -0
- package/es/charts/BaseRadar/index.d.ts +2 -0
- package/es/charts/BaseRadar/src/index.vue.d.ts +47 -0
- package/es/charts/config.d.ts +32 -0
- package/es/charts/index.d.ts +8 -0
- package/es/charts/useChart.d.ts +21 -0
- package/es/components/ee-dept-cascader/index.d.ts +2 -0
- package/es/components/ee-dept-cascader/src/index.vue.d.ts +26 -0
- package/es/components/ee-dept-cascader/type.d.ts +39 -0
- package/es/components/ee-dict-select/src/index.vue.d.ts +19 -18
- package/es/components/ee-dict-select/type.d.ts +54 -0
- package/es/components/ee-form-dialog/src/index.vue.d.ts +108 -8
- package/es/components/ee-form-table/src/components/FormAuto.vue.d.ts +115 -0
- package/es/components/ee-form-table/src/components/FormDrawer.vue.d.ts +280 -7
- package/es/components/ee-form-table/src/components/TableToolbar.vue.d.ts +10 -3
- package/es/components/ee-form-table/src/constants.d.ts +2 -2
- package/es/components/ee-form-table/src/hooks/useCrud.d.ts +3 -1
- package/es/components/ee-form-table/src/hooks/useExport.d.ts +2 -0
- package/es/components/ee-form-table/src/hooks/useForm.d.ts +4 -2
- package/es/components/ee-form-table/src/hooks/useTable.d.ts +28 -11
- package/es/components/ee-form-table/src/index.vue.d.ts +33 -2
- package/es/components/ee-form-table/types.d.ts +86 -1
- package/es/components/ee-remote-select/index.d.ts +2 -0
- package/es/components/ee-remote-select/src/index.vue.d.ts +30 -0
- package/es/components/ee-remote-select/type.d.ts +53 -0
- package/es/components/ee-role-select/index.d.ts +2 -0
- package/es/components/ee-role-select/src/index.vue.d.ts +29 -0
- package/es/components/ee-role-select/type.d.ts +44 -0
- package/es/components/ee-search-bar/src/index.vue.d.ts +80 -10
- package/es/components/ee-status-tag/src/index.vue.d.ts +1 -1
- package/es/components/ee-user-select/index.d.ts +2 -0
- package/es/components/ee-user-select/src/index.vue.d.ts +29 -0
- package/es/components/ee-user-select/type.d.ts +46 -0
- package/es/hooks/index.d.ts +4 -0
- package/es/hooks/useRemoteSelectPagination.d.ts +68 -0
- package/es/hooks/useSelectEcho.d.ts +27 -0
- package/es/index.d.ts +50 -2
- package/es/index.mjs +3119 -1092
- package/es/locale/en.d.ts +3 -0
- package/es/locale/index.d.ts +91 -0
- package/es/locale/useLocale.d.ts +13 -0
- package/es/locale/zh-cn.d.ts +3 -0
- package/es/style.css +1 -1
- package/es/utils/types.d.ts +39 -0
- package/lib/charts/BaseBar/index.d.ts +2 -0
- package/lib/charts/BaseBar/src/index.vue.d.ts +45 -0
- package/lib/charts/BaseLine/index.d.ts +2 -0
- package/lib/charts/BaseLine/src/index.vue.d.ts +47 -0
- package/lib/charts/BasePie/index.d.ts +2 -0
- package/lib/charts/BasePie/src/index.vue.d.ts +41 -0
- package/lib/charts/BaseRadar/index.d.ts +2 -0
- package/lib/charts/BaseRadar/src/index.vue.d.ts +47 -0
- package/lib/charts/config.d.ts +32 -0
- package/lib/charts/index.d.ts +8 -0
- package/lib/charts/useChart.d.ts +21 -0
- package/lib/components/ee-dept-cascader/index.d.ts +2 -0
- package/lib/components/ee-dept-cascader/src/index.vue.d.ts +26 -0
- package/lib/components/ee-dept-cascader/type.d.ts +39 -0
- package/lib/components/ee-dict-select/src/index.vue.d.ts +19 -18
- package/lib/components/ee-dict-select/type.d.ts +54 -0
- package/lib/components/ee-form-dialog/src/index.vue.d.ts +108 -8
- package/lib/components/ee-form-table/src/components/FormAuto.vue.d.ts +115 -0
- package/lib/components/ee-form-table/src/components/FormDrawer.vue.d.ts +280 -7
- package/lib/components/ee-form-table/src/components/TableToolbar.vue.d.ts +10 -3
- package/lib/components/ee-form-table/src/constants.d.ts +2 -2
- package/lib/components/ee-form-table/src/hooks/useCrud.d.ts +3 -1
- package/lib/components/ee-form-table/src/hooks/useExport.d.ts +2 -0
- package/lib/components/ee-form-table/src/hooks/useForm.d.ts +4 -2
- package/lib/components/ee-form-table/src/hooks/useTable.d.ts +28 -11
- package/lib/components/ee-form-table/src/index.vue.d.ts +33 -2
- package/lib/components/ee-form-table/types.d.ts +86 -1
- package/lib/components/ee-remote-select/index.d.ts +2 -0
- package/lib/components/ee-remote-select/src/index.vue.d.ts +30 -0
- package/lib/components/ee-remote-select/type.d.ts +53 -0
- package/lib/components/ee-role-select/index.d.ts +2 -0
- package/lib/components/ee-role-select/src/index.vue.d.ts +29 -0
- package/lib/components/ee-role-select/type.d.ts +44 -0
- package/lib/components/ee-search-bar/src/index.vue.d.ts +80 -10
- package/lib/components/ee-status-tag/src/index.vue.d.ts +1 -1
- package/lib/components/ee-user-select/index.d.ts +2 -0
- package/lib/components/ee-user-select/src/index.vue.d.ts +29 -0
- package/lib/components/ee-user-select/type.d.ts +46 -0
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/useRemoteSelectPagination.d.ts +68 -0
- package/lib/hooks/useSelectEcho.d.ts +27 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +50 -2
- package/lib/locale/en.d.ts +3 -0
- package/lib/locale/index.d.ts +91 -0
- package/lib/locale/useLocale.d.ts +13 -0
- package/lib/locale/zh-cn.d.ts +3 -0
- package/lib/style.css +1 -1
- package/lib/utils/types.d.ts +39 -0
- package/package.json +5 -2
|
@@ -8,6 +8,7 @@ import { ExportConfig, TableColumn } from '../../types';
|
|
|
8
8
|
* @param deps.dictLabel - 字典值转文本函数
|
|
9
9
|
* @param deps.setLoading - 设置加载状态
|
|
10
10
|
* @param deps.getCurrentData - 获取当前数据列表的函数
|
|
11
|
+
* @param deps.t - 国际化翻译函数,接收 (section, key, args?) 返回本地化文字
|
|
11
12
|
*/
|
|
12
13
|
export declare function useExport(props: {
|
|
13
14
|
exportConfig?: ExportConfig;
|
|
@@ -26,6 +27,7 @@ export declare function useExport(props: {
|
|
|
26
27
|
fetchData: () => Promise<void>;
|
|
27
28
|
setLoading: (v: boolean) => void;
|
|
28
29
|
getCurrentData: () => Record<string, unknown>[];
|
|
30
|
+
t: (section: string, key: string, args?: Record<string, string | number>) => string;
|
|
29
31
|
}): {
|
|
30
32
|
handleExport: () => Promise<void>;
|
|
31
33
|
exporting: Ref<boolean, boolean>;
|
|
@@ -4,7 +4,7 @@ import { DrawerConfig } from '../../types';
|
|
|
4
4
|
* @param props.drawerConfig - 抽屉/弹窗的外观配置
|
|
5
5
|
* @param props.rowKey - 数据行的唯一键(用于编辑时取 ID)
|
|
6
6
|
* @returns formVisible - 表单是否显示
|
|
7
|
-
* @returns
|
|
7
|
+
* @returns formMode - 表单模式:add | edit | view
|
|
8
8
|
* @returns editingRow - 当前编辑的行数据(新增时为 null)
|
|
9
9
|
* @returns formData - 表单绑定的数据对象
|
|
10
10
|
* @returns saving - 是否正在保存(加载状态)
|
|
@@ -12,6 +12,7 @@ import { DrawerConfig } from '../../types';
|
|
|
12
12
|
* @returns drawerCfg - 合并默认值后的配置
|
|
13
13
|
* @returns openAdd - 打开新增表单
|
|
14
14
|
* @returns openEdit - 打开编辑表单
|
|
15
|
+
* @returns openView - 打开查看表单
|
|
15
16
|
* @returns closeForm - 关闭表单
|
|
16
17
|
*/
|
|
17
18
|
export declare function useForm(props: {
|
|
@@ -19,7 +20,7 @@ export declare function useForm(props: {
|
|
|
19
20
|
rowKey?: string;
|
|
20
21
|
}): {
|
|
21
22
|
formVisible: ReturnType<typeof ref<boolean>>;
|
|
22
|
-
|
|
23
|
+
formMode: ReturnType<typeof ref<'add' | 'edit' | 'view'>>;
|
|
23
24
|
editingRow: ReturnType<typeof ref<Record<string, unknown> | null>>;
|
|
24
25
|
formData: ReturnType<typeof ref<Record<string, unknown>>>;
|
|
25
26
|
saving: ReturnType<typeof ref<boolean>>;
|
|
@@ -27,5 +28,6 @@ export declare function useForm(props: {
|
|
|
27
28
|
drawerCfg: DrawerConfig;
|
|
28
29
|
openAdd: () => void;
|
|
29
30
|
openEdit: (row: Record<string, unknown>) => void;
|
|
31
|
+
openView: (row: Record<string, unknown>) => void;
|
|
30
32
|
closeForm: () => void;
|
|
31
33
|
};
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
2
|
import { TableColumn, SelectionConfig, ColumnSettingConfig, AutoHeightConfig } from '../../types';
|
|
3
|
-
/**
|
|
4
|
-
* @param props.columns - 表格列配置
|
|
5
|
-
* @param props.selectionConfig - 选择列配置
|
|
6
|
-
* @param props.columnSetting - 列设置配置
|
|
7
|
-
* @param props.rowKey - 数据行唯一标识字段名
|
|
8
|
-
* @param props.tableHeight - 固定表格高度
|
|
9
|
-
* @param props.tableMaxHeight - 表格最大高度
|
|
10
|
-
* @param props.autoHeight - 自适应高度配置
|
|
11
|
-
* @param deps.authPass - 权限判断函数(用于按权限过滤列)
|
|
12
|
-
*/
|
|
13
3
|
export declare function useTable(props: {
|
|
14
4
|
columns: TableColumn[];
|
|
15
5
|
data?: Record<string, unknown>[];
|
|
@@ -32,11 +22,32 @@ export declare function useTable(props: {
|
|
|
32
22
|
singleSelection: import('vue').Ref<string | number | null, string | number | null>;
|
|
33
23
|
columnSettingVisible: import('vue').Ref<boolean, boolean>;
|
|
34
24
|
checkedColumns: import('vue').Ref<string[], string[]>;
|
|
25
|
+
columnOrder: import('vue').Ref<string[], string[]>;
|
|
26
|
+
columnWidths: import('vue').Ref<Record<string, string | number>, Record<string, string | number>>;
|
|
35
27
|
selectionCfg: ComputedRef<SelectionConfig>;
|
|
36
28
|
columnSettingCfg: ComputedRef<ColumnSettingConfig>;
|
|
37
29
|
showColumnSetting: ComputedRef<boolean | undefined>;
|
|
30
|
+
showIndex: import('vue').Ref<boolean, boolean>;
|
|
31
|
+
selectionVisible: import('vue').Ref<boolean, boolean>;
|
|
38
32
|
allColumns: ComputedRef<TableColumn[]>;
|
|
39
|
-
visibleColumns: ComputedRef<
|
|
33
|
+
visibleColumns: ComputedRef<{
|
|
34
|
+
width: string | number;
|
|
35
|
+
prop: string;
|
|
36
|
+
label: string;
|
|
37
|
+
minWidth?: string | number;
|
|
38
|
+
align?: import('../../types').AlignType;
|
|
39
|
+
fixed?: import('../../types').FixedType;
|
|
40
|
+
sortable?: boolean;
|
|
41
|
+
show?: boolean;
|
|
42
|
+
showTooltip?: boolean;
|
|
43
|
+
formatter?: (row: Record<string, unknown>, column: TableColumn, cellValue: unknown, index: number) => unknown;
|
|
44
|
+
dictKey?: string;
|
|
45
|
+
slotName?: string;
|
|
46
|
+
search?: import('../../types').ColumnSearchItem;
|
|
47
|
+
form?: import('../../types').ColumnFormItem;
|
|
48
|
+
auth?: string;
|
|
49
|
+
children?: TableColumn[];
|
|
50
|
+
}[]>;
|
|
40
51
|
tableComputedHeight: ComputedRef<string | number | undefined>;
|
|
41
52
|
tableMaxHeightProp: ComputedRef<string | number | undefined>;
|
|
42
53
|
tableWrapperStyle: ComputedRef<{
|
|
@@ -46,4 +57,10 @@ export declare function useTable(props: {
|
|
|
46
57
|
}>;
|
|
47
58
|
handleSelectionChange: (val: Record<string, unknown>[]) => void;
|
|
48
59
|
handleSingleSelect: (row: Record<string, unknown>) => void;
|
|
60
|
+
toggleColumn: (prop: string) => void;
|
|
61
|
+
toggleIndex: () => void;
|
|
62
|
+
toggleSelection: () => void;
|
|
63
|
+
moveColumn: (fromIdx: number, toIdx: number) => void;
|
|
64
|
+
onColumnResize: (newWidth: string | number, col: any) => void;
|
|
65
|
+
saveToStorage: () => void;
|
|
49
66
|
};
|
|
@@ -3,6 +3,7 @@ type __VLS_Props = {
|
|
|
3
3
|
columns: TableColumn[];
|
|
4
4
|
data?: Record<string, any>[];
|
|
5
5
|
loading?: boolean;
|
|
6
|
+
readOnly?: boolean;
|
|
6
7
|
searchConfig?: any;
|
|
7
8
|
pagination?: any;
|
|
8
9
|
actionConfig?: ActionConfig | boolean;
|
|
@@ -30,8 +31,25 @@ declare function __VLS_template(): {
|
|
|
30
31
|
slots: Partial<Record<string, (_: {
|
|
31
32
|
row: import('element-plus/es/components/table/src/table/defaults.mjs').DefaultRow;
|
|
32
33
|
index: number;
|
|
33
|
-
column:
|
|
34
|
-
|
|
34
|
+
column: {
|
|
35
|
+
width: string | number;
|
|
36
|
+
prop: string;
|
|
37
|
+
label: string;
|
|
38
|
+
minWidth?: string | number;
|
|
39
|
+
align?: import('../types').AlignType;
|
|
40
|
+
fixed?: import('../types').FixedType;
|
|
41
|
+
sortable?: boolean;
|
|
42
|
+
show?: boolean;
|
|
43
|
+
showTooltip?: boolean;
|
|
44
|
+
formatter?: (row: Record<string, unknown>, column: TableColumn, cellValue: unknown, index: number) => unknown;
|
|
45
|
+
dictKey?: string;
|
|
46
|
+
slotName?: string;
|
|
47
|
+
search?: import('../types').ColumnSearchItem;
|
|
48
|
+
form?: import('../types').ColumnFormItem;
|
|
49
|
+
auth?: string;
|
|
50
|
+
children?: TableColumn[];
|
|
51
|
+
};
|
|
52
|
+
}) => any>> & {
|
|
35
53
|
'search-action'?(_: {
|
|
36
54
|
params: Record<string, unknown>;
|
|
37
55
|
}): any;
|
|
@@ -43,6 +61,18 @@ declare function __VLS_template(): {
|
|
|
43
61
|
row: import('element-plus/es/components/table/src/table/defaults.mjs').DefaultRow;
|
|
44
62
|
}): any;
|
|
45
63
|
empty?(_: {}): any;
|
|
64
|
+
'add-form'?(_: {
|
|
65
|
+
row: Record<string, unknown> | null;
|
|
66
|
+
formData: Record<string, unknown>;
|
|
67
|
+
}): any;
|
|
68
|
+
'edit-form'?(_: {
|
|
69
|
+
row: Record<string, unknown> | null;
|
|
70
|
+
formData: Record<string, unknown>;
|
|
71
|
+
}): any;
|
|
72
|
+
'view-form'?(_: {
|
|
73
|
+
row: Record<string, unknown> | null;
|
|
74
|
+
formData: Record<string, unknown>;
|
|
75
|
+
}): any;
|
|
46
76
|
};
|
|
47
77
|
refs: {
|
|
48
78
|
tableRef: {
|
|
@@ -959,6 +989,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
|
959
989
|
emptyText: string;
|
|
960
990
|
border: boolean;
|
|
961
991
|
stripe: boolean;
|
|
992
|
+
readOnly: boolean;
|
|
962
993
|
authMode: "hide" | "disabled";
|
|
963
994
|
highlightCurrentRow: boolean;
|
|
964
995
|
rowKey: string;
|
|
@@ -23,6 +23,8 @@ export type ExportMode = 'current' | 'all';
|
|
|
23
23
|
export type SearchFieldType = 'input' | 'number' | 'select' | 'radio' | 'checkbox' | 'date' | 'date-range' | 'textarea';
|
|
24
24
|
/** Element Plus 按钮类型 */
|
|
25
25
|
export type ButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'default';
|
|
26
|
+
/** 表单字段控件类型 */
|
|
27
|
+
export type FormFieldType = 'input' | 'number' | 'select' | 'radio' | 'checkbox' | 'date' | 'date-range' | 'textarea' | 'switch';
|
|
26
28
|
export interface DictOption {
|
|
27
29
|
value: string | number;
|
|
28
30
|
label: string;
|
|
@@ -37,6 +39,37 @@ export interface ColumnSearchItem {
|
|
|
37
39
|
props?: Record<string, unknown>;
|
|
38
40
|
field?: string;
|
|
39
41
|
}
|
|
42
|
+
export interface ColumnFormItem {
|
|
43
|
+
/** 是否在新增表单中展示(默认 true) */
|
|
44
|
+
add?: boolean;
|
|
45
|
+
/** 是否在编辑表单中展示(默认同 add) */
|
|
46
|
+
edit?: boolean;
|
|
47
|
+
/** 表单控件类型,默认 'input' */
|
|
48
|
+
type?: FormFieldType;
|
|
49
|
+
/** 占位符 */
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
/** 静态选项(select/radio/checkbox) */
|
|
52
|
+
options?: {
|
|
53
|
+
value: any;
|
|
54
|
+
label: string;
|
|
55
|
+
}[];
|
|
56
|
+
/** 字典 key(优先于 options) */
|
|
57
|
+
dictKey?: string;
|
|
58
|
+
/** 透传给控件的 props */
|
|
59
|
+
props?: Record<string, unknown>;
|
|
60
|
+
/** Element Plus 校验规则 */
|
|
61
|
+
rules?: Record<string, unknown>[];
|
|
62
|
+
/** 栅格跨列数(默认 1) */
|
|
63
|
+
colSpan?: number;
|
|
64
|
+
/** 必填标记(自动加 required 校验) */
|
|
65
|
+
required?: boolean;
|
|
66
|
+
/** 编辑时只读 */
|
|
67
|
+
readonly?: boolean;
|
|
68
|
+
/** 新增时的默认值 */
|
|
69
|
+
defaultValue?: unknown;
|
|
70
|
+
/** 强制隐藏 */
|
|
71
|
+
hide?: boolean;
|
|
72
|
+
}
|
|
40
73
|
export interface TableColumn {
|
|
41
74
|
prop: string;
|
|
42
75
|
label: string;
|
|
@@ -46,10 +79,12 @@ export interface TableColumn {
|
|
|
46
79
|
fixed?: FixedType;
|
|
47
80
|
sortable?: boolean;
|
|
48
81
|
show?: boolean;
|
|
82
|
+
showTooltip?: boolean;
|
|
49
83
|
formatter?: (row: Record<string, unknown>, column: TableColumn, cellValue: unknown, index: number) => unknown;
|
|
50
84
|
dictKey?: string;
|
|
51
85
|
slotName?: string;
|
|
52
86
|
search?: ColumnSearchItem;
|
|
87
|
+
form?: ColumnFormItem;
|
|
53
88
|
auth?: string;
|
|
54
89
|
children?: TableColumn[];
|
|
55
90
|
[key: string]: unknown;
|
|
@@ -72,13 +107,15 @@ export interface PaginationConfig {
|
|
|
72
107
|
}
|
|
73
108
|
export interface ActionButton {
|
|
74
109
|
text: string;
|
|
75
|
-
icon?:
|
|
110
|
+
icon?: any;
|
|
76
111
|
type?: ButtonType;
|
|
77
112
|
code?: string;
|
|
78
113
|
auth?: string;
|
|
79
114
|
show?: (row: Record<string, unknown>) => boolean;
|
|
80
115
|
handler: (row: Record<string, unknown>) => void;
|
|
81
116
|
}
|
|
117
|
+
/** 操作列按钮展示模式 */
|
|
118
|
+
export type ActionButtonMode = 'text' | 'icon' | 'icon-text';
|
|
82
119
|
export interface ActionConfig {
|
|
83
120
|
show?: boolean;
|
|
84
121
|
label?: string;
|
|
@@ -87,17 +124,28 @@ export interface ActionConfig {
|
|
|
87
124
|
showView?: boolean;
|
|
88
125
|
showEdit?: boolean;
|
|
89
126
|
showDelete?: boolean;
|
|
127
|
+
showVersion?: boolean;
|
|
90
128
|
viewText?: string;
|
|
91
129
|
editText?: string;
|
|
92
130
|
deleteText?: string;
|
|
131
|
+
versionText?: string;
|
|
93
132
|
viewAuth?: string;
|
|
94
133
|
editAuth?: string;
|
|
95
134
|
deleteAuth?: string;
|
|
135
|
+
versionAuth?: string;
|
|
96
136
|
fixed?: FixedType;
|
|
97
137
|
confirmDelete?: boolean;
|
|
98
138
|
deleteConfirmTitle?: string;
|
|
99
139
|
deleteConfirmMessage?: string;
|
|
100
140
|
customButtons?: ActionButton[];
|
|
141
|
+
beforeButtons?: ActionButton[];
|
|
142
|
+
afterButtons?: ActionButton[];
|
|
143
|
+
buttonMode?: ActionButtonMode;
|
|
144
|
+
maxButtons?: number;
|
|
145
|
+
onView?: (row: Record<string, unknown>) => void;
|
|
146
|
+
onAdd?: () => void;
|
|
147
|
+
onEdit?: (row: Record<string, unknown>) => void;
|
|
148
|
+
onDelete?: (row: Record<string, unknown>) => void;
|
|
101
149
|
}
|
|
102
150
|
export interface ToolbarButton {
|
|
103
151
|
text: string;
|
|
@@ -113,6 +161,7 @@ export interface ToolbarConfig {
|
|
|
113
161
|
showImport?: boolean;
|
|
114
162
|
showExport?: boolean;
|
|
115
163
|
showBatchDelete?: boolean;
|
|
164
|
+
showRefresh?: boolean;
|
|
116
165
|
addText?: string;
|
|
117
166
|
importText?: string;
|
|
118
167
|
exportText?: string;
|
|
@@ -132,12 +181,38 @@ export interface CrudApi {
|
|
|
132
181
|
edit?: (data: Record<string, unknown>) => Promise<unknown>;
|
|
133
182
|
delete?: (id: string | number) => Promise<unknown>;
|
|
134
183
|
batchDelete?: (ids: (string | number)[]) => Promise<unknown>;
|
|
184
|
+
version?: (id: string | number) => Promise<Record<string, unknown>[]>;
|
|
135
185
|
}
|
|
136
186
|
export interface CrudConfig {
|
|
137
187
|
api: CrudApi;
|
|
138
188
|
baseParams?: Record<string, unknown>;
|
|
139
189
|
requestMethod?: 'GET' | 'POST';
|
|
140
190
|
requestInstance?: unknown;
|
|
191
|
+
/** 各操作的自定义 URL,优先级高于 api 函数 */
|
|
192
|
+
urls?: {
|
|
193
|
+
list?: string;
|
|
194
|
+
add?: string;
|
|
195
|
+
edit?: string;
|
|
196
|
+
delete?: string;
|
|
197
|
+
batchDelete?: string;
|
|
198
|
+
version?: string;
|
|
199
|
+
};
|
|
200
|
+
/** 各操作的自定义参数 */
|
|
201
|
+
params?: {
|
|
202
|
+
list?: Record<string, unknown>;
|
|
203
|
+
add?: Record<string, unknown>;
|
|
204
|
+
edit?: Record<string, unknown>;
|
|
205
|
+
delete?: Record<string, unknown>;
|
|
206
|
+
batchDelete?: Record<string, unknown>;
|
|
207
|
+
version?: Record<string, unknown>;
|
|
208
|
+
};
|
|
209
|
+
/** 版本管理配置 */
|
|
210
|
+
versionConfig?: {
|
|
211
|
+
/** 自定义版本请求 URL(优先级高于 api.version) */
|
|
212
|
+
url?: string;
|
|
213
|
+
/** 自定义参数 */
|
|
214
|
+
params?: Record<string, unknown>;
|
|
215
|
+
};
|
|
141
216
|
}
|
|
142
217
|
export interface SelectionConfig {
|
|
143
218
|
show?: boolean;
|
|
@@ -158,10 +233,19 @@ export interface DrawerConfig {
|
|
|
158
233
|
closeOnReset?: boolean;
|
|
159
234
|
addTitle?: string;
|
|
160
235
|
editTitle?: string;
|
|
236
|
+
viewTitle?: string;
|
|
237
|
+
/** 表单每行展示列数(默认 2) */
|
|
238
|
+
formCols?: number;
|
|
239
|
+
/** 表单标签宽度(默认 '80px') */
|
|
240
|
+
formLabelWidth?: string;
|
|
241
|
+
/** 表单组件尺寸 */
|
|
242
|
+
formSize?: ComponentSize;
|
|
161
243
|
}
|
|
162
244
|
export interface ColumnSettingConfig {
|
|
163
245
|
show?: boolean;
|
|
164
246
|
storageKey?: string;
|
|
247
|
+
/** 是否默认显示行号列 */
|
|
248
|
+
showIndex?: boolean;
|
|
165
249
|
}
|
|
166
250
|
export interface AutoHeightConfig {
|
|
167
251
|
offset?: number;
|
|
@@ -170,6 +254,7 @@ export interface EeFormTableProps {
|
|
|
170
254
|
columns: TableColumn[];
|
|
171
255
|
data?: Record<string, unknown>[];
|
|
172
256
|
loading?: boolean;
|
|
257
|
+
readOnly?: boolean;
|
|
173
258
|
searchConfig?: SearchConfig | boolean;
|
|
174
259
|
pagination?: PaginationConfig | boolean;
|
|
175
260
|
actionConfig?: ActionConfig | boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EeRemoteSelectProps } from '../type';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<EeRemoteSelectProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
|
+
search: (keyword: string) => any;
|
|
4
|
+
clear: () => any;
|
|
5
|
+
"update:modelValue": (val: string | number | (string | number)[]) => any;
|
|
6
|
+
change: (val: string | number | (string | number)[]) => any;
|
|
7
|
+
blur: (evt: FocusEvent) => any;
|
|
8
|
+
focus: (evt: FocusEvent) => any;
|
|
9
|
+
"load-success": (options: any[]) => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<EeRemoteSelectProps> & Readonly<{
|
|
11
|
+
onSearch?: ((keyword: string) => any) | undefined;
|
|
12
|
+
onClear?: (() => any) | undefined;
|
|
13
|
+
"onUpdate:modelValue"?: ((val: string | number | (string | number)[]) => any) | undefined;
|
|
14
|
+
onChange?: ((val: string | number | (string | number)[]) => any) | undefined;
|
|
15
|
+
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
16
|
+
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
17
|
+
"onLoad-success"?: ((options: any[]) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
pageNumKey: string;
|
|
20
|
+
pageSizeKey: string;
|
|
21
|
+
pageSize: number;
|
|
22
|
+
searchKey: string;
|
|
23
|
+
labelField: string;
|
|
24
|
+
valueField: string;
|
|
25
|
+
size: "large" | "default" | "small";
|
|
26
|
+
mode: "single" | "multiple";
|
|
27
|
+
clearable: boolean;
|
|
28
|
+
filterable: boolean;
|
|
29
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { DictOption } from '../../utils/types';
|
|
3
|
+
/** EeRemoteSelect 组件属性 */
|
|
4
|
+
export interface EeRemoteSelectProps {
|
|
5
|
+
/** 双向绑定值 */
|
|
6
|
+
modelValue?: string | number | (string | number)[];
|
|
7
|
+
/** 远程列表查询接口地址(必填) */
|
|
8
|
+
apiUrl: string;
|
|
9
|
+
/** ID 回显详情查询接口地址(必填) */
|
|
10
|
+
detailEchoUrl: string;
|
|
11
|
+
/** 选择模式,默认 single */
|
|
12
|
+
mode?: 'single' | 'multiple';
|
|
13
|
+
/** 选项 label 字段名,默认 label */
|
|
14
|
+
labelField?: string;
|
|
15
|
+
/** 选项 value 字段名,默认 value */
|
|
16
|
+
valueField?: string;
|
|
17
|
+
/** 搜索关键词参数字段名,默认 keyword */
|
|
18
|
+
searchKey?: string;
|
|
19
|
+
/** 分页页码字段名,默认 pageNum */
|
|
20
|
+
pageNumKey?: string;
|
|
21
|
+
/** 分页条数字段名,默认 pageSize */
|
|
22
|
+
pageSizeKey?: string;
|
|
23
|
+
/** 每页条数,默认 20 */
|
|
24
|
+
pageSize?: number;
|
|
25
|
+
/** 固定附加请求参数 */
|
|
26
|
+
extraParams?: Record<string, any>;
|
|
27
|
+
/** 外部 axios 请求实例,不传则从全局配置获取 */
|
|
28
|
+
requestInstance?: AxiosInstance;
|
|
29
|
+
/** 占位符文本 */
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
/** 是否可清空,默认 true */
|
|
32
|
+
clearable?: boolean;
|
|
33
|
+
/** 是否禁用 */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/** 是否只读 */
|
|
36
|
+
readonly?: boolean;
|
|
37
|
+
/** 是否可搜索过滤,默认 true */
|
|
38
|
+
filterable?: boolean;
|
|
39
|
+
/** 组件尺寸 */
|
|
40
|
+
size?: 'large' | 'default' | 'small';
|
|
41
|
+
/** 静态选项数据,优先级最高,传入后不走接口 */
|
|
42
|
+
options?: DictOption[];
|
|
43
|
+
}
|
|
44
|
+
/** EeRemoteSelect 组件事件 */
|
|
45
|
+
export interface EeRemoteSelectEmits {
|
|
46
|
+
(e: 'update:modelValue', val: string | number | (string | number)[]): void;
|
|
47
|
+
(e: 'change', val: string | number | (string | number)[]): void;
|
|
48
|
+
(e: 'clear'): void;
|
|
49
|
+
(e: 'blur', evt: FocusEvent): void;
|
|
50
|
+
(e: 'focus', evt: FocusEvent): void;
|
|
51
|
+
(e: 'search', keyword: string): void;
|
|
52
|
+
(e: 'load-success', options: any[]): void;
|
|
53
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EeRoleSelectProps } from '../type';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<EeRoleSelectProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
|
+
search: (keyword: string) => any;
|
|
4
|
+
clear: () => any;
|
|
5
|
+
"update:modelValue": (val: string | number | (string | number)[]) => any;
|
|
6
|
+
change: (val: string | number | (string | number)[]) => any;
|
|
7
|
+
blur: (evt: FocusEvent) => any;
|
|
8
|
+
focus: (evt: FocusEvent) => any;
|
|
9
|
+
"load-success": (options: any[]) => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<EeRoleSelectProps> & Readonly<{
|
|
11
|
+
onSearch?: ((keyword: string) => any) | undefined;
|
|
12
|
+
onClear?: (() => any) | undefined;
|
|
13
|
+
"onUpdate:modelValue"?: ((val: string | number | (string | number)[]) => any) | undefined;
|
|
14
|
+
onChange?: ((val: string | number | (string | number)[]) => any) | undefined;
|
|
15
|
+
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
16
|
+
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
17
|
+
"onLoad-success"?: ((options: any[]) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
apiUrl: string;
|
|
20
|
+
searchKey: string;
|
|
21
|
+
labelField: string;
|
|
22
|
+
valueField: string;
|
|
23
|
+
size: "large" | "default" | "small";
|
|
24
|
+
detailEchoUrl: string;
|
|
25
|
+
mode: "single" | "multiple";
|
|
26
|
+
clearable: boolean;
|
|
27
|
+
filterable: boolean;
|
|
28
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
/** EeRoleSelect 组件属性 */
|
|
3
|
+
export interface EeRoleSelectProps {
|
|
4
|
+
/** 双向绑定值 */
|
|
5
|
+
modelValue?: string | number | (string | number)[];
|
|
6
|
+
/** 自定义角色列表接口地址,覆盖默认接口 */
|
|
7
|
+
apiUrl?: string;
|
|
8
|
+
/** 自定义角色详情回显接口地址 */
|
|
9
|
+
detailEchoUrl?: string;
|
|
10
|
+
/** 选择模式,默认 single */
|
|
11
|
+
mode?: 'single' | 'multiple';
|
|
12
|
+
/** 选项 label 字段名,默认 label */
|
|
13
|
+
labelField?: string;
|
|
14
|
+
/** 选项 value 字段名,默认 value */
|
|
15
|
+
valueField?: string;
|
|
16
|
+
/** 搜索关键词参数字段名,默认 keyword */
|
|
17
|
+
searchKey?: string;
|
|
18
|
+
/** 固定附加请求参数 */
|
|
19
|
+
extraParams?: Record<string, any>;
|
|
20
|
+
/** 外部 axios 请求实例,不传则从全局配置获取 */
|
|
21
|
+
requestInstance?: AxiosInstance;
|
|
22
|
+
/** 占位符文本 */
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
/** 是否可清空,默认 true */
|
|
25
|
+
clearable?: boolean;
|
|
26
|
+
/** 是否禁用 */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** 是否只读 */
|
|
29
|
+
readonly?: boolean;
|
|
30
|
+
/** 是否可搜索过滤,默认 true */
|
|
31
|
+
filterable?: boolean;
|
|
32
|
+
/** 组件尺寸 */
|
|
33
|
+
size?: 'large' | 'default' | 'small';
|
|
34
|
+
}
|
|
35
|
+
/** EeRoleSelect 组件事件 */
|
|
36
|
+
export interface EeRoleSelectEmits {
|
|
37
|
+
(e: 'update:modelValue', val: string | number | (string | number)[]): void;
|
|
38
|
+
(e: 'change', val: string | number | (string | number)[]): void;
|
|
39
|
+
(e: 'clear'): void;
|
|
40
|
+
(e: 'blur', evt: FocusEvent): void;
|
|
41
|
+
(e: 'focus', evt: FocusEvent): void;
|
|
42
|
+
(e: 'search', keyword: string): void;
|
|
43
|
+
(e: 'load-success', options: any[]): void;
|
|
44
|
+
}
|
|
@@ -9,12 +9,12 @@ type __VLS_Props = {
|
|
|
9
9
|
size?: 'large' | 'default' | 'small';
|
|
10
10
|
};
|
|
11
11
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
12
|
-
"update:modelValue": (val: Record<string, any>) => any;
|
|
13
12
|
search: (val: Record<string, any>) => any;
|
|
13
|
+
"update:modelValue": (val: Record<string, any>) => any;
|
|
14
14
|
reset: () => any;
|
|
15
15
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
-
"onUpdate:modelValue"?: ((val: Record<string, any>) => any) | undefined;
|
|
17
16
|
onSearch?: ((val: Record<string, any>) => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((val: Record<string, any>) => any) | undefined;
|
|
18
18
|
onReset?: (() => any) | undefined;
|
|
19
19
|
}>, {
|
|
20
20
|
size: "large" | "default" | "small";
|
|
@@ -60,10 +60,45 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
60
60
|
$options: import('vue').ComponentOptionsBase<Readonly<import('element-plus').FormProps> & Readonly<{
|
|
61
61
|
onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
62
62
|
}>, {
|
|
63
|
-
validate: (callback
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
validate: (callback
|
|
64
|
+
/**
|
|
65
|
+
* EeSearchBar 搜索栏组件
|
|
66
|
+
*
|
|
67
|
+
* 基于 el-form 封装的搜索栏,支持多字段类型(input/select/datepicker)、
|
|
68
|
+
* 搜索/重置按钮、字段显隐控制。
|
|
69
|
+
*/
|
|
70
|
+
?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
|
|
71
|
+
validateField: (props
|
|
72
|
+
/**
|
|
73
|
+
* EeSearchBar 搜索栏组件
|
|
74
|
+
*
|
|
75
|
+
* 基于 el-form 封装的搜索栏,支持多字段类型(input/select/datepicker)、
|
|
76
|
+
* 搜索/重置按钮、字段显隐控制。
|
|
77
|
+
*/
|
|
78
|
+
?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>, callback
|
|
79
|
+
/**
|
|
80
|
+
* EeSearchBar 搜索栏组件
|
|
81
|
+
*
|
|
82
|
+
* 基于 el-form 封装的搜索栏,支持多字段类型(input/select/datepicker)、
|
|
83
|
+
* 搜索/重置按钮、字段显隐控制。
|
|
84
|
+
*/
|
|
85
|
+
?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
|
|
86
|
+
resetFields: (props
|
|
87
|
+
/**
|
|
88
|
+
* EeSearchBar 搜索栏组件
|
|
89
|
+
*
|
|
90
|
+
* 基于 el-form 封装的搜索栏,支持多字段类型(input/select/datepicker)、
|
|
91
|
+
* 搜索/重置按钮、字段显隐控制。
|
|
92
|
+
*/
|
|
93
|
+
?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
|
|
94
|
+
clearValidate: (props
|
|
95
|
+
/**
|
|
96
|
+
* EeSearchBar 搜索栏组件
|
|
97
|
+
*
|
|
98
|
+
* 基于 el-form 封装的搜索栏,支持多字段类型(input/select/datepicker)、
|
|
99
|
+
* 搜索/重置按钮、字段显隐控制。
|
|
100
|
+
*/
|
|
101
|
+
?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
|
|
67
102
|
scrollToField: (prop: import('element-plus').FormItemProp) => void;
|
|
68
103
|
getField: (prop: import('element-plus').FormItemProp) => import('element-plus').FormItemContext | undefined;
|
|
69
104
|
fields: import('vue').Reactive<import('element-plus').FormItemContext[]>;
|
|
@@ -109,10 +144,45 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
109
144
|
}> & Omit<Readonly<import('element-plus').FormProps> & Readonly<{
|
|
110
145
|
onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
111
146
|
}>, "fields" | "labelWidth" | "labelPosition" | "requireAsteriskPosition" | "labelSuffix" | "showMessage" | "validateOnRuleChange" | "scrollIntoViewOptions" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "setInitialValues"> & {
|
|
112
|
-
validate: (callback
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
147
|
+
validate: (callback
|
|
148
|
+
/**
|
|
149
|
+
* EeSearchBar 搜索栏组件
|
|
150
|
+
*
|
|
151
|
+
* 基于 el-form 封装的搜索栏,支持多字段类型(input/select/datepicker)、
|
|
152
|
+
* 搜索/重置按钮、字段显隐控制。
|
|
153
|
+
*/
|
|
154
|
+
?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
|
|
155
|
+
validateField: (props
|
|
156
|
+
/**
|
|
157
|
+
* EeSearchBar 搜索栏组件
|
|
158
|
+
*
|
|
159
|
+
* 基于 el-form 封装的搜索栏,支持多字段类型(input/select/datepicker)、
|
|
160
|
+
* 搜索/重置按钮、字段显隐控制。
|
|
161
|
+
*/
|
|
162
|
+
?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>, callback
|
|
163
|
+
/**
|
|
164
|
+
* EeSearchBar 搜索栏组件
|
|
165
|
+
*
|
|
166
|
+
* 基于 el-form 封装的搜索栏,支持多字段类型(input/select/datepicker)、
|
|
167
|
+
* 搜索/重置按钮、字段显隐控制。
|
|
168
|
+
*/
|
|
169
|
+
?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
|
|
170
|
+
resetFields: (props
|
|
171
|
+
/**
|
|
172
|
+
* EeSearchBar 搜索栏组件
|
|
173
|
+
*
|
|
174
|
+
* 基于 el-form 封装的搜索栏,支持多字段类型(input/select/datepicker)、
|
|
175
|
+
* 搜索/重置按钮、字段显隐控制。
|
|
176
|
+
*/
|
|
177
|
+
?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
|
|
178
|
+
clearValidate: (props
|
|
179
|
+
/**
|
|
180
|
+
* EeSearchBar 搜索栏组件
|
|
181
|
+
*
|
|
182
|
+
* 基于 el-form 封装的搜索栏,支持多字段类型(input/select/datepicker)、
|
|
183
|
+
* 搜索/重置按钮、字段显隐控制。
|
|
184
|
+
*/
|
|
185
|
+
?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
|
|
116
186
|
scrollToField: (prop: import('element-plus').FormItemProp) => void;
|
|
117
187
|
getField: (prop: import('element-plus').FormItemProp) => import('element-plus').FormItemContext | undefined;
|
|
118
188
|
fields: import('vue').Reactive<import('element-plus').FormItemContext[]>;
|
|
@@ -8,6 +8,6 @@ type __VLS_Props = {
|
|
|
8
8
|
};
|
|
9
9
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
10
|
defaultType: "primary" | "success" | "warning" | "danger" | "info";
|
|
11
|
-
defaultEffect: "
|
|
11
|
+
defaultEffect: "plain" | "light" | "dark";
|
|
12
12
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
export default _default;
|