@done-coding/admin-core 0.8.3-alpha.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/bridge/config-hook.mjs +37 -0
- package/es/bridge/index.mjs +157 -62
- package/es/bridge/plugin.mjs +29 -0
- package/es/bridge/theme.mjs +62 -0
- package/es/components/app-layout/AppBody.vue.mjs +1 -1
- package/es/components/app-layout/AppBody.vue2.mjs +47 -49
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
- package/es/components/app-layout/AppFooter.vue.mjs +2 -2
- package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
- package/es/components/app-layout/AppHeader.vue.mjs +1 -1
- package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
- package/es/components/app-layout/AppLayout.vue.mjs +2 -2
- package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
- package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
- package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
- package/es/components/app-layout/AppTheme.vue.mjs +7 -0
- package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
- package/es/components/data-view/DataListView.vue.mjs +2 -2
- package/es/components/data-view/DataListView.vue2.mjs +36 -36
- package/es/components/display/ActionConfirm.vue2.mjs +16 -16
- package/es/components/display/HeightProvider.vue.mjs +10 -10
- package/es/components/display/TabsHeader.vue.mjs +4 -4
- package/es/components/display/TabsHeader.vue2.mjs +34 -34
- package/es/components/display/TabsMain.vue.mjs +40 -39
- package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
- package/es/components/form/FormItem.vue.mjs +1 -1
- package/es/components/form/FormItem.vue2.mjs +75 -81
- package/es/components/form/FormMain.vue.mjs +81 -88
- package/es/components/form/FormRadioGroup.vue.mjs +42 -49
- package/es/components/form/FormSearch.vue.mjs +1 -1
- package/es/components/form/FormSearch.vue2.mjs +116 -123
- package/es/components/form/FormSelect.vue.mjs +34 -40
- package/es/components/form/FormSubmitBtn.vue.mjs +23 -28
- package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
- package/es/components/form/FormSubmitPanel.vue2.mjs +16 -16
- package/es/components/form/FormTree.vue.mjs +16 -21
- package/es/components/form/FormVerifyCode.vue.mjs +37 -43
- package/es/components/form/FormVerifyImage.vue.mjs +2 -2
- package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +134 -139
- package/es/components/menu/MenuItemSub.vue.mjs +41 -48
- package/es/components/menu/MenuTree.vue.mjs +58 -65
- package/es/components/misc/AutoRefresh.vue.mjs +2 -2
- package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
- package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
- package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
- package/es/components/modal/ConfirmModal.vue.mjs +3 -3
- package/es/components/modal/ConfirmModal.vue2.mjs +93 -100
- package/es/components/modal/DetailModal.vue.mjs +38 -41
- package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
- package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
- package/es/components/panel/PanelMain.vue.mjs +2 -2
- package/es/components/panel/PanelMain.vue2.mjs +67 -74
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +221 -229
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +115 -126
- package/es/hooks/use-admin-theme-apply.mjs +84 -0
- package/es/hooks/use-admin-viewport-apply.mjs +27 -0
- package/es/index.mjs +125 -117
- package/es/inject/key.mjs +7 -4
- package/es/store/app.mjs +75 -84
- package/es/style.css +1 -1
- package/es/utils/theme-scale.mjs +37 -0
- package/package.json +2 -4
- package/types/bridge/config-hook.d.ts +91 -0
- package/types/bridge/index.d.ts +108 -8
- package/types/bridge/plugin.d.ts +39 -0
- package/types/bridge/theme.d.ts +66 -0
- package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
- package/types/components/app-layout/types.d.ts +1 -1
- package/types/components/form/FormItem.vue.d.ts +12 -12
- package/types/components/form/FormTree.vue.d.ts +50 -50
- package/types/components/menu/MenuTree.vue.d.ts +10 -10
- package/types/components/modal/ModalShelf.vue.d.ts +1 -1
- package/types/components/table/TableMain.vue.d.ts +1 -1
- package/types/hooks/activated.d.ts +2 -2
- package/types/hooks/feel-size.d.ts +1 -1
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/menus-dispatch.d.ts +5 -5
- package/types/hooks/use-admin-theme-apply.d.ts +17 -0
- package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
- package/types/hooks/use-breakpoint.d.ts +1 -1
- package/types/inject/key.d.ts +18 -0
- package/types/store/app.d.ts +138 -59
- package/types/utils/index.d.ts +1 -0
- package/types/utils/theme-scale.d.ts +35 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useChannelViewportHeight as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as H, ref as w, computed as i, provide as C, watch as b, openBlock as y, createBlock as S, createSlots as V, withCtx as r, createElementVNode as $, normalizeStyle as x, renderSlot as h } from "vue";
|
|
2
|
+
import _ from "./HeightProvider.vue.mjs";
|
|
3
|
+
import { useChannelViewportHeight as k } from "../../hooks/use-channel-viewport-height.mjs";
|
|
4
|
+
const F = /* @__PURE__ */ H({
|
|
5
5
|
__name: "TabsRefineFlow",
|
|
6
6
|
props: {
|
|
7
7
|
viewportHeight: {},
|
|
@@ -12,45 +12,47 @@ const M = /* @__PURE__ */ w({
|
|
|
12
12
|
refineReduceHeight: { default: 0 }
|
|
13
13
|
},
|
|
14
14
|
emits: ["viewportHeightChange"],
|
|
15
|
-
setup(
|
|
16
|
-
const e =
|
|
15
|
+
setup(n, { emit: d }) {
|
|
16
|
+
const e = n, p = d, a = e.channel ? Symbol.for(e.channel) : void 0, { viewportHeightFinal: c, parentLevel: o } = k(e), l = w(0), s = i(() => e.padding[0] + e.padding[2]), g = i(() => ({
|
|
17
17
|
padding: e.padding.map((t) => `${t}px`).join(" "),
|
|
18
18
|
boxSizing: "border-box"
|
|
19
|
-
})), v =
|
|
19
|
+
})), v = i(
|
|
20
20
|
() => Math.max(
|
|
21
|
-
|
|
21
|
+
c.value - s.value - e.refineReduceHeight,
|
|
22
22
|
0
|
|
23
23
|
)
|
|
24
|
-
),
|
|
25
|
-
() =>
|
|
26
|
-
),
|
|
27
|
-
|
|
24
|
+
), m = i(
|
|
25
|
+
() => o.value > 0 ? o.value : 1
|
|
26
|
+
), u = i(() => m.value + 1), f = (t) => {
|
|
27
|
+
l.value = t, p("viewportHeightChange", t);
|
|
28
28
|
};
|
|
29
|
-
return
|
|
30
|
-
viewportHeight:
|
|
31
|
-
level
|
|
32
|
-
|
|
29
|
+
return a && C(a, {
|
|
30
|
+
viewportHeight: i(() => l.value),
|
|
31
|
+
// level 有意取 setup 期一次性快照(channel 不响应式),非误丢响应性,定向 disable。
|
|
32
|
+
// eslint-disable-next-line vue/no-ref-object-destructure
|
|
33
|
+
level: u.value
|
|
34
|
+
}), b(
|
|
33
35
|
// eslint-disable-next-line vue/no-setup-props-destructure
|
|
34
36
|
() => e.channel,
|
|
35
37
|
() => console.error("[TabsMain] channel 不支持响应式变更,当前值已忽略。")
|
|
36
|
-
), (t,
|
|
37
|
-
viewportHeight:
|
|
38
|
-
minHeight:
|
|
39
|
-
onChildViewportHeightChange:
|
|
40
|
-
},
|
|
41
|
-
default:
|
|
42
|
-
|
|
43
|
-
style:
|
|
38
|
+
), (t, L) => (y(), S(_, {
|
|
39
|
+
viewportHeight: v.value,
|
|
40
|
+
minHeight: n.minHeight,
|
|
41
|
+
onChildViewportHeightChange: f
|
|
42
|
+
}, V({
|
|
43
|
+
default: r(() => [
|
|
44
|
+
$("div", {
|
|
45
|
+
style: x(g.value)
|
|
44
46
|
}, [
|
|
45
|
-
|
|
47
|
+
h(t.$slots, "default")
|
|
46
48
|
], 4)
|
|
47
49
|
]),
|
|
48
50
|
_: 2
|
|
49
51
|
}, [
|
|
50
52
|
t.$slots.header ? {
|
|
51
53
|
name: "header",
|
|
52
|
-
fn:
|
|
53
|
-
|
|
54
|
+
fn: r(() => [
|
|
55
|
+
h(t.$slots, "header")
|
|
54
56
|
]),
|
|
55
57
|
key: "0"
|
|
56
58
|
} : void 0
|
|
@@ -58,5 +60,5 @@ const M = /* @__PURE__ */ w({
|
|
|
58
60
|
}
|
|
59
61
|
});
|
|
60
62
|
export {
|
|
61
|
-
|
|
63
|
+
F as default
|
|
62
64
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FormItem.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8b508d64"]]);
|
|
5
5
|
export {
|
|
6
6
|
_ as default
|
|
7
7
|
};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "element-plus
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import { defineComponent as J, shallowRef as Q, computed as n, watch as p, withDirectives as U, openBlock as a, createBlock as c, mergeProps as v, unref as r, withCtx as y, renderSlot as W, normalizeProps as F, createTextVNode as k, toDisplayString as h, resolveDynamicComponent as b, createSlots as X, createElementBlock as H, Fragment as Y, createCommentVNode as Z, vShow as _ } from "vue";
|
|
6
|
-
import { getPlaceholder as ee, getChangeSubmit as te, getBlurSubmit as ne, getEnterSubmit as oe, getVModelSugar as re, generateFormData as ie } from "./utils.mjs";
|
|
7
|
-
import ae from "lodash/omit";
|
|
1
|
+
import { defineComponent as q, shallowRef as G, computed as n, watch as f, withDirectives as J, openBlock as a, createBlock as i, unref as I, mergeProps as g, withCtx as d, renderSlot as Q, normalizeProps as L, createTextVNode as p, toDisplayString as v, resolveDynamicComponent as y, createSlots as U, createElementBlock as B, Fragment as W, createCommentVNode as X, vShow as Y } from "vue";
|
|
2
|
+
import { ElFormItem as Z, ElText as _ } from "element-plus";
|
|
3
|
+
import { getPlaceholder as ee, getChangeSubmit as te, getBlurSubmit as ne, getEnterSubmit as oe, getVModelSugar as re, generateFormData as ae } from "./utils.mjs";
|
|
4
|
+
import ie from "lodash/omit";
|
|
8
5
|
const ce = {
|
|
9
6
|
key: 2,
|
|
10
7
|
class: "form-item-tip"
|
|
11
|
-
},
|
|
8
|
+
}, fe = /* @__PURE__ */ q({
|
|
12
9
|
name: "FormItem",
|
|
13
10
|
__name: "FormItem",
|
|
14
11
|
props: {
|
|
@@ -16,133 +13,130 @@ const ce = {
|
|
|
16
13
|
data: {}
|
|
17
14
|
},
|
|
18
15
|
emits: ["viewHideChange", "submit"],
|
|
19
|
-
setup(
|
|
20
|
-
const t =
|
|
16
|
+
setup(r, { emit: E }) {
|
|
17
|
+
const t = r, c = E, k = G(), F = n(() => {
|
|
21
18
|
const {
|
|
22
19
|
config: { beLink: e }
|
|
23
20
|
} = t;
|
|
24
21
|
return e ? Array.isArray(e) ? e : [e] : [];
|
|
25
|
-
}),
|
|
22
|
+
}), h = n(() => F.value.filter((e) => e.key !== t.config.key)), b = n(() => h.value.length > 0), x = n(() => t.data[t.config.key]), s = n(() => ({
|
|
26
23
|
data: t.data,
|
|
27
24
|
config: t.config
|
|
28
25
|
})), D = n(() => {
|
|
29
26
|
const { config: e } = t;
|
|
30
|
-
return typeof e.wrapProps == "function" ? e.wrapProps(
|
|
31
|
-
}),
|
|
27
|
+
return typeof e.wrapProps == "function" ? e.wrapProps(s.value) : e.wrapProps || {};
|
|
28
|
+
}), P = n(() => {
|
|
32
29
|
const { config: e } = t;
|
|
33
|
-
return typeof e.props == "function" ? e.props(
|
|
30
|
+
return typeof e.props == "function" ? e.props(s.value) : e.props || {};
|
|
34
31
|
}), T = () => {
|
|
35
|
-
|
|
32
|
+
c("submit", "enter");
|
|
36
33
|
}, A = () => {
|
|
37
|
-
|
|
34
|
+
c("submit", "blur");
|
|
38
35
|
}, M = () => {
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
const { key:
|
|
43
|
-
t.data[
|
|
36
|
+
c("submit", "change");
|
|
37
|
+
}, w = (e, o) => {
|
|
38
|
+
h.value.forEach((C) => {
|
|
39
|
+
const { key: S, getValue: H } = C, j = H(e, t.data[S], o);
|
|
40
|
+
t.data[S] = H(e, j);
|
|
44
41
|
});
|
|
45
42
|
}, N = n(() => ee(t.config) || {}), $ = n(() => ({
|
|
46
43
|
...oe(t.config, T) || {},
|
|
47
44
|
...ne(t.config, A) || {},
|
|
48
45
|
...te(t.config, M) || {}
|
|
49
|
-
})), z = n(() =>
|
|
46
|
+
})), z = n(() => ie(P.value, ["children"])), K = n(() => re({
|
|
50
47
|
modelValueKey: "modelValue",
|
|
51
48
|
data: t.data,
|
|
52
49
|
config: t.config
|
|
53
|
-
})), O = n(() =>
|
|
54
|
-
onTriggerChangeLink:
|
|
55
|
-
} : {}),
|
|
50
|
+
})), O = n(() => b.value ? {
|
|
51
|
+
onTriggerChangeLink: w
|
|
52
|
+
} : {}), m = n(() => ({
|
|
56
53
|
...N.value,
|
|
57
54
|
...$.value,
|
|
58
55
|
...z.value,
|
|
59
56
|
...K.value,
|
|
60
57
|
...O.value
|
|
61
|
-
})),
|
|
62
|
-
const { children: e } =
|
|
58
|
+
})), l = n(() => {
|
|
59
|
+
const { children: e } = P.value;
|
|
63
60
|
return e;
|
|
64
|
-
}),
|
|
61
|
+
}), V = n(() => {
|
|
65
62
|
const { config: e } = t, { hide: o } = e;
|
|
66
63
|
return typeof o == "boolean" ? o : (o == null ? void 0 : o({
|
|
67
|
-
...
|
|
68
|
-
getInitValue: () =>
|
|
64
|
+
...s.value,
|
|
65
|
+
getInitValue: () => ae([e])[e.key]
|
|
69
66
|
})) ?? !1;
|
|
70
67
|
}), R = n(() => [
|
|
71
68
|
`form-item-${t.config.key}`,
|
|
72
69
|
{ "form-item-label-hide": !!t.config.labelHide }
|
|
73
70
|
]);
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
f(
|
|
72
|
+
V,
|
|
76
73
|
(e) => {
|
|
77
74
|
var o;
|
|
78
|
-
|
|
75
|
+
c("viewHideChange", {
|
|
79
76
|
config: t.config,
|
|
80
77
|
status: e
|
|
81
|
-
}), e && ((o =
|
|
78
|
+
}), e && ((o = k.value) == null || o.clearValidate());
|
|
82
79
|
},
|
|
83
80
|
{
|
|
84
81
|
immediate: !0
|
|
85
82
|
}
|
|
86
83
|
);
|
|
87
|
-
let
|
|
88
|
-
return
|
|
89
|
-
|
|
84
|
+
let u;
|
|
85
|
+
return f(
|
|
86
|
+
b,
|
|
90
87
|
(e) => {
|
|
91
|
-
e ?
|
|
88
|
+
e ? u = f(
|
|
92
89
|
x,
|
|
93
90
|
(o) => {
|
|
94
|
-
|
|
91
|
+
w(o);
|
|
95
92
|
},
|
|
96
93
|
{
|
|
97
94
|
immediate: !0
|
|
98
95
|
}
|
|
99
|
-
) :
|
|
96
|
+
) : u == null || u();
|
|
100
97
|
},
|
|
101
98
|
{
|
|
102
99
|
immediate: !0
|
|
103
100
|
}
|
|
104
|
-
), (e, o) => {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
[_, !r(I)]
|
|
142
|
-
]);
|
|
143
|
-
};
|
|
101
|
+
), (e, o) => J((a(), i(I(Z), g({
|
|
102
|
+
ref_key: "formItem",
|
|
103
|
+
ref: k,
|
|
104
|
+
prop: r.config.key,
|
|
105
|
+
label: r.config.label,
|
|
106
|
+
class: R.value
|
|
107
|
+
}, D.value), {
|
|
108
|
+
default: d(() => [
|
|
109
|
+
r.config.render === void 0 ? Q(e.$slots, "default", L(g({ key: 0 }, m.value)), () => [
|
|
110
|
+
p(v(m.value.modelValue), 1)
|
|
111
|
+
], !0) : (a(), i(y(r.config.render), L(g({ key: 1 }, m.value)), U({ _: 2 }, [
|
|
112
|
+
l.value !== void 0 ? {
|
|
113
|
+
name: "default",
|
|
114
|
+
fn: d(() => [
|
|
115
|
+
typeof l.value == "function" ? (a(), i(y(l.value), { key: 0 })) : (a(), B(W, { key: 1 }, [
|
|
116
|
+
p(v(l.value), 1)
|
|
117
|
+
], 64))
|
|
118
|
+
]),
|
|
119
|
+
key: "0"
|
|
120
|
+
} : void 0
|
|
121
|
+
]), 1040)),
|
|
122
|
+
r.config.tip ? (a(), B("div", ce, [
|
|
123
|
+
typeof r.config.tip == "function" ? (a(), i(y(r.config.tip), { key: 0 })) : (a(), i(I(_), {
|
|
124
|
+
key: 1,
|
|
125
|
+
type: "info"
|
|
126
|
+
}, {
|
|
127
|
+
default: d(() => [
|
|
128
|
+
p(v(r.config.tip), 1)
|
|
129
|
+
]),
|
|
130
|
+
_: 1
|
|
131
|
+
}))
|
|
132
|
+
])) : X("", !0)
|
|
133
|
+
]),
|
|
134
|
+
_: 3
|
|
135
|
+
}, 16, ["prop", "label", "class"])), [
|
|
136
|
+
[Y, !V.value]
|
|
137
|
+
]);
|
|
144
138
|
}
|
|
145
139
|
});
|
|
146
140
|
export {
|
|
147
|
-
|
|
141
|
+
fe as default
|
|
148
142
|
};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "element-plus
|
|
3
|
-
import "element-plus/es/components/form/style/css";
|
|
4
|
-
import "element-plus/es/components/row/style/css";
|
|
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";
|
|
1
|
+
import { defineComponent as M, shallowRef as A, ref as L, computed as n, provide as B, watch as y, openBlock as h, createBlock as O, unref as b, withCtx as m, createVNode as V, createElementBlock as H, Fragment as N, renderList as P, withDirectives as T, mergeProps as j, renderSlot as S, vShow as q } from "vue";
|
|
2
|
+
import { ElForm as z, ElRow as J, ElCol as Q } from "element-plus";
|
|
7
3
|
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
|
|
9
|
-
const
|
|
4
|
+
import { FORM_ITEM_CHANGE_LOADING as W, stringifyFormData as X, parseFormData as Y, generateFormData as Z, resolveFormLayout as x } from "./utils.mjs";
|
|
5
|
+
const ue = /* @__PURE__ */ M({
|
|
10
6
|
name: "FormMain",
|
|
11
7
|
inheritAttrs: !0,
|
|
12
8
|
__name: "FormMain",
|
|
@@ -17,84 +13,84 @@ const me = /* @__PURE__ */ H({
|
|
|
17
13
|
rowGutter: { default: 0 }
|
|
18
14
|
},
|
|
19
15
|
emits: ["loadingChange", "visibleChange", "submit"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
(e) =>
|
|
23
|
-
)),
|
|
24
|
-
|
|
25
|
-
validate: () =>
|
|
16
|
+
setup(c, { expose: _, emit: D }) {
|
|
17
|
+
const a = c, v = D, o = A(), i = L([]), s = L({}), F = n(() => !!i.value.length), p = n(() => Object.keys(s.value).filter(
|
|
18
|
+
(e) => s.value[e]
|
|
19
|
+
)), R = n(() => a.list.filter((e) => !p.value.includes(e.key))), $ = n(() => R.value.length > 0), G = (e) => e;
|
|
20
|
+
_({
|
|
21
|
+
validate: () => o.value ? new Promise((e, t) => {
|
|
26
22
|
var l;
|
|
27
|
-
(l =
|
|
23
|
+
(l = o.value) == null || l.validate((r, u) => {
|
|
28
24
|
if (r)
|
|
29
25
|
e();
|
|
30
26
|
else {
|
|
31
|
-
const
|
|
32
|
-
Object.keys(
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
}), Object.keys(
|
|
27
|
+
const f = { ...u || {} };
|
|
28
|
+
Object.keys(f).forEach((d) => {
|
|
29
|
+
var E;
|
|
30
|
+
p.value.includes(d) && (console.log(`当前${d}被隐藏,移除校验`, f[d]), delete f[d], (E = o.value) == null || E.clearValidate(d));
|
|
31
|
+
}), Object.keys(f).length === 0 ? e() : t(u);
|
|
36
32
|
}
|
|
37
33
|
});
|
|
38
34
|
}) : Promise.reject(new Error("实例化未完成")),
|
|
39
|
-
resetFields: () =>
|
|
40
|
-
clearValidate: (e) =>
|
|
41
|
-
generate: () => Z(
|
|
42
|
-
parse: (e) => Y(e,
|
|
43
|
-
stringify: () => X(
|
|
35
|
+
resetFields: () => o.value ? o.value.resetFields() : console.error("实例化未完成"),
|
|
36
|
+
clearValidate: (e) => o.value ? o.value.clearValidate(e) : console.error("实例化未完成"),
|
|
37
|
+
generate: () => Z(a.list),
|
|
38
|
+
parse: (e) => Y(e, a.list),
|
|
39
|
+
stringify: () => X(a.data, a.list)
|
|
44
40
|
});
|
|
45
|
-
const g =
|
|
46
|
-
data:
|
|
41
|
+
const g = n(() => a.list), k = n(() => g.value.reduce((e, t) => (t.rules && (typeof t.rules == "function" ? e[t.key] = t.rules({
|
|
42
|
+
data: a.data,
|
|
47
43
|
config: t
|
|
48
|
-
}) : e[t.key] = t.rules), e), {})),
|
|
44
|
+
}) : e[t.key] = t.rules), e), {})), w = n(() => i.value.reduce(
|
|
49
45
|
(e, t) => (e[t.key] = [
|
|
50
46
|
{
|
|
51
47
|
validator: () => [new Error(`${t.label}${t.message}`)]
|
|
52
48
|
}
|
|
53
49
|
], e),
|
|
54
50
|
{}
|
|
55
|
-
)), I =
|
|
56
|
-
const e = Object.keys(
|
|
57
|
-
return [...new Set(e.concat(t))].reduce((r,
|
|
58
|
-
...
|
|
59
|
-
...
|
|
51
|
+
)), I = n(() => {
|
|
52
|
+
const e = Object.keys(k.value), t = Object.keys(w.value);
|
|
53
|
+
return [...new Set(e.concat(t))].reduce((r, u) => (r[u] = [
|
|
54
|
+
...k.value[u] || [],
|
|
55
|
+
...w.value[u] || []
|
|
60
56
|
], r), {});
|
|
61
57
|
});
|
|
62
|
-
|
|
58
|
+
B(W, ({ key: e, message: t }) => {
|
|
63
59
|
if (!e)
|
|
64
60
|
return console.error("更新状态未传入key, 此处忽略");
|
|
65
|
-
const l =
|
|
66
|
-
l === -1 ? t &&
|
|
61
|
+
const l = i.value.findIndex((r) => r.key === e);
|
|
62
|
+
l === -1 ? t && i.value.push({
|
|
67
63
|
key: e,
|
|
68
64
|
message: t,
|
|
69
|
-
label:
|
|
70
|
-
}) : t ?
|
|
65
|
+
label: a.list.find((r) => r.key === e).label
|
|
66
|
+
}) : t ? i.value.splice(l, 1, {
|
|
71
67
|
key: e,
|
|
72
68
|
message: t,
|
|
73
|
-
label:
|
|
74
|
-
}) :
|
|
69
|
+
label: a.list.find((r) => r.key === e).label
|
|
70
|
+
}) : i.value.splice(l, 1);
|
|
75
71
|
});
|
|
76
72
|
const K = ({
|
|
77
73
|
status: e,
|
|
78
74
|
config: { key: t }
|
|
79
75
|
}) => {
|
|
80
|
-
(
|
|
81
|
-
},
|
|
82
|
-
...
|
|
83
|
-
...
|
|
76
|
+
(s.value[t] || !1) !== e && (s.value[t] = e);
|
|
77
|
+
}, C = (e) => ({
|
|
78
|
+
...x(a.layout),
|
|
79
|
+
...x(e)
|
|
84
80
|
});
|
|
85
81
|
return y(
|
|
86
82
|
g,
|
|
87
83
|
(e) => {
|
|
88
84
|
const t = e.map((l) => l.key);
|
|
89
|
-
Object.keys(
|
|
90
|
-
t.includes(l) || delete
|
|
85
|
+
Object.keys(s.value).forEach((l) => {
|
|
86
|
+
t.includes(l) || delete s.value[l];
|
|
91
87
|
});
|
|
92
88
|
},
|
|
93
89
|
{
|
|
94
90
|
immediate: !0
|
|
95
91
|
}
|
|
96
|
-
), y(
|
|
97
|
-
v("loadingChange",
|
|
92
|
+
), y(F, () => {
|
|
93
|
+
v("loadingChange", F.value);
|
|
98
94
|
}), y(
|
|
99
95
|
$,
|
|
100
96
|
(e) => {
|
|
@@ -103,47 +99,44 @@ const me = /* @__PURE__ */ H({
|
|
|
103
99
|
{
|
|
104
100
|
immediate: !0
|
|
105
101
|
}
|
|
106
|
-
), (e, t) => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
_: 3
|
|
143
|
-
}, 8, ["model", "rules"]);
|
|
144
|
-
};
|
|
102
|
+
), (e, t) => (h(), O(b(z), {
|
|
103
|
+
ref_key: "elForm",
|
|
104
|
+
ref: o,
|
|
105
|
+
model: c.data,
|
|
106
|
+
rules: I.value
|
|
107
|
+
}, {
|
|
108
|
+
default: m(() => [
|
|
109
|
+
V(b(J), { gutter: c.rowGutter }, {
|
|
110
|
+
default: m(() => [
|
|
111
|
+
(h(!0), H(N, null, P(g.value, (l) => T((h(), O(b(Q), j({
|
|
112
|
+
key: l.key
|
|
113
|
+
}, { ref_for: !0 }, C(l.layout)), {
|
|
114
|
+
default: m(() => [
|
|
115
|
+
V(U, {
|
|
116
|
+
data: c.data,
|
|
117
|
+
config: G(l),
|
|
118
|
+
onViewHideChange: K,
|
|
119
|
+
onSubmit: t[0] || (t[0] = (r) => v("submit", r))
|
|
120
|
+
}, {
|
|
121
|
+
default: m((r) => [
|
|
122
|
+
S(e.$slots, l.key, j({ ref_for: !0 }, r))
|
|
123
|
+
]),
|
|
124
|
+
_: 2
|
|
125
|
+
}, 1032, ["data", "config"])
|
|
126
|
+
]),
|
|
127
|
+
_: 2
|
|
128
|
+
}, 1040)), [
|
|
129
|
+
[q, !(s.value[l.key] ?? !1)]
|
|
130
|
+
])), 128)),
|
|
131
|
+
S(e.$slots, "default", { mergeLayout: C })
|
|
132
|
+
]),
|
|
133
|
+
_: 3
|
|
134
|
+
}, 8, ["gutter"])
|
|
135
|
+
]),
|
|
136
|
+
_: 3
|
|
137
|
+
}, 8, ["model", "rules"]));
|
|
145
138
|
}
|
|
146
139
|
});
|
|
147
140
|
export {
|
|
148
|
-
|
|
141
|
+
ue as default
|
|
149
142
|
};
|