@done-coding/admin-core 0.8.3-alpha.0 → 0.9.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 (89) hide show
  1. package/es/bridge/config-hook.mjs +37 -0
  2. package/es/bridge/index.mjs +157 -62
  3. package/es/bridge/plugin.mjs +29 -0
  4. package/es/bridge/theme.mjs +62 -0
  5. package/es/components/app-layout/AppBody.vue.mjs +1 -1
  6. package/es/components/app-layout/AppBody.vue2.mjs +47 -49
  7. package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
  8. package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
  9. package/es/components/app-layout/AppFooter.vue.mjs +2 -2
  10. package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
  11. package/es/components/app-layout/AppHeader.vue.mjs +1 -1
  12. package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
  13. package/es/components/app-layout/AppLayout.vue.mjs +2 -2
  14. package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
  15. package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
  16. package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
  17. package/es/components/app-layout/AppTheme.vue.mjs +7 -0
  18. package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
  19. package/es/components/data-view/DataListView.vue.mjs +2 -2
  20. package/es/components/data-view/DataListView.vue2.mjs +36 -36
  21. package/es/components/display/ActionConfirm.vue2.mjs +16 -16
  22. package/es/components/display/HeightProvider.vue.mjs +10 -10
  23. package/es/components/display/TabsHeader.vue.mjs +4 -4
  24. package/es/components/display/TabsHeader.vue2.mjs +34 -34
  25. package/es/components/display/TabsMain.vue.mjs +40 -39
  26. package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
  27. package/es/components/form/FormItem.vue.mjs +1 -1
  28. package/es/components/form/FormItem.vue2.mjs +75 -81
  29. package/es/components/form/FormMain.vue.mjs +81 -88
  30. package/es/components/form/FormRadioGroup.vue.mjs +42 -49
  31. package/es/components/form/FormSearch.vue.mjs +1 -1
  32. package/es/components/form/FormSearch.vue2.mjs +116 -123
  33. package/es/components/form/FormSelect.vue.mjs +34 -40
  34. package/es/components/form/FormSubmitBtn.vue.mjs +23 -28
  35. package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
  36. package/es/components/form/FormSubmitPanel.vue2.mjs +16 -16
  37. package/es/components/form/FormTree.vue.mjs +16 -21
  38. package/es/components/form/FormVerifyCode.vue.mjs +37 -43
  39. package/es/components/form/FormVerifyImage.vue.mjs +2 -2
  40. package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
  41. package/es/components/list-page/ListPage.vue.mjs +2 -2
  42. package/es/components/list-page/ListPage.vue2.mjs +134 -139
  43. package/es/components/menu/MenuItemSub.vue.mjs +41 -48
  44. package/es/components/menu/MenuTree.vue.mjs +58 -65
  45. package/es/components/misc/AutoRefresh.vue.mjs +2 -2
  46. package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
  47. package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
  48. package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
  49. package/es/components/modal/ConfirmModal.vue.mjs +3 -3
  50. package/es/components/modal/ConfirmModal.vue2.mjs +93 -100
  51. package/es/components/modal/DetailModal.vue.mjs +38 -41
  52. package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
  53. package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
  54. package/es/components/panel/PanelMain.vue.mjs +2 -2
  55. package/es/components/panel/PanelMain.vue2.mjs +67 -74
  56. package/es/components/table/TableMain.vue.mjs +2 -2
  57. package/es/components/table/TableMain.vue2.mjs +221 -229
  58. package/es/components/table/TableToolbar.vue.mjs +2 -2
  59. package/es/components/table/TableToolbar.vue2.mjs +115 -126
  60. package/es/hooks/use-admin-theme-apply.mjs +84 -0
  61. package/es/hooks/use-admin-viewport-apply.mjs +27 -0
  62. package/es/index.mjs +125 -117
  63. package/es/inject/key.mjs +7 -4
  64. package/es/store/app.mjs +75 -84
  65. package/es/style.css +1 -1
  66. package/es/utils/theme-scale.mjs +37 -0
  67. package/package.json +2 -4
  68. package/types/bridge/config-hook.d.ts +91 -0
  69. package/types/bridge/index.d.ts +108 -8
  70. package/types/bridge/plugin.d.ts +39 -0
  71. package/types/bridge/theme.d.ts +66 -0
  72. package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
  73. package/types/components/app-layout/types.d.ts +1 -1
  74. package/types/components/form/FormItem.vue.d.ts +12 -12
  75. package/types/components/form/FormTree.vue.d.ts +50 -50
  76. package/types/components/menu/MenuTree.vue.d.ts +10 -10
  77. package/types/components/modal/ModalShelf.vue.d.ts +1 -1
  78. package/types/components/table/TableMain.vue.d.ts +1 -1
  79. package/types/hooks/activated.d.ts +2 -2
  80. package/types/hooks/feel-size.d.ts +1 -1
  81. package/types/hooks/index.d.ts +2 -0
  82. package/types/hooks/menus-dispatch.d.ts +5 -5
  83. package/types/hooks/use-admin-theme-apply.d.ts +17 -0
  84. package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
  85. package/types/hooks/use-breakpoint.d.ts +1 -1
  86. package/types/inject/key.d.ts +18 -0
  87. package/types/store/app.d.ts +138 -59
  88. package/types/utils/index.d.ts +1 -0
  89. package/types/utils/theme-scale.d.ts +35 -0
