@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,36 @@
|
|
|
1
|
+
import { ElRadioGroup as i, ElRadio as p } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/radio-group/style/css";
|
|
4
|
+
import "element-plus/es/components/radio/style/css";
|
|
5
|
+
import { defineComponent as u, openBlock as e, createBlock as t, withCtx as r, createElementBlock as d, Fragment as c, renderList as s, createTextVNode as m, toDisplayString as _ } from "vue";
|
|
6
|
+
const G = /* @__PURE__ */ u({
|
|
7
|
+
name: "FormRadioGroup",
|
|
8
|
+
inheritAttrs: !0,
|
|
9
|
+
__name: "FormRadioGroup",
|
|
10
|
+
props: {
|
|
11
|
+
options: {}
|
|
12
|
+
},
|
|
13
|
+
setup(a) {
|
|
14
|
+
return (f, R) => {
|
|
15
|
+
const n = p, l = i;
|
|
16
|
+
return e(), t(l, null, {
|
|
17
|
+
default: r(() => [
|
|
18
|
+
(e(!0), d(c, null, s(a.options, (o) => (e(), t(n, {
|
|
19
|
+
key: o.value,
|
|
20
|
+
value: o.value,
|
|
21
|
+
disabled: o.disabled
|
|
22
|
+
}, {
|
|
23
|
+
default: r(() => [
|
|
24
|
+
m(_(o.label), 1)
|
|
25
|
+
]),
|
|
26
|
+
_: 2
|
|
27
|
+
}, 1032, ["value", "disabled"]))), 128))
|
|
28
|
+
]),
|
|
29
|
+
_: 1
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
G as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import V from "./FormMain.vue.mjs";
|
|
2
|
+
import { ElCol as k, ElButton as M } from "element-plus/es";
|
|
3
|
+
import "element-plus/es/components/base/style/css";
|
|
4
|
+
import "element-plus/es/components/col/style/css";
|
|
5
|
+
import "element-plus/es/components/button/style/css";
|
|
6
|
+
import { defineComponent as B, useAttrs as R, ref as W, computed as $, shallowRef as D, openBlock as N, createBlock as Q, normalizeClass as z, unref as i, withCtx as r, withDirectives as A, createVNode as m, mergeProps as H, createSlots as L, normalizeProps as g, guardReactiveProps as v, createElementVNode as T, createTextVNode as y, renderList as j, renderSlot as q, vShow as G } from "vue";
|
|
7
|
+
import { stringifyFormData as I } from "./utils.mjs";
|
|
8
|
+
import J from "../display/WatchSize.vue.mjs";
|
|
9
|
+
const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
|
|
10
|
+
name: "FormSearch",
|
|
11
|
+
inheritAttrs: !1,
|
|
12
|
+
__name: "FormSearch",
|
|
13
|
+
props: {
|
|
14
|
+
labelPosition: { default: "right" },
|
|
15
|
+
labelWidth: { default: "auto" },
|
|
16
|
+
staticQuery: {},
|
|
17
|
+
list: {},
|
|
18
|
+
data: {},
|
|
19
|
+
layout: { default: () => ({
|
|
20
|
+
xs: 24,
|
|
21
|
+
sm: 12,
|
|
22
|
+
md: 12,
|
|
23
|
+
lg: 8,
|
|
24
|
+
xl: 6
|
|
25
|
+
}) }
|
|
26
|
+
},
|
|
27
|
+
emits: ["search", "heightChange", "visibleChange"],
|
|
28
|
+
setup(o, { expose: b, emit: C }) {
|
|
29
|
+
const s = o, l = C, w = R(), u = W(!1), x = $(() => s.data), S = (e) => {
|
|
30
|
+
l("heightChange", e);
|
|
31
|
+
}, a = D(), d = (e) => ({
|
|
32
|
+
...s.staticQuery || {},
|
|
33
|
+
...I(e, s.list)
|
|
34
|
+
}), h = () => {
|
|
35
|
+
var e;
|
|
36
|
+
(e = a.value) == null || e.resetFields(), l("search", d(s.data), "reset");
|
|
37
|
+
}, c = (e = "search") => {
|
|
38
|
+
var t;
|
|
39
|
+
(t = a.value) == null || t.validate().then(() => {
|
|
40
|
+
l("search", d(s.data), e);
|
|
41
|
+
});
|
|
42
|
+
}, F = (e) => {
|
|
43
|
+
c(e);
|
|
44
|
+
};
|
|
45
|
+
b({
|
|
46
|
+
validate: () => {
|
|
47
|
+
if (a.value)
|
|
48
|
+
return a.value.validate();
|
|
49
|
+
throw new Error("实例化未完成");
|
|
50
|
+
},
|
|
51
|
+
resetFields: () => {
|
|
52
|
+
var e;
|
|
53
|
+
return (e = a.value) == null ? void 0 : e.resetFields();
|
|
54
|
+
},
|
|
55
|
+
clearValidate: (e) => {
|
|
56
|
+
var t;
|
|
57
|
+
return (t = a.value) == null ? void 0 : t.clearValidate(e);
|
|
58
|
+
},
|
|
59
|
+
triggerReset: h,
|
|
60
|
+
triggerSearch: () => c()
|
|
61
|
+
});
|
|
62
|
+
const _ = (e) => {
|
|
63
|
+
u.value = e, l("visibleChange", e);
|
|
64
|
+
};
|
|
65
|
+
return (e, t) => {
|
|
66
|
+
const f = M, P = k, E = V;
|
|
67
|
+
return N(), Q(J, {
|
|
68
|
+
class: z(["form-search", {
|
|
69
|
+
"form-search_show": i(u)
|
|
70
|
+
}]),
|
|
71
|
+
onHeightChange: S
|
|
72
|
+
}, {
|
|
73
|
+
default: r(() => [
|
|
74
|
+
A(m(E, H({
|
|
75
|
+
ref_key: "formMain",
|
|
76
|
+
ref: a,
|
|
77
|
+
list: o.list,
|
|
78
|
+
data: i(x)
|
|
79
|
+
}, i(w), {
|
|
80
|
+
layout: o.layout,
|
|
81
|
+
labelPosition: o.labelPosition,
|
|
82
|
+
labelWidth: o.labelWidth,
|
|
83
|
+
onSubmit: F,
|
|
84
|
+
onVisibleChange: _
|
|
85
|
+
}), L({
|
|
86
|
+
default: r(({ mergeLayout: n }) => [
|
|
87
|
+
m(P, g(v(n())), {
|
|
88
|
+
default: r(() => [
|
|
89
|
+
T("div", K, [
|
|
90
|
+
m(f, {
|
|
91
|
+
type: "primary",
|
|
92
|
+
onMousedown: h
|
|
93
|
+
}, {
|
|
94
|
+
default: r(() => [...t[1] || (t[1] = [
|
|
95
|
+
y("重置", -1)
|
|
96
|
+
])]),
|
|
97
|
+
_: 1
|
|
98
|
+
}),
|
|
99
|
+
m(f, {
|
|
100
|
+
type: "primary",
|
|
101
|
+
onMousedown: t[0] || (t[0] = (p) => c())
|
|
102
|
+
}, {
|
|
103
|
+
default: r(() => [...t[2] || (t[2] = [
|
|
104
|
+
y("查询", -1)
|
|
105
|
+
])]),
|
|
106
|
+
_: 1
|
|
107
|
+
})
|
|
108
|
+
])
|
|
109
|
+
]),
|
|
110
|
+
_: 1
|
|
111
|
+
}, 16)
|
|
112
|
+
]),
|
|
113
|
+
_: 2
|
|
114
|
+
}, [
|
|
115
|
+
j(o.list, (n) => ({
|
|
116
|
+
name: n.key,
|
|
117
|
+
fn: r((p) => [
|
|
118
|
+
q(e.$slots, n.key, g(v(p)), void 0, !0)
|
|
119
|
+
])
|
|
120
|
+
}))
|
|
121
|
+
]), 1040, ["list", "data", "layout", "labelPosition", "labelWidth"]), [
|
|
122
|
+
[G, i(u)]
|
|
123
|
+
])
|
|
124
|
+
]),
|
|
125
|
+
_: 3
|
|
126
|
+
}, 8, ["class"]);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
export {
|
|
131
|
+
re as default
|
|
132
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ElSelect as E, ElOption as S } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/select/style/css";
|
|
4
|
+
import "element-plus/es/components/option/style/css";
|
|
5
|
+
import { defineComponent as k, useAttrs as w, ref as f, computed as n, onMounted as B, watch as F, openBlock as m, createBlock as h, mergeProps as _, unref as r, withCtx as v, createElementBlock as x, Fragment as y, renderList as D, normalizeClass as z, renderSlot as A } from "vue";
|
|
6
|
+
const j = /* @__PURE__ */ k({
|
|
7
|
+
name: "FormSelect",
|
|
8
|
+
__name: "FormSelect",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: {},
|
|
11
|
+
options: { default: () => [] },
|
|
12
|
+
remoteMethod: {},
|
|
13
|
+
itemCls: {},
|
|
14
|
+
getOptions: {}
|
|
15
|
+
},
|
|
16
|
+
emits: ["update:modelValue", "detailChange"],
|
|
17
|
+
setup(l, { emit: b }) {
|
|
18
|
+
const t = l, d = b, M = w(), u = f([]), i = f([]), s = n(() => !!t.remoteMethod), O = n(() => t.getOptions ? u.value : t.options), c = n(() => s.value ? i.value : O.value), V = n(() => c.value.find((e) => e.value === t.modelValue)), p = async (e) => {
|
|
19
|
+
i.value = await t.remoteMethod(e);
|
|
20
|
+
};
|
|
21
|
+
return B(() => {
|
|
22
|
+
var e;
|
|
23
|
+
t.remoteMethod ? p() : (e = t.getOptions) == null || e.call(t).then((a) => {
|
|
24
|
+
u.value = a;
|
|
25
|
+
});
|
|
26
|
+
}), F(
|
|
27
|
+
V,
|
|
28
|
+
(e) => {
|
|
29
|
+
d("detailChange", e);
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
immediate: !0
|
|
33
|
+
}
|
|
34
|
+
), (e, a) => {
|
|
35
|
+
const g = S, C = E;
|
|
36
|
+
return m(), h(C, _({
|
|
37
|
+
modelValue: l.modelValue,
|
|
38
|
+
remote: r(s),
|
|
39
|
+
filterable: r(s),
|
|
40
|
+
remoteMethod: l.remoteMethod && p
|
|
41
|
+
}, r(M), {
|
|
42
|
+
"onUpdate:modelValue": a[0] || (a[0] = (o) => d("update:modelValue", o))
|
|
43
|
+
}), {
|
|
44
|
+
default: v(() => [
|
|
45
|
+
(m(!0), x(y, null, D(r(c), (o) => (m(), h(g, {
|
|
46
|
+
key: o.value,
|
|
47
|
+
class: z(l.itemCls),
|
|
48
|
+
label: o.label,
|
|
49
|
+
value: o.value,
|
|
50
|
+
disabled: o.disabled
|
|
51
|
+
}, {
|
|
52
|
+
default: v(() => [
|
|
53
|
+
A(e.$slots, "option", { data: o })
|
|
54
|
+
]),
|
|
55
|
+
_: 2
|
|
56
|
+
}, 1032, ["class", "label", "value", "disabled"]))), 128))
|
|
57
|
+
]),
|
|
58
|
+
_: 3
|
|
59
|
+
}, 16, ["modelValue", "remote", "filterable", "remoteMethod"]);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
export {
|
|
64
|
+
j as default
|
|
65
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ElTree as c } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/tree/style/css";
|
|
4
|
+
import { defineComponent as m, openBlock as r, createBlock as u } from "vue";
|
|
5
|
+
const i = /* @__PURE__ */ m({
|
|
6
|
+
__name: "FormTree",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: {},
|
|
9
|
+
tree: { default: () => [] },
|
|
10
|
+
showCheckbox: { type: Boolean },
|
|
11
|
+
defaultExpandAll: { type: Boolean }
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(e, { emit: o }) {
|
|
15
|
+
const l = o, a = (d, { checkedKeys: t }) => {
|
|
16
|
+
l("update:modelValue", t);
|
|
17
|
+
};
|
|
18
|
+
return (d, t) => {
|
|
19
|
+
const n = c;
|
|
20
|
+
return r(), u(n, {
|
|
21
|
+
ref: "elTree",
|
|
22
|
+
data: e.tree,
|
|
23
|
+
showCheckbox: e.showCheckbox,
|
|
24
|
+
nodeKey: "id",
|
|
25
|
+
defaultCheckedKeys: e.modelValue,
|
|
26
|
+
defaultExpandAll: e.defaultExpandAll,
|
|
27
|
+
onCheck: a
|
|
28
|
+
}, null, 8, ["data", "showCheckbox", "defaultCheckedKeys", "defaultExpandAll"]);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
i as default
|
|
34
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ElInput as B, ElButton as g } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/input/style/css";
|
|
4
|
+
import "element-plus/es/components/button/style/css";
|
|
5
|
+
import { defineComponent as h, ref as u, computed as x, onBeforeUnmount as _, watch as E, openBlock as n, createBlock as I, withCtx as r, createVNode as T, unref as a, createElementBlock as p, toDisplayString as c } from "vue";
|
|
6
|
+
import { timeCountDown as z } from "../../utils/time.mjs";
|
|
7
|
+
const K = { key: 0 }, U = { key: 1 }, A = /* @__PURE__ */ h({
|
|
8
|
+
__name: "FormVerifyCode",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: {},
|
|
11
|
+
hz: { default: 60 },
|
|
12
|
+
api: {},
|
|
13
|
+
params: {},
|
|
14
|
+
resetKey: {},
|
|
15
|
+
disabled: { type: Boolean },
|
|
16
|
+
btnText: { default: "发送验证码" }
|
|
17
|
+
},
|
|
18
|
+
emits: ["update:modelValue"],
|
|
19
|
+
setup(o, { emit: f }) {
|
|
20
|
+
const l = o, y = f, t = u(0), d = u(!1), i = x(() => t.value > 0);
|
|
21
|
+
let e;
|
|
22
|
+
const V = () => {
|
|
23
|
+
d.value = !0, console.log("发送验证码"), l.api(l.params).then(() => {
|
|
24
|
+
t.value = l.hz, e == null || e(), e = z(
|
|
25
|
+
t.value,
|
|
26
|
+
(s) => {
|
|
27
|
+
t.value = s;
|
|
28
|
+
},
|
|
29
|
+
() => {
|
|
30
|
+
console.log("倒计时结束");
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}).finally(() => {
|
|
34
|
+
d.value = !1;
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
return _(() => {
|
|
38
|
+
e == null || e();
|
|
39
|
+
}), E(
|
|
40
|
+
() => l.resetKey,
|
|
41
|
+
() => {
|
|
42
|
+
e == null || e(), t.value = 0;
|
|
43
|
+
}
|
|
44
|
+
), (s, m) => {
|
|
45
|
+
const b = g, v = B;
|
|
46
|
+
return n(), I(v, {
|
|
47
|
+
modelValue: o.modelValue,
|
|
48
|
+
disabled: o.disabled,
|
|
49
|
+
"onUpdate:modelValue": m[0] || (m[0] = (k) => y("update:modelValue", k))
|
|
50
|
+
}, {
|
|
51
|
+
suffix: r(() => [
|
|
52
|
+
T(b, {
|
|
53
|
+
type: "primary",
|
|
54
|
+
link: "",
|
|
55
|
+
loading: a(d),
|
|
56
|
+
disabled: a(i) || o.disabled,
|
|
57
|
+
onClick: V
|
|
58
|
+
}, {
|
|
59
|
+
default: r(() => [
|
|
60
|
+
a(i) ? (n(), p("span", K, c(a(t)) + "s后可重新发送", 1)) : (n(), p("span", U, c(o.btnText), 1))
|
|
61
|
+
]),
|
|
62
|
+
_: 1
|
|
63
|
+
}, 8, ["loading", "disabled"])
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
}, 8, ["modelValue", "disabled"]);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
A as default
|
|
72
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ElInput as x } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/input/style/css";
|
|
4
|
+
import { defineComponent as V, ref as r, computed as s, onMounted as _, openBlock as k, createBlock as U, normalizeStyle as u, unref as o, withCtx as I, createElementVNode as c } from "vue";
|
|
5
|
+
const R = ["disabled"], $ = ["src"], d = "9px", E = /* @__PURE__ */ V({
|
|
6
|
+
__name: "FormVerifyImage",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: {},
|
|
9
|
+
imgWidth: { default: 100 },
|
|
10
|
+
api: {},
|
|
11
|
+
params: {},
|
|
12
|
+
autoRevokeUrl: { type: Boolean }
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:modelValue"],
|
|
15
|
+
setup(a, { emit: f }) {
|
|
16
|
+
const e = a, p = f, t = r(!1), l = r(""), g = s(() => ({
|
|
17
|
+
left: `calc(100% + ${d})`,
|
|
18
|
+
width: `${e.imgWidth}px`
|
|
19
|
+
})), v = s(() => ({
|
|
20
|
+
width: `calc(100% - ${d} - ${e.imgWidth}px)`
|
|
21
|
+
})), i = () => {
|
|
22
|
+
t.value || (console.log("获取图片验证码"), t.value = !0, l.value && e.autoRevokeUrl && URL.revokeObjectURL(l.value), e.api(e.params).then((n) => {
|
|
23
|
+
l.value = n;
|
|
24
|
+
}).finally(() => {
|
|
25
|
+
t.value = !1;
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
28
|
+
return _(() => {
|
|
29
|
+
i();
|
|
30
|
+
}), (n, m) => {
|
|
31
|
+
const y = x;
|
|
32
|
+
return k(), U(y, {
|
|
33
|
+
placeholder: "验证码",
|
|
34
|
+
modelValue: a.modelValue,
|
|
35
|
+
class: "form-verify-image",
|
|
36
|
+
style: u(o(v)),
|
|
37
|
+
"onUpdate:modelValue": m[0] || (m[0] = (h) => p("update:modelValue", h))
|
|
38
|
+
}, {
|
|
39
|
+
suffix: I(() => [
|
|
40
|
+
c("div", {
|
|
41
|
+
class: "form-verify-image-suffix",
|
|
42
|
+
style: u(o(g)),
|
|
43
|
+
disabled: o(t),
|
|
44
|
+
onClick: i
|
|
45
|
+
}, [
|
|
46
|
+
c("img", {
|
|
47
|
+
class: "form-verify-image-suffix-main",
|
|
48
|
+
src: o(l),
|
|
49
|
+
alt: ""
|
|
50
|
+
}, null, 8, $)
|
|
51
|
+
], 12, R)
|
|
52
|
+
]),
|
|
53
|
+
_: 1
|
|
54
|
+
}, 8, ["modelValue", "style"]);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
export {
|
|
59
|
+
E as default
|
|
60
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import e from "./FormMain.vue.mjs";
|
|
2
|
+
import i from "./FormSelect.vue.mjs";
|
|
3
|
+
import a from "./FormRadioGroup.vue.mjs";
|
|
4
|
+
import t from "./FormTree.vue.mjs";
|
|
5
|
+
import f from "./FormSearch.vue.mjs";
|
|
6
|
+
import n from "./FormVerifyImage.vue.mjs";
|
|
7
|
+
import s from "./FormVerifyCode.vue.mjs";
|
|
8
|
+
const c = {
|
|
9
|
+
FormMain: e,
|
|
10
|
+
FormSelect: i,
|
|
11
|
+
FormRadioGroup: a,
|
|
12
|
+
FormTree: t,
|
|
13
|
+
FormSearch: f,
|
|
14
|
+
FormVerifyImage: n,
|
|
15
|
+
FormVerifyCode: s
|
|
16
|
+
}, S = {
|
|
17
|
+
install(o) {
|
|
18
|
+
Object.entries(c).forEach(([r, m]) => {
|
|
19
|
+
o.component(r, m);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
e as FormMain,
|
|
25
|
+
a as FormRadioGroup,
|
|
26
|
+
f as FormSearch,
|
|
27
|
+
i as FormSelect,
|
|
28
|
+
t as FormTree,
|
|
29
|
+
s as FormVerifyCode,
|
|
30
|
+
n as FormVerifyImage,
|
|
31
|
+
S as formInstall
|
|
32
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import p from "lodash/cloneDeep";
|
|
2
|
+
const u = (t) => {
|
|
3
|
+
const { ignore: r, key: e } = t;
|
|
4
|
+
return r || e.startsWith("__") && e.toUpperCase() === e;
|
|
5
|
+
}, m = (t) => typeof t == "function", I = (t) => t.reduce(
|
|
6
|
+
(r, e) => (u(e) || (typeof e.init == "object" && console.error(
|
|
7
|
+
`表单项${e.label}的初始值不能为对象 请设置为返回值的形式`
|
|
8
|
+
), r[e.key] = m(e.init) ? e.init() : e.init), r),
|
|
9
|
+
{}
|
|
10
|
+
), S = (t, r) => {
|
|
11
|
+
const e = p(t);
|
|
12
|
+
return r.reduce(
|
|
13
|
+
(i, n) => {
|
|
14
|
+
if (u(n)) return i;
|
|
15
|
+
if (n.parse) {
|
|
16
|
+
const s = n.parse(
|
|
17
|
+
t[n.key],
|
|
18
|
+
i,
|
|
19
|
+
e
|
|
20
|
+
);
|
|
21
|
+
s !== void 0 && (i[n.key] = s);
|
|
22
|
+
} else
|
|
23
|
+
i[n.key] = t[n.key];
|
|
24
|
+
return i;
|
|
25
|
+
},
|
|
26
|
+
{}
|
|
27
|
+
);
|
|
28
|
+
}, d = (t, r) => {
|
|
29
|
+
const e = p(t);
|
|
30
|
+
return r.reduce(
|
|
31
|
+
(i, n) => {
|
|
32
|
+
if (u(n)) return i;
|
|
33
|
+
if (n.stringify) {
|
|
34
|
+
const s = n.stringify(
|
|
35
|
+
t[n.key],
|
|
36
|
+
i,
|
|
37
|
+
e
|
|
38
|
+
);
|
|
39
|
+
s !== void 0 && (i[n.key] = s);
|
|
40
|
+
} else
|
|
41
|
+
i[n.key] = t[n.key];
|
|
42
|
+
return i;
|
|
43
|
+
},
|
|
44
|
+
{}
|
|
45
|
+
);
|
|
46
|
+
}, C = ({
|
|
47
|
+
modelValueKey: t = "modelValue",
|
|
48
|
+
config: r,
|
|
49
|
+
data: e,
|
|
50
|
+
updateData: i = (n) => {
|
|
51
|
+
e[r.key] = n;
|
|
52
|
+
}
|
|
53
|
+
}) => ({
|
|
54
|
+
[t]: e[r.key],
|
|
55
|
+
[`onUpdate:${t}`]: (n) => {
|
|
56
|
+
i(n);
|
|
57
|
+
}
|
|
58
|
+
}), _ = (t) => {
|
|
59
|
+
var r, e;
|
|
60
|
+
return (r = t.extra) != null && r.isInput ? {
|
|
61
|
+
placeholder: `请输入${t.label}`
|
|
62
|
+
} : (e = t.extra) != null && e.isSelect ? {
|
|
63
|
+
placeholder: `请选择${t.label}`
|
|
64
|
+
} : {};
|
|
65
|
+
}, O = (t, r) => {
|
|
66
|
+
const { extra: e } = t;
|
|
67
|
+
if (e != null && e.enterSubmit)
|
|
68
|
+
return {
|
|
69
|
+
onKeyup: (i) => {
|
|
70
|
+
var n, s;
|
|
71
|
+
i.key === "Enter" && (r(), (s = (n = i.target) == null ? void 0 : n.blur) == null || s.call(n));
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}, h = (t, r) => {
|
|
75
|
+
const { extra: e } = t;
|
|
76
|
+
if (e != null && e.isInput && ((e == null ? void 0 : e.blurSubmit) ?? !0))
|
|
77
|
+
return {
|
|
78
|
+
onBlur: r
|
|
79
|
+
};
|
|
80
|
+
}, E = (t, r) => {
|
|
81
|
+
const { extra: e } = t;
|
|
82
|
+
if (e != null && e.isSelect && ((e == null ? void 0 : e.changeSubmit) ?? !0))
|
|
83
|
+
return {
|
|
84
|
+
onChange: r
|
|
85
|
+
};
|
|
86
|
+
}, N = Symbol("FORM_ITEM_CHANGE_LOADING"), k = (t) => t.required === !0, f = [], y = [], a = (t) => {
|
|
87
|
+
f.push(...t);
|
|
88
|
+
}, c = (t) => {
|
|
89
|
+
y.push(...t);
|
|
90
|
+
}, D = (t) => {
|
|
91
|
+
const { label: r, type: e, ...i } = t;
|
|
92
|
+
let n;
|
|
93
|
+
if (e)
|
|
94
|
+
n = e;
|
|
95
|
+
else {
|
|
96
|
+
const { render: o } = t;
|
|
97
|
+
o && (f.includes(o) ? n = "input" : y.includes(o) && (n = "select"));
|
|
98
|
+
}
|
|
99
|
+
let s;
|
|
100
|
+
n === "input" && (s = {
|
|
101
|
+
...i.extra || {},
|
|
102
|
+
isInput: !0
|
|
103
|
+
}), n === "select" && (s = {
|
|
104
|
+
...i.extra || {},
|
|
105
|
+
isSelect: !0
|
|
106
|
+
});
|
|
107
|
+
let l;
|
|
108
|
+
if (k(t)) {
|
|
109
|
+
l = [
|
|
110
|
+
{
|
|
111
|
+
required: !0,
|
|
112
|
+
message: `请${{
|
|
113
|
+
input: "输入",
|
|
114
|
+
select: "选择",
|
|
115
|
+
unknown: "填写"
|
|
116
|
+
}[n ?? "unknown"]}${r}`,
|
|
117
|
+
trigger: "blur"
|
|
118
|
+
}
|
|
119
|
+
];
|
|
120
|
+
const { required: o, ...g } = i;
|
|
121
|
+
return {
|
|
122
|
+
label: r,
|
|
123
|
+
extra: s,
|
|
124
|
+
rules: l,
|
|
125
|
+
...g
|
|
126
|
+
};
|
|
127
|
+
} else
|
|
128
|
+
return {
|
|
129
|
+
label: r,
|
|
130
|
+
extra: s,
|
|
131
|
+
...i
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
export {
|
|
135
|
+
N as FORM_ITEM_CHANGE_LOADING,
|
|
136
|
+
I as generateFormData,
|
|
137
|
+
h as getBlurSubmit,
|
|
138
|
+
E as getChangeSubmit,
|
|
139
|
+
O as getEnterSubmit,
|
|
140
|
+
_ as getPlaceholder,
|
|
141
|
+
C as getVModelSugar,
|
|
142
|
+
S as parseFormData,
|
|
143
|
+
a as setInputComponent,
|
|
144
|
+
c as setSelectComponent,
|
|
145
|
+
d as stringifyFormData,
|
|
146
|
+
D as swiftFormItemConfig
|
|
147
|
+
};
|