@done-coding/admin-core 0.1.1-alpha.5 → 0.1.1-alpha.7
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/components/form/FormItem.vue.mjs +2 -2
- package/es/components/form/FormItem.vue2.mjs +10 -7
- package/es/components/form/FormMain.vue.mjs +32 -32
- package/es/components/form/FormRadioGroup.vue.mjs +57 -20
- package/es/components/form/index.mjs +23 -26
- package/es/components/form/utils.mjs +79 -72
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +88 -90
- package/es/components/modal/DetailModal.vue.mjs +33 -32
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +91 -90
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +55 -56
- package/es/index.mjs +95 -96
- package/es/style.css +1 -1
- package/package.json +2 -2
- package/types/components/form/FormRadioGroup.vue.d.ts +31 -19
- package/types/components/form/index.d.ts +1 -2
- package/types/components/form/types.d.ts +5 -0
- package/types/components/form/utils.d.ts +7 -0
- package/types/components/list-page/ListPage.vue.d.ts +0 -2
- package/types/components/list-page/types.d.ts +0 -4
- package/types/components/modal/types.d.ts +2 -0
- package/es/components/form/FormRadio.vue.mjs +0 -69
- package/es/components/form/FormRadio.vue2.mjs +0 -4
- package/types/components/form/FormRadio.vue.d.ts +0 -35
|
@@ -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
|
|
4
|
+
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0dd66b41"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_ as default
|
|
7
7
|
};
|
|
@@ -2,7 +2,7 @@ import { ElFormItem as q, ElText as G } from "element-plus/es";
|
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
3
|
import "element-plus/es/components/form-item/style/css";
|
|
4
4
|
import "element-plus/es/components/text/style/css";
|
|
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
|
|
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
6
|
import { getPlaceholder as ee, getChangeSubmit as te, getBlurSubmit as ne, getEnterSubmit as oe, getVModelSugar as re, generateFormData as ie } from "./utils.mjs";
|
|
7
7
|
import ae from "lodash/omit";
|
|
8
8
|
const ce = {
|
|
@@ -16,13 +16,13 @@ const ce = {
|
|
|
16
16
|
data: {}
|
|
17
17
|
},
|
|
18
18
|
emits: ["viewHideChange", "submit"],
|
|
19
|
-
setup(i, { emit:
|
|
20
|
-
const t = i, l =
|
|
19
|
+
setup(i, { emit: L }) {
|
|
20
|
+
const t = i, l = L, P = Q(), B = n(() => {
|
|
21
21
|
const {
|
|
22
22
|
config: { beLink: e }
|
|
23
23
|
} = t;
|
|
24
24
|
return e ? Array.isArray(e) ? e : [e] : [];
|
|
25
|
-
}), w = n(() =>
|
|
25
|
+
}), w = n(() => B.value.filter((e) => e.key !== t.config.key)), V = n(() => w.value.length > 0), x = n(() => t.data[t.config.key]), g = n(() => ({
|
|
26
26
|
data: t.data,
|
|
27
27
|
config: t.config
|
|
28
28
|
})), D = n(() => {
|
|
@@ -67,7 +67,10 @@ const ce = {
|
|
|
67
67
|
...g.value,
|
|
68
68
|
getInitValue: () => ie([e])[e.key]
|
|
69
69
|
})) ?? !1;
|
|
70
|
-
}), R = n(() =>
|
|
70
|
+
}), R = n(() => [
|
|
71
|
+
`form-item-${t.config.key}`,
|
|
72
|
+
{ "form-item-label-hide": !!t.config.labelHide }
|
|
73
|
+
]);
|
|
71
74
|
p(
|
|
72
75
|
I,
|
|
73
76
|
(e) => {
|
|
@@ -114,14 +117,14 @@ const ce = {
|
|
|
114
117
|
r(s) !== void 0 ? {
|
|
115
118
|
name: "default",
|
|
116
119
|
fn: y(() => [
|
|
117
|
-
typeof r(s) == "function" ? (a(), c(b(r(s)), { key: 0 })) : (a(),
|
|
120
|
+
typeof r(s) == "function" ? (a(), c(b(r(s)), { key: 0 })) : (a(), H(Y, { key: 1 }, [
|
|
118
121
|
k(h(r(s)), 1)
|
|
119
122
|
], 64))
|
|
120
123
|
]),
|
|
121
124
|
key: "0"
|
|
122
125
|
} : void 0
|
|
123
126
|
]), 1040)),
|
|
124
|
-
i.config.tip ? (a(),
|
|
127
|
+
i.config.tip ? (a(), H("div", ce, [
|
|
125
128
|
typeof i.config.tip == "function" ? (a(), c(b(i.config.tip), { key: 0 })) : (a(), c(u, {
|
|
126
129
|
key: 1,
|
|
127
130
|
type: "info"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ElForm as
|
|
1
|
+
import { ElForm as A, ElRow as B, ElCol as H } from "element-plus/es";
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
3
|
import "element-plus/es/components/form/style/css";
|
|
4
4
|
import "element-plus/es/components/row/style/css";
|
|
5
5
|
import "element-plus/es/components/col/style/css";
|
|
6
|
-
import { defineComponent as
|
|
7
|
-
import
|
|
8
|
-
import { FORM_ITEM_CHANGE_LOADING as
|
|
9
|
-
const
|
|
6
|
+
import { defineComponent as N, shallowRef as P, ref as _, computed as i, provide as D, watch as y, openBlock as h, createBlock as L, unref as p, 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, resolveFormLayout as S } from "./utils.mjs";
|
|
9
|
+
const de = /* @__PURE__ */ N({
|
|
10
10
|
name: "FormMain",
|
|
11
11
|
inheritAttrs: !0,
|
|
12
12
|
__name: "FormMain",
|
|
@@ -17,11 +17,11 @@ const ue = /* @__PURE__ */ H({
|
|
|
17
17
|
rowGutter: { default: 0 }
|
|
18
18
|
},
|
|
19
19
|
emits: ["loadingChange", "visibleChange", "submit"],
|
|
20
|
-
setup(f, { expose:
|
|
21
|
-
const d = f, v =
|
|
20
|
+
setup(f, { expose: x, emit: R }) {
|
|
21
|
+
const d = f, v = R, a = P(), c = _([]), u = _({}), b = i(() => !!c.value.length), w = i(() => Object.keys(u.value).filter(
|
|
22
22
|
(e) => u.value[e]
|
|
23
|
-
)),
|
|
24
|
-
|
|
23
|
+
)), $ = i(() => d.list.filter((e) => !w.value.includes(e.key))), G = i(() => $.value.length > 0), I = (e) => e;
|
|
24
|
+
x({
|
|
25
25
|
validate: () => a.value ? new Promise((e, t) => {
|
|
26
26
|
var l;
|
|
27
27
|
(l = a.value) == null || l.validate((r, s) => {
|
|
@@ -39,24 +39,24 @@ const ue = /* @__PURE__ */ H({
|
|
|
39
39
|
resetFields: () => a.value ? a.value.resetFields() : console.error("实例化未完成"),
|
|
40
40
|
clearValidate: (e) => a.value ? a.value.clearValidate(e) : console.error("实例化未完成")
|
|
41
41
|
});
|
|
42
|
-
const g = i(() => d.list),
|
|
42
|
+
const g = i(() => d.list), F = i(() => g.value.reduce((e, t) => (t.rules && (typeof t.rules == "function" ? e[t.key] = t.rules({
|
|
43
43
|
data: d.data,
|
|
44
44
|
config: t
|
|
45
|
-
}) : e[t.key] = t.rules), e), {})),
|
|
45
|
+
}) : e[t.key] = t.rules), e), {})), k = i(() => c.value.reduce(
|
|
46
46
|
(e, t) => (e[t.key] = [
|
|
47
47
|
{
|
|
48
48
|
validator: () => [new Error(`${t.label}${t.message}`)]
|
|
49
49
|
}
|
|
50
50
|
], e),
|
|
51
51
|
{}
|
|
52
|
-
)),
|
|
53
|
-
const e = Object.keys(
|
|
52
|
+
)), K = i(() => {
|
|
53
|
+
const e = Object.keys(F.value), t = Object.keys(k.value);
|
|
54
54
|
return [...new Set(e.concat(t))].reduce((r, s) => (r[s] = [
|
|
55
|
-
...
|
|
56
|
-
...
|
|
55
|
+
...F.value[s] || [],
|
|
56
|
+
...k.value[s] || []
|
|
57
57
|
], r), {});
|
|
58
58
|
});
|
|
59
|
-
|
|
59
|
+
D(W, ({ key: e, message: t }) => {
|
|
60
60
|
if (!e)
|
|
61
61
|
return console.error("更新状态未传入key, 此处忽略");
|
|
62
62
|
const l = c.value.findIndex((r) => r.key === e);
|
|
@@ -70,16 +70,16 @@ const ue = /* @__PURE__ */ H({
|
|
|
70
70
|
label: d.list.find((r) => r.key === e).label
|
|
71
71
|
}) : c.value.splice(l, 1);
|
|
72
72
|
});
|
|
73
|
-
const
|
|
73
|
+
const M = ({
|
|
74
74
|
status: e,
|
|
75
75
|
config: { key: t }
|
|
76
76
|
}) => {
|
|
77
77
|
(u.value[t] || !1) !== e && (u.value[t] = e);
|
|
78
78
|
}, E = (e) => ({
|
|
79
|
-
...d.layout
|
|
80
|
-
...e
|
|
79
|
+
...S(d.layout),
|
|
80
|
+
...S(e)
|
|
81
81
|
});
|
|
82
|
-
return
|
|
82
|
+
return y(
|
|
83
83
|
g,
|
|
84
84
|
(e) => {
|
|
85
85
|
const t = e.map((l) => l.key);
|
|
@@ -90,10 +90,10 @@ const ue = /* @__PURE__ */ H({
|
|
|
90
90
|
{
|
|
91
91
|
immediate: !0
|
|
92
92
|
}
|
|
93
|
-
),
|
|
93
|
+
), y(b, () => {
|
|
94
94
|
v("loadingChange", b.value);
|
|
95
|
-
}),
|
|
96
|
-
|
|
95
|
+
}), y(
|
|
96
|
+
G,
|
|
97
97
|
(e) => {
|
|
98
98
|
v("visibleChange", e);
|
|
99
99
|
},
|
|
@@ -101,24 +101,24 @@ const ue = /* @__PURE__ */ H({
|
|
|
101
101
|
immediate: !0
|
|
102
102
|
}
|
|
103
103
|
), (e, t) => {
|
|
104
|
-
const l =
|
|
105
|
-
return
|
|
104
|
+
const l = H, r = B, s = A;
|
|
105
|
+
return h(), L(s, {
|
|
106
106
|
ref_key: "elForm",
|
|
107
107
|
ref: a,
|
|
108
108
|
model: f.data,
|
|
109
|
-
rules:
|
|
109
|
+
rules: p(K)
|
|
110
110
|
}, {
|
|
111
111
|
default: m(() => [
|
|
112
112
|
O(r, { gutter: f.rowGutter }, {
|
|
113
113
|
default: m(() => [
|
|
114
|
-
(
|
|
114
|
+
(h(!0), T(q, null, z(p(g), (o) => J((h(), L(l, V({
|
|
115
115
|
key: o.key
|
|
116
116
|
}, { ref_for: !0 }, E(o.layout)), {
|
|
117
117
|
default: m(() => [
|
|
118
|
-
O(
|
|
118
|
+
O(U, {
|
|
119
119
|
data: f.data,
|
|
120
|
-
config:
|
|
121
|
-
onViewHideChange:
|
|
120
|
+
config: I(o),
|
|
121
|
+
onViewHideChange: M,
|
|
122
122
|
onSubmit: t[0] || (t[0] = (n) => v("submit", n))
|
|
123
123
|
}, {
|
|
124
124
|
default: m((n) => [
|
|
@@ -129,7 +129,7 @@ const ue = /* @__PURE__ */ H({
|
|
|
129
129
|
]),
|
|
130
130
|
_: 2
|
|
131
131
|
}, 1040)), [
|
|
132
|
-
[
|
|
132
|
+
[Q, !(p(u)[o.key] ?? !1)]
|
|
133
133
|
])), 128)),
|
|
134
134
|
j(e.$slots, "default", { mergeLayout: E })
|
|
135
135
|
]),
|
|
@@ -142,5 +142,5 @@ const ue = /* @__PURE__ */ H({
|
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
export {
|
|
145
|
-
|
|
145
|
+
de as default
|
|
146
146
|
};
|
|
@@ -1,36 +1,73 @@
|
|
|
1
|
-
import { ElRadioGroup as
|
|
1
|
+
import { ElRadioGroup as E, ElRadioButton as h, ElRadio as y } from "element-plus/es";
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
3
|
import "element-plus/es/components/radio-group/style/css";
|
|
4
4
|
import "element-plus/es/components/radio/style/css";
|
|
5
|
-
import
|
|
6
|
-
|
|
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({
|
|
7
8
|
name: "FormRadioGroup",
|
|
8
9
|
inheritAttrs: !0,
|
|
9
10
|
__name: "FormRadioGroup",
|
|
10
|
-
props: {
|
|
11
|
-
options: {}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
props: /* @__PURE__ */ M({
|
|
12
|
+
options: {},
|
|
13
|
+
mode: { default: "radio" },
|
|
14
|
+
notNull: { type: Boolean, default: !0 }
|
|
15
|
+
}, {
|
|
16
|
+
modelValue: {},
|
|
17
|
+
modelModifiers: {}
|
|
18
|
+
}),
|
|
19
|
+
emits: ["update:modelValue"],
|
|
20
|
+
setup(t) {
|
|
21
|
+
const u = t, l = V(t, "modelValue"), r = G(() => {
|
|
22
|
+
if (u.notNull && u.options.length > 0) {
|
|
23
|
+
const o = u.options.some(
|
|
24
|
+
(i) => i.value === l.value
|
|
25
|
+
);
|
|
26
|
+
if (l.value === void 0 || !o)
|
|
27
|
+
return u.options[0].value;
|
|
28
|
+
}
|
|
29
|
+
return l.value;
|
|
30
|
+
}), f = (o) => {
|
|
31
|
+
l.value = o;
|
|
32
|
+
};
|
|
33
|
+
return _(
|
|
34
|
+
r,
|
|
35
|
+
(o) => {
|
|
36
|
+
o !== void 0 && o !== l.value && (l.value = o);
|
|
37
|
+
},
|
|
38
|
+
{ immediate: !0 }
|
|
39
|
+
), (o, i) => {
|
|
40
|
+
const b = h, R = y, k = E;
|
|
41
|
+
return a(), d(k, {
|
|
42
|
+
"model-value": g(r),
|
|
43
|
+
"onUpdate:modelValue": f
|
|
44
|
+
}, {
|
|
45
|
+
default: n(() => [
|
|
46
|
+
t.mode === "buttonGroup" ? (a(!0), m(s, { key: 0 }, c(t.options, (e) => (a(), d(b, {
|
|
47
|
+
key: e.value,
|
|
48
|
+
value: e.value,
|
|
49
|
+
disabled: e.disabled
|
|
50
|
+
}, {
|
|
51
|
+
default: n(() => [
|
|
52
|
+
p(v(e.label), 1)
|
|
53
|
+
]),
|
|
54
|
+
_: 2
|
|
55
|
+
}, 1032, ["value", "disabled"]))), 128)) : t.mode === "radio" ? (a(!0), m(s, { key: 1 }, c(t.options, (e) => (a(), d(R, {
|
|
56
|
+
key: e.value,
|
|
57
|
+
value: e.value,
|
|
58
|
+
disabled: e.disabled
|
|
22
59
|
}, {
|
|
23
|
-
default:
|
|
24
|
-
|
|
60
|
+
default: n(() => [
|
|
61
|
+
p(v(e.label), 1)
|
|
25
62
|
]),
|
|
26
63
|
_: 2
|
|
27
|
-
}, 1032, ["value", "disabled"]))), 128))
|
|
64
|
+
}, 1032, ["value", "disabled"]))), 128)) : x("", !0)
|
|
28
65
|
]),
|
|
29
66
|
_: 1
|
|
30
|
-
});
|
|
67
|
+
}, 8, ["model-value"]);
|
|
31
68
|
};
|
|
32
69
|
}
|
|
33
70
|
});
|
|
34
71
|
export {
|
|
35
|
-
|
|
72
|
+
D as default
|
|
36
73
|
};
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import t from "./
|
|
5
|
-
import f from "./
|
|
6
|
-
import s from "./FormSearch.vue.mjs";
|
|
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";
|
|
7
6
|
import n from "./FormVerifyImage.vue.mjs";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
7
|
+
import s from "./FormVerifyCode.vue.mjs";
|
|
8
|
+
import c from "./FormDatePicker.vue.mjs";
|
|
10
9
|
const p = {
|
|
11
|
-
FormMain:
|
|
12
|
-
FormSelect:
|
|
13
|
-
FormRadioGroup:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
FormSearch: s,
|
|
10
|
+
FormMain: e,
|
|
11
|
+
FormSelect: i,
|
|
12
|
+
FormRadioGroup: a,
|
|
13
|
+
FormTree: t,
|
|
14
|
+
FormSearch: f,
|
|
17
15
|
FormVerifyImage: n,
|
|
18
|
-
FormVerifyCode:
|
|
19
|
-
FormDatePicker:
|
|
20
|
-
},
|
|
16
|
+
FormVerifyCode: s,
|
|
17
|
+
FormDatePicker: c
|
|
18
|
+
}, h = {
|
|
21
19
|
install(o) {
|
|
22
20
|
Object.entries(p).forEach(([r, m]) => {
|
|
23
21
|
o.component(r, m);
|
|
@@ -25,14 +23,13 @@ const p = {
|
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
25
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
c as FormVerifyCode,
|
|
26
|
+
c as FormDatePicker,
|
|
27
|
+
e as FormMain,
|
|
28
|
+
a as FormRadioGroup,
|
|
29
|
+
f as FormSearch,
|
|
30
|
+
i as FormSelect,
|
|
31
|
+
t as FormTree,
|
|
32
|
+
s as FormVerifyCode,
|
|
36
33
|
n as FormVerifyImage,
|
|
37
|
-
|
|
34
|
+
h as formInstall
|
|
38
35
|
};
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import f from "lodash/cloneDeep";
|
|
2
|
-
const k = () => {
|
|
3
|
-
|
|
2
|
+
const y = ["xs", "sm", "md", "lg", "xl"], k = (t) => {
|
|
3
|
+
if (!t) return {};
|
|
4
|
+
const n = { ...t };
|
|
5
|
+
return t.span !== void 0 && y.forEach((e) => {
|
|
6
|
+
t[e] === void 0 && (n[e] = t.span);
|
|
7
|
+
}), n;
|
|
8
|
+
}, O = () => {
|
|
9
|
+
const t = /* @__PURE__ */ new Date(), n = new Date(
|
|
4
10
|
t.getFullYear(),
|
|
5
11
|
t.getMonth(),
|
|
6
12
|
t.getDate()
|
|
7
|
-
), e = new Date(
|
|
13
|
+
), e = new Date(n.getTime() + 864e5 - 1), s = new Date(n.getTime() - 864e5), r = new Date(n.getTime() - 1), i = new Date(n.getTime() - 6 * 864e5);
|
|
8
14
|
return [
|
|
9
15
|
{
|
|
10
16
|
key: "今日",
|
|
11
|
-
set: () => [
|
|
17
|
+
set: () => [n, e]
|
|
12
18
|
},
|
|
13
19
|
{
|
|
14
20
|
key: "昨日",
|
|
15
|
-
set: () => [s,
|
|
21
|
+
set: () => [s, r]
|
|
16
22
|
},
|
|
17
23
|
{
|
|
18
24
|
key: "近7日",
|
|
@@ -20,112 +26,112 @@ const k = () => {
|
|
|
20
26
|
}
|
|
21
27
|
];
|
|
22
28
|
}, u = (t) => {
|
|
23
|
-
const { ignore:
|
|
24
|
-
return
|
|
25
|
-
},
|
|
26
|
-
(
|
|
29
|
+
const { ignore: n, key: e } = t;
|
|
30
|
+
return n || e.startsWith("__") && e.toUpperCase() === e;
|
|
31
|
+
}, m = (t) => typeof t == "function", S = (t) => t.reduce(
|
|
32
|
+
(n, e) => (u(e) || (typeof e.init == "object" && console.error(
|
|
27
33
|
`表单项${e.label}的初始值不能为对象 请设置为返回值的形式`
|
|
28
|
-
),
|
|
34
|
+
), n[e.key] = m(e.init) ? e.init() : e.init), n),
|
|
29
35
|
{}
|
|
30
|
-
),
|
|
36
|
+
), D = (t, n) => {
|
|
31
37
|
const e = f(t);
|
|
32
|
-
return
|
|
33
|
-
(s,
|
|
34
|
-
if (u(
|
|
35
|
-
if (
|
|
36
|
-
const i =
|
|
37
|
-
t[
|
|
38
|
+
return n.reduce(
|
|
39
|
+
(s, r) => {
|
|
40
|
+
if (u(r)) return s;
|
|
41
|
+
if (r.parse) {
|
|
42
|
+
const i = r.parse(
|
|
43
|
+
t[r.key],
|
|
38
44
|
s,
|
|
39
45
|
e
|
|
40
46
|
);
|
|
41
|
-
i !== void 0 && (s[
|
|
47
|
+
i !== void 0 && (s[r.key] = i);
|
|
42
48
|
} else
|
|
43
|
-
s[
|
|
49
|
+
s[r.key] = t[r.key];
|
|
44
50
|
return s;
|
|
45
51
|
},
|
|
46
52
|
{}
|
|
47
53
|
);
|
|
48
|
-
},
|
|
54
|
+
}, b = (t, n) => {
|
|
49
55
|
const e = f(t);
|
|
50
|
-
return
|
|
51
|
-
(s,
|
|
52
|
-
if (u(
|
|
53
|
-
if (
|
|
54
|
-
const i =
|
|
55
|
-
t[
|
|
56
|
+
return n.reduce(
|
|
57
|
+
(s, r) => {
|
|
58
|
+
if (u(r)) return s;
|
|
59
|
+
if (r.stringify) {
|
|
60
|
+
const i = r.stringify(
|
|
61
|
+
t[r.key],
|
|
56
62
|
s,
|
|
57
63
|
e
|
|
58
64
|
);
|
|
59
|
-
i !== void 0 && (s[
|
|
65
|
+
i !== void 0 && (s[r.key] = i);
|
|
60
66
|
} else
|
|
61
|
-
s[
|
|
67
|
+
s[r.key] = t[r.key];
|
|
62
68
|
return s;
|
|
63
69
|
},
|
|
64
70
|
{}
|
|
65
71
|
);
|
|
66
|
-
},
|
|
72
|
+
}, I = ({
|
|
67
73
|
modelValueKey: t = "modelValue",
|
|
68
|
-
config:
|
|
74
|
+
config: n,
|
|
69
75
|
data: e,
|
|
70
|
-
updateData: s = (
|
|
71
|
-
e[
|
|
76
|
+
updateData: s = (r) => {
|
|
77
|
+
e[n.key] = r;
|
|
72
78
|
}
|
|
73
79
|
}) => ({
|
|
74
|
-
[t]: e[
|
|
75
|
-
[`onUpdate:${t}`]: (
|
|
76
|
-
s(
|
|
80
|
+
[t]: e[n.key],
|
|
81
|
+
[`onUpdate:${t}`]: (r) => {
|
|
82
|
+
s(r);
|
|
77
83
|
}
|
|
78
|
-
}),
|
|
79
|
-
var
|
|
80
|
-
return (
|
|
84
|
+
}), E = (t) => {
|
|
85
|
+
var n, e;
|
|
86
|
+
return (n = t.extra) != null && n.isInput ? {
|
|
81
87
|
placeholder: `请输入${t.label}`
|
|
82
88
|
} : (e = t.extra) != null && e.isSelect ? {
|
|
83
89
|
placeholder: `请选择${t.label}`
|
|
84
90
|
} : {};
|
|
85
|
-
},
|
|
91
|
+
}, _ = (t, n) => {
|
|
86
92
|
const { extra: e } = t;
|
|
87
93
|
if (e != null && e.enterSubmit)
|
|
88
94
|
return {
|
|
89
95
|
onKeyup: (s) => {
|
|
90
|
-
var
|
|
91
|
-
s.key === "Enter" && (
|
|
96
|
+
var r, i;
|
|
97
|
+
s.key === "Enter" && (n(), (i = (r = s.target) == null ? void 0 : r.blur) == null || i.call(r));
|
|
92
98
|
}
|
|
93
99
|
};
|
|
94
|
-
},
|
|
100
|
+
}, T = (t, n) => {
|
|
95
101
|
const { extra: e } = t;
|
|
96
102
|
if (e != null && e.isInput && ((e == null ? void 0 : e.blurSubmit) ?? !0))
|
|
97
103
|
return {
|
|
98
|
-
onBlur:
|
|
104
|
+
onBlur: n
|
|
99
105
|
};
|
|
100
|
-
},
|
|
106
|
+
}, h = (t, n) => {
|
|
101
107
|
const { extra: e } = t;
|
|
102
108
|
if (e != null && e.isSelect && ((e == null ? void 0 : e.changeSubmit) ?? !0))
|
|
103
109
|
return {
|
|
104
|
-
onChange:
|
|
110
|
+
onChange: n
|
|
105
111
|
};
|
|
106
|
-
},
|
|
107
|
-
y.push(...t);
|
|
108
|
-
}, w = (t) => {
|
|
112
|
+
}, C = Symbol("FORM_ITEM_CHANGE_LOADING"), d = (t) => t.required === !0, p = [], g = [], w = (t) => {
|
|
109
113
|
p.push(...t);
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
}, F = (t) => {
|
|
115
|
+
g.push(...t);
|
|
116
|
+
}, N = (t) => {
|
|
117
|
+
const { label: n, type: e, ...s } = t;
|
|
118
|
+
let r;
|
|
113
119
|
if (e)
|
|
114
|
-
|
|
120
|
+
r = e;
|
|
115
121
|
else {
|
|
116
122
|
const { render: o } = t;
|
|
117
|
-
o && (
|
|
123
|
+
o && (p.includes(o) ? r = "input" : g.includes(o) && (r = "select"));
|
|
118
124
|
}
|
|
119
125
|
let i;
|
|
120
|
-
|
|
126
|
+
r === "input" && (i = {
|
|
121
127
|
...s.extra || {},
|
|
122
128
|
isInput: !0
|
|
123
|
-
}),
|
|
129
|
+
}), r === "select" && (i = {
|
|
124
130
|
...s.extra || {},
|
|
125
131
|
isSelect: !0
|
|
126
132
|
});
|
|
127
133
|
let l;
|
|
128
|
-
if (
|
|
134
|
+
if (d(t)) {
|
|
129
135
|
l = [
|
|
130
136
|
{
|
|
131
137
|
required: !0,
|
|
@@ -133,36 +139,37 @@ const k = () => {
|
|
|
133
139
|
input: "输入",
|
|
134
140
|
select: "选择",
|
|
135
141
|
unknown: "填写"
|
|
136
|
-
}[
|
|
142
|
+
}[r ?? "unknown"]}${n}`,
|
|
137
143
|
trigger: "blur"
|
|
138
144
|
}
|
|
139
145
|
];
|
|
140
146
|
const { required: o, ...a } = s;
|
|
141
147
|
return {
|
|
142
|
-
label:
|
|
148
|
+
label: n,
|
|
143
149
|
extra: i,
|
|
144
150
|
rules: l,
|
|
145
151
|
...a
|
|
146
152
|
};
|
|
147
153
|
} else
|
|
148
154
|
return {
|
|
149
|
-
label:
|
|
155
|
+
label: n,
|
|
150
156
|
extra: i,
|
|
151
157
|
...s
|
|
152
158
|
};
|
|
153
159
|
};
|
|
154
160
|
export {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
w as
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
C as FORM_ITEM_CHANGE_LOADING,
|
|
162
|
+
S as generateFormData,
|
|
163
|
+
T as getBlurSubmit,
|
|
164
|
+
h as getChangeSubmit,
|
|
165
|
+
O as getDatePickerSwiftOptions,
|
|
166
|
+
_ as getEnterSubmit,
|
|
167
|
+
E as getPlaceholder,
|
|
168
|
+
I as getVModelSugar,
|
|
169
|
+
D as parseFormData,
|
|
170
|
+
k as resolveFormLayout,
|
|
171
|
+
w as setInputComponent,
|
|
172
|
+
F as setSelectComponent,
|
|
173
|
+
b as stringifyFormData,
|
|
174
|
+
N as swiftFormItemConfig
|
|
168
175
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ListPage.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-010d0705"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|