@@ -1,9 +1,7 @@
1
- import { ElLoadingDirective as de } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/loading/style/css";
4
- import { defineComponent as ve, useCssVars as me, unref as a, useSlots as pe, computed as o, useModel as w, ref as u, shallowRef as q, watch as we, withDirectives as Se, openBlock as S, createElementBlock as ye, createBlock as x, withCtx as h, renderSlot as f, createCommentVNode as E, createVNode as L, mergeProps as y, createSlots as N, renderList as C, normalizeProps as b, guardReactiveProps as H, mergeModels as U } from "vue";
1
+ import { defineComponent as ge, useCssVars as de, useSlots as me, computed as a, useModel as p, ref as i, shallowRef as q, watch as pe, withDirectives as we, openBlock as w, createElementBlock as Se, createBlock as x, unref as v, withCtx as c, renderSlot as h, createCommentVNode as L, createVNode as E, mergeProps as S, createSlots as N, renderList as y, normalizeProps as C, guardReactiveProps as H, mergeModels as U } from "vue";
2
+ import { vLoading as ye } from "element-plus";
5
3
  import Ce from "../form/FormSearch.vue.mjs";
6
- import { generateFormData as be, stringifyFormData as He } from "../form/utils.mjs";
4
+ import { generateFormData as He, stringifyFormData as be } from "../form/utils.mjs";
7
5
  import J from "../display/WatchSize.vue.mjs";
8
6
  import Ve from "../table/TableMain.vue.mjs";
9
7
  import Ie from "lodash/pick";
