@done-coding/admin-core 0.4.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.
Files changed (123) hide show
  1. package/es/bridge/index.mjs +30 -42
  2. package/es/components/app-layout/AppHeader.vue.mjs +2 -2
  3. package/es/components/app-layout/AppHeader.vue2.mjs +16 -19
  4. package/es/components/data-view/DataListView.vue.mjs +2 -2
  5. package/es/components/data-view/DataListView.vue2.mjs +63 -52
  6. package/es/components/data-view/utils.mjs +36 -0
  7. package/es/components/display/TabsMain.vue.mjs +1 -1
  8. package/es/components/list-page/ListPage.vue.mjs +2 -2
  9. package/es/components/list-page/ListPage.vue2.mjs +44 -44
  10. package/es/components/misc/ActionConfirm.vue2.mjs +16 -16
  11. package/es/components/modal/ConfirmModal.vue.mjs +3 -3
  12. package/es/components/modal/DetailModal.vue.mjs +10 -10
  13. package/es/components/table/TableMain.vue.mjs +3 -3
  14. package/es/components/table/TableMain.vue2.mjs +167 -177
  15. package/es/components/table/TableToolbar.vue.mjs +3 -3
  16. package/es/components/table/TableToolbar.vue2.mjs +8 -4
  17. package/es/index.mjs +150 -180
  18. package/es/style.css +1 -1
  19. package/package.json +6 -5
  20. package/types/bridge/index.d.ts +3 -6
  21. package/types/bridge/route.d.ts +0 -1
  22. package/types/components/app-layout/AppBody.vue.d.ts +14 -34
  23. package/types/components/app-layout/AppBreadcrumb.vue.d.ts +6 -19
  24. package/types/components/app-layout/AppFooter.vue.d.ts +1 -1
  25. package/types/components/app-layout/AppHeader.vue.d.ts +15 -39
  26. package/types/components/app-layout/AppLayout.vue.d.ts +17 -50
  27. package/types/components/app-layout/AppPage.vue.d.ts +14 -39
  28. package/types/components/app-layout/AppSidebar.vue.d.ts +15 -37
  29. package/types/components/app-layout/index.d.ts +1 -19
  30. package/types/components/app-layout/types.d.ts +0 -1
  31. package/types/components/data-view/DataListView.vue.d.ts +9 -9
  32. package/types/components/data-view/DataListViewItem.vue.d.ts +19 -17
  33. package/types/components/data-view/index.d.ts +0 -1
  34. package/types/components/data-view/types.d.ts +9 -18
  35. package/types/components/data-view/utils.d.ts +5 -0
  36. package/types/components/display/ActionBtnGroup.vue.d.ts +8 -6
  37. package/types/components/display/HeightProvider.vue.d.ts +15 -31
  38. package/types/components/display/TabsHeader.vue.d.ts +27 -34
  39. package/types/components/display/TabsMain.vue.d.ts +14 -75
  40. package/types/components/display/TabsNaturalFlow.vue.d.ts +11 -5
  41. package/types/components/display/TabsRefineFlow.vue.d.ts +13 -31
  42. package/types/components/display/WatchSize.vue.d.ts +20 -32
  43. package/types/components/display/index.d.ts +0 -3
  44. package/types/components/display/types.d.ts +1 -2
  45. package/types/components/form/FormItem.vue.d.ts +208 -33
  46. package/types/components/form/FormMain.vue.d.ts +6 -7
  47. package/types/components/form/FormRadioGroup.vue.d.ts +14 -31
  48. package/types/components/form/FormSearch.vue.d.ts +5 -6
  49. package/types/components/form/FormSelect.vue.d.ts +19 -40
  50. package/types/components/form/FormTree.vue.d.ts +2037 -32
  51. package/types/components/form/FormVerifyCode.vue.d.ts +6 -6
  52. package/types/components/form/FormVerifyImage.vue.d.ts +6 -6
  53. package/types/components/form/form-search-utils.d.ts +0 -1
  54. package/types/components/form/index.d.ts +0 -3
  55. package/types/components/form/types.d.ts +2 -3
  56. package/types/components/form/utils.d.ts +0 -1
  57. package/types/components/list-page/ListPage.vue.d.ts +32 -33
  58. package/types/components/list-page/index.d.ts +0 -3
  59. package/types/components/list-page/types.d.ts +0 -1
  60. package/types/components/menu/MenuItemSub.vue.d.ts +3 -15
  61. package/types/components/menu/MenuTree.vue.d.ts +117 -19
  62. package/types/components/menu/index.d.ts +0 -3
  63. package/types/components/misc/ActionBtn.vue.d.ts +10 -11
  64. package/types/components/misc/ActionConfirm.vue.d.ts +21 -60
  65. package/types/components/misc/AutoRefresh.vue.d.ts +18 -24
  66. package/types/components/misc/TriggerAutoImport.vue.d.ts +8 -2
  67. package/types/components/misc/index.d.ts +4 -14
  68. package/types/components/misc/types.d.ts +0 -1
  69. package/types/components/modal/DetailModal.vue.d.ts +5 -6
  70. package/types/components/modal/ModalPorter.vue.d.ts +13 -18
  71. package/types/components/modal/ModalShelf.vue.d.ts +13 -18
  72. package/types/components/modal/index.d.ts +0 -4
  73. package/types/components/modal/modal-shelf-core.d.ts +0 -1
  74. package/types/components/modal/modal-shelf-hierarchy.d.ts +0 -1
  75. package/types/components/modal/modal-shelf-types.d.ts +0 -1
  76. package/types/components/modal/types.d.ts +0 -1
  77. package/types/components/panel/PanelEditSwitch.vue.d.ts +17 -20
  78. package/types/components/panel/PanelItem.vue.d.ts +7 -16
  79. package/types/components/panel/PanelMain.vue.d.ts +5 -6
  80. package/types/components/panel/index.d.ts +0 -4
  81. package/types/components/panel/types.d.ts +0 -1
  82. package/types/components/table/TableMain.vue.d.ts +12 -12
  83. package/types/components/table/TableToolbar.vue.d.ts +17 -108
  84. package/types/components/table/ToolbarButtons.vue.d.ts +15 -17
  85. package/types/components/table/index.d.ts +0 -3
  86. package/types/components/table/types.d.ts +59 -19
  87. package/types/config/list-model.d.ts +2 -1
  88. package/types/helpers/form.d.ts +0 -1
  89. package/types/helpers/index.d.ts +0 -10
  90. package/types/helpers/list-helper.d.ts +0 -1
  91. package/types/hooks/menus-dispatch.d.ts +0 -1
  92. package/types/hooks/use-channel-viewport-height.d.ts +0 -1
  93. package/types/index.d.ts +0 -13
  94. package/types/inject/key.d.ts +0 -1
  95. package/types/router/guard/index.d.ts +0 -1
  96. package/types/router/guard/login.d.ts +0 -1
  97. package/types/router/guard/permission.d.ts +0 -1
  98. package/types/router/guard/types.d.ts +0 -1
  99. package/types/store/app.d.ts +1 -2
  100. package/types/store/router-permission.d.ts +0 -1
  101. package/types/store/user.d.ts +0 -1
  102. package/types/types/route.d.ts +0 -1
  103. package/types/utils/export.d.ts +11 -10
  104. package/types/utils/router.d.ts +0 -1
  105. package/es/components/app-layout/index.mjs +0 -32
  106. package/es/components/display/index.mjs +0 -18
  107. package/es/components/form/index.mjs +0 -32
  108. package/es/components/list-page/index.mjs +0 -14
  109. package/es/components/menu/index.mjs +0 -12
  110. package/es/components/misc/ActionButton.vue.mjs +0 -52
  111. package/es/components/misc/ActionButton.vue2.mjs +0 -4
  112. package/es/components/misc/ActionButtonDanger.vue.mjs +0 -32
  113. package/es/components/misc/ActionButtonDanger.vue2.mjs +0 -4
  114. package/es/components/misc/ActionButtonWarn.vue.mjs +0 -32
  115. package/es/components/misc/ActionButtonWarn.vue2.mjs +0 -4
  116. package/es/components/misc/index.mjs +0 -32
  117. package/es/components/modal/index.mjs +0 -23
  118. package/es/components/panel/index.mjs +0 -20
  119. package/es/components/table/index.mjs +0 -14
  120. package/types/components/misc/ActionButton.vue.d.ts +0 -24
  121. package/types/components/misc/ActionButtonDanger.vue.d.ts +0 -19
  122. package/types/components/misc/ActionButtonWarn.vue.d.ts +0 -19
  123. 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: Record<string, any>[];
