@done-coding/admin-core 0.0.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.
- package/README.md +48 -0
- package/docs/TECH_SNAPSHOT.md +146 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/RETROSPECTIVE.md +63 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/design.md +575 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/landing-authorizations/2026-05-09-080900-/346/234/2371-/345/205/245/345/256/236/346/226/275/346/216/210/346/235/203.md +107 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/project-orchestration.md +58 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/requirements.md +238 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/tasks.md +290 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/components/display/WatchSize.vue.mjs +50 -0
- package/es/components/display/WatchSize.vue2.mjs +4 -0
- package/es/components/display/index.mjs +12 -0
- package/es/components/form/FormItem.vue.mjs +7 -0
- package/es/components/form/FormItem.vue2.mjs +145 -0
- package/es/components/form/FormMain.vue.mjs +142 -0
- package/es/components/form/FormMain.vue2.mjs +4 -0
- package/es/components/form/FormRadioGroup.vue.mjs +36 -0
- package/es/components/form/FormRadioGroup.vue2.mjs +4 -0
- package/es/components/form/FormSearch.vue.mjs +7 -0
- package/es/components/form/FormSearch.vue2.mjs +132 -0
- package/es/components/form/FormSelect.vue.mjs +65 -0
- package/es/components/form/FormSelect.vue2.mjs +4 -0
- package/es/components/form/FormTree.vue.mjs +34 -0
- package/es/components/form/FormTree.vue2.mjs +4 -0
- package/es/components/form/FormVerifyCode.vue.mjs +72 -0
- package/es/components/form/FormVerifyCode.vue2.mjs +4 -0
- package/es/components/form/FormVerifyImage.vue.mjs +7 -0
- package/es/components/form/FormVerifyImage.vue2.mjs +60 -0
- package/es/components/form/index.mjs +32 -0
- package/es/components/form/utils.mjs +147 -0
- package/es/components/list-page/ListPage.vue.mjs +7 -0
- package/es/components/list-page/ListPage.vue2.mjs +194 -0
- package/es/components/list-page/index.mjs +14 -0
- package/es/components/menu/MenuItemSub.vue.mjs +60 -0
- package/es/components/menu/MenuItemSub.vue2.mjs +4 -0
- package/es/components/menu/MenuTree.vue.mjs +87 -0
- package/es/components/menu/MenuTree.vue2.mjs +4 -0
- package/es/components/menu/index.mjs +12 -0
- package/es/components/misc/TriggerAutoImport.vue.mjs +10 -0
- package/es/components/misc/TriggerAutoImport.vue2.mjs +4 -0
- package/es/components/misc/index.mjs +12 -0
- package/es/components/modal/ConfirmModal.vue.mjs +8 -0
- package/es/components/modal/ConfirmModal.vue2.mjs +141 -0
- package/es/components/modal/DetailModal.vue.mjs +67 -0
- package/es/components/modal/DetailModal.vue2.mjs +4 -0
- package/es/components/modal/index.mjs +17 -0
- package/es/components/table/TableMain.vue.mjs +7 -0
- package/es/components/table/TableMain.vue2.mjs +204 -0
- package/es/components/table/index.mjs +14 -0
- package/es/config/list-model.mjs +13 -0
- package/es/config/route.mjs +4 -0
- package/es/helpers/form.mjs +32 -0
- package/es/helpers/route.mjs +60 -0
- package/es/helpers/state.mjs +46 -0
- package/es/helpers/storage.mjs +16 -0
- package/es/hooks/activated.mjs +42 -0
- package/es/hooks/feel-size.mjs +30 -0
- package/es/hooks/menus-dispatch.mjs +47 -0
- package/es/index.mjs +97 -0
- package/es/inject/key.mjs +6 -0
- package/es/style.css +1 -0
- package/es/utils/id.mjs +5 -0
- package/es/utils/router.mjs +18 -0
- package/es/utils/time.mjs +18 -0
- package/package.json +81 -0
- package/types/components/display/WatchSize.vue.d.ts +44 -0
- package/types/components/display/index.d.ts +5 -0
- package/types/components/form/FormItem.vue.d.ts +50 -0
- package/types/components/form/FormMain.vue.d.ts +51 -0
- package/types/components/form/FormRadioGroup.vue.d.ts +23 -0
- package/types/components/form/FormSearch.vue.d.ts +23 -0
- package/types/components/form/FormSelect.vue.d.ts +60 -0
- package/types/components/form/FormTree.vue.d.ts +42 -0
- package/types/components/form/FormVerifyCode.vue.d.ts +32 -0
- package/types/components/form/FormVerifyImage.vue.d.ts +22 -0
- package/types/components/form/index.d.ts +13 -0
- package/types/components/form/types.d.ts +223 -0
- package/types/components/form/utils.d.ts +49 -0
- package/types/components/list-page/ListPage.vue.d.ts +44 -0
- package/types/components/list-page/index.d.ts +6 -0
- package/types/components/list-page/types.d.ts +44 -0
- package/types/components/menu/MenuItemSub.vue.d.ts +19 -0
- package/types/components/menu/MenuTree.vue.d.ts +28 -0
- package/types/components/menu/index.d.ts +6 -0
- package/types/components/misc/TriggerAutoImport.vue.d.ts +11 -0
- package/types/components/misc/index.d.ts +5 -0
- package/types/components/modal/ConfirmModal.vue.d.ts +107 -0
- package/types/components/modal/DetailModal.vue.d.ts +23 -0
- package/types/components/modal/index.d.ts +7 -0
- package/types/components/modal/types.d.ts +33 -0
- package/types/components/table/TableMain.vue.d.ts +35 -0
- package/types/components/table/index.d.ts +6 -0
- package/types/components/table/types.d.ts +90 -0
- package/types/config/index.d.ts +2 -0
- package/types/config/list-model.d.ts +48 -0
- package/types/config/route.d.ts +2 -0
- package/types/helpers/form.d.ts +11 -0
- package/types/helpers/index.d.ts +4 -0
- package/types/helpers/route.d.ts +37 -0
- package/types/helpers/state.d.ts +26 -0
- package/types/helpers/storage.d.ts +10 -0
- package/types/hooks/activated.d.ts +8 -0
- package/types/hooks/feel-size.d.ts +10 -0
- package/types/hooks/index.d.ts +3 -0
- package/types/hooks/menus-dispatch.d.ts +33 -0
- package/types/index.d.ts +24 -0
- package/types/inject/index.d.ts +1 -0
- package/types/inject/key.d.ts +11 -0
- package/types/types/dot-path.d.ts +13 -0
- package/types/types/index.d.ts +3 -0
- package/types/types/route.d.ts +92 -0
- package/types/types/utility-types.d.ts +8 -0
- package/types/utils/id.d.ts +2 -0
- package/types/utils/index.d.ts +3 -0
- package/types/utils/router.d.ts +8 -0
- package/types/utils/time.d.ts +2 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { ElLoadingDirective as W } 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 Y, useCssVars as U, unref as t, ref as c, shallowRef as k, inject as X, computed as n, watch as Z, withDirectives as ee, openBlock as D, createElementBlock as re, createVNode as F, mergeProps as v, createSlots as P, renderList as y, withCtx as g, renderSlot as m, normalizeProps as T, guardReactiveProps as $, createBlock as te, createCommentVNode as ae } from "vue";
|
|
5
|
+
import oe from "../form/FormSearch.vue.mjs";
|
|
6
|
+
import { generateFormData as ne, stringifyFormData as se } from "../form/utils.mjs";
|
|
7
|
+
import ie from "../display/WatchSize.vue.mjs";
|
|
8
|
+
import le from "../table/TableMain.vue.mjs";
|
|
9
|
+
import ue from "lodash/pick";
|
|
10
|
+
import ce from "lodash/cloneDeep";
|
|
11
|
+
import { BODY_CONTENT_VIEWPORT_HEIGHT as fe } from "../../inject/key.mjs";
|
|
12
|
+
const he = {
|
|
13
|
+
"element-loading-background": "rgba(122, 122, 122, 0.5)",
|
|
14
|
+
class: "list-page"
|
|
15
|
+
}, Oe = /* @__PURE__ */ Y({
|
|
16
|
+
__name: "ListPage",
|
|
17
|
+
props: {
|
|
18
|
+
staticQuery: { default: () => ({}) },
|
|
19
|
+
formSearchProps: {},
|
|
20
|
+
columns: {},
|
|
21
|
+
rowKey: {},
|
|
22
|
+
refine: { type: Boolean, default: !0 },
|
|
23
|
+
refineReduceHeight: { default: 0 },
|
|
24
|
+
tableMainProps: {},
|
|
25
|
+
showOperation: { type: Boolean, default: !1 },
|
|
26
|
+
list: { default: () => [] },
|
|
27
|
+
api: {},
|
|
28
|
+
query: {},
|
|
29
|
+
injectInfo: {},
|
|
30
|
+
beforeSearch: {},
|
|
31
|
+
clearTableFilterOnReset: { type: Boolean }
|
|
32
|
+
},
|
|
33
|
+
setup(s, { expose: I }) {
|
|
34
|
+
U((e) => ({
|
|
35
|
+
v20e95162: t(E)
|
|
36
|
+
}));
|
|
37
|
+
const a = s, d = c({}), p = c(
|
|
38
|
+
{}
|
|
39
|
+
), S = c(!1), i = k(), u = k(), M = X(
|
|
40
|
+
fe,
|
|
41
|
+
500
|
|
42
|
+
), b = c(0), H = c(0), x = n(() => ({
|
|
43
|
+
...p.value,
|
|
44
|
+
...a.staticQuery
|
|
45
|
+
})), w = c(!1), V = n(() => w.value ? b.value + 10 : 0), B = n(() => a.showOperation ? H.value + 10 : 0), C = n(() => M.value - a.refineReduceHeight), E = n(() => a.refine ? `${C.value}px` : "auto"), K = n(() => a.refine ? Math.max(
|
|
46
|
+
C.value - V.value - B.value,
|
|
47
|
+
200
|
|
48
|
+
) : void 0), O = (e, r = "search") => {
|
|
49
|
+
var o, l, h;
|
|
50
|
+
let f = e;
|
|
51
|
+
if (a.beforeSearch && (f = a.beforeSearch(
|
|
52
|
+
ce(e),
|
|
53
|
+
r
|
|
54
|
+
)), r === "reset" && a.clearTableFilterOnReset && ((l = (o = u.value) == null ? void 0 : o.getTableInstance()) == null || l.clearFilter()), JSON.stringify(f) === JSON.stringify(p.value))
|
|
55
|
+
return ["reset", "search"].includes(r) ? (h = u.value) == null ? void 0 : h.reload() : void 0;
|
|
56
|
+
p.value = {
|
|
57
|
+
...f
|
|
58
|
+
};
|
|
59
|
+
}, N = (e) => {
|
|
60
|
+
S.value = e;
|
|
61
|
+
}, q = (e) => {
|
|
62
|
+
b.value = e;
|
|
63
|
+
}, L = (e) => {
|
|
64
|
+
H.value = e;
|
|
65
|
+
}, A = n(() => a.list), _ = n(() => a.rowKey), R = n(() => d.value), j = {
|
|
66
|
+
refresh: (e = !1) => {
|
|
67
|
+
var r;
|
|
68
|
+
return (r = u.value) == null ? void 0 : r.refresh(e);
|
|
69
|
+
},
|
|
70
|
+
reload: (e = !1) => {
|
|
71
|
+
var r;
|
|
72
|
+
return (r = u.value) == null ? void 0 : r.reload(e);
|
|
73
|
+
},
|
|
74
|
+
getTableInstance: () => {
|
|
75
|
+
var e;
|
|
76
|
+
return (e = u.value) == null ? void 0 : e.getTableInstance();
|
|
77
|
+
},
|
|
78
|
+
validate: () => {
|
|
79
|
+
if (i.value)
|
|
80
|
+
return i.value.validate();
|
|
81
|
+
throw new Error("实例化未完成");
|
|
82
|
+
},
|
|
83
|
+
resetFields: () => {
|
|
84
|
+
var e;
|
|
85
|
+
return (e = i.value) == null ? void 0 : e.resetFields();
|
|
86
|
+
},
|
|
87
|
+
clearValidate: (e) => {
|
|
88
|
+
var r;
|
|
89
|
+
return (r = i.value) == null ? void 0 : r.clearValidate(e);
|
|
90
|
+
},
|
|
91
|
+
triggerReset: () => {
|
|
92
|
+
var e;
|
|
93
|
+
return (e = i.value) == null ? void 0 : e.triggerReset();
|
|
94
|
+
},
|
|
95
|
+
triggerSearch: () => {
|
|
96
|
+
var e;
|
|
97
|
+
return (e = i.value) == null ? void 0 : e.triggerSearch();
|
|
98
|
+
},
|
|
99
|
+
update: (e, r) => {
|
|
100
|
+
d.value[e] = r;
|
|
101
|
+
}
|
|
102
|
+
}, J = n(() => {
|
|
103
|
+
const e = ue(j, [
|
|
104
|
+
"triggerReset",
|
|
105
|
+
"triggerSearch",
|
|
106
|
+
"update"
|
|
107
|
+
]);
|
|
108
|
+
return {
|
|
109
|
+
...a.injectInfo || {},
|
|
110
|
+
...e
|
|
111
|
+
};
|
|
112
|
+
}), Q = (e) => e, z = (e) => e, G = (e) => {
|
|
113
|
+
w.value = e;
|
|
114
|
+
};
|
|
115
|
+
return I(j), Z(
|
|
116
|
+
() => a.list,
|
|
117
|
+
(e) => {
|
|
118
|
+
const r = ne(e);
|
|
119
|
+
d.value = r, O(se(r, e));
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
immediate: !0
|
|
123
|
+
}
|
|
124
|
+
), (e, r) => {
|
|
125
|
+
const f = W;
|
|
126
|
+
return ee((D(), re("div", he, [
|
|
127
|
+
F(t(oe), v({
|
|
128
|
+
ref_key: "formSearch",
|
|
129
|
+
ref: i,
|
|
130
|
+
list: t(A),
|
|
131
|
+
data: t(R)
|
|
132
|
+
}, s.formSearchProps, {
|
|
133
|
+
onSearch: O,
|
|
134
|
+
onHeightChange: q,
|
|
135
|
+
onVisibleChange: G
|
|
136
|
+
}), P({ _: 2 }, [
|
|
137
|
+
y(s.list, (o) => ({
|
|
138
|
+
name: o.key,
|
|
139
|
+
fn: g((l) => [
|
|
140
|
+
m(e.$slots, `form-${o.key}`, T($(l)), void 0, !0)
|
|
141
|
+
])
|
|
142
|
+
}))
|
|
143
|
+
]), 1040, ["list", "data"]),
|
|
144
|
+
s.showOperation ? (D(), te(t(ie), {
|
|
145
|
+
key: 0,
|
|
146
|
+
class: "list-page-operation",
|
|
147
|
+
onHeightChange: L
|
|
148
|
+
}, {
|
|
149
|
+
default: g(() => [
|
|
150
|
+
m(e.$slots, "operation", {}, void 0, !0)
|
|
151
|
+
]),
|
|
152
|
+
_: 3
|
|
153
|
+
})) : ae("", !0),
|
|
154
|
+
F(t(le), v({
|
|
155
|
+
ref_key: "tableMain",
|
|
156
|
+
ref: u,
|
|
157
|
+
api: s.api,
|
|
158
|
+
columns: s.columns,
|
|
159
|
+
query: t(x),
|
|
160
|
+
maxHeight: t(K),
|
|
161
|
+
rowKey: t(_)
|
|
162
|
+
}, s.tableMainProps, {
|
|
163
|
+
refine: !1,
|
|
164
|
+
injectInfo: t(J),
|
|
165
|
+
onLoadingChange: N
|
|
166
|
+
}), P({ _: 2 }, [
|
|
167
|
+
y(s.columns, (o) => ({
|
|
168
|
+
name: o.prop,
|
|
169
|
+
fn: g((l) => [
|
|
170
|
+
m(e.$slots, `table-${o.prop}`, T($(Q(l))), void 0, !0)
|
|
171
|
+
])
|
|
172
|
+
})),
|
|
173
|
+
y(s.columns, (o) => ({
|
|
174
|
+
name: `header-${o.prop}`,
|
|
175
|
+
fn: g((l) => {
|
|
176
|
+
var h;
|
|
177
|
+
return [
|
|
178
|
+
m(e.$slots, `table-header-${o.columnKey || o.prop}`, v(z(l), {
|
|
179
|
+
searchFormData: t(R),
|
|
180
|
+
triggerSearch: (h = t(i)) == null ? void 0 : h.triggerSearch
|
|
181
|
+
}), void 0, !0)
|
|
182
|
+
];
|
|
183
|
+
})
|
|
184
|
+
}))
|
|
185
|
+
]), 1040, ["api", "columns", "query", "maxHeight", "rowKey", "injectInfo"])
|
|
186
|
+
])), [
|
|
187
|
+
[f, t(S)]
|
|
188
|
+
]);
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
export {
|
|
193
|
+
Oe as default
|
|
194
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
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({
|
|
8
|
+
__name: "MenuItemSub",
|
|
9
|
+
props: {
|
|
10
|
+
menu: {},
|
|
11
|
+
MenuItemSub: {}
|
|
12
|
+
},
|
|
13
|
+
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 }, {
|
|
21
|
+
default: m(() => [
|
|
22
|
+
(e(), u(r(n.menu.menuIcon)))
|
|
23
|
+
]),
|
|
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
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
export {
|
|
59
|
+
D as default
|
|
60
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
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({
|
|
10
|
+
__name: "MenuTree",
|
|
11
|
+
props: {
|
|
12
|
+
menus: {},
|
|
13
|
+
menuFlatList: {},
|
|
14
|
+
routerMode: { type: Boolean },
|
|
15
|
+
collapse: { type: Boolean },
|
|
16
|
+
autoClose: { type: Boolean }
|
|
17
|
+
},
|
|
18
|
+
setup(s, { expose: M }) {
|
|
19
|
+
const p = s, u = v(), y = R(), i = x(), E = g(() => p.routerMode ? {
|
|
20
|
+
...i,
|
|
21
|
+
defaultActive: y.path
|
|
22
|
+
} : i);
|
|
23
|
+
M({
|
|
24
|
+
open: (o) => {
|
|
25
|
+
var e;
|
|
26
|
+
return (e = u.value) == null ? void 0 : e.open(o);
|
|
27
|
+
},
|
|
28
|
+
close: (o) => {
|
|
29
|
+
var e;
|
|
30
|
+
return (e = u.value) == null ? void 0 : e.close(o);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
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);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
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
|
+
};
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
export {
|
|
86
|
+
H as default
|
|
87
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ElDialog as N, ElButton as O, ElIcon as S } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/dialog/style/css";
|
|
4
|
+
import "element-plus/es/components/icon/style/css";
|
|
5
|
+
import "element-plus/es/components/button/style/css";
|
|
6
|
+
import { defineComponent as V, ref as $, computed as F, openBlock as l, createBlock as i, withCtx as r, createElementVNode as c, renderSlot as u, resolveDynamicComponent as w, createElementBlock as m, Fragment as B, createTextVNode as d, toDisplayString as f, unref as y, createCommentVNode as x, createVNode as C } from "vue";
|
|
7
|
+
import { Close as L } from "@element-plus/icons-vue";
|
|
8
|
+
const M = { class: "main" }, I = { class: "shim" }, P = { class: "title" }, z = { class: "content" }, A = ["reverse"], W = /* @__PURE__ */ V({
|
|
9
|
+
inheritAttrs: !1,
|
|
10
|
+
__name: "ConfirmModal",
|
|
11
|
+
props: {
|
|
12
|
+
show: { type: Boolean },
|
|
13
|
+
showClose: { type: Boolean, default: !0 },
|
|
14
|
+
onClose: {},
|
|
15
|
+
onCancel: {},
|
|
16
|
+
onConfirm: {},
|
|
17
|
+
title: {},
|
|
18
|
+
content: {},
|
|
19
|
+
cancelText: { type: [String, Function], default: "取消" },
|
|
20
|
+
confirmText: { type: [String, Function], default: "确定" },
|
|
21
|
+
hiddenCancel: { type: Boolean, default: !1 },
|
|
22
|
+
width: { default: 418 },
|
|
23
|
+
reverse: { type: Boolean, default: !1 },
|
|
24
|
+
closeOnPressEscape: { type: Boolean, default: !0 },
|
|
25
|
+
closeOnClickModal: { type: Boolean, default: !0 },
|
|
26
|
+
useLoading: { type: Boolean }
|
|
27
|
+
},
|
|
28
|
+
emits: ["update:show"],
|
|
29
|
+
setup(e, { emit: E }) {
|
|
30
|
+
const o = e, T = E, a = $(!1), h = F(() => o.useLoading && a.value), s = (n) => {
|
|
31
|
+
var t;
|
|
32
|
+
console.log("close", n), T("update:show", !1), (t = o.onClose) == null || t.call(o, n);
|
|
33
|
+
}, g = async () => {
|
|
34
|
+
var t;
|
|
35
|
+
if (await ((t = o.onCancel) == null ? void 0 : t.call(o)) === !1) {
|
|
36
|
+
console.log("确认弹窗 onCancel 返回false,不关闭弹窗");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
s(!1);
|
|
40
|
+
}, v = async () => {
|
|
41
|
+
var n;
|
|
42
|
+
a.value = !0;
|
|
43
|
+
try {
|
|
44
|
+
const t = await ((n = o.onConfirm) == null ? void 0 : n.call(o));
|
|
45
|
+
if (a.value = !1, t === !1) {
|
|
46
|
+
console.log("确认弹窗 onConfirm 返回false,不关闭弹窗");
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
s(!0);
|
|
50
|
+
} catch {
|
|
51
|
+
a.value = !1;
|
|
52
|
+
}
|
|
53
|
+
}, b = () => {
|
|
54
|
+
console.log("closeHandler"), s(!1);
|
|
55
|
+
};
|
|
56
|
+
return (n, t) => {
|
|
57
|
+
const k = O, H = S, D = N;
|
|
58
|
+
return l(), i(D, {
|
|
59
|
+
"model-value": e.show,
|
|
60
|
+
class: "confirm-dialog",
|
|
61
|
+
width: e.width,
|
|
62
|
+
"show-close": !1,
|
|
63
|
+
"append-to-body": "",
|
|
64
|
+
"align-center": "",
|
|
65
|
+
"close-on-click-modal": e.closeOnClickModal,
|
|
66
|
+
"close-on-press-escape": e.closeOnPressEscape,
|
|
67
|
+
onClose: b
|
|
68
|
+
}, {
|
|
69
|
+
default: r(() => [
|
|
70
|
+
c("div", M, [
|
|
71
|
+
c("div", I, [
|
|
72
|
+
c("div", P, [
|
|
73
|
+
u(n.$slots, "title", {}, () => [
|
|
74
|
+
typeof e.title == "function" ? (l(), i(w(e.title), { key: 0 })) : (l(), m(B, { key: 1 }, [
|
|
75
|
+
d(f(e.title), 1)
|
|
76
|
+
], 64))
|
|
77
|
+
], !0)
|
|
78
|
+
]),
|
|
79
|
+
c("div", z, [
|
|
80
|
+
u(n.$slots, "default", {}, () => [
|
|
81
|
+
typeof e.content == "function" ? (l(), i(w(e.content), { key: 0 })) : (l(), m(B, { key: 1 }, [
|
|
82
|
+
d(f(e.content), 1)
|
|
83
|
+
], 64))
|
|
84
|
+
], !0)
|
|
85
|
+
]),
|
|
86
|
+
c("div", {
|
|
87
|
+
class: "footer",
|
|
88
|
+
reverse: e.reverse
|
|
89
|
+
}, [
|
|
90
|
+
u(n.$slots, "footer", {
|
|
91
|
+
cancelHandler: g,
|
|
92
|
+
confirmHandler: v,
|
|
93
|
+
loading: y(h)
|
|
94
|
+
}, () => [
|
|
95
|
+
e.hiddenCancel ? x("", !0) : (l(), i(k, {
|
|
96
|
+
key: 0,
|
|
97
|
+
class: "btn cancel-btn",
|
|
98
|
+
btnHover: "",
|
|
99
|
+
onClick: g
|
|
100
|
+
}, {
|
|
101
|
+
default: r(() => [
|
|
102
|
+
d(f(typeof e.cancelText == "function" ? e.cancelText() : e.cancelText), 1)
|
|
103
|
+
]),
|
|
104
|
+
_: 1
|
|
105
|
+
})),
|
|
106
|
+
C(k, {
|
|
107
|
+
type: "primary",
|
|
108
|
+
class: "btn confirm-btn",
|
|
109
|
+
loading: y(h),
|
|
110
|
+
onClick: v
|
|
111
|
+
}, {
|
|
112
|
+
default: r(() => [
|
|
113
|
+
d(f(typeof e.confirmText == "function" ? e.confirmText() : e.confirmText), 1)
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
116
|
+
}, 8, ["loading"])
|
|
117
|
+
], !0)
|
|
118
|
+
], 8, A)
|
|
119
|
+
]),
|
|
120
|
+
e.showClose ? (l(), m("div", {
|
|
121
|
+
key: 0,
|
|
122
|
+
class: "close-box",
|
|
123
|
+
onClick: t[0] || (t[0] = (j) => s())
|
|
124
|
+
}, [
|
|
125
|
+
C(H, { size: 22 }, {
|
|
126
|
+
default: r(() => [
|
|
127
|
+
C(y(L))
|
|
128
|
+
]),
|
|
129
|
+
_: 1
|
|
130
|
+
})
|
|
131
|
+
])) : x("", !0)
|
|
132
|
+
])
|
|
133
|
+
]),
|
|
134
|
+
_: 3
|
|
135
|
+
}, 8, ["model-value", "width", "close-on-click-modal", "close-on-press-escape"]);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
export {
|
|
140
|
+
W as default
|
|
141
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import p from "./ConfirmModal.vue.mjs";
|
|
2
|
+
import y from "../form/FormMain.vue.mjs";
|
|
3
|
+
import { defineComponent as g, ref as A, computed as r, watch as C, openBlock as M, createBlock as x, unref as s, withCtx as D, createVNode as _, mergeProps as b } from "vue";
|
|
4
|
+
import { stringifyFormData as k } from "../form/utils.mjs";
|
|
5
|
+
const v = "80px", W = /* @__PURE__ */ g({
|
|
6
|
+
__name: "DetailModal",
|
|
7
|
+
props: {
|
|
8
|
+
data: {},
|
|
9
|
+
list: {},
|
|
10
|
+
type: {},
|
|
11
|
+
subTitle: {},
|
|
12
|
+
show: { type: Boolean },
|
|
13
|
+
addApi: {},
|
|
14
|
+
editApi: {},
|
|
15
|
+
modalWidth: { default: 600 },
|
|
16
|
+
formLayout: { default: () => ({ span: 24 }) },
|
|
17
|
+
formProps: {}
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:show", "afterAdd", "afterEdit"],
|
|
20
|
+
setup(e, { emit: c }) {
|
|
21
|
+
const t = e, d = c, l = A(), f = r(() => t.data), m = r(() => `${t.type === "add" ? "新增" : "编辑"}${t.subTitle || ""}`), u = (o) => {
|
|
22
|
+
d("update:show", o);
|
|
23
|
+
}, h = () => {
|
|
24
|
+
var o;
|
|
25
|
+
return (o = l.value) == null ? void 0 : o.validate().then(async () => {
|
|
26
|
+
var i, n;
|
|
27
|
+
const a = k(t.data, t.list);
|
|
28
|
+
console.log("confirm", a), t.type === "add" ? (await ((i = t.addApi) == null ? void 0 : i.call(t, a)), d("afterAdd", a)) : (await ((n = t.editApi) == null ? void 0 : n.call(t, a)), d("afterEdit", a));
|
|
29
|
+
});
|
|
30
|
+
}, w = () => {
|
|
31
|
+
console.log("cancel");
|
|
32
|
+
};
|
|
33
|
+
return C(
|
|
34
|
+
() => t.show,
|
|
35
|
+
(o) => {
|
|
36
|
+
var a;
|
|
37
|
+
o || (a = l.value) == null || a.clearValidate();
|
|
38
|
+
}
|
|
39
|
+
), (o, a) => {
|
|
40
|
+
const i = y, n = p;
|
|
41
|
+
return M(), x(n, {
|
|
42
|
+
title: s(m),
|
|
43
|
+
show: e.show,
|
|
44
|
+
onConfirm: h,
|
|
45
|
+
onCancel: w,
|
|
46
|
+
useLoading: "",
|
|
47
|
+
width: e.modalWidth,
|
|
48
|
+
"onUpdate:show": u
|
|
49
|
+
}, {
|
|
50
|
+
default: D(() => [
|
|
51
|
+
_(i, b({
|
|
52
|
+
ref_key: "formMain",
|
|
53
|
+
ref: l,
|
|
54
|
+
list: e.list,
|
|
55
|
+
data: s(f),
|
|
56
|
+
layout: e.formLayout,
|
|
57
|
+
labelWidth: v
|
|
58
|
+
}, e.formProps), null, 16, ["list", "data", "layout"])
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
}, 8, ["title", "show", "width"]);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
W as default
|
|
67
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import n from "./ConfirmModal.vue.mjs";
|
|
2
|
+
import l from "./DetailModal.vue.mjs";
|
|
3
|
+
const m = {
|
|
4
|
+
ConfirmModal: n,
|
|
5
|
+
DetailModal: l
|
|
6
|
+
}, r = {
|
|
7
|
+
install(o) {
|
|
8
|
+
Object.entries(m).forEach(([t, a]) => {
|
|
9
|
+
o.component(t, a);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
n as ConfirmModal,
|
|
15
|
+
l as DetailModal,
|
|
16
|
+
r as modalInstall
|
|
17
|
+
};
|