@@ -12,7 +10,7 @@ import { useChannelViewportHeight as Me } from "../../hooks/use-channel-viewport
12
10
  const ke = {
13
11
  "element-loading-background": "rgba(122, 122, 122, 0.5)",
14
12
  class: "list-page"
15
- }, xe = /* @__PURE__ */ ve({
13
+ }, Te = /* @__PURE__ */ ge({
16
14
  __name: "ListPage",
17
15
  props: /* @__PURE__ */ U({
18
16
  staticQuery: { default: () => ({}) },
@@ -41,200 +39,197 @@ const ke = {
41
39
  customViewModifiers: {}
42
40
  }),
43
41
  emits: /* @__PURE__ */ U(["dataChange", "pageInfoChange"], ["update:isAutoRefresh", "update:refreshInterval", "update:customView"]),
44
- setup(s, { expose: Q, emit: z }) {
45
- me((e) => ({
46
- v9299b0d4: a(_)
42
+ setup(o, { expose: Q, emit: z }) {
43
+ de((e) => ({
44
+ c6e708aa: _.value
47
45
  }));
48
- const n = s, V = z, I = pe(), R = o(() => !!I.header), M = o(() => !!I.operation), v = w(s, "isAutoRefresh"), k = w(s, "refreshInterval"), $ = w(s, "customView"), m = u({}), p = u(
46
+ const s = o, b = z, V = me(), I = a(() => !!V.header), R = a(() => !!V.operation), g = p(o, "isAutoRefresh"), M = p(o, "refreshInterval"), k = p(o, "customView"), d = i({}), m = i(
49
47
  {}
50
- ), D = u(!1), i = q(), c = q(), { viewportHeightFinal: G } = Me(n, {
48
+ ), $ = i(!1), n = q(), u = q(), { viewportHeightFinal: G } = Me(s, {
51
49
  fallback: 500
52
- }), F = u(0), P = u(0), j = u(0), W = o(() => ({
53
- ...p.value,
54
- ...n.staticQuery
55
- })), A = u(!1), X = o(() => A.value ? F.value + 10 : 0), Y = o(() => M.value ? P.value + 10 : 0), Z = o(() => R.value ? j.value + 10 : 0), B = o(() => G.value - n.refineReduceHeight), _ = o(() => n.refine ? `${B.value}px` : "auto"), ee = o(() => n.refine ? B.value - X.value - Y.value - Z.value : void 0), K = (e, t = "search") => {
56
- var r, l, d;
57
- let g = e;
58
- if (n.beforeSearch && (g = n.beforeSearch(
50
+ }), F = i(0), P = i(0), j = i(0), W = a(() => ({
51
+ ...m.value,
52
+ ...s.staticQuery
53
+ })), A = i(!1), X = a(() => A.value ? F.value + 10 : 0), Y = a(() => R.value ? P.value + 10 : 0), Z = a(() => I.value ? j.value + 10 : 0), D = a(() => G.value - s.refineReduceHeight), _ = a(() => s.refine ? `${D.value}px` : "auto"), ee = a(() => s.refine ? D.value - X.value - Y.value - Z.value : void 0), B = (e, t = "search") => {
54
+ var l, f, T;
55
+ let r = e;
56
+ if (s.beforeSearch && (r = s.beforeSearch(
59
57
  Re(e),
60
58
  t
61
- )), t === "reset" && n.clearTableFilterOnReset && ((l = (r = c.value) == null ? void 0 : r.getTableInstance()) == null || l.clearFilter()), JSON.stringify(g) === JSON.stringify(p.value))
62
- return ["reset", "search"].includes(t) ? (d = c.value) == null ? void 0 : d.reload() : void 0;
63
- p.value = {
64
- ...g
59
+ )), t === "reset" && s.clearTableFilterOnReset && ((f = (l = u.value) == null ? void 0 : l.getTableInstance()) == null || f.clearFilter()), JSON.stringify(r) === JSON.stringify(m.value))
60
+ return ["reset", "search"].includes(t) ? (T = u.value) == null ? void 0 : T.reload() : void 0;
61
+ m.value = {
62
+ ...r
65
63
  };
66
64
  }, te = (e) => {
67
- V("dataChange", e);
65
+ b("dataChange", e);
68
66
  }, re = (e) => {
69
- V("pageInfoChange", e);
67
+ b("pageInfoChange", e);
70
68
  }, ae = (e) => {
71
- D.value = e;
69
+ $.value = e;
72
70
  }, oe = (e) => {
73
71
  F.value = e;
74
72
  }, se = (e) => {
75
73
  P.value = e;
76
74
  }, ne = (e) => {
77
75
  j.value = e;
78
- }, ie = o(() => n.list), le = o(() => n.rowKey), O = o(() => m.value), T = {
76
+ }, le = a(() => s.list), ie = a(() => s.rowKey), K = a(() => d.value), O = {
79
77
  refresh: async (e = !1) => {
80
78
  var t;
81
- return (t = c.value) == null ? void 0 : t.refresh(e);
79
+ return (t = u.value) == null ? void 0 : t.refresh(e);
82
80
  },
83
81
  reload: async (e = !1) => {
84
82
  var t;
85
- return (t = c.value) == null ? void 0 : t.reload(e);
83
+ return (t = u.value) == null ? void 0 : t.reload(e);
86
84
  },
87
85
  getTableInstance: () => {
88
86
  var e;
89
- return (e = c.value) == null ? void 0 : e.getTableInstance();
87
+ return (e = u.value) == null ? void 0 : e.getTableInstance();
90
88
  },
91
89
  validate: () => {
92
- if (i.value)
93
- return i.value.validate();
90
+ if (n.value)
91
+ return n.value.validate();
94
92
  throw new Error("实例化未完成");
95
93
  },
96
94
  resetFields: () => {
97
95
  var e;
98
- return (e = i.value) == null ? void 0 : e.resetFields();
96
+ return (e = n.value) == null ? void 0 : e.resetFields();
99
97
  },
100
98
  clearValidate: (e) => {
101
99
  var t;
102
- return (t = i.value) == null ? void 0 : t.clearValidate(e);
100
+ return (t = n.value) == null ? void 0 : t.clearValidate(e);
103
101
  },
104
102
  triggerReset: () => {
105
103
  var e;
106
- return (e = i.value) == null ? void 0 : e.triggerReset();
104
+ return (e = n.value) == null ? void 0 : e.triggerReset();
107
105
  },
108
106
  triggerSearch: () => {
109
107
  var e;
110
- return (e = i.value) == null ? void 0 : e.triggerSearch();
108
+ return (e = n.value) == null ? void 0 : e.triggerSearch();
111
109
  },
112
110
  toggleCollapse: (e) => {
113
111
  var t;
114
- return (t = i.value) == null ? void 0 : t.toggleCollapse(e);
112
+ return (t = n.value) == null ? void 0 : t.toggleCollapse(e);
115
113
  },
116
- isCollapsed: o(() => {
114
+ isCollapsed: a(() => {
117
115
  var e;
118
- return ((e = i.value) == null ? void 0 : e.isCollapsed.value) ?? !1;
116
+ return ((e = n.value) == null ? void 0 : e.isCollapsed.value) ?? !1;
119
117
  }),
120
118
  update: (e, t) => {
121
- m.value[e] = t;
119
+ d.value[e] = t;
122
120
  }
123
- }, ue = o(() => {
124
- const e = Ie(T, [
121
+ }, ue = a(() => {
122
+ const e = Ie(O, [
125
123
  "triggerReset",
126
124
  "triggerSearch",
127
125
  "update"
128
126
  ]);
129
127
  return {
130
- ...n.injectInfo || {},
128
+ ...s.injectInfo || {},
131
129
  ...e
132
130
  };
133
- }), ce = (e) => e, he = (e) => e, fe = (e) => e, ge = (e) => {
131
+ }), ce = (e) => e, he = (e) => e, fe = (e) => e, ve = (e) => {
134
132
  A.value = e;
135
133
  };
136
- return Q(T), we(
137
- () => n.list,
134
+ return Q(O), pe(
135
+ () => s.list,
138
136
  (e) => {
139
- const t = be(e);
140
- m.value = t, K(He(t, e));
137
+ const t = He(e);
138
+ d.value = t, B(be(t, e));
141
139
  },
142
140
  {
143
141
  immediate: !0
144
142
  }
145
- ), (e, t) => {
146
- const g = de;
147
- return Se((S(), ye("div", ke, [
148
- a(R) ? (S(), x(a(J), {
149
- key: 0,
150
- class: "list-page-header",
151
- onHeightChange: ne
152
- }, {
153
- default: h(() => [
154
- f(e.$slots, "header", {}, void 0, !0)
155
- ]),
156
- _: 3
157
- })) : E("", !0),
158
- L(a(Ce), y({
159
- ref_key: "formSearch",
160
- ref: i,
161
- list: a(ie),
162
- data: a(O)
163
- }, s.formSearchProps, {
164
- onSearch: K,
165
- onHeightChange: oe,
166
- onVisibleChange: ge
167
- }), N({ _: 2 }, [
168
- C(s.list, (r) => ({
169
- name: r.key,
170
- fn: h((l) => [
171
- f(e.$slots, `form-${r.key}`, b(H(l)), void 0, !0)
172
- ])
173
- }))
174
- ]), 1040, ["list", "data"]),
175
- a(M) ? (S(), x(a(J), {
176
- key: 1,
177
- class: "list-page-operation",
178
- onHeightChange: se
179
- }, {
180
- default: h(() => [
181
- f(e.$slots, "operation", {}, void 0, !0)
182
- ]),
183
- _: 3
184
- })) : E("", !0),
185
- L(a(Ve), y({
186
- ref_key: "tableMain",
187
- ref: c,
188
- "is-auto-refresh": v.value,
189
- "onUpdate:isAutoRefresh": t[0] || (t[0] = (r) => v.value = r),
190
- "refresh-interval": k.value,
191
- "onUpdate:refreshInterval": t[1] || (t[1] = (r) => k.value = r),
192
- "custom-view": $.value,
193
- "onUpdate:customView": t[2] || (t[2] = (r) => $.value = r),
194
- api: s.api,
195
- columns: s.columns,
196
- query: a(W),
197
- maxHeight: a(ee),
198
- rowKey: a(le),
199
- toolbar: s.toolbar,
200
- showSwitchView: s.showSwitchView
201
- }, s.tableMainProps, {
202
- refine: !1,
203
- injectInfo: a(ue),
204
- onLoadingChange: ae,
205
- onDataChange: te,
206
- onPageInfoChange: re
207
- }), N({
208
- "custom-view-item": h((r) => [
209
- f(e.$slots, "custom-view-item", b(H(fe(r))), void 0, !0)
210
- ]),
211
- _: 2
212
- }, [
213
- C(s.columns, (r) => ({
214
- name: r.prop,
215
- fn: h((l) => [
216
- f(e.$slots, `table-${r.prop}`, b(H(ce(l))), void 0, !0)
217
- ])
218
- })),
219
- C(s.columns, (r) => ({
220
- name: `header-${r.prop}`,
221
- fn: h((l) => {
222
- var d;
223
- return [
224
- f(e.$slots, `table-header-${r.columnKey || r.prop}`, y(he(l), {
225
- searchFormData: a(O),
226
- triggerSearch: (d = a(i)) == null ? void 0 : d.triggerSearch
227
- }), void 0, !0)
228
- ];
229
- })
230
- }))
231
- ]), 1040, ["is-auto-refresh", "refresh-interval", "custom-view", "api", "columns", "query", "maxHeight", "rowKey", "toolbar", "showSwitchView", "injectInfo"])
232
- ])), [
233
- [g, !v.value && a(D)]
234
- ]);
235
- };
143
+ ), (e, t) => we((w(), Se("div", ke, [
144
+ I.value ? (w(), x(v(J), {
145
+ key: 0,
146
+ class: "list-page-header",
147
+ onHeightChange: ne
148
+ }, {
149
+ default: c(() => [
150
+ h(e.$slots, "header", {}, void 0, !0)
151
+ ]),
152
+ _: 3
153
+ })) : L("", !0),
154
+ E(v(Ce), S({
155
+ ref_key: "formSearch",
156
+ ref: n,
157
+ list: le.value,
158
+ data: K.value
159
+ }, o.formSearchProps, {
160
+ onSearch: B,
161
+ onHeightChange: oe,
162
+ onVisibleChange: ve
163
+ }), N({ _: 2 }, [
164
+ y(o.list, (r) => ({
165
+ name: r.key,
166
+ fn: c((l) => [
167
+ h(e.$slots, `form-${r.key}`, C(H(l)), void 0, !0)
168
+ ])
169
+ }))
170
+ ]), 1040, ["list", "data"]),
171
+ R.value ? (w(), x(v(J), {
172
+ key: 1,
173
+ class: "list-page-operation",
174
+ onHeightChange: se
175
+ }, {
176
+ default: c(() => [
177
+ h(e.$slots, "operation", {}, void 0, !0)
178
+ ]),
179
+ _: 3
180
+ })) : L("", !0),
181
+ E(v(Ve), S({
182
+ ref_key: "tableMain",
183
+ ref: u,
184
+ "is-auto-refresh": g.value,
185
+ "onUpdate:isAutoRefresh": t[0] || (t[0] = (r) => g.value = r),
186
+ "refresh-interval": M.value,
187
+ "onUpdate:refreshInterval": t[1] || (t[1] = (r) => M.value = r),
188
+ "custom-view": k.value,
189
+ "onUpdate:customView": t[2] || (t[2] = (r) => k.value = r),
190
+ api: o.api,
191
+ columns: o.columns,
192
+ query: W.value,
193
+ maxHeight: ee.value,
194
+ rowKey: ie.value,
195
+ toolbar: o.toolbar,
196
+ showSwitchView: o.showSwitchView
197
+ }, o.tableMainProps, {
198
+ refine: !1,
199
+ injectInfo: ue.value,
200
+ onLoadingChange: ae,
201
+ onDataChange: te,
202
+ onPageInfoChange: re
203
+ }), N({
204
+ "custom-view-item": c((r) => [
205
+ h(e.$slots, "custom-view-item", C(H(fe(r))), void 0, !0)
206
+ ]),
207
+ _: 2
208
+ }, [
209
+ y(o.columns, (r) => ({
210
+ name: r.prop,
211
+ fn: c((l) => [
212
+ h(e.$slots, `table-${r.prop}`, C(H(ce(l))), void 0, !0)
213
+ ])
214
+ })),
215
+ y(o.columns, (r) => ({
216
+ name: `header-${r.prop}`,
217
+ fn: c((l) => {
218
+ var f;
219
+ return [
220
+ h(e.$slots, `table-header-${r.columnKey || r.prop}`, S(he(l), {
221
+ searchFormData: K.value,
222
+ triggerSearch: (f = n.value) == null ? void 0 : f.triggerSearch
223
+ }), void 0, !0)
224
+ ];
225
+ })
226
+ }))
227
+ ]), 1040, ["is-auto-refresh", "refresh-interval", "custom-view", "api", "columns", "query", "maxHeight", "rowKey", "toolbar", "showSwitchView", "injectInfo"])
228
+ ])), [
229
+ [v(ye), !g.value && $.value]
230
+ ]);
236
231
  }
237
232
  });
238
233
  export {
239
- xe as default
234
+ Te as default
240
235
  };
@@ -1,60 +1,53 @@
1
- import { ElSubMenu as p, ElMenuItem as M, ElIcon as S } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/sub-menu/style/css";
4
- import "element-plus/es/components/menu-item/style/css";
5
- import "element-plus/es/components/icon/style/css";
6
- import { defineComponent as b, openBlock as e, createBlock as u, withCtx as m, createElementBlock as l, Fragment as c, renderList as h, unref as k, resolveDynamicComponent as r, createCommentVNode as a, createElementVNode as i, toDisplayString as d } from "vue";
7
- const D = /* @__PURE__ */ b({
1
+ import { defineComponent as f, openBlock as e, createBlock as t, unref as l, withCtx as m, createElementBlock as a, Fragment as r, renderList as h, resolveDynamicComponent as c, createCommentVNode as o, createElementVNode as d, toDisplayString as i } from "vue";
2
+ import { ElSubMenu as k, ElMenuItem as M, ElIcon as I } from "element-plus";
3
+ const E = /* @__PURE__ */ f({
8
4
  __name: "MenuItemSub",
9
5
  props: {
10
6
  menu: {},
11
7
  MenuItemSub: {}
12
8
  },
13
9
  setup(n) {
14
- return (E, s) => {
15
- const o = S, I = M, f = p;
16
- return e(), u(f, {
17
- index: n.menu.path
18
- }, {
19
- title: m(() => [
20
- n.menu.menuIcon ? (e(), u(o, { key: 0 }, {
10
+ return (S, b) => (e(), t(l(k), {
11
+ index: n.menu.path
12
+ }, {
13
+ title: m(() => [
14
+ n.menu.menuIcon ? (e(), t(l(I), { key: 0 }, {
15
+ default: m(() => [
16
+ (e(), t(c(n.menu.menuIcon)))
17
+ ]),
18
+ _: 1
19
+ })) : o("", !0),
20
+ d("span", null, i(n.menu.title), 1)
21
+ ]),
22
+ default: m(() => [
23
+ (e(!0), a(r, null, h(n.menu.children, (u) => (e(), a(r, {
24
+ key: u.path
25
+ }, [
26
+ u.children.length ? (e(), t(l(n.MenuItemSub), {
27
+ key: 0,
28
+ menu: u,
29
+ MenuItemSub: n.MenuItemSub
30
+ }, null, 8, ["menu", "MenuItemSub"])) : (e(), t(l(M), {
31
+ key: 1,
32
+ index: u.path
33
+ }, {
21
34
  default: m(() => [
22
- (e(), u(r(n.menu.menuIcon)))
35
+ u.menuIcon ? (e(), t(l(I), { key: 0 }, {
36
+ default: m(() => [
37
+ (e(), t(c(u.menuIcon)))
38
+ ]),
39
+ _: 2
40
+ }, 1024)) : o("", !0),
41
+ d("span", null, i(u.title), 1)
23
42
  ]),
24
- _: 1
25
- })) : a("", !0),
26
- i("span", null, d(n.menu.title), 1)
27
- ]),
28
- default: m(() => [
29
- (e(!0), l(c, null, h(n.menu.children, (t) => (e(), l(c, {
30
- key: t.path
31
- }, [
32
- t.children.length ? (e(), u(k(n.MenuItemSub), {
33
- key: 0,
34
- menu: t,
35
- MenuItemSub: n.MenuItemSub
36
- }, null, 8, ["menu", "MenuItemSub"])) : (e(), u(I, {
37
- key: 1,
38
- index: t.path
39
- }, {
40
- default: m(() => [
41
- t.menuIcon ? (e(), u(o, { key: 0 }, {
42
- default: m(() => [
43
- (e(), u(r(t.menuIcon)))
44
- ]),
45
- _: 2
46
- }, 1024)) : a("", !0),
47
- i("span", null, d(t.title), 1)
48
- ]),
49
- _: 2
50
- }, 1032, ["index"]))
51
- ], 64))), 128))
52
- ]),
53
- _: 1
54
- }, 8, ["index"]);
55
- };
43
+ _: 2
44
+ }, 1032, ["index"]))
45
+ ], 64))), 128))
46
+ ]),
47
+ _: 1
48
+ }, 8, ["index"]));
56
49
  }
57
50
  });
58
51
  export {
59
- D as default
52
+ E as default
60
53
  };
@@ -1,12 +1,8 @@
1
- import { ElMenu as I, ElMenuItem as B, ElIcon as C } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/menu/style/css";
4
- import "element-plus/es/components/menu-item/style/css";
5
- import "element-plus/es/components/icon/style/css";
6
- import { defineComponent as P, ref as v, useAttrs as x, computed as g, openBlock as l, createBlock as c, mergeProps as L, unref as S, withCtx as m, createElementBlock as d, Fragment as h, renderList as w, resolveDynamicComponent as A, createCommentVNode as D, createElementVNode as F, toDisplayString as N } from "vue";
7
- import _ from "./MenuItemSub.vue.mjs";
8
- import { useRoute as R } from "vue-router";
9
- const H = /* @__PURE__ */ P({
1
+ import { defineComponent as E, ref as P, useAttrs as _, computed as x, openBlock as r, createBlock as a, unref as p, mergeProps as I, withCtx as f, createElementBlock as h, Fragment as y, renderList as g, resolveDynamicComponent as L, createCommentVNode as S, createElementVNode as w, toDisplayString as A } from "vue";
2
+ import M from "./MenuItemSub.vue.mjs";
3
+ import { useRoute as D } from "vue-router";
4
+ import { ElMenu as F, ElMenuItem as N, ElIcon as R } from "element-plus";
5
+ const j = /* @__PURE__ */ E({
10
6
  __name: "MenuTree",
11
7
  props: {
12
8
  menus: {},
@@ -15,73 +11,70 @@ const H = /* @__PURE__ */ P({
15
11
  collapse: { type: Boolean },
16
12
  autoClose: { type: Boolean }
17
13
  },
18
- setup(s, { expose: M }) {
19
- const p = s, u = v(), y = R(), i = x(), E = g(() => p.routerMode ? {
14
+ setup(l, { expose: k }) {
15
+ const c = l, u = P(), v = D(), i = _(), B = x(() => c.routerMode ? {
20
16
  ...i,
21
- defaultActive: y.path
17
+ defaultActive: v.path
22
18
  } : i);
23
- M({
19
+ k({
24
20
  open: (o) => {
25
- var e;
26
- return (e = u.value) == null ? void 0 : e.open(o);
21
+ var t;
22
+ return (t = u.value) == null ? void 0 : t.open(o);
27
23
  },
28
24
  close: (o) => {
29
- var e;
30
- return (e = u.value) == null ? void 0 : e.close(o);
25
+ var t;
26
+ return (t = u.value) == null ? void 0 : t.close(o);
31
27
  }
32
28
  });
33
- const f = (o, e, r) => {
34
- const n = e.find((a) => a.path === o);
35
- return n != null && n.parentPath ? (r.unshift(n.parentPath), f(n.parentPath, e, r)) : r;
36
- }, k = (o) => {
37
- const { autoClose: e } = p;
38
- if (e) {
39
- const { menuFlatList: r } = p, n = f(o, r, [o]);
40
- r.forEach((a) => {
41
- var t;
42
- n.includes(a.path) || (t = u.value) == null || t.close(a.path);
29
+ const m = (o, t, e) => {
30
+ const n = t.find((s) => s.path === o);
31
+ return n != null && n.parentPath ? (e.unshift(n.parentPath), m(n.parentPath, t, e)) : e;
32
+ }, C = (o) => {
33
+ const { autoClose: t } = c;
34
+ if (t) {
35
+ const { menuFlatList: e } = c, n = m(o, e, [o]);
36
+ e.forEach((s) => {
37
+ var d;
38
+ n.includes(s.path) || (d = u.value) == null || d.close(s.path);
43
39
  });
44
40
  }
45
41
  };
46
- return (o, e) => {
47
- const r = C, n = B, a = I;
48
- return l(), c(a, L(S(E), {
49
- ref_key: "elMenu",
50
- ref: u,
51
- collapse: s.collapse,
52
- router: s.routerMode,
53
- onSelect: k
54
- }), {
55
- default: m(() => [
56
- (l(!0), d(h, null, w(s.menus, (t) => (l(), d(h, {
57
- key: t.path
58
- }, [
59
- t.children.length ? (l(), c(_, {
60
- key: 0,
61
- menu: t,
62
- MenuItemSub: _
63
- }, null, 8, ["menu"])) : (l(), c(n, {
64
- key: 1,
65
- index: t.path
66
- }, {
67
- default: m(() => [
68
- t.menuIcon ? (l(), c(r, { key: 0 }, {
69
- default: m(() => [
70
- (l(), c(A(t.menuIcon)))
71
- ]),
72
- _: 2
73
- }, 1024)) : D("", !0),
74
- F("span", null, N(t.title), 1)
75
- ]),
76
- _: 2
77
- }, 1032, ["index"]))
78
- ], 64))), 128))
79
- ]),
80
- _: 1
81
- }, 16, ["collapse", "router"]);
82
- };
42
+ return (o, t) => (r(), a(p(F), I(B.value, {
43
+ ref_key: "elMenu",
44
+ ref: u,
45
+ collapse: l.collapse,
46
+ router: l.routerMode,
47
+ onSelect: C
48
+ }), {
49
+ default: f(() => [
50
+ (r(!0), h(y, null, g(l.menus, (e) => (r(), h(y, {
51
+ key: e.path
52
+ }, [
53
+ e.children.length ? (r(), a(M, {
54
+ key: 0,
55
+ menu: e,
56
+ MenuItemSub: M
57
+ }, null, 8, ["menu"])) : (r(), a(p(N), {
58
+ key: 1,
59
+ index: e.path
60
+ }, {
61
+ default: f(() => [
62
+ e.menuIcon ? (r(), a(p(R), { key: 0 }, {
63
+ default: f(() => [
64
+ (r(), a(L(e.menuIcon)))
65
+ ]),
66
+ _: 2
67
+ }, 1024)) : S("", !0),
68
+ w("span", null, A(e.title), 1)
69
+ ]),
70
+ _: 2
71
+ }, 1032, ["index"]))
72
+ ], 64))), 128))
73
+ ]),
74
+ _: 1
75
+ }, 16, ["collapse", "router"]));
83
76
  }
84
77
  });
85
78
  export {
86
- H as default
79
+ j as default
87
80
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AutoRefresh.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1f8a1089"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-64f355fe"]]);
5
5
  export {
6
- e as default
6
+ m as default
7
7
  };