@done-coding/admin-core 0.8.3-alpha.0 → 0.9.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 (127) hide show
  1. package/docs/nested-config-paradigm.md +80 -0
  2. package/es/bridge/config-hook.mjs +37 -0
  3. package/es/bridge/index.mjs +157 -62
  4. package/es/bridge/plugin.mjs +29 -0
  5. package/es/bridge/theme.mjs +65 -0
  6. package/es/components/app-layout/AppBody.vue.mjs +1 -1
  7. package/es/components/app-layout/AppBody.vue2.mjs +47 -49
  8. package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
  9. package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
  10. package/es/components/app-layout/AppFooter.vue.mjs +2 -2
  11. package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
  12. package/es/components/app-layout/AppHeader.vue.mjs +1 -1
  13. package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
  14. package/es/components/app-layout/AppLayout.vue.mjs +2 -2
  15. package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
  16. package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
  17. package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
  18. package/es/components/app-layout/AppTheme.vue.mjs +7 -0
  19. package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
  20. package/es/components/data-view/DataListView.vue.mjs +2 -2
  21. package/es/components/data-view/DataListView.vue2.mjs +36 -36
  22. package/es/components/display/ActionConfirm.vue2.mjs +16 -16
  23. package/es/components/display/HeightProvider.vue.mjs +10 -10
  24. package/es/components/display/TabsHeader.vue.mjs +4 -4
  25. package/es/components/display/TabsHeader.vue2.mjs +34 -34
  26. package/es/components/display/TabsMain.vue.mjs +40 -39
  27. package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
  28. package/es/components/form/FormItem.vue.mjs +1 -1
  29. package/es/components/form/FormItem.vue2.mjs +75 -81
  30. package/es/components/form/FormItemNestForm.vue.mjs +7 -0
  31. package/es/components/form/FormItemNestForm.vue2.mjs +49 -0
  32. package/es/components/form/FormItemNestFormList.vue.mjs +7 -0
  33. package/es/components/form/FormItemNestFormList.vue2.mjs +137 -0
  34. package/es/components/form/FormMain.vue.mjs +5 -147
  35. package/es/components/form/FormMain.vue2.mjs +160 -2
  36. package/es/components/form/FormRadioGroup.vue.mjs +42 -49
  37. package/es/components/form/FormSearch.vue.mjs +2 -2
  38. package/es/components/form/FormSearch.vue2.mjs +122 -128
  39. package/es/components/form/FormSelect.vue.mjs +34 -40
  40. package/es/components/form/FormSubmitBtn.vue.mjs +23 -28
  41. package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
  42. package/es/components/form/FormSubmitPanel.vue2.mjs +29 -28
  43. package/es/components/form/FormTree.vue.mjs +16 -21
  44. package/es/components/form/FormVerifyCode.vue.mjs +37 -43
  45. package/es/components/form/FormVerifyImage.vue.mjs +2 -2
  46. package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
  47. package/es/components/form/nest-form-item-list.mjs +71 -0
  48. package/es/components/form/nest-form-item.mjs +42 -0
  49. package/es/components/form/nest-registry.mjs +7 -0
  50. package/es/components/form/use-nest-form-list.mjs +22 -0
  51. package/es/components/form/use-nest-form.mjs +34 -0
  52. package/es/components/form/use-nest-layout-scale.mjs +14 -0
  53. package/es/components/form/utils.mjs +77 -61
  54. package/es/components/list-page/ListPage.vue.mjs +2 -2
  55. package/es/components/list-page/ListPage.vue2.mjs +134 -139
  56. package/es/components/menu/MenuItemSub.vue.mjs +41 -48
  57. package/es/components/menu/MenuTree.vue.mjs +58 -65
  58. package/es/components/misc/AutoRefresh.vue.mjs +2 -2
  59. package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
  60. package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
  61. package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
  62. package/es/components/modal/ConfirmModal.vue.mjs +3 -4
  63. package/es/components/modal/ConfirmModal.vue2.mjs +83 -111
  64. package/es/components/modal/DetailModal.vue.mjs +38 -41
  65. package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
  66. package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
  67. package/es/components/panel/PanelItemNestForm.vue.mjs +7 -0
  68. package/es/components/panel/PanelItemNestForm.vue2.mjs +69 -0
  69. package/es/components/panel/PanelItemNestPanel.vue.mjs +34 -0
  70. package/es/components/panel/PanelItemNestPanel.vue2.mjs +4 -0
  71. package/es/components/panel/PanelMain.vue.mjs +1 -1
  72. package/es/components/panel/PanelMain.vue2.mjs +72 -72
  73. package/es/components/panel/nest-panel-form.mjs +53 -0
  74. package/es/components/panel/nest-panel-item.mjs +25 -0
  75. package/es/components/table/TableMain.vue.mjs +2 -2
  76. package/es/components/table/TableMain.vue2.mjs +221 -229
  77. package/es/components/table/TableToolbar.vue.mjs +2 -2
  78. package/es/components/table/TableToolbar.vue2.mjs +115 -126
  79. package/es/hooks/use-admin-theme-apply.mjs +84 -0
  80. package/es/hooks/use-admin-viewport-apply.mjs +27 -0
  81. package/es/index.mjs +190 -153
  82. package/es/inject/key.mjs +15 -6
  83. package/es/store/app.mjs +75 -84
  84. package/es/style.css +1 -1
  85. package/es/utils/theme-scale.mjs +37 -0
  86. package/package.json +2 -4
  87. package/types/bridge/config-hook.d.ts +91 -0
  88. package/types/bridge/index.d.ts +108 -8
  89. package/types/bridge/plugin.d.ts +39 -0
  90. package/types/bridge/theme.d.ts +85 -0
  91. package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
  92. package/types/components/app-layout/types.d.ts +1 -1
  93. package/types/components/form/FormItem.vue.d.ts +12 -12
  94. package/types/components/form/FormItemNestForm.vue.d.ts +36 -0
  95. package/types/components/form/FormItemNestFormList.vue.d.ts +63 -0
  96. package/types/components/form/FormMain.vue.d.ts +2 -2
  97. package/types/components/form/FormSearch.vue.d.ts +2 -2
  98. package/types/components/form/FormTree.vue.d.ts +50 -50
  99. package/types/components/form/index.d.ts +9 -1
  100. package/types/components/form/nest-form-item-list.d.ts +63 -0
  101. package/types/components/form/nest-form-item.d.ts +36 -0
  102. package/types/components/form/nest-registry.d.ts +22 -0
  103. package/types/components/form/types.d.ts +2 -0
  104. package/types/components/form/use-nest-form-list.d.ts +20 -0
  105. package/types/components/form/use-nest-form.d.ts +26 -0
  106. package/types/components/form/use-nest-layout-scale.d.ts +17 -0
  107. package/types/components/form/utils.d.ts +26 -1
  108. package/types/components/menu/MenuTree.vue.d.ts +10 -10
  109. package/types/components/modal/ModalShelf.vue.d.ts +1 -1
  110. package/types/components/panel/PanelItemNestForm.vue.d.ts +35 -0
  111. package/types/components/panel/PanelItemNestPanel.vue.d.ts +22 -0
  112. package/types/components/panel/index.d.ts +5 -1
  113. package/types/components/panel/nest-panel-form.d.ts +38 -0
  114. package/types/components/panel/nest-panel-item.d.ts +28 -0
  115. package/types/components/panel/types.d.ts +2 -0
  116. package/types/components/table/TableMain.vue.d.ts +3 -3
  117. package/types/hooks/activated.d.ts +2 -2
  118. package/types/hooks/feel-size.d.ts +1 -1
  119. package/types/hooks/index.d.ts +2 -0
  120. package/types/hooks/menus-dispatch.d.ts +5 -5
  121. package/types/hooks/use-admin-theme-apply.d.ts +17 -0
  122. package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
  123. package/types/hooks/use-breakpoint.d.ts +1 -1
  124. package/types/inject/key.d.ts +46 -1
  125. package/types/store/app.d.ts +138 -59
  126. package/types/utils/index.d.ts +1 -0
  127. package/types/utils/theme-scale.d.ts +35 -0
