@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.
- package/es/bridge/config-hook.mjs +37 -0
- package/es/bridge/index.mjs +157 -62
- package/es/bridge/plugin.mjs +29 -0
- package/es/bridge/theme.mjs +62 -0
- package/es/components/app-layout/AppBody.vue.mjs +1 -1
- package/es/components/app-layout/AppBody.vue2.mjs +47 -49
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
- package/es/components/app-layout/AppFooter.vue.mjs +2 -2
- package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
- package/es/components/app-layout/AppHeader.vue.mjs +1 -1
- package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
- package/es/components/app-layout/AppLayout.vue.mjs +2 -2
- package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
- package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
- package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
- package/es/components/app-layout/AppTheme.vue.mjs +7 -0
- package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
- package/es/components/data-view/DataListView.vue.mjs +2 -2
- package/es/components/data-view/DataListView.vue2.mjs +36 -36
- package/es/components/display/ActionConfirm.vue2.mjs +16 -16
- package/es/components/display/HeightProvider.vue.mjs +10 -10
- package/es/components/display/TabsHeader.vue.mjs +4 -4
- package/es/components/display/TabsHeader.vue2.mjs +34 -34
- package/es/components/display/TabsMain.vue.mjs +40 -39
- package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
- package/es/components/form/FormItem.vue.mjs +1 -1
- package/es/components/form/FormItem.vue2.mjs +75 -81
- package/es/components/form/FormMain.vue.mjs +81 -88
- package/es/components/form/FormRadioGroup.vue.mjs +42 -49
- package/es/components/form/FormSearch.vue.mjs +1 -1
- package/es/components/form/FormSearch.vue2.mjs +116 -123
- package/es/components/form/FormSelect.vue.mjs +34 -40
- package/es/components/form/FormSubmitBtn.vue.mjs +23 -28
- package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
- package/es/components/form/FormSubmitPanel.vue2.mjs +16 -16
- package/es/components/form/FormTree.vue.mjs +16 -21
- package/es/components/form/FormVerifyCode.vue.mjs +37 -43
- package/es/components/form/FormVerifyImage.vue.mjs +2 -2
- package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +134 -139
- package/es/components/menu/MenuItemSub.vue.mjs +41 -48
- package/es/components/menu/MenuTree.vue.mjs +58 -65
- package/es/components/misc/AutoRefresh.vue.mjs +2 -2
- package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
- package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
- package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
- package/es/components/modal/ConfirmModal.vue.mjs +3 -3
- package/es/components/modal/ConfirmModal.vue2.mjs +93 -100
- package/es/components/modal/DetailModal.vue.mjs +38 -41
- package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
- package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
- package/es/components/panel/PanelMain.vue.mjs +2 -2
- package/es/components/panel/PanelMain.vue2.mjs +67 -74
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +221 -229
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +115 -126
- package/es/hooks/use-admin-theme-apply.mjs +84 -0
- package/es/hooks/use-admin-viewport-apply.mjs +27 -0
- package/es/index.mjs +125 -117
- package/es/inject/key.mjs +7 -4
- package/es/store/app.mjs +75 -84
- package/es/style.css +1 -1
- package/es/utils/theme-scale.mjs +37 -0
- package/package.json +2 -4
- package/types/bridge/config-hook.d.ts +91 -0
- package/types/bridge/index.d.ts +108 -8
- package/types/bridge/plugin.d.ts +39 -0
- package/types/bridge/theme.d.ts +66 -0
- package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
- package/types/components/app-layout/types.d.ts +1 -1
- package/types/components/form/FormItem.vue.d.ts +12 -12
- package/types/components/form/FormTree.vue.d.ts +50 -50
- package/types/components/menu/MenuTree.vue.d.ts +10 -10
- package/types/components/modal/ModalShelf.vue.d.ts +1 -1
- package/types/components/table/TableMain.vue.d.ts +1 -1
- package/types/hooks/activated.d.ts +2 -2
- package/types/hooks/feel-size.d.ts +1 -1
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/menus-dispatch.d.ts +5 -5
- package/types/hooks/use-admin-theme-apply.d.ts +17 -0
- package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
- package/types/hooks/use-breakpoint.d.ts +1 -1
- package/types/inject/key.d.ts +18 -0
- package/types/store/app.d.ts +138 -59
- package/types/utils/index.d.ts +1 -0
- package/types/utils/theme-scale.d.ts +35 -0
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "element-plus
|
|
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
|
|
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
|
-
},
|
|
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(
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
setup(o, { expose: Q, emit: z }) {
|
|
43
|
+
de((e) => ({
|
|
44
|
+
c6e708aa: _.value
|
|
47
45
|
}));
|
|
48
|
-
const
|
|
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
|
-
),
|
|
48
|
+
), $ = i(!1), n = q(), u = q(), { viewportHeightFinal: G } = Me(s, {
|
|
51
49
|
fallback: 500
|
|
52
|
-
}), F =
|
|
53
|
-
...
|
|
54
|
-
...
|
|
55
|
-
})), A =
|
|
56
|
-
var
|
|
57
|
-
let
|
|
58
|
-
if (
|
|
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" &&
|
|
62
|
-
return ["reset", "search"].includes(t) ? (
|
|
63
|
-
|
|
64
|
-
...
|
|
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
|
-
|
|
65
|
+
b("dataChange", e);
|
|
68
66
|
}, re = (e) => {
|
|
69
|
-
|
|
67
|
+
b("pageInfoChange", e);
|
|
70
68
|
}, ae = (e) => {
|
|
71
|
-
|
|
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
|
-
},
|
|
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 =
|
|
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 =
|
|
83
|
+
return (t = u.value) == null ? void 0 : t.reload(e);
|
|
86
84
|
},
|
|
87
85
|
getTableInstance: () => {
|
|
88
86
|
var e;
|
|
89
|
-
return (e =
|
|
87
|
+
return (e = u.value) == null ? void 0 : e.getTableInstance();
|
|
90
88
|
},
|
|
91
89
|
validate: () => {
|
|
92
|
-
if (
|
|
93
|
-
return
|
|
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 =
|
|
96
|
+
return (e = n.value) == null ? void 0 : e.resetFields();
|
|
99
97
|
},
|
|
100
98
|
clearValidate: (e) => {
|
|
101
99
|
var t;
|
|
102
|
-
return (t =
|
|
100
|
+
return (t = n.value) == null ? void 0 : t.clearValidate(e);
|
|
103
101
|
},
|
|
104
102
|
triggerReset: () => {
|
|
105
103
|
var e;
|
|
106
|
-
return (e =
|
|
104
|
+
return (e = n.value) == null ? void 0 : e.triggerReset();
|
|
107
105
|
},
|
|
108
106
|
triggerSearch: () => {
|
|
109
107
|
var e;
|
|
110
|
-
return (e =
|
|
108
|
+
return (e = n.value) == null ? void 0 : e.triggerSearch();
|
|
111
109
|
},
|
|
112
110
|
toggleCollapse: (e) => {
|
|
113
111
|
var t;
|
|
114
|
-
return (t =
|
|
112
|
+
return (t = n.value) == null ? void 0 : t.toggleCollapse(e);
|
|
115
113
|
},
|
|
116
|
-
isCollapsed:
|
|
114
|
+
isCollapsed: a(() => {
|
|
117
115
|
var e;
|
|
118
|
-
return ((e =
|
|
116
|
+
return ((e = n.value) == null ? void 0 : e.isCollapsed.value) ?? !1;
|
|
119
117
|
}),
|
|
120
118
|
update: (e, t) => {
|
|
121
|
-
|
|
119
|
+
d.value[e] = t;
|
|
122
120
|
}
|
|
123
|
-
}, ue =
|
|
124
|
-
const e = Ie(
|
|
121
|
+
}, ue = a(() => {
|
|
122
|
+
const e = Ie(O, [
|
|
125
123
|
"triggerReset",
|
|
126
124
|
"triggerSearch",
|
|
127
125
|
"update"
|
|
128
126
|
]);
|
|
129
127
|
return {
|
|
130
|
-
...
|
|
128
|
+
...s.injectInfo || {},
|
|
131
129
|
...e
|
|
132
130
|
};
|
|
133
|
-
}), ce = (e) => e, he = (e) => e, fe = (e) => e,
|
|
131
|
+
}), ce = (e) => e, he = (e) => e, fe = (e) => e, ve = (e) => {
|
|
134
132
|
A.value = e;
|
|
135
133
|
};
|
|
136
|
-
return Q(
|
|
137
|
-
() =>
|
|
134
|
+
return Q(O), pe(
|
|
135
|
+
() => s.list,
|
|
138
136
|
(e) => {
|
|
139
|
-
const t =
|
|
140
|
-
|
|
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
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
f
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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
|
-
|
|
234
|
+
Te as default
|
|
240
235
|
};
|
|
@@ -1,60 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "element-plus
|
|
3
|
-
|
|
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 (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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(),
|
|
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
|
-
_:
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
52
|
+
E as default
|
|
60
53
|
};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "element-plus
|
|
5
|
-
|
|
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(
|
|
19
|
-
const
|
|
14
|
+
setup(l, { expose: k }) {
|
|
15
|
+
const c = l, u = P(), v = D(), i = _(), B = x(() => c.routerMode ? {
|
|
20
16
|
...i,
|
|
21
|
-
defaultActive:
|
|
17
|
+
defaultActive: v.path
|
|
22
18
|
} : i);
|
|
23
|
-
|
|
19
|
+
k({
|
|
24
20
|
open: (o) => {
|
|
25
|
-
var
|
|
26
|
-
return (
|
|
21
|
+
var t;
|
|
22
|
+
return (t = u.value) == null ? void 0 : t.open(o);
|
|
27
23
|
},
|
|
28
24
|
close: (o) => {
|
|
29
|
-
var
|
|
30
|
-
return (
|
|
25
|
+
var t;
|
|
26
|
+
return (t = u.value) == null ? void 0 : t.close(o);
|
|
31
27
|
}
|
|
32
28
|
});
|
|
33
|
-
const
|
|
34
|
-
const n =
|
|
35
|
-
return n != null && n.parentPath ? (
|
|
36
|
-
},
|
|
37
|
-
const { autoClose:
|
|
38
|
-
if (
|
|
39
|
-
const { menuFlatList:
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
n.includes(
|
|
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,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
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
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-64f355fe"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|