@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.
Files changed (36) hide show
  1. package/es/components/form/FormDatePicker.vue.mjs +7 -0
  2. package/es/components/form/FormDatePicker.vue2.mjs +50 -0
  3. package/es/components/form/index.mjs +19 -19
  4. package/es/components/form/utils.mjs +82 -61
  5. package/es/components/misc/ActionButton.vue.mjs +52 -0
  6. package/es/components/misc/ActionButton.vue2.mjs +4 -0
  7. package/es/components/misc/ActionButtonDanger.vue.mjs +32 -0
  8. package/es/components/misc/ActionButtonDanger.vue2.mjs +4 -0
  9. package/es/components/misc/ActionButtonWarn.vue.mjs +32 -0
  10. package/es/components/misc/ActionButtonWarn.vue2.mjs +4 -0
  11. package/es/components/misc/index.mjs +21 -9
  12. package/es/components/table/TableMain.vue.mjs +1 -1
  13. package/es/components/table/TableMain.vue2.mjs +148 -133
  14. package/es/components/table/TableToolbar.vue.mjs +3 -3
  15. package/es/components/table/TableToolbar.vue2.mjs +154 -70
  16. package/es/components/table/ToolbarButtons.vue.mjs +49 -0
  17. package/es/components/table/ToolbarButtons.vue2.mjs +4 -0
  18. package/es/helpers/list-helper.mjs +29 -33
  19. package/es/index.mjs +104 -92
  20. package/es/style.css +1 -1
  21. package/es/utils/export.mjs +23 -0
  22. package/package.json +2 -2
  23. package/types/components/form/{FormDateTimeRange.vue.d.ts → FormDatePicker.vue.d.ts} +2 -2
  24. package/types/components/form/index.d.ts +2 -2
  25. package/types/components/form/utils.d.ts +3 -1
  26. package/types/components/misc/ActionButton.vue.d.ts +24 -0
  27. package/types/components/misc/ActionButtonDanger.vue.d.ts +19 -0
  28. package/types/components/misc/ActionButtonWarn.vue.d.ts +19 -0
  29. package/types/components/misc/index.d.ts +4 -1
  30. package/types/components/table/TableToolbar.vue.d.ts +66 -9
  31. package/types/components/table/ToolbarButtons.vue.d.ts +19 -0
  32. package/types/components/table/types.d.ts +64 -17
  33. package/types/utils/export.d.ts +30 -0
  34. package/types/utils/index.d.ts +1 -0
  35. package/es/components/form/FormDateTimeRange.vue.mjs +0 -46
  36. 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 F } from "./components/modal/DetailModal.vue.mjs";
