@done-coding/admin-core 0.5.0 → 0.5.1-alpha.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/es/bridge/index.mjs +30 -42
- package/es/components/app-layout/AppHeader.vue.mjs +2 -2
- package/es/components/app-layout/AppHeader.vue2.mjs +16 -19
- package/es/components/data-view/DataListView.vue.mjs +2 -2
- package/es/components/data-view/DataListView.vue2.mjs +63 -52
- package/es/components/data-view/utils.mjs +36 -0
- package/es/components/display/TabsMain.vue.mjs +1 -1
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +44 -44
- package/es/components/misc/ActionConfirm.vue2.mjs +16 -16
- package/es/components/modal/ConfirmModal.vue.mjs +3 -3
- package/es/components/modal/DetailModal.vue.mjs +10 -10
- package/es/components/table/TableMain.vue.mjs +3 -3
- package/es/components/table/TableMain.vue2.mjs +167 -177
- package/es/components/table/TableToolbar.vue.mjs +3 -3
- package/es/components/table/TableToolbar.vue2.mjs +8 -4
- package/es/index.mjs +150 -180
- package/es/style.css +1 -1
- package/package.json +6 -5
- package/types/bridge/index.d.ts +3 -6
- package/types/bridge/route.d.ts +0 -1
- package/types/components/app-layout/AppBody.vue.d.ts +14 -34
- package/types/components/app-layout/AppBreadcrumb.vue.d.ts +6 -19
- package/types/components/app-layout/AppFooter.vue.d.ts +1 -1
- package/types/components/app-layout/AppHeader.vue.d.ts +15 -39
- package/types/components/app-layout/AppLayout.vue.d.ts +17 -50
- package/types/components/app-layout/AppPage.vue.d.ts +14 -39
- package/types/components/app-layout/AppSidebar.vue.d.ts +15 -37
- package/types/components/app-layout/index.d.ts +1 -19
- package/types/components/app-layout/types.d.ts +0 -1
- package/types/components/data-view/DataListView.vue.d.ts +9 -9
- package/types/components/data-view/DataListViewItem.vue.d.ts +19 -17
- package/types/components/data-view/index.d.ts +0 -1
- package/types/components/data-view/types.d.ts +9 -18
- package/types/components/data-view/utils.d.ts +5 -0
- package/types/components/display/ActionBtnGroup.vue.d.ts +8 -6
- package/types/components/display/HeightProvider.vue.d.ts +15 -31
- package/types/components/display/TabsHeader.vue.d.ts +27 -34
- package/types/components/display/TabsMain.vue.d.ts +14 -75
- package/types/components/display/TabsNaturalFlow.vue.d.ts +11 -5
- package/types/components/display/TabsRefineFlow.vue.d.ts +13 -31
- package/types/components/display/WatchSize.vue.d.ts +20 -32
- package/types/components/display/index.d.ts +0 -3
- package/types/components/display/types.d.ts +1 -2
- package/types/components/form/FormItem.vue.d.ts +208 -33
- package/types/components/form/FormMain.vue.d.ts +6 -7
- package/types/components/form/FormRadioGroup.vue.d.ts +14 -31
- package/types/components/form/FormSearch.vue.d.ts +5 -6
- package/types/components/form/FormSelect.vue.d.ts +19 -40
- package/types/components/form/FormTree.vue.d.ts +2037 -32
- package/types/components/form/FormVerifyCode.vue.d.ts +6 -6
- package/types/components/form/FormVerifyImage.vue.d.ts +6 -6
- package/types/components/form/form-search-utils.d.ts +0 -1
- package/types/components/form/index.d.ts +0 -3
- package/types/components/form/types.d.ts +0 -1
- package/types/components/form/utils.d.ts +0 -1
- package/types/components/list-page/ListPage.vue.d.ts +32 -33
- package/types/components/list-page/index.d.ts +0 -3
- package/types/components/list-page/types.d.ts +0 -1
- package/types/components/menu/MenuItemSub.vue.d.ts +3 -15
- package/types/components/menu/MenuTree.vue.d.ts +117 -19
- package/types/components/menu/index.d.ts +0 -3
- package/types/components/misc/ActionBtn.vue.d.ts +10 -11
- package/types/components/misc/ActionConfirm.vue.d.ts +21 -60
- package/types/components/misc/AutoRefresh.vue.d.ts +18 -24
- package/types/components/misc/TriggerAutoImport.vue.d.ts +8 -2
- package/types/components/misc/index.d.ts +4 -14
- package/types/components/misc/types.d.ts +0 -1
- package/types/components/modal/DetailModal.vue.d.ts +5 -6
- package/types/components/modal/ModalPorter.vue.d.ts +13 -18
- package/types/components/modal/ModalShelf.vue.d.ts +13 -18
- package/types/components/modal/index.d.ts +0 -4
- package/types/components/modal/modal-shelf-core.d.ts +0 -1
- package/types/components/modal/modal-shelf-hierarchy.d.ts +0 -1
- package/types/components/modal/modal-shelf-types.d.ts +0 -1
- package/types/components/modal/types.d.ts +0 -1
- package/types/components/panel/PanelEditSwitch.vue.d.ts +17 -20
- package/types/components/panel/PanelItem.vue.d.ts +7 -16
- package/types/components/panel/PanelMain.vue.d.ts +5 -6
- package/types/components/panel/index.d.ts +0 -4
- package/types/components/panel/types.d.ts +0 -1
- package/types/components/table/TableMain.vue.d.ts +12 -12
- package/types/components/table/TableToolbar.vue.d.ts +17 -108
- package/types/components/table/ToolbarButtons.vue.d.ts +15 -17
- package/types/components/table/index.d.ts +0 -3
- package/types/components/table/types.d.ts +59 -19
- package/types/config/list-model.d.ts +0 -1
- package/types/helpers/form.d.ts +0 -1
- package/types/helpers/index.d.ts +0 -10
- package/types/helpers/list-helper.d.ts +0 -1
- package/types/hooks/menus-dispatch.d.ts +0 -1
- package/types/hooks/use-channel-viewport-height.d.ts +0 -1
- package/types/index.d.ts +0 -13
- package/types/inject/key.d.ts +0 -1
- package/types/router/guard/index.d.ts +0 -1
- package/types/router/guard/login.d.ts +0 -1
- package/types/router/guard/permission.d.ts +0 -1
- package/types/router/guard/types.d.ts +0 -1
- package/types/store/app.d.ts +1 -2
- package/types/store/router-permission.d.ts +0 -1
- package/types/store/user.d.ts +0 -1
- package/types/types/route.d.ts +0 -1
- package/types/utils/export.d.ts +11 -10
- package/types/utils/router.d.ts +0 -1
- package/es/components/app-layout/index.mjs +0 -32
- package/es/components/display/index.mjs +0 -18
- package/es/components/form/index.mjs +0 -32
- package/es/components/list-page/index.mjs +0 -14
- package/es/components/menu/index.mjs +0 -12
- package/es/components/misc/ActionButton.vue.mjs +0 -52
- package/es/components/misc/ActionButton.vue2.mjs +0 -4
- package/es/components/misc/ActionButtonDanger.vue.mjs +0 -32
- package/es/components/misc/ActionButtonDanger.vue2.mjs +0 -4
- package/es/components/misc/ActionButtonWarn.vue.mjs +0 -32
- package/es/components/misc/ActionButtonWarn.vue2.mjs +0 -4
- package/es/components/misc/index.mjs +0 -32
- package/es/components/modal/index.mjs +0 -23
- package/es/components/panel/index.mjs +0 -20
- package/es/components/table/index.mjs +0 -14
- package/types/components/misc/ActionButton.vue.d.ts +0 -24
- package/types/components/misc/ActionButtonDanger.vue.d.ts +0 -19
- package/types/components/misc/ActionButtonWarn.vue.d.ts +0 -19
- package/types/components/modal/ConfirmModal.vue.d.ts +0 -124
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ElTableColumn as ETC, TableInstance, TableProps } from 'element-plus';
|
|
1
|
+
import { ElTableColumn as ETC, TableInstance as ElTableInstance, TableProps } from 'element-plus';
|
|
2
2
|
import { APP_API_LIST_MODEL_KEY_CONFIG, BuildListParams } from '../../config';
|
|
3
3
|
import { DotToObject, UnionToIntersection } from '../../types';
|
|
4
4
|
import { ExportColumnConfig } from '../../utils';
|
|
5
5
|
import { ExtractPropTypes, VNode } from 'vue';
|
|
6
6
|
import { ActionBtnConfigItem } from '../display';
|
|
7
|
-
|
|
7
|
+
/** 表格实例 */
|
|
8
|
+
export type TableInstance = Pick<ElTableInstance, "clearSelection" | "getSelectionRows" | "toggleRowSelection" | "toggleAllSelection" | "toggleRowExpansion" | "setCurrentRow" | "clearSort" | "clearFilter" | "doLayout" | "sort" | "scrollTo" | "setScrollTop" | "setScrollLeft" | "columns" | "updateKeyChildren">;
|
|
8
9
|
/**
|
|
9
10
|
* 表格请求参数
|
|
10
11
|
* ---
|
|
@@ -29,30 +30,38 @@ export interface TableMainInstance {
|
|
|
29
30
|
/** 导出类型 */
|
|
30
31
|
export type ExportType = "selected" | "current" | "all";
|
|
31
32
|
/** TableMain 传给 toolbar 的导出上下文 */
|
|
32
|
-
export interface TableExportContext
|
|
33
|
+
export interface TableExportContext<T extends Record<string, any> = Record<string, any>,
|
|
34
|
+
/** 静态参数 */
|
|
35
|
+
SQ extends Record<string, any> = Record<string, any>,
|
|
36
|
+
/** 期望注入到表格列插槽上的额外内容 */
|
|
37
|
+
F extends Record<string, any> = {}> {
|
|
33
38
|
/** 可导出列 */
|
|
34
|
-
columns: Pick<ElTableColumnProps, "prop" | "label">[];
|
|
39
|
+
columns: Pick<ElTableColumnProps<T, F>, "prop" | "label">[];
|
|
35
40
|
/** 选中行数据 */
|
|
36
|
-
selectedList:
|
|
41
|
+
selectedList: T[];
|
|
37
42
|
/** 当前页数据 */
|
|
38
|
-
currentPageList:
|
|
43
|
+
currentPageList: T[];
|
|
39
44
|
/** 分页 API */
|
|
40
|
-
api:
|
|
45
|
+
api: (params: TableApiParams<SQ>) => Promise<TableApiResult<T>>;
|
|
41
46
|
/** 静态查询参数 */
|
|
42
|
-
query
|
|
47
|
+
query?: SQ;
|
|
43
48
|
/** 当前数据总数 */
|
|
44
49
|
total: number;
|
|
45
50
|
/** 是否包含 selection 列 */
|
|
46
51
|
hasSelection: boolean;
|
|
47
52
|
}
|
|
48
53
|
/** toolbar 按钮渲染上下文 */
|
|
49
|
-
export interface ToolbarButtonContext<T extends Record<string, any> = Record<string, any
|
|
54
|
+
export interface ToolbarButtonContext<T extends Record<string, any> = Record<string, any>,
|
|
55
|
+
/** 静态参数 */
|
|
56
|
+
SQ extends Record<string, any> = Record<string, any>,
|
|
57
|
+
/** 期望注入到表格列插槽上的额外内容 */
|
|
58
|
+
F extends Record<string, any> = {}> {
|
|
50
59
|
/** TableMain expose */
|
|
51
60
|
tableExpose: TableMainInstance;
|
|
52
61
|
/** 表格是否加载中 */
|
|
53
62
|
loading: boolean;
|
|
54
63
|
/** 导出上下文 */
|
|
55
|
-
exportContext: TableExportContext
|
|
64
|
+
exportContext: TableExportContext<T, SQ, F>;
|
|
56
65
|
/** 当前选中行数据 */
|
|
57
66
|
selectedList: T[];
|
|
58
67
|
/** 分页信息 */
|
|
@@ -70,9 +79,34 @@ export interface ToolbarButtonContext<T extends Record<string, any> = Record<str
|
|
|
70
79
|
* 旧的 VNode[] 返回函数字段已移除,render 三态(string | Component | functional)
|
|
71
80
|
* 对标 FormItem;升级路径见 MIGRATION.md BL-4 节。
|
|
72
81
|
*/
|
|
73
|
-
export type ToolbarButtonConfig<T extends Record<string, any> = Record<string, any
|
|
74
|
-
/**
|
|
75
|
-
|
|
82
|
+
export type ToolbarButtonConfig<T extends Record<string, any> = Record<string, any>,
|
|
83
|
+
/** 静态参数 */
|
|
84
|
+
SQ extends Record<string, any> = Record<string, any>,
|
|
85
|
+
/** 期望注入到表格列插槽上的额外内容 */
|
|
86
|
+
F extends Record<string, any> = {}> = ActionBtnConfigItem<ToolbarButtonContext<T, SQ, F>>;
|
|
87
|
+
/** toolbar (被TableMain) 内部提供的props */
|
|
88
|
+
export interface TableToolbarPrivateProps<T extends Record<string, any> = Record<string, any>,
|
|
89
|
+
/** 静态参数 */
|
|
90
|
+
SQ extends Record<string, any> = Record<string, any>,
|
|
91
|
+
/** 期望注入到表格列插槽上的额外内容 */
|
|
92
|
+
F extends Record<string, any> = {}> {
|
|
93
|
+
/** TableMain expose */
|
|
94
|
+
tableExpose: TableMainInstance;
|
|
95
|
+
/** 表格是否加载中 */
|
|
96
|
+
loading: boolean;
|
|
97
|
+
/** 导出上下文 */
|
|
98
|
+
exportContext: TableExportContext<T, SQ, F>;
|
|
99
|
+
/** 当前页码 */
|
|
100
|
+
currentPage: number;
|
|
101
|
+
/** 每页行数 */
|
|
102
|
+
pageSize: number;
|
|
103
|
+
}
|
|
104
|
+
/** toolbar props */
|
|
105
|
+
export interface TableToolbarProps<T extends Record<string, any> = Record<string, any>,
|
|
106
|
+
/** 静态参数 */
|
|
107
|
+
SQ extends Record<string, any> = Record<string, any>,
|
|
108
|
+
/** 期望注入到表格列插槽上的额外内容 */
|
|
109
|
+
F extends Record<string, any> = {}> extends TableToolbarPrivateProps<T, SQ, F> {
|
|
76
110
|
/** 是否显示刷新按钮,默认 true */
|
|
77
111
|
showRefresh?: boolean;
|
|
78
112
|
/** 是否显示自动刷新开关,默认 true */
|
|
@@ -88,12 +122,18 @@ export interface TableToolbarConfig {
|
|
|
88
122
|
/** 导出方法。传入导出类型,返回 Promise。exportByFe 为 false 时必传 */
|
|
89
123
|
exportFn?: (type: ExportType) => Promise<unknown>;
|
|
90
124
|
/** 导出列配置。不传则不显示导出按钮。支持 valueMap 自定义取值 */
|
|
91
|
-
exportColumns?: ExportColumnConfig[];
|
|
125
|
+
exportColumns?: ExportColumnConfig<T>[];
|
|
92
126
|
/** 左侧额外按钮 */
|
|
93
|
-
leftExtraButtons?: ToolbarButtonConfig[];
|
|
127
|
+
leftExtraButtons?: ToolbarButtonConfig<T, SQ, F>[];
|
|
94
128
|
/** 右侧额外按钮 */
|
|
95
|
-
rightExtraButtons?: ToolbarButtonConfig[];
|
|
129
|
+
rightExtraButtons?: ToolbarButtonConfig<T, SQ, F>[];
|
|
96
130
|
}
|
|
131
|
+
/** toolbar 可配置项(通过 TableMain 的 toolbar prop 传入) */
|
|
132
|
+
export type TableToolbarConfig<T extends Record<string, any> = Record<string, any>,
|
|
133
|
+
/** 静态参数 */
|
|
134
|
+
SQ extends Record<string, any> = Record<string, any>,
|
|
135
|
+
/** 期望注入到表格列插槽上的额外内容 */
|
|
136
|
+
F extends Record<string, any> = {}> = Omit<TableToolbarProps<T, SQ, F>, keyof TableToolbarPrivateProps<T, SQ, F>>;
|
|
97
137
|
/** 表格列默认作用域 */
|
|
98
138
|
export interface TableColumnDefaultScope<T extends Record<string, any>, F extends Record<string, any>> {
|
|
99
139
|
row: T;
|
|
@@ -117,8 +157,8 @@ export type ExtractElTableColumnProps = ExtractPropTypes<typeof ETC>;
|
|
|
117
157
|
export type ElTableColumnProps<T extends Record<string, any> = Record<string, any>,
|
|
118
158
|
/** 期望注入到表格列插槽上的额外内容 */
|
|
119
159
|
F extends Record<string, any> = {}> = Omit<ExtractPropTypes<typeof ETC>, "prop" | "columnKey" | "type"> & Partial<{
|
|
120
|
-
prop: Extract<keyof T, string> | `${Uppercase<string>}`;
|
|
121
|
-
columnKey: ElTableColumnProps<T>["prop"];
|
|
160
|
+
prop: Exclude<Extract<keyof T, string>, "custom-view-item" | "item"> | `${Uppercase<string>}`;
|
|
161
|
+
columnKey: ElTableColumnProps<T, F>["prop"];
|
|
122
162
|
type: "default" | "selection" | "index" | "expand";
|
|
123
163
|
fixed: "left" | "right" | boolean;
|
|
124
164
|
align: "left" | "center" | "right";
|
|
@@ -147,7 +187,7 @@ F extends Record<string, any>> {
|
|
|
147
187
|
/** 是否显示 toolbar(顶层开关,默认 true,优先级高于 toolbar.leftFeatures / rightFeatures) */
|
|
148
188
|
showToolbar?: boolean;
|
|
149
189
|
/** toolbar 配置 */
|
|
150
|
-
toolbar?: TableToolbarConfig
|
|
190
|
+
toolbar?: TableToolbarConfig<T, SQ, F>;
|
|
151
191
|
/** 参数 */
|
|
152
192
|
query?: SQ;
|
|
153
193
|
/** 每页条数 */
|
package/types/helpers/form.d.ts
CHANGED
package/types/helpers/index.d.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
1
|
export * from './form';
|
|
2
2
|
export * from './types';
|
|
3
3
|
export * from './list-helper';
|
|
4
|
-
/** @deprecated 改用 appAdminBridge.useState() */
|
|
5
|
-
export { createUseState } from '../bridge/state';
|
|
6
|
-
/** @deprecated 改用 appAdminBridge.useState() */
|
|
7
|
-
export type { UseStateOptions } from '../bridge/state';
|
|
8
|
-
/** @deprecated 改用 appAdminBridge.generateRouteMetaRawTree() */
|
|
9
|
-
export { createGenerateRouteMetaRawTree } from '../bridge/route';
|
|
10
|
-
/** @deprecated 改用 appAdminBridge.generateRouteMetaRawTree() */
|
|
11
|
-
export type { RouteMetaDefaultConfig } from '../bridge/route';
|
|
12
|
-
/** @deprecated 改用 appAdminBridge.getStorage() */
|
|
13
|
-
export { createStorageWithNamespace } from '../bridge/storage';
|
package/types/index.d.ts
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import { Plugin } from 'vue';
|
|
2
|
-
import { formInstall } from './components/form';
|
|
3
|
-
import { menuInstall } from './components/menu';
|
|
4
|
-
import { displayInstall } from './components/display';
|
|
5
|
-
import { miscInstall } from './components/misc';
|
|
6
|
-
import { modalInstall } from './components/modal';
|
|
7
|
-
import { tableInstall } from './components/table';
|
|
8
|
-
import { listPageInstall } from './components/list-page';
|
|
9
|
-
import { panelInstall } from './components/panel';
|
|
10
|
-
import { appLayoutInstall } from './components/app-layout';
|
|
11
|
-
|
|
12
1
|
export * from './components/form';
|
|
13
2
|
export * from './components/menu';
|
|
14
3
|
export * from './components/display';
|
|
@@ -27,5 +16,3 @@ export * from './inject';
|
|
|
27
16
|
export * from './helpers';
|
|
28
17
|
export * from './bridge';
|
|
29
18
|
export * from './store';
|
|
30
|
-
export { formInstall, menuInstall, displayInstall, miscInstall, modalInstall, tableInstall, listPageInstall, panelInstall, appLayoutInstall, };
|
|
31
|
-
export declare const installComponents: Plugin;
|
package/types/inject/key.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RouteLocationNormalized } from 'vue-router';
|
|
2
2
|
import { GuardRoutePermissionStore } from './types';
|
|
3
|
-
|
|
4
3
|
/** 登录检测壳子——复用 store.checkNeedGoToLoginPage */
|
|
5
4
|
export declare const checkLogin: (to: RouteLocationNormalized, store: GuardRoutePermissionStore) => Promise<boolean>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RouteLocationNormalized } from 'vue-router';
|
|
2
2
|
import { GuardRoutePermissionStore } from './types';
|
|
3
|
-
|
|
4
3
|
/** 权限检测壳子——复用 store.checkNeedGoToAuthPage */
|
|
5
4
|
export declare const checkPermission: (to: RouteLocationNormalized, store: GuardRoutePermissionStore) => Promise<boolean>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RouteLocationNormalized } from 'vue-router';
|
|
2
2
|
import { AdminBridge } from '../../bridge';
|
|
3
|
-
|
|
4
3
|
/** guard 仅依赖 bridge 的路径配置切片(Pick 表达 → 必 type alias,无法 interface) */
|
|
5
4
|
export type GuardBridgeSlice = Pick<AdminBridge, "APP_ROUTER_PATHS_CONFIG">;
|
|
6
5
|
/** guard 仅依赖 route-permission store 的 2 个 check 方法 */
|
package/types/store/app.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AdminBridge } from '../bridge';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* createAppStore 工厂依赖(#A 期,与 createUserStore deps 收敛单字段 `{ bridge }` 范式对齐)。
|
|
5
4
|
*
|
|
@@ -107,7 +106,7 @@ export declare function createAppStore<UserInfo = unknown, LoginParams = unknown
|
|
|
107
106
|
changeSidebarCollapseStatus: (status: boolean) => void;
|
|
108
107
|
changeSidebarHasMenusStatus: (status: boolean) => void;
|
|
109
108
|
changeIsDarkTheme: (status: boolean) => void;
|
|
110
|
-
}, "
|
|
109
|
+
}, "keepAlive" | "bodyShimPadding" | "isDarkTheme" | "theme" | "showHeader" | "showFooter" | "showSidebar" | "showBreadcrumb" | "headerStyle" | "footerStyle" | "sidebarStyle" | "bodyStyle" | "bodyShimStyle" | "sidebarIsCollapse">, Pick<{
|
|
111
110
|
name: globalThis.Ref<string, string>;
|
|
112
111
|
isDarkTheme: globalThis.ComputedRef<boolean>;
|
|
113
112
|
theme: globalThis.ComputedRef<import('../bridge').AppThemeColor>;
|
package/types/store/user.d.ts
CHANGED
package/types/types/route.d.ts
CHANGED
package/types/utils/export.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { ElTableColumnProps } from '../components/table/types';
|
|
2
|
-
|
|
3
2
|
/** 操作列标记 prop。消费方以此值标记操作列,导出时自动过滤 */
|
|
4
3
|
export declare const OPERATE_COLUMN_PROP = "OPERATE";
|
|
5
4
|
/** 前端导出最大行数 */
|
|
6
5
|
export declare const EXPORT_MAX_LIMIT = 10000;
|
|
7
6
|
/** 导出列:从 ElTableColumnProps 中提取 prop、label、type */
|
|
8
|
-
export type ExportColumn
|
|
7
|
+
export type ExportColumn<T extends Record<string, any>,
|
|
8
|
+
/** 期望注入到表格列插槽上的额外内容 */
|
|
9
|
+
F extends Record<string, any> = {}> = Pick<ElTableColumnProps<T, F>, "prop" | "label" | "type">;
|
|
9
10
|
/** 导出列配置:支持 valueMap 自定义取值 */
|
|
10
|
-
export interface ExportColumnConfig {
|
|
11
|
-
prop:
|
|
11
|
+
export interface ExportColumnConfig<T extends Record<string, any>> {
|
|
12
|
+
prop: keyof T;
|
|
12
13
|
label: string;
|
|
13
14
|
/** 自定义取值,不传则取 row[prop] */
|
|
14
|
-
valueMap?: (row: Record<
|
|
15
|
+
valueMap?: (row: Record<keyof T, any>) => unknown;
|
|
15
16
|
}
|
|
16
17
|
/** 导出参数 */
|
|
17
|
-
export interface ExportOptions {
|
|
18
|
-
columns: ExportColumnConfig[];
|
|
19
|
-
list:
|
|
18
|
+
export interface ExportOptions<T extends Record<string, any>> {
|
|
19
|
+
columns: ExportColumnConfig<T>[];
|
|
20
|
+
list: T[];
|
|
20
21
|
filename?: string;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
@@ -25,6 +26,6 @@ export interface ExportOptions {
|
|
|
25
26
|
* 过滤规则:排除 type 为 selection / index / expand 的列(除 default 外均排除),
|
|
26
27
|
* 排除 prop 为 OPERATE_COLUMN_PROP 的列,排除无 prop 的列
|
|
27
28
|
*/
|
|
28
|
-
export declare const pickExportColumns: <T extends Record<string, any>>(columns: ElTableColumnProps<T>[]) => ExportColumn[];
|
|
29
|
+
export declare const pickExportColumns: <T extends Record<string, any>, F extends Record<string, any>>(columns: ElTableColumnProps<T, F>[]) => ExportColumn<T, F>[];
|
|
29
30
|
/** 导出 CSV 文件 */
|
|
30
|
-
export declare const exportCSV: ({ columns, list, filename, }: ExportOptions) => void;
|
|
31
|
+
export declare const exportCSV: <T extends Record<string, any>>({ columns, list, filename, }: ExportOptions<T>) => void;
|
package/types/utils/router.d.ts
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import t from "./AppLayout.vue.mjs";
|
|
2
|
-
import m from "./AppHeader.vue.mjs";
|
|
3
|
-
import e from "./AppSidebar.vue.mjs";
|
|
4
|
-
import a from "./AppBody.vue.mjs";
|
|
5
|
-
import i from "./AppBreadcrumb.vue.mjs";
|
|
6
|
-
import n from "./AppFooter.vue.mjs";
|
|
7
|
-
import f from "./AppPage.vue.mjs";
|
|
8
|
-
const c = {
|
|
9
|
-
AppLayout: t,
|
|
10
|
-
AppHeader: m,
|
|
11
|
-
AppSidebar: e,
|
|
12
|
-
AppBody: a,
|
|
13
|
-
AppBreadcrumb: i,
|
|
14
|
-
AppFooter: n,
|
|
15
|
-
AppPage: f
|
|
16
|
-
}, B = {
|
|
17
|
-
install(o) {
|
|
18
|
-
Object.entries(c).forEach(([p, r]) => {
|
|
19
|
-
o.component(p, r);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
a as AppBody,
|
|
25
|
-
i as AppBreadcrumb,
|
|
26
|
-
n as AppFooter,
|
|
27
|
-
m as AppHeader,
|
|
28
|
-
t as AppLayout,
|
|
29
|
-
f as AppPage,
|
|
30
|
-
e as AppSidebar,
|
|
31
|
-
B as appLayoutInstall
|
|
32
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import n from "./WatchSize.vue.mjs";
|
|
2
|
-
import a from "./TabsMain.vue.mjs";
|
|
3
|
-
import r from "./HeightProvider.vue.mjs";
|
|
4
|
-
import s from "./ActionBtnGroup.vue.mjs";
|
|
5
|
-
const c = { WatchSize: n, TabsMain: a, HeightProvider: r, ActionBtnGroup: s }, _ = {
|
|
6
|
-
install(o) {
|
|
7
|
-
Object.entries(c).forEach(([i, t]) => {
|
|
8
|
-
o.component(i, t);
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
s as ActionBtnGroup,
|
|
14
|
-
r as HeightProvider,
|
|
15
|
-
a as TabsMain,
|
|
16
|
-
n as WatchSize,
|
|
17
|
-
_ as displayInstall
|
|
18
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import e from "./FormMain.vue.mjs";
|
|
2
|
-
import i from "./FormSelect.vue.mjs";
|
|
3
|
-
import a from "./FormRadioGroup.vue.mjs";
|
|
4
|
-
import t from "./FormTree.vue.mjs";
|
|
5
|
-
import f from "./FormSearch.vue.mjs";
|
|
6
|
-
import n from "./FormVerifyImage.vue.mjs";
|
|
7
|
-
import s from "./FormVerifyCode.vue.mjs";
|
|
8
|
-
const c = {
|
|
9
|
-
FormMain: e,
|
|
10
|
-
FormSelect: i,
|
|
11
|
-
FormRadioGroup: a,
|
|
12
|
-
FormTree: t,
|
|
13
|
-
FormSearch: f,
|
|
14
|
-
FormVerifyImage: n,
|
|
15
|
-
FormVerifyCode: s
|
|
16
|
-
}, S = {
|
|
17
|
-
install(o) {
|
|
18
|
-
Object.entries(c).forEach(([r, m]) => {
|
|
19
|
-
o.component(r, m);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
e as FormMain,
|
|
25
|
-
a as FormRadioGroup,
|
|
26
|
-
f as FormSearch,
|
|
27
|
-
i as FormSelect,
|
|
28
|
-
t as FormTree,
|
|
29
|
-
s as FormVerifyCode,
|
|
30
|
-
n as FormVerifyImage,
|
|
31
|
-
S as formInstall
|
|
32
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ElPopconfirm as d, ElButton as v } from "element-plus/es";
|
|
2
|
-
import "element-plus/es/components/base/style/css";
|
|
3
|
-
import "element-plus/es/components/popconfirm/style/css";
|
|
4
|
-
import "element-plus/es/components/button/style/css";
|
|
5
|
-
import { defineComponent as b, useModel as y, computed as C, openBlock as B, createBlock as E, withCtx as i, createVNode as k, renderSlot as x, mergeModels as l } from "vue";
|
|
6
|
-
const z = /* @__PURE__ */ b({
|
|
7
|
-
__name: "ActionButton",
|
|
8
|
-
props: /* @__PURE__ */ l({
|
|
9
|
-
data: {},
|
|
10
|
-
type: { default: "danger" },
|
|
11
|
-
tipContent: {}
|
|
12
|
-
}, {
|
|
13
|
-
visible: { type: Boolean, default: !1 },
|
|
14
|
-
visibleModifiers: {}
|
|
15
|
-
}),
|
|
16
|
-
emits: /* @__PURE__ */ l(["confirm"], ["update:visible"]),
|
|
17
|
-
setup(e, { emit: r }) {
|
|
18
|
-
const t = e, p = r, o = y(e, "visible"), s = C(
|
|
19
|
-
() => typeof t.tipContent == "function" ? t.tipContent(t.data) : t.tipContent
|
|
20
|
-
), m = () => {
|
|
21
|
-
p("confirm", t.data);
|
|
22
|
-
};
|
|
23
|
-
return (a, n) => {
|
|
24
|
-
const c = v, f = d;
|
|
25
|
-
return B(), E(f, {
|
|
26
|
-
visible: o.value,
|
|
27
|
-
"onUpdate:visible": n[0] || (n[0] = (u) => o.value = u),
|
|
28
|
-
title: s.value,
|
|
29
|
-
"confirm-button-text": "确定",
|
|
30
|
-
"confirm-button-type": e.type,
|
|
31
|
-
onConfirm: m
|
|
32
|
-
}, {
|
|
33
|
-
reference: i(() => [
|
|
34
|
-
k(c, {
|
|
35
|
-
type: e.type,
|
|
36
|
-
link: "",
|
|
37
|
-
size: "small"
|
|
38
|
-
}, {
|
|
39
|
-
default: i(() => [
|
|
40
|
-
x(a.$slots, "default")
|
|
41
|
-
]),
|
|
42
|
-
_: 3
|
|
43
|
-
}, 8, ["type"])
|
|
44
|
-
]),
|
|
45
|
-
_: 3
|
|
46
|
-
}, 8, ["visible", "title", "confirm-button-type"]);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
export {
|
|
51
|
-
z as default
|
|
52
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { defineComponent as c, useModel as f, computed as a, openBlock as v, createBlock as b, withCtx as C, renderSlot as y, mergeModels as s } from "vue";
|
|
2
|
-
import g from "./ActionButton.vue.mjs";
|
|
3
|
-
const A = /* @__PURE__ */ c({
|
|
4
|
-
__name: "ActionButtonDanger",
|
|
5
|
-
props: /* @__PURE__ */ s({
|
|
6
|
-
data: {},
|
|
7
|
-
tipContent: { type: [String, Function] }
|
|
8
|
-
}, {
|
|
9
|
-
visible: { type: Boolean, default: !1 },
|
|
10
|
-
visibleModifiers: {}
|
|
11
|
-
}),
|
|
12
|
-
emits: /* @__PURE__ */ s(["confirm"], ["update:visible"]),
|
|
13
|
-
setup(e, { emit: l }) {
|
|
14
|
-
const n = e, r = l, o = f(e, "visible"), p = a(() => n.data), d = a(() => n.tipContent), m = (t) => r("confirm", t);
|
|
15
|
-
return (t, i) => (v(), b(g, {
|
|
16
|
-
visible: o.value,
|
|
17
|
-
"onUpdate:visible": i[0] || (i[0] = (u) => o.value = u),
|
|
18
|
-
type: "danger",
|
|
19
|
-
data: p.value,
|
|
20
|
-
tipContent: d.value,
|
|
21
|
-
onConfirm: m
|
|
22
|
-
}, {
|
|
23
|
-
default: C(() => [
|
|
24
|
-
y(t.$slots, "default")
|
|
25
|
-
]),
|
|
26
|
-
_: 3
|
|
27
|
-
}, 8, ["visible", "data", "tipContent"]));
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
export {
|
|
31
|
-
A as default
|
|
32
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { defineComponent as c, useModel as f, computed as a, openBlock as v, createBlock as b, withCtx as C, renderSlot as y, mergeModels as s } from "vue";
|
|
2
|
-
import B from "./ActionButton.vue.mjs";
|
|
3
|
-
const A = /* @__PURE__ */ c({
|
|
4
|
-
__name: "ActionButtonWarn",
|
|
5
|
-
props: /* @__PURE__ */ s({
|
|
6
|
-
data: {},
|
|
7
|
-
tipContent: { type: [String, Function] }
|
|
8
|
-
}, {
|
|
9
|
-
visible: { type: Boolean, default: !1 },
|
|
10
|
-
visibleModifiers: {}
|
|
11
|
-
}),
|
|
12
|
-
emits: /* @__PURE__ */ s(["confirm"], ["update:visible"]),
|
|
13
|
-
setup(e, { emit: l }) {
|
|
14
|
-
const n = e, r = l, i = f(e, "visible"), p = a(() => n.data), d = a(() => n.tipContent), m = (t) => r("confirm", t);
|
|
15
|
-
return (t, o) => (v(), b(B, {
|
|
16
|
-
visible: i.value,
|
|
17
|
-
"onUpdate:visible": o[0] || (o[0] = (u) => i.value = u),
|
|
18
|
-
type: "warning",
|
|
19
|
-
data: p.value,
|
|
20
|
-
tipContent: d.value,
|
|
21
|
-
onConfirm: m
|
|
22
|
-
}, {
|
|
23
|
-
default: C(() => [
|
|
24
|
-
y(t.$slots, "default")
|
|
25
|
-
]),
|
|
26
|
-
_: 3
|
|
27
|
-
}, 8, ["visible", "data", "tipContent"]));
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
export {
|
|
31
|
-
A as default
|
|
32
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import r from "./TriggerAutoImport.vue.mjs";
|
|
2
|
-
import i from "./AutoRefresh.vue.mjs";
|
|
3
|
-
import m from "./ActionButton.vue.mjs";
|
|
4
|
-
import c from "./ActionButtonDanger.vue.mjs";
|
|
5
|
-
import s from "./ActionButtonWarn.vue.mjs";
|
|
6
|
-
import a from "./ActionBtn.vue.mjs";
|
|
7
|
-
import f from "./ActionConfirm.vue.mjs";
|
|
8
|
-
const e = {
|
|
9
|
-
TriggerAutoImport: r,
|
|
10
|
-
AutoRefresh: i,
|
|
11
|
-
ActionButton: m,
|
|
12
|
-
ActionButtonDanger: c,
|
|
13
|
-
ActionButtonWarn: s,
|
|
14
|
-
ActionBtn: a,
|
|
15
|
-
ActionConfirm: f
|
|
16
|
-
}, $ = {
|
|
17
|
-
install(t) {
|
|
18
|
-
Object.entries(e).forEach(([o, n]) => {
|
|
19
|
-
t.component(o, n);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
a as ActionBtn,
|
|
25
|
-
m as ActionButton,
|
|
26
|
-
c as ActionButtonDanger,
|
|
27
|
-
s as ActionButtonWarn,
|
|
28
|
-
f as ActionConfirm,
|
|
29
|
-
i as AutoRefresh,
|
|
30
|
-
r as TriggerAutoImport,
|
|
31
|
-
$ as miscInstall
|
|
32
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import l from "./ConfirmModal.vue.mjs";
|
|
2
|
-
import r from "./DetailModal.vue.mjs";
|
|
3
|
-
import m from "./ModalShelf.vue.mjs";
|
|
4
|
-
import n from "./ModalPorter.vue.mjs";
|
|
5
|
-
const e = {
|
|
6
|
-
ConfirmModal: l,
|
|
7
|
-
DetailModal: r,
|
|
8
|
-
ModalShelf: m,
|
|
9
|
-
ModalPorter: n
|
|
10
|
-
}, d = {
|
|
11
|
-
install(o) {
|
|
12
|
-
Object.entries(e).forEach(([a, t]) => {
|
|
13
|
-
o.component(a, t);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
l as ConfirmModal,
|
|
19
|
-
r as DetailModal,
|
|
20
|
-
n as ModalPorter,
|
|
21
|
-
m as ModalShelf,
|
|
22
|
-
d as modalInstall
|
|
23
|
-
};
|