@done-coding/admin-core 0.3.0 → 0.4.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 (106) hide show
  1. package/es/bridge/index.mjs +87 -47
  2. package/es/components/app-layout/AppBody.vue.mjs +7 -0
  3. package/es/components/app-layout/AppBody.vue2.mjs +89 -0
  4. package/es/components/app-layout/AppBreadcrumb.vue.mjs +7 -0
  5. package/es/components/app-layout/AppBreadcrumb.vue2.mjs +58 -0
  6. package/es/components/app-layout/AppFooter.vue.mjs +7 -0
  7. package/es/components/app-layout/AppFooter.vue2.mjs +17 -0
  8. package/es/components/app-layout/AppHeader.vue.mjs +7 -0
  9. package/es/components/app-layout/AppHeader.vue2.mjs +99 -0
  10. package/es/components/app-layout/AppLayout.vue.mjs +7 -0
  11. package/es/components/app-layout/AppLayout.vue2.mjs +130 -0
  12. package/es/components/app-layout/AppPage.vue.mjs +7 -0
  13. package/es/components/app-layout/AppPage.vue2.mjs +39 -0
  14. package/es/components/app-layout/AppSidebar.vue.mjs +7 -0
  15. package/es/components/app-layout/AppSidebar.vue2.mjs +97 -0
  16. package/es/components/app-layout/index.mjs +32 -0
  17. package/es/components/display/ActionBtnGroup.vue.mjs +61 -0
  18. package/es/components/display/ActionBtnGroup.vue2.mjs +4 -0
  19. package/es/components/display/HeightProvider.vue.mjs +26 -26
  20. package/es/components/display/TabsHeader.vue.mjs +7 -0
  21. package/es/components/display/TabsHeader.vue2.mjs +76 -0
  22. package/es/components/display/TabsMain.vue.mjs +100 -5
  23. package/es/components/display/TabsMain.vue2.mjs +2 -95
  24. package/es/components/display/TabsNaturalFlow.vue.mjs +17 -0
  25. package/es/components/display/TabsNaturalFlow.vue2.mjs +4 -0
  26. package/es/components/display/TabsRefineFlow.vue.mjs +62 -0
  27. package/es/components/display/TabsRefineFlow.vue2.mjs +4 -0
  28. package/es/components/display/index.mjs +10 -8
  29. package/es/components/form/FormSearch.vue.mjs +2 -2
  30. package/es/components/form/FormSearch.vue2.mjs +107 -63
  31. package/es/components/form/form-search-utils.mjs +25 -0
  32. package/es/components/list-page/ListPage.vue.mjs +2 -2
  33. package/es/components/list-page/ListPage.vue2.mjs +82 -76
  34. package/es/components/misc/ActionBtn.vue.mjs +84 -65
  35. package/es/components/misc/ActionConfirm.vue.mjs +1 -1
  36. package/es/components/misc/ActionConfirm.vue2.mjs +77 -71
  37. package/es/components/misc/SelectModule.vue.mjs +55 -0
  38. package/es/components/misc/SelectModule.vue2.mjs +4 -0
  39. package/es/components/modal/ConfirmModal.vue.mjs +1 -1
  40. package/es/components/modal/ConfirmModal.vue2.mjs +13 -12
  41. package/es/components/modal/modal-shelf-hierarchy.mjs +4 -6
  42. package/es/components/table/TableMain.vue.mjs +3 -3
  43. package/es/components/table/TableMain.vue2.mjs +103 -102
  44. package/es/components/table/ToolbarButtons.vue.mjs +10 -40
  45. package/es/hooks/use-breakpoint.mjs +40 -0
  46. package/es/hooks/use-channel-viewport-height.mjs +18 -0
  47. package/es/index.mjs +165 -128
  48. package/es/inject/key.mjs +18 -8
  49. package/es/router/guard/index.mjs +31 -0
  50. package/es/router/guard/login.mjs +4 -0
  51. package/es/router/guard/permission.mjs +4 -0
  52. package/es/store/app.mjs +103 -0
  53. package/es/store/router-permission.mjs +65 -0
  54. package/es/store/user.mjs +52 -52
  55. package/es/style.css +1 -1
  56. package/package.json +3 -2
  57. package/types/bridge/index.d.ts +193 -89
  58. package/types/components/app-layout/AppBody.vue.d.ts +45 -0
  59. package/types/components/app-layout/AppBreadcrumb.vue.d.ts +25 -0
  60. package/types/components/app-layout/AppFooter.vue.d.ts +2 -0
  61. package/types/components/app-layout/AppHeader.vue.d.ts +55 -0
  62. package/types/components/app-layout/AppLayout.vue.d.ts +76 -0
  63. package/types/components/app-layout/AppPage.vue.d.ts +54 -0
  64. package/types/components/app-layout/AppSidebar.vue.d.ts +51 -0
  65. package/types/components/app-layout/index.d.ts +27 -0
  66. package/types/components/app-layout/types.d.ts +43 -0
  67. package/types/components/display/ActionBtnGroup.vue.d.ts +16 -0
  68. package/types/components/display/HeightProvider.vue.d.ts +10 -6
  69. package/types/components/display/TabsHeader.vue.d.ts +42 -0
  70. package/types/components/display/TabsMain.vue.d.ts +49 -7
  71. package/types/components/display/TabsNaturalFlow.vue.d.ts +16 -0
  72. package/types/components/display/TabsRefineFlow.vue.d.ts +53 -0
  73. package/types/components/display/index.d.ts +16 -13
  74. package/types/components/display/types.d.ts +85 -29
  75. package/types/components/form/form-search-utils.d.ts +24 -0
  76. package/types/components/form/types.d.ts +7 -1
  77. package/types/components/list-page/types.d.ts +1 -1
  78. package/types/components/misc/ActionBtn.vue.d.ts +17 -23
  79. package/types/components/misc/ActionConfirm.vue.d.ts +56 -27
  80. package/types/components/misc/SelectModule.vue.d.ts +2 -0
  81. package/types/components/misc/index.d.ts +11 -1
  82. package/types/components/misc/types.d.ts +35 -26
  83. package/types/components/modal/ConfirmModal.vue.d.ts +17 -0
  84. package/types/components/modal/modal-shelf-hierarchy.d.ts +1 -1
  85. package/types/components/table/types.d.ts +14 -12
  86. package/types/helpers/index.d.ts +10 -3
  87. package/types/hooks/index.d.ts +2 -0
  88. package/types/hooks/use-breakpoint.d.ts +4 -0
  89. package/types/hooks/use-channel-viewport-height.d.ts +28 -0
  90. package/types/index.d.ts +4 -1
  91. package/types/inject/key.d.ts +35 -10
  92. package/types/router/guard/index.d.ts +21 -0
  93. package/types/router/guard/login.d.ts +5 -0
  94. package/types/router/guard/permission.d.ts +5 -0
  95. package/types/router/guard/types.d.ts +15 -0
  96. package/types/router/index.d.ts +1 -0
  97. package/types/store/app.d.ts +149 -0
  98. package/types/store/index.d.ts +2 -0
  99. package/types/store/router-permission.d.ts +80 -0
  100. package/types/store/user.d.ts +11 -9
  101. /package/es/{helpers → bridge}/route.mjs +0 -0
  102. /package/es/{helpers → bridge}/state.mjs +0 -0
  103. /package/es/{helpers → bridge}/storage.mjs +0 -0
  104. /package/types/{helpers → bridge}/route.d.ts +0 -0
  105. /package/types/{helpers → bridge}/state.d.ts +0 -0
  106. /package/types/{helpers → bridge}/storage.d.ts +0 -0
