easy-ep-ui 0.1.2 → 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/dist/easy-ep-ui.js +1 -1
- package/dist/style.css +1 -1
- package/es/components/ee-form-table/src/components/TableToolbar.vue.d.ts +9 -3
- package/es/components/ee-form-table/src/hooks/useCrud.d.ts +1 -1
- package/es/components/ee-form-table/src/hooks/useTable.d.ts +28 -11
- package/es/components/ee-form-table/src/index.vue.d.ts +20 -1
- package/es/components/ee-form-table/types.d.ts +45 -1
- package/es/index.d.ts +1 -0
- package/es/index.mjs +1863 -1475
- package/es/locale/index.d.ts +5 -0
- package/es/style.css +1 -1
- package/lib/components/ee-form-table/src/components/TableToolbar.vue.d.ts +9 -3
- package/lib/components/ee-form-table/src/hooks/useCrud.d.ts +1 -1
- package/lib/components/ee-form-table/src/hooks/useTable.d.ts +28 -11
- package/lib/components/ee-form-table/src/index.vue.d.ts +20 -1
- package/lib/components/ee-form-table/types.d.ts +45 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/locale/index.d.ts +5 -0
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/es/locale/index.d.ts
CHANGED
|
@@ -48,6 +48,11 @@ export interface Locale {
|
|
|
48
48
|
dateRangeTo: string;
|
|
49
49
|
dateRangeStart: string;
|
|
50
50
|
dateRangeEnd: string;
|
|
51
|
+
version: string;
|
|
52
|
+
versionTitle: string;
|
|
53
|
+
moreActions: string;
|
|
54
|
+
rowIndex: string;
|
|
55
|
+
selectionLabel: string;
|
|
51
56
|
};
|
|
52
57
|
searchBar: {
|
|
53
58
|
search: string;
|
package/es/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ee-search-bar[data-v-fe481020]{margin-bottom:16px}.ee-search-bar .el-form-item[data-v-fe481020]{margin-bottom:0}.ee-form-dialog-footer[data-v-929d8568]{display:flex;justify-content:flex-end;gap:12px}.ee-form-table{display:flex;flex-direction:column;height:100%;background:#fff;border-radius:4px}.ee-search-area{padding:16px 16px 0;border-bottom:1px solid #ebeef5}.ee-search-area .el-form-item{margin-bottom:16px}.ee-toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;flex-shrink:0}.ee-toolbar-left{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ee-toolbar-right{display:flex;align-items:center;gap:8px}.ee-table-wrapper{flex:1;overflow:auto;padding:0 16px}.ee-table-wrapper .el-table{width:100%}.ee-pagination{display:flex;justify-content:flex-end;padding:12px 16px;border-top:1px solid #ebeef5;flex-shrink:0}.ee-size--small{font-size:13px}.ee-size--large{font-size:16px}.ee-load-more[data-v-21c5d143],.ee-no-more[data-v-21c5d143]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999;cursor:pointer}.ee-load-more[data-v-21c5d143]:hover{color:#409eff}.ee-loading-tip[data-v-21c5d143]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999}.ee-load-more[data-v-6e78b80d],.ee-no-more[data-v-6e78b80d]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999;cursor:pointer}.ee-load-more[data-v-6e78b80d]:hover{color:#409eff}.ee-loading-tip[data-v-6e78b80d]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999}.ee-load-more[data-v-58cd12c9],.ee-no-more[data-v-58cd12c9]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999;cursor:pointer}.ee-load-more[data-v-58cd12c9]:hover{color:#409eff}.ee-loading-tip[data-v-58cd12c9]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999}
|
|
1
|
+
.ee-search-bar[data-v-fe481020]{margin-bottom:16px}.ee-search-bar .el-form-item[data-v-fe481020]{margin-bottom:0}.ee-form-dialog-footer[data-v-929d8568]{display:flex;justify-content:flex-end;gap:12px}.ee-column-setting[data-v-951992f2]{max-height:320px;overflow-y:auto}.ee-column-setting-item[data-v-951992f2]{display:flex;align-items:center;justify-content:space-between;padding:4px 4px 4px 8px;cursor:grab;border-radius:4px;-webkit-user-select:none;user-select:none}.ee-column-setting-item[data-v-951992f2]:hover{background:var(--el-color-primary-light-9, #f0f5ff)}.ee-column-setting-item--drag-over[data-v-951992f2]{background:var(--el-color-primary-light-7, #d9ecff)}.ee-column-setting-drag[data-v-951992f2]{cursor:grab;color:#c0c4cc;font-size:14px}.ee-column-setting-drag[data-v-951992f2]:hover{color:#909399}.ee-column-setting-special[data-v-951992f2]{padding-bottom:4px}.ee-column-setting-item--special[data-v-951992f2]{cursor:default}.ee-column-setting-item--special[data-v-951992f2]:hover{background:transparent}.ee-form-table{display:flex;flex-direction:column;height:100%;background:#fff;border-radius:4px}.ee-search-area{padding:16px 16px 0;border-bottom:1px solid #ebeef5}.ee-search-area .el-form-item{margin-bottom:16px}.ee-toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;flex-shrink:0}.ee-toolbar-left{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ee-toolbar-right{display:flex;align-items:center;gap:8px}.ee-table-wrapper{flex:1;overflow:auto;padding:0 16px}.ee-table-wrapper .el-table{width:100%}.ee-table-wrapper .el-table th.el-table__cell{background-color:#f5f7fa}.app-root.dark .ee-table-wrapper .el-table th.el-table__cell{background-color:#2a2a2a}.ee-pagination{display:flex;justify-content:flex-end;padding:12px 16px;border-top:1px solid #ebeef5;flex-shrink:0}.ee-size--small{font-size:13px}.ee-size--large{font-size:16px}.ee-action-btns{display:flex;align-items:center;justify-content:center;gap:2px;flex-wrap:nowrap}.ee-action-btn{white-space:nowrap!important}.ee-action-btn .el-icon{margin-right:0}.ee-load-more[data-v-21c5d143],.ee-no-more[data-v-21c5d143]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999;cursor:pointer}.ee-load-more[data-v-21c5d143]:hover{color:#409eff}.ee-loading-tip[data-v-21c5d143]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999}.ee-load-more[data-v-6e78b80d],.ee-no-more[data-v-6e78b80d]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999;cursor:pointer}.ee-load-more[data-v-6e78b80d]:hover{color:#409eff}.ee-loading-tip[data-v-6e78b80d]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999}.ee-load-more[data-v-58cd12c9],.ee-no-more[data-v-58cd12c9]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999;cursor:pointer}.ee-load-more[data-v-58cd12c9]:hover{color:#409eff}.ee-loading-tip[data-v-58cd12c9]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToolbarConfig } from '../../types';
|
|
1
|
+
import { ToolbarConfig, TableColumn } from '../../types';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
show: boolean;
|
|
4
4
|
toolbarCfg: ToolbarConfig;
|
|
@@ -8,6 +8,14 @@ type __VLS_Props = {
|
|
|
8
8
|
authPass: (auth?: string) => boolean;
|
|
9
9
|
selectionCount: number;
|
|
10
10
|
showColumnSetting: boolean;
|
|
11
|
+
allColumns: TableColumn[];
|
|
12
|
+
checkedColumns: string[];
|
|
13
|
+
toggleColumn: (prop: string) => void;
|
|
14
|
+
moveColumn: (from: number, to: number) => void;
|
|
15
|
+
showIndex: boolean;
|
|
16
|
+
toggleIndex: () => void;
|
|
17
|
+
selectionVisible: boolean;
|
|
18
|
+
toggleSelection: () => void;
|
|
11
19
|
};
|
|
12
20
|
};
|
|
13
21
|
declare function __VLS_template(): {
|
|
@@ -25,14 +33,12 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
25
33
|
import: () => any;
|
|
26
34
|
export: () => any;
|
|
27
35
|
refresh: () => any;
|
|
28
|
-
"column-setting": () => any;
|
|
29
36
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
37
|
onAdd?: (() => any) | undefined;
|
|
31
38
|
"onBatch-delete"?: (() => any) | undefined;
|
|
32
39
|
onImport?: (() => any) | undefined;
|
|
33
40
|
onExport?: (() => any) | undefined;
|
|
34
41
|
onRefresh?: (() => any) | undefined;
|
|
35
|
-
"onColumn-setting"?: (() => any) | undefined;
|
|
36
42
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
37
43
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
38
44
|
export default _default;
|
|
@@ -35,7 +35,7 @@ export declare function useCrud(props: {
|
|
|
35
35
|
fetchData: () => Promise<void>;
|
|
36
36
|
refreshTable: () => Promise<void>;
|
|
37
37
|
doDelete: (row: Record<string, unknown>) => Promise<void>;
|
|
38
|
-
handleDelete: (row: Record<string, unknown
|
|
38
|
+
handleDelete: (row: Record<string, unknown>) => Promise<void>;
|
|
39
39
|
doBatchDelete: (ids: (string | number)[]) => Promise<void>;
|
|
40
40
|
handleBatchDelete: () => Promise<void>;
|
|
41
41
|
};
|
|
@@ -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,7 +31,24 @@ 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
|
+
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
|
+
};
|
|
34
52
|
}) => any>> & {
|
|
35
53
|
'search-action'?(_: {
|
|
36
54
|
params: Record<string, unknown>;
|
|
@@ -971,6 +989,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
|
971
989
|
emptyText: string;
|
|
972
990
|
border: boolean;
|
|
973
991
|
stripe: boolean;
|
|
992
|
+
readOnly: boolean;
|
|
974
993
|
authMode: "hide" | "disabled";
|
|
975
994
|
highlightCurrentRow: boolean;
|
|
976
995
|
rowKey: string;
|
|
@@ -79,6 +79,7 @@ export interface TableColumn {
|
|
|
79
79
|
fixed?: FixedType;
|
|
80
80
|
sortable?: boolean;
|
|
81
81
|
show?: boolean;
|
|
82
|
+
showTooltip?: boolean;
|
|
82
83
|
formatter?: (row: Record<string, unknown>, column: TableColumn, cellValue: unknown, index: number) => unknown;
|
|
83
84
|
dictKey?: string;
|
|
84
85
|
slotName?: string;
|
|
@@ -106,13 +107,15 @@ export interface PaginationConfig {
|
|
|
106
107
|
}
|
|
107
108
|
export interface ActionButton {
|
|
108
109
|
text: string;
|
|
109
|
-
icon?:
|
|
110
|
+
icon?: any;
|
|
110
111
|
type?: ButtonType;
|
|
111
112
|
code?: string;
|
|
112
113
|
auth?: string;
|
|
113
114
|
show?: (row: Record<string, unknown>) => boolean;
|
|
114
115
|
handler: (row: Record<string, unknown>) => void;
|
|
115
116
|
}
|
|
117
|
+
/** 操作列按钮展示模式 */
|
|
118
|
+
export type ActionButtonMode = 'text' | 'icon' | 'icon-text';
|
|
116
119
|
export interface ActionConfig {
|
|
117
120
|
show?: boolean;
|
|
118
121
|
label?: string;
|
|
@@ -121,17 +124,28 @@ export interface ActionConfig {
|
|
|
121
124
|
showView?: boolean;
|
|
122
125
|
showEdit?: boolean;
|
|
123
126
|
showDelete?: boolean;
|
|
127
|
+
showVersion?: boolean;
|
|
124
128
|
viewText?: string;
|
|
125
129
|
editText?: string;
|
|
126
130
|
deleteText?: string;
|
|
131
|
+
versionText?: string;
|
|
127
132
|
viewAuth?: string;
|
|
128
133
|
editAuth?: string;
|
|
129
134
|
deleteAuth?: string;
|
|
135
|
+
versionAuth?: string;
|
|
130
136
|
fixed?: FixedType;
|
|
131
137
|
confirmDelete?: boolean;
|
|
132
138
|
deleteConfirmTitle?: string;
|
|
133
139
|
deleteConfirmMessage?: string;
|
|
134
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;
|
|
135
149
|
}
|
|
136
150
|
export interface ToolbarButton {
|
|
137
151
|
text: string;
|
|
@@ -147,6 +161,7 @@ export interface ToolbarConfig {
|
|
|
147
161
|
showImport?: boolean;
|
|
148
162
|
showExport?: boolean;
|
|
149
163
|
showBatchDelete?: boolean;
|
|
164
|
+
showRefresh?: boolean;
|
|
150
165
|
addText?: string;
|
|
151
166
|
importText?: string;
|
|
152
167
|
exportText?: string;
|
|
@@ -166,12 +181,38 @@ export interface CrudApi {
|
|
|
166
181
|
edit?: (data: Record<string, unknown>) => Promise<unknown>;
|
|
167
182
|
delete?: (id: string | number) => Promise<unknown>;
|
|
168
183
|
batchDelete?: (ids: (string | number)[]) => Promise<unknown>;
|
|
184
|
+
version?: (id: string | number) => Promise<Record<string, unknown>[]>;
|
|
169
185
|
}
|
|
170
186
|
export interface CrudConfig {
|
|
171
187
|
api: CrudApi;
|
|
172
188
|
baseParams?: Record<string, unknown>;
|
|
173
189
|
requestMethod?: 'GET' | 'POST';
|
|
174
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
|
+
};
|
|
175
216
|
}
|
|
176
217
|
export interface SelectionConfig {
|
|
177
218
|
show?: boolean;
|
|
@@ -203,6 +244,8 @@ export interface DrawerConfig {
|
|
|
203
244
|
export interface ColumnSettingConfig {
|
|
204
245
|
show?: boolean;
|
|
205
246
|
storageKey?: string;
|
|
247
|
+
/** 是否默认显示行号列 */
|
|
248
|
+
showIndex?: boolean;
|
|
206
249
|
}
|
|
207
250
|
export interface AutoHeightConfig {
|
|
208
251
|
offset?: number;
|
|
@@ -211,6 +254,7 @@ export interface EeFormTableProps {
|
|
|
211
254
|
columns: TableColumn[];
|
|
212
255
|
data?: Record<string, unknown>[];
|
|
213
256
|
loading?: boolean;
|
|
257
|
+
readOnly?: boolean;
|
|
214
258
|
searchConfig?: SearchConfig | boolean;
|
|
215
259
|
pagination?: PaginationConfig | boolean;
|
|
216
260
|
actionConfig?: ActionConfig | boolean;
|