41
+ selectedList: T[];
37
42
  /** 当前页数据 */
38
- currentPageList: Record<string, any>[];
43
+ currentPageList: T[];
39
44
  /** 分页 API */
40
- api: TableMainProps<any, any, any>["api"];
45
+ api: (params: TableApiParams<SQ>) => Promise<TableApiResult<T>>;
41
46
  /** 静态查询参数 */
42
- query: Record<string, any>;
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>> = ActionBtnConfigItem<ToolbarButtonContext<T>>;
74
- /** toolbar 可配置项(通过 TableMain 的 toolbar prop 传入) */
75
- export interface TableToolbarConfig {
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
  /** 每页条数 */
@@ -1,5 +1,4 @@
1
1
  import { DotToObject, UnionToIntersection } from '../types';
2
-
3
2
  /**
4
3
  * 列表 KEY 配置接口
5
4
  * ---
@@ -46,3 +45,5 @@ export type AppApiListPageParamsKey = typeof APP_API_LIST_MODEL_KEY_CONFIG.PAGE_
46
45
  export type AppApiListNoPageParamsKey = Exclude<string, AppApiListPageParamsKey>;
47
46
  /** 应用接口列表请求参数模型 */
48
47
  export type AppApiListParamsModel<P extends Record<AppApiListNoPageParamsKey, any> = Record<AppApiListNoPageParamsKey, any>> = BuildListParams<typeof APP_API_LIST_MODEL_KEY_CONFIG, Partial<P>>;
48
+ /** 应用接口列表请求参数模型(排除分页参数) */
49
+ export type AppApiListParamsNoPageParams<P extends BuildListParams<typeof APP_API_LIST_MODEL_KEY_CONFIG>> = Omit<AppApiListParamsModel<P>, keyof UnionToIntersection<DotToObject<(typeof APP_API_LIST_MODEL_KEY_CONFIG)["CURRENT_PAGE_KEY"], number> | DotToObject<(typeof APP_API_LIST_MODEL_KEY_CONFIG)["PAGE_SIZE_KEY"], number>>>;
@@ -1,5 +1,4 @@
1
1
  import { FormItemRule } from 'element-plus';
2
-
3
2
  /**
4
3
  * 密码规则
5
4
  */
@@ -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';
@@ -1,5 +1,4 @@
1
1
  import { TableApiParams, TableApiResult } from '../components/table/types';
2
-
3
2
  export interface FetchListAllOptions {
4
3
  /** 单页大小,默认 200,范围 [1, 1000] */
5
4
  pageSize?: number;
@@ -1,5 +1,4 @@
1
1
  import { RouteMetaResolveRaw } from '../types';
2
-
3
2
  /** 应用菜单数据分发 */
4
3
  export declare const useMenusDataDispatch: ({ getMenus, getMenuFlatList, getExtractLevel1ToHeader, }: {
5
4
  /** 菜单树 */
@@ -1,5 +1,4 @@
1
1
  import { ComputedRef } from 'vue';
2
-
3
2
  /** useChannelViewportHeight 第二参数 options */
4
3
  export interface UseChannelViewportHeightOptions {
5
4
  /** body inject 未命中时的最终兜底,默认 0 */
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;
@@ -1,7 +1,6 @@
1
1
  import { InjectionKey } from 'vue';
2
2
  import { ModalLevel, ShelfController } from '../components/modal';
3
3
  import { AppLayoutAppStoreSlice, AppLayoutUserStoreSlice, AppLayoutBridgeSlice } from '../components/app-layout';
4
-
5
4
  /**
6
5
  * body 视口高度
7
6
  * ---
@@ -2,7 +2,6 @@ import { Router } from 'vue-router';
2
2
  import { checkLogin } from './login';
3
3
  import { checkPermission } from './permission';
4
4
  import { CreateGuardOptions } from './types';
5
-
6
5
  /**
7
6
  * 路由守卫工厂——给 router 装登录守卫 + 权限守卫 + document.title 写入。
8
7
  *
@@ -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 方法 */
@@ -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
- }, "showHeader" | "keepAlive" | "bodyShimPadding" | "isDarkTheme" | "theme" | "showFooter" | "showSidebar" | "showBreadcrumb" | "headerStyle" | "footerStyle" | "sidebarStyle" | "bodyStyle" | "bodyShimStyle" | "sidebarIsCollapse">, Pick<{
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>;
@@ -1,6 +1,5 @@
1
1
  import { RouteLocationNormalizedLoaded } from 'vue-router';
2
2
  import { AdminBridge } from '../bridge';
3
-
4
3
  /**
5
4
  * createRoutePermissionStore 工厂依赖(#B 期;与 createUserStore / createAppStore
6
5
  * deps 范式对齐——bridge 经 init 注入,业务 hook / 业务路径常量经 deps 注入)。
@@ -1,7 +1,6 @@
1
1
  import { ComputedRef } from 'vue';
2
2
  import { AdminBridge } from '../bridge';
3
3
  import { RoutePermission } from '../types';
4
-
5
4
  /**
6
5
  * createUserStore 工厂依赖(v3 终锁 Δ1:deps 收敛单字段 `{ bridge }`)。
7
6
  *
@@ -1,6 +1,5 @@
1
1
  import { RouteRecordRaw } from 'vue-router';
2
2
  import { DefineComponent } from 'vue';
3
-
4
3
  /** 路由权限配置 */
5
4
  export type RoutePermission = Partial<{
6
5
  /** 是否需要登录 */
@@ -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 = Pick<ElTableColumnProps, "prop" | "label" | "type">;
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: string;
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<string, any>) => unknown;
15
+ valueMap?: (row: Record<keyof T, any>) => unknown;
15
16
  }
16
17
  /** 导出参数 */
17
- export interface ExportOptions {
18
- columns: ExportColumnConfig[];
19
- list: Record<string, any>[];
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;
@@ -1,5 +1,4 @@
1
1
  import { GetRoutePermissionParams } from '../types';
2
-
3
2
  /** 获取路由权限key */
4
3
  export declare const getRoutePermissionKey: ({ path, permission: permissionConfig, }: GetRoutePermissionParams) => string | number | undefined;
5
4
  /** 扁平化路由元信息解析raw */
@@ -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,14 +0,0 @@
1
- import e from "./ListPage.vue.mjs";
2
- const s = {
3
- ListPage: e
4
- }, a = {
5
- install(t) {
6
- Object.entries(s).forEach(([o, n]) => {
7
- t.component(o, n);
8
- });
9
- }
10
- };
11
- export {
12
- e as ListPage,
13
- a as listPageInstall
14
- };
@@ -1,12 +0,0 @@
1
- import t from "./MenuTree.vue.mjs";
2
- const s = { MenuTree: t }, r = {
3
- install(e) {
4
- Object.entries(s).forEach(([n, o]) => {
5
- e.component(n, o);
6
- });
7
- }
8
- };
9
- export {
10
- t as MenuTree,
11
- r as menuInstall
12
- };
@@ -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,4 +0,0 @@
1
- import f from "./ActionButton.vue.mjs";
2
- export {
3
- f as default
4
- };
@@ -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,4 +0,0 @@
1
- import f from "./ActionButtonDanger.vue.mjs";
2
- export {
3
- f as default
4
- };
@@ -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,4 +0,0 @@
1
- import f from "./ActionButtonWarn.vue.mjs";
2
- export {
3
- f as default
4
- };
@@ -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
- };