@@ -1,75 +1,115 @@
1
- function w() {
2
- let l, h, c, T, I, k = !1, t, i, o, f, g, u, s, A;
3
- const n = (e) => `admin bridge: ${e} 未注册`, r = () => {
4
- if (!k) throw new Error("admin bridge: 未 init");
5
- }, a = {
6
- init(e) {
7
- return l = e.appConfig, h = e.storage, c = e.routes, T = e.userInfoAccess, I = e.getUserInfoInitFn, k = !0, a;
1
+ import { createStorageWithNamespace as u } from "./storage.mjs";
2
+ import { createUseState as a } from "./state.mjs";
3
+ import { createGenerateRouteMetaRawTree as L } from "./route.mjs";
4
+ function l(e) {
5
+ const n = e.APP_CACHE_CONFIG.namespace;
6
+ let _;
7
+ n === "" ? (console.error(
8
+ "[adminBridge] APP_CACHE_CONFIG.namespace 为空,已兜底为 'ADMIN_CORE'"
9
+ ), _ = "ADMIN_CORE") : _ = n, Object.freeze(e);
10
+ let N = u(_), f = e.routes, g = e.getUserInfoInitFn;
11
+ const U = a(_), R = L(
12
+ e.APP_ROUTER_META_DEFAULT_CONFIG
13
+ ), G = Object.freeze({
14
+ header: e.APP_LAYOUT_HEADER_CONFIG,
15
+ footer: e.APP_LAYOUT_FOOTER_CONFIG,
16
+ sidebar: e.APP_LAYOUT_SIDEBAR_CONFIG,
17
+ breadcrumb: e.APP_LAYOUT_BREADCRUMB_CONFIG,
18
+ body: e.APP_LAYOUT_BODY_CONFIG
19
+ });
20
+ let P, O, T, t, E, I, F, C;
21
+ const A = (r) => `admin bridge: ${r} 未注册`;
22
+ return {
23
+ register(r) {
24
+ r.getToken && (P = r.getToken), r.goToLogin && (O = r.goToLogin), r.refreshToken && (T = r.refreshToken), r.refreshAuth && (t = r.refreshAuth), r.loginApi && (E = r.loginApi), r.logoutApi && (I = r.logoutApi), r.getUserInfoApi && (F = r.getUserInfoApi), r.refreshTokenApi && (C = r.refreshTokenApi);
8
25
  },
9
- register(e) {
10
- r(), e.getToken && (t = e.getToken), e.goToLogin && (i = e.goToLogin), e.refreshToken && (o = e.refreshToken), e.refreshAuth && (f = e.refreshAuth), e.loginApi && (g = e.loginApi), e.logoutApi && (u = e.logoutApi), e.getUserInfoApi && (s = e.getUserInfoApi), e.refreshTokenApi && (A = e.refreshTokenApi);
11
- },
12
- // pre-init 同步 throw;post-init 未注册同步 throw;已注册返回 undefined 是合法业务态不 throw
26
+ // 已注册返回 undefined 是合法业务态不 throw
13
27
  // v3 终锁 Δ8b:零参 facade(BR-1 ③ 终裁——core 对 UserInfo 不透明 + 拦截器无 info 源)
14
28
  getToken() {
15
- if (r(), !t) throw new Error(n("getToken"));
16
- return t();
29
+ if (!P) throw new Error(A("getToken"));
30
+ return P();
17
31
  },
18
- // pre-init 同步 throw;post-init 同步对
19
32
  goToLogin() {
20
- if (r(), !i) throw new Error(n("goToLogin"));
21
- i();
33
+ if (!O) throw new Error(A("goToLogin"));
34
+ O();
22
35
  },
23
- // 异步对:init-gate 优先于「异步对返 reject」——pre-init 一律同步 throw;
24
- // post-init 未注册才返回 rejected Promise(既有降级语义保留)。
36
+ // 异步对:未注册才返回 rejected Promise(既有降级语义保留)。
25
37
  refreshToken() {
26
- return r(), o ? o().then(() => {
27
- }) : Promise.reject(new Error(n("refreshToken")));
38
+ return T ? T().then(() => {
39
+ }) : Promise.reject(new Error(A("refreshToken")));
28
40
  },
29
- // 异步对:同上
30
41
  refreshAuth() {
31
- return r(), f ? f().then(() => {
32
- }) : Promise.reject(new Error(n("refreshAuth")));
42
+ return t ? t().then(() => {
43
+ }) : Promise.reject(new Error(A("refreshAuth")));
33
44
  },
34
- // pre-init 同步 throw;post-init 返回 init 注册引用
45
+ // #2.5 ADR-4 候选 b:getAppConfig facade 保留 + 内部从 12 readonly 属性组装聚合对象
46
+ // 每次调用产新对象(多次调用 !== 引用不等),与原 facade 返回 options.appConfig 引用语义不同;
47
+ // store/app.ts:18 解构后丢弃返回引用,引用相等性不被消费,行为对等 ✅
35
48
  getAppConfig() {
36
- return r(), l;
49
+ return Object.freeze({
50
+ APP_BASE_INFO: e.APP_BASE_INFO,
51
+ APP_LAYOUT_HEADER_CONFIG: e.APP_LAYOUT_HEADER_CONFIG,
52
+ APP_LAYOUT_FOOTER_CONFIG: e.APP_LAYOUT_FOOTER_CONFIG,
53
+ APP_LAYOUT_SIDEBAR_CONFIG: e.APP_LAYOUT_SIDEBAR_CONFIG,
54
+ APP_LAYOUT_BODY_CONFIG: e.APP_LAYOUT_BODY_CONFIG,
55
+ APP_THEME_CONFIG: e.APP_THEME_CONFIG,
56
+ APP_ROUTER_META_DEFAULT_CONFIG: e.APP_ROUTER_META_DEFAULT_CONFIG,
57
+ APP_CACHE_CONFIG: e.APP_CACHE_CONFIG
58
+ });
37
59
  },
38
- // pre-init 同步 throw;post-init 返回 init 注册引用
39
60
  getStorage() {
40
- return r(), h;
61
+ return N;
41
62
  },
42
- // pre-init 同步 throw;post-init 返回 init 注册引用
43
63
  getRoutes() {
44
- return r(), c;
45
- },
46
- // pre-init 同步 throw;post-init 返回 init 注册引用(v3 终锁 Δ0d,镜像 getRoutes 范式)
47
- getUserInfoAccess() {
48
- return r(), T;
64
+ return f;
49
65
  },
50
- // pre-init 同步 throw;post-init 返回 init 注册引用(v3 终锁 Δ0d,镜像 getRoutes 范式)
51
66
  getUserInfoInitFn() {
52
- return r(), I;
67
+ return g;
53
68
  },
54
- // 异步对:pre-init 同步 throw;post-init 未注册返回 rejected 原生 Error(#4a-2 per-method 降级)
55
- loginApi(e) {
56
- return r(), g ? g(e) : Promise.reject(new Error(n("loginApi")));
69
+ useState: U,
70
+ generateRouteMetaRawTree: R,
71
+ // ============ #2.5 12 readonly 属性值挂载(per ADR-1 sibling pattern 复用 useState / generateRouteMetaRawTree) ============
72
+ /** 应用基础信息(per #2.5 期 REQ-1 直接挂载形态) */
73
+ APP_BASE_INFO: e.APP_BASE_INFO,
74
+ /** 应用环境信息(per #2.5 期 REQ-1) */
75
+ APP_ENV_INFO: e.APP_ENV_INFO,
76
+ /** 应用缓存配置(per #2.5 期 REQ-1) */
77
+ APP_CACHE_CONFIG: e.APP_CACHE_CONFIG,
78
+ /** 应用布局-header 配置(per #2.5 期 REQ-1) */
79
+ APP_LAYOUT_HEADER_CONFIG: e.APP_LAYOUT_HEADER_CONFIG,
80
+ /** 应用布局-footer 配置(per #2.5 期 REQ-1) */
81
+ APP_LAYOUT_FOOTER_CONFIG: e.APP_LAYOUT_FOOTER_CONFIG,
82
+ /** 应用布局-sidebar 配置(per #2.5 期 REQ-1) */
83
+ APP_LAYOUT_SIDEBAR_CONFIG: e.APP_LAYOUT_SIDEBAR_CONFIG,
84
+ /** 应用布局-面包屑配置(per #2.5 期 REQ-1) */
85
+ APP_LAYOUT_BREADCRUMB_CONFIG: e.APP_LAYOUT_BREADCRUMB_CONFIG,
86
+ /** 应用布局-页面主体配置(per #2.5 期 REQ-1) */
87
+ APP_LAYOUT_BODY_CONFIG: e.APP_LAYOUT_BODY_CONFIG,
88
+ /** 应用布局聚合配置(per #2.5 期 ADR-3 bridge 内部聚合派生) */
89
+ APP_LAYOUT_CONFIG: G,
90
+ /** 应用路由元信息默认配置(per #2.5 期 REQ-1) */
91
+ APP_ROUTER_META_DEFAULT_CONFIG: e.APP_ROUTER_META_DEFAULT_CONFIG,
92
+ /** 应用路由配置(per #2.5 期 REQ-1) */
93
+ APP_ROUTER_CONFIG: e.APP_ROUTER_CONFIG,
94
+ /** 应用路由路径配置(per #7.3 期 readonly 挂载) */
95
+ APP_ROUTER_PATHS_CONFIG: e.APP_ROUTER_PATHS_CONFIG,
96
+ /** 应用主题配置(per #2.5 期 REQ-1) */
97
+ APP_THEME_CONFIG: e.APP_THEME_CONFIG,
98
+ // 异步对:未注册返回 rejected 原生 Error(#4a-2 per-method 降级)
99
+ loginApi(r) {
100
+ return E ? E(r) : Promise.reject(new Error(A("loginApi")));
57
101
  },
58
- // 异步对:同上
59
102
  logoutApi() {
60
- return r(), u ? u() : Promise.reject(new Error(n("logoutApi")));
103
+ return I ? I() : Promise.reject(new Error(A("logoutApi")));
61
104
  },
62
- // 异步对:同上
63
105
  getUserInfoApi() {
64
- return r(), s ? s() : Promise.reject(new Error(n("getUserInfoApi")));
106
+ return F ? F() : Promise.reject(new Error(A("getUserInfoApi")));
65
107
  },
66
- // 异步对:同上
67
- refreshTokenApi(e) {
68
- return r(), A ? A(e) : Promise.reject(new Error(n("refreshTokenApi")));
108
+ refreshTokenApi(r) {
109
+ return C ? C(r) : Promise.reject(new Error(A("refreshTokenApi")));
69
110
  }
70
111
  };
71
- return a;
72
112
  }
73
113
  export {
74
- w as createAdminBridge
114
+ l as createAdminBridge
75
115
  };
@@ -0,0 +1,7 @@
1
+ import o from "./AppBody.vue2.mjs";
2
+ /* empty css */
3
+ import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const _ = /* @__PURE__ */ p(o, [["__scopeId", "data-v-305d730c"]]);
5
+ export {
6
+ _ as default
7
+ };
@@ -0,0 +1,89 @@
1
+ import { ElAffix as V } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/affix/style/css";
4
+ import { defineComponent as F, useCssVars as N, unref as t, inject as A, ref as E, provide as H, computed as o, watch as I, resolveComponent as U, openBlock as i, createElementBlock as Y, normalizeStyle as b, createElementVNode as k, createBlock as r, withCtx as P, createVNode as w, createCommentVNode as l, KeepAlive as G, resolveDynamicComponent as S, renderSlot as D } from "vue";
5
+ import $ from "./AppBreadcrumb.vue.mjs";
6
+ import z from "lodash/debounce";
7
+ import { APP_LAYOUT_APP_STORE_KEY as K, APP_LAYOUT_BRIDGE_KEY as M, BODY_CONTENT_VIEWPORT_HEIGHT as j } from "../../inject/key.mjs";
8
+ import { useActivatedExec as W, useActivatedEvent as q } from "../../hooks/activated.mjs";
9
+ const se = /* @__PURE__ */ F({
10
+ __name: "AppBody",
11
+ props: {
12
+ menus: { default: () => [] },
13
+ menuFlatList: { default: () => [] }
14
+ },
15
+ setup(c) {
16
+ N((e) => ({
17
+ v078aa5b4: t(a)
18
+ }));
19
+ const n = A(K), m = A(M), x = m.APP_LAYOUT_BREADCRUMB_CONFIG, C = m.APP_ROUTER_CONFIG, d = E(!1), u = x.height, p = E(0);
20
+ H(j, p);
21
+ const g = o(() => n.bodyShimPadding), f = o(() => n.bodyShimStyle), O = o(() => n.bodyStyle), _ = o(() => n.showBreadcrumb), B = o(() => parseFloat(`${n.bodyStyle.paddingTop ?? 0}`) || 0), a = o(
22
+ () => `calc(${f.value.minHeight} - ${_.value && d.value ? u : 0}px - ${g.value * 2}px)`
23
+ ), R = (e) => {
24
+ d.value = e;
25
+ }, s = z(() => {
26
+ const e = document.createElement("div");
27
+ e.style.height = a.value, e.style.position = "fixed", e.style.left = "100%", e.style.top = "100%", e.style.opacity = "0", e.style.pointerEvents = "none", document.body.appendChild(e), p.value = e.clientHeight, e.remove();
28
+ }, 16);
29
+ return W(() => {
30
+ s();
31
+ }), q(
32
+ () => {
33
+ window.addEventListener("resize", s);
34
+ },
35
+ () => {
36
+ window.removeEventListener("resize", s);
37
+ }
38
+ ), I(a, () => {
39
+ s();
40
+ }), (e, J) => {
41
+ const T = V, L = U("RouterView");
42
+ return i(), Y("div", {
43
+ class: "app-body",
44
+ style: b(t(O))
45
+ }, [
46
+ k("div", {
47
+ class: "app-body-shim",
48
+ style: b(t(f))
49
+ }, [
50
+ t(_) ? (i(), r(T, {
51
+ key: 0,
52
+ offset: t(B)
53
+ }, {
54
+ default: P(() => [
55
+ w($, {
56
+ menus: c.menus,
57
+ height: t(u),
58
+ menuFlatList: c.menuFlatList,
59
+ onShow: R
60
+ }, null, 8, ["menus", "height", "menuFlatList"])
61
+ ]),
62
+ _: 1
63
+ }, 8, ["offset"])) : l("", !0),
64
+ w(L, null, {
65
+ default: P(({
66
+ Component: y,
67
+ route: {
68
+ path: h,
69
+ meta: { keepAlive: v }
70
+ }
71
+ }) => [
72
+ (i(), r(G, {
73
+ max: t(C).keepAliveMaxCount
74
+ }, [
75
+ v ? (i(), r(S(y), { key: h })) : l("", !0)
76
+ ], 1032, ["max"])),
77
+ v ? l("", !0) : (i(), r(S(y), { key: h }))
78
+ ]),
79
+ _: 1
80
+ })
81
+ ], 4),
82
+ D(e.$slots, "footer", {}, void 0, !0)
83
+ ], 4);
84
+ };
85
+ }
86
+ });
87
+ export {
88
+ se as default
89
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./AppBreadcrumb.vue2.mjs";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-39d4ee00"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,58 @@
1
+ import { ElBreadcrumb as b, ElBreadcrumbItem as w } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/breadcrumb/style/css";
4
+ import "element-plus/es/components/breadcrumb-item/style/css";
5
+ import { defineComponent as g, computed as o, watch as x, withDirectives as y, openBlock as n, createElementBlock as u, normalizeStyle as E, unref as m, createVNode as k, withCtx as p, Fragment as v, renderList as I, createBlock as F, createTextVNode as L, toDisplayString as S, vShow as A } from "vue";
6
+ import { useRoute as C } from "vue-router";
7
+ const $ = /* @__PURE__ */ g({
8
+ name: "AppBreadcrumb",
9
+ __name: "AppBreadcrumb",
10
+ props: {
11
+ menus: {},
12
+ height: {},
13
+ menuFlatList: {}
14
+ },
15
+ emits: ["show"],
16
+ setup(i, { emit: l }) {
17
+ const a = i, h = l, d = C(), c = o(() => d.matched.map((t) => a.menuFlatList.find(
18
+ (e) => e.path === t.path
19
+ )).filter((t) => t)), s = o(() => c.value.length > 1), _ = o(() => ({
20
+ height: `${a.height}px`
21
+ }));
22
+ return x(
23
+ s,
24
+ (t) => {
25
+ h("show", t);
26
+ },
27
+ {
28
+ immediate: !0
29
+ }
30
+ ), (t, f) => {
31
+ const e = w, B = b;
32
+ return y((n(), u("div", {
33
+ class: "app-breadcrumb",
34
+ style: E(m(_))
35
+ }, [
36
+ k(B, { separator: "/" }, {
37
+ default: p(() => [
38
+ (n(!0), u(v, null, I(m(c), (r) => (n(), F(e, {
39
+ key: r.path,
40
+ to: r.path
41
+ }, {
42
+ default: p(() => [
43
+ L(S(r.title), 1)
44
+ ]),
45
+ _: 2
46
+ }, 1032, ["to"]))), 128))
47
+ ]),
48
+ _: 1
49
+ })
50
+ ], 4)), [
51
+ [A, m(s)]
52
+ ]);
53
+ };
54
+ }
55
+ });
56
+ export {
57
+ $ as default
58
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./AppFooter.vue2.mjs";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-393d9768"]]);
5
+ export {
6
+ _ as default
7
+ };
@@ -0,0 +1,17 @@
1
+ import { defineComponent as r, inject as n, computed as p, openBlock as l, createElementBlock as s, normalizeStyle as m, unref as a, createElementVNode as c } from "vue";
2
+ import { APP_LAYOUT_APP_STORE_KEY as f } from "../../inject/key.mjs";
3
+ const S = /* @__PURE__ */ r({
4
+ __name: "AppFooter",
5
+ setup(_) {
6
+ const o = n(f), t = p(() => o.footerStyle);
7
+ return (i, e) => (l(), s("div", {
8
+ class: "app-footer",
9
+ style: m(a(t))
10
+ }, [...e[0] || (e[0] = [
11
+ c("div", { class: "app-footer-shim" }, null, -1)
12
+ ])], 4));
13
+ }
14
+ });
15
+ export {
16
+ S as default
17
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./AppHeader.vue2.mjs";
2
+ /* empty css */
3
+ import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const a = /* @__PURE__ */ p(o, [["__scopeId", "data-v-55cf55e9"]]);
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,99 @@
1
+ import { ElIcon as E, ElSwitch as g } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/switch/style/css";
4
+ import "element-plus/es/components/icon/style/css";
5
+ import { defineComponent as w, useCssVars as I, unref as o, inject as B, toRefs as P, computed as m, watch as V, nextTick as $, openBlock as r, createElementBlock as s, normalizeStyle as T, createElementVNode as d, renderSlot as v, normalizeClass as _, Fragment as b, renderList as x, createBlock as f, withCtx as A, resolveDynamicComponent as D, createCommentVNode as y, toDisplayString as L, createVNode as N } from "vue";
6
+ import { Sunny as R, Moon as q } from "@element-plus/icons-vue";
7
+ import { useRouter as z } from "vue-router";
8
+ import { APP_LAYOUT_APP_STORE_KEY as F } from "../../inject/key.mjs";
9
+ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
10
+ class: "app-header-userInfo",
11
+ pl20: ""
12
+ }, ee = /* @__PURE__ */ w({
13
+ __name: "AppHeader",
14
+ props: {
15
+ show: { type: Boolean },
16
+ menus: { default: () => [] },
17
+ activeMenu: {},
18
+ activeModuleMenu: {},
19
+ menuFlatList: {}
20
+ },
21
+ setup(p) {
22
+ I((e) => ({
23
+ v4db2d700: o(u).baseColor,
24
+ v23ceefd3: o(u).primaryColor
25
+ }));
26
+ const c = p, i = B(F), { theme: u } = P(i), S = m(() => i.headerStyle), k = z(), h = `app-header-module_${Math.random().toString(36).substring(2)}`, C = m(() => c.menus), l = m({
27
+ get() {
28
+ var e;
29
+ return (e = c.activeModuleMenu) == null ? void 0 : e.path;
30
+ },
31
+ set(e) {
32
+ var n, a;
33
+ ((a = (n = c.activeMenu) == null ? void 0 : n.parentPathList) == null ? void 0 : a[0]) !== e && k.push(e);
34
+ }
35
+ });
36
+ return V(
37
+ l,
38
+ (e) => {
39
+ e && $(() => {
40
+ var n, a;
41
+ (a = (n = document.querySelector(`.${h}`)) == null ? void 0 : n.querySelector(`[name="${e}"]`)) == null || a.scrollIntoView({
42
+ behavior: "smooth"
43
+ });
44
+ });
45
+ },
46
+ {
47
+ immediate: !0
48
+ }
49
+ ), (e, n) => {
50
+ const a = E, M = g;
51
+ return r(), s("div", {
52
+ class: "app-header",
53
+ style: T(o(S))
54
+ }, [
55
+ d("div", O, [
56
+ v(e.$slots, "left", {}, void 0, !0),
57
+ o(C) ? (r(), s("div", {
58
+ key: 0,
59
+ class: _(["app-header-module", h])
60
+ }, [
61
+ (r(!0), s(b, null, x(p.menus, (t) => (r(), s("div", {
62
+ key: t.path,
63
+ name: t.path,
64
+ class: _([
65
+ "app-header-module-item",
66
+ o(l) === t.path ? "app-header-module-item_active" : ""
67
+ ]),
68
+ onClick: (j) => l.value = t.path
69
+ }, [
70
+ t.menuIcon ? (r(), f(a, {
71
+ key: 0,
72
+ mr2: ""
73
+ }, {
74
+ default: A(() => [
75
+ (r(), f(D(t.menuIcon)))
76
+ ]),
77
+ _: 2
78
+ }, 1024)) : y("", !0),
79
+ d("span", null, L(t.title), 1)
80
+ ], 10, U))), 128))
81
+ ])) : y("", !0),
82
+ d("div", Y, [
83
+ N(M, {
84
+ "model-value": o(i).isDarkTheme,
85
+ mr3: "",
86
+ "active-action-icon": o(q),
87
+ "inactive-action-icon": o(R),
88
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => o(i).changeIsDarkTheme(!!t))
89
+ }, null, 8, ["model-value", "active-action-icon", "inactive-action-icon"]),
90
+ v(e.$slots, "right", {}, void 0, !0)
91
+ ])
92
+ ])
93
+ ], 4);
94
+ };
95
+ }
96
+ });
97
+ export {
98
+ ee as default
99
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./AppLayout.vue2.mjs";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2952b5fa"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,130 @@
1
+ import { ElWatermark as F } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/watermark/style/css";
4
+ import { defineComponent as R, provide as l, computed as n, watch as f, openBlock as E, createElementBlock as P, normalizeClass as B, unref as t, createVNode as a, withCtx as r, renderSlot as u } from "vue";
5
+ import H from "./AppBody.vue.mjs";
6
+ import T from "./AppHeader.vue.mjs";
7
+ import k from "./AppFooter.vue.mjs";
8
+ import y from "./AppSidebar.vue.mjs";
9
+ import $ from "../modal/ModalShelf.vue.mjs";
10
+ import { useRoute as C, useRouter as Y } from "vue-router";
11
+ import { APP_LAYOUT_BRIDGE_KEY as K, APP_LAYOUT_APP_STORE_KEY as O, APP_LAYOUT_USER_STORE_KEY as U } from "../../inject/key.mjs";
12
+ import { flatRouteMetaResolveRaw as z } from "../../utils/router.mjs";
13
+ import { useMenusDataDispatch as D } from "../../hooks/menus-dispatch.mjs";
14
+ const te = /* @__PURE__ */ R({
15
+ __name: "AppLayout",
16
+ props: {
17
+ adminBridge: {},
18
+ appStore: {},
19
+ userStore: {},
20
+ watermarkContent: {},
21
+ sidebarAboveHeader: { type: Boolean, default: !1 }
22
+ },
23
+ setup(m) {
24
+ const o = m, h = {
25
+ color: "rgba(0,0,0,0.08)",
26
+ fontSize: 12
27
+ };
28
+ l(K, o.adminBridge), l(O, o.appStore), l(U, o.userStore);
29
+ const p = n(() => o.adminBridge.generateRouteMetaRawTree(
30
+ o.adminBridge.getRoutes(),
31
+ {
32
+ parentPath: "",
33
+ filterFn: (e, i, d) => e.checkPermission ? e.menuShow && o.userStore.havePermissionByKey(e.permissionKey) : e.menuShow && (!d || i),
34
+ sortFn: (e, i) => e.menuSort - i.menuSort
35
+ }
36
+ )), s = n(() => z(p.value)), {
37
+ sidebarMenus: c,
38
+ headerMenus: v,
39
+ activeMenu: S,
40
+ activeModuleMenu: _,
41
+ needRedirectToFirstChildMenu: g
42
+ } = D({
43
+ getMenus: () => p.value,
44
+ getMenuFlatList: () => s.value,
45
+ getExtractLevel1ToHeader: () => o.appStore.extractLevel1ToHeader
46
+ }), M = n(() => o.userStore.isLogin), L = n(() => o.appStore.showHeader), b = n(() => o.appStore.showSidebar);
47
+ f(
48
+ () => c.value.length,
49
+ (e) => {
50
+ o.appStore.changeSidebarHasMenusStatus(!!e);
51
+ },
52
+ {
53
+ immediate: !0
54
+ }
55
+ );
56
+ const w = C(), A = Y();
57
+ return f(
58
+ g,
59
+ (e) => {
60
+ e && (console.log(`${w.path}需要重定向到${e.path}`), A.replace(e.path));
61
+ },
62
+ {
63
+ immediate: !0
64
+ }
65
+ ), (e, i) => {
66
+ const d = F;
67
+ return E(), P("div", {
68
+ class: B(["app-layout", {
69
+ "app-layout_noLogin": !t(M)
70
+ }])
71
+ }, [
72
+ a(d, {
73
+ content: m.watermarkContent,
74
+ font: h,
75
+ zIndex: 1e4
76
+ }, {
77
+ default: r(() => [
78
+ a(t($), { level: "app" }, {
79
+ default: r(() => [
80
+ a(H, {
81
+ menus: t(p),
82
+ menuFlatList: t(s)
83
+ }, {
84
+ footer: r(() => [
85
+ a(k)
86
+ ]),
87
+ _: 1
88
+ }, 8, ["menus", "menuFlatList"]),
89
+ a(y, {
90
+ show: t(b),
91
+ aboveHeader: m.sidebarAboveHeader,
92
+ menus: t(c),
93
+ menuFlatList: t(s)
94
+ }, {
95
+ top: r(() => [
96
+ u(e.$slots, "sidebar-top", {}, void 0, !0)
97
+ ]),
98
+ bottom: r(() => [
99
+ u(e.$slots, "sidebar-bottom", {}, void 0, !0)
100
+ ]),
101
+ _: 3
102
+ }, 8, ["show", "aboveHeader", "menus", "menuFlatList"]),
103
+ a(T, {
104
+ show: t(L),
105
+ menus: t(v),
106
+ activeMenu: t(S),
107
+ activeModuleMenu: t(_),
108
+ menuFlatList: t(s)
109
+ }, {
110
+ left: r(() => [
111
+ u(e.$slots, "header-left", {}, void 0, !0)
112
+ ]),
113
+ right: r(() => [
114
+ u(e.$slots, "header-right", {}, void 0, !0)
115
+ ]),
116
+ _: 3
117
+ }, 8, ["show", "menus", "activeMenu", "activeModuleMenu", "menuFlatList"])
118
+ ]),
119
+ _: 3
120
+ })
121
+ ]),
122
+ _: 3
123
+ }, 8, ["content"])
124
+ ], 2);
125
+ };
126
+ }
127
+ });
128
+ export {
129
+ te as default
130
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./AppPage.vue2.mjs";
2
+ /* empty css */
3
+ import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const f = /* @__PURE__ */ p(o, [["__scopeId", "data-v-fda19616"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,39 @@
1
+ import { defineComponent as r, useCssVars as p, computed as l, openBlock as n, createElementBlock as s, normalizeStyle as i, createElementVNode as c, createVNode as u, unref as d, withCtx as f, renderSlot as m } from "vue";
2
+ import g from "../modal/ModalShelf.vue.mjs";
3
+ const h = { class: "app-page-shim" }, _ = "--app-viewport-max-height", w = /* @__PURE__ */ r({
4
+ name: "AppPage",
5
+ __name: "AppPage",
6
+ props: {
7
+ fullViewport: { type: Boolean, default: !1 },
8
+ fullMode: { default: "min-height" },
9
+ nextViewportMaxHeight: { default: "var(--app-viewport-max-height)" },
10
+ background: {}
11
+ },
12
+ setup(a) {
13
+ p((t) => ({
14
+ v54888f0e: e.nextViewportMaxHeight
15
+ }));
16
+ const e = a, o = l(() => ({
17
+ background: e.background,
18
+ ...e.fullViewport ? {
19
+ [e.fullMode]: `var(${_})`
20
+ } : {}
21
+ }));
22
+ return (t, v) => (n(), s("div", {
23
+ class: "app-page",
24
+ style: i(o.value)
25
+ }, [
26
+ c("div", h, [
27
+ u(d(g), { level: "page" }, {
28
+ default: f(() => [
29
+ m(t.$slots, "default", {}, void 0, !0)
30
+ ]),
31
+ _: 3
32
+ })
33
+ ])
34
+ ], 4));
35
+ }
36
+ });
37
+ export {
38
+ w as default
39
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./AppSidebar.vue2.mjs";
2
+ /* empty css */
3
+ import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const a = /* @__PURE__ */ p(o, [["__scopeId", "data-v-37ff5e0c"]]);
5
+ export {
6
+ a as default
7
+ };