@form-create/element-ui 2.7.14 → 2.7.16
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/dist/form-create.esm.js +392 -383
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +3 -3
package/dist/form-create.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/element-ui v2.7.
|
|
3
|
+
* @form-create/element-ui v2.7.16
|
|
4
4
|
* (c) 2018-2025 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
@@ -19,7 +19,7 @@ var at = (t, e, r) => e in t ? ir(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
19
19
|
ar.call(e, r) && at(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
21
|
}, q = (t, e) => nr(t, sr(e));
|
|
22
|
-
import $e, { getCurrentInstance as lr, provide as ur, inject as fr, toRefs as lt, reactive as
|
|
22
|
+
import $e, { getCurrentInstance as lr, provide as ur, inject as fr, toRefs as lt, reactive as ne, onBeforeMount as cr, watch as L, onMounted as hr, onBeforeUnmount as dr, onUpdated as pr, nextTick as P, markRaw as ge, computed as ye, toRef as Ae, ref as mr } from "vue";
|
|
23
23
|
function gr(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
@@ -496,7 +496,7 @@ const Fr = "fcFrame", kr = {
|
|
|
496
496
|
mounted() {
|
|
497
497
|
this.$on("fc.closeModal", this.closeModal);
|
|
498
498
|
}
|
|
499
|
-
}, Er = "fcRadio",
|
|
499
|
+
}, Er = "fcRadio", Rr = {
|
|
500
500
|
name: Er,
|
|
501
501
|
props: {
|
|
502
502
|
formCreateInject: {
|
|
@@ -591,11 +591,11 @@ const Fr = "fcFrame", kr = {
|
|
|
591
591
|
return h.type(e, t);
|
|
592
592
|
};
|
|
593
593
|
});
|
|
594
|
-
function
|
|
594
|
+
function j(t, e) {
|
|
595
595
|
return {}.hasOwnProperty.call(t, e);
|
|
596
596
|
}
|
|
597
|
-
const
|
|
598
|
-
name:
|
|
597
|
+
const Sr = "fcSelect", jr = {
|
|
598
|
+
name: Sr,
|
|
599
599
|
functional: !0,
|
|
600
600
|
props: {
|
|
601
601
|
formCreateInject: {
|
|
@@ -621,13 +621,13 @@ const Rr = "fcSelect", Dr = {
|
|
|
621
621
|
}, [h.trueArray(n.options) && n.options.map((a, l) => r(a, l))]), s = e.props.formCreateInject.options;
|
|
622
622
|
return t("ElSelect", I([{}, e.data, {
|
|
623
623
|
ref: "el"
|
|
624
|
-
}]), [(Array.isArray(s) ? s : []).map((n, o) =>
|
|
624
|
+
}]), [(Array.isArray(s) ? s : []).map((n, o) => j(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
625
625
|
},
|
|
626
626
|
mounted() {
|
|
627
627
|
this.$emit("fc.el", this.$refs.el);
|
|
628
628
|
}
|
|
629
|
-
},
|
|
630
|
-
name:
|
|
629
|
+
}, Dr = "fcTree", Ar = {
|
|
630
|
+
name: Dr,
|
|
631
631
|
formCreateParser: {
|
|
632
632
|
mergeProp(t) {
|
|
633
633
|
const e = t.prop.props;
|
|
@@ -912,13 +912,13 @@ const Ir = "fcUpload", Pr = {
|
|
|
912
912
|
}), this.$emit("fc.el", this.$refs.upload);
|
|
913
913
|
}
|
|
914
914
|
};
|
|
915
|
-
function
|
|
915
|
+
function F(t, e, r) {
|
|
916
916
|
$e.set(t, e, r);
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function ie(t, e) {
|
|
919
919
|
($e.del || $e.delete)(t, e);
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function Oe(t, e = {}, r) {
|
|
922
922
|
let i = !1;
|
|
923
923
|
for (let s in e)
|
|
924
924
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
@@ -926,29 +926,29 @@ function we(t, e = {}, r) {
|
|
|
926
926
|
if ((i = Array.isArray(n)) || h.Object(n)) {
|
|
927
927
|
let o = t[s] === void 0;
|
|
928
928
|
if (i)
|
|
929
|
-
i = !1, o &&
|
|
929
|
+
i = !1, o && F(t, s, []);
|
|
930
930
|
else if (n._clone && r !== void 0)
|
|
931
931
|
if (r)
|
|
932
|
-
n = n.getRule(), o &&
|
|
932
|
+
n = n.getRule(), o && F(t, s, {});
|
|
933
933
|
else {
|
|
934
|
-
|
|
934
|
+
F(t, s, n._clone());
|
|
935
935
|
continue;
|
|
936
936
|
}
|
|
937
937
|
else
|
|
938
|
-
o &&
|
|
939
|
-
t[s] =
|
|
938
|
+
o && F(t, s, {});
|
|
939
|
+
t[s] = Oe(t[s], n, r);
|
|
940
940
|
} else
|
|
941
|
-
|
|
941
|
+
F(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
|
|
942
942
|
}
|
|
943
943
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
944
944
|
}
|
|
945
945
|
function K(t) {
|
|
946
|
-
return
|
|
946
|
+
return Oe({}, { value: t }).value;
|
|
947
947
|
}
|
|
948
948
|
const Tr = Object.assign || function(t) {
|
|
949
949
|
for (let e, r = 1; r < arguments.length; r++)
|
|
950
950
|
for (let i in e = arguments[r], e)
|
|
951
|
-
Object.prototype.hasOwnProperty.call(e, i) &&
|
|
951
|
+
Object.prototype.hasOwnProperty.call(e, i) && F(t, i, e[i]);
|
|
952
952
|
return t;
|
|
953
953
|
};
|
|
954
954
|
function _() {
|
|
@@ -1039,7 +1039,7 @@ const Br = "fcGroup", Lr = {
|
|
|
1039
1039
|
const s = i.$f.formData();
|
|
1040
1040
|
if (t === e)
|
|
1041
1041
|
i.$f.deferSyncValue(() => {
|
|
1042
|
-
|
|
1042
|
+
Oe(i.rule, t), i.$f.setValue(s);
|
|
1043
1043
|
}, !0);
|
|
1044
1044
|
else {
|
|
1045
1045
|
const n = i.$f.formData();
|
|
@@ -1079,7 +1079,7 @@ const Br = "fcGroup", Lr = {
|
|
|
1079
1079
|
},
|
|
1080
1080
|
methods: {
|
|
1081
1081
|
_value(t) {
|
|
1082
|
-
return t &&
|
|
1082
|
+
return t && j(t, this.field) ? t[this.field] : t;
|
|
1083
1083
|
},
|
|
1084
1084
|
cache(t, e) {
|
|
1085
1085
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1349,14 +1349,14 @@ const Br = "fcGroup", Lr = {
|
|
|
1349
1349
|
}, qr = [
|
|
1350
1350
|
Or,
|
|
1351
1351
|
kr,
|
|
1352
|
-
|
|
1353
|
-
|
|
1352
|
+
Rr,
|
|
1353
|
+
jr,
|
|
1354
1354
|
Ar,
|
|
1355
1355
|
Pr,
|
|
1356
1356
|
Lr,
|
|
1357
1357
|
Mr
|
|
1358
1358
|
];
|
|
1359
|
-
function
|
|
1359
|
+
function se(t, e) {
|
|
1360
1360
|
var r = null;
|
|
1361
1361
|
return function(...i) {
|
|
1362
1362
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
@@ -1369,8 +1369,8 @@ function be(t) {
|
|
|
1369
1369
|
function Ur(t) {
|
|
1370
1370
|
return t.replace(t[0], t[0].toLocaleUpperCase());
|
|
1371
1371
|
}
|
|
1372
|
-
const kt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style", "directives"],
|
|
1373
|
-
const i = [...kt, ...r.normal || []], s = [...Et, ...r.array || []], n = [...
|
|
1372
|
+
const kt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style", "directives"], Rt = ["on", "nativeOn", "hook"], Y = (t, e = {}, r = {}) => {
|
|
1373
|
+
const i = [...kt, ...r.normal || []], s = [...Et, ...r.array || []], n = [...Rt, ...r.functional || []], o = r.props || [];
|
|
1374
1374
|
return t.reduce((a, l) => {
|
|
1375
1375
|
for (const u in l)
|
|
1376
1376
|
if (a[u])
|
|
@@ -1399,15 +1399,15 @@ const kt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style"
|
|
|
1399
1399
|
}, e);
|
|
1400
1400
|
}, Hr = (t, e) => function() {
|
|
1401
1401
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1402
|
-
},
|
|
1403
|
-
function
|
|
1404
|
-
return [...
|
|
1402
|
+
}, St = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache"], Qe = ["validate", "children", "control"], Ye = ["effect", "deep", "renderSlots"];
|
|
1403
|
+
function jt() {
|
|
1404
|
+
return [...St, ...kt, ...Et, ...Rt, ...Qe, ...Ye];
|
|
1405
1405
|
}
|
|
1406
|
-
function
|
|
1406
|
+
function Dt(t, e, r) {
|
|
1407
1407
|
return `[form-create ${t}]: ${e}`;
|
|
1408
1408
|
}
|
|
1409
1409
|
function et(t, e) {
|
|
1410
|
-
console.error(
|
|
1410
|
+
console.error(Dt("err", t));
|
|
1411
1411
|
}
|
|
1412
1412
|
function Gr(t) {
|
|
1413
1413
|
et(t.toString()), console.error(t);
|
|
@@ -1416,8 +1416,8 @@ function At(t) {
|
|
|
1416
1416
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
1417
1417
|
}
|
|
1418
1418
|
const Ke = "[[FORM-CREATE-PREFIX-", We = "-FORM-CREATE-SUFFIX]]";
|
|
1419
|
-
function
|
|
1420
|
-
return JSON.stringify(
|
|
1419
|
+
function we(t, e) {
|
|
1420
|
+
return JSON.stringify(Oe(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1421
1421
|
if (!(i && i._isVue === !0)) {
|
|
1422
1422
|
if (typeof i != "function")
|
|
1423
1423
|
return i;
|
|
@@ -1482,11 +1482,11 @@ function Ve() {
|
|
|
1482
1482
|
const t = 370 + ++Jr;
|
|
1483
1483
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1485
|
+
function oe(t, e, r) {
|
|
1486
1486
|
let i = t, s;
|
|
1487
1487
|
return (e || "").split(".").forEach((n) => {
|
|
1488
|
-
s && ((!i[s] || typeof i[s] != "object") &&
|
|
1489
|
-
}),
|
|
1488
|
+
s && ((!i[s] || typeof i[s] != "object") && F(i, s, {}), i = i[s]), s = n;
|
|
1489
|
+
}), F(i, s, r), i;
|
|
1490
1490
|
}
|
|
1491
1491
|
function xe(t, e) {
|
|
1492
1492
|
return {
|
|
@@ -1500,7 +1500,7 @@ function It(t, e) {
|
|
|
1500
1500
|
return Pt([t], e || !1)[0];
|
|
1501
1501
|
}
|
|
1502
1502
|
function Pt(t, e) {
|
|
1503
|
-
return
|
|
1503
|
+
return Oe([], [...t], e || !1);
|
|
1504
1504
|
}
|
|
1505
1505
|
function ee(t, e) {
|
|
1506
1506
|
return Y(Array.isArray(e) ? e : [e], t, { array: Qe, normal: Ye }), t;
|
|
@@ -1549,7 +1549,7 @@ function Wr(t, e) {
|
|
|
1549
1549
|
} else
|
|
1550
1550
|
return ze(t, e);
|
|
1551
1551
|
}
|
|
1552
|
-
function
|
|
1552
|
+
function Re() {
|
|
1553
1553
|
const t = {}, e = (r) => r || "default";
|
|
1554
1554
|
return {
|
|
1555
1555
|
setSlot(r, i) {
|
|
@@ -1588,9 +1588,9 @@ function Ee() {
|
|
|
1588
1588
|
function Se(t, e) {
|
|
1589
1589
|
return Object.setPrototypeOf(t, e), t;
|
|
1590
1590
|
}
|
|
1591
|
-
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e,
|
|
1591
|
+
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, ce = {
|
|
1592
1592
|
"==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
|
|
1593
|
-
"!=": (t, e) => !
|
|
1593
|
+
"!=": (t, e) => !ce["=="](t, e),
|
|
1594
1594
|
">": (t, e) => t > e,
|
|
1595
1595
|
">=": (t, e) => t >= e,
|
|
1596
1596
|
"<": (t, e) => t < e,
|
|
@@ -1599,13 +1599,13 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1599
1599
|
return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
|
|
1600
1600
|
},
|
|
1601
1601
|
notOn(t, e) {
|
|
1602
|
-
return !
|
|
1602
|
+
return !ce.on(t, e);
|
|
1603
1603
|
},
|
|
1604
1604
|
in(t, e) {
|
|
1605
1605
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1606
1606
|
},
|
|
1607
1607
|
notIn(t, e) {
|
|
1608
|
-
return !
|
|
1608
|
+
return !ce.in(t, e);
|
|
1609
1609
|
},
|
|
1610
1610
|
between(t, e) {
|
|
1611
1611
|
return t > e[0] && t < e[1];
|
|
@@ -1654,12 +1654,12 @@ function Bt(t) {
|
|
|
1654
1654
|
}
|
|
1655
1655
|
return r && e.push({ type: "key", value: r }), e.map((s) => s.type === "key" ? { key: s.value } : { children: s.value });
|
|
1656
1656
|
}
|
|
1657
|
-
const
|
|
1657
|
+
const je = (t, e) => {
|
|
1658
1658
|
if (!(!t || t === e || !t.$props)) {
|
|
1659
1659
|
if (t.$props.formCreateInject)
|
|
1660
1660
|
return t.$props.formCreateInject;
|
|
1661
1661
|
if (t.$parent)
|
|
1662
|
-
return
|
|
1662
|
+
return je(t.$parent, e);
|
|
1663
1663
|
}
|
|
1664
1664
|
};
|
|
1665
1665
|
function zr(t, e, r) {
|
|
@@ -1723,27 +1723,27 @@ function zr(t, e, r) {
|
|
|
1723
1723
|
a = a.parent;
|
|
1724
1724
|
else
|
|
1725
1725
|
a = n;
|
|
1726
|
-
const { rule: l, value: u, subForm: f, inFor: p } = lt(s), d =
|
|
1726
|
+
const { rule: l, value: u, subForm: f, inFor: p } = lt(s), d = ne({
|
|
1727
1727
|
ctxInject: {},
|
|
1728
1728
|
destroyed: !1,
|
|
1729
1729
|
isShow: !0,
|
|
1730
1730
|
unique: 1,
|
|
1731
1731
|
renderRule: [...l.value || []],
|
|
1732
1732
|
updateValue: JSON.stringify(u.value || {})
|
|
1733
|
-
}),
|
|
1733
|
+
}), g = new t(n), y = g.api(), C = p.value, k = () => {
|
|
1734
1734
|
if (o) {
|
|
1735
|
-
const E =
|
|
1735
|
+
const E = je(n, o);
|
|
1736
1736
|
if (E) {
|
|
1737
|
-
let
|
|
1738
|
-
C ? (
|
|
1737
|
+
let R;
|
|
1738
|
+
C ? (R = H(E.getSubForm()), R.push(y)) : R = y, E.subForm(R);
|
|
1739
1739
|
}
|
|
1740
1740
|
}
|
|
1741
1741
|
}, G = () => {
|
|
1742
|
-
const E =
|
|
1742
|
+
const E = je(n, o);
|
|
1743
1743
|
if (E)
|
|
1744
1744
|
if (C) {
|
|
1745
|
-
const
|
|
1746
|
-
M > -1 &&
|
|
1745
|
+
const R = H(E.getSubForm()), M = R.indexOf(y);
|
|
1746
|
+
M > -1 && R.splice(M, 1);
|
|
1747
1747
|
} else
|
|
1748
1748
|
E.subForm();
|
|
1749
1749
|
};
|
|
@@ -1751,54 +1751,54 @@ function zr(t, e, r) {
|
|
|
1751
1751
|
cr(() => {
|
|
1752
1752
|
L(() => {
|
|
1753
1753
|
let E = "";
|
|
1754
|
-
const
|
|
1755
|
-
Object.keys(
|
|
1756
|
-
let
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
}),
|
|
1754
|
+
const R = s.option && s.option.globalClass || {};
|
|
1755
|
+
Object.keys(R).forEach((M) => {
|
|
1756
|
+
let me = "";
|
|
1757
|
+
R[M].style && Object.keys(R[M].style).forEach((W) => {
|
|
1758
|
+
me += be(W) + ":" + R[M].style[W] + ";";
|
|
1759
|
+
}), R[M].content && (me += R[M].content + ";"), me && (E += `.${M}{${me}}`);
|
|
1760
1760
|
}), s.option && s.option.style && (E += s.option.style), V || (V = document.createElement("style"), V.type = "text/css", document.head.appendChild(V)), V.innerHTML = E || "";
|
|
1761
1761
|
}, () => {
|
|
1762
1762
|
});
|
|
1763
1763
|
});
|
|
1764
|
-
const N =
|
|
1765
|
-
|
|
1766
|
-
}, 100),
|
|
1767
|
-
|
|
1768
|
-
}, 100), Ie =
|
|
1769
|
-
|
|
1770
|
-
}, 100),
|
|
1771
|
-
|
|
1764
|
+
const N = se(() => {
|
|
1765
|
+
g.bus.$emit("$loadData.$topForm");
|
|
1766
|
+
}, 100), de = se(function() {
|
|
1767
|
+
g.bus.$emit("$loadData.$scopeForm");
|
|
1768
|
+
}, 100), Ie = se(() => {
|
|
1769
|
+
g.bus.$emit("$loadData.$form");
|
|
1770
|
+
}, 100), pe = (E) => {
|
|
1771
|
+
g.bus.$emit("change-$form." + E);
|
|
1772
1772
|
};
|
|
1773
1773
|
return hr(() => {
|
|
1774
|
-
o && (y.top.bus.$on("$loadData.$form", N), y.top.bus.$on("change",
|
|
1774
|
+
o && (y.top.bus.$on("$loadData.$form", N), y.top.bus.$on("change", pe)), y !== y.scope && y.scope.bus.$on("$loadData.$scopeForm", de), g.mounted();
|
|
1775
1775
|
}), dr(() => {
|
|
1776
|
-
o && (y.top.bus.$off("$loadData.$form", N), y.top.bus.$off("change",
|
|
1776
|
+
o && (y.top.bus.$off("$loadData.$form", N), y.top.bus.$off("change", pe)), y !== y.scope && y.scope.bus.$off("$loadData.$scopeForm", de), G(), d.destroyed = !0, g.unmount(), V && (V.parentNode || V.parentElement) && document.head.removeChild(V);
|
|
1777
1777
|
}), pr(() => {
|
|
1778
|
-
|
|
1778
|
+
g.updated();
|
|
1779
1779
|
}), L(f, (E) => {
|
|
1780
|
-
E ?
|
|
1780
|
+
E ? k() : G();
|
|
1781
1781
|
}, { immediate: !0 }), L(() => s.option, () => {
|
|
1782
|
-
|
|
1782
|
+
g.initOptions(), y.refresh();
|
|
1783
1783
|
}, { deep: !0, flush: "sync" }), L(() => [...l.value], (E) => {
|
|
1784
|
-
|
|
1784
|
+
g.$handle.isBreakWatch() || E.length === d.renderRule.length && E.every((R) => d.renderRule.indexOf(R) > -1) || (g.$handle.updateAppendData(), g.$handle.reloadRule(l.value), n.renderRule());
|
|
1785
1785
|
}), L(() => [s.disabled, s.preview], () => {
|
|
1786
1786
|
y.refresh();
|
|
1787
1787
|
}), L(u, (E) => {
|
|
1788
|
-
|
|
1788
|
+
we(E || {}) !== d.updateValue && (y.config.forceCoverValue ? y.coverValue(E || {}) : y.setValue(E || {}));
|
|
1789
1789
|
}, { deep: !0, flush: "post" }), L(() => s.index, () => {
|
|
1790
|
-
y.coverValue({}),
|
|
1790
|
+
y.coverValue({}), g.$handle.updateAppendData(), P(() => {
|
|
1791
1791
|
P(() => {
|
|
1792
1792
|
y.clearValidateState();
|
|
1793
1793
|
});
|
|
1794
1794
|
});
|
|
1795
1795
|
}, { flush: "sync" }), q(v({
|
|
1796
|
-
fc: ge(
|
|
1796
|
+
fc: ge(g),
|
|
1797
1797
|
parent: o && ge(o),
|
|
1798
1798
|
top: ge(a),
|
|
1799
1799
|
fapi: ge(y)
|
|
1800
1800
|
}, lt(d)), {
|
|
1801
|
-
getGroupInject: () =>
|
|
1801
|
+
getGroupInject: () => je(n, o),
|
|
1802
1802
|
refresh() {
|
|
1803
1803
|
++d.unique;
|
|
1804
1804
|
},
|
|
@@ -1807,9 +1807,9 @@ function zr(t, e, r) {
|
|
|
1807
1807
|
},
|
|
1808
1808
|
updateValue(E) {
|
|
1809
1809
|
if (d.destroyed) return;
|
|
1810
|
-
const
|
|
1811
|
-
d.updateValue !==
|
|
1812
|
-
Ie(), o ? f.value ||
|
|
1810
|
+
const R = we(E);
|
|
1811
|
+
d.updateValue !== R && (d.updateValue = R, n.$emit("update:value", E), P(() => {
|
|
1812
|
+
Ie(), o ? f.value || de() : (N(), de());
|
|
1813
1813
|
}));
|
|
1814
1814
|
}
|
|
1815
1815
|
});
|
|
@@ -1845,7 +1845,7 @@ _(tt.prototype, {
|
|
|
1845
1845
|
return this._data;
|
|
1846
1846
|
},
|
|
1847
1847
|
setProp(t, e) {
|
|
1848
|
-
return
|
|
1848
|
+
return F(this._data, t, e), this;
|
|
1849
1849
|
},
|
|
1850
1850
|
_clone() {
|
|
1851
1851
|
const t = new this.constructor();
|
|
@@ -1859,7 +1859,7 @@ function Nt(t) {
|
|
|
1859
1859
|
};
|
|
1860
1860
|
});
|
|
1861
1861
|
}
|
|
1862
|
-
Nt(
|
|
1862
|
+
Nt(jt());
|
|
1863
1863
|
const Mt = T("");
|
|
1864
1864
|
function Xr(t, e, r) {
|
|
1865
1865
|
let i = Mt("", e);
|
|
@@ -1924,7 +1924,7 @@ function gt(t, e, r) {
|
|
|
1924
1924
|
onSuccess(n) {
|
|
1925
1925
|
let o = (l) => l;
|
|
1926
1926
|
const a = z(t.parse);
|
|
1927
|
-
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => B(l, a)), i(o(n,
|
|
1927
|
+
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => B(l, a)), i(o(n, t.targetRule, r));
|
|
1928
1928
|
},
|
|
1929
1929
|
onError(n) {
|
|
1930
1930
|
s(n);
|
|
@@ -1943,7 +1943,7 @@ function Yr(t) {
|
|
|
1943
1943
|
h.Undef(n) ? n = Object.keys(v(v({}, t.fieldCtx), t.nameCtx)) : Array.isArray(n) || (n = [n]), n.forEach((l) => {
|
|
1944
1944
|
const u = t.fieldCtx[l] || t.nameCtx[l];
|
|
1945
1945
|
u && u.forEach((f) => {
|
|
1946
|
-
|
|
1946
|
+
F(f.rule, o, a), t.$render.clearCache(f);
|
|
1947
1947
|
});
|
|
1948
1948
|
});
|
|
1949
1949
|
}
|
|
@@ -2026,7 +2026,7 @@ function Yr(t) {
|
|
|
2026
2026
|
},
|
|
2027
2027
|
getValue(n) {
|
|
2028
2028
|
const o = t.getFieldCtx(n);
|
|
2029
|
-
return o ? _e(o.rule.value) : t.options.appendValue !== !1 &&
|
|
2029
|
+
return o ? _e(o.rule.value) : t.options.appendValue !== !1 && j(t.appendData, n) ? _e(t.appendData[n]) : void 0;
|
|
2030
2030
|
},
|
|
2031
2031
|
coverValue(n) {
|
|
2032
2032
|
const o = v({}, n || {});
|
|
@@ -2034,9 +2034,9 @@ function Yr(t) {
|
|
|
2034
2034
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
2035
2035
|
const l = t.fieldCtx[a];
|
|
2036
2036
|
if (l) {
|
|
2037
|
-
const u =
|
|
2037
|
+
const u = j(n, a);
|
|
2038
2038
|
l.forEach((f) => {
|
|
2039
|
-
|
|
2039
|
+
F(f.rule, "value", u ? n[a] : void 0);
|
|
2040
2040
|
}), delete o[a];
|
|
2041
2041
|
}
|
|
2042
2042
|
}), _(t.appendData, o);
|
|
@@ -2049,7 +2049,7 @@ function Yr(t) {
|
|
|
2049
2049
|
const l = t.fieldCtx[a];
|
|
2050
2050
|
if (!l) return t.appendData[a] = o[a];
|
|
2051
2051
|
l.forEach((u) => {
|
|
2052
|
-
|
|
2052
|
+
F(u.rule, "value", o[a]);
|
|
2053
2053
|
});
|
|
2054
2054
|
});
|
|
2055
2055
|
}, !0);
|
|
@@ -2113,7 +2113,7 @@ function Yr(t) {
|
|
|
2113
2113
|
disabled(n, o) {
|
|
2114
2114
|
e(o).forEach((a) => {
|
|
2115
2115
|
t.getCtxs(a).forEach((l) => {
|
|
2116
|
-
|
|
2116
|
+
F(l.rule.props, "disabled", !!n);
|
|
2117
2117
|
});
|
|
2118
2118
|
}), t.refresh();
|
|
2119
2119
|
},
|
|
@@ -2171,7 +2171,7 @@ function Yr(t) {
|
|
|
2171
2171
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2172
2172
|
},
|
|
2173
2173
|
hideForm: (n) => {
|
|
2174
|
-
|
|
2174
|
+
F(t.vm, "isShow", !n);
|
|
2175
2175
|
},
|
|
2176
2176
|
changeStatus: () => t.changeStatus,
|
|
2177
2177
|
clearChangeStatus: () => {
|
|
@@ -2230,7 +2230,7 @@ function Yr(t) {
|
|
|
2230
2230
|
},
|
|
2231
2231
|
setEffect(n, o, a) {
|
|
2232
2232
|
const l = t.getCtx(n);
|
|
2233
|
-
l && o && (o[0] === "$" && (o = o.substr(1)),
|
|
2233
|
+
l && o && (o[0] === "$" && (o = o.substr(1)), j(l.rule, "$" + o) && F(l.rule, "$" + o, a), j(l.rule, "effect") || F(l.rule, "effect", {}), F(l.rule.effect, o, a));
|
|
2234
2234
|
},
|
|
2235
2235
|
clearEffectData(n, o) {
|
|
2236
2236
|
const a = t.getCtx(n);
|
|
@@ -2263,14 +2263,14 @@ function Yr(t) {
|
|
|
2263
2263
|
method(n, o) {
|
|
2264
2264
|
const a = s.el(n);
|
|
2265
2265
|
if (!a || !a[o])
|
|
2266
|
-
throw new Error(
|
|
2266
|
+
throw new Error(Dt("err", `${o} 方法不存在`));
|
|
2267
2267
|
return (...l) => a[o](...l);
|
|
2268
2268
|
},
|
|
2269
2269
|
exec(n, o, ...a) {
|
|
2270
2270
|
return O(() => s.method(n, o)(...a));
|
|
2271
2271
|
},
|
|
2272
2272
|
toJson(n) {
|
|
2273
|
-
return
|
|
2273
|
+
return we(s.rule, n);
|
|
2274
2274
|
},
|
|
2275
2275
|
trigger(n, o, ...a) {
|
|
2276
2276
|
const l = s.el(n);
|
|
@@ -2317,7 +2317,7 @@ function Yr(t) {
|
|
|
2317
2317
|
const l = s.getChildrenRuleList(n);
|
|
2318
2318
|
t.deferSyncValue(() => {
|
|
2319
2319
|
l.forEach((u) => {
|
|
2320
|
-
|
|
2320
|
+
j(o, u.field) ? F(u, "value", o[u.field]) : a && F(u, "value", void 0);
|
|
2321
2321
|
});
|
|
2322
2322
|
});
|
|
2323
2323
|
},
|
|
@@ -2361,6 +2361,10 @@ function Yr(t) {
|
|
|
2361
2361
|
t.deferSyncValue(n, o);
|
|
2362
2362
|
},
|
|
2363
2363
|
bus: t.bus,
|
|
2364
|
+
getCurrentFormRule() {
|
|
2365
|
+
var n;
|
|
2366
|
+
return (n = t.vm.getGroupInject()) == null ? void 0 : n.rule;
|
|
2367
|
+
},
|
|
2364
2368
|
fetch(n) {
|
|
2365
2369
|
return new Promise((o, a) => {
|
|
2366
2370
|
n = K(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
@@ -2467,7 +2471,7 @@ function ti(t) {
|
|
|
2467
2471
|
if (!this.vm.isShow)
|
|
2468
2472
|
return;
|
|
2469
2473
|
this.$manager.beforeRender();
|
|
2470
|
-
const e =
|
|
2474
|
+
const e = Re();
|
|
2471
2475
|
return this.sort.forEach((r) => {
|
|
2472
2476
|
this.renderSlot(e, this.$handle.ctxs[r]);
|
|
2473
2477
|
}), this.$manager.render(e);
|
|
@@ -2485,12 +2489,12 @@ function ti(t) {
|
|
|
2485
2489
|
},
|
|
2486
2490
|
setOptions(e) {
|
|
2487
2491
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
2488
|
-
e.prop.options = r, e.prop.optionsTo && r &&
|
|
2492
|
+
e.prop.options = r, e.prop.optionsTo && r && oe(e.prop, e.prop.optionsTo, r);
|
|
2489
2493
|
},
|
|
2490
2494
|
deepSet(e) {
|
|
2491
2495
|
const r = e.rule.deep;
|
|
2492
2496
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2493
|
-
|
|
2497
|
+
oe(e.prop, i, r[i]);
|
|
2494
2498
|
});
|
|
2495
2499
|
},
|
|
2496
2500
|
parseSide(e, r) {
|
|
@@ -2543,8 +2547,8 @@ function ti(t) {
|
|
|
2543
2547
|
})()));
|
|
2544
2548
|
});
|
|
2545
2549
|
const d = this.getTypeSlot(e);
|
|
2546
|
-
let
|
|
2547
|
-
return d ? (u.children = f,
|
|
2550
|
+
let g;
|
|
2551
|
+
return d ? (u.children = f, g = d(u)) : g = a ? e.parser.preview(Je(f), e) : e.parser.render(Je(f), e), g = this.renderSides(g, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), g = this.$manager.makeWrap(e, g)), e.none && (Array.isArray(g) ? g = g.map((y) => !y || !y.tag ? y : this.none(y)) : g = this.none(g)), o && this.setCache(e, () => this.stable(g), r), g;
|
|
2548
2552
|
}, this.setCache(e, s, r);
|
|
2549
2553
|
}
|
|
2550
2554
|
return (...s) => {
|
|
@@ -2586,11 +2590,11 @@ function ti(t) {
|
|
|
2586
2590
|
},
|
|
2587
2591
|
injectProp(e) {
|
|
2588
2592
|
const r = this.vm;
|
|
2589
|
-
r.ctxInject[e.id] || (r.ctxInject
|
|
2593
|
+
r.ctxInject[e.id] || F(r.ctxInject, e.id, {
|
|
2590
2594
|
api: this.$handle.api,
|
|
2591
2595
|
form: this.fc.create,
|
|
2592
|
-
subForm: (
|
|
2593
|
-
this.$handle.addSubForm(e,
|
|
2596
|
+
subForm: (n) => {
|
|
2597
|
+
this.$handle.addSubForm(e, n);
|
|
2594
2598
|
},
|
|
2595
2599
|
getSubForm: () => this.$handle.subForm[e.id],
|
|
2596
2600
|
slots: () => this.vm.top.$scopedSlots,
|
|
@@ -2602,20 +2606,22 @@ function ti(t) {
|
|
|
2602
2606
|
field: e.field,
|
|
2603
2607
|
rule: e.rule,
|
|
2604
2608
|
input: e.input,
|
|
2605
|
-
t: (...
|
|
2606
|
-
updateValue: (
|
|
2607
|
-
this.$handle.onUpdateValue(e,
|
|
2609
|
+
t: (...n) => this.$handle.api.t(...n),
|
|
2610
|
+
updateValue: (n) => {
|
|
2611
|
+
this.$handle.onUpdateValue(e, n);
|
|
2608
2612
|
}
|
|
2609
2613
|
});
|
|
2610
|
-
const i = r.ctxInject[e.id]
|
|
2611
|
-
return _(i, {
|
|
2614
|
+
const i = r.ctxInject[e.id], s = {
|
|
2612
2615
|
preview: e.prop.preview,
|
|
2613
2616
|
options: e.prop.options,
|
|
2614
2617
|
prop: function() {
|
|
2615
|
-
const
|
|
2616
|
-
return
|
|
2618
|
+
const n = v({}, e.prop);
|
|
2619
|
+
return n.on = n.on ? v({}, n.on) : {}, delete n.model, n;
|
|
2617
2620
|
}(),
|
|
2618
2621
|
children: e.loadChildrenPending()
|
|
2622
|
+
};
|
|
2623
|
+
return Object.keys(s).forEach((n) => {
|
|
2624
|
+
F(i, n, s[n]);
|
|
2619
2625
|
}), i;
|
|
2620
2626
|
},
|
|
2621
2627
|
ctxProp(e) {
|
|
@@ -2682,7 +2688,7 @@ function ti(t) {
|
|
|
2682
2688
|
},
|
|
2683
2689
|
renderChildren(e, r, i) {
|
|
2684
2690
|
if (!h.trueArray(e)) return [];
|
|
2685
|
-
const s =
|
|
2691
|
+
const s = Re();
|
|
2686
2692
|
return e.map((n) => {
|
|
2687
2693
|
if (n) {
|
|
2688
2694
|
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
@@ -2708,7 +2714,7 @@ function ti(t) {
|
|
|
2708
2714
|
},
|
|
2709
2715
|
createRuleVnode(e, r, i) {
|
|
2710
2716
|
this.force = i !== !1, this.tmpInput = r;
|
|
2711
|
-
const s =
|
|
2717
|
+
const s = Re();
|
|
2712
2718
|
return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
|
|
2713
2719
|
},
|
|
2714
2720
|
renderRule(e, r, i) {
|
|
@@ -2723,7 +2729,7 @@ function ti(t) {
|
|
|
2723
2729
|
a && (s = J(a));
|
|
2724
2730
|
}
|
|
2725
2731
|
if (!s) return;
|
|
2726
|
-
const n =
|
|
2732
|
+
const n = Re();
|
|
2727
2733
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2728
2734
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2729
2735
|
});
|
|
@@ -2739,7 +2745,7 @@ function rt(t) {
|
|
|
2739
2745
|
fc: t.fc,
|
|
2740
2746
|
vm: t.vm,
|
|
2741
2747
|
$manager: t.$manager,
|
|
2742
|
-
vNode: new t.fc.CreateNode(t
|
|
2748
|
+
vNode: new t.fc.CreateNode(t),
|
|
2743
2749
|
force: !1,
|
|
2744
2750
|
tmpInput: null,
|
|
2745
2751
|
id: ri++
|
|
@@ -2784,8 +2790,8 @@ function ii(t) {
|
|
|
2784
2790
|
let p, d = n || o || a;
|
|
2785
2791
|
if (h.Object(f) && (p = f.inject, f = f.name, d = f.prefix || d), d) {
|
|
2786
2792
|
r || (d = `native-${d}`);
|
|
2787
|
-
const
|
|
2788
|
-
this.vm.$emit(
|
|
2793
|
+
const g = be(`${d}-${f}`), y = (...C) => {
|
|
2794
|
+
this.vm.$emit(g, ...C), this.vm.$emit("emit-event", g, ...C), this.bus.$emit(g, ...C);
|
|
2789
2795
|
};
|
|
2790
2796
|
if (y.__emit = !0, !p && l === !1)
|
|
2791
2797
|
i[f] = y;
|
|
@@ -2825,7 +2831,7 @@ function ii(t) {
|
|
|
2825
2831
|
let f = !1, p;
|
|
2826
2832
|
if (i && u.indexOf("$form.") === 0) {
|
|
2827
2833
|
const d = u.split(".");
|
|
2828
|
-
d.shift(),
|
|
2834
|
+
d.shift(), j(i.value, d[0]) && (f = !0, p = r ? r({
|
|
2829
2835
|
id: "$form." + d[0] + "_" + i.rule.__fc__.id,
|
|
2830
2836
|
getValue: () => B(i.value, d)
|
|
2831
2837
|
}) : B(i.value, d));
|
|
@@ -2837,16 +2843,16 @@ function ii(t) {
|
|
|
2837
2843
|
d.key ? f.push(d.key) : d.children && f.push(a(d.children));
|
|
2838
2844
|
});
|
|
2839
2845
|
let p = !1;
|
|
2840
|
-
return f.forEach((d,
|
|
2841
|
-
d != null && (d.indexOf("'") === 0 || d.indexOf('"') === 0) && (f[
|
|
2846
|
+
return f.forEach((d, g) => {
|
|
2847
|
+
d != null && (d.indexOf("'") === 0 || d.indexOf('"') === 0) && (f[g] = d.slice(1, -1), p = !0);
|
|
2842
2848
|
}), f.length === 1 && (p || !isNaN(Number(f[0]))) ? f[0] : o(f.join("."));
|
|
2843
2849
|
};
|
|
2844
2850
|
let l;
|
|
2845
2851
|
if (n.forEach((u) => {
|
|
2846
2852
|
const f = u.split("||"), p = f[0].trim();
|
|
2847
2853
|
if (p) {
|
|
2848
|
-
const d = (f[1] || "").trim(),
|
|
2849
|
-
let y = O(() => a(
|
|
2854
|
+
const d = (f[1] || "").trim(), g = Bt(p);
|
|
2855
|
+
let y = O(() => a(g));
|
|
2850
2856
|
(y == null || y === "") && f.length > 1 && (y = d), l = y, e = e.replaceAll(`{{${u}}}`, y == null ? "" : y);
|
|
2851
2857
|
}
|
|
2852
2858
|
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
@@ -3005,7 +3011,7 @@ _(Ht.prototype, {
|
|
|
3005
3011
|
setPending(t, e, r) {
|
|
3006
3012
|
this.pending[t] = {
|
|
3007
3013
|
origin: e,
|
|
3008
|
-
value:
|
|
3014
|
+
value: ne(r)
|
|
3009
3015
|
};
|
|
3010
3016
|
},
|
|
3011
3017
|
effectData(t) {
|
|
@@ -3157,29 +3163,29 @@ function li(t) {
|
|
|
3157
3163
|
let l = ct(o);
|
|
3158
3164
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3159
3165
|
this.fc.targetFormDriver("loadRule", { rule: l, api: this.api }, this.fc), this.ruleEffect(l, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", o, this.api);
|
|
3160
|
-
let f, p = !1, d = !!o.__fc__,
|
|
3166
|
+
let f, p = !1, d = !!o.__fc__, g = l.value;
|
|
3161
3167
|
if (d) {
|
|
3162
|
-
if (f = o.__fc__,
|
|
3168
|
+
if (f = o.__fc__, g = f.defaultValue, f.deleted) {
|
|
3163
3169
|
if ($t(f))
|
|
3164
3170
|
return;
|
|
3165
3171
|
f.update(this);
|
|
3166
3172
|
} else if (!f.check(this)) {
|
|
3167
3173
|
if ($t(f))
|
|
3168
3174
|
return;
|
|
3169
|
-
e[a] = o = o._clone ? o._clone() : Vt(
|
|
3175
|
+
e[a] = o = o._clone ? o._clone() : Vt(we(o)), f = null, p = !0;
|
|
3170
3176
|
}
|
|
3171
3177
|
}
|
|
3172
3178
|
if (f)
|
|
3173
3179
|
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3174
3180
|
else {
|
|
3175
|
-
const
|
|
3176
|
-
f = new Ht(this,
|
|
3181
|
+
const k = this.parseRule(o);
|
|
3182
|
+
f = new Ht(this, k, g), this.bindParser(f);
|
|
3177
3183
|
}
|
|
3178
|
-
[!1, !0].forEach((
|
|
3184
|
+
[!1, !0].forEach((k) => this.parseEmit(f, k)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !p && !d && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
|
|
3179
3185
|
const y = f.loadChildrenPending();
|
|
3180
3186
|
if (f.parser.loadChildren === !1 || s(y, f), !r) {
|
|
3181
|
-
const
|
|
3182
|
-
|
|
3187
|
+
const k = i(a);
|
|
3188
|
+
k > -1 || !a ? this.sort.splice(k + 1, 0, f.id) : this.sort.push(f.id);
|
|
3183
3189
|
}
|
|
3184
3190
|
const C = f.rule;
|
|
3185
3191
|
return f.updated || (f.updated = !0, h.Function(C.update) && this.bus.$once("load-end", () => {
|
|
@@ -3196,7 +3202,7 @@ function li(t) {
|
|
|
3196
3202
|
if (!r.length) return !1;
|
|
3197
3203
|
for (let a = 0; a < r.length; a++) {
|
|
3198
3204
|
const l = r[a], u = l.handle || function(p) {
|
|
3199
|
-
return (
|
|
3205
|
+
return (ce[l.condition || "=="] || ce["=="])(p, l.value);
|
|
3200
3206
|
};
|
|
3201
3207
|
if (!h.trueArray(l.rule)) continue;
|
|
3202
3208
|
const f = q(v({}, l), {
|
|
@@ -3210,13 +3216,13 @@ function li(t) {
|
|
|
3210
3216
|
const n = [];
|
|
3211
3217
|
let o = !1;
|
|
3212
3218
|
return this.deferSyncValue(() => {
|
|
3213
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: p, child: d, ctrl:
|
|
3219
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: p, child: d, ctrl: g, method: y }) => {
|
|
3214
3220
|
if (a) {
|
|
3215
3221
|
l ? e.ctrlRule.push({
|
|
3216
3222
|
__ctrl: !0,
|
|
3217
3223
|
children: u,
|
|
3218
3224
|
valid: l
|
|
3219
|
-
}) :
|
|
3225
|
+
}) : g && e.ctrlRule.splice(e.ctrlRule.indexOf(g) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3220
3226
|
y === "disabled" || y === "enabled" ? this.api.disabled(!l, u) : y === "display" || y === "show" ? this.api.display(l, u) : y === "required" ? (u.forEach((C) => {
|
|
3221
3227
|
this.api.setEffect(C, "required", l);
|
|
3222
3228
|
}), l || this.api.clearValidateState(u)) : y === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
@@ -3235,8 +3241,8 @@ function li(t) {
|
|
|
3235
3241
|
f ? s.prepend(C, f, d) : p || d ? s.append(C, p || e.id, d) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, C);
|
|
3236
3242
|
});
|
|
3237
3243
|
} else {
|
|
3238
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3239
|
-
const C = Q(
|
|
3244
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(g), 1);
|
|
3245
|
+
const C = Q(g);
|
|
3240
3246
|
C && C.rm();
|
|
3241
3247
|
}
|
|
3242
3248
|
});
|
|
@@ -3267,7 +3273,7 @@ function li(t) {
|
|
|
3267
3273
|
function ui(t) {
|
|
3268
3274
|
const e = Lt();
|
|
3269
3275
|
return Object.keys(e).forEach((r) => {
|
|
3270
|
-
|
|
3276
|
+
j(t, r) || F(t, r, e[r]);
|
|
3271
3277
|
}), t;
|
|
3272
3278
|
}
|
|
3273
3279
|
function fi(t) {
|
|
@@ -3307,7 +3313,7 @@ function hi(t) {
|
|
|
3307
3313
|
this.deferSyncValue(() => {
|
|
3308
3314
|
const i = e.getParentGroup(), s = i ? this.subRuleData[i.id] : null, n = {};
|
|
3309
3315
|
Object.keys(r || {}).forEach((o) => {
|
|
3310
|
-
s &&
|
|
3316
|
+
s && j(s, o) ? n[o] = r[o] : j(this.api.form, o) ? this.api.form[o] = r[o] : this.api.top !== this.api && j(this.api.top.form, o) && (this.api.top.form[o] = r[o]);
|
|
3311
3317
|
}), Object.keys(n).length && this.api.setChildrenFormData(i.rule, n);
|
|
3312
3318
|
});
|
|
3313
3319
|
},
|
|
@@ -3317,11 +3323,11 @@ function hi(t) {
|
|
|
3317
3323
|
setFormData(e, r) {
|
|
3318
3324
|
e.modelValue = r;
|
|
3319
3325
|
const i = e.getParentGroup();
|
|
3320
|
-
i && (this.subRuleData[i.id] ||
|
|
3326
|
+
i && (this.subRuleData[i.id] || F(this.subRuleData, i.id, {}), F(this.subRuleData[i.id], e.field, e.rule.value)), F(this.formData, e.id, r);
|
|
3321
3327
|
},
|
|
3322
3328
|
rmSubRuleData(e) {
|
|
3323
3329
|
const r = e.getParentGroup();
|
|
3324
|
-
r && this.subRuleData[r.id] &&
|
|
3330
|
+
r && this.subRuleData[r.id] && ie(this.subRuleData[r.id], e.field);
|
|
3325
3331
|
},
|
|
3326
3332
|
getFormData(e) {
|
|
3327
3333
|
return this.formData[e.id];
|
|
@@ -3331,13 +3337,13 @@ function hi(t) {
|
|
|
3331
3337
|
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] = Ae(this.appendData, n)), s), e), r.reduce((s, n) => {
|
|
3332
3338
|
let o = (this.fieldCtx[n] || []).filter((a) => !this.isIgnore(a))[0];
|
|
3333
3339
|
return o || (o = this.fieldCtx[n][0], i.push(n)), s[n] = Ae(o.rule, "value"), s;
|
|
3334
|
-
}, e), this.form =
|
|
3340
|
+
}, e), this.form = ne(e), this.ignoreFields = i, this.syncValue();
|
|
3335
3341
|
},
|
|
3336
3342
|
isIgnore(e) {
|
|
3337
3343
|
return e.rule.ignore === !0 || (e.rule.ignore === "hidden" || this.options.ignoreHiddenFields) && e.hasHidden();
|
|
3338
3344
|
},
|
|
3339
3345
|
appendValue(e) {
|
|
3340
|
-
(!e.field || !
|
|
3346
|
+
(!e.field || !j(this.appendData, e.field)) && !this.options.forceCoverValue || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
3341
3347
|
},
|
|
3342
3348
|
addSubForm(e, r) {
|
|
3343
3349
|
this.subForm[e.id] = r;
|
|
@@ -3390,7 +3396,7 @@ function hi(t) {
|
|
|
3390
3396
|
function bt(t, e) {
|
|
3391
3397
|
return typeof e == "function" ? "" + e : e;
|
|
3392
3398
|
}
|
|
3393
|
-
const
|
|
3399
|
+
const De = {
|
|
3394
3400
|
init(t) {
|
|
3395
3401
|
},
|
|
3396
3402
|
toFormValue(t, e) {
|
|
@@ -3409,7 +3415,7 @@ const je = {
|
|
|
3409
3415
|
},
|
|
3410
3416
|
mergeProp(t) {
|
|
3411
3417
|
}
|
|
3412
|
-
}, di = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"],
|
|
3418
|
+
}, di = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"], Ce = Symbol("oldValue");
|
|
3413
3419
|
function pi(t) {
|
|
3414
3420
|
_(t.prototype, {
|
|
3415
3421
|
getCtx(e) {
|
|
@@ -3445,7 +3451,7 @@ function pi(t) {
|
|
|
3445
3451
|
if (n)
|
|
3446
3452
|
return n;
|
|
3447
3453
|
}
|
|
3448
|
-
return r[e.originType] || r[J(e.type)] || r[e.trueType] ||
|
|
3454
|
+
return r[e.originType] || r[J(e.type)] || r[e.trueType] || De;
|
|
3449
3455
|
},
|
|
3450
3456
|
bindParser(e) {
|
|
3451
3457
|
e.setParser(this.getParser(e));
|
|
@@ -3458,7 +3464,7 @@ function pi(t) {
|
|
|
3458
3464
|
this.noWatchFn || (this.noWatchFn = e), O(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
3459
3465
|
},
|
|
3460
3466
|
watchCtx(e) {
|
|
3461
|
-
if (
|
|
3467
|
+
if (jt().filter((i) => i[0] !== "_" && i[0] !== "$" && di.indexOf(i) === -1).forEach((i) => {
|
|
3462
3468
|
const s = Ae(e.rule, i), n = i === "children";
|
|
3463
3469
|
e.refRule[i] = s, e.watch.push(L(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3464
3470
|
let l = s.value;
|
|
@@ -3539,12 +3545,12 @@ function pi(t) {
|
|
|
3539
3545
|
const a = i[s];
|
|
3540
3546
|
if (!a) return;
|
|
3541
3547
|
const l = this.compute(e, a);
|
|
3542
|
-
return a.linkage && l ===
|
|
3548
|
+
return (a.linkage || a.linkageVariable) && l === Ce ? Ce : l;
|
|
3543
3549
|
}), o = (a) => {
|
|
3544
|
-
s === "value" ? this.onInput(e, a) : s[0] === "$" ? this.api.setEffect(e.id, s, a) :
|
|
3550
|
+
s === "value" ? this.onInput(e, a) : s[0] === "$" ? this.api.setEffect(e.id, s, a) : oe(e.rule, s, a);
|
|
3545
3551
|
};
|
|
3546
3552
|
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : n.value !== B(e.rule, s)) && o(n.value), e.watch.push(L(n, (a, l) => {
|
|
3547
|
-
a ===
|
|
3553
|
+
a === Ce || a === l || setTimeout(() => {
|
|
3548
3554
|
o(a);
|
|
3549
3555
|
});
|
|
3550
3556
|
}, { deep: !0 }));
|
|
@@ -3674,22 +3680,22 @@ function pi(t) {
|
|
|
3674
3680
|
let u = !0;
|
|
3675
3681
|
for (let f = 0; f < a.group.length; f++) {
|
|
3676
3682
|
const p = a.group[f];
|
|
3677
|
-
let d,
|
|
3683
|
+
let d, g = null;
|
|
3678
3684
|
if (p.variable)
|
|
3679
|
-
|
|
3685
|
+
g = JSON.stringify(this.fc.getLoadData(p.variable)) || "";
|
|
3680
3686
|
else if (p.field)
|
|
3681
|
-
|
|
3687
|
+
g = dt(p.field || "");
|
|
3682
3688
|
else if (!p.mode)
|
|
3683
3689
|
return !0;
|
|
3684
3690
|
let y = p.compare;
|
|
3685
|
-
if (y && (y = dt(y || "")), p.mode ? d = n(p) :
|
|
3691
|
+
if (y && (y = dt(y || "")), p.mode ? d = n(p) : ce[p.condition] ? h.Function(p.handler) ? d = O(() => p.handler(this.api, e.rule)) : d = O(() => new Function("$condition", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${p.condition}'](${g}, ${y || "$val"}); }}}}`).call(this.api.form, ce, p.value, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : d = !1, l && d)
|
|
3686
3692
|
return !0;
|
|
3687
3693
|
l || (u = u && d);
|
|
3688
3694
|
}
|
|
3689
3695
|
return l ? !1 : u;
|
|
3690
3696
|
};
|
|
3691
3697
|
let o = n(r);
|
|
3692
|
-
return o = r.invert === !0 ? !o : o, r.linkage ? o ? O(() => this.computeValue(r.linkage, e, s), void 0) :
|
|
3698
|
+
return o = r.invert === !0 ? !o : o, r.linkage ? o ? O(() => this.computeValue(r.linkage, e, s), void 0) : Ce : r.linkageVariable ? o ? O(() => this.fc.getLoadData(r.linkageVariable), void 0) : Ce : o;
|
|
3693
3699
|
} else if (h.Function(r))
|
|
3694
3700
|
i = () => r(this.api.form, this.api);
|
|
3695
3701
|
else {
|
|
@@ -3724,9 +3730,9 @@ function pi(t) {
|
|
|
3724
3730
|
rmCtx(e) {
|
|
3725
3731
|
if (e.deleted) return;
|
|
3726
3732
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3727
|
-
|
|
3733
|
+
ie(this.ctxs, r), ie(this.formData, r), ie(this.subForm, r), ie(this.vm.ctxInject, r);
|
|
3728
3734
|
const o = e.getParentGroup();
|
|
3729
|
-
o && this.subRuleData[o.id] &&
|
|
3735
|
+
o && this.subRuleData[o.id] && ie(this.subRuleData[o.id], i), e.group && ie(this.subRuleData, r), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !j(this.fieldCtx, i) && ie(this.form, i), this.deferSyncValue(() => {
|
|
3730
3736
|
if (!this.reloading) {
|
|
3731
3737
|
if (e.parser.loadChildren !== !1) {
|
|
3732
3738
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3761,12 +3767,12 @@ function mi(t) {
|
|
|
3761
3767
|
},
|
|
3762
3768
|
targetHook(e, r, i) {
|
|
3763
3769
|
var l, u, f, p;
|
|
3764
|
-
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (d,
|
|
3770
|
+
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (d, g) => {
|
|
3765
3771
|
d && (d = Array.isArray(d) ? d : [d], d.forEach((y) => {
|
|
3766
3772
|
O(() => y(q(v({}, i || {}), {
|
|
3767
3773
|
self: e.rule,
|
|
3768
3774
|
rule: e.rule,
|
|
3769
|
-
parent:
|
|
3775
|
+
parent: g == null ? void 0 : g.rule,
|
|
3770
3776
|
$f: this.api,
|
|
3771
3777
|
api: this.api,
|
|
3772
3778
|
option: this.vm.$props.option
|
|
@@ -3788,23 +3794,23 @@ function gi(t) {
|
|
|
3788
3794
|
const e = this.fc.providers;
|
|
3789
3795
|
Object.keys(e).forEach((r) => {
|
|
3790
3796
|
let i = e[r];
|
|
3791
|
-
h.Function(i) && (i = i(this.fc)), i._c = $i(i), this.onEffect(i), this.providers[r] = i;
|
|
3797
|
+
h.Function(i) && (i = i(this.fc)), i._c = $i(i), this.onEffect(i, r), this.providers[r] = i;
|
|
3792
3798
|
});
|
|
3793
3799
|
},
|
|
3794
|
-
onEffect(e) {
|
|
3795
|
-
const
|
|
3796
|
-
(e._c || ["*"]).forEach((
|
|
3797
|
-
const
|
|
3798
|
-
|
|
3799
|
-
e[
|
|
3800
|
+
onEffect(e, r) {
|
|
3801
|
+
const i = [];
|
|
3802
|
+
(e._c || ["*"]).forEach((s) => {
|
|
3803
|
+
const n = s === "*" ? "*" : this.getType(s);
|
|
3804
|
+
i.indexOf(n) > -1 || (i.push(n), this.bus.$on(`p:${r || e.name}:${n}:${e.input ? 1 : 0}`, (o, a) => {
|
|
3805
|
+
e[o] && e[o](...a);
|
|
3800
3806
|
}));
|
|
3801
|
-
}), e._used =
|
|
3807
|
+
}), e._used = i;
|
|
3802
3808
|
},
|
|
3803
3809
|
watchEffect(e) {
|
|
3804
3810
|
let r = {
|
|
3805
3811
|
required: () => {
|
|
3806
3812
|
var i, s;
|
|
3807
|
-
return (
|
|
3813
|
+
return (j(e.rule, "$required") ? e.rule.$required : (s = (i = e.rule) == null ? void 0 : i.effect) == null ? void 0 : s.required) || !1;
|
|
3808
3814
|
}
|
|
3809
3815
|
};
|
|
3810
3816
|
Object.keys(e.rule.effect || {}).forEach((i) => {
|
|
@@ -3834,9 +3840,9 @@ function gi(t) {
|
|
|
3834
3840
|
}, r);
|
|
3835
3841
|
},
|
|
3836
3842
|
getEffect(e, r) {
|
|
3837
|
-
if (
|
|
3843
|
+
if (j(e, "$" + r))
|
|
3838
3844
|
return e["$" + r];
|
|
3839
|
-
if (
|
|
3845
|
+
if (j(e, "effect") && j(e.effect, r))
|
|
3840
3846
|
return e.effect[r];
|
|
3841
3847
|
},
|
|
3842
3848
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
@@ -3853,7 +3859,7 @@ function gi(t) {
|
|
|
3853
3859
|
else
|
|
3854
3860
|
return;
|
|
3855
3861
|
const d = v({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3856
|
-
e && (d.getProp = () => e.effectData(u), d.clearProp = () => e.clearEffectData(u), d.mergeProp = (
|
|
3862
|
+
e && (d.getProp = () => e.effectData(u), d.clearProp = () => e.clearEffectData(u), d.mergeProp = (g) => ee(d.getProp(), [g]), d.id = e.id), this.bus.$emit(`p:${u}:${p}:${f.input ? 1 : 0}`, o, [d, r, this.api]);
|
|
3857
3863
|
});
|
|
3858
3864
|
}
|
|
3859
3865
|
});
|
|
@@ -3879,7 +3885,7 @@ function X(t) {
|
|
|
3879
3885
|
return t.bus;
|
|
3880
3886
|
},
|
|
3881
3887
|
preview() {
|
|
3882
|
-
return t.vm.$
|
|
3888
|
+
return t.vm.$props.preview != null ? t.vm.$props.preview : t.vm.parent && t.vm.parent.$props.preview != null ? t.vm.parent.$props.preview : t.options.value.preview || !1;
|
|
3883
3889
|
}
|
|
3884
3890
|
}), _(this, {
|
|
3885
3891
|
fc: t,
|
|
@@ -3890,10 +3896,10 @@ function X(t) {
|
|
|
3890
3896
|
noWatchFn: null,
|
|
3891
3897
|
deferSyncFn: null,
|
|
3892
3898
|
isMounted: !1,
|
|
3893
|
-
formData:
|
|
3894
|
-
subRuleData:
|
|
3899
|
+
formData: ne({}),
|
|
3900
|
+
subRuleData: ne({}),
|
|
3895
3901
|
subForm: {},
|
|
3896
|
-
form:
|
|
3902
|
+
form: ne({}),
|
|
3897
3903
|
appendData: {},
|
|
3898
3904
|
ignoreFields: [],
|
|
3899
3905
|
providers: {},
|
|
@@ -3924,7 +3930,7 @@ _(X.prototype, {
|
|
|
3924
3930
|
this.updateAppendData(), this.useProvider(), this.usePage(), this.loadRule(), this.$manager.__init(), this.lifecycle("created");
|
|
3925
3931
|
},
|
|
3926
3932
|
updateAppendData() {
|
|
3927
|
-
this.appendData = v(v(v({}, this.options.formData || {}), this.fc.vm.$
|
|
3933
|
+
this.appendData = v(v(v({}, this.options.formData || {}), this.fc.vm.$props.value || {}), this.appendData);
|
|
3928
3934
|
},
|
|
3929
3935
|
isBreakWatch() {
|
|
3930
3936
|
return this.loading || this.noWatchFn || this.reloading;
|
|
@@ -3974,22 +3980,24 @@ function _i() {
|
|
|
3974
3980
|
}
|
|
3975
3981
|
return _(e.prototype, {
|
|
3976
3982
|
setVm(r) {
|
|
3977
|
-
this.vm = r, this.h = this.$h = r.$createElement;
|
|
3983
|
+
this.handle = r, this.vm = r.vm, this.h = this.$h = r.vm.$createElement;
|
|
3978
3984
|
},
|
|
3979
3985
|
make(r, i, s) {
|
|
3980
3986
|
var n, o, a;
|
|
3981
3987
|
return ($e.isReservedTag ? $e.isReservedTag(r) : (o = (n = $e) == null ? void 0 : n.config) != null && o.isReservedTag(r)) && (i == null || delete i.nativeOn, (a = i == null ? void 0 : i.props) == null || delete a.formCreateInject), this.makeComponent(r, i, s);
|
|
3982
3988
|
},
|
|
3983
3989
|
makeComponent(r, i, s) {
|
|
3984
|
-
var
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
+
var a;
|
|
3991
|
+
const n = this.handle.fc.prop.components[r];
|
|
3992
|
+
n && (r = n);
|
|
3993
|
+
let o = this.$h(r, vi(i), s || []);
|
|
3994
|
+
if ((a = o == null ? void 0 : o.componentOptions) != null && a.propsData && (i != null && i.props)) {
|
|
3995
|
+
const l = Object.keys(o.componentOptions.propsData);
|
|
3996
|
+
o.data.attrs || (o.data.attrs = {}), Object.keys(i.props).forEach((u) => {
|
|
3997
|
+
o.data.attrs[u] == null && l.indexOf(u) === -1 && ["string", "number", "boolean"].indexOf(typeof i.props[u]) > -1 && (o.data.attrs[u] = i.props[u]);
|
|
3990
3998
|
});
|
|
3991
3999
|
}
|
|
3992
|
-
return
|
|
4000
|
+
return o.context = this.vm, o;
|
|
3993
4001
|
},
|
|
3994
4002
|
aliasMap: t
|
|
3995
4003
|
}), _(e, {
|
|
@@ -4000,9 +4008,9 @@ function _i() {
|
|
|
4000
4008
|
use(r) {
|
|
4001
4009
|
Object.keys(r).forEach((i) => {
|
|
4002
4010
|
const s = be(i), n = At(i).toLocaleLowerCase(), o = r[i];
|
|
4003
|
-
[i, s, n].forEach((a) => {
|
|
4004
|
-
e.
|
|
4005
|
-
return this.make(
|
|
4011
|
+
e.alias(i, o), [i, s, n].forEach((a) => {
|
|
4012
|
+
e.prototype[a] = function(l, u) {
|
|
4013
|
+
return this.make(t[i] || a, l, u);
|
|
4006
4014
|
};
|
|
4007
4015
|
});
|
|
4008
4016
|
});
|
|
@@ -4088,13 +4096,13 @@ const wi = function(t) {
|
|
|
4088
4096
|
let l = (p) => {
|
|
4089
4097
|
let d;
|
|
4090
4098
|
i && i.__fc__ && (d = i.__fc__.getParentGroup());
|
|
4091
|
-
let
|
|
4092
|
-
a.template ?
|
|
4099
|
+
let g;
|
|
4100
|
+
a.template ? g = t.$handle.loadStrVar(a.template, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null) : a.handler && h.Function(a.handler) ? g = a.handler(p, i, s) : g = t.$handle.loadStrVar(`{{${a.attr}}}`, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null), (g == null || g === "") && a.default != null && (g = a.default), a.copy !== !1 && (g = K(g));
|
|
4093
4101
|
const y = a.modify ? i : r.getProp();
|
|
4094
|
-
a.to === "child" ? y.children ?
|
|
4102
|
+
a.to === "child" ? y.children ? F(y.children, 0, g) : F(y, "children", [g]) : oe(y, a.to || "options", g), s.sync(i);
|
|
4095
4103
|
}, u = (p) => l(p);
|
|
4096
4104
|
const f = t.watchLoadData(u);
|
|
4097
|
-
l =
|
|
4105
|
+
l = se(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
4098
4106
|
}
|
|
4099
4107
|
}), this._fn[r.id] = o;
|
|
4100
4108
|
});
|
|
@@ -4118,13 +4126,13 @@ const wi = function(t) {
|
|
|
4118
4126
|
const l = n[a];
|
|
4119
4127
|
if (l) {
|
|
4120
4128
|
const u = typeof l == "object";
|
|
4121
|
-
let f = (
|
|
4122
|
-
let y = t.t(u ? l.attr : l, u ? l.params : null,
|
|
4129
|
+
let f = (g) => {
|
|
4130
|
+
let y = t.t(u ? l.attr : l, u ? l.params : null, g);
|
|
4123
4131
|
const C = u && l.modify ? i : r.getProp();
|
|
4124
|
-
a === "child" ? C.children ?
|
|
4125
|
-
}, p = (
|
|
4132
|
+
a === "child" ? C.children ? F(C.children, 0, y) : F(C, "children", [y]) : oe(C, a, y), s.sync(i);
|
|
4133
|
+
}, p = (g) => f(g);
|
|
4126
4134
|
const d = t.watchLoadData(p);
|
|
4127
|
-
f =
|
|
4135
|
+
f = se(f, l.wait || 300), l.watch !== !1 ? o.push(d) : d();
|
|
4128
4136
|
}
|
|
4129
4137
|
}), this._fn[r.id] = o;
|
|
4130
4138
|
},
|
|
@@ -4171,47 +4179,45 @@ const wi = function(t) {
|
|
|
4171
4179
|
let a = s.value;
|
|
4172
4180
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
4173
4181
|
const l = (p) => {
|
|
4174
|
-
p === void 0 ? s.clearProp() :
|
|
4182
|
+
p === void 0 ? s.clearProp() : oe(s.getProp(), a.to || "options", p), o.sync(n);
|
|
4175
4183
|
};
|
|
4176
4184
|
if (!a || !a.action && !a.key) {
|
|
4177
4185
|
l(void 0);
|
|
4178
4186
|
return;
|
|
4179
4187
|
}
|
|
4180
|
-
|
|
4181
|
-
const p = t.$handle.options.globalData[a.key];
|
|
4182
|
-
if (!p) {
|
|
4183
|
-
l(void 0);
|
|
4184
|
-
return;
|
|
4185
|
-
}
|
|
4186
|
-
if (p.type === "static") {
|
|
4187
|
-
l(p.data);
|
|
4188
|
-
return;
|
|
4189
|
-
} else
|
|
4190
|
-
a = v(v({}, a), p);
|
|
4191
|
-
}
|
|
4188
|
+
a = K(a), a.to || (a.to = "options");
|
|
4192
4189
|
const u = a.onError, f = () => {
|
|
4193
4190
|
if (!s.getValue())
|
|
4194
4191
|
return s.clearProp(), o.sync(n), !0;
|
|
4195
4192
|
};
|
|
4196
|
-
i._fn[s.id] = t.watchLoadData(
|
|
4193
|
+
i._fn[s.id] = t.watchLoadData(se((p, d) => {
|
|
4197
4194
|
if (d && a.watch === !1)
|
|
4198
4195
|
return i._fn[s.id]();
|
|
4199
|
-
|
|
4196
|
+
if (a.key) {
|
|
4197
|
+
t.targetRule = n;
|
|
4198
|
+
const C = p("$globalData." + a.key);
|
|
4199
|
+
if (delete t.targetRule, C) {
|
|
4200
|
+
if (f()) return;
|
|
4201
|
+
l(C);
|
|
4202
|
+
}
|
|
4203
|
+
return;
|
|
4204
|
+
}
|
|
4205
|
+
const g = t.$handle.loadFetchVar(K(a), p, n), y = q(v({
|
|
4200
4206
|
headers: {}
|
|
4201
|
-
},
|
|
4202
|
-
onSuccess(C,
|
|
4207
|
+
}, g), {
|
|
4208
|
+
onSuccess(C, k) {
|
|
4203
4209
|
if (f()) return;
|
|
4204
|
-
let G = (N) =>
|
|
4205
|
-
const V = z(
|
|
4210
|
+
let G = (N) => k ? N : j(N, "data") ? N.data : N;
|
|
4211
|
+
const V = z(g.parse);
|
|
4206
4212
|
h.Function(V) ? G = V : V && h.String(V) && (G = (N) => B(N, V)), l(G(C, n, o));
|
|
4207
4213
|
},
|
|
4208
4214
|
onError(C) {
|
|
4209
|
-
l(void 0), !f() && (u || ((
|
|
4215
|
+
l(void 0), !f() && (u || ((k) => et(k.message || "fetch fail " + g.action)))(C, n, o);
|
|
4210
4216
|
}
|
|
4211
4217
|
});
|
|
4212
4218
|
t.$handle.beforeFetch(y, { rule: n, api: o }).then(() => {
|
|
4213
|
-
if (h.Function(
|
|
4214
|
-
|
|
4219
|
+
if (h.Function(g.action)) {
|
|
4220
|
+
g.action(n, o).then((C) => {
|
|
4215
4221
|
y.onSuccess(C, !0);
|
|
4216
4222
|
}).catch((C) => {
|
|
4217
4223
|
y.onError(C);
|
|
@@ -4267,8 +4273,8 @@ function Ei(t) {
|
|
|
4267
4273
|
};
|
|
4268
4274
|
return e;
|
|
4269
4275
|
}
|
|
4270
|
-
const
|
|
4271
|
-
name:
|
|
4276
|
+
const Ri = "html", Si = {
|
|
4277
|
+
name: Ri,
|
|
4272
4278
|
loadChildren: !1,
|
|
4273
4279
|
render(t, e) {
|
|
4274
4280
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
@@ -4277,7 +4283,7 @@ const Si = "html", Ri = {
|
|
|
4277
4283
|
return Array.isArray(t) ? t.filter((e) => h.String(e)).join("") : "";
|
|
4278
4284
|
}
|
|
4279
4285
|
};
|
|
4280
|
-
function
|
|
4286
|
+
function ji(t) {
|
|
4281
4287
|
t = t + "=";
|
|
4282
4288
|
const r = decodeURIComponent(document.cookie).split(";");
|
|
4283
4289
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -4295,7 +4301,7 @@ function Di(t) {
|
|
|
4295
4301
|
}
|
|
4296
4302
|
return null;
|
|
4297
4303
|
}
|
|
4298
|
-
function
|
|
4304
|
+
function Di(t) {
|
|
4299
4305
|
const e = localStorage.getItem(t);
|
|
4300
4306
|
if (e)
|
|
4301
4307
|
try {
|
|
@@ -4323,10 +4329,10 @@ function it(t, e) {
|
|
|
4323
4329
|
return r.length ? i == null ? null : B(i, r) : i;
|
|
4324
4330
|
}
|
|
4325
4331
|
function Vi(t) {
|
|
4326
|
-
return it(
|
|
4332
|
+
return it(ji, t);
|
|
4327
4333
|
}
|
|
4328
4334
|
function Ii(t) {
|
|
4329
|
-
return it(
|
|
4335
|
+
return it(Di, t);
|
|
4330
4336
|
}
|
|
4331
4337
|
function Pi(t) {
|
|
4332
4338
|
return it(Ai, t);
|
|
@@ -4404,7 +4410,7 @@ function Ni(t, e) {
|
|
|
4404
4410
|
}
|
|
4405
4411
|
function Mi(t) {
|
|
4406
4412
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
4407
|
-
|
|
4413
|
+
St.push(...e), Qe.push(...r), Ye.push(...i), Nt([...e, ...r, ...i]);
|
|
4408
4414
|
}
|
|
4409
4415
|
let qi = 1;
|
|
4410
4416
|
const U = {}, vt = Symbol("defValue");
|
|
@@ -4415,16 +4421,16 @@ function Kt(t) {
|
|
|
4415
4421
|
t.extendApi
|
|
4416
4422
|
], u = v({}, ki), f = Zr();
|
|
4417
4423
|
let p = { global: {} };
|
|
4418
|
-
const d = t.isMobile === !0,
|
|
4424
|
+
const d = t.isMobile === !0, g = ne({
|
|
4419
4425
|
$mobile: d
|
|
4420
|
-
}), y = _i(), C = {},
|
|
4426
|
+
}), y = _i(), C = {}, k = {};
|
|
4421
4427
|
Mi(t.attrs || {});
|
|
4422
4428
|
function G(c) {
|
|
4423
|
-
const
|
|
4424
|
-
if (Array.isArray(
|
|
4425
|
-
return
|
|
4426
|
-
if (
|
|
4427
|
-
return
|
|
4429
|
+
const m = U[c];
|
|
4430
|
+
if (Array.isArray(m))
|
|
4431
|
+
return m.map(($) => $.api());
|
|
4432
|
+
if (m)
|
|
4433
|
+
return m.api();
|
|
4428
4434
|
}
|
|
4429
4435
|
function V(c) {
|
|
4430
4436
|
o.push(c);
|
|
@@ -4433,7 +4439,7 @@ function Kt(t) {
|
|
|
4433
4439
|
const c = Ne(...arguments);
|
|
4434
4440
|
c.id && c.prop && (i[c.id] = c.prop);
|
|
4435
4441
|
}
|
|
4436
|
-
function
|
|
4442
|
+
function de() {
|
|
4437
4443
|
const c = Ne(...arguments);
|
|
4438
4444
|
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(v({}, c.prop), {
|
|
4439
4445
|
name: c.id
|
|
@@ -4442,41 +4448,41 @@ function Kt(t) {
|
|
|
4442
4448
|
function Ie(c) {
|
|
4443
4449
|
y.use(c);
|
|
4444
4450
|
}
|
|
4445
|
-
function
|
|
4451
|
+
function pe() {
|
|
4446
4452
|
const c = Ne(...arguments);
|
|
4447
|
-
if (!c.id || !c.prop) return
|
|
4448
|
-
const
|
|
4449
|
-
r[
|
|
4453
|
+
if (!c.id || !c.prop) return De;
|
|
4454
|
+
const m = J(c.id), $ = c.prop, b = $.merge === !0 ? r[m] : void 0;
|
|
4455
|
+
r[m] = Se($, b || De), f[m] = T(m), $.maker && _(f, $.maker);
|
|
4450
4456
|
}
|
|
4451
|
-
function E(c,
|
|
4457
|
+
function E(c, m) {
|
|
4452
4458
|
let $;
|
|
4453
4459
|
if (h.String(c)) {
|
|
4454
|
-
if ($ = c,
|
|
4455
|
-
return ["form-create", "formcreate"].indexOf($) > -1 ?
|
|
4460
|
+
if ($ = c, m === void 0)
|
|
4461
|
+
return ["form-create", "formcreate"].indexOf($) > -1 ? R() : e[$];
|
|
4456
4462
|
} else
|
|
4457
|
-
$ = J(c.name),
|
|
4458
|
-
if (!$ || !
|
|
4463
|
+
$ = J(c.name), m = c;
|
|
4464
|
+
if (!$ || !m) return;
|
|
4459
4465
|
const b = J($);
|
|
4460
|
-
e[$] =
|
|
4466
|
+
e[$] = m, e[b] = m, delete y.aliasMap[$], delete y.aliasMap[b], delete r[$], delete r[b], m.formCreateParser && pe($, m.formCreateParser);
|
|
4461
4467
|
}
|
|
4462
|
-
function
|
|
4468
|
+
function R() {
|
|
4463
4469
|
return zr(Te, e, i);
|
|
4464
4470
|
}
|
|
4465
4471
|
function M() {
|
|
4466
4472
|
return Le;
|
|
4467
4473
|
}
|
|
4468
|
-
function
|
|
4469
|
-
return h.Function(c.install) ? c.install(W,
|
|
4474
|
+
function me(c, m) {
|
|
4475
|
+
return h.Function(c.install) ? c.install(W, m) : h.Function(c) && c(W, m), this;
|
|
4470
4476
|
}
|
|
4471
|
-
function W(c,
|
|
4472
|
-
let b = Ni(c,
|
|
4477
|
+
function W(c, m, $) {
|
|
4478
|
+
let b = Ni(c, m || {});
|
|
4473
4479
|
const w = b.$refs.fc.formCreate;
|
|
4474
4480
|
return w.$parent = $, Li(w.options).appendChild(b.$el), w.api();
|
|
4475
4481
|
}
|
|
4476
|
-
Se(W,
|
|
4482
|
+
Se(W, k);
|
|
4477
4483
|
function xt(c) {
|
|
4478
|
-
let
|
|
4479
|
-
return c ?
|
|
4484
|
+
let m = v({}, t);
|
|
4485
|
+
return c ? m.inherit = {
|
|
4480
4486
|
components: e,
|
|
4481
4487
|
parsers: r,
|
|
4482
4488
|
directives: i,
|
|
@@ -4485,53 +4491,53 @@ function Kt(t) {
|
|
|
4485
4491
|
useApps: o,
|
|
4486
4492
|
maker: f,
|
|
4487
4493
|
formulas: C,
|
|
4488
|
-
loadData:
|
|
4489
|
-
} : delete
|
|
4494
|
+
loadData: g
|
|
4495
|
+
} : delete m.inherit, Kt(m);
|
|
4490
4496
|
}
|
|
4491
|
-
function zt(c,
|
|
4492
|
-
s[c] =
|
|
4497
|
+
function zt(c, m) {
|
|
4498
|
+
s[c] = m;
|
|
4493
4499
|
}
|
|
4494
|
-
function Xt(c,
|
|
4495
|
-
C[c] =
|
|
4500
|
+
function Xt(c, m) {
|
|
4501
|
+
C[c] = m;
|
|
4496
4502
|
}
|
|
4497
|
-
function Zt(c,
|
|
4503
|
+
function Zt(c, m) {
|
|
4498
4504
|
const $ = n[c] || {}, b = $.parsers || {};
|
|
4499
|
-
|
|
4500
|
-
b[w] = Se(
|
|
4501
|
-
}),
|
|
4505
|
+
m.parsers && Object.keys(m.parsers).forEach((w) => {
|
|
4506
|
+
b[w] = Se(m.parsers[w], De);
|
|
4507
|
+
}), m.name = c, n[c] = q(v(v({}, $), m), { parsers: b });
|
|
4502
4508
|
}
|
|
4503
|
-
function
|
|
4504
|
-
c && Object.keys(U).forEach((
|
|
4505
|
-
(Array.isArray(U[
|
|
4509
|
+
function Fe(c) {
|
|
4510
|
+
c && Object.keys(U).forEach((m) => {
|
|
4511
|
+
(Array.isArray(U[m]) ? U[m] : [U[m]]).forEach((b) => {
|
|
4506
4512
|
b.bus.$emit("$loadData." + c);
|
|
4507
4513
|
});
|
|
4508
4514
|
});
|
|
4509
4515
|
}
|
|
4510
|
-
function Pe(c,
|
|
4511
|
-
|
|
4516
|
+
function Pe(c, m) {
|
|
4517
|
+
oe(g, c, m), Fe(c);
|
|
4512
4518
|
}
|
|
4513
|
-
function
|
|
4514
|
-
const $ = (...b) => O(() =>
|
|
4519
|
+
function ke(c, m) {
|
|
4520
|
+
const $ = (...b) => O(() => m(...b));
|
|
4515
4521
|
$._driver = !0, Pe(c, $);
|
|
4516
4522
|
}
|
|
4517
|
-
function nt(c,
|
|
4523
|
+
function nt(c, m) {
|
|
4518
4524
|
const $ = (c || "").split(".");
|
|
4519
4525
|
c = $.shift();
|
|
4520
4526
|
const b = $.join(".");
|
|
4521
|
-
if (
|
|
4522
|
-
let w =
|
|
4523
|
-
return w && w._driver ? w = w(b) : $.length && (w = B(w, $)), w == null || w === "" ?
|
|
4527
|
+
if (j(g, c) || F(g, c, vt), g[c] !== vt) {
|
|
4528
|
+
let w = g[c];
|
|
4529
|
+
return w && w._driver ? w = w(b) : $.length && (w = B(w, $)), w == null || w === "" ? m : w;
|
|
4524
4530
|
} else
|
|
4525
|
-
return
|
|
4531
|
+
return m;
|
|
4526
4532
|
}
|
|
4527
4533
|
function Qt(c) {
|
|
4528
4534
|
l.push(c);
|
|
4529
4535
|
}
|
|
4530
4536
|
function Yt(c) {
|
|
4531
|
-
delete
|
|
4537
|
+
delete g[c], Fe(c);
|
|
4532
4538
|
}
|
|
4533
|
-
function er(c,
|
|
4534
|
-
a.push({ name: c, callback:
|
|
4539
|
+
function er(c, m) {
|
|
4540
|
+
a.push({ name: c, callback: m });
|
|
4535
4541
|
}
|
|
4536
4542
|
function Te(c) {
|
|
4537
4543
|
_(this, {
|
|
@@ -4544,9 +4550,9 @@ function Kt(t) {
|
|
|
4544
4550
|
modelFields: s,
|
|
4545
4551
|
formulas: C,
|
|
4546
4552
|
isMobile: d,
|
|
4547
|
-
rules: c.$
|
|
4548
|
-
name: c.$
|
|
4549
|
-
inFor: c.$
|
|
4553
|
+
rules: c.$props.rule,
|
|
4554
|
+
name: c.$props.name || Ve(),
|
|
4555
|
+
inFor: c.$props.inFor,
|
|
4550
4556
|
prop: {
|
|
4551
4557
|
components: e,
|
|
4552
4558
|
directives: i
|
|
@@ -4554,17 +4560,17 @@ function Kt(t) {
|
|
|
4554
4560
|
get: null,
|
|
4555
4561
|
drivers: n,
|
|
4556
4562
|
renderDriver: null,
|
|
4557
|
-
refreshData:
|
|
4558
|
-
loadData:
|
|
4563
|
+
refreshData: Fe,
|
|
4564
|
+
loadData: g,
|
|
4559
4565
|
CreateNode: y,
|
|
4560
4566
|
bus: new Ei(),
|
|
4561
4567
|
unwatch: [],
|
|
4562
4568
|
options: mr({}),
|
|
4563
4569
|
extendApiFn: l,
|
|
4564
4570
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4565
|
-
tmpData:
|
|
4566
|
-
}), a.forEach((
|
|
4567
|
-
this.bus.$on(
|
|
4571
|
+
tmpData: ne({})
|
|
4572
|
+
}), a.forEach((m) => {
|
|
4573
|
+
this.bus.$on(m.name, m.callback);
|
|
4568
4574
|
}), P(() => {
|
|
4569
4575
|
L(this.options, () => {
|
|
4570
4576
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
@@ -4575,55 +4581,55 @@ function Kt(t) {
|
|
|
4575
4581
|
init() {
|
|
4576
4582
|
this.isSub() && this.unwatch.push(L(() => this.vm.parent.fc.options.value, () => {
|
|
4577
4583
|
this.initOptions(), this.$handle.api.refresh();
|
|
4578
|
-
}, { deep: !0, flush: "sync" })), this.vm.$
|
|
4584
|
+
}, { deep: !0, flush: "sync" })), this.vm.$props.driver && (this.renderDriver = typeof this.vm.$props.driver == "object" ? this.vm.$props.driver : this.drivers[this.vm.$props.driver]), !this.renderDriver && this.vm.parent && (this.renderDriver = this.vm.parent.fc.renderDriver), this.renderDriver || (this.renderDriver = this.drivers.default), this.initOptions(), this.$handle.init();
|
|
4579
4585
|
},
|
|
4580
|
-
targetFormDriver(c, ...
|
|
4581
|
-
if (this.renderDriver && this.renderDriver[c])
|
|
4582
|
-
return O(() => this.renderDriver[c](...
|
|
4586
|
+
targetFormDriver(c, ...m) {
|
|
4587
|
+
if (this.bus.$emit(c, ...m), this.renderDriver && this.renderDriver[c])
|
|
4588
|
+
return O(() => this.renderDriver[c](...m));
|
|
4583
4589
|
},
|
|
4584
|
-
t(c,
|
|
4590
|
+
t(c, m, $) {
|
|
4585
4591
|
let b = $ ? $("$t." + c) : this.globalLanguageDriver(c);
|
|
4586
|
-
return b == null && (b = ""), b &&
|
|
4587
|
-
const
|
|
4588
|
-
b = b.replace(
|
|
4592
|
+
return b == null && (b = ""), b && m && Object.keys(m).forEach((w) => {
|
|
4593
|
+
const D = new RegExp(`{${w}}`, "g");
|
|
4594
|
+
b = b.replace(D, m[w]);
|
|
4589
4595
|
}), b;
|
|
4590
4596
|
},
|
|
4591
4597
|
globalDataDriver(c) {
|
|
4592
|
-
let
|
|
4593
|
-
const $ =
|
|
4598
|
+
let m = c.split(".");
|
|
4599
|
+
const $ = m.shift(), b = this.options.value.globalData && this.options.value.globalData[$];
|
|
4594
4600
|
if (b) {
|
|
4595
4601
|
if (b.type === "static")
|
|
4596
|
-
return B(b.data,
|
|
4602
|
+
return B(b.data, m);
|
|
4597
4603
|
{
|
|
4598
4604
|
let w;
|
|
4599
|
-
const
|
|
4600
|
-
if (
|
|
4601
|
-
if (
|
|
4605
|
+
const D = this.fetchCache.get(b);
|
|
4606
|
+
if (D) {
|
|
4607
|
+
if (D.status && (w = B(D.data, m)), !D.loading)
|
|
4602
4608
|
return w;
|
|
4603
|
-
|
|
4609
|
+
D.loading = !1, this.fetchCache.set(b, D);
|
|
4604
4610
|
} else
|
|
4605
4611
|
this.fetchCache.set(b, { status: !1 });
|
|
4606
|
-
const
|
|
4607
|
-
|
|
4612
|
+
const S = se(() => {
|
|
4613
|
+
te();
|
|
4608
4614
|
const x = this.fetchCache.get(b);
|
|
4609
4615
|
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (x && (x.loading = !0, this.fetchCache.set(b, x)), this.bus.$emit("$loadData.$globalData." + $)) : this.fetchCache.delete(b);
|
|
4610
4616
|
}, b.wait || 600), ve = (x) => {
|
|
4611
4617
|
this.fetchCache.set(b, { status: !0, data: x }), this.bus.$emit("$loadData.$globalData." + $);
|
|
4612
|
-
},
|
|
4618
|
+
}, ae = (x, le) => {
|
|
4613
4619
|
if (le && b.watch === !1)
|
|
4614
|
-
return
|
|
4620
|
+
return te();
|
|
4615
4621
|
if (le) {
|
|
4616
|
-
|
|
4622
|
+
S();
|
|
4617
4623
|
return;
|
|
4618
4624
|
}
|
|
4619
|
-
const
|
|
4620
|
-
this.$handle.api.fetch(
|
|
4621
|
-
ve(
|
|
4622
|
-
}).catch((
|
|
4625
|
+
const ue = this.$handle.loadFetchVar(Je(b), x);
|
|
4626
|
+
ue.targetRule = this.targetRule, this.$handle.api.fetch(ue).then((re) => {
|
|
4627
|
+
ve(re);
|
|
4628
|
+
}).catch((re) => {
|
|
4623
4629
|
ve(null);
|
|
4624
4630
|
});
|
|
4625
|
-
},
|
|
4626
|
-
return this.unwatch.push(
|
|
4631
|
+
}, te = this.watchLoadData(ae);
|
|
4632
|
+
return b.watch === !1 && te(), this.unwatch.push(te), w;
|
|
4627
4633
|
}
|
|
4628
4634
|
}
|
|
4629
4635
|
},
|
|
@@ -4632,28 +4638,28 @@ function Kt(t) {
|
|
|
4632
4638
|
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4633
4639
|
},
|
|
4634
4640
|
globalLanguageDriver(c) {
|
|
4635
|
-
let
|
|
4636
|
-
if (
|
|
4637
|
-
const w = this.options.value.language || {},
|
|
4638
|
-
b = B(w[
|
|
4641
|
+
let m = this.vm.top.$props.t, $ = this.vm.top.$props.locale, b;
|
|
4642
|
+
if (m && (b = O(() => m(c))), b == null && $ && typeof $ == "object" && (b = B($, c)), b == null) {
|
|
4643
|
+
const w = this.options.value.language || {}, D = this.getLocale();
|
|
4644
|
+
b = B(w[D] || {}, c), b == null && (b = B(Ti[D] || {}, c));
|
|
4639
4645
|
}
|
|
4640
4646
|
return b;
|
|
4641
4647
|
},
|
|
4642
4648
|
globalVarDriver(c) {
|
|
4643
|
-
let
|
|
4644
|
-
const $ =
|
|
4649
|
+
let m = c.split(".");
|
|
4650
|
+
const $ = m.shift(), b = this.options.value.globalVariable && this.options.value.globalVariable[$];
|
|
4645
4651
|
if (b) {
|
|
4646
4652
|
const w = h.Function(b) ? b : z(b.handle);
|
|
4647
4653
|
if (w) {
|
|
4648
|
-
let
|
|
4649
|
-
return B(
|
|
4654
|
+
let D = w((...S) => this.$handle.api.getData(...S), this.$handle.api);
|
|
4655
|
+
return B(D, m);
|
|
4650
4656
|
}
|
|
4651
4657
|
}
|
|
4652
4658
|
},
|
|
4653
|
-
setData(c,
|
|
4654
|
-
$ ? Pe(c,
|
|
4659
|
+
setData(c, m, $) {
|
|
4660
|
+
$ ? Pe(c, m) : (oe(this.vm.top.fc.tmpData, c, m), this.bus.$emit("$loadData." + c));
|
|
4655
4661
|
},
|
|
4656
|
-
getLoadData(c,
|
|
4662
|
+
getLoadData(c, m) {
|
|
4657
4663
|
let $ = null;
|
|
4658
4664
|
if (c != null) {
|
|
4659
4665
|
let b = c.split(".");
|
|
@@ -4683,38 +4689,38 @@ function Kt(t) {
|
|
|
4683
4689
|
}
|
|
4684
4690
|
$ && b.length && ($ = B($, b));
|
|
4685
4691
|
}
|
|
4686
|
-
return $ == null || $ === "" ?
|
|
4692
|
+
return $ == null || $ === "" ? m : $;
|
|
4687
4693
|
},
|
|
4688
|
-
watchLoadData(c,
|
|
4694
|
+
watchLoadData(c, m) {
|
|
4689
4695
|
let $ = {};
|
|
4690
|
-
const b = (
|
|
4696
|
+
const b = (S) => {
|
|
4691
4697
|
this.get || (this.get = w), O(() => {
|
|
4692
|
-
c(w,
|
|
4698
|
+
c(w, S);
|
|
4693
4699
|
}), this.get === w && (this.get = void 0);
|
|
4694
|
-
}, w = (
|
|
4695
|
-
let
|
|
4696
|
-
if (typeof
|
|
4697
|
-
return $[
|
|
4698
|
-
const
|
|
4699
|
-
const
|
|
4700
|
-
if ($[
|
|
4701
|
-
((
|
|
4700
|
+
}, w = (S, ve) => {
|
|
4701
|
+
let ae;
|
|
4702
|
+
if (typeof S == "object" && (ae = S.getValue, S = S.id), $[S])
|
|
4703
|
+
return $[S].val;
|
|
4704
|
+
const te = ye(() => ae ? ae() : this.getLoadData(S, ve)), x = S.split("."), le = x.shift(), ue = x.shift() || "", re = se(() => {
|
|
4705
|
+
const fe = ae ? ae() : this.getLoadData(S, ve);
|
|
4706
|
+
if ($[S])
|
|
4707
|
+
((fe instanceof Function || h.Object(fe) || Array.isArray(fe)) && fe === $[S].val || JSON.stringify(fe) !== JSON.stringify($[S].val)) && ($[S].val = fe, b(!0));
|
|
4702
4708
|
else return;
|
|
4703
|
-
},
|
|
4704
|
-
|
|
4709
|
+
}, m || 0), rr = L(te, (fe) => {
|
|
4710
|
+
re();
|
|
4705
4711
|
});
|
|
4706
|
-
return this.bus.$on("$loadData." + le,
|
|
4712
|
+
return this.bus.$on("$loadData." + le, re), ue && this.bus.$on("$loadData." + le + "." + ue, re), $[S] = {
|
|
4707
4713
|
fn: () => {
|
|
4708
|
-
this.bus.$off("$loadData." + le,
|
|
4714
|
+
this.bus.$off("$loadData." + le, re), ue && this.bus.$off("$loadData." + le + "." + ue, re), rr();
|
|
4709
4715
|
},
|
|
4710
|
-
val:
|
|
4711
|
-
},
|
|
4716
|
+
val: te.value
|
|
4717
|
+
}, te.value;
|
|
4712
4718
|
};
|
|
4713
4719
|
b(!1);
|
|
4714
|
-
const
|
|
4715
|
-
Object.keys($).forEach((
|
|
4720
|
+
const D = () => {
|
|
4721
|
+
Object.keys($).forEach((S) => $[S].fn()), $ = {};
|
|
4716
4722
|
};
|
|
4717
|
-
return this.unwatch.push(
|
|
4723
|
+
return this.unwatch.push(D), D;
|
|
4718
4724
|
},
|
|
4719
4725
|
isSub() {
|
|
4720
4726
|
return this.vm.parent && this.vm.extendOption;
|
|
@@ -4728,12 +4734,15 @@ function Kt(t) {
|
|
|
4728
4734
|
globalEvent: {},
|
|
4729
4735
|
globalData: {}
|
|
4730
4736
|
}, K(p));
|
|
4731
|
-
|
|
4737
|
+
const m = this.isSub();
|
|
4738
|
+
m && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$props.option || {});
|
|
4739
|
+
const $ = this.api();
|
|
4740
|
+
this.targetFormDriver("initOptions", c, { api: $, isSubForm: m }), this.updateOptions(c);
|
|
4732
4741
|
},
|
|
4733
|
-
mergeOptions(c,
|
|
4734
|
-
return
|
|
4735
|
-
delete
|
|
4736
|
-
}),
|
|
4742
|
+
mergeOptions(c, m, $) {
|
|
4743
|
+
return m = v({}, m || {}), $ && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4744
|
+
delete m[b];
|
|
4745
|
+
}), m.global && (c.global = Kr(c.global, m.global), delete m.global), this.$handle.$manager.mergeOptions([m], c), c;
|
|
4737
4746
|
},
|
|
4738
4747
|
updateOptions(c) {
|
|
4739
4748
|
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
@@ -4769,30 +4778,30 @@ function Kt(t) {
|
|
|
4769
4778
|
isMobile: d,
|
|
4770
4779
|
extendApi: Qt,
|
|
4771
4780
|
getData: nt,
|
|
4772
|
-
setDataDriver:
|
|
4781
|
+
setDataDriver: ke,
|
|
4773
4782
|
setData: Pe,
|
|
4774
4783
|
removeData: Yt,
|
|
4775
|
-
refreshData:
|
|
4784
|
+
refreshData: Fe,
|
|
4776
4785
|
maker: f,
|
|
4777
4786
|
component: E,
|
|
4778
4787
|
directive: N,
|
|
4779
4788
|
setModelField: zt,
|
|
4780
4789
|
setFormula: Xt,
|
|
4781
4790
|
setDriver: Zt,
|
|
4782
|
-
register:
|
|
4791
|
+
register: de,
|
|
4783
4792
|
$vnode: M,
|
|
4784
|
-
parser:
|
|
4785
|
-
use:
|
|
4793
|
+
parser: pe,
|
|
4794
|
+
use: me,
|
|
4786
4795
|
factory: xt,
|
|
4787
4796
|
componentAlias: Ie,
|
|
4788
4797
|
copyRule: It,
|
|
4789
4798
|
copyRules: Pt,
|
|
4790
4799
|
mergeRule: ee,
|
|
4791
4800
|
fetch: qt,
|
|
4792
|
-
$form:
|
|
4801
|
+
$form: R,
|
|
4793
4802
|
parseFn: z,
|
|
4794
4803
|
parseJson: Vt,
|
|
4795
|
-
toJson:
|
|
4804
|
+
toJson: we,
|
|
4796
4805
|
useApp: V,
|
|
4797
4806
|
getApi: G,
|
|
4798
4807
|
on: er
|
|
@@ -4801,35 +4810,35 @@ function Kt(t) {
|
|
|
4801
4810
|
function tr(c) {
|
|
4802
4811
|
_(c, {
|
|
4803
4812
|
create: W,
|
|
4804
|
-
install(
|
|
4805
|
-
if (p = v(v({}, p), $ || {}),
|
|
4806
|
-
|
|
4807
|
-
const b = function(
|
|
4808
|
-
return W(
|
|
4813
|
+
install(m, $) {
|
|
4814
|
+
if (p = v(v({}, p), $ || {}), m._installedFormCreate === !0) return;
|
|
4815
|
+
m._installedFormCreate = !0;
|
|
4816
|
+
const b = function(D, S = {}) {
|
|
4817
|
+
return W(D, S, this);
|
|
4809
4818
|
};
|
|
4810
|
-
st(b),
|
|
4811
|
-
const w =
|
|
4812
|
-
|
|
4813
|
-
O(() =>
|
|
4819
|
+
st(b), m.prototype.$formCreate = b;
|
|
4820
|
+
const w = R();
|
|
4821
|
+
m.component(w.name, w), m.component("FcFragment", M()), o.forEach((D) => {
|
|
4822
|
+
O(() => D(c, m));
|
|
4814
4823
|
});
|
|
4815
4824
|
}
|
|
4816
4825
|
});
|
|
4817
4826
|
}
|
|
4818
|
-
if (st(
|
|
4827
|
+
if (st(k), tr(k), ke("$cookie", Vi), ke("$localStorage", Ii), ke("$sessionStorage", Pi), y.use({ fragment: "fcFragment" }), t.install && W.use(t), pe(Si), t.inherit) {
|
|
4819
4828
|
const c = t.inherit;
|
|
4820
|
-
c.components && _(e, c.components), c.parsers && _(r, c.parsers), c.directives && _(i, c.directives), c.modelFields && _(s, c.modelFields), c.providers && _(u, c.providers), c.useApps && _(o, c.useApps), c.maker && _(f, c.maker), c.loadData && _(
|
|
4829
|
+
c.components && _(e, c.components), c.parsers && _(r, c.parsers), c.directives && _(i, c.directives), c.modelFields && _(s, c.modelFields), c.providers && _(u, c.providers), c.useApps && _(o, c.useApps), c.maker && _(f, c.maker), c.loadData && _(g, c.loadData), c.formulas && _(C, c.formulas);
|
|
4821
4830
|
}
|
|
4822
|
-
const
|
|
4823
|
-
return Se(
|
|
4831
|
+
const Ee = R();
|
|
4832
|
+
return Se(Ee, k), Object.defineProperties(Ee, {
|
|
4824
4833
|
fetch: {
|
|
4825
4834
|
get() {
|
|
4826
|
-
return
|
|
4835
|
+
return k.fetch;
|
|
4827
4836
|
},
|
|
4828
4837
|
set(c) {
|
|
4829
|
-
|
|
4838
|
+
k.fetch = c;
|
|
4830
4839
|
}
|
|
4831
4840
|
}
|
|
4832
|
-
}),
|
|
4841
|
+
}), Ee.util = k, Ee;
|
|
4833
4842
|
}
|
|
4834
4843
|
const _t = {
|
|
4835
4844
|
date: "yyyy-MM-dd",
|
|
@@ -4977,13 +4986,13 @@ function Yi(t) {
|
|
|
4977
4986
|
return t.type === "tooltip";
|
|
4978
4987
|
}
|
|
4979
4988
|
function Ot(t, e) {
|
|
4980
|
-
|
|
4989
|
+
j(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4981
4990
|
}
|
|
4982
4991
|
function Z(t) {
|
|
4983
4992
|
return t === !1;
|
|
4984
4993
|
}
|
|
4985
4994
|
function en(t, e) {
|
|
4986
|
-
|
|
4995
|
+
j(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4987
4996
|
}
|
|
4988
4997
|
function He(t) {
|
|
4989
4998
|
const e = v({}, t);
|
|
@@ -5082,22 +5091,22 @@ const tn = {
|
|
|
5082
5091
|
return !(!e.title && !e.native || Z(e.show));
|
|
5083
5092
|
},
|
|
5084
5093
|
makeInfo(t, e, r) {
|
|
5085
|
-
var f, p, d,
|
|
5094
|
+
var f, p, d, g, y, C;
|
|
5086
5095
|
const i = v({}, t.title), s = v({}, t.info), n = Yi(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
|
|
5087
5096
|
title: (p = (f = r.refRule) == null ? void 0 : f.__$title) == null ? void 0 : p.value,
|
|
5088
5097
|
rule: r.rule,
|
|
5089
5098
|
options: this.options
|
|
5090
|
-
}) : ((
|
|
5099
|
+
}) : ((g = (d = r.refRule) == null ? void 0 : d.__$title) == null ? void 0 : g.value) + (o.labelSuffix || o["label-suffix"] || "")];
|
|
5091
5100
|
if (!Z(s.show) && (s.info || s.native) && !Z(s.icon)) {
|
|
5092
|
-
const
|
|
5101
|
+
const k = {
|
|
5093
5102
|
type: s.type || "popover",
|
|
5094
5103
|
slot: "label",
|
|
5095
5104
|
props: He(s),
|
|
5096
5105
|
key: `${e}pop`
|
|
5097
5106
|
};
|
|
5098
|
-
delete
|
|
5107
|
+
delete k.props.icon, delete k.props.show, delete k.props.info, delete k.props.align, delete k.props.native;
|
|
5099
5108
|
const G = "content";
|
|
5100
|
-
s.info && !
|
|
5109
|
+
s.info && !j(k.props, G) && (k.props[G] = (C = (y = r.refRule) == null ? void 0 : y.__$info) == null ? void 0 : C.value), l[s.align !== "left" ? "unshift" : "push"](this.$r(Y([s, k]), [
|
|
5101
5110
|
this.$r({
|
|
5102
5111
|
type: "i",
|
|
5103
5112
|
slot: n ? "default" : "reference",
|
|
@@ -5182,12 +5191,12 @@ const tn = {
|
|
|
5182
5191
|
key: `${this.key}b1`
|
|
5183
5192
|
}, [e]);
|
|
5184
5193
|
}
|
|
5185
|
-
},
|
|
5186
|
-
rn(
|
|
5187
|
-
nn(
|
|
5188
|
-
sn(
|
|
5189
|
-
on(
|
|
5190
|
-
an(
|
|
5194
|
+
}, he = {};
|
|
5195
|
+
rn(he);
|
|
5196
|
+
nn(he);
|
|
5197
|
+
sn(he);
|
|
5198
|
+
on(he);
|
|
5199
|
+
an(he);
|
|
5191
5200
|
function rn(t) {
|
|
5192
5201
|
["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
|
|
5193
5202
|
t[e] = T(e);
|
|
@@ -5358,14 +5367,14 @@ function fn(t) {
|
|
|
5358
5367
|
t.component(e.name, e);
|
|
5359
5368
|
}), t.register(Wt), Xi.forEach((e) => {
|
|
5360
5369
|
t.parser(e);
|
|
5361
|
-
}), Object.keys(
|
|
5362
|
-
t.maker[e] =
|
|
5370
|
+
}), Object.keys(he).forEach((e) => {
|
|
5371
|
+
t.maker[e] = he[e];
|
|
5363
5372
|
});
|
|
5364
5373
|
}
|
|
5365
5374
|
function cn() {
|
|
5366
5375
|
return Kt({
|
|
5367
5376
|
ui: "element-ui",
|
|
5368
|
-
version: "2.7.
|
|
5377
|
+
version: "2.7.16",
|
|
5369
5378
|
manager: tn,
|
|
5370
5379
|
extendApi: ln,
|
|
5371
5380
|
install: fn,
|