9
- import { default as E } from "./components/form/FormDateTimeRange.vue.mjs";
10
- import { default as R } from "./components/form/FormMain.vue.mjs";
11
- import { default as C } from "./components/form/FormRadio.vue.mjs";
12
- import { default as S } from "./components/form/FormRadioGroup.vue.mjs";
13
- import { default as D } from "./components/form/FormSelect.vue.mjs";
14
- import { default as P } from "./components/form/FormTree.vue.mjs";
15
- import { default as h } from "./components/form/FormVerifyCode.vue.mjs";
16
- import { default as G } from "./components/menu/MenuItemSub.vue.mjs";
17
- import { default as w } from "./components/menu/MenuTree.vue.mjs";
18
- import { default as v } from "./components/display/TabsMain.vue.mjs";
19
- import { default as H } from "./components/misc/TriggerAutoImport.vue.mjs";
20
- import { default as W } from "./components/display/WatchSize.vue.mjs";
21
- import { APP_API_LIST_MODEL_KEY_CONFIG as B } from "./config/list-model.mjs";
22
- import { default as Q } from "./components/misc/AutoRefresh.vue.mjs";
23
- import { BODY_CONTENT_VIEWPORT_HEIGHT as k } from "./inject/key.mjs";
24
- import { default as J } from "./components/modal/ConfirmModal.vue.mjs";
25
- import { FORM_CONFIG_SELECT_ALL_VALUE as Z, getConfirmPasswordRule as $, passwordRule as ee, setFormComponentType as te } from "./helpers/form.mjs";
26
- import { FORM_ITEM_CHANGE_LOADING as re, generateFormData as ae, getBlurSubmit as me, getChangeSubmit as fe, getEnterSubmit as se, getPlaceholder as le, getVModelSugar as ue, parseFormData as ie, setInputComponent as pe, setSelectComponent as ne, stringifyFormData as xe, swiftFormItemConfig as de } from "./components/form/utils.mjs";
27
- import { default as ce } from "./components/form/FormSearch.vue.mjs";
28
- import { default as Fe } from "./components/form/FormVerifyImage.vue.mjs";
29
- import { default as Ee } from "./components/list-page/ListPage.vue.mjs";
30
- import { ROUTE_MODULE_LEVEL as Re, TabsMainReplaceQueryKey as _e } from "./config/route.mjs";
31
- import { default as Ae } from "./components/table/TableMain.vue.mjs";
32
- import { countAll as Le, createListApi as De, fetchListAll as Oe } from "./helpers/list-helper.mjs";
33
- import { createGenerateRouteMetaRawTree as be } from "./helpers/route.mjs";
34
- import { createStorageWithNamespace as ye } from "./helpers/storage.mjs";
35
- import { createUseState as Ne } from "./helpers/state.mjs";
36
- import { flatRouteMetaResolveRaw as Ve, getRoutePermissionKey as ve } from "./utils/router.mjs";
37
- import { getId as He } from "./utils/id.mjs";
38
- import { timeCountDown as We } from "./utils/time.mjs";
39
- import { useActivated as Be, useActivatedEvent as Ye, useActivatedExec as Qe } from "./hooks/activated.mjs";
40
- import { useFeelSize as ke } from "./hooks/feel-size.mjs";
41
- import { useMenusDataDispatch as Je } from "./hooks/menus-dispatch.mjs";
42
- import { useTimeout as Ze } from "./hooks/timeout.mjs";
43
- const I = {
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
- B as APP_API_LIST_MODEL_KEY_CONFIG,
50
- Q as AutoRefresh,
51
- k as BODY_CONTENT_VIEWPORT_HEIGHT,
52
- J as ConfirmModal,
53
- F as DetailModal,
54
- Z as FORM_CONFIG_SELECT_ALL_VALUE,
55
- re as FORM_ITEM_CHANGE_LOADING,
56
- E as FormDateTimeRange,
57
- R as FormMain,
58
- C as FormRadio,
59
- S as FormRadioGroup,
60
- ce as FormSearch,
61
- D as FormSelect,
62
- P as FormTree,
63
- h as FormVerifyCode,
64
- Fe as FormVerifyImage,
65
- Ee as ListPage,
66
- G as MenuItemSub,
67
- w as MenuTree,
68
- Re as ROUTE_MODULE_LEVEL,
69
- Ae as TableMain,
70
- v as TabsMain,
71
- _e as TabsMainReplaceQueryKey,
72
- H as TriggerAutoImport,
73
- W as WatchSize,
74
- Le as countAll,
75
- be as createGenerateRouteMetaRawTree,
76
- De as createListApi,
77
- ye as createStorageWithNamespace,
78
- Ne as createUseState,
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
- Oe as fetchListAll,
81
- Ve as flatRouteMetaResolveRaw,
89
+ ae as exportCSV,
90
+ We as fetchListAll,
91
+ je as flatRouteMetaResolveRaw,
82
92
  t as formInstall,
83
- ae as generateFormData,
84
- me as getBlurSubmit,
85
- fe as getChangeSubmit,
86
- $ as getConfirmPasswordRule,
87
- se as getEnterSubmit,
88
- He as getId,
89
- le as getPlaceholder,
90
- ve as getRoutePermissionKey,
91
- ue as getVModelSugar,
92
- I as installComponents,
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
- ie as parseFormData,
98
- ee as passwordRule,
99
- te as setFormComponentType,
100
- pe as setInputComponent,
101
- ne as setSelectComponent,
102
- xe as stringifyFormData,
103
- de as swiftFormItemConfig,
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
- We as timeCountDown,
106
- Be as useActivated,
107
- Ye as useActivatedEvent,
108
- Qe as useActivatedExec,
109
- ke as useFeelSize,
110
- Je as useMenusDataDispatch,
111
- Ze as useTimeout
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-60e049ad]{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px;gap:20px}.table-toolbar-left[data-v-60e049ad],.table-toolbar-right[data-v-60e049ad]{display:flex;align-items:center;gap:10px}.table-toolbar-icon--rotating[data-v-60e049ad]{animation:table-toolbar-rotating-60e049ad 1s linear infinite}@keyframes table-toolbar-rotating-60e049ad{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.table-main-table[data-v-643017c3]{--el-table-header-bg-color: var(--v4c03ff8f)}.table-main-pagination[data-v-643017c3]{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}
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.2",
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": "ab2bb3cbded6a375d254e49281d93383534afabe"
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: () => never[];
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: () => never[];
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 FormDateTimeRange } from './FormDateTimeRange.vue';
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, FormDateTimeRange, };
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
- leftFeatures: {
10
- type: globalThis.PropType<"export"[]>;
13
+ showRefresh: {
14
+ type: globalThis.PropType<boolean>;
15
+ default: boolean;
11
16
  };
12
- rightFeatures: {
13
- type: globalThis.PropType<import('./types').TableToolbarRightFeature[]>;
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
- leftFeatures: {
33
- type: globalThis.PropType<"export"[]>;
63
+ showRefresh: {
64
+ type: globalThis.PropType<boolean>;
65
+ default: boolean;
34
66
  };
35
- rightFeatures: {
36
- type: globalThis.PropType<import('./types').TableToolbarRightFeature[]>;
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 type TableToolbarLeftFeature = "export";
31
- /** toolbar 右侧功能 */
32
- export type TableToolbarRightFeature = "refresh" | "autoRefresh";
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
- * - undefined(默认):显示所有左侧功能
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
- /** 导出方法。传入导出类型,返回 Promise */
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>> {