@form-create/element-ui 2.7.14 → 2.7.15
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 +298 -292
- 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.15
|
|
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
|
}
|
|
@@ -591,10 +591,10 @@ 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 Rr = "fcSelect",
|
|
597
|
+
const Rr = "fcSelect", jr = {
|
|
598
598
|
name: Rr,
|
|
599
599
|
functional: !0,
|
|
600
600
|
props: {
|
|
@@ -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;
|
|
@@ -915,10 +915,10 @@ const Ir = "fcUpload", Pr = {
|
|
|
915
915
|
function k(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)) {
|
|
@@ -936,14 +936,14 @@ function we(t, e = {}, r) {
|
|
|
936
936
|
}
|
|
937
937
|
else
|
|
938
938
|
o && k(t, s, {});
|
|
939
|
-
t[s] =
|
|
939
|
+
t[s] = Oe(t[s], n, r);
|
|
940
940
|
} else
|
|
941
941
|
k(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++)
|
|
@@ -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);
|
|
@@ -1350,13 +1350,13 @@ const Br = "fcGroup", Lr = {
|
|
|
1350
1350
|
Or,
|
|
1351
1351
|
kr,
|
|
1352
1352
|
Sr,
|
|
1353
|
-
|
|
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);
|
|
@@ -1400,14 +1400,14 @@ const kt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style"
|
|
|
1400
1400
|
}, Hr = (t, e) => function() {
|
|
1401
1401
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1402
1402
|
}, Rt = ["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
|
|
1403
|
+
function jt() {
|
|
1404
1404
|
return [...Rt, ...kt, ...Et, ...St, ...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,7 +1482,7 @@ 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
1488
|
s && ((!i[s] || typeof i[s] != "object") && k(i, s, {}), i = i[s]), s = n;
|
|
@@ -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 Se() {
|
|
1553
1553
|
const t = {}, e = (r) => r || "default";
|
|
1554
1554
|
return {
|
|
1555
1555
|
setSlot(r, i) {
|
|
@@ -1585,7 +1585,7 @@ function Ee() {
|
|
|
1585
1585
|
}
|
|
1586
1586
|
};
|
|
1587
1587
|
}
|
|
1588
|
-
function
|
|
1588
|
+
function Re(t, e) {
|
|
1589
1589
|
return Object.setPrototypeOf(t, e), t;
|
|
1590
1590
|
}
|
|
1591
1591
|
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, fe = {
|
|
@@ -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,23 +1723,23 @@ 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, F = () => {
|
|
1734
1734
|
if (o) {
|
|
1735
|
-
const E =
|
|
1735
|
+
const E = je(n, o);
|
|
1736
1736
|
if (E) {
|
|
1737
1737
|
let S;
|
|
1738
1738
|
C ? (S = H(E.getSubForm()), S.push(y)) : S = y, E.subForm(S);
|
|
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
1745
|
const S = H(E.getSubForm()), M = S.indexOf(y);
|
|
@@ -1761,44 +1761,44 @@ function zr(t, e, r) {
|
|
|
1761
1761
|
}, () => {
|
|
1762
1762
|
});
|
|
1763
1763
|
});
|
|
1764
|
-
const N =
|
|
1765
|
-
|
|
1766
|
-
}, 100), he =
|
|
1767
|
-
|
|
1768
|
-
}, 100), Ie =
|
|
1769
|
-
|
|
1764
|
+
const N = se(() => {
|
|
1765
|
+
g.bus.$emit("$loadData.$topForm");
|
|
1766
|
+
}, 100), he = se(function() {
|
|
1767
|
+
g.bus.$emit("$loadData.$scopeForm");
|
|
1768
|
+
}, 100), Ie = se(() => {
|
|
1769
|
+
g.bus.$emit("$loadData.$form");
|
|
1770
1770
|
}, 100), de = (E) => {
|
|
1771
|
-
|
|
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", de)), y !== y.scope && y.scope.bus.$on("$loadData.$scopeForm", he),
|
|
1774
|
+
o && (y.top.bus.$on("$loadData.$form", N), y.top.bus.$on("change", de)), y !== y.scope && y.scope.bus.$on("$loadData.$scopeForm", he), g.mounted();
|
|
1775
1775
|
}), dr(() => {
|
|
1776
|
-
o && (y.top.bus.$off("$loadData.$form", N), y.top.bus.$off("change", de)), y !== y.scope && y.scope.bus.$off("$loadData.$scopeForm", he), G(), d.destroyed = !0,
|
|
1776
|
+
o && (y.top.bus.$off("$loadData.$form", N), y.top.bus.$off("change", de)), y !== y.scope && y.scope.bus.$off("$loadData.$scopeForm", he), 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
1780
|
E ? F() : 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((S) => d.renderRule.indexOf(S) > -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,7 +1807,7 @@ function zr(t, e, r) {
|
|
|
1807
1807
|
},
|
|
1808
1808
|
updateValue(E) {
|
|
1809
1809
|
if (d.destroyed) return;
|
|
1810
|
-
const S =
|
|
1810
|
+
const S = we(E);
|
|
1811
1811
|
d.updateValue !== S && (d.updateValue = S, n.$emit("update:value", E), P(() => {
|
|
1812
1812
|
Ie(), o ? f.value || he() : (N(), he());
|
|
1813
1813
|
}));
|
|
@@ -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);
|
|
@@ -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,7 +2034,7 @@ 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
|
k(f.rule, "value", u ? n[a] : void 0);
|
|
2040
2040
|
}), delete o[a];
|
|
@@ -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) && k(l.rule, "$" + o, a), j(l.rule, "effect") || k(l.rule, "effect", {}), k(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) ? k(u, "value", o[u.field]) : a && k(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 = Se();
|
|
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) => {
|
|
@@ -2682,7 +2686,7 @@ function ti(t) {
|
|
|
2682
2686
|
},
|
|
2683
2687
|
renderChildren(e, r, i) {
|
|
2684
2688
|
if (!h.trueArray(e)) return [];
|
|
2685
|
-
const s =
|
|
2689
|
+
const s = Se();
|
|
2686
2690
|
return e.map((n) => {
|
|
2687
2691
|
if (n) {
|
|
2688
2692
|
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
@@ -2708,7 +2712,7 @@ function ti(t) {
|
|
|
2708
2712
|
},
|
|
2709
2713
|
createRuleVnode(e, r, i) {
|
|
2710
2714
|
this.force = i !== !1, this.tmpInput = r;
|
|
2711
|
-
const s =
|
|
2715
|
+
const s = Se();
|
|
2712
2716
|
return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
|
|
2713
2717
|
},
|
|
2714
2718
|
renderRule(e, r, i) {
|
|
@@ -2723,7 +2727,7 @@ function ti(t) {
|
|
|
2723
2727
|
a && (s = J(a));
|
|
2724
2728
|
}
|
|
2725
2729
|
if (!s) return;
|
|
2726
|
-
const n =
|
|
2730
|
+
const n = Se();
|
|
2727
2731
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2728
2732
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2729
2733
|
});
|
|
@@ -2739,7 +2743,7 @@ function rt(t) {
|
|
|
2739
2743
|
fc: t.fc,
|
|
2740
2744
|
vm: t.vm,
|
|
2741
2745
|
$manager: t.$manager,
|
|
2742
|
-
vNode: new t.fc.CreateNode(t
|
|
2746
|
+
vNode: new t.fc.CreateNode(t),
|
|
2743
2747
|
force: !1,
|
|
2744
2748
|
tmpInput: null,
|
|
2745
2749
|
id: ri++
|
|
@@ -2784,8 +2788,8 @@ function ii(t) {
|
|
|
2784
2788
|
let p, d = n || o || a;
|
|
2785
2789
|
if (h.Object(f) && (p = f.inject, f = f.name, d = f.prefix || d), d) {
|
|
2786
2790
|
r || (d = `native-${d}`);
|
|
2787
|
-
const
|
|
2788
|
-
this.vm.$emit(
|
|
2791
|
+
const g = be(`${d}-${f}`), y = (...C) => {
|
|
2792
|
+
this.vm.$emit(g, ...C), this.vm.$emit("emit-event", g, ...C), this.bus.$emit(g, ...C);
|
|
2789
2793
|
};
|
|
2790
2794
|
if (y.__emit = !0, !p && l === !1)
|
|
2791
2795
|
i[f] = y;
|
|
@@ -2825,7 +2829,7 @@ function ii(t) {
|
|
|
2825
2829
|
let f = !1, p;
|
|
2826
2830
|
if (i && u.indexOf("$form.") === 0) {
|
|
2827
2831
|
const d = u.split(".");
|
|
2828
|
-
d.shift(),
|
|
2832
|
+
d.shift(), j(i.value, d[0]) && (f = !0, p = r ? r({
|
|
2829
2833
|
id: "$form." + d[0] + "_" + i.rule.__fc__.id,
|
|
2830
2834
|
getValue: () => B(i.value, d)
|
|
2831
2835
|
}) : B(i.value, d));
|
|
@@ -2837,16 +2841,16 @@ function ii(t) {
|
|
|
2837
2841
|
d.key ? f.push(d.key) : d.children && f.push(a(d.children));
|
|
2838
2842
|
});
|
|
2839
2843
|
let p = !1;
|
|
2840
|
-
return f.forEach((d,
|
|
2841
|
-
d != null && (d.indexOf("'") === 0 || d.indexOf('"') === 0) && (f[
|
|
2844
|
+
return f.forEach((d, g) => {
|
|
2845
|
+
d != null && (d.indexOf("'") === 0 || d.indexOf('"') === 0) && (f[g] = d.slice(1, -1), p = !0);
|
|
2842
2846
|
}), f.length === 1 && (p || !isNaN(Number(f[0]))) ? f[0] : o(f.join("."));
|
|
2843
2847
|
};
|
|
2844
2848
|
let l;
|
|
2845
2849
|
if (n.forEach((u) => {
|
|
2846
2850
|
const f = u.split("||"), p = f[0].trim();
|
|
2847
2851
|
if (p) {
|
|
2848
|
-
const d = (f[1] || "").trim(),
|
|
2849
|
-
let y = O(() => a(
|
|
2852
|
+
const d = (f[1] || "").trim(), g = Bt(p);
|
|
2853
|
+
let y = O(() => a(g));
|
|
2850
2854
|
(y == null || y === "") && f.length > 1 && (y = d), l = y, e = e.replaceAll(`{{${u}}}`, y == null ? "" : y);
|
|
2851
2855
|
}
|
|
2852
2856
|
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
@@ -3005,7 +3009,7 @@ _(Ht.prototype, {
|
|
|
3005
3009
|
setPending(t, e, r) {
|
|
3006
3010
|
this.pending[t] = {
|
|
3007
3011
|
origin: e,
|
|
3008
|
-
value:
|
|
3012
|
+
value: ne(r)
|
|
3009
3013
|
};
|
|
3010
3014
|
},
|
|
3011
3015
|
effectData(t) {
|
|
@@ -3157,23 +3161,23 @@ function li(t) {
|
|
|
3157
3161
|
let l = ct(o);
|
|
3158
3162
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3159
3163
|
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__,
|
|
3164
|
+
let f, p = !1, d = !!o.__fc__, g = l.value;
|
|
3161
3165
|
if (d) {
|
|
3162
|
-
if (f = o.__fc__,
|
|
3166
|
+
if (f = o.__fc__, g = f.defaultValue, f.deleted) {
|
|
3163
3167
|
if ($t(f))
|
|
3164
3168
|
return;
|
|
3165
3169
|
f.update(this);
|
|
3166
3170
|
} else if (!f.check(this)) {
|
|
3167
3171
|
if ($t(f))
|
|
3168
3172
|
return;
|
|
3169
|
-
e[a] = o = o._clone ? o._clone() : Vt(
|
|
3173
|
+
e[a] = o = o._clone ? o._clone() : Vt(we(o)), f = null, p = !0;
|
|
3170
3174
|
}
|
|
3171
3175
|
}
|
|
3172
3176
|
if (f)
|
|
3173
3177
|
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3174
3178
|
else {
|
|
3175
3179
|
const F = this.parseRule(o);
|
|
3176
|
-
f = new Ht(this, F,
|
|
3180
|
+
f = new Ht(this, F, g), this.bindParser(f);
|
|
3177
3181
|
}
|
|
3178
3182
|
[!1, !0].forEach((F) => this.parseEmit(f, F)), 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
3183
|
const y = f.loadChildrenPending();
|
|
@@ -3210,13 +3214,13 @@ function li(t) {
|
|
|
3210
3214
|
const n = [];
|
|
3211
3215
|
let o = !1;
|
|
3212
3216
|
return this.deferSyncValue(() => {
|
|
3213
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: p, child: d, ctrl:
|
|
3217
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: p, child: d, ctrl: g, method: y }) => {
|
|
3214
3218
|
if (a) {
|
|
3215
3219
|
l ? e.ctrlRule.push({
|
|
3216
3220
|
__ctrl: !0,
|
|
3217
3221
|
children: u,
|
|
3218
3222
|
valid: l
|
|
3219
|
-
}) :
|
|
3223
|
+
}) : g && e.ctrlRule.splice(e.ctrlRule.indexOf(g) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3220
3224
|
y === "disabled" || y === "enabled" ? this.api.disabled(!l, u) : y === "display" || y === "show" ? this.api.display(l, u) : y === "required" ? (u.forEach((C) => {
|
|
3221
3225
|
this.api.setEffect(C, "required", l);
|
|
3222
3226
|
}), l || this.api.clearValidateState(u)) : y === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
@@ -3235,8 +3239,8 @@ function li(t) {
|
|
|
3235
3239
|
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
3240
|
});
|
|
3237
3241
|
} else {
|
|
3238
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3239
|
-
const C = Q(
|
|
3242
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(g), 1);
|
|
3243
|
+
const C = Q(g);
|
|
3240
3244
|
C && C.rm();
|
|
3241
3245
|
}
|
|
3242
3246
|
});
|
|
@@ -3267,7 +3271,7 @@ function li(t) {
|
|
|
3267
3271
|
function ui(t) {
|
|
3268
3272
|
const e = Lt();
|
|
3269
3273
|
return Object.keys(e).forEach((r) => {
|
|
3270
|
-
|
|
3274
|
+
j(t, r) || k(t, r, e[r]);
|
|
3271
3275
|
}), t;
|
|
3272
3276
|
}
|
|
3273
3277
|
function fi(t) {
|
|
@@ -3307,7 +3311,7 @@ function hi(t) {
|
|
|
3307
3311
|
this.deferSyncValue(() => {
|
|
3308
3312
|
const i = e.getParentGroup(), s = i ? this.subRuleData[i.id] : null, n = {};
|
|
3309
3313
|
Object.keys(r || {}).forEach((o) => {
|
|
3310
|
-
s &&
|
|
3314
|
+
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
3315
|
}), Object.keys(n).length && this.api.setChildrenFormData(i.rule, n);
|
|
3312
3316
|
});
|
|
3313
3317
|
},
|
|
@@ -3321,7 +3325,7 @@ function hi(t) {
|
|
|
3321
3325
|
},
|
|
3322
3326
|
rmSubRuleData(e) {
|
|
3323
3327
|
const r = e.getParentGroup();
|
|
3324
|
-
r && this.subRuleData[r.id] &&
|
|
3328
|
+
r && this.subRuleData[r.id] && ie(this.subRuleData[r.id], e.field);
|
|
3325
3329
|
},
|
|
3326
3330
|
getFormData(e) {
|
|
3327
3331
|
return this.formData[e.id];
|
|
@@ -3331,13 +3335,13 @@ function hi(t) {
|
|
|
3331
3335
|
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
3336
|
let o = (this.fieldCtx[n] || []).filter((a) => !this.isIgnore(a))[0];
|
|
3333
3337
|
return o || (o = this.fieldCtx[n][0], i.push(n)), s[n] = Ae(o.rule, "value"), s;
|
|
3334
|
-
}, e), this.form =
|
|
3338
|
+
}, e), this.form = ne(e), this.ignoreFields = i, this.syncValue();
|
|
3335
3339
|
},
|
|
3336
3340
|
isIgnore(e) {
|
|
3337
3341
|
return e.rule.ignore === !0 || (e.rule.ignore === "hidden" || this.options.ignoreHiddenFields) && e.hasHidden();
|
|
3338
3342
|
},
|
|
3339
3343
|
appendValue(e) {
|
|
3340
|
-
(!e.field || !
|
|
3344
|
+
(!e.field || !j(this.appendData, e.field)) && !this.options.forceCoverValue || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
3341
3345
|
},
|
|
3342
3346
|
addSubForm(e, r) {
|
|
3343
3347
|
this.subForm[e.id] = r;
|
|
@@ -3390,7 +3394,7 @@ function hi(t) {
|
|
|
3390
3394
|
function bt(t, e) {
|
|
3391
3395
|
return typeof e == "function" ? "" + e : e;
|
|
3392
3396
|
}
|
|
3393
|
-
const
|
|
3397
|
+
const De = {
|
|
3394
3398
|
init(t) {
|
|
3395
3399
|
},
|
|
3396
3400
|
toFormValue(t, e) {
|
|
@@ -3409,7 +3413,7 @@ const je = {
|
|
|
3409
3413
|
},
|
|
3410
3414
|
mergeProp(t) {
|
|
3411
3415
|
}
|
|
3412
|
-
}, di = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"],
|
|
3416
|
+
}, di = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"], Ce = Symbol("oldValue");
|
|
3413
3417
|
function pi(t) {
|
|
3414
3418
|
_(t.prototype, {
|
|
3415
3419
|
getCtx(e) {
|
|
@@ -3445,7 +3449,7 @@ function pi(t) {
|
|
|
3445
3449
|
if (n)
|
|
3446
3450
|
return n;
|
|
3447
3451
|
}
|
|
3448
|
-
return r[e.originType] || r[J(e.type)] || r[e.trueType] ||
|
|
3452
|
+
return r[e.originType] || r[J(e.type)] || r[e.trueType] || De;
|
|
3449
3453
|
},
|
|
3450
3454
|
bindParser(e) {
|
|
3451
3455
|
e.setParser(this.getParser(e));
|
|
@@ -3458,7 +3462,7 @@ function pi(t) {
|
|
|
3458
3462
|
this.noWatchFn || (this.noWatchFn = e), O(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
3459
3463
|
},
|
|
3460
3464
|
watchCtx(e) {
|
|
3461
|
-
if (
|
|
3465
|
+
if (jt().filter((i) => i[0] !== "_" && i[0] !== "$" && di.indexOf(i) === -1).forEach((i) => {
|
|
3462
3466
|
const s = Ae(e.rule, i), n = i === "children";
|
|
3463
3467
|
e.refRule[i] = s, e.watch.push(L(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3464
3468
|
let l = s.value;
|
|
@@ -3539,12 +3543,12 @@ function pi(t) {
|
|
|
3539
3543
|
const a = i[s];
|
|
3540
3544
|
if (!a) return;
|
|
3541
3545
|
const l = this.compute(e, a);
|
|
3542
|
-
return a.linkage && l ===
|
|
3546
|
+
return (a.linkage || a.linkageVariable) && l === Ce ? Ce : l;
|
|
3543
3547
|
}), o = (a) => {
|
|
3544
|
-
s === "value" ? this.onInput(e, a) : s[0] === "$" ? this.api.setEffect(e.id, s, a) :
|
|
3548
|
+
s === "value" ? this.onInput(e, a) : s[0] === "$" ? this.api.setEffect(e.id, s, a) : oe(e.rule, s, a);
|
|
3545
3549
|
};
|
|
3546
3550
|
(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 ===
|
|
3551
|
+
a === Ce || a === l || setTimeout(() => {
|
|
3548
3552
|
o(a);
|
|
3549
3553
|
});
|
|
3550
3554
|
}, { deep: !0 }));
|
|
@@ -3674,22 +3678,22 @@ function pi(t) {
|
|
|
3674
3678
|
let u = !0;
|
|
3675
3679
|
for (let f = 0; f < a.group.length; f++) {
|
|
3676
3680
|
const p = a.group[f];
|
|
3677
|
-
let d,
|
|
3681
|
+
let d, g = null;
|
|
3678
3682
|
if (p.variable)
|
|
3679
|
-
|
|
3683
|
+
g = JSON.stringify(this.fc.getLoadData(p.variable)) || "";
|
|
3680
3684
|
else if (p.field)
|
|
3681
|
-
|
|
3685
|
+
g = dt(p.field || "");
|
|
3682
3686
|
else if (!p.mode)
|
|
3683
3687
|
return !0;
|
|
3684
3688
|
let y = p.compare;
|
|
3685
|
-
if (y && (y = dt(y || "")), p.mode ? d = n(p) : fe[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}'](${
|
|
3689
|
+
if (y && (y = dt(y || "")), p.mode ? d = n(p) : fe[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, fe, 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
3690
|
return !0;
|
|
3687
3691
|
l || (u = u && d);
|
|
3688
3692
|
}
|
|
3689
3693
|
return l ? !1 : u;
|
|
3690
3694
|
};
|
|
3691
3695
|
let o = n(r);
|
|
3692
|
-
return o = r.invert === !0 ? !o : o, r.linkage ? o ? O(() => this.computeValue(r.linkage, e, s), void 0) :
|
|
3696
|
+
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
3697
|
} else if (h.Function(r))
|
|
3694
3698
|
i = () => r(this.api.form, this.api);
|
|
3695
3699
|
else {
|
|
@@ -3724,9 +3728,9 @@ function pi(t) {
|
|
|
3724
3728
|
rmCtx(e) {
|
|
3725
3729
|
if (e.deleted) return;
|
|
3726
3730
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3727
|
-
|
|
3731
|
+
ie(this.ctxs, r), ie(this.formData, r), ie(this.subForm, r), ie(this.vm.ctxInject, r);
|
|
3728
3732
|
const o = e.getParentGroup();
|
|
3729
|
-
o && this.subRuleData[o.id] &&
|
|
3733
|
+
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
3734
|
if (!this.reloading) {
|
|
3731
3735
|
if (e.parser.loadChildren !== !1) {
|
|
3732
3736
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3761,12 +3765,12 @@ function mi(t) {
|
|
|
3761
3765
|
},
|
|
3762
3766
|
targetHook(e, r, i) {
|
|
3763
3767
|
var l, u, f, p;
|
|
3764
|
-
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (d,
|
|
3768
|
+
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (d, g) => {
|
|
3765
3769
|
d && (d = Array.isArray(d) ? d : [d], d.forEach((y) => {
|
|
3766
3770
|
O(() => y(q(v({}, i || {}), {
|
|
3767
3771
|
self: e.rule,
|
|
3768
3772
|
rule: e.rule,
|
|
3769
|
-
parent:
|
|
3773
|
+
parent: g == null ? void 0 : g.rule,
|
|
3770
3774
|
$f: this.api,
|
|
3771
3775
|
api: this.api,
|
|
3772
3776
|
option: this.vm.$props.option
|
|
@@ -3788,23 +3792,23 @@ function gi(t) {
|
|
|
3788
3792
|
const e = this.fc.providers;
|
|
3789
3793
|
Object.keys(e).forEach((r) => {
|
|
3790
3794
|
let i = e[r];
|
|
3791
|
-
h.Function(i) && (i = i(this.fc)), i._c = $i(i), this.onEffect(i), this.providers[r] = i;
|
|
3795
|
+
h.Function(i) && (i = i(this.fc)), i._c = $i(i), this.onEffect(i, r), this.providers[r] = i;
|
|
3792
3796
|
});
|
|
3793
3797
|
},
|
|
3794
|
-
onEffect(e) {
|
|
3795
|
-
const
|
|
3796
|
-
(e._c || ["*"]).forEach((
|
|
3797
|
-
const
|
|
3798
|
-
|
|
3799
|
-
e[
|
|
3798
|
+
onEffect(e, r) {
|
|
3799
|
+
const i = [];
|
|
3800
|
+
(e._c || ["*"]).forEach((s) => {
|
|
3801
|
+
const n = s === "*" ? "*" : this.getType(s);
|
|
3802
|
+
i.indexOf(n) > -1 || (i.push(n), this.bus.$on(`p:${r || e.name}:${n}:${e.input ? 1 : 0}`, (o, a) => {
|
|
3803
|
+
e[o] && e[o](...a);
|
|
3800
3804
|
}));
|
|
3801
|
-
}), e._used =
|
|
3805
|
+
}), e._used = i;
|
|
3802
3806
|
},
|
|
3803
3807
|
watchEffect(e) {
|
|
3804
3808
|
let r = {
|
|
3805
3809
|
required: () => {
|
|
3806
3810
|
var i, s;
|
|
3807
|
-
return (
|
|
3811
|
+
return (j(e.rule, "$required") ? e.rule.$required : (s = (i = e.rule) == null ? void 0 : i.effect) == null ? void 0 : s.required) || !1;
|
|
3808
3812
|
}
|
|
3809
3813
|
};
|
|
3810
3814
|
Object.keys(e.rule.effect || {}).forEach((i) => {
|
|
@@ -3834,9 +3838,9 @@ function gi(t) {
|
|
|
3834
3838
|
}, r);
|
|
3835
3839
|
},
|
|
3836
3840
|
getEffect(e, r) {
|
|
3837
|
-
if (
|
|
3841
|
+
if (j(e, "$" + r))
|
|
3838
3842
|
return e["$" + r];
|
|
3839
|
-
if (
|
|
3843
|
+
if (j(e, "effect") && j(e.effect, r))
|
|
3840
3844
|
return e.effect[r];
|
|
3841
3845
|
},
|
|
3842
3846
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
@@ -3853,7 +3857,7 @@ function gi(t) {
|
|
|
3853
3857
|
else
|
|
3854
3858
|
return;
|
|
3855
3859
|
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 = (
|
|
3860
|
+
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
3861
|
});
|
|
3858
3862
|
}
|
|
3859
3863
|
});
|
|
@@ -3879,7 +3883,7 @@ function X(t) {
|
|
|
3879
3883
|
return t.bus;
|
|
3880
3884
|
},
|
|
3881
3885
|
preview() {
|
|
3882
|
-
return t.vm.$
|
|
3886
|
+
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
3887
|
}
|
|
3884
3888
|
}), _(this, {
|
|
3885
3889
|
fc: t,
|
|
@@ -3890,10 +3894,10 @@ function X(t) {
|
|
|
3890
3894
|
noWatchFn: null,
|
|
3891
3895
|
deferSyncFn: null,
|
|
3892
3896
|
isMounted: !1,
|
|
3893
|
-
formData:
|
|
3894
|
-
subRuleData:
|
|
3897
|
+
formData: ne({}),
|
|
3898
|
+
subRuleData: ne({}),
|
|
3895
3899
|
subForm: {},
|
|
3896
|
-
form:
|
|
3900
|
+
form: ne({}),
|
|
3897
3901
|
appendData: {},
|
|
3898
3902
|
ignoreFields: [],
|
|
3899
3903
|
providers: {},
|
|
@@ -3924,7 +3928,7 @@ _(X.prototype, {
|
|
|
3924
3928
|
this.updateAppendData(), this.useProvider(), this.usePage(), this.loadRule(), this.$manager.__init(), this.lifecycle("created");
|
|
3925
3929
|
},
|
|
3926
3930
|
updateAppendData() {
|
|
3927
|
-
this.appendData = v(v(v({}, this.options.formData || {}), this.fc.vm.$
|
|
3931
|
+
this.appendData = v(v(v({}, this.options.formData || {}), this.fc.vm.$props.value || {}), this.appendData);
|
|
3928
3932
|
},
|
|
3929
3933
|
isBreakWatch() {
|
|
3930
3934
|
return this.loading || this.noWatchFn || this.reloading;
|
|
@@ -3974,22 +3978,24 @@ function _i() {
|
|
|
3974
3978
|
}
|
|
3975
3979
|
return _(e.prototype, {
|
|
3976
3980
|
setVm(r) {
|
|
3977
|
-
this.vm = r, this.h = this.$h = r.$createElement;
|
|
3981
|
+
this.handle = r, this.vm = r.vm, this.h = this.$h = r.vm.$createElement;
|
|
3978
3982
|
},
|
|
3979
3983
|
make(r, i, s) {
|
|
3980
3984
|
var n, o, a;
|
|
3981
3985
|
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
3986
|
},
|
|
3983
3987
|
makeComponent(r, i, s) {
|
|
3984
|
-
var
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3988
|
+
var a;
|
|
3989
|
+
const n = this.handle.fc.prop.components[r];
|
|
3990
|
+
n && (r = n);
|
|
3991
|
+
let o = this.$h(r, vi(i), s || []);
|
|
3992
|
+
if ((a = o == null ? void 0 : o.componentOptions) != null && a.propsData && (i != null && i.props)) {
|
|
3993
|
+
const l = Object.keys(o.componentOptions.propsData);
|
|
3994
|
+
o.data.attrs || (o.data.attrs = {}), Object.keys(i.props).forEach((u) => {
|
|
3995
|
+
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
3996
|
});
|
|
3991
3997
|
}
|
|
3992
|
-
return
|
|
3998
|
+
return o.context = this.vm, o;
|
|
3993
3999
|
},
|
|
3994
4000
|
aliasMap: t
|
|
3995
4001
|
}), _(e, {
|
|
@@ -4000,9 +4006,9 @@ function _i() {
|
|
|
4000
4006
|
use(r) {
|
|
4001
4007
|
Object.keys(r).forEach((i) => {
|
|
4002
4008
|
const s = be(i), n = At(i).toLocaleLowerCase(), o = r[i];
|
|
4003
|
-
[i, s, n].forEach((a) => {
|
|
4004
|
-
e.
|
|
4005
|
-
return this.make(
|
|
4009
|
+
e.alias(i, o), [i, s, n].forEach((a) => {
|
|
4010
|
+
e.prototype[a] = function(l, u) {
|
|
4011
|
+
return this.make(t[i] || a, l, u);
|
|
4006
4012
|
};
|
|
4007
4013
|
});
|
|
4008
4014
|
});
|
|
@@ -4088,13 +4094,13 @@ const wi = function(t) {
|
|
|
4088
4094
|
let l = (p) => {
|
|
4089
4095
|
let d;
|
|
4090
4096
|
i && i.__fc__ && (d = i.__fc__.getParentGroup());
|
|
4091
|
-
let
|
|
4092
|
-
a.template ?
|
|
4097
|
+
let g;
|
|
4098
|
+
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
4099
|
const y = a.modify ? i : r.getProp();
|
|
4094
|
-
a.to === "child" ? y.children ? k(y.children, 0,
|
|
4100
|
+
a.to === "child" ? y.children ? k(y.children, 0, g) : k(y, "children", [g]) : oe(y, a.to || "options", g), s.sync(i);
|
|
4095
4101
|
}, u = (p) => l(p);
|
|
4096
4102
|
const f = t.watchLoadData(u);
|
|
4097
|
-
l =
|
|
4103
|
+
l = se(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
4098
4104
|
}
|
|
4099
4105
|
}), this._fn[r.id] = o;
|
|
4100
4106
|
});
|
|
@@ -4118,13 +4124,13 @@ const wi = function(t) {
|
|
|
4118
4124
|
const l = n[a];
|
|
4119
4125
|
if (l) {
|
|
4120
4126
|
const u = typeof l == "object";
|
|
4121
|
-
let f = (
|
|
4122
|
-
let y = t.t(u ? l.attr : l, u ? l.params : null,
|
|
4127
|
+
let f = (g) => {
|
|
4128
|
+
let y = t.t(u ? l.attr : l, u ? l.params : null, g);
|
|
4123
4129
|
const C = u && l.modify ? i : r.getProp();
|
|
4124
|
-
a === "child" ? C.children ? k(C.children, 0, y) : k(C, "children", [y]) :
|
|
4125
|
-
}, p = (
|
|
4130
|
+
a === "child" ? C.children ? k(C.children, 0, y) : k(C, "children", [y]) : oe(C, a, y), s.sync(i);
|
|
4131
|
+
}, p = (g) => f(g);
|
|
4126
4132
|
const d = t.watchLoadData(p);
|
|
4127
|
-
f =
|
|
4133
|
+
f = se(f, l.wait || 300), l.watch !== !1 ? o.push(d) : d();
|
|
4128
4134
|
}
|
|
4129
4135
|
}), this._fn[r.id] = o;
|
|
4130
4136
|
},
|
|
@@ -4171,47 +4177,44 @@ const wi = function(t) {
|
|
|
4171
4177
|
let a = s.value;
|
|
4172
4178
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
4173
4179
|
const l = (p) => {
|
|
4174
|
-
p === void 0 ? s.clearProp() :
|
|
4180
|
+
p === void 0 ? s.clearProp() : oe(s.getProp(), a.to || "options", p), o.sync(n);
|
|
4175
4181
|
};
|
|
4176
4182
|
if (!a || !a.action && !a.key) {
|
|
4177
4183
|
l(void 0);
|
|
4178
4184
|
return;
|
|
4179
4185
|
}
|
|
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
|
-
}
|
|
4186
|
+
a = K(a), a.to || (a.to = "options");
|
|
4192
4187
|
const u = a.onError, f = () => {
|
|
4193
4188
|
if (!s.getValue())
|
|
4194
4189
|
return s.clearProp(), o.sync(n), !0;
|
|
4195
4190
|
};
|
|
4196
|
-
i._fn[s.id] = t.watchLoadData(
|
|
4191
|
+
i._fn[s.id] = t.watchLoadData(se((p, d) => {
|
|
4197
4192
|
if (d && a.watch === !1)
|
|
4198
4193
|
return i._fn[s.id]();
|
|
4199
|
-
|
|
4194
|
+
if (a.key) {
|
|
4195
|
+
const C = p("$globalData." + a.key);
|
|
4196
|
+
if (C) {
|
|
4197
|
+
if (f()) return;
|
|
4198
|
+
l(C);
|
|
4199
|
+
}
|
|
4200
|
+
return;
|
|
4201
|
+
}
|
|
4202
|
+
const g = t.$handle.loadFetchVar(K(a), p, n), y = q(v({
|
|
4200
4203
|
headers: {}
|
|
4201
|
-
},
|
|
4204
|
+
}, g), {
|
|
4202
4205
|
onSuccess(C, F) {
|
|
4203
4206
|
if (f()) return;
|
|
4204
|
-
let G = (N) => F ? N :
|
|
4205
|
-
const V = z(
|
|
4207
|
+
let G = (N) => F ? N : j(N, "data") ? N.data : N;
|
|
4208
|
+
const V = z(g.parse);
|
|
4206
4209
|
h.Function(V) ? G = V : V && h.String(V) && (G = (N) => B(N, V)), l(G(C, n, o));
|
|
4207
4210
|
},
|
|
4208
4211
|
onError(C) {
|
|
4209
|
-
l(void 0), !f() && (u || ((F) => et(F.message || "fetch fail " +
|
|
4212
|
+
l(void 0), !f() && (u || ((F) => et(F.message || "fetch fail " + g.action)))(C, n, o);
|
|
4210
4213
|
}
|
|
4211
4214
|
});
|
|
4212
4215
|
t.$handle.beforeFetch(y, { rule: n, api: o }).then(() => {
|
|
4213
|
-
if (h.Function(
|
|
4214
|
-
|
|
4216
|
+
if (h.Function(g.action)) {
|
|
4217
|
+
g.action(n, o).then((C) => {
|
|
4215
4218
|
y.onSuccess(C, !0);
|
|
4216
4219
|
}).catch((C) => {
|
|
4217
4220
|
y.onError(C);
|
|
@@ -4277,7 +4280,7 @@ const Si = "html", Ri = {
|
|
|
4277
4280
|
return Array.isArray(t) ? t.filter((e) => h.String(e)).join("") : "";
|
|
4278
4281
|
}
|
|
4279
4282
|
};
|
|
4280
|
-
function
|
|
4283
|
+
function ji(t) {
|
|
4281
4284
|
t = t + "=";
|
|
4282
4285
|
const r = decodeURIComponent(document.cookie).split(";");
|
|
4283
4286
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -4295,7 +4298,7 @@ function Di(t) {
|
|
|
4295
4298
|
}
|
|
4296
4299
|
return null;
|
|
4297
4300
|
}
|
|
4298
|
-
function
|
|
4301
|
+
function Di(t) {
|
|
4299
4302
|
const e = localStorage.getItem(t);
|
|
4300
4303
|
if (e)
|
|
4301
4304
|
try {
|
|
@@ -4323,10 +4326,10 @@ function it(t, e) {
|
|
|
4323
4326
|
return r.length ? i == null ? null : B(i, r) : i;
|
|
4324
4327
|
}
|
|
4325
4328
|
function Vi(t) {
|
|
4326
|
-
return it(
|
|
4329
|
+
return it(ji, t);
|
|
4327
4330
|
}
|
|
4328
4331
|
function Ii(t) {
|
|
4329
|
-
return it(
|
|
4332
|
+
return it(Di, t);
|
|
4330
4333
|
}
|
|
4331
4334
|
function Pi(t) {
|
|
4332
4335
|
return it(Ai, t);
|
|
@@ -4415,16 +4418,16 @@ function Kt(t) {
|
|
|
4415
4418
|
t.extendApi
|
|
4416
4419
|
], u = v({}, ki), f = Zr();
|
|
4417
4420
|
let p = { global: {} };
|
|
4418
|
-
const d = t.isMobile === !0,
|
|
4421
|
+
const d = t.isMobile === !0, g = ne({
|
|
4419
4422
|
$mobile: d
|
|
4420
4423
|
}), y = _i(), C = {}, F = {};
|
|
4421
4424
|
Mi(t.attrs || {});
|
|
4422
4425
|
function G(c) {
|
|
4423
|
-
const
|
|
4424
|
-
if (Array.isArray(
|
|
4425
|
-
return
|
|
4426
|
-
if (
|
|
4427
|
-
return
|
|
4426
|
+
const m = U[c];
|
|
4427
|
+
if (Array.isArray(m))
|
|
4428
|
+
return m.map(($) => $.api());
|
|
4429
|
+
if (m)
|
|
4430
|
+
return m.api();
|
|
4428
4431
|
}
|
|
4429
4432
|
function V(c) {
|
|
4430
4433
|
o.push(c);
|
|
@@ -4444,20 +4447,20 @@ function Kt(t) {
|
|
|
4444
4447
|
}
|
|
4445
4448
|
function de() {
|
|
4446
4449
|
const c = Ne(...arguments);
|
|
4447
|
-
if (!c.id || !c.prop) return
|
|
4448
|
-
const
|
|
4449
|
-
r[
|
|
4450
|
+
if (!c.id || !c.prop) return De;
|
|
4451
|
+
const m = J(c.id), $ = c.prop, b = $.merge === !0 ? r[m] : void 0;
|
|
4452
|
+
r[m] = Re($, b || De), f[m] = T(m), $.maker && _(f, $.maker);
|
|
4450
4453
|
}
|
|
4451
|
-
function E(c,
|
|
4454
|
+
function E(c, m) {
|
|
4452
4455
|
let $;
|
|
4453
4456
|
if (h.String(c)) {
|
|
4454
|
-
if ($ = c,
|
|
4457
|
+
if ($ = c, m === void 0)
|
|
4455
4458
|
return ["form-create", "formcreate"].indexOf($) > -1 ? S() : e[$];
|
|
4456
4459
|
} else
|
|
4457
|
-
$ = J(c.name),
|
|
4458
|
-
if (!$ || !
|
|
4460
|
+
$ = J(c.name), m = c;
|
|
4461
|
+
if (!$ || !m) return;
|
|
4459
4462
|
const b = J($);
|
|
4460
|
-
e[$] =
|
|
4463
|
+
e[$] = m, e[b] = m, delete y.aliasMap[$], delete y.aliasMap[b], delete r[$], delete r[b], m.formCreateParser && de($, m.formCreateParser);
|
|
4461
4464
|
}
|
|
4462
4465
|
function S() {
|
|
4463
4466
|
return zr(Te, e, i);
|
|
@@ -4465,18 +4468,18 @@ function Kt(t) {
|
|
|
4465
4468
|
function M() {
|
|
4466
4469
|
return Le;
|
|
4467
4470
|
}
|
|
4468
|
-
function pe(c,
|
|
4469
|
-
return h.Function(c.install) ? c.install(W,
|
|
4471
|
+
function pe(c, m) {
|
|
4472
|
+
return h.Function(c.install) ? c.install(W, m) : h.Function(c) && c(W, m), this;
|
|
4470
4473
|
}
|
|
4471
|
-
function W(c,
|
|
4472
|
-
let b = Ni(c,
|
|
4474
|
+
function W(c, m, $) {
|
|
4475
|
+
let b = Ni(c, m || {});
|
|
4473
4476
|
const w = b.$refs.fc.formCreate;
|
|
4474
4477
|
return w.$parent = $, Li(w.options).appendChild(b.$el), w.api();
|
|
4475
4478
|
}
|
|
4476
|
-
|
|
4479
|
+
Re(W, F);
|
|
4477
4480
|
function xt(c) {
|
|
4478
|
-
let
|
|
4479
|
-
return c ?
|
|
4481
|
+
let m = v({}, t);
|
|
4482
|
+
return c ? m.inherit = {
|
|
4480
4483
|
components: e,
|
|
4481
4484
|
parsers: r,
|
|
4482
4485
|
directives: i,
|
|
@@ -4485,53 +4488,53 @@ function Kt(t) {
|
|
|
4485
4488
|
useApps: o,
|
|
4486
4489
|
maker: f,
|
|
4487
4490
|
formulas: C,
|
|
4488
|
-
loadData:
|
|
4489
|
-
} : delete
|
|
4491
|
+
loadData: g
|
|
4492
|
+
} : delete m.inherit, Kt(m);
|
|
4490
4493
|
}
|
|
4491
|
-
function zt(c,
|
|
4492
|
-
s[c] =
|
|
4494
|
+
function zt(c, m) {
|
|
4495
|
+
s[c] = m;
|
|
4493
4496
|
}
|
|
4494
|
-
function Xt(c,
|
|
4495
|
-
C[c] =
|
|
4497
|
+
function Xt(c, m) {
|
|
4498
|
+
C[c] = m;
|
|
4496
4499
|
}
|
|
4497
|
-
function Zt(c,
|
|
4500
|
+
function Zt(c, m) {
|
|
4498
4501
|
const $ = n[c] || {}, b = $.parsers || {};
|
|
4499
|
-
|
|
4500
|
-
b[w] =
|
|
4501
|
-
}),
|
|
4502
|
+
m.parsers && Object.keys(m.parsers).forEach((w) => {
|
|
4503
|
+
b[w] = Re(m.parsers[w], De);
|
|
4504
|
+
}), m.name = c, n[c] = q(v(v({}, $), m), { parsers: b });
|
|
4502
4505
|
}
|
|
4503
|
-
function
|
|
4504
|
-
c && Object.keys(U).forEach((
|
|
4505
|
-
(Array.isArray(U[
|
|
4506
|
+
function Fe(c) {
|
|
4507
|
+
c && Object.keys(U).forEach((m) => {
|
|
4508
|
+
(Array.isArray(U[m]) ? U[m] : [U[m]]).forEach((b) => {
|
|
4506
4509
|
b.bus.$emit("$loadData." + c);
|
|
4507
4510
|
});
|
|
4508
4511
|
});
|
|
4509
4512
|
}
|
|
4510
|
-
function Pe(c,
|
|
4511
|
-
|
|
4513
|
+
function Pe(c, m) {
|
|
4514
|
+
oe(g, c, m), Fe(c);
|
|
4512
4515
|
}
|
|
4513
|
-
function
|
|
4514
|
-
const $ = (...b) => O(() =>
|
|
4516
|
+
function ke(c, m) {
|
|
4517
|
+
const $ = (...b) => O(() => m(...b));
|
|
4515
4518
|
$._driver = !0, Pe(c, $);
|
|
4516
4519
|
}
|
|
4517
|
-
function nt(c,
|
|
4520
|
+
function nt(c, m) {
|
|
4518
4521
|
const $ = (c || "").split(".");
|
|
4519
4522
|
c = $.shift();
|
|
4520
4523
|
const b = $.join(".");
|
|
4521
|
-
if (
|
|
4522
|
-
let w =
|
|
4523
|
-
return w && w._driver ? w = w(b) : $.length && (w = B(w, $)), w == null || w === "" ?
|
|
4524
|
+
if (j(g, c) || k(g, c, vt), g[c] !== vt) {
|
|
4525
|
+
let w = g[c];
|
|
4526
|
+
return w && w._driver ? w = w(b) : $.length && (w = B(w, $)), w == null || w === "" ? m : w;
|
|
4524
4527
|
} else
|
|
4525
|
-
return
|
|
4528
|
+
return m;
|
|
4526
4529
|
}
|
|
4527
4530
|
function Qt(c) {
|
|
4528
4531
|
l.push(c);
|
|
4529
4532
|
}
|
|
4530
4533
|
function Yt(c) {
|
|
4531
|
-
delete
|
|
4534
|
+
delete g[c], Fe(c);
|
|
4532
4535
|
}
|
|
4533
|
-
function er(c,
|
|
4534
|
-
a.push({ name: c, callback:
|
|
4536
|
+
function er(c, m) {
|
|
4537
|
+
a.push({ name: c, callback: m });
|
|
4535
4538
|
}
|
|
4536
4539
|
function Te(c) {
|
|
4537
4540
|
_(this, {
|
|
@@ -4544,9 +4547,9 @@ function Kt(t) {
|
|
|
4544
4547
|
modelFields: s,
|
|
4545
4548
|
formulas: C,
|
|
4546
4549
|
isMobile: d,
|
|
4547
|
-
rules: c.$
|
|
4548
|
-
name: c.$
|
|
4549
|
-
inFor: c.$
|
|
4550
|
+
rules: c.$props.rule,
|
|
4551
|
+
name: c.$props.name || Ve(),
|
|
4552
|
+
inFor: c.$props.inFor,
|
|
4550
4553
|
prop: {
|
|
4551
4554
|
components: e,
|
|
4552
4555
|
directives: i
|
|
@@ -4554,17 +4557,17 @@ function Kt(t) {
|
|
|
4554
4557
|
get: null,
|
|
4555
4558
|
drivers: n,
|
|
4556
4559
|
renderDriver: null,
|
|
4557
|
-
refreshData:
|
|
4558
|
-
loadData:
|
|
4560
|
+
refreshData: Fe,
|
|
4561
|
+
loadData: g,
|
|
4559
4562
|
CreateNode: y,
|
|
4560
4563
|
bus: new Ei(),
|
|
4561
4564
|
unwatch: [],
|
|
4562
4565
|
options: mr({}),
|
|
4563
4566
|
extendApiFn: l,
|
|
4564
4567
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4565
|
-
tmpData:
|
|
4566
|
-
}), a.forEach((
|
|
4567
|
-
this.bus.$on(
|
|
4568
|
+
tmpData: ne({})
|
|
4569
|
+
}), a.forEach((m) => {
|
|
4570
|
+
this.bus.$on(m.name, m.callback);
|
|
4568
4571
|
}), P(() => {
|
|
4569
4572
|
L(this.options, () => {
|
|
4570
4573
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
@@ -4575,55 +4578,55 @@ function Kt(t) {
|
|
|
4575
4578
|
init() {
|
|
4576
4579
|
this.isSub() && this.unwatch.push(L(() => this.vm.parent.fc.options.value, () => {
|
|
4577
4580
|
this.initOptions(), this.$handle.api.refresh();
|
|
4578
|
-
}, { deep: !0, flush: "sync" })), this.vm.$
|
|
4581
|
+
}, { 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
4582
|
},
|
|
4580
|
-
targetFormDriver(c, ...
|
|
4581
|
-
if (this.renderDriver && this.renderDriver[c])
|
|
4582
|
-
return O(() => this.renderDriver[c](...
|
|
4583
|
+
targetFormDriver(c, ...m) {
|
|
4584
|
+
if (this.bus.$emit(c, ...m), this.renderDriver && this.renderDriver[c])
|
|
4585
|
+
return O(() => this.renderDriver[c](...m));
|
|
4583
4586
|
},
|
|
4584
|
-
t(c,
|
|
4587
|
+
t(c, m, $) {
|
|
4585
4588
|
let b = $ ? $("$t." + c) : this.globalLanguageDriver(c);
|
|
4586
|
-
return b == null && (b = ""), b &&
|
|
4587
|
-
const
|
|
4588
|
-
b = b.replace(
|
|
4589
|
+
return b == null && (b = ""), b && m && Object.keys(m).forEach((w) => {
|
|
4590
|
+
const D = new RegExp(`{${w}}`, "g");
|
|
4591
|
+
b = b.replace(D, m[w]);
|
|
4589
4592
|
}), b;
|
|
4590
4593
|
},
|
|
4591
4594
|
globalDataDriver(c) {
|
|
4592
|
-
let
|
|
4593
|
-
const $ =
|
|
4595
|
+
let m = c.split(".");
|
|
4596
|
+
const $ = m.shift(), b = this.options.value.globalData && this.options.value.globalData[$];
|
|
4594
4597
|
if (b) {
|
|
4595
4598
|
if (b.type === "static")
|
|
4596
|
-
return B(b.data,
|
|
4599
|
+
return B(b.data, m);
|
|
4597
4600
|
{
|
|
4598
4601
|
let w;
|
|
4599
|
-
const
|
|
4600
|
-
if (
|
|
4601
|
-
if (
|
|
4602
|
+
const D = this.fetchCache.get(b);
|
|
4603
|
+
if (D) {
|
|
4604
|
+
if (D.status && (w = B(D.data, m)), !D.loading)
|
|
4602
4605
|
return w;
|
|
4603
|
-
|
|
4606
|
+
D.loading = !1, this.fetchCache.set(b, D);
|
|
4604
4607
|
} else
|
|
4605
4608
|
this.fetchCache.set(b, { status: !1 });
|
|
4606
|
-
const R =
|
|
4607
|
-
|
|
4609
|
+
const R = se(() => {
|
|
4610
|
+
te();
|
|
4608
4611
|
const x = this.fetchCache.get(b);
|
|
4609
4612
|
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
4613
|
}, b.wait || 600), ve = (x) => {
|
|
4611
4614
|
this.fetchCache.set(b, { status: !0, data: x }), this.bus.$emit("$loadData.$globalData." + $);
|
|
4612
|
-
},
|
|
4615
|
+
}, ae = (x, le) => {
|
|
4613
4616
|
if (le && b.watch === !1)
|
|
4614
|
-
return
|
|
4617
|
+
return te();
|
|
4615
4618
|
if (le) {
|
|
4616
4619
|
R();
|
|
4617
4620
|
return;
|
|
4618
4621
|
}
|
|
4619
4622
|
const me = this.$handle.loadFetchVar(Je(b), x);
|
|
4620
|
-
this.$handle.api.fetch(me).then((
|
|
4621
|
-
ve(
|
|
4622
|
-
}).catch((
|
|
4623
|
+
this.$handle.api.fetch(me).then((re) => {
|
|
4624
|
+
ve(re);
|
|
4625
|
+
}).catch((re) => {
|
|
4623
4626
|
ve(null);
|
|
4624
4627
|
});
|
|
4625
|
-
},
|
|
4626
|
-
return this.unwatch.push(
|
|
4628
|
+
}, te = this.watchLoadData(ae);
|
|
4629
|
+
return b.watch === !1 && te(), this.unwatch.push(te), w;
|
|
4627
4630
|
}
|
|
4628
4631
|
}
|
|
4629
4632
|
},
|
|
@@ -4632,28 +4635,28 @@ function Kt(t) {
|
|
|
4632
4635
|
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4633
4636
|
},
|
|
4634
4637
|
globalLanguageDriver(c) {
|
|
4635
|
-
let
|
|
4636
|
-
if (
|
|
4637
|
-
const w = this.options.value.language || {},
|
|
4638
|
-
b = B(w[
|
|
4638
|
+
let m = this.vm.top.$props.t, $ = this.vm.top.$props.locale, b;
|
|
4639
|
+
if (m && (b = O(() => m(c))), b == null && $ && typeof $ == "object" && (b = B($, c)), b == null) {
|
|
4640
|
+
const w = this.options.value.language || {}, D = this.getLocale();
|
|
4641
|
+
b = B(w[D] || {}, c), b == null && (b = B(Ti[D] || {}, c));
|
|
4639
4642
|
}
|
|
4640
4643
|
return b;
|
|
4641
4644
|
},
|
|
4642
4645
|
globalVarDriver(c) {
|
|
4643
|
-
let
|
|
4644
|
-
const $ =
|
|
4646
|
+
let m = c.split(".");
|
|
4647
|
+
const $ = m.shift(), b = this.options.value.globalVariable && this.options.value.globalVariable[$];
|
|
4645
4648
|
if (b) {
|
|
4646
4649
|
const w = h.Function(b) ? b : z(b.handle);
|
|
4647
4650
|
if (w) {
|
|
4648
|
-
let
|
|
4649
|
-
return B(
|
|
4651
|
+
let D = w((...R) => this.$handle.api.getData(...R), this.$handle.api);
|
|
4652
|
+
return B(D, m);
|
|
4650
4653
|
}
|
|
4651
4654
|
}
|
|
4652
4655
|
},
|
|
4653
|
-
setData(c,
|
|
4654
|
-
$ ? Pe(c,
|
|
4656
|
+
setData(c, m, $) {
|
|
4657
|
+
$ ? Pe(c, m) : (oe(this.vm.top.fc.tmpData, c, m), this.bus.$emit("$loadData." + c));
|
|
4655
4658
|
},
|
|
4656
|
-
getLoadData(c,
|
|
4659
|
+
getLoadData(c, m) {
|
|
4657
4660
|
let $ = null;
|
|
4658
4661
|
if (c != null) {
|
|
4659
4662
|
let b = c.split(".");
|
|
@@ -4683,38 +4686,38 @@ function Kt(t) {
|
|
|
4683
4686
|
}
|
|
4684
4687
|
$ && b.length && ($ = B($, b));
|
|
4685
4688
|
}
|
|
4686
|
-
return $ == null || $ === "" ?
|
|
4689
|
+
return $ == null || $ === "" ? m : $;
|
|
4687
4690
|
},
|
|
4688
|
-
watchLoadData(c,
|
|
4691
|
+
watchLoadData(c, m) {
|
|
4689
4692
|
let $ = {};
|
|
4690
4693
|
const b = (R) => {
|
|
4691
4694
|
this.get || (this.get = w), O(() => {
|
|
4692
4695
|
c(w, R);
|
|
4693
4696
|
}), this.get === w && (this.get = void 0);
|
|
4694
4697
|
}, w = (R, ve) => {
|
|
4695
|
-
let
|
|
4696
|
-
if (typeof R == "object" && (
|
|
4698
|
+
let ae;
|
|
4699
|
+
if (typeof R == "object" && (ae = R.getValue, R = R.id), $[R])
|
|
4697
4700
|
return $[R].val;
|
|
4698
|
-
const
|
|
4699
|
-
const ue =
|
|
4701
|
+
const te = ye(() => ae ? ae() : this.getLoadData(R, ve)), x = R.split("."), le = x.shift(), me = x.shift() || "", re = se(() => {
|
|
4702
|
+
const ue = ae ? ae() : this.getLoadData(R, ve);
|
|
4700
4703
|
if ($[R])
|
|
4701
4704
|
((ue instanceof Function || h.Object(ue) || Array.isArray(ue)) && ue === $[R].val || JSON.stringify(ue) !== JSON.stringify($[R].val)) && ($[R].val = ue, b(!0));
|
|
4702
4705
|
else return;
|
|
4703
|
-
},
|
|
4704
|
-
|
|
4706
|
+
}, m || 0), rr = L(te, (ue) => {
|
|
4707
|
+
re();
|
|
4705
4708
|
});
|
|
4706
|
-
return this.bus.$on("$loadData." + le,
|
|
4709
|
+
return this.bus.$on("$loadData." + le, re), me && this.bus.$on("$loadData." + le + "." + me, re), $[R] = {
|
|
4707
4710
|
fn: () => {
|
|
4708
|
-
this.bus.$off("$loadData." + le,
|
|
4711
|
+
this.bus.$off("$loadData." + le, re), me && this.bus.$off("$loadData." + le + "." + me, re), rr();
|
|
4709
4712
|
},
|
|
4710
|
-
val:
|
|
4711
|
-
},
|
|
4713
|
+
val: te.value
|
|
4714
|
+
}, te.value;
|
|
4712
4715
|
};
|
|
4713
4716
|
b(!1);
|
|
4714
|
-
const
|
|
4717
|
+
const D = () => {
|
|
4715
4718
|
Object.keys($).forEach((R) => $[R].fn()), $ = {};
|
|
4716
4719
|
};
|
|
4717
|
-
return this.unwatch.push(
|
|
4720
|
+
return this.unwatch.push(D), D;
|
|
4718
4721
|
},
|
|
4719
4722
|
isSub() {
|
|
4720
4723
|
return this.vm.parent && this.vm.extendOption;
|
|
@@ -4728,12 +4731,15 @@ function Kt(t) {
|
|
|
4728
4731
|
globalEvent: {},
|
|
4729
4732
|
globalData: {}
|
|
4730
4733
|
}, K(p));
|
|
4731
|
-
|
|
4734
|
+
const m = this.isSub();
|
|
4735
|
+
m && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$props.option || {});
|
|
4736
|
+
const $ = this.api();
|
|
4737
|
+
this.targetFormDriver("initOptions", c, { api: $, isSubForm: m }), this.updateOptions(c);
|
|
4732
4738
|
},
|
|
4733
|
-
mergeOptions(c,
|
|
4734
|
-
return
|
|
4735
|
-
delete
|
|
4736
|
-
}),
|
|
4739
|
+
mergeOptions(c, m, $) {
|
|
4740
|
+
return m = v({}, m || {}), $ && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4741
|
+
delete m[b];
|
|
4742
|
+
}), m.global && (c.global = Kr(c.global, m.global), delete m.global), this.$handle.$manager.mergeOptions([m], c), c;
|
|
4737
4743
|
},
|
|
4738
4744
|
updateOptions(c) {
|
|
4739
4745
|
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
@@ -4769,10 +4775,10 @@ function Kt(t) {
|
|
|
4769
4775
|
isMobile: d,
|
|
4770
4776
|
extendApi: Qt,
|
|
4771
4777
|
getData: nt,
|
|
4772
|
-
setDataDriver:
|
|
4778
|
+
setDataDriver: ke,
|
|
4773
4779
|
setData: Pe,
|
|
4774
4780
|
removeData: Yt,
|
|
4775
|
-
refreshData:
|
|
4781
|
+
refreshData: Fe,
|
|
4776
4782
|
maker: f,
|
|
4777
4783
|
component: E,
|
|
4778
4784
|
directive: N,
|
|
@@ -4792,7 +4798,7 @@ function Kt(t) {
|
|
|
4792
4798
|
$form: S,
|
|
4793
4799
|
parseFn: z,
|
|
4794
4800
|
parseJson: Vt,
|
|
4795
|
-
toJson:
|
|
4801
|
+
toJson: we,
|
|
4796
4802
|
useApp: V,
|
|
4797
4803
|
getApi: G,
|
|
4798
4804
|
on: er
|
|
@@ -4801,26 +4807,26 @@ function Kt(t) {
|
|
|
4801
4807
|
function tr(c) {
|
|
4802
4808
|
_(c, {
|
|
4803
4809
|
create: W,
|
|
4804
|
-
install(
|
|
4805
|
-
if (p = v(v({}, p), $ || {}),
|
|
4806
|
-
|
|
4807
|
-
const b = function(
|
|
4808
|
-
return W(
|
|
4810
|
+
install(m, $) {
|
|
4811
|
+
if (p = v(v({}, p), $ || {}), m._installedFormCreate === !0) return;
|
|
4812
|
+
m._installedFormCreate = !0;
|
|
4813
|
+
const b = function(D, R = {}) {
|
|
4814
|
+
return W(D, R, this);
|
|
4809
4815
|
};
|
|
4810
|
-
st(b),
|
|
4816
|
+
st(b), m.prototype.$formCreate = b;
|
|
4811
4817
|
const w = S();
|
|
4812
|
-
|
|
4813
|
-
O(() =>
|
|
4818
|
+
m.component(w.name, w), m.component("FcFragment", M()), o.forEach((D) => {
|
|
4819
|
+
O(() => D(c, m));
|
|
4814
4820
|
});
|
|
4815
4821
|
}
|
|
4816
4822
|
});
|
|
4817
4823
|
}
|
|
4818
|
-
if (st(F), tr(F),
|
|
4824
|
+
if (st(F), tr(F), ke("$cookie", Vi), ke("$localStorage", Ii), ke("$sessionStorage", Pi), y.use({ fragment: "fcFragment" }), t.install && W.use(t), de(Ri), t.inherit) {
|
|
4819
4825
|
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 && _(
|
|
4826
|
+
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
4827
|
}
|
|
4822
|
-
const
|
|
4823
|
-
return
|
|
4828
|
+
const Ee = S();
|
|
4829
|
+
return Re(Ee, F), Object.defineProperties(Ee, {
|
|
4824
4830
|
fetch: {
|
|
4825
4831
|
get() {
|
|
4826
4832
|
return F.fetch;
|
|
@@ -4829,7 +4835,7 @@ function Kt(t) {
|
|
|
4829
4835
|
F.fetch = c;
|
|
4830
4836
|
}
|
|
4831
4837
|
}
|
|
4832
|
-
}),
|
|
4838
|
+
}), Ee.util = F, Ee;
|
|
4833
4839
|
}
|
|
4834
4840
|
const _t = {
|
|
4835
4841
|
date: "yyyy-MM-dd",
|
|
@@ -4977,13 +4983,13 @@ function Yi(t) {
|
|
|
4977
4983
|
return t.type === "tooltip";
|
|
4978
4984
|
}
|
|
4979
4985
|
function Ot(t, e) {
|
|
4980
|
-
|
|
4986
|
+
j(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4981
4987
|
}
|
|
4982
4988
|
function Z(t) {
|
|
4983
4989
|
return t === !1;
|
|
4984
4990
|
}
|
|
4985
4991
|
function en(t, e) {
|
|
4986
|
-
|
|
4992
|
+
j(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4987
4993
|
}
|
|
4988
4994
|
function He(t) {
|
|
4989
4995
|
const e = v({}, t);
|
|
@@ -5082,12 +5088,12 @@ const tn = {
|
|
|
5082
5088
|
return !(!e.title && !e.native || Z(e.show));
|
|
5083
5089
|
},
|
|
5084
5090
|
makeInfo(t, e, r) {
|
|
5085
|
-
var f, p, d,
|
|
5091
|
+
var f, p, d, g, y, C;
|
|
5086
5092
|
const i = v({}, t.title), s = v({}, t.info), n = Yi(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
|
|
5087
5093
|
title: (p = (f = r.refRule) == null ? void 0 : f.__$title) == null ? void 0 : p.value,
|
|
5088
5094
|
rule: r.rule,
|
|
5089
5095
|
options: this.options
|
|
5090
|
-
}) : ((
|
|
5096
|
+
}) : ((g = (d = r.refRule) == null ? void 0 : d.__$title) == null ? void 0 : g.value) + (o.labelSuffix || o["label-suffix"] || "")];
|
|
5091
5097
|
if (!Z(s.show) && (s.info || s.native) && !Z(s.icon)) {
|
|
5092
5098
|
const F = {
|
|
5093
5099
|
type: s.type || "popover",
|
|
@@ -5097,7 +5103,7 @@ const tn = {
|
|
|
5097
5103
|
};
|
|
5098
5104
|
delete F.props.icon, delete F.props.show, delete F.props.info, delete F.props.align, delete F.props.native;
|
|
5099
5105
|
const G = "content";
|
|
5100
|
-
s.info && !
|
|
5106
|
+
s.info && !j(F.props, G) && (F.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, F]), [
|
|
5101
5107
|
this.$r({
|
|
5102
5108
|
type: "i",
|
|
5103
5109
|
slot: n ? "default" : "reference",
|
|
@@ -5365,7 +5371,7 @@ function fn(t) {
|
|
|
5365
5371
|
function cn() {
|
|
5366
5372
|
return Kt({
|
|
5367
5373
|
ui: "element-ui",
|
|
5368
|
-
version: "2.7.
|
|
5374
|
+
version: "2.7.15",
|
|
5369
5375
|
manager: tn,
|
|
5370
5376
|
extendApi: ln,
|
|
5371
5377
|
install: fn,
|