@done-coding/admin-core 0.8.3-alpha.0 → 0.9.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/docs/nested-config-paradigm.md +80 -0
- 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 +65 -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/FormItemNestForm.vue.mjs +7 -0
- package/es/components/form/FormItemNestForm.vue2.mjs +49 -0
- package/es/components/form/FormItemNestFormList.vue.mjs +7 -0
- package/es/components/form/FormItemNestFormList.vue2.mjs +137 -0
- package/es/components/form/FormMain.vue.mjs +5 -147
- package/es/components/form/FormMain.vue2.mjs +160 -2
- package/es/components/form/FormRadioGroup.vue.mjs +42 -49
- package/es/components/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +122 -128
- 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 +29 -28
- 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/form/nest-form-item-list.mjs +71 -0
- package/es/components/form/nest-form-item.mjs +42 -0
- package/es/components/form/nest-registry.mjs +7 -0
- package/es/components/form/use-nest-form-list.mjs +22 -0
- package/es/components/form/use-nest-form.mjs +34 -0
- package/es/components/form/use-nest-layout-scale.mjs +14 -0
- package/es/components/form/utils.mjs +77 -61
- 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 -4
- package/es/components/modal/ConfirmModal.vue2.mjs +83 -111
- 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/PanelItemNestForm.vue.mjs +7 -0
- package/es/components/panel/PanelItemNestForm.vue2.mjs +69 -0
- package/es/components/panel/PanelItemNestPanel.vue.mjs +34 -0
- package/es/components/panel/PanelItemNestPanel.vue2.mjs +4 -0
- package/es/components/panel/PanelMain.vue.mjs +1 -1
- package/es/components/panel/PanelMain.vue2.mjs +72 -72
- package/es/components/panel/nest-panel-form.mjs +53 -0
- package/es/components/panel/nest-panel-item.mjs +25 -0
- 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 +190 -153
- package/es/inject/key.mjs +15 -6
- 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 +85 -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/FormItemNestForm.vue.d.ts +36 -0
- package/types/components/form/FormItemNestFormList.vue.d.ts +63 -0
- package/types/components/form/FormMain.vue.d.ts +2 -2
- package/types/components/form/FormSearch.vue.d.ts +2 -2
- package/types/components/form/FormTree.vue.d.ts +50 -50
- package/types/components/form/index.d.ts +9 -1
- package/types/components/form/nest-form-item-list.d.ts +63 -0
- package/types/components/form/nest-form-item.d.ts +36 -0
- package/types/components/form/nest-registry.d.ts +22 -0
- package/types/components/form/types.d.ts +2 -0
- package/types/components/form/use-nest-form-list.d.ts +20 -0
- package/types/components/form/use-nest-form.d.ts +26 -0
- package/types/components/form/use-nest-layout-scale.d.ts +17 -0
- package/types/components/form/utils.d.ts +26 -1
- package/types/components/menu/MenuTree.vue.d.ts +10 -10
- package/types/components/modal/ModalShelf.vue.d.ts +1 -1
- package/types/components/panel/PanelItemNestForm.vue.d.ts +35 -0
- package/types/components/panel/PanelItemNestPanel.vue.d.ts +22 -0
- package/types/components/panel/index.d.ts +5 -1
- package/types/components/panel/nest-panel-form.d.ts +38 -0
- package/types/components/panel/nest-panel-item.d.ts +28 -0
- package/types/components/panel/types.d.ts +2 -0
- package/types/components/table/TableMain.vue.d.ts +3 -3
- 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 +46 -1
- 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,149 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
import "element-plus/es/components/col/style/css";
|
|
6
|
-
import { defineComponent as H, shallowRef as N, ref as _, computed as u, provide as P, watch as y, openBlock as p, createBlock as L, unref as h, withCtx as m, createVNode as O, createElementBlock as T, Fragment as q, renderList as z, withDirectives as J, mergeProps as V, renderSlot as j, vShow as Q } from "vue";
|
|
7
|
-
import U from "./FormItem.vue.mjs";
|
|
8
|
-
import { FORM_ITEM_CHANGE_LOADING as W, stringifyFormData as X, parseFormData as Y, generateFormData as Z, resolveFormLayout as S } from "./utils.mjs";
|
|
9
|
-
const me = /* @__PURE__ */ H({
|
|
10
|
-
name: "FormMain",
|
|
11
|
-
inheritAttrs: !0,
|
|
12
|
-
__name: "FormMain",
|
|
13
|
-
props: {
|
|
14
|
-
list: {},
|
|
15
|
-
data: {},
|
|
16
|
-
layout: {},
|
|
17
|
-
rowGutter: { default: 0 }
|
|
18
|
-
},
|
|
19
|
-
emits: ["loadingChange", "visibleChange", "submit"],
|
|
20
|
-
setup(f, { expose: x, emit: R }) {
|
|
21
|
-
const o = f, v = R, s = N(), c = _([]), d = _({}), b = u(() => !!c.value.length), F = u(() => Object.keys(d.value).filter(
|
|
22
|
-
(e) => d.value[e]
|
|
23
|
-
)), D = u(() => o.list.filter((e) => !F.value.includes(e.key))), $ = u(() => D.value.length > 0), G = (e) => e;
|
|
24
|
-
x({
|
|
25
|
-
validate: () => s.value ? new Promise((e, t) => {
|
|
26
|
-
var l;
|
|
27
|
-
(l = s.value) == null || l.validate((r, i) => {
|
|
28
|
-
if (r)
|
|
29
|
-
e();
|
|
30
|
-
else {
|
|
31
|
-
const a = { ...i || {} };
|
|
32
|
-
Object.keys(a).forEach((n) => {
|
|
33
|
-
var C;
|
|
34
|
-
F.value.includes(n) && (console.log(`当前${n}被隐藏,移除校验`, a[n]), delete a[n], (C = s.value) == null || C.clearValidate(n));
|
|
35
|
-
}), Object.keys(a).length === 0 ? e() : t(i);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}) : Promise.reject(new Error("实例化未完成")),
|
|
39
|
-
resetFields: () => s.value ? s.value.resetFields() : console.error("实例化未完成"),
|
|
40
|
-
clearValidate: (e) => s.value ? s.value.clearValidate(e) : console.error("实例化未完成"),
|
|
41
|
-
generate: () => Z(o.list),
|
|
42
|
-
parse: (e) => Y(e, o.list),
|
|
43
|
-
stringify: () => X(o.data, o.list)
|
|
44
|
-
});
|
|
45
|
-
const g = u(() => o.list), w = u(() => g.value.reduce((e, t) => (t.rules && (typeof t.rules == "function" ? e[t.key] = t.rules({
|
|
46
|
-
data: o.data,
|
|
47
|
-
config: t
|
|
48
|
-
}) : e[t.key] = t.rules), e), {})), k = u(() => c.value.reduce(
|
|
49
|
-
(e, t) => (e[t.key] = [
|
|
50
|
-
{
|
|
51
|
-
validator: () => [new Error(`${t.label}${t.message}`)]
|
|
52
|
-
}
|
|
53
|
-
], e),
|
|
54
|
-
{}
|
|
55
|
-
)), I = u(() => {
|
|
56
|
-
const e = Object.keys(w.value), t = Object.keys(k.value);
|
|
57
|
-
return [...new Set(e.concat(t))].reduce((r, i) => (r[i] = [
|
|
58
|
-
...w.value[i] || [],
|
|
59
|
-
...k.value[i] || []
|
|
60
|
-
], r), {});
|
|
61
|
-
});
|
|
62
|
-
P(W, ({ key: e, message: t }) => {
|
|
63
|
-
if (!e)
|
|
64
|
-
return console.error("更新状态未传入key, 此处忽略");
|
|
65
|
-
const l = c.value.findIndex((r) => r.key === e);
|
|
66
|
-
l === -1 ? t && c.value.push({
|
|
67
|
-
key: e,
|
|
68
|
-
message: t,
|
|
69
|
-
label: o.list.find((r) => r.key === e).label
|
|
70
|
-
}) : t ? c.value.splice(l, 1, {
|
|
71
|
-
key: e,
|
|
72
|
-
message: t,
|
|
73
|
-
label: o.list.find((r) => r.key === e).label
|
|
74
|
-
}) : c.value.splice(l, 1);
|
|
75
|
-
});
|
|
76
|
-
const K = ({
|
|
77
|
-
status: e,
|
|
78
|
-
config: { key: t }
|
|
79
|
-
}) => {
|
|
80
|
-
(d.value[t] || !1) !== e && (d.value[t] = e);
|
|
81
|
-
}, E = (e) => ({
|
|
82
|
-
...S(o.layout),
|
|
83
|
-
...S(e)
|
|
84
|
-
});
|
|
85
|
-
return y(
|
|
86
|
-
g,
|
|
87
|
-
(e) => {
|
|
88
|
-
const t = e.map((l) => l.key);
|
|
89
|
-
Object.keys(d.value).forEach((l) => {
|
|
90
|
-
t.includes(l) || delete d.value[l];
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
immediate: !0
|
|
95
|
-
}
|
|
96
|
-
), y(b, () => {
|
|
97
|
-
v("loadingChange", b.value);
|
|
98
|
-
}), y(
|
|
99
|
-
$,
|
|
100
|
-
(e) => {
|
|
101
|
-
v("visibleChange", e);
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
immediate: !0
|
|
105
|
-
}
|
|
106
|
-
), (e, t) => {
|
|
107
|
-
const l = B, r = A, i = M;
|
|
108
|
-
return p(), L(i, {
|
|
109
|
-
ref_key: "elForm",
|
|
110
|
-
ref: s,
|
|
111
|
-
model: f.data,
|
|
112
|
-
rules: h(I)
|
|
113
|
-
}, {
|
|
114
|
-
default: m(() => [
|
|
115
|
-
O(r, { gutter: f.rowGutter }, {
|
|
116
|
-
default: m(() => [
|
|
117
|
-
(p(!0), T(q, null, z(h(g), (a) => J((p(), L(l, V({
|
|
118
|
-
key: a.key
|
|
119
|
-
}, { ref_for: !0 }, E(a.layout)), {
|
|
120
|
-
default: m(() => [
|
|
121
|
-
O(U, {
|
|
122
|
-
data: f.data,
|
|
123
|
-
config: G(a),
|
|
124
|
-
onViewHideChange: K,
|
|
125
|
-
onSubmit: t[0] || (t[0] = (n) => v("submit", n))
|
|
126
|
-
}, {
|
|
127
|
-
default: m((n) => [
|
|
128
|
-
j(e.$slots, a.key, V({ ref_for: !0 }, n))
|
|
129
|
-
]),
|
|
130
|
-
_: 2
|
|
131
|
-
}, 1032, ["data", "config"])
|
|
132
|
-
]),
|
|
133
|
-
_: 2
|
|
134
|
-
}, 1040)), [
|
|
135
|
-
[Q, !(h(d)[a.key] ?? !1)]
|
|
136
|
-
])), 128)),
|
|
137
|
-
j(e.$slots, "default", { mergeLayout: E })
|
|
138
|
-
]),
|
|
139
|
-
_: 3
|
|
140
|
-
}, 8, ["gutter"])
|
|
141
|
-
]),
|
|
142
|
-
_: 3
|
|
143
|
-
}, 8, ["model", "rules"]);
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
});
|
|
1
|
+
import o from "./FormMain.vue2.mjs";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-8ad14c45"]]);
|
|
147
5
|
export {
|
|
148
|
-
|
|
6
|
+
p as default
|
|
149
7
|
};
|
|
@@ -1,4 +1,162 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as Y, shallowRef as B, provide as p, computed as o, ref as L, watch as b, openBlock as E, createBlock as V, unref as F, withCtx as v, createVNode as j, createElementBlock as H, Fragment as U, renderList as q, withDirectives as z, mergeProps as x, renderSlot as R, vShow as J } from "vue";
|
|
2
|
+
import { ElForm as Q, ElRow as W, ElCol as X } from "element-plus";
|
|
3
|
+
import Z from "./FormItem.vue.mjs";
|
|
4
|
+
import { FORM_ITEM_CHANGE_LOADING as ee, stringifyFormData as te, parseFormData as le, generateFormData as ae, resolveFormLayout as M } from "./utils.mjs";
|
|
5
|
+
import { createNestFormExposeMap as re } from "./nest-registry.mjs";
|
|
6
|
+
import { FORM_NEST_REGISTRY_KEY as oe, NEST_LAYOUT_SCALE_KEY as se } from "../../inject/key.mjs";
|
|
7
|
+
const pe = /* @__PURE__ */ Y({
|
|
8
|
+
name: "FormMain",
|
|
9
|
+
inheritAttrs: !0,
|
|
10
|
+
__name: "FormMain",
|
|
11
|
+
props: {
|
|
12
|
+
list: {},
|
|
13
|
+
data: {},
|
|
14
|
+
layout: {},
|
|
15
|
+
rowGutter: { default: 8 },
|
|
16
|
+
layoutScale: { default: 1 }
|
|
17
|
+
},
|
|
18
|
+
emits: ["loadingChange", "visibleChange", "submit"],
|
|
19
|
+
setup(d, { expose: K, emit: N }) {
|
|
20
|
+
const r = d, y = N, s = B(), f = re();
|
|
21
|
+
p(oe, f);
|
|
22
|
+
const A = o(() => r.layoutScale ?? 1);
|
|
23
|
+
p(se, A);
|
|
24
|
+
const n = L([]), i = L({}), w = o(() => !!n.value.length), g = o(() => Object.keys(i.value).filter(
|
|
25
|
+
(e) => i.value[e]
|
|
26
|
+
)), D = o(() => r.list.filter((e) => !g.value.includes(e.key))), G = o(() => D.value.length > 0), I = (e) => e;
|
|
27
|
+
K({
|
|
28
|
+
validate: async () => {
|
|
29
|
+
if (!s.value) return Promise.reject(new Error("实例化未完成"));
|
|
30
|
+
const e = new Promise((l, a) => {
|
|
31
|
+
var u;
|
|
32
|
+
(u = s.value) == null || u.validate((P, C) => {
|
|
33
|
+
if (P)
|
|
34
|
+
l();
|
|
35
|
+
else {
|
|
36
|
+
const m = { ...C || {} };
|
|
37
|
+
Object.keys(m).forEach((c) => {
|
|
38
|
+
var _;
|
|
39
|
+
g.value.includes(c) && (console.log(`当前${c}被隐藏,移除校验`, m[c]), delete m[c], (_ = s.value) == null || _.clearValidate(c));
|
|
40
|
+
}), Object.keys(m).length === 0 ? l() : a(C);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}), t = Object.entries(f).filter(([l]) => !g.value.includes(l)).map(([, l]) => l.validate());
|
|
44
|
+
await Promise.all([e, ...t]);
|
|
45
|
+
},
|
|
46
|
+
resetFields: () => {
|
|
47
|
+
if (!s.value) return console.error("实例化未完成");
|
|
48
|
+
s.value.resetFields(), Object.values(f).forEach((e) => e.resetFields());
|
|
49
|
+
},
|
|
50
|
+
clearValidate: (e) => {
|
|
51
|
+
if (!s.value) return console.error("实例化未完成");
|
|
52
|
+
s.value.clearValidate(e), Object.values(f).forEach((t) => t.clearValidate());
|
|
53
|
+
},
|
|
54
|
+
generate: () => ae(r.list),
|
|
55
|
+
parse: (e) => le(e, r.list),
|
|
56
|
+
stringify: () => te(r.data, r.list)
|
|
57
|
+
});
|
|
58
|
+
const h = o(() => r.list), S = o(() => h.value.reduce((e, t) => (t.rules && (typeof t.rules == "function" ? e[t.key] = t.rules({
|
|
59
|
+
data: r.data,
|
|
60
|
+
config: t
|
|
61
|
+
}) : e[t.key] = t.rules), e), {})), k = o(() => n.value.reduce(
|
|
62
|
+
(e, t) => (e[t.key] = [
|
|
63
|
+
{
|
|
64
|
+
validator: () => [new Error(`${t.label}${t.message}`)]
|
|
65
|
+
}
|
|
66
|
+
], e),
|
|
67
|
+
{}
|
|
68
|
+
)), T = o(() => {
|
|
69
|
+
const e = Object.keys(S.value), t = Object.keys(k.value);
|
|
70
|
+
return [...new Set(e.concat(t))].reduce((a, u) => (a[u] = [
|
|
71
|
+
...S.value[u] || [],
|
|
72
|
+
...k.value[u] || []
|
|
73
|
+
], a), {});
|
|
74
|
+
});
|
|
75
|
+
p(ee, ({ key: e, message: t }) => {
|
|
76
|
+
if (!e)
|
|
77
|
+
return console.error("更新状态未传入key, 此处忽略");
|
|
78
|
+
const l = n.value.findIndex((a) => a.key === e);
|
|
79
|
+
l === -1 ? t && n.value.push({
|
|
80
|
+
key: e,
|
|
81
|
+
message: t,
|
|
82
|
+
label: r.list.find((a) => a.key === e).label
|
|
83
|
+
}) : t ? n.value.splice(l, 1, {
|
|
84
|
+
key: e,
|
|
85
|
+
message: t,
|
|
86
|
+
label: r.list.find((a) => a.key === e).label
|
|
87
|
+
}) : n.value.splice(l, 1);
|
|
88
|
+
});
|
|
89
|
+
const $ = ({
|
|
90
|
+
status: e,
|
|
91
|
+
config: { key: t }
|
|
92
|
+
}) => {
|
|
93
|
+
(i.value[t] || !1) !== e && (i.value[t] = e);
|
|
94
|
+
}, O = (e) => {
|
|
95
|
+
const t = r.layoutScale ?? 1;
|
|
96
|
+
return {
|
|
97
|
+
...M(r.layout, t),
|
|
98
|
+
...M(e, t)
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
return b(
|
|
102
|
+
h,
|
|
103
|
+
(e) => {
|
|
104
|
+
const t = e.map((l) => l.key);
|
|
105
|
+
Object.keys(i.value).forEach((l) => {
|
|
106
|
+
t.includes(l) || delete i.value[l];
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
immediate: !0
|
|
111
|
+
}
|
|
112
|
+
), b(w, () => {
|
|
113
|
+
y("loadingChange", w.value);
|
|
114
|
+
}), b(
|
|
115
|
+
G,
|
|
116
|
+
(e) => {
|
|
117
|
+
y("visibleChange", e);
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
immediate: !0
|
|
121
|
+
}
|
|
122
|
+
), (e, t) => (E(), V(F(Q), {
|
|
123
|
+
ref_key: "elForm",
|
|
124
|
+
ref: s,
|
|
125
|
+
model: d.data,
|
|
126
|
+
rules: T.value
|
|
127
|
+
}, {
|
|
128
|
+
default: v(() => [
|
|
129
|
+
j(F(W), { gutter: d.rowGutter }, {
|
|
130
|
+
default: v(() => [
|
|
131
|
+
(E(!0), H(U, null, q(h.value, (l) => z((E(), V(F(X), x({
|
|
132
|
+
key: l.key
|
|
133
|
+
}, { ref_for: !0 }, O(l.layout)), {
|
|
134
|
+
default: v(() => [
|
|
135
|
+
j(Z, {
|
|
136
|
+
data: d.data,
|
|
137
|
+
config: I(l),
|
|
138
|
+
onViewHideChange: $,
|
|
139
|
+
onSubmit: t[0] || (t[0] = (a) => y("submit", a))
|
|
140
|
+
}, {
|
|
141
|
+
default: v((a) => [
|
|
142
|
+
R(e.$slots, l.key, x({ ref_for: !0 }, a), void 0, !0)
|
|
143
|
+
]),
|
|
144
|
+
_: 2
|
|
145
|
+
}, 1032, ["data", "config"])
|
|
146
|
+
]),
|
|
147
|
+
_: 2
|
|
148
|
+
}, 1040)), [
|
|
149
|
+
[J, !(i.value[l.key] ?? !1)]
|
|
150
|
+
])), 128)),
|
|
151
|
+
R(e.$slots, "default", { mergeLayout: O }, void 0, !0)
|
|
152
|
+
]),
|
|
153
|
+
_: 3
|
|
154
|
+
}, 8, ["gutter"])
|
|
155
|
+
]),
|
|
156
|
+
_: 3
|
|
157
|
+
}, 8, ["model", "rules"]));
|
|
158
|
+
}
|
|
159
|
+
});
|
|
2
160
|
export {
|
|
3
|
-
|
|
161
|
+
pe as default
|
|
4
162
|
};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "element-plus
|
|
3
|
-
|
|
4
|
-
import "element-plus/es/components/radio/style/css";
|
|
5
|
-
import "element-plus/es/components/radio-button/style/css";
|
|
6
|
-
import { defineComponent as B, useModel as V, computed as G, watch as _, openBlock as a, createBlock as d, unref as g, withCtx as n, createElementBlock as m, Fragment as s, renderList as c, createTextVNode as p, toDisplayString as v, createCommentVNode as x, mergeModels as M } from "vue";
|
|
7
|
-
const D = /* @__PURE__ */ B({
|
|
1
|
+
import { defineComponent as k, useModel as h, computed as y, watch as V, openBlock as t, createBlock as d, unref as r, withCtx as n, createElementBlock as m, Fragment as v, renderList as c, createTextVNode as p, toDisplayString as f, createCommentVNode as B, mergeModels as R } from "vue";
|
|
2
|
+
import { ElRadioGroup as g, ElRadioButton as x, ElRadio as E } from "element-plus";
|
|
3
|
+
const N = /* @__PURE__ */ k({
|
|
8
4
|
name: "FormRadioGroup",
|
|
9
5
|
inheritAttrs: !0,
|
|
10
6
|
__name: "FormRadioGroup",
|
|
11
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ R({
|
|
12
8
|
options: {},
|
|
13
9
|
mode: { default: "radio" },
|
|
14
10
|
notNull: { type: Boolean, default: !0 }
|
|
@@ -17,57 +13,54 @@ const D = /* @__PURE__ */ B({
|
|
|
17
13
|
modelModifiers: {}
|
|
18
14
|
}),
|
|
19
15
|
emits: ["update:modelValue"],
|
|
20
|
-
setup(
|
|
21
|
-
const u =
|
|
16
|
+
setup(l) {
|
|
17
|
+
const u = l, a = h(l, "modelValue"), i = y(() => {
|
|
22
18
|
if (u.notNull && u.options.length > 0) {
|
|
23
19
|
const o = u.options.some(
|
|
24
|
-
(
|
|
20
|
+
(s) => s.value === a.value
|
|
25
21
|
);
|
|
26
|
-
if (
|
|
22
|
+
if (a.value === void 0 || !o)
|
|
27
23
|
return u.options[0].value;
|
|
28
24
|
}
|
|
29
|
-
return
|
|
30
|
-
}),
|
|
31
|
-
|
|
25
|
+
return a.value;
|
|
26
|
+
}), b = (o) => {
|
|
27
|
+
a.value = o;
|
|
32
28
|
};
|
|
33
|
-
return
|
|
34
|
-
|
|
29
|
+
return V(
|
|
30
|
+
i,
|
|
35
31
|
(o) => {
|
|
36
|
-
o !== void 0 && o !==
|
|
32
|
+
o !== void 0 && o !== a.value && (a.value = o);
|
|
37
33
|
},
|
|
38
34
|
{ immediate: !0 }
|
|
39
|
-
), (o,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
_: 1
|
|
67
|
-
}, 8, ["model-value"]);
|
|
68
|
-
};
|
|
35
|
+
), (o, s) => (t(), d(r(g), {
|
|
36
|
+
"model-value": i.value,
|
|
37
|
+
"onUpdate:modelValue": b
|
|
38
|
+
}, {
|
|
39
|
+
default: n(() => [
|
|
40
|
+
l.mode === "buttonGroup" ? (t(!0), m(v, { key: 0 }, c(l.options, (e) => (t(), d(r(x), {
|
|
41
|
+
key: e.value,
|
|
42
|
+
value: e.value,
|
|
43
|
+
disabled: e.disabled
|
|
44
|
+
}, {
|
|
45
|
+
default: n(() => [
|
|
46
|
+
p(f(e.label), 1)
|
|
47
|
+
]),
|
|
48
|
+
_: 2
|
|
49
|
+
}, 1032, ["value", "disabled"]))), 128)) : l.mode === "radio" ? (t(!0), m(v, { key: 1 }, c(l.options, (e) => (t(), d(r(E), {
|
|
50
|
+
key: e.value,
|
|
51
|
+
value: e.value,
|
|
52
|
+
disabled: e.disabled
|
|
53
|
+
}, {
|
|
54
|
+
default: n(() => [
|
|
55
|
+
p(f(e.label), 1)
|
|
56
|
+
]),
|
|
57
|
+
_: 2
|
|
58
|
+
}, 1032, ["value", "disabled"]))), 128)) : B("", !0)
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
}, 8, ["model-value"]));
|
|
69
62
|
}
|
|
70
63
|
});
|
|
71
64
|
export {
|
|
72
|
-
|
|
65
|
+
N as default
|
|
73
66
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FormSearch.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9a9f48af"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|