@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,204 @@
|
|
|
1
|
+
import { ElTable as ne, ElTableColumn as ae, ElEmpty as oe, ElPagination as ie } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/pagination/style/css";
|
|
4
|
+
import "element-plus/es/components/table/style/css";
|
|
5
|
+
import "element-plus/es/components/empty/style/css";
|
|
6
|
+
import "element-plus/es/components/table-column/style/css";
|
|
7
|
+
import { defineComponent as le, useCssVars as se, useAttrs as ue, ref as p, shallowRef as fe, inject as pe, computed as _, onMounted as ge, onActivated as de, watch as g, openBlock as o, createElementBlock as c, createVNode as L, mergeProps as d, unref as u, withCtx as S, Fragment as E, renderList as ce, createBlock as C, createSlots as me, renderSlot as j, resolveDynamicComponent as A, createTextVNode as T, toDisplayString as J, withDirectives as he, createElementVNode as ye, isRef as B, vShow as ve } from "vue";
|
|
8
|
+
import $ from "lodash/cloneDeep";
|
|
9
|
+
import M from "lodash/omit";
|
|
10
|
+
import V from "lodash/set";
|
|
11
|
+
import Y from "lodash/get";
|
|
12
|
+
import { BODY_CONTENT_VIEWPORT_HEIGHT as _e } from "../../inject/key.mjs";
|
|
13
|
+
import { APP_API_LIST_MODEL_KEY_CONFIG as b } from "../../config/list-model.mjs";
|
|
14
|
+
const Se = { class: "table-main" }, Ee = { class: "table-main-pagination" }, Ke = /* @__PURE__ */ le({
|
|
15
|
+
__name: "TableMain",
|
|
16
|
+
props: {
|
|
17
|
+
showPager: { type: Boolean, default: !0 },
|
|
18
|
+
query: {},
|
|
19
|
+
pageSizeInit: { default: 20 },
|
|
20
|
+
pageSizeOptions: { default: () => [10, 20, 30, 40] },
|
|
21
|
+
pageLayout: { default: "total, sizes, prev, pager, next, jumper" },
|
|
22
|
+
rowKey: {},
|
|
23
|
+
api: {},
|
|
24
|
+
tableProps: {},
|
|
25
|
+
columns: {},
|
|
26
|
+
maxHeight: {},
|
|
27
|
+
headerColor: { default: "rgb(240, 240, 240)" },
|
|
28
|
+
refine: { type: Boolean, default: !0 },
|
|
29
|
+
refineReduceHeight: { default: 0 },
|
|
30
|
+
injectInfo: {}
|
|
31
|
+
},
|
|
32
|
+
emits: ["pageChange", "pageSizeChange", "dataChange", "loadingChange"],
|
|
33
|
+
setup(f, { expose: G, emit: q }) {
|
|
34
|
+
se((e) => ({
|
|
35
|
+
v2c344d25: e.headerColor
|
|
36
|
+
}));
|
|
37
|
+
const n = f, m = q, D = ue(), w = p([]), I = p(0), i = p(0), a = p(1), h = p(!1), x = p(!1), O = fe(), F = pe(
|
|
38
|
+
_e,
|
|
39
|
+
500
|
|
40
|
+
), P = _(() => n.showPager ? 35 : 0), U = _(() => {
|
|
41
|
+
const { maxHeight: e, refine: t } = n;
|
|
42
|
+
return e ? Math.max(e - P.value, 200) : t ? Math.max(
|
|
43
|
+
F.value - P.value - n.refineReduceHeight,
|
|
44
|
+
200
|
|
45
|
+
) : void 0;
|
|
46
|
+
}), y = _(() => {
|
|
47
|
+
const e = $(n.query || {});
|
|
48
|
+
return V(e, b.PAGE_SIZE_KEY, i.value), V(
|
|
49
|
+
e,
|
|
50
|
+
b.CURRENT_PAGE_KEY,
|
|
51
|
+
a.value
|
|
52
|
+
), e;
|
|
53
|
+
}), W = _(() => ({
|
|
54
|
+
...n.tableProps,
|
|
55
|
+
...D
|
|
56
|
+
})), N = (e, t = !0) => {
|
|
57
|
+
const l = JSON.stringify(e) === JSON.stringify(y.value);
|
|
58
|
+
return !l && t && console.warn(
|
|
59
|
+
`同一地方 并发请求 参数冰花 当前不是最新的参数 丢弃结果 ${JSON.stringify(
|
|
60
|
+
e
|
|
61
|
+
)} => ${JSON.stringify(y.value)}`
|
|
62
|
+
), l;
|
|
63
|
+
}, k = (e = !1) => {
|
|
64
|
+
if (!i.value) return;
|
|
65
|
+
h.value ? console.warn("请求并发") : h.value = !0, e || (x.value = !0);
|
|
66
|
+
const t = $(y.value);
|
|
67
|
+
n.api(t).then((l) => {
|
|
68
|
+
N(t, !1) && (w.value = Y(
|
|
69
|
+
l,
|
|
70
|
+
b.LIST_KEY
|
|
71
|
+
), I.value = Y(
|
|
72
|
+
l,
|
|
73
|
+
b.TOTAL_KEY
|
|
74
|
+
));
|
|
75
|
+
}).finally(() => {
|
|
76
|
+
N(t) && (h.value = !1, x.value = !1);
|
|
77
|
+
});
|
|
78
|
+
}, z = (e = !1) => {
|
|
79
|
+
k(e);
|
|
80
|
+
}, Z = (e = !1) => {
|
|
81
|
+
a.value === 1 ? z(e) : a.value = 1;
|
|
82
|
+
}, Q = (e) => e, v = {
|
|
83
|
+
refresh: z,
|
|
84
|
+
reload: Z,
|
|
85
|
+
getTableInstance: () => O.value
|
|
86
|
+
}, R = (e, t = []) => ({
|
|
87
|
+
...M(e, ["render", "headerRender"].concat(t)),
|
|
88
|
+
injectInfo: n.injectInfo || {},
|
|
89
|
+
exposeInfo: v
|
|
90
|
+
}), H = (e) => ({
|
|
91
|
+
...M(e, ["render", "headerRender"]),
|
|
92
|
+
injectInfo: n.injectInfo || {},
|
|
93
|
+
exposeInfo: v
|
|
94
|
+
});
|
|
95
|
+
G(v);
|
|
96
|
+
const X = (e) => {
|
|
97
|
+
i.value = e, a.value = 1;
|
|
98
|
+
}, K = (e) => !e || e === "expand";
|
|
99
|
+
return ge(() => {
|
|
100
|
+
i.value = n.pageSizeInit, de(() => {
|
|
101
|
+
v.refresh();
|
|
102
|
+
});
|
|
103
|
+
}), g(w, (e) => {
|
|
104
|
+
m("dataChange", e);
|
|
105
|
+
}), g(
|
|
106
|
+
() => n.query,
|
|
107
|
+
(e, t) => {
|
|
108
|
+
JSON.stringify(e) !== JSON.stringify(t) && (a.value = 1);
|
|
109
|
+
}
|
|
110
|
+
), g(
|
|
111
|
+
y,
|
|
112
|
+
(e, t) => {
|
|
113
|
+
JSON.stringify(e) !== JSON.stringify(t) && k();
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
immediate: !0
|
|
117
|
+
}
|
|
118
|
+
), g(x, (e) => {
|
|
119
|
+
m("loadingChange", e);
|
|
120
|
+
}), g(i, (e) => {
|
|
121
|
+
m("pageSizeChange", e);
|
|
122
|
+
}), g(a, (e) => {
|
|
123
|
+
m("pageChange", e);
|
|
124
|
+
}), (e, t) => {
|
|
125
|
+
const l = ae, ee = oe, te = ne, re = ie;
|
|
126
|
+
return o(), c("div", Se, [
|
|
127
|
+
L(te, d({
|
|
128
|
+
ref_key: "elTable",
|
|
129
|
+
ref: O,
|
|
130
|
+
class: "table-main-table",
|
|
131
|
+
stripe: "",
|
|
132
|
+
border: "",
|
|
133
|
+
highlightCurrentRow: ""
|
|
134
|
+
}, u(W), {
|
|
135
|
+
maxHeight: u(U),
|
|
136
|
+
data: u(w),
|
|
137
|
+
rowKey: Q(f.rowKey)
|
|
138
|
+
}), {
|
|
139
|
+
empty: S(() => [
|
|
140
|
+
u(h) ? (o(), c(E, { key: 0 }, [
|
|
141
|
+
T("加载中...")
|
|
142
|
+
], 64)) : (o(), C(ee, { key: 1 }))
|
|
143
|
+
]),
|
|
144
|
+
default: S(() => [
|
|
145
|
+
(o(!0), c(E, null, ce(f.columns, (r) => (o(), C(l, d({
|
|
146
|
+
key: r.columnKey || r.prop
|
|
147
|
+
}, { ref_for: !0 }, r), me({ _: 2 }, [
|
|
148
|
+
K(r.type) ? {
|
|
149
|
+
name: "default",
|
|
150
|
+
fn: S((s) => [
|
|
151
|
+
j(e.$slots, r.prop, d({ ref_for: !0 }, R(s)), () => [
|
|
152
|
+
r.render ? (o(), C(A(r.render), d({
|
|
153
|
+
key: 0,
|
|
154
|
+
ref_for: !0
|
|
155
|
+
}, R(s, ["$index"]), {
|
|
156
|
+
_index: s.$index
|
|
157
|
+
}), null, 16, ["_index"])) : (o(), c(E, { key: 1 }, [
|
|
158
|
+
T(J(s.row[r.prop]), 1)
|
|
159
|
+
], 64))
|
|
160
|
+
], !0)
|
|
161
|
+
]),
|
|
162
|
+
key: "0"
|
|
163
|
+
} : void 0,
|
|
164
|
+
K(r.type) ? {
|
|
165
|
+
name: "header",
|
|
166
|
+
fn: S((s) => [
|
|
167
|
+
j(e.$slots, `header-${r.prop}`, d({ ref_for: !0 }, H(s)), () => [
|
|
168
|
+
r.headerRender ? (o(), C(A(r.headerRender), d({
|
|
169
|
+
key: 0,
|
|
170
|
+
ref_for: !0
|
|
171
|
+
}, H(s)), null, 16)) : (o(), c(E, { key: 1 }, [
|
|
172
|
+
T(J(r.label), 1)
|
|
173
|
+
], 64))
|
|
174
|
+
], !0)
|
|
175
|
+
]),
|
|
176
|
+
key: "1"
|
|
177
|
+
} : void 0
|
|
178
|
+
]), 1040))), 128))
|
|
179
|
+
]),
|
|
180
|
+
_: 3
|
|
181
|
+
}, 16, ["maxHeight", "data", "rowKey"]),
|
|
182
|
+
he(ye("div", Ee, [
|
|
183
|
+
L(re, {
|
|
184
|
+
"current-page": u(a),
|
|
185
|
+
"onUpdate:currentPage": t[0] || (t[0] = (r) => B(a) ? a.value = r : null),
|
|
186
|
+
"page-size": u(i),
|
|
187
|
+
"onUpdate:pageSize": t[1] || (t[1] = (r) => B(i) ? i.value = r : null),
|
|
188
|
+
"page-sizes": f.pageSizeOptions,
|
|
189
|
+
small: "",
|
|
190
|
+
background: "",
|
|
191
|
+
layout: f.pageLayout,
|
|
192
|
+
total: u(I),
|
|
193
|
+
onSizeChange: X
|
|
194
|
+
}, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total"])
|
|
195
|
+
], 512), [
|
|
196
|
+
[ve, f.showPager]
|
|
197
|
+
])
|
|
198
|
+
]);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
export {
|
|
203
|
+
Ke as default
|
|
204
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const e = Object.freeze({
|
|
2
|
+
/** 当前页码 key */
|
|
3
|
+
CURRENT_PAGE_KEY: "page.page",
|
|
4
|
+
/** 每页条数 key */
|
|
5
|
+
PAGE_SIZE_KEY: "page.pageSize",
|
|
6
|
+
/** 总数 key */
|
|
7
|
+
TOTAL_KEY: "page.totalRecord",
|
|
8
|
+
/** 数据列表 key */
|
|
9
|
+
LIST_KEY: "items"
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
e as APP_API_LIST_MODEL_KEY_CONFIG
|
|
13
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ElInput as e, ElInputNumber as m, ElSelect as n } from "element-plus";
|
|
2
|
+
import p from "../components/form/FormSelect.vue.mjs";
|
|
3
|
+
import s from "../components/form/FormSearch.vue.mjs";
|
|
4
|
+
import i from "../components/form/FormVerifyImage.vue.mjs";
|
|
5
|
+
import f from "../components/form/FormVerifyCode.vue.mjs";
|
|
6
|
+
import { setInputComponent as _, setSelectComponent as a } from "../components/form/utils.mjs";
|
|
7
|
+
const S = {
|
|
8
|
+
message: "限定20个以内字母、数字",
|
|
9
|
+
pattern: /^[0-9a-zA-Z]{0,20}$/,
|
|
10
|
+
trigger: "blur"
|
|
11
|
+
}, F = (o) => ({
|
|
12
|
+
validator: (l, t, r) => {
|
|
13
|
+
t !== o() ? r("两次输入密码不一致!") : r();
|
|
14
|
+
},
|
|
15
|
+
trigger: "blur"
|
|
16
|
+
}), I = `SELECT_ALL_${Date.now().toString(
|
|
17
|
+
36
|
|
18
|
+
)}`, A = () => {
|
|
19
|
+
_([
|
|
20
|
+
e,
|
|
21
|
+
m,
|
|
22
|
+
s,
|
|
23
|
+
i,
|
|
24
|
+
f
|
|
25
|
+
]), a([n, p]);
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
I as FORM_CONFIG_SELECT_ALL_VALUE,
|
|
29
|
+
F as getConfirmPasswordRule,
|
|
30
|
+
S as passwordRule,
|
|
31
|
+
A as setFormComponentType
|
|
32
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { getRoutePermissionKey as T } from "../utils/router.mjs";
|
|
2
|
+
import { ROUTE_MODULE_LEVEL as f } from "../config/route.mjs";
|
|
3
|
+
const K = (u) => {
|
|
4
|
+
const R = (E, {
|
|
5
|
+
parentPath: w = "",
|
|
6
|
+
parentPathList: g = [],
|
|
7
|
+
routeLevel: p = f,
|
|
8
|
+
sortFn: s,
|
|
9
|
+
mapFn: i,
|
|
10
|
+
filterFn: h
|
|
11
|
+
} = {}) => {
|
|
12
|
+
const a = [];
|
|
13
|
+
return E.forEach((L) => {
|
|
14
|
+
const { path: o, children: n, meta: S } = L, d = S;
|
|
15
|
+
if (!d) {
|
|
16
|
+
console.error(`路由${o}未配置meta`);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const { menu: e, redirectToFirstChildRoute: m = !0 } = d, { title: y, permission: t } = d, c = o.startsWith("/") ? o : `${w}/${o}`, M = [...g, c], l = T({
|
|
20
|
+
path: c,
|
|
21
|
+
permission: t
|
|
22
|
+
}), r = {
|
|
23
|
+
path: c,
|
|
24
|
+
title: y,
|
|
25
|
+
routeLevel: p,
|
|
26
|
+
redirectToFirstChildRoute: m,
|
|
27
|
+
menuShow: (e == null ? void 0 : e.show) ?? u.menuShow,
|
|
28
|
+
menuIcon: e == null ? void 0 : e.icon,
|
|
29
|
+
menuSort: (e == null ? void 0 : e.sort) || 0,
|
|
30
|
+
childrenRaw: Array.isArray(n) ? n : [],
|
|
31
|
+
children: n ? R(n, {
|
|
32
|
+
parentPath: c,
|
|
33
|
+
parentPathList: M,
|
|
34
|
+
routeLevel: p + 1,
|
|
35
|
+
filterFn: h,
|
|
36
|
+
mapFn: i,
|
|
37
|
+
sortFn: s
|
|
38
|
+
}) : [],
|
|
39
|
+
parentPath: w,
|
|
40
|
+
parentPathList: g,
|
|
41
|
+
permissionKey: l,
|
|
42
|
+
checkPermission: !!l,
|
|
43
|
+
permissionEditShow: l ? (t == null ? void 0 : t.editShow) ?? !0 : !1,
|
|
44
|
+
needLogin: (t == null ? void 0 : t.login) ?? u.needLogin
|
|
45
|
+
};
|
|
46
|
+
if (h && !h(
|
|
47
|
+
r,
|
|
48
|
+
r.children.length > 0,
|
|
49
|
+
r.childrenRaw.length > 0
|
|
50
|
+
))
|
|
51
|
+
return;
|
|
52
|
+
const P = i ? i(r) : r;
|
|
53
|
+
a.push(P);
|
|
54
|
+
}), s && a.sort(s), a;
|
|
55
|
+
};
|
|
56
|
+
return R;
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
K as createGenerateRouteMetaRawTree
|
|
60
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ref as I, computed as O, watch as J, reactive as N } from "vue";
|
|
2
|
+
import b from "lodash/cloneDeep";
|
|
3
|
+
const x = (m) => (s, { debug: l, moduleKey: a, cache: f, storage: e = localStorage } = {
|
|
4
|
+
debug: !1,
|
|
5
|
+
moduleKey: ""
|
|
6
|
+
}) => {
|
|
7
|
+
const i = `${m}/useState/${a}`;
|
|
8
|
+
let r;
|
|
9
|
+
if (f) {
|
|
10
|
+
const t = e.getItem(i);
|
|
11
|
+
try {
|
|
12
|
+
r = JSON.parse(t ?? "");
|
|
13
|
+
} catch {
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const $ = typeof s == "function" ? s() : s, n = () => b($), c = I(r || n()), d = O(() => c.value), h = () => {
|
|
17
|
+
c.value = n(), l && console.log(`[useState]
|
|
18
|
+
重置 ${a} store 状态属性
|
|
19
|
+
`);
|
|
20
|
+
}, v = (t = {}) => {
|
|
21
|
+
Object.entries(t).forEach(([o, u]) => {
|
|
22
|
+
const p = c.value, S = p[o];
|
|
23
|
+
S !== u && (l && console.log(`[useState]
|
|
24
|
+
${a} ${o} 变化更新: ${S} => ${u}
|
|
25
|
+
`), p[o] = u);
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
return f && J(
|
|
29
|
+
c,
|
|
30
|
+
(t) => {
|
|
31
|
+
e == null || e.setItem(i, JSON.stringify(t));
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
deep: !0,
|
|
35
|
+
immediate: !0
|
|
36
|
+
}
|
|
37
|
+
), N({
|
|
38
|
+
state: d,
|
|
39
|
+
getStateInit: n,
|
|
40
|
+
resetState: h,
|
|
41
|
+
updateState: v
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
x as createUseState
|
|
46
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const o = (r) => {
|
|
2
|
+
const t = (e) => `${r}/${e}`;
|
|
3
|
+
return {
|
|
4
|
+
setItem: (e, a) => localStorage.setItem(t(e), a),
|
|
5
|
+
getItem: (e) => localStorage.getItem(t(e)),
|
|
6
|
+
removeItem: (e) => localStorage.removeItem(t(e)),
|
|
7
|
+
clear: () => localStorage.clear(),
|
|
8
|
+
key: (e) => localStorage.key(e),
|
|
9
|
+
get length() {
|
|
10
|
+
return localStorage.length;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
o as createStorageWithNamespace
|
|
16
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { watch as i, ref as s, onMounted as n, onActivated as u, onDeactivated as v, onBeforeUnmount as d } from "vue";
|
|
2
|
+
const c = () => {
|
|
3
|
+
const e = s(!1);
|
|
4
|
+
return n(() => {
|
|
5
|
+
e.value = !0, u(() => {
|
|
6
|
+
e.value = !0;
|
|
7
|
+
});
|
|
8
|
+
}), v(() => {
|
|
9
|
+
e.value = !1;
|
|
10
|
+
}), d(() => {
|
|
11
|
+
e.value = !1;
|
|
12
|
+
}), {
|
|
13
|
+
isActivated: e
|
|
14
|
+
};
|
|
15
|
+
}, f = (e) => {
|
|
16
|
+
const { isActivated: t } = c();
|
|
17
|
+
i(
|
|
18
|
+
t,
|
|
19
|
+
(a) => {
|
|
20
|
+
a && e();
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
immediate: !0
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}, l = (e, t) => {
|
|
27
|
+
const { isActivated: a } = c();
|
|
28
|
+
i(
|
|
29
|
+
a,
|
|
30
|
+
(o) => {
|
|
31
|
+
o ? e() : t();
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
immediate: !0
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
c as useActivated,
|
|
40
|
+
l as useActivatedEvent,
|
|
41
|
+
f as useActivatedExec
|
|
42
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { shallowRef as c, ref as f, onBeforeMount as a, computed as h } from "vue";
|
|
2
|
+
const w = () => {
|
|
3
|
+
const t = c(), o = f(), n = new ResizeObserver((e) => {
|
|
4
|
+
for (const u of e) {
|
|
5
|
+
const { target: v, contentRect: i } = u;
|
|
6
|
+
v === t.value && (o.value = {
|
|
7
|
+
width: i.width,
|
|
8
|
+
height: i.height
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}), s = () => {
|
|
12
|
+
t.value && (n.unobserve(t.value), t.value = void 0, o.value = void 0);
|
|
13
|
+
}, r = (e) => {
|
|
14
|
+
e !== t.value && (s(), n.observe(e), t.value = e, o.value = {
|
|
15
|
+
width: e.offsetWidth,
|
|
16
|
+
height: e.offsetHeight
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
return a(() => {
|
|
20
|
+
s(), n.disconnect();
|
|
21
|
+
}), {
|
|
22
|
+
unwatchDom: s,
|
|
23
|
+
watchDom: r,
|
|
24
|
+
/** 元素尺寸信息只读属性 */
|
|
25
|
+
sizeInfo: h(() => o.value)
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
w as useFeelSize
|
|
30
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { computed as t } from "vue";
|
|
2
|
+
import { useRoute as F } from "vue-router";
|
|
3
|
+
import { ROUTE_MODULE_LEVEL as c } from "../config/route.mjs";
|
|
4
|
+
const O = ({
|
|
5
|
+
getMenus: v,
|
|
6
|
+
getMenuFlatList: d,
|
|
7
|
+
getExtractLevel1ToHeader: h
|
|
8
|
+
}) => {
|
|
9
|
+
const u = t(v), M = t(d), n = t(h), o = F(), r = t(() => M.value.find((e) => e.path === o.path)), f = t(
|
|
10
|
+
() => r.value && i(r.value, !0)
|
|
11
|
+
), a = t(() => {
|
|
12
|
+
if (!r.value) {
|
|
13
|
+
console.warn(
|
|
14
|
+
`当前 ${o.path} 未找到聚焦的菜单 可能路由配置不展示菜单`
|
|
15
|
+
);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
return r.value.routeLevel === c ? r.value.path : r.value.parentPathList[0];
|
|
19
|
+
}), l = t(() => a.value ? u.value.find((e) => e.path === a.value) : void 0), p = t(() => {
|
|
20
|
+
var e;
|
|
21
|
+
return (e = l.value) == null ? void 0 : e.children;
|
|
22
|
+
}), L = t(() => n.value ? p.value || [] : u.value), m = t(() => u.value.filter((e) => e.routeLevel === c)), C = t(
|
|
23
|
+
() => m.value.map((e) => ({
|
|
24
|
+
...e,
|
|
25
|
+
// 避免 展示子菜单
|
|
26
|
+
children: []
|
|
27
|
+
}))
|
|
28
|
+
), R = t(() => n.value ? C.value : []), i = (e, E) => {
|
|
29
|
+
if (e.redirectToFirstChildRoute) {
|
|
30
|
+
const s = e.children[0];
|
|
31
|
+
if (s)
|
|
32
|
+
return i(s, !1);
|
|
33
|
+
}
|
|
34
|
+
if (!E)
|
|
35
|
+
return e;
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
sidebarMenus: L,
|
|
39
|
+
headerMenus: R,
|
|
40
|
+
activeMenu: r,
|
|
41
|
+
activeModuleMenu: l,
|
|
42
|
+
needRedirectToFirstChildMenu: f
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
O as useMenusDataDispatch
|
|
47
|
+
};
|
package/es/index.mjs
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { formInstall as t } from "./components/form/index.mjs";
|
|
2
|
+
import { menuInstall as o } from "./components/menu/index.mjs";
|
|
3
|
+
import { displayInstall as r } from "./components/display/index.mjs";
|
|
4
|
+
import { miscInstall as a } from "./components/misc/index.mjs";
|
|
5
|
+
import { modalInstall as m } from "./components/modal/index.mjs";
|
|
6
|
+
import { tableInstall as f } from "./components/table/index.mjs";
|
|
7
|
+
import { listPageInstall as s } from "./components/list-page/index.mjs";
|
|
8
|
+
import { default as F } from "./components/modal/DetailModal.vue.mjs";
|
|
9
|
+
import { default as c } from "./components/form/FormMain.vue.mjs";
|
|
10
|
+
import { default as M } from "./components/form/FormRadioGroup.vue.mjs";
|
|
11
|
+
import { default as T } from "./components/form/FormSelect.vue.mjs";
|
|
12
|
+
import { default as D } from "./components/form/FormTree.vue.mjs";
|
|
13
|
+
import { default as O } from "./components/form/FormVerifyCode.vue.mjs";
|
|
14
|
+
import { default as P } from "./components/menu/MenuItemSub.vue.mjs";
|
|
15
|
+
import { default as N } from "./components/menu/MenuTree.vue.mjs";
|
|
16
|
+
import { default as h } from "./components/misc/TriggerAutoImport.vue.mjs";
|
|
17
|
+
import { default as y } from "./components/display/WatchSize.vue.mjs";
|
|
18
|
+
import { APP_API_LIST_MODEL_KEY_CONFIG as v } from "./config/list-model.mjs";
|
|
19
|
+
import { BODY_CONTENT_VIEWPORT_HEIGHT as H } from "./inject/key.mjs";
|
|
20
|
+
import { default as z } from "./components/modal/ConfirmModal.vue.mjs";
|
|
21
|
+
import { FORM_CONFIG_SELECT_ALL_VALUE as K, getConfirmPasswordRule as Y, passwordRule as j, setFormComponentType as k } from "./helpers/form.mjs";
|
|
22
|
+
import { FORM_ITEM_CHANGE_LOADING as J, generateFormData as Q, getBlurSubmit as X, getChangeSubmit as Z, getEnterSubmit as $, getPlaceholder as ee, getVModelSugar as te, parseFormData as oe, setInputComponent as re, setSelectComponent as ae, stringifyFormData as me, swiftFormItemConfig as fe } from "./components/form/utils.mjs";
|
|
23
|
+
import { default as le } from "./components/form/FormSearch.vue.mjs";
|
|
24
|
+
import { default as ie } from "./components/form/FormVerifyImage.vue.mjs";
|
|
25
|
+
import { default as ne } from "./components/list-page/ListPage.vue.mjs";
|
|
26
|
+
import { ROUTE_MODULE_LEVEL as de } from "./config/route.mjs";
|
|
27
|
+
import { default as ge } from "./components/table/TableMain.vue.mjs";
|
|
28
|
+
import { createGenerateRouteMetaRawTree as Fe } from "./helpers/route.mjs";
|
|
29
|
+
import { createStorageWithNamespace as ce } from "./helpers/storage.mjs";
|
|
30
|
+
import { createUseState as Me } from "./helpers/state.mjs";
|
|
31
|
+
import { flatRouteMetaResolveRaw as Te, getRoutePermissionKey as Re } from "./utils/router.mjs";
|
|
32
|
+
import { getId as Le } from "./utils/id.mjs";
|
|
33
|
+
import { timeCountDown as Ae } from "./utils/time.mjs";
|
|
34
|
+
import { useActivated as Ge, useActivatedEvent as Ne, useActivatedExec as be } from "./hooks/activated.mjs";
|
|
35
|
+
import { useFeelSize as we } from "./hooks/feel-size.mjs";
|
|
36
|
+
import { useMenusDataDispatch as Ve } from "./hooks/menus-dispatch.mjs";
|
|
37
|
+
const I = {
|
|
38
|
+
install(e) {
|
|
39
|
+
e.use(t), e.use(o), e.use(r), e.use(a), e.use(m), e.use(f), e.use(s);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
v as APP_API_LIST_MODEL_KEY_CONFIG,
|
|
44
|
+
H as BODY_CONTENT_VIEWPORT_HEIGHT,
|
|
45
|
+
z as ConfirmModal,
|
|
46
|
+
F as DetailModal,
|
|
47
|
+
K as FORM_CONFIG_SELECT_ALL_VALUE,
|
|
48
|
+
J as FORM_ITEM_CHANGE_LOADING,
|
|
49
|
+
c as FormMain,
|
|
50
|
+
M as FormRadioGroup,
|
|
51
|
+
le as FormSearch,
|
|
52
|
+
T as FormSelect,
|
|
53
|
+
D as FormTree,
|
|
54
|
+
O as FormVerifyCode,
|
|
55
|
+
ie as FormVerifyImage,
|
|
56
|
+
ne as ListPage,
|
|
57
|
+
P as MenuItemSub,
|
|
58
|
+
N as MenuTree,
|
|
59
|
+
de as ROUTE_MODULE_LEVEL,
|
|
60
|
+
ge as TableMain,
|
|
61
|
+
h as TriggerAutoImport,
|
|
62
|
+
y as WatchSize,
|
|
63
|
+
Fe as createGenerateRouteMetaRawTree,
|
|
64
|
+
ce as createStorageWithNamespace,
|
|
65
|
+
Me as createUseState,
|
|
66
|
+
r as displayInstall,
|
|
67
|
+
Te as flatRouteMetaResolveRaw,
|
|
68
|
+
t as formInstall,
|
|
69
|
+
Q as generateFormData,
|
|
70
|
+
X as getBlurSubmit,
|
|
71
|
+
Z as getChangeSubmit,
|
|
72
|
+
Y as getConfirmPasswordRule,
|
|
73
|
+
$ as getEnterSubmit,
|
|
74
|
+
Le as getId,
|
|
75
|
+
ee as getPlaceholder,
|
|
76
|
+
Re as getRoutePermissionKey,
|
|
77
|
+
te as getVModelSugar,
|
|
78
|
+
I as installComponents,
|
|
79
|
+
s as listPageInstall,
|
|
80
|
+
o as menuInstall,
|
|
81
|
+
a as miscInstall,
|
|
82
|
+
m as modalInstall,
|
|
83
|
+
oe as parseFormData,
|
|
84
|
+
j as passwordRule,
|
|
85
|
+
k as setFormComponentType,
|
|
86
|
+
re as setInputComponent,
|
|
87
|
+
ae as setSelectComponent,
|
|
88
|
+
me as stringifyFormData,
|
|
89
|
+
fe as swiftFormItemConfig,
|
|
90
|
+
f as tableInstall,
|
|
91
|
+
Ae as timeCountDown,
|
|
92
|
+
Ge as useActivated,
|
|
93
|
+
Ne as useActivatedEvent,
|
|
94
|
+
be as useActivatedExec,
|
|
95
|
+
we as useFeelSize,
|
|
96
|
+
Ve as useMenusDataDispatch
|
|
97
|
+
};
|
package/es/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.form-item-tip[data-v-e889a0ed]{text-align:left;line-height:1.5;font-size:12px}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-main-table[data-v-173e1cb3]{--el-table-header-bg-color: var(--v2c344d25)}.table-main-pagination[data-v-173e1cb3]{margin-top:10px;display:flex;justify-content:flex-end}.list-page[data-v-167d5788]{min-height:var(--v20e95162)}.list-page-operation[data-v-167d5788]{margin-bottom:10px}.list-page[data-v-167d5788] .el-loading-mask{left:-10px;top:-10px;right:-10px;bottom:-10px}
|
package/es/utils/id.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const r = ({
|
|
2
|
+
path: s,
|
|
3
|
+
permission: e
|
|
4
|
+
}) => {
|
|
5
|
+
if (!e)
|
|
6
|
+
return;
|
|
7
|
+
const { key: t, keyUsePath: n } = e;
|
|
8
|
+
if (t)
|
|
9
|
+
return t;
|
|
10
|
+
if (n)
|
|
11
|
+
return s;
|
|
12
|
+
}, o = (s, e = []) => (s.forEach((t) => {
|
|
13
|
+
e.push(t), o(t.children, e);
|
|
14
|
+
}), e);
|
|
15
|
+
export {
|
|
16
|
+
o as flatRouteMetaResolveRaw,
|
|
17
|
+
r as getRoutePermissionKey
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const p = (o, t, a) => {
|
|
2
|
+
let e;
|
|
3
|
+
const n = Date.now() + o * 1e3, c = 1e3;
|
|
4
|
+
function i() {
|
|
5
|
+
e = setTimeout(() => {
|
|
6
|
+
const m = Date.now();
|
|
7
|
+
if (n - m > 0) {
|
|
8
|
+
const s = Math.round((n - m) / 1e3);
|
|
9
|
+
t(Math.max(s, 0)), i();
|
|
10
|
+
} else
|
|
11
|
+
t(0), a();
|
|
12
|
+
}, c);
|
|
13
|
+
}
|
|
14
|
+
return i(), () => clearTimeout(e);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
p as timeCountDown
|
|
18
|
+
};
|