@done-coding/admin-core 0.1.1-alpha.2 → 0.1.1-alpha.4
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/es/components/form/FormDatePicker.vue.mjs +7 -0
- package/es/components/form/FormDatePicker.vue2.mjs +50 -0
- package/es/components/form/index.mjs +19 -19
- package/es/components/form/utils.mjs +82 -61
- package/es/components/misc/ActionButton.vue.mjs +52 -0
- package/es/components/misc/ActionButton.vue2.mjs +4 -0
- package/es/components/misc/ActionButtonDanger.vue.mjs +32 -0
- package/es/components/misc/ActionButtonDanger.vue2.mjs +4 -0
- package/es/components/misc/ActionButtonWarn.vue.mjs +32 -0
- package/es/components/misc/ActionButtonWarn.vue2.mjs +4 -0
- package/es/components/misc/index.mjs +21 -9
- package/es/components/table/TableMain.vue.mjs +1 -1
- package/es/components/table/TableMain.vue2.mjs +148 -133
- package/es/components/table/TableToolbar.vue.mjs +3 -3
- package/es/components/table/TableToolbar.vue2.mjs +154 -70
- package/es/components/table/ToolbarButtons.vue.mjs +49 -0
- package/es/components/table/ToolbarButtons.vue2.mjs +4 -0
- package/es/helpers/list-helper.mjs +29 -33
- package/es/index.mjs +104 -92
- package/es/style.css +1 -1
- package/es/utils/export.mjs +23 -0
- package/package.json +2 -2
- package/types/components/form/{FormDateTimeRange.vue.d.ts → FormDatePicker.vue.d.ts} +2 -2
- package/types/components/form/index.d.ts +2 -2
- package/types/components/form/utils.d.ts +3 -1
- package/types/components/misc/ActionButton.vue.d.ts +24 -0
- package/types/components/misc/ActionButtonDanger.vue.d.ts +19 -0
- package/types/components/misc/ActionButtonWarn.vue.d.ts +19 -0
- package/types/components/misc/index.d.ts +4 -1
- package/types/components/table/TableToolbar.vue.d.ts +66 -9
- package/types/components/table/ToolbarButtons.vue.d.ts +19 -0
- package/types/components/table/types.d.ts +64 -17
- package/types/utils/export.d.ts +30 -0
- package/types/utils/index.d.ts +1 -0
- package/es/components/form/FormDateTimeRange.vue.mjs +0 -46
- package/es/components/form/FormDateTimeRange.vue2.mjs +0 -4
package/es/index.mjs
CHANGED
|
@@ -5,108 +5,120 @@ import { miscInstall as a } from "./components/misc/index.mjs";
|
|
|
5
5
|
import { modalInstall as m } from "./components/modal/index.mjs";
|
|
6
6
|
import { tableInstall as f } from "./components/table/index.mjs";
|
|
7
7
|
import { listPageInstall as s } from "./components/list-page/index.mjs";
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as h } from "./components/form/
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as v } from "./components/
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import {
|
|
22
|
-
import { default as
|
|
23
|
-
import {
|
|
24
|
-
import { default as
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import { default as
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
|
|
8
|
+
import { default as E } from "./components/misc/ActionButton.vue.mjs";
|
|
9
|
+
import { default as M } from "./components/misc/ActionButtonDanger.vue.mjs";
|
|
10
|
+
import { default as A } from "./components/misc/ActionButtonWarn.vue.mjs";
|
|
11
|
+
import { default as R } from "./components/modal/DetailModal.vue.mjs";
|
|
12
|
+
import { default as O } from "./components/form/FormMain.vue.mjs";
|
|
13
|
+
import { default as L } from "./components/form/FormRadio.vue.mjs";
|
|
14
|
+
import { default as D } from "./components/form/FormRadioGroup.vue.mjs";
|
|
15
|
+
import { default as h } from "./components/form/FormSelect.vue.mjs";
|
|
16
|
+
import { default as N } from "./components/form/FormTree.vue.mjs";
|
|
17
|
+
import { default as G } from "./components/form/FormVerifyCode.vue.mjs";
|
|
18
|
+
import { default as v } from "./components/menu/MenuItemSub.vue.mjs";
|
|
19
|
+
import { default as U } from "./components/menu/MenuTree.vue.mjs";
|
|
20
|
+
import { default as k } from "./components/display/TabsMain.vue.mjs";
|
|
21
|
+
import { default as K } from "./components/misc/TriggerAutoImport.vue.mjs";
|
|
22
|
+
import { default as X } from "./components/display/WatchSize.vue.mjs";
|
|
23
|
+
import { APP_API_LIST_MODEL_KEY_CONFIG as Q } from "./config/list-model.mjs";
|
|
24
|
+
import { default as q } from "./components/misc/AutoRefresh.vue.mjs";
|
|
25
|
+
import { BODY_CONTENT_VIEWPORT_HEIGHT as Z } from "./inject/key.mjs";
|
|
26
|
+
import { default as ee } from "./components/modal/ConfirmModal.vue.mjs";
|
|
27
|
+
import { EXPORT_MAX_LIMIT as oe, OPERATE_COLUMN_PROP as re, exportCSV as ae, pickExportColumns as me } from "./utils/export.mjs";
|
|
28
|
+
import { FORM_CONFIG_SELECT_ALL_VALUE as se, getConfirmPasswordRule as le, passwordRule as ue, setFormComponentType as ie } from "./helpers/form.mjs";
|
|
29
|
+
import { FORM_ITEM_CHANGE_LOADING as ne, generateFormData as xe, getBlurSubmit as de, getChangeSubmit as ce, getDatePickerSwiftOptions as Ie, getEnterSubmit as ge, getPlaceholder as Ee, getVModelSugar as _e, parseFormData as Me, setInputComponent as Te, setSelectComponent as Ae, stringifyFormData as Fe, swiftFormItemConfig as Re } from "./components/form/utils.mjs";
|
|
30
|
+
import { default as Oe } from "./components/form/FormDatePicker.vue.mjs";
|
|
31
|
+
import { default as Le } from "./components/form/FormSearch.vue.mjs";
|
|
32
|
+
import { default as De } from "./components/form/FormVerifyImage.vue.mjs";
|
|
33
|
+
import { default as he } from "./components/list-page/ListPage.vue.mjs";
|
|
34
|
+
import { ROUTE_MODULE_LEVEL as Ne, TabsMainReplaceQueryKey as we } from "./config/route.mjs";
|
|
35
|
+
import { default as Ve } from "./components/table/TableMain.vue.mjs";
|
|
36
|
+
import { countAll as Be, createListApi as Ue, fetchListAll as We } from "./helpers/list-helper.mjs";
|
|
37
|
+
import { createGenerateRouteMetaRawTree as He } from "./helpers/route.mjs";
|
|
38
|
+
import { createStorageWithNamespace as ze } from "./helpers/storage.mjs";
|
|
39
|
+
import { createUseState as Ye } from "./helpers/state.mjs";
|
|
40
|
+
import { flatRouteMetaResolveRaw as je, getRoutePermissionKey as qe } from "./utils/router.mjs";
|
|
41
|
+
import { getId as Ze } from "./utils/id.mjs";
|
|
42
|
+
import { timeCountDown as et } from "./utils/time.mjs";
|
|
43
|
+
import { useActivated as ot, useActivatedEvent as rt, useActivatedExec as at } from "./hooks/activated.mjs";
|
|
44
|
+
import { useFeelSize as ft } from "./hooks/feel-size.mjs";
|
|
45
|
+
import { useMenusDataDispatch as lt } from "./hooks/menus-dispatch.mjs";
|
|
46
|
+
import { useTimeout as it } from "./hooks/timeout.mjs";
|
|
47
|
+
const c = {
|
|
44
48
|
install(e) {
|
|
45
49
|
e.use(t), e.use(o), e.use(r), e.use(a), e.use(m), e.use(f), e.use(s);
|
|
46
50
|
}
|
|
47
51
|
};
|
|
48
52
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Z as
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
v as
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
53
|
+
Q as APP_API_LIST_MODEL_KEY_CONFIG,
|
|
54
|
+
E as ActionButton,
|
|
55
|
+
M as ActionButtonDanger,
|
|
56
|
+
A as ActionButtonWarn,
|
|
57
|
+
q as AutoRefresh,
|
|
58
|
+
Z as BODY_CONTENT_VIEWPORT_HEIGHT,
|
|
59
|
+
ee as ConfirmModal,
|
|
60
|
+
R as DetailModal,
|
|
61
|
+
oe as EXPORT_MAX_LIMIT,
|
|
62
|
+
se as FORM_CONFIG_SELECT_ALL_VALUE,
|
|
63
|
+
ne as FORM_ITEM_CHANGE_LOADING,
|
|
64
|
+
Oe as FormDatePicker,
|
|
65
|
+
O as FormMain,
|
|
66
|
+
L as FormRadio,
|
|
67
|
+
D as FormRadioGroup,
|
|
68
|
+
Le as FormSearch,
|
|
69
|
+
h as FormSelect,
|
|
70
|
+
N as FormTree,
|
|
71
|
+
G as FormVerifyCode,
|
|
72
|
+
De as FormVerifyImage,
|
|
73
|
+
he as ListPage,
|
|
74
|
+
v as MenuItemSub,
|
|
75
|
+
U as MenuTree,
|
|
76
|
+
re as OPERATE_COLUMN_PROP,
|
|
77
|
+
Ne as ROUTE_MODULE_LEVEL,
|
|
78
|
+
Ve as TableMain,
|
|
79
|
+
k as TabsMain,
|
|
80
|
+
we as TabsMainReplaceQueryKey,
|
|
81
|
+
K as TriggerAutoImport,
|
|
82
|
+
X as WatchSize,
|
|
83
|
+
Be as countAll,
|
|
84
|
+
He as createGenerateRouteMetaRawTree,
|
|
85
|
+
Ue as createListApi,
|
|
86
|
+
ze as createStorageWithNamespace,
|
|
87
|
+
Ye as createUseState,
|
|
79
88
|
r as displayInstall,
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
ae as exportCSV,
|
|
90
|
+
We as fetchListAll,
|
|
91
|
+
je as flatRouteMetaResolveRaw,
|
|
82
92
|
t as formInstall,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
xe as generateFormData,
|
|
94
|
+
de as getBlurSubmit,
|
|
95
|
+
ce as getChangeSubmit,
|
|
96
|
+
le as getConfirmPasswordRule,
|
|
97
|
+
Ie as getDatePickerSwiftOptions,
|
|
98
|
+
ge as getEnterSubmit,
|
|
99
|
+
Ze as getId,
|
|
100
|
+
Ee as getPlaceholder,
|
|
101
|
+
qe as getRoutePermissionKey,
|
|
102
|
+
_e as getVModelSugar,
|
|
103
|
+
c as installComponents,
|
|
93
104
|
s as listPageInstall,
|
|
94
105
|
o as menuInstall,
|
|
95
106
|
a as miscInstall,
|
|
96
107
|
m as modalInstall,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
Me as parseFormData,
|
|
109
|
+
ue as passwordRule,
|
|
110
|
+
me as pickExportColumns,
|
|
111
|
+
ie as setFormComponentType,
|
|
112
|
+
Te as setInputComponent,
|
|
113
|
+
Ae as setSelectComponent,
|
|
114
|
+
Fe as stringifyFormData,
|
|
115
|
+
Re as swiftFormItemConfig,
|
|
104
116
|
f as tableInstall,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
et as timeCountDown,
|
|
118
|
+
ot as useActivated,
|
|
119
|
+
rt as useActivatedEvent,
|
|
120
|
+
at as useActivatedExec,
|
|
121
|
+
ft as useFeelSize,
|
|
122
|
+
lt as useMenusDataDispatch,
|
|
123
|
+
it as useTimeout
|
|
112
124
|
};
|
package/es/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.form-item-tip[data-v-e889a0ed]{text-align:left;line-height:1.5;font-size:12px}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.auto-refresh[data-v-9d78ca06]{display:flex;align-items:center;gap:8px}.auto-refresh-label[data-v-9d78ca06]{font-size:13px;color:var(--el-text-color-regular)}.auto-refresh-interval[data-v-9d78ca06]{width:80px}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-toolbar[data-v-
|
|
1
|
+
.form-item-tip[data-v-e889a0ed]{text-align:left;line-height:1.5;font-size:12px}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.form-date-picker[data-v-cefb4529]{display:flex;align-items:center}.form-date-picker-input[data-v-cefb4529]{width:50%}.form-date-picker-swift[data-v-cefb4529]{width:50%;padding-left:12px;display:flex;align-items:center;gap:8px;flex-wrap:nowrap}.auto-refresh[data-v-9d78ca06]{display:flex;align-items:center;gap:8px}.auto-refresh-label[data-v-9d78ca06]{font-size:13px;color:var(--el-text-color-regular)}.auto-refresh-interval[data-v-9d78ca06]{width:80px}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-toolbar[data-v-66ef498f]{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px;gap:20px}.table-toolbar-left[data-v-66ef498f],.table-toolbar-right[data-v-66ef498f]{display:flex;align-items:center;gap:10px}.table-toolbar-icon--rotating[data-v-66ef498f]{animation:table-toolbar-rotating-66ef498f 1s linear infinite}@keyframes table-toolbar-rotating-66ef498f{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.table-main-table[data-v-3d9833b8]{--el-table-header-bg-color: var(--v131e457a)}.table-main-pagination[data-v-3d9833b8]{margin-top:10px;display:flex;justify-content:flex-end}.list-page[data-v-182577bf]{min-height:var(--ad28a056)}.list-page-header[data-v-182577bf],.list-page-operation[data-v-182577bf]{margin-bottom:10px}.list-page[data-v-182577bf] .el-loading-mask{left:-10px;top:-10px;right:-10px;bottom:-10px}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const f = "OPERATE", E = 1e4, O = (t) => t.filter((e) => !(!e.prop || e.prop === f || e.type && e.type !== "default")).map((e) => ({
|
|
2
|
+
prop: e.prop,
|
|
3
|
+
label: e.label
|
|
4
|
+
})), b = "\uFEFF", R = ({
|
|
5
|
+
columns: t,
|
|
6
|
+
list: e,
|
|
7
|
+
filename: a = "导出数据"
|
|
8
|
+
}) => {
|
|
9
|
+
const s = t.map((r) => r.label).join(","), c = e.map(
|
|
10
|
+
(r) => t.map((o) => {
|
|
11
|
+
const i = o.valueMap ? o.valueMap(r) : r[o.prop] ?? "";
|
|
12
|
+
return `"${String(i).replace(/"/g, '""')}"`;
|
|
13
|
+
}).join(",")
|
|
14
|
+
), l = b + [s, ...c].join(`
|
|
15
|
+
`), u = new Blob([l], { type: "text/csv;charset=utf-8;" }), p = URL.createObjectURL(u), n = document.createElement("a");
|
|
16
|
+
n.href = p, n.download = `${a}.csv`, n.click(), URL.revokeObjectURL(p);
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
E as EXPORT_MAX_LIMIT,
|
|
20
|
+
f as OPERATE_COLUMN_PROP,
|
|
21
|
+
R as exportCSV,
|
|
22
|
+
O as pickExportColumns
|
|
23
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/admin-core",
|
|
3
|
-
"version": "0.1.1-alpha.
|
|
3
|
+
"version": "0.1.1-alpha.4",
|
|
4
4
|
"description": "后台管理核心",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"node": ">=18.0.0",
|
|
78
78
|
"pnpm": ">=9.0.0"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "794ee8e01014a83fba07f0dc7a6b53258420dd64"
|
|
81
81
|
}
|
|
@@ -4,13 +4,13 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
4
4
|
modelValue: import('vue').PropType<[Date, Date] | null>;
|
|
5
5
|
swiftOptions: {
|
|
6
6
|
type: globalThis.PropType<DateTimeRangeSwiftOption[]>;
|
|
7
|
-
default: () =>
|
|
7
|
+
default: () => DateTimeRangeSwiftOption[];
|
|
8
8
|
};
|
|
9
9
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
10
10
|
modelValue: import('vue').PropType<[Date, Date] | null>;
|
|
11
11
|
swiftOptions: {
|
|
12
12
|
type: globalThis.PropType<DateTimeRangeSwiftOption[]>;
|
|
13
|
-
default: () =>
|
|
13
|
+
default: () => DateTimeRangeSwiftOption[];
|
|
14
14
|
};
|
|
15
15
|
}>> & Readonly<{}>, {
|
|
16
16
|
swiftOptions: DateTimeRangeSwiftOption[];
|
|
@@ -7,9 +7,9 @@ import { default as FormTree } from './FormTree.vue';
|
|
|
7
7
|
import { default as FormSearch } from './FormSearch.vue';
|
|
8
8
|
import { default as FormVerifyImage } from './FormVerifyImage.vue';
|
|
9
9
|
import { default as FormVerifyCode } from './FormVerifyCode.vue';
|
|
10
|
-
import { default as
|
|
10
|
+
import { default as FormDatePicker } from './FormDatePicker.vue';
|
|
11
11
|
|
|
12
12
|
export * from './types';
|
|
13
13
|
export * from './utils';
|
|
14
|
-
export { FormMain, FormSelect, FormSearch, FormRadioGroup, FormRadio, FormTree, FormVerifyImage, FormVerifyCode,
|
|
14
|
+
export { FormMain, FormSelect, FormSearch, FormRadioGroup, FormRadio, FormTree, FormVerifyImage, FormVerifyCode, FormDatePicker, };
|
|
15
15
|
export declare const formInstall: Plugin;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { FormItemConfig, FormItemConfigList, ExtractFormStringifyFromObject, FormItemConfigSwiftOptions } from './types';
|
|
1
|
+
import { DateTimeRangeSwiftOption, FormItemConfig, FormItemConfigList, ExtractFormStringifyFromObject, FormItemConfigSwiftOptions } from './types';
|
|
2
2
|
|
|
3
|
+
/** 获取日期选择器默认快捷选项:今日、昨日、近7日 */
|
|
4
|
+
export declare const getDatePickerSwiftOptions: () => DateTimeRangeSwiftOption[];
|
|
3
5
|
/**
|
|
4
6
|
* 生成表单数据
|
|
5
7
|
*/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: <T>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
2
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
3
|
+
readonly onConfirm?: ((data: T) => any) | undefined;
|
|
4
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & ({
|
|
5
|
+
data: T;
|
|
6
|
+
type?: "primary" | "danger" | "info" | "warning" | "success";
|
|
7
|
+
/** Popconfirm 标题 */
|
|
8
|
+
tipContent: string | ((data: T) => string);
|
|
9
|
+
} & {
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
}), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
12
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
13
|
+
attrs: any;
|
|
14
|
+
slots: ReturnType<() => {
|
|
15
|
+
default?(_: {}): any;
|
|
16
|
+
}>;
|
|
17
|
+
emit: (evt: "confirm", data: T) => void;
|
|
18
|
+
}>) => import('vue').VNode & {
|
|
19
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_Prettify<T> = {
|
|
23
|
+
[K in keyof T]: T[K];
|
|
24
|
+
} & {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const _default: <T>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
2
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
3
|
+
readonly onConfirm?: ((data: T) => any) | undefined;
|
|
4
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & ({
|
|
5
|
+
data: T;
|
|
6
|
+
tipContent: string | ((data: T) => string);
|
|
7
|
+
} & {
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
}), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
10
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
11
|
+
attrs: any;
|
|
12
|
+
slots: ReturnType<() => {
|
|
13
|
+
default?(_: {}): any;
|
|
14
|
+
}>;
|
|
15
|
+
emit: (evt: "confirm", data: T) => void;
|
|
16
|
+
}>) => import('vue').VNode & {
|
|
17
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const _default: <T>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
2
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
3
|
+
readonly onConfirm?: ((data: T) => any) | undefined;
|
|
4
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & ({
|
|
5
|
+
data: T;
|
|
6
|
+
tipContent: string | ((data: T) => string);
|
|
7
|
+
} & {
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
}), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
10
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
11
|
+
attrs: any;
|
|
12
|
+
slots: ReturnType<() => {
|
|
13
|
+
default?(_: {}): any;
|
|
14
|
+
}>;
|
|
15
|
+
emit: (evt: "confirm", data: T) => void;
|
|
16
|
+
}>) => import('vue').VNode & {
|
|
17
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Plugin } from 'vue';
|
|
2
2
|
import { default as TriggerAutoImport } from './TriggerAutoImport.vue';
|
|
3
3
|
import { default as AutoRefresh } from './AutoRefresh.vue';
|
|
4
|
+
import { default as ActionButton } from './ActionButton.vue';
|
|
5
|
+
import { default as ActionButtonDanger } from './ActionButtonDanger.vue';
|
|
6
|
+
import { default as ActionButtonWarn } from './ActionButtonWarn.vue';
|
|
4
7
|
|
|
5
|
-
export { TriggerAutoImport, AutoRefresh };
|
|
8
|
+
export { TriggerAutoImport, AutoRefresh, ActionButton, ActionButtonDanger, ActionButtonWarn, };
|
|
6
9
|
export declare const miscInstall: Plugin;
|
|
@@ -1,52 +1,109 @@
|
|
|
1
|
-
import { ExportType, TableMainInstance } from './types';
|
|
1
|
+
import { ExportType, TableExportContext, TableMainInstance } from './types';
|
|
2
2
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
4
4
|
isAutoRefresh: import('vue').PropType<boolean>;
|
|
5
|
+
pageSize: {
|
|
6
|
+
type: globalThis.PropType<number>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
5
9
|
loading: {
|
|
6
10
|
type: globalThis.PropType<boolean>;
|
|
7
11
|
required: true;
|
|
8
12
|
};
|
|
9
|
-
|
|
10
|
-
type: globalThis.PropType<
|
|
13
|
+
showRefresh: {
|
|
14
|
+
type: globalThis.PropType<boolean>;
|
|
15
|
+
default: boolean;
|
|
11
16
|
};
|
|
12
|
-
|
|
13
|
-
type: globalThis.PropType<
|
|
17
|
+
showAutoRefresh: {
|
|
18
|
+
type: globalThis.PropType<boolean>;
|
|
19
|
+
default: boolean;
|
|
14
20
|
};
|
|
15
21
|
refreshInterval: {
|
|
16
22
|
type: globalThis.PropType<number>;
|
|
17
23
|
default: number;
|
|
18
24
|
};
|
|
25
|
+
exportByFe: {
|
|
26
|
+
type: globalThis.PropType<boolean>;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
19
29
|
exportFn: {
|
|
20
30
|
type: globalThis.PropType<(type: ExportType) => Promise<unknown>>;
|
|
21
31
|
};
|
|
32
|
+
exportColumns: {
|
|
33
|
+
type: globalThis.PropType<import('../../utils').ExportColumnConfig[]>;
|
|
34
|
+
};
|
|
35
|
+
leftExtraButtons: {
|
|
36
|
+
type: globalThis.PropType<import('./types').ToolbarButtonConfig<Record<string, any>>[]>;
|
|
37
|
+
};
|
|
38
|
+
rightExtraButtons: {
|
|
39
|
+
type: globalThis.PropType<import('./types').ToolbarButtonConfig<Record<string, any>>[]>;
|
|
40
|
+
};
|
|
22
41
|
tableExpose: {
|
|
23
42
|
type: globalThis.PropType<TableMainInstance>;
|
|
24
43
|
required: true;
|
|
25
44
|
};
|
|
45
|
+
exportContext: {
|
|
46
|
+
type: globalThis.PropType<TableExportContext>;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
currentPage: {
|
|
50
|
+
type: globalThis.PropType<number>;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
26
53
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
27
54
|
isAutoRefresh: import('vue').PropType<boolean>;
|
|
55
|
+
pageSize: {
|
|
56
|
+
type: globalThis.PropType<number>;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
28
59
|
loading: {
|
|
29
60
|
type: globalThis.PropType<boolean>;
|
|
30
61
|
required: true;
|
|
31
62
|
};
|
|
32
|
-
|
|
33
|
-
type: globalThis.PropType<
|
|
63
|
+
showRefresh: {
|
|
64
|
+
type: globalThis.PropType<boolean>;
|
|
65
|
+
default: boolean;
|
|
34
66
|
};
|
|
35
|
-
|
|
36
|
-
type: globalThis.PropType<
|
|
67
|
+
showAutoRefresh: {
|
|
68
|
+
type: globalThis.PropType<boolean>;
|
|
69
|
+
default: boolean;
|
|
37
70
|
};
|
|
38
71
|
refreshInterval: {
|
|
39
72
|
type: globalThis.PropType<number>;
|
|
40
73
|
default: number;
|
|
41
74
|
};
|
|
75
|
+
exportByFe: {
|
|
76
|
+
type: globalThis.PropType<boolean>;
|
|
77
|
+
default: boolean;
|
|
78
|
+
};
|
|
42
79
|
exportFn: {
|
|
43
80
|
type: globalThis.PropType<(type: ExportType) => Promise<unknown>>;
|
|
44
81
|
};
|
|
82
|
+
exportColumns: {
|
|
83
|
+
type: globalThis.PropType<import('../../utils').ExportColumnConfig[]>;
|
|
84
|
+
};
|
|
85
|
+
leftExtraButtons: {
|
|
86
|
+
type: globalThis.PropType<import('./types').ToolbarButtonConfig<Record<string, any>>[]>;
|
|
87
|
+
};
|
|
88
|
+
rightExtraButtons: {
|
|
89
|
+
type: globalThis.PropType<import('./types').ToolbarButtonConfig<Record<string, any>>[]>;
|
|
90
|
+
};
|
|
45
91
|
tableExpose: {
|
|
46
92
|
type: globalThis.PropType<TableMainInstance>;
|
|
47
93
|
required: true;
|
|
48
94
|
};
|
|
95
|
+
exportContext: {
|
|
96
|
+
type: globalThis.PropType<TableExportContext>;
|
|
97
|
+
required: true;
|
|
98
|
+
};
|
|
99
|
+
currentPage: {
|
|
100
|
+
type: globalThis.PropType<number>;
|
|
101
|
+
required: true;
|
|
102
|
+
};
|
|
49
103
|
}>> & Readonly<{}>, {
|
|
104
|
+
showRefresh: boolean;
|
|
105
|
+
showAutoRefresh: boolean;
|
|
50
106
|
refreshInterval: number;
|
|
107
|
+
exportByFe: boolean;
|
|
51
108
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
52
109
|
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ToolbarButtonConfig, ToolbarButtonContext } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
buttons?: ToolbarButtonConfig[];
|
|
5
|
+
ctx: ToolbarButtonContext;
|
|
6
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
|
+
buttons?: ToolbarButtonConfig[];
|
|
8
|
+
ctx: ToolbarButtonContext;
|
|
9
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ElTableColumn as ETC, TableInstance, TableProps } from 'element-plus';
|
|
2
2
|
import { APP_API_LIST_MODEL_KEY_CONFIG, BuildListParams } from '../../config';
|
|
3
3
|
import { DotToObject, UnionToIntersection } from '../../types';
|
|
4
|
+
import { ExportColumnConfig } from '../../utils';
|
|
4
5
|
import { ExtractPropTypes, VNode } from 'vue';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -26,28 +27,74 @@ export interface TableMainInstance {
|
|
|
26
27
|
}
|
|
27
28
|
/** 导出类型 */
|
|
28
29
|
export type ExportType = "selected" | "current" | "all";
|
|
29
|
-
/** toolbar
|
|
30
|
-
export
|
|
31
|
-
/**
|
|
32
|
-
|
|
30
|
+
/** TableMain 传给 toolbar 的导出上下文 */
|
|
31
|
+
export interface TableExportContext {
|
|
32
|
+
/** 可导出列 */
|
|
33
|
+
columns: Pick<ElTableColumnProps, "prop" | "label">[];
|
|
34
|
+
/** 选中行数据 */
|
|
35
|
+
selectedList: Record<string, any>[];
|
|
36
|
+
/** 当前页数据 */
|
|
37
|
+
currentPageList: Record<string, any>[];
|
|
38
|
+
/** 分页 API */
|
|
39
|
+
api: TableMainProps<any, any, any>["api"];
|
|
40
|
+
/** 静态查询参数 */
|
|
41
|
+
query: Record<string, any>;
|
|
42
|
+
/** 当前数据总数 */
|
|
43
|
+
total: number;
|
|
44
|
+
/** 是否包含 selection 列 */
|
|
45
|
+
hasSelection: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** toolbar 按钮渲染上下文 */
|
|
48
|
+
export interface ToolbarButtonContext<T extends Record<string, any> = Record<string, any>> {
|
|
49
|
+
/** TableMain expose */
|
|
50
|
+
tableExpose: TableMainInstance;
|
|
51
|
+
/** 表格是否加载中 */
|
|
52
|
+
loading: boolean;
|
|
53
|
+
/** 导出上下文 */
|
|
54
|
+
exportContext: TableExportContext;
|
|
55
|
+
/** 当前选中行数据 */
|
|
56
|
+
selectedList: T[];
|
|
57
|
+
/** 分页信息 */
|
|
58
|
+
pagination: {
|
|
59
|
+
currentPage: number;
|
|
60
|
+
pageSize: number;
|
|
61
|
+
total: number;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** toolbar 额外按钮配置 */
|
|
65
|
+
export interface ToolbarButtonConfig<T extends Record<string, any> = Record<string, any>> {
|
|
66
|
+
key: string;
|
|
67
|
+
/** ElButton props,与 actionButtonProps 二选一 */
|
|
68
|
+
props?: (ctx: ToolbarButtonContext<T>) => Record<string, any>;
|
|
69
|
+
/** ActionButton props(含 data/tipContent),与 props 二选一 */
|
|
70
|
+
actionButtonProps?: (ctx: ToolbarButtonContext<T>) => Record<string, any>;
|
|
71
|
+
/** 按钮文字。btnRender 优先 */
|
|
72
|
+
label?: string;
|
|
73
|
+
/** 按钮内容 render,优先级高于 label */
|
|
74
|
+
btnRender?: (ctx: ToolbarButtonContext<T>) => VNode[];
|
|
75
|
+
}
|
|
33
76
|
/** toolbar 可配置项(通过 TableMain 的 toolbar prop 传入) */
|
|
34
77
|
export interface TableToolbarConfig {
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*/
|
|
40
|
-
leftFeatures?: TableToolbarLeftFeature[];
|
|
41
|
-
/**
|
|
42
|
-
* 右侧功能列表。
|
|
43
|
-
* - undefined(默认):显示所有右侧功能
|
|
44
|
-
* - [](空数组):不渲染右侧功能
|
|
45
|
-
*/
|
|
46
|
-
rightFeatures?: TableToolbarRightFeature[];
|
|
78
|
+
/** 是否显示刷新按钮,默认 true */
|
|
79
|
+
showRefresh?: boolean;
|
|
80
|
+
/** 是否显示自动刷新开关,默认 true */
|
|
81
|
+
showAutoRefresh?: boolean;
|
|
47
82
|
/** 自动刷新默认间隔(秒),默认 30 */
|
|
48
83
|
refreshInterval?: number;
|
|
49
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* 是否由前端导出,默认 true。
|
|
86
|
+
* - true:toolbar 内部调 fetchListAll + exportCSV 完成导出
|
|
87
|
+
* - false:走 exportFn 回调
|
|
88
|
+
*/
|
|
89
|
+
exportByFe?: boolean;
|
|
90
|
+
/** 导出方法。传入导出类型,返回 Promise。exportByFe 为 false 时必传 */
|
|
50
91
|
exportFn?: (type: ExportType) => Promise<unknown>;
|
|
92
|
+
/** 导出列配置。不传则不显示导出按钮。支持 valueMap 自定义取值 */
|
|
93
|
+
exportColumns?: ExportColumnConfig[];
|
|
94
|
+
/** 左侧额外按钮 */
|
|
95
|
+
leftExtraButtons?: ToolbarButtonConfig[];
|
|
96
|
+
/** 右侧额外按钮 */
|
|
97
|
+
rightExtraButtons?: ToolbarButtonConfig[];
|
|
51
98
|
}
|
|
52
99
|
/** 表格列默认作用域 */
|
|
53
100
|
export interface TableColumnDefaultScope<T extends Record<string, any>, F extends Record<string, any>> {
|