@done-coding/admin-core 0.7.0 → 0.8.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/components/display/ActionBtnGroup.vue.mjs +1 -1
- package/es/components/{misc → display}/ActionConfirm.vue.mjs +2 -2
- package/es/components/form/FormMain.vue.mjs +47 -44
- package/es/components/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +47 -46
- package/es/components/form/FormSubmitBtn.vue.mjs +66 -0
- package/es/components/form/FormSubmitBtn.vue2.mjs +4 -0
- package/es/components/form/FormSubmitPanel.vue.mjs +7 -0
- package/es/components/form/FormSubmitPanel.vue2.mjs +112 -0
- package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
- package/es/components/panel/PanelEditSwitch.vue2.mjs +67 -71
- package/es/components/panel/PanelItem.vue.mjs +72 -42
- package/es/components/panel/PanelMain.vue.mjs +5 -78
- package/es/components/panel/PanelMain.vue2.mjs +99 -2
- package/es/index.mjs +92 -88
- package/es/style.css +1 -1
- package/package.json +4 -2
- package/types/components/display/index.d.ts +12 -0
- package/types/components/display/types.d.ts +87 -1
- package/types/components/form/FormItem.vue.d.ts +2 -2
- package/types/components/form/FormMain.vue.d.ts +1 -1
- package/types/components/form/FormSearch.vue.d.ts +1 -1
- package/types/components/form/FormSubmitBtn.vue.d.ts +20 -0
- package/types/components/form/FormSubmitPanel.vue.d.ts +46 -0
- package/types/components/form/index.d.ts +3 -1
- package/types/components/form/types.d.ts +68 -3
- package/types/components/list-page/ListPage.vue.d.ts +1 -1
- package/types/components/list-page/types.d.ts +1 -1
- package/types/components/misc/index.d.ts +1 -3
- package/types/components/misc/types.d.ts +0 -88
- package/types/components/panel/PanelItem.vue.d.ts +18 -10
- package/types/components/panel/PanelMain.vue.d.ts +3 -5
- package/types/components/panel/types.d.ts +64 -33
- package/types/components/panel/PanelEditSwitch.vue.d.ts +0 -28
- /package/es/components/{misc → display}/ActionBtn.vue.mjs +0 -0
- /package/es/components/{misc → display}/ActionBtn.vue2.mjs +0 -0
- /package/es/components/{misc → display}/ActionConfirm.vue2.mjs +0 -0
- /package/types/components/{misc → display}/ActionBtn.vue.d.ts +0 -0
- /package/types/components/{misc → display}/ActionConfirm.vue.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as z, toRefs as C, computed as S, openBlock as r, createElementBlock as c, Fragment as s, renderList as h, createBlock as a, resolveDynamicComponent as i, unref as n, mergeProps as m, withCtx as d, createTextVNode as _, toDisplayString as k } from "vue";
|
|
2
2
|
import { ElButton as A } from "element-plus";
|
|
3
|
-
import P from "
|
|
3
|
+
import P from "./ActionBtn.vue.mjs";
|
|
4
4
|
const F = /* @__PURE__ */ z({
|
|
5
5
|
__name: "ActionBtnGroup",
|
|
6
6
|
props: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ActionConfirm.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-88119b35"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ElForm as
|
|
1
|
+
import { ElForm as M, ElRow as A, ElCol as B } 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
|
|
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
7
|
import U from "./FormItem.vue.mjs";
|
|
8
|
-
import { FORM_ITEM_CHANGE_LOADING as W, resolveFormLayout as S } from "./utils.mjs";
|
|
9
|
-
const
|
|
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
10
|
name: "FormMain",
|
|
11
11
|
inheritAttrs: !0,
|
|
12
12
|
__name: "FormMain",
|
|
@@ -18,73 +18,76 @@ const de = /* @__PURE__ */ N({
|
|
|
18
18
|
},
|
|
19
19
|
emits: ["loadingChange", "visibleChange", "submit"],
|
|
20
20
|
setup(f, { expose: x, emit: R }) {
|
|
21
|
-
const
|
|
22
|
-
(e) =>
|
|
23
|
-
)),
|
|
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
24
|
x({
|
|
25
|
-
validate: () =>
|
|
25
|
+
validate: () => s.value ? new Promise((e, t) => {
|
|
26
26
|
var l;
|
|
27
|
-
(l =
|
|
27
|
+
(l = s.value) == null || l.validate((r, i) => {
|
|
28
28
|
if (r)
|
|
29
29
|
e();
|
|
30
30
|
else {
|
|
31
|
-
const
|
|
32
|
-
Object.keys(
|
|
31
|
+
const a = { ...i || {} };
|
|
32
|
+
Object.keys(a).forEach((n) => {
|
|
33
33
|
var C;
|
|
34
|
-
|
|
35
|
-
}), Object.keys(
|
|
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
36
|
}
|
|
37
37
|
});
|
|
38
38
|
}) : Promise.reject(new Error("实例化未完成")),
|
|
39
|
-
resetFields: () =>
|
|
40
|
-
clearValidate: (e) =>
|
|
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)
|
|
41
44
|
});
|
|
42
|
-
const g =
|
|
43
|
-
data:
|
|
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,
|
|
44
47
|
config: t
|
|
45
|
-
}) : e[t.key] = t.rules), e), {})), k =
|
|
48
|
+
}) : e[t.key] = t.rules), e), {})), k = u(() => c.value.reduce(
|
|
46
49
|
(e, t) => (e[t.key] = [
|
|
47
50
|
{
|
|
48
51
|
validator: () => [new Error(`${t.label}${t.message}`)]
|
|
49
52
|
}
|
|
50
53
|
], e),
|
|
51
54
|
{}
|
|
52
|
-
)),
|
|
53
|
-
const e = Object.keys(
|
|
54
|
-
return [...new Set(e.concat(t))].reduce((r,
|
|
55
|
-
...
|
|
56
|
-
...k.value[
|
|
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] || []
|
|
57
60
|
], r), {});
|
|
58
61
|
});
|
|
59
|
-
|
|
62
|
+
P(W, ({ key: e, message: t }) => {
|
|
60
63
|
if (!e)
|
|
61
64
|
return console.error("更新状态未传入key, 此处忽略");
|
|
62
65
|
const l = c.value.findIndex((r) => r.key === e);
|
|
63
66
|
l === -1 ? t && c.value.push({
|
|
64
67
|
key: e,
|
|
65
68
|
message: t,
|
|
66
|
-
label:
|
|
69
|
+
label: o.list.find((r) => r.key === e).label
|
|
67
70
|
}) : t ? c.value.splice(l, 1, {
|
|
68
71
|
key: e,
|
|
69
72
|
message: t,
|
|
70
|
-
label:
|
|
73
|
+
label: o.list.find((r) => r.key === e).label
|
|
71
74
|
}) : c.value.splice(l, 1);
|
|
72
75
|
});
|
|
73
|
-
const
|
|
76
|
+
const K = ({
|
|
74
77
|
status: e,
|
|
75
78
|
config: { key: t }
|
|
76
79
|
}) => {
|
|
77
|
-
(
|
|
80
|
+
(d.value[t] || !1) !== e && (d.value[t] = e);
|
|
78
81
|
}, E = (e) => ({
|
|
79
|
-
...S(
|
|
82
|
+
...S(o.layout),
|
|
80
83
|
...S(e)
|
|
81
84
|
});
|
|
82
85
|
return y(
|
|
83
86
|
g,
|
|
84
87
|
(e) => {
|
|
85
88
|
const t = e.map((l) => l.key);
|
|
86
|
-
Object.keys(
|
|
87
|
-
t.includes(l) || delete
|
|
89
|
+
Object.keys(d.value).forEach((l) => {
|
|
90
|
+
t.includes(l) || delete d.value[l];
|
|
88
91
|
});
|
|
89
92
|
},
|
|
90
93
|
{
|
|
@@ -93,7 +96,7 @@ const de = /* @__PURE__ */ N({
|
|
|
93
96
|
), y(b, () => {
|
|
94
97
|
v("loadingChange", b.value);
|
|
95
98
|
}), y(
|
|
96
|
-
|
|
99
|
+
$,
|
|
97
100
|
(e) => {
|
|
98
101
|
v("visibleChange", e);
|
|
99
102
|
},
|
|
@@ -101,35 +104,35 @@ const de = /* @__PURE__ */ N({
|
|
|
101
104
|
immediate: !0
|
|
102
105
|
}
|
|
103
106
|
), (e, t) => {
|
|
104
|
-
const l =
|
|
105
|
-
return
|
|
107
|
+
const l = B, r = A, i = M;
|
|
108
|
+
return p(), L(i, {
|
|
106
109
|
ref_key: "elForm",
|
|
107
|
-
ref:
|
|
110
|
+
ref: s,
|
|
108
111
|
model: f.data,
|
|
109
|
-
rules:
|
|
112
|
+
rules: h(I)
|
|
110
113
|
}, {
|
|
111
114
|
default: m(() => [
|
|
112
115
|
O(r, { gutter: f.rowGutter }, {
|
|
113
116
|
default: m(() => [
|
|
114
|
-
(
|
|
115
|
-
key:
|
|
116
|
-
}, { ref_for: !0 }, E(
|
|
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)), {
|
|
117
120
|
default: m(() => [
|
|
118
121
|
O(U, {
|
|
119
122
|
data: f.data,
|
|
120
|
-
config:
|
|
121
|
-
onViewHideChange:
|
|
123
|
+
config: G(a),
|
|
124
|
+
onViewHideChange: K,
|
|
122
125
|
onSubmit: t[0] || (t[0] = (n) => v("submit", n))
|
|
123
126
|
}, {
|
|
124
127
|
default: m((n) => [
|
|
125
|
-
j(e.$slots,
|
|
128
|
+
j(e.$slots, a.key, V({ ref_for: !0 }, n))
|
|
126
129
|
]),
|
|
127
130
|
_: 2
|
|
128
131
|
}, 1032, ["data", "config"])
|
|
129
132
|
]),
|
|
130
133
|
_: 2
|
|
131
134
|
}, 1040)), [
|
|
132
|
-
[Q, !(
|
|
135
|
+
[Q, !(h(d)[a.key] ?? !1)]
|
|
133
136
|
])), 128)),
|
|
134
137
|
j(e.$slots, "default", { mergeLayout: E })
|
|
135
138
|
]),
|
|
@@ -142,5 +145,5 @@ const de = /* @__PURE__ */ N({
|
|
|
142
145
|
}
|
|
143
146
|
});
|
|
144
147
|
export {
|
|
145
|
-
|
|
148
|
+
me as default
|
|
146
149
|
};
|
|
@@ -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 f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d240f220"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ElCol as
|
|
1
|
+
import L from "./FormMain.vue.mjs";
|
|
2
|
+
import { ElCol as T, ElButton as H, ElIcon as U } from "element-plus/es";
|
|
3
3
|
import "element-plus/es/components/base/style/css";
|
|
4
4
|
import "element-plus/es/components/col/style/css";
|
|
5
5
|
import "element-plus/es/components/button/style/css";
|
|
6
6
|
import "element-plus/es/components/icon/style/css";
|
|
7
7
|
import { defineComponent as j, useAttrs as q, ref as k, computed as l, shallowRef as J, openBlock as f, createBlock as p, normalizeClass as K, unref as r, withCtx as a, withDirectives as O, createVNode as m, mergeProps as X, createSlots as Y, normalizeProps as R, guardReactiveProps as S, createElementVNode as Z, createTextVNode as y, toDisplayString as ee, createCommentVNode as te, renderList as oe, renderSlot as re, vShow as ae } from "vue";
|
|
8
|
-
import { stringifyFormData as
|
|
9
|
-
import { getCurrentSpan as
|
|
8
|
+
import { stringifyFormData as ne } from "./utils.mjs";
|
|
9
|
+
import { getCurrentSpan as se, computeButtonColProps as le, computeItemsPerRow as ie } from "./form-search-utils.mjs";
|
|
10
10
|
import { ArrowDown as ue, ArrowUp as me } from "@element-plus/icons-vue";
|
|
11
11
|
import ce from "../display/WatchSize.vue.mjs";
|
|
12
12
|
import { useBreakpoint as de } from "../../hooks/use-breakpoint.mjs";
|
|
13
|
-
const fe = { class: "btn-box" },
|
|
13
|
+
const fe = { class: "btn-box" }, Pe = /* @__PURE__ */ j({
|
|
14
14
|
name: "FormSearch",
|
|
15
15
|
inheritAttrs: !1,
|
|
16
16
|
__name: "FormSearch",
|
|
@@ -31,67 +31,67 @@ const fe = { class: "btn-box" }, _e = /* @__PURE__ */ j({
|
|
|
31
31
|
rowGutter: {}
|
|
32
32
|
},
|
|
33
33
|
emits: ["search", "heightChange", "visibleChange"],
|
|
34
|
-
setup(
|
|
35
|
-
const o =
|
|
34
|
+
setup(i, { expose: P, emit: _ }) {
|
|
35
|
+
const o = i, c = _, E = q(), h = k(!1), { activeBreakpoint: F } = de(), n = k(!0), B = l(() => o.data), v = l(() => {
|
|
36
36
|
if (o.maxRows <= 0) return 1 / 0;
|
|
37
|
-
const e =
|
|
38
|
-
return Math.max(0, o.maxRows * t -
|
|
37
|
+
const e = se(o.layout, F.value), t = ie(e), u = t > 1 ? 1 : 0;
|
|
38
|
+
return Math.max(0, o.maxRows * t - u);
|
|
39
39
|
}), M = l(() => o.maxRows <= 0 ? !1 : o.list.filter(
|
|
40
40
|
(t) => t.hide !== !0
|
|
41
41
|
).length > v.value), V = l(() => {
|
|
42
42
|
let e = 0;
|
|
43
43
|
for (let t = 0; t < o.list.length; t++)
|
|
44
|
-
o.list[t].hide !== !0 && (
|
|
44
|
+
o.list[t].hide !== !0 && (n.value && o.maxRows > 0 && t >= v.value || e++);
|
|
45
45
|
return e;
|
|
46
46
|
}), I = l(() => le(o.layout, V.value)), D = l(() => {
|
|
47
|
-
if (!
|
|
47
|
+
if (!n.value || o.maxRows <= 0)
|
|
48
48
|
return o.list;
|
|
49
49
|
const e = v.value;
|
|
50
50
|
return o.list.map(
|
|
51
|
-
(t,
|
|
51
|
+
(t, u) => u >= e ? { ...t, hide: !0 } : t
|
|
52
52
|
);
|
|
53
|
-
}), C = (e = !
|
|
54
|
-
|
|
53
|
+
}), C = (e = !n.value) => {
|
|
54
|
+
n.value = e;
|
|
55
55
|
}, $ = (e) => {
|
|
56
56
|
c("heightChange", e);
|
|
57
|
-
},
|
|
57
|
+
}, s = J(), b = (e) => ({
|
|
58
58
|
...o.staticQuery || {},
|
|
59
|
-
...
|
|
59
|
+
...ne(e, o.list)
|
|
60
60
|
}), x = () => {
|
|
61
61
|
var e;
|
|
62
|
-
(e =
|
|
63
|
-
},
|
|
62
|
+
(e = s.value) == null || e.resetFields(), c("search", b(o.data), "reset");
|
|
63
|
+
}, w = (e = "search") => {
|
|
64
64
|
var t;
|
|
65
|
-
(t =
|
|
65
|
+
(t = s.value) == null || t.validate().then(() => {
|
|
66
66
|
c("search", b(o.data), e);
|
|
67
67
|
});
|
|
68
68
|
}, A = (e) => {
|
|
69
|
-
|
|
69
|
+
w(e);
|
|
70
70
|
}, N = {
|
|
71
71
|
validate: () => {
|
|
72
|
-
if (
|
|
73
|
-
return
|
|
72
|
+
if (s.value)
|
|
73
|
+
return s.value.validate();
|
|
74
74
|
throw new Error("实例化未完成");
|
|
75
75
|
},
|
|
76
76
|
resetFields: () => {
|
|
77
77
|
var e;
|
|
78
|
-
return (e =
|
|
78
|
+
return (e = s.value) == null ? void 0 : e.resetFields();
|
|
79
79
|
},
|
|
80
80
|
clearValidate: (e) => {
|
|
81
81
|
var t;
|
|
82
|
-
return (t =
|
|
82
|
+
return (t = s.value) == null ? void 0 : t.clearValidate(e);
|
|
83
83
|
},
|
|
84
84
|
triggerReset: x,
|
|
85
|
-
triggerSearch: () =>
|
|
85
|
+
triggerSearch: () => w(),
|
|
86
86
|
toggleCollapse: C,
|
|
87
|
-
isCollapsed: l(() =>
|
|
87
|
+
isCollapsed: l(() => n.value)
|
|
88
88
|
};
|
|
89
|
-
|
|
89
|
+
P(N);
|
|
90
90
|
const W = (e) => {
|
|
91
91
|
h.value = e, c("visibleChange", e);
|
|
92
92
|
};
|
|
93
93
|
return (e, t) => {
|
|
94
|
-
const
|
|
94
|
+
const u = U, g = H, Q = T, z = L;
|
|
95
95
|
return f(), p(ce, {
|
|
96
96
|
class: K(["form-search", {
|
|
97
97
|
"form-search_show": r(h)
|
|
@@ -101,13 +101,14 @@ const fe = { class: "btn-box" }, _e = /* @__PURE__ */ j({
|
|
|
101
101
|
default: a(() => [
|
|
102
102
|
O(m(z, X({
|
|
103
103
|
ref_key: "formMain",
|
|
104
|
-
ref:
|
|
104
|
+
ref: s,
|
|
105
105
|
list: r(D),
|
|
106
|
-
data: r(B)
|
|
106
|
+
data: r(B),
|
|
107
|
+
"row-gutter": i.rowGutter
|
|
107
108
|
}, r(E), {
|
|
108
|
-
layout:
|
|
109
|
-
labelPosition:
|
|
110
|
-
labelWidth:
|
|
109
|
+
layout: i.layout,
|
|
110
|
+
labelPosition: i.labelPosition,
|
|
111
|
+
labelWidth: i.labelWidth,
|
|
111
112
|
onSubmit: A,
|
|
112
113
|
onVisibleChange: W
|
|
113
114
|
}), Y({
|
|
@@ -115,25 +116,25 @@ const fe = { class: "btn-box" }, _e = /* @__PURE__ */ j({
|
|
|
115
116
|
m(Q, R(S(r(I))), {
|
|
116
117
|
default: a(() => [
|
|
117
118
|
Z("div", fe, [
|
|
118
|
-
r(M) ? (f(), p(
|
|
119
|
+
r(M) ? (f(), p(g, {
|
|
119
120
|
key: 0,
|
|
120
121
|
type: "primary",
|
|
121
122
|
link: "",
|
|
122
123
|
onMousedown: t[0] || (t[0] = (d) => C())
|
|
123
124
|
}, {
|
|
124
125
|
default: a(() => [
|
|
125
|
-
m(
|
|
126
|
+
m(u, { class: "btn-box-expand-icon" }, {
|
|
126
127
|
default: a(() => [
|
|
127
|
-
r(
|
|
128
|
+
r(n) ? (f(), p(r(ue), { key: 0 })) : (f(), p(r(me), { key: 1 }))
|
|
128
129
|
]),
|
|
129
130
|
_: 1
|
|
130
131
|
}),
|
|
131
|
-
y(" " + ee(r(
|
|
132
|
+
y(" " + ee(r(n) ? "展开更多" : "收起更多"), 1)
|
|
132
133
|
]),
|
|
133
134
|
_: 1
|
|
134
135
|
})) : te("", !0),
|
|
135
|
-
m(
|
|
136
|
-
type: "
|
|
136
|
+
m(g, {
|
|
137
|
+
type: "warning",
|
|
137
138
|
onMousedown: x
|
|
138
139
|
}, {
|
|
139
140
|
default: a(() => [...t[2] || (t[2] = [
|
|
@@ -141,9 +142,9 @@ const fe = { class: "btn-box" }, _e = /* @__PURE__ */ j({
|
|
|
141
142
|
])]),
|
|
142
143
|
_: 1
|
|
143
144
|
}),
|
|
144
|
-
m(
|
|
145
|
+
m(g, {
|
|
145
146
|
type: "primary",
|
|
146
|
-
onMousedown: t[1] || (t[1] = (d) =>
|
|
147
|
+
onMousedown: t[1] || (t[1] = (d) => w())
|
|
147
148
|
}, {
|
|
148
149
|
default: a(() => [...t[3] || (t[3] = [
|
|
149
150
|
y("查询", -1)
|
|
@@ -157,13 +158,13 @@ const fe = { class: "btn-box" }, _e = /* @__PURE__ */ j({
|
|
|
157
158
|
]),
|
|
158
159
|
_: 2
|
|
159
160
|
}, [
|
|
160
|
-
oe(
|
|
161
|
+
oe(i.list, (d) => ({
|
|
161
162
|
name: d.key,
|
|
162
|
-
fn: a((
|
|
163
|
-
re(e.$slots, d.key, R(S(
|
|
163
|
+
fn: a((G) => [
|
|
164
|
+
re(e.$slots, d.key, R(S(G)), void 0, !0)
|
|
164
165
|
])
|
|
165
166
|
}))
|
|
166
|
-
]), 1040, ["list", "data", "layout", "labelPosition", "labelWidth"]), [
|
|
167
|
+
]), 1040, ["list", "data", "row-gutter", "layout", "labelPosition", "labelWidth"]), [
|
|
167
168
|
[ae, r(h)]
|
|
168
169
|
])
|
|
169
170
|
]),
|
|
@@ -173,5 +174,5 @@ const fe = { class: "btn-box" }, _e = /* @__PURE__ */ j({
|
|
|
173
174
|
}
|
|
174
175
|
});
|
|
175
176
|
export {
|
|
176
|
-
|
|
177
|
+
Pe as default
|
|
177
178
|
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ElButton as m } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/button/style/css";
|
|
4
|
+
import { defineComponent as p, ref as u, computed as f, openBlock as y, createBlock as d, mergeProps as B, unref as b, withCtx as g, createTextVNode as x, toDisplayString as _ } from "vue";
|
|
5
|
+
import k from "lodash/omit";
|
|
6
|
+
const w = /* @__PURE__ */ p({
|
|
7
|
+
__name: "FormSubmitBtn",
|
|
8
|
+
props: {
|
|
9
|
+
size: {},
|
|
10
|
+
disabled: { type: Boolean },
|
|
11
|
+
type: {},
|
|
12
|
+
icon: {},
|
|
13
|
+
nativeType: {},
|
|
14
|
+
loadingIcon: {},
|
|
15
|
+
plain: { type: Boolean },
|
|
16
|
+
text: { type: Boolean },
|
|
17
|
+
link: { type: Boolean },
|
|
18
|
+
bg: { type: Boolean },
|
|
19
|
+
autofocus: { type: Boolean },
|
|
20
|
+
round: { type: Boolean },
|
|
21
|
+
circle: { type: Boolean },
|
|
22
|
+
dashed: { type: Boolean },
|
|
23
|
+
color: {},
|
|
24
|
+
dark: { type: Boolean },
|
|
25
|
+
autoInsertSpace: { type: Boolean },
|
|
26
|
+
tag: {},
|
|
27
|
+
formMainInstance: {},
|
|
28
|
+
submitText: { default: "提交" },
|
|
29
|
+
submitFn: {}
|
|
30
|
+
},
|
|
31
|
+
emits: ["success", "fail"],
|
|
32
|
+
setup(a, { emit: s }) {
|
|
33
|
+
const e = a, i = s, o = u(!1), l = f(
|
|
34
|
+
() => k(e, ["formMainInstance", "submitText", "submitFn"])
|
|
35
|
+
), r = async () => {
|
|
36
|
+
o.value = !0;
|
|
37
|
+
const { formMainInstance: n } = e;
|
|
38
|
+
try {
|
|
39
|
+
await n.validate();
|
|
40
|
+
const t = n.stringify();
|
|
41
|
+
await e.submitFn(t), i("success", {
|
|
42
|
+
stringifyData: t
|
|
43
|
+
});
|
|
44
|
+
} catch (t) {
|
|
45
|
+
i("fail", t);
|
|
46
|
+
} finally {
|
|
47
|
+
o.value = !1;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return (n, t) => {
|
|
51
|
+
const c = m;
|
|
52
|
+
return y(), d(c, B(b(l), {
|
|
53
|
+
loading: o.value,
|
|
54
|
+
onClick: r
|
|
55
|
+
}), {
|
|
56
|
+
default: g(() => [
|
|
57
|
+
x(_(a.submitText), 1)
|
|
58
|
+
]),
|
|
59
|
+
_: 1
|
|
60
|
+
}, 16, ["loading"]);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
export {
|
|
65
|
+
w as default
|
|
66
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { defineComponent as M, useAttrs as N, shallowRef as V, useModel as W, computed as s, watch as E, openBlock as i, createElementBlock as R, normalizeClass as T, createVNode as D, mergeProps as l, unref as m, createSlots as j, renderList as z, withCtx as o, renderSlot as u, normalizeProps as G, guardReactiveProps as H, createBlock as f, resolveDynamicComponent as I, createElementVNode as L, createTextVNode as g, toDisplayString as B, createCommentVNode as v, mergeModels as x } from "vue";
|
|
2
|
+
import { ElAffix as O } from "element-plus";
|
|
3
|
+
import q from "./FormMain.vue.mjs";
|
|
4
|
+
import J from "./FormSubmitBtn.vue.mjs";
|
|
5
|
+
import P from "../display/ActionBtn.vue.mjs";
|
|
6
|
+
import { parseFormData as K, generateFormData as Q } from "./utils.mjs";
|
|
7
|
+
const U = { class: "form-submit-panel-operation-inner" }, nt = /* @__PURE__ */ M({
|
|
8
|
+
name: "FormSubmitPanel",
|
|
9
|
+
inheritAttrs: !1,
|
|
10
|
+
__name: "FormSubmitPanel",
|
|
11
|
+
props: /* @__PURE__ */ x({
|
|
12
|
+
list: {},
|
|
13
|
+
layout: { default: () => ({
|
|
14
|
+
span: 24
|
|
15
|
+
}) },
|
|
16
|
+
rowGutter: {},
|
|
17
|
+
stringifyData: {},
|
|
18
|
+
submitText: {},
|
|
19
|
+
submitFn: {},
|
|
20
|
+
submitBtnProps: {},
|
|
21
|
+
labelPosition: { default: "right" },
|
|
22
|
+
labelWidth: { default: "auto" },
|
|
23
|
+
cancelBtn: {},
|
|
24
|
+
resetBtn: {},
|
|
25
|
+
operationPosition: { default: "bottom-center" },
|
|
26
|
+
operationAffix: { type: [Boolean, Object], default: !1 }
|
|
27
|
+
}, {
|
|
28
|
+
parseData: {
|
|
29
|
+
// 此处在实际运行使用时 已经触发了 getResetData
|
|
30
|
+
default: () => ({})
|
|
31
|
+
},
|
|
32
|
+
parseDataModifiers: {}
|
|
33
|
+
}),
|
|
34
|
+
emits: /* @__PURE__ */ x(["cancel", "fail", "success", "reset"], ["update:parseData"]),
|
|
35
|
+
setup(t, { emit: h }) {
|
|
36
|
+
const e = t, n = h, k = N(), c = V(), r = W(t, "parseData"), S = s(() => c.value), w = s(() => e.operationAffix ? O : "div"), A = s(() => e.operationAffix ? typeof e.operationAffix == "object" ? e.operationAffix : { position: "bottom" } : {}), d = () => e.stringifyData ? K(e.stringifyData, e.list) : Q(e.list), b = () => n("cancel"), p = () => n("reset", d()), C = (a) => n("success", {
|
|
37
|
+
stringifyData: a.stringifyData,
|
|
38
|
+
parseData: r.value
|
|
39
|
+
}), F = (a) => n("fail", a);
|
|
40
|
+
return E(
|
|
41
|
+
[() => e.stringifyData, () => e.list],
|
|
42
|
+
() => {
|
|
43
|
+
r.value = d();
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
immediate: !0
|
|
47
|
+
}
|
|
48
|
+
), (a, X) => (i(), R("div", {
|
|
49
|
+
class: T(["form-submit-panel", `form-submit-panel_${t.operationPosition}`])
|
|
50
|
+
}, [
|
|
51
|
+
D(q, l({
|
|
52
|
+
ref_key: "formMain",
|
|
53
|
+
ref: c,
|
|
54
|
+
class: "form-submit-panel-form",
|
|
55
|
+
list: t.list,
|
|
56
|
+
data: r.value,
|
|
57
|
+
"row-gutter": t.rowGutter
|
|
58
|
+
}, m(k), {
|
|
59
|
+
layout: t.layout,
|
|
60
|
+
labelPosition: t.labelPosition,
|
|
61
|
+
labelWidth: t.labelWidth
|
|
62
|
+
}), j({ _: 2 }, [
|
|
63
|
+
z(t.list, (y) => ({
|
|
64
|
+
name: y.key,
|
|
65
|
+
fn: o(($) => [
|
|
66
|
+
u(a.$slots, y.key, G(H($)), void 0, !0)
|
|
67
|
+
])
|
|
68
|
+
}))
|
|
69
|
+
]), 1040, ["list", "data", "row-gutter", "layout", "labelPosition", "labelWidth"]),
|
|
70
|
+
(i(), f(I(w.value), l(A.value, { class: "form-submit-panel-operation" }), {
|
|
71
|
+
default: o(() => [
|
|
72
|
+
L("div", U, [
|
|
73
|
+
u(a.$slots, "cancelBtn", { cancel: b }, () => [
|
|
74
|
+
t.cancelBtn ? (i(), f(m(P), {
|
|
75
|
+
key: 0,
|
|
76
|
+
onClick: b
|
|
77
|
+
}, {
|
|
78
|
+
default: o(() => [
|
|
79
|
+
g(B(t.cancelBtn), 1)
|
|
80
|
+
]),
|
|
81
|
+
_: 1
|
|
82
|
+
})) : v("", !0)
|
|
83
|
+
], !0),
|
|
84
|
+
u(a.$slots, "resetBtn", { reset: p }, () => [
|
|
85
|
+
t.resetBtn ? (i(), f(m(P), {
|
|
86
|
+
key: 0,
|
|
87
|
+
type: "warning",
|
|
88
|
+
onClick: p
|
|
89
|
+
}, {
|
|
90
|
+
default: o(() => [
|
|
91
|
+
g(B(t.resetBtn), 1)
|
|
92
|
+
]),
|
|
93
|
+
_: 1
|
|
94
|
+
})) : v("", !0)
|
|
95
|
+
], !0),
|
|
96
|
+
D(J, l(t.submitBtnProps, {
|
|
97
|
+
"submit-fn": t.submitFn,
|
|
98
|
+
"submit-text": t.submitText,
|
|
99
|
+
"form-main-instance": S.value,
|
|
100
|
+
onSuccess: C,
|
|
101
|
+
onFail: F
|
|
102
|
+
}), null, 16, ["submit-fn", "submit-text", "form-main-instance"])
|
|
103
|
+
])
|
|
104
|
+
]),
|
|
105
|
+
_: 3
|
|
106
|
+
}, 16))
|
|
107
|
+
], 2));
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
export {
|
|
111
|
+
nt as default
|
|
112
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./PanelEditSwitch.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
4
|
+
const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-5b38b68e"]]);
|
|
5
5
|
export {
|
|
6
6
|
i as default
|
|
7
7
|
};
|