@@ -1,10 +1,7 @@
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 p, normalizeStyle as E, unref as m, createVNode as k, withCtx as u, 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({
1
+ import { defineComponent as _, computed as r, watch as v, withDirectives as w, openBlock as a, createElementBlock as m, normalizeStyle as B, createVNode as b, unref as s, withCtx as c, Fragment as g, renderList as x, createBlock as y, createTextVNode as k, toDisplayString as E, vShow as F } from "vue";
2
+ import { useRoute as I } from "vue-router";
3
+ import { ElBreadcrumb as L, ElBreadcrumbItem as S } from "element-plus";
4
+ const N = /* @__PURE__ */ _({
8
5
  name: "AppBreadcrumb",
9
6
  __name: "AppBreadcrumb",
10
7
  props: {
@@ -12,46 +9,43 @@ const $ = /* @__PURE__ */ g({
12
9
  menuFlatList: {}
13
10
  },
14
11
  emits: ["show"],
15
- setup(i, { emit: l }) {
16
- const a = i, h = l, d = C(), c = o(() => d.matched.map((t) => a.menuFlatList.find(
17
- (e) => e.path === t.path
18
- )).filter((t) => t)), s = o(() => !!c.value.length), _ = o(() => ({
19
- height: `${a.height}px`
12
+ setup(l, { emit: i }) {
13
+ const o = l, p = i, h = I(), n = r(() => h.matched.map((e) => o.menuFlatList.find(
14
+ (t) => t.path === e.path
15
+ )).filter((e) => e)), u = r(() => !!n.value.length), d = r(() => ({
16
+ height: `${o.height}px`
20
17
  }));
21
- return x(
22
- s,
23
- (t) => {
24
- h("show", t);
18
+ return v(
19
+ u,
20
+ (e) => {
21
+ p("show", e);
25
22
  },
26
23
  {
27
24
  immediate: !0
28
25
  }
29
- ), (t, f) => {
30
- const e = w, B = b;
31
- return y((n(), p("div", {
32
- class: "app-breadcrumb",
33
- style: E(m(_))
34
- }, [
35
- k(B, { separator: "/" }, {
36
- default: u(() => [
37
- (n(!0), p(v, null, I(m(c), (r) => (n(), F(e, {
38
- key: r.path,
39
- to: r.path
40
- }, {
41
- default: u(() => [
42
- L(S(r.title), 1)
43
- ]),
44
- _: 2
45
- }, 1032, ["to"]))), 128))
46
- ]),
47
- _: 1
48
- })
49
- ], 4)), [
50
- [A, m(s)]
51
- ]);
52
- };
26
+ ), (e, f) => w((a(), m("div", {
27
+ class: "app-breadcrumb",
28
+ style: B(d.value)
29
+ }, [
30
+ b(s(L), { separator: "/" }, {
31
+ default: c(() => [
32
+ (a(!0), m(g, null, x(n.value, (t) => (a(), y(s(S), {
33
+ key: t.path,
34
+ to: t.path
35
+ }, {
36
+ default: c(() => [
37
+ k(E(t.title), 1)
38
+ ]),
39
+ _: 2
40
+ }, 1032, ["to"]))), 128))
41
+ ]),
42
+ _: 1
43
+ })
44
+ ], 4)), [
45
+ [F, u.value]
46
+ ]);
53
47
  }
54
48
  });
55
49
  export {
56
- $ as default
50
+ N as default
57
51
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AppFooter.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-393d9768"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-bba5d0e4"]]);
5
5
  export {
6
- _ as default
6
+ e as default
7
7
  };
@@ -1,17 +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({
1
+ import { defineComponent as r, inject as p, computed as n, openBlock as l, createElementBlock as s, normalizeStyle as a, createElementVNode as m } from "vue";
2
+ import { APP_LAYOUT_APP_STORE_KEY as c } from "../../inject/key.mjs";
3
+ const d = /* @__PURE__ */ r({
4
4
  __name: "AppFooter",
5
5
  setup(_) {
6
- const o = n(f), t = p(() => o.footerStyle);
7
- return (i, e) => (l(), s("div", {
6
+ const o = p(c), t = n(() => o.footerStyle);
7
+ return (f, e) => (l(), s("div", {
8
8
  class: "app-footer",
9
- style: m(a(t))
9
+ style: a(t.value)
10
10
  }, [...e[0] || (e[0] = [
11
- c("div", { class: "app-footer-shim" }, null, -1)
11
+ m("div", { class: "app-footer-shim" }, null, -1)
12
12
  ])], 4));
13
13
  }
14
14
  });
15
15
  export {
16
- S as default
16
+ d as default
17
17
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AppHeader.vue2.mjs";
2
2
  /* empty css */
3
3
  import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-ef3cc8a6"]]);
4
+ const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-b47543cd"]]);
5
5
  export {
6
6
  e as default
7
7
  };
@@ -1,12 +1,9 @@
1
- import { ElIcon as w, ElSwitch as E } 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 I, useCssVars as g, 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 = { class: "app-header-userInfo" }, ee = /* @__PURE__ */ I({
1
+ import { defineComponent as S, useCssVars as k, inject as h, computed as r, watch as w, nextTick as A, openBlock as a, createElementBlock as n, normalizeStyle as E, createElementVNode as c, renderSlot as v, normalizeClass as _, Fragment as B, renderList as I, createBlock as f, unref as $, withCtx as b, resolveDynamicComponent as L, createCommentVNode as y, toDisplayString as T, createVNode as V } from "vue";
2
+ import { useRouter as x } from "vue-router";
3
+ import { ElIcon as Y } from "element-plus";
4
+ import D from "./AppTheme.vue.mjs";
5
+ import { APP_LAYOUT_APP_STORE_KEY as N, APP_LAYOUT_BRIDGE_KEY as O } from "../../inject/key.mjs";
6
+ const R = { class: "app-header-shim" }, q = ["name", "onClick"], z = { class: "app-header-userInfo" }, J = /* @__PURE__ */ S({
10
7
  __name: "AppHeader",
11
8
  props: {
12
9
  show: { type: Boolean },
@@ -15,27 +12,30 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = { class: "a
15
12
  activeModuleMenu: {},
16
13
  menuFlatList: {}
17
14
  },
18
- setup(p) {
19
- g((e) => ({
20
- v3dfae5bc: o(u).baseColor,
21
- v158cd0d2: o(u).primaryColor
15
+ setup(u) {
16
+ k((t) => ({
17
+ ae6f6fe0: l.value.left,
18
+ v4782742c: l.value.top,
19
+ v70971b33: l.value.right,
20
+ fcf1a792: p.value.baseColor,
21
+ d3910988: p.value.primaryColor
22
22
  }));
23
- 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({
23
+ const s = u, d = h(N), C = h(O), p = r(() => C.themeColors.value), g = r(() => d.headerStyle), l = r(() => d.viewportPadding), M = x(), m = `app-header-module_${Math.random().toString(36).substring(2)}`, P = r(() => s.menus), i = r({
24
24
  get() {
25
- var e;
26
- return (e = c.activeModuleMenu) == null ? void 0 : e.path;
25
+ var t;
26
+ return (t = s.activeModuleMenu) == null ? void 0 : t.path;
27
27
  },
28
- set(e) {
29
- var a, n;
30
- ((n = (a = c.activeMenu) == null ? void 0 : a.parentPathList) == null ? void 0 : n[0]) !== e && k.push(e);
28
+ set(t) {
29
+ var o, e;
30
+ ((e = (o = s.activeMenu) == null ? void 0 : o.parentPathList) == null ? void 0 : e[0]) !== t && M.push(t);
31
31
  }
32
32
  });
33
- return V(
34
- l,
35
- (e) => {
36
- e && $(() => {
37
- var a, n;
38
- (n = (a = document.querySelector(`.${h}`)) == null ? void 0 : a.querySelector(`[name="${e}"]`)) == null || n.scrollIntoView({
33
+ return w(
34
+ i,
35
+ (t) => {
36
+ t && A(() => {
37
+ var o, e;
38
+ (e = (o = document.querySelector(`.${m}`)) == null ? void 0 : o.querySelector(`[name="${t}"]`)) == null || e.scrollIntoView({
39
39
  behavior: "smooth"
40
40
  });
41
41
  });
@@ -43,54 +43,45 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = { class: "a
43
43
  {
44
44
  immediate: !0
45
45
  }
46
- ), (e, a) => {
47
- const n = w, M = E;
48
- return r(), s("div", {
49
- class: "app-header",
50
- style: T(o(S))
51
- }, [
52
- d("div", O, [
53
- v(e.$slots, "left", {}, void 0, !0),
54
- o(C) ? (r(), s("div", {
55
- key: 0,
56
- class: _(["app-header-module", h])
46
+ ), (t, o) => (a(), n("div", {
47
+ class: "app-header",
48
+ style: E(g.value)
49
+ }, [
50
+ c("div", R, [
51
+ v(t.$slots, "left", {}, void 0, !0),
52
+ P.value ? (a(), n("div", {
53
+ key: 0,
54
+ class: _(["app-header-module", m])
55
+ }, [
56
+ (a(!0), n(B, null, I(u.menus, (e) => (a(), n("div", {
57
+ key: e.path,
58
+ name: e.path,
59
+ class: _([
60
+ "app-header-module-item",
61
+ i.value === e.path ? "app-header-module-item_active" : ""
62
+ ]),
63
+ onClick: (F) => i.value = e.path
57
64
  }, [
58
- (r(!0), s(b, null, x(p.menus, (t) => (r(), s("div", {
59
- key: t.path,
60
- name: t.path,
61
- class: _([
62
- "app-header-module-item",
63
- o(l) === t.path ? "app-header-module-item_active" : ""
65
+ e.menuIcon ? (a(), f($(Y), {
66
+ key: 0,
67
+ class: "app-header-module-item__icon"
68
+ }, {
69
+ default: b(() => [
70
+ (a(), f(L(e.menuIcon)))
64
71
  ]),
65
- onClick: (j) => l.value = t.path
66
- }, [
67
- t.menuIcon ? (r(), f(n, {
68
- key: 0,
69
- class: "app-header-module-item__icon"
70
- }, {
71
- default: A(() => [
72
- (r(), f(D(t.menuIcon)))
73
- ]),
74
- _: 2
75
- }, 1024)) : y("", !0),
76
- d("span", null, L(t.title), 1)
77
- ], 10, U))), 128))
78
- ])) : y("", !0),
79
- d("div", Y, [
80
- N(M, {
81
- "model-value": o(i).isDarkTheme,
82
- class: "app-header-userInfo__theme-switch",
83
- "active-action-icon": o(q),
84
- "inactive-action-icon": o(R),
85
- "onUpdate:modelValue": a[0] || (a[0] = (t) => o(i).changeIsDarkTheme(!!t))
86
- }, null, 8, ["model-value", "active-action-icon", "inactive-action-icon"]),
87
- v(e.$slots, "right", {}, void 0, !0)
88
- ])
72
+ _: 2
73
+ }, 1024)) : y("", !0),
74
+ c("span", null, T(e.title), 1)
75
+ ], 10, q))), 128))
76
+ ])) : y("", !0),
77
+ c("div", z, [
78
+ V(D),
79
+ v(t.$slots, "right", {}, void 0, !0)
89
80
  ])
90
- ], 4);
91
- };
81
+ ])
82
+ ], 4));
92
83
  }
93
84
  });
94
85
  export {
95
- ee as default
86
+ J as default
96
87
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AppLayout.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6924f8b7"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7aeee1b9"]]);
5
5
  export {
6
- f as default
6
+ r as default
7
7
  };
@@ -1,17 +1,17 @@
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 d, computed as n, watch as f, openBlock as E, createElementBlock as P, normalizeClass as B, unref as o, 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";
1
+ import { defineComponent as P, provide as p, computed as n, watch as c, openBlock as F, createElementBlock as T, normalizeClass as R, createVNode as r, unref as a, withCtx as o, renderSlot as u } from "vue";
2
+ import { ElWatermark as B } from "element-plus";
3
+ import { useRoute as E, useRouter as H } from "vue-router";
4
+ import y from "./AppBody.vue.mjs";
5
+ import C from "./AppHeader.vue.mjs";
7
6
  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({
7
+ import O from "./AppSidebar.vue.mjs";
8
+ import I from "../modal/ModalShelf.vue.mjs";
9
+ import { APP_LAYOUT_BRIDGE_KEY as Y, APP_LAYOUT_APP_STORE_KEY as $, APP_LAYOUT_USER_STORE_KEY as D } from "../../inject/key.mjs";
10
+ import { useAdminThemeApply as K } from "../../hooks/use-admin-theme-apply.mjs";
11
+ import { useAdminViewportApply as U } from "../../hooks/use-admin-viewport-apply.mjs";
12
+ import { flatRouteMetaResolveRaw as V } from "../../utils/router.mjs";
13
+ import { useMenusDataDispatch as z } from "../../hooks/menus-dispatch.mjs";
14
+ const re = /* @__PURE__ */ P({
15
15
  __name: "AppLayout",
16
16
  props: {
17
17
  adminBridge: {},
@@ -21,31 +21,36 @@ const te = /* @__PURE__ */ R({
21
21
  sidebarAboveHeader: { type: Boolean, default: !1 }
22
22
  },
23
23
  setup(m) {
24
- const t = m, h = {
24
+ const t = m, f = {
25
25
  color: "rgba(0,0,0,0.08)",
26
26
  fontSize: 12
27
27
  };
28
- d(K, t.adminBridge), d(O, t.appStore), d(U, t.userStore);
29
- const l = n(() => t.adminBridge.generateRouteMetaRawTree(
28
+ p(Y, t.adminBridge), p($, t.appStore), p(D, t.userStore), K({
29
+ getThemeConfig: () => t.adminBridge.APP_THEME_CONFIG,
30
+ getThemeIsDark: () => t.adminBridge.themeIsDark.value
31
+ }), U({
32
+ getViewportConfig: () => t.adminBridge.APP_LAYOUT_VIEWPORT_CONFIG
33
+ });
34
+ const d = n(() => t.adminBridge.generateRouteMetaRawTree(
30
35
  t.adminBridge.getRoutes(),
31
36
  {
32
37
  parentPath: "",
33
- filterFn: (e, i, p) => e.checkPermission ? e.menuShow && t.userStore.havePermissionByKey(e.permissionKey) : e.menuShow && (!p || i),
34
- sortFn: (e, i) => e.menuSort - i.menuSort
38
+ filterFn: (e, s, w) => e.checkPermission ? e.menuShow && t.userStore.havePermissionByKey(e.permissionKey) : e.menuShow && (!w || s),
39
+ sortFn: (e, s) => e.menuSort - s.menuSort
35
40
  }
36
- )), s = n(() => z(l.value)), {
37
- sidebarMenus: c,
38
- headerMenus: v,
39
- activeMenu: S,
40
- activeModuleMenu: _,
41
- needRedirectToFirstChildMenu: g
42
- } = D({
43
- getMenus: () => l.value,
44
- getMenuFlatList: () => s.value,
41
+ )), i = n(() => V(d.value)), {
42
+ sidebarMenus: l,
43
+ headerMenus: h,
44
+ activeMenu: v,
45
+ activeModuleMenu: g,
46
+ needRedirectToFirstChildMenu: S
47
+ } = z({
48
+ getMenus: () => d.value,
49
+ getMenuFlatList: () => i.value,
45
50
  getExtractLevel1ToHeader: () => t.appStore.extractLevel1ToHeader
46
- }), M = n(() => t.userStore.isLogin), L = n(() => t.appStore.showHeader), b = n(() => t.appStore.showSidebar);
47
- f(
48
- () => c.value.length,
51
+ }), _ = n(() => t.userStore.isLogin), A = n(() => t.appStore.showHeader), M = n(() => t.appStore.showSidebar);
52
+ c(
53
+ () => l.value.length,
49
54
  (e) => {
50
55
  t.appStore.changeSidebarHasMenusStatus(!!e);
51
56
  },
@@ -53,75 +58,72 @@ const te = /* @__PURE__ */ R({
53
58
  immediate: !0
54
59
  }
55
60
  );
56
- const w = C(), A = Y();
57
- return f(
58
- g,
61
+ const L = E(), b = H();
62
+ return c(
63
+ S,
59
64
  (e) => {
60
- e && (console.log(`${w.path}需要重定向到${e.path}`), A.replace(e.path));
65
+ e && (console.log(`${L.path}需要重定向到${e.path}`), b.replace(e.path));
61
66
  },
62
67
  {
63
68
  immediate: !0
64
69
  }
65
- ), (e, i) => {
66
- const p = F;
67
- return E(), P("div", {
68
- class: B(["app-layout", {
69
- "app-layout_noLogin": !o(M)
70
- }])
71
- }, [
72
- a(p, {
73
- content: m.watermarkContent,
74
- font: h,
75
- zIndex: 1e4
76
- }, {
77
- default: r(() => [
78
- a(o($), { level: "app" }, {
79
- default: r(() => [
80
- a(H, { menuFlatList: o(s) }, {
81
- footer: r(() => [
82
- a(k)
83
- ]),
84
- _: 1
85
- }, 8, ["menuFlatList"]),
86
- a(y, {
87
- show: o(b),
88
- aboveHeader: m.sidebarAboveHeader,
89
- menus: o(c),
90
- menuFlatList: o(s)
91
- }, {
92
- top: r(() => [
93
- u(e.$slots, "sidebar-top", {}, void 0, !0)
94
- ]),
95
- bottom: r(() => [
96
- u(e.$slots, "sidebar-bottom", {}, void 0, !0)
97
- ]),
98
- _: 3
99
- }, 8, ["show", "aboveHeader", "menus", "menuFlatList"]),
100
- a(T, {
101
- show: o(L),
102
- menus: o(v),
103
- activeMenu: o(S),
104
- activeModuleMenu: o(_),
105
- menuFlatList: o(s)
106
- }, {
107
- left: r(() => [
108
- u(e.$slots, "header-left", {}, void 0, !0)
109
- ]),
110
- right: r(() => [
111
- u(e.$slots, "header-right", {}, void 0, !0)
112
- ]),
113
- _: 3
114
- }, 8, ["show", "menus", "activeMenu", "activeModuleMenu", "menuFlatList"])
115
- ]),
116
- _: 3
117
- })
118
- ]),
119
- _: 3
120
- }, 8, ["content"])
121
- ], 2);
122
- };
70
+ ), (e, s) => (F(), T("div", {
71
+ class: R(["app-layout", {
72
+ "app-layout_noLogin": !_.value
73
+ }])
74
+ }, [
75
+ r(a(B), {
76
+ content: m.watermarkContent,
77
+ font: f,
78
+ zIndex: 1e4
79
+ }, {
80
+ default: o(() => [
81
+ r(a(I), { level: "app" }, {
82
+ default: o(() => [
83
+ r(y, { menuFlatList: i.value }, {
84
+ footer: o(() => [
85
+ r(k)
86
+ ]),
87
+ _: 1
88
+ }, 8, ["menuFlatList"]),
89
+ r(O, {
90
+ show: M.value,
91
+ aboveHeader: m.sidebarAboveHeader,
92
+ menus: a(l),
93
+ menuFlatList: i.value
94
+ }, {
95
+ top: o(() => [
96
+ u(e.$slots, "sidebar-top", {}, void 0, !0)
97
+ ]),
98
+ bottom: o(() => [
99
+ u(e.$slots, "sidebar-bottom", {}, void 0, !0)
100
+ ]),
101
+ _: 3
102
+ }, 8, ["show", "aboveHeader", "menus", "menuFlatList"]),
103
+ r(C, {
104
+ show: A.value,
105
+ menus: a(h),
106
+ activeMenu: a(v),
107
+ activeModuleMenu: a(g),
108
+ menuFlatList: i.value
109
+ }, {
110
+ left: o(() => [
111
+ u(e.$slots, "header-left", {}, void 0, !0)
112
+ ]),
113
+ right: o(() => [
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));
123
125
  }
124
126
  });
125
127
  export {
126
- te as default
128
+ re as default
127
129
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AppSidebar.vue2.mjs";
2
2
  /* empty css */
3
3
  import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const a = /* @__PURE__ */ p(o, [["__scopeId", "data-v-37ff5e0c"]]);
4
+ const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-2499f12e"]]);
5
5
  export {
6
- a as default
6
+ e as default
7
7
  };