@form-create/element-ui 2.7.24 → 2.7.25
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 +90 -89
- 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.25
|
|
4
4
|
* (c) 2018-2026 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
@@ -942,7 +942,7 @@ function Fe(t, e = {}, r) {
|
|
|
942
942
|
}
|
|
943
943
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function Y(t) {
|
|
946
946
|
return Fe({}, { value: t }).value;
|
|
947
947
|
}
|
|
948
948
|
const Br = Object.assign || function(t) {
|
|
@@ -1004,7 +1004,7 @@ function Oe(t, e) {
|
|
|
1004
1004
|
function Le(t) {
|
|
1005
1005
|
return new Function("return " + t)();
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1007
|
+
function z(t, e) {
|
|
1008
1008
|
if (t && h.String(t) && t.length > 4) {
|
|
1009
1009
|
let r = t.trim(), i = !1;
|
|
1010
1010
|
try {
|
|
@@ -1047,7 +1047,7 @@ err: ${s}`);
|
|
|
1047
1047
|
}
|
|
1048
1048
|
function St(t, e) {
|
|
1049
1049
|
return JSON.parse(t, function(r, i) {
|
|
1050
|
-
return h.Undef(i) || !i.indexOf ? i :
|
|
1050
|
+
return h.Undef(i) || !i.indexOf ? i : z(i, e);
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
1053
1053
|
let qr = 0;
|
|
@@ -1149,7 +1149,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1149
1149
|
const n = i.$f.formData();
|
|
1150
1150
|
i.$f.once("reloading", () => {
|
|
1151
1151
|
i.$f.setValue(n);
|
|
1152
|
-
}), i.rule =
|
|
1152
|
+
}), i.rule = Y(t);
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
1155
|
});
|
|
@@ -1214,7 +1214,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1214
1214
|
};
|
|
1215
1215
|
if (this.defaultValue) {
|
|
1216
1216
|
i.formData || (i.formData = {});
|
|
1217
|
-
const s =
|
|
1217
|
+
const s = Y(this.defaultValue);
|
|
1218
1218
|
C(i.formData, this.field ? {
|
|
1219
1219
|
[this.field]: s
|
|
1220
1220
|
} : s);
|
|
@@ -1241,7 +1241,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1241
1241
|
if (this.disabled || this.onBeforeAdd(this.value) === !1)
|
|
1242
1242
|
return;
|
|
1243
1243
|
const e = [...this.value];
|
|
1244
|
-
e.push(this.defaultValue ?
|
|
1244
|
+
e.push(this.defaultValue ? Y(this.defaultValue) : this.field ? null : {}), this.input(e);
|
|
1245
1245
|
},
|
|
1246
1246
|
del(t, e) {
|
|
1247
1247
|
if (this.disabled)
|
|
@@ -1464,13 +1464,13 @@ const Ur = "fcGroup", Hr = {
|
|
|
1464
1464
|
Tr,
|
|
1465
1465
|
Hr,
|
|
1466
1466
|
Jr
|
|
1467
|
-
], jt = ["attrs", "props", "domProps", "scopedSlots"], Dt = ["class", "style", "directives"], Vt = ["on", "nativeOn", "hook"],
|
|
1467
|
+
], jt = ["attrs", "props", "domProps", "scopedSlots"], Dt = ["class", "style", "directives"], Vt = ["on", "nativeOn", "hook"], Q = (t, e = {}, r = {}) => {
|
|
1468
1468
|
const i = [...jt, ...r.normal || []], s = [...Dt, ...r.array || []], n = [...Vt, ...r.functional || []], o = r.props || [];
|
|
1469
1469
|
return t.reduce((a, l) => {
|
|
1470
1470
|
for (const u in l)
|
|
1471
1471
|
if (a[u])
|
|
1472
1472
|
if (o.indexOf(u) > -1)
|
|
1473
|
-
a[u] =
|
|
1473
|
+
a[u] = Q([l[u]], a[u]);
|
|
1474
1474
|
else if (i.indexOf(u) > -1)
|
|
1475
1475
|
a[u] = _(_({}, a[u]), l[u]);
|
|
1476
1476
|
else if (s.indexOf(u) > -1) {
|
|
@@ -1513,7 +1513,7 @@ function Tt(t, e) {
|
|
|
1513
1513
|
return Fe([], [...t], e || !1);
|
|
1514
1514
|
}
|
|
1515
1515
|
function ee(t, e) {
|
|
1516
|
-
return
|
|
1516
|
+
return Q(Array.isArray(e) ? e : [e], t, { array: et, normal: tt }), t;
|
|
1517
1517
|
}
|
|
1518
1518
|
function ht(t) {
|
|
1519
1519
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
@@ -1531,7 +1531,7 @@ function Bt(t, e) {
|
|
|
1531
1531
|
}
|
|
1532
1532
|
}, r), {}));
|
|
1533
1533
|
}
|
|
1534
|
-
function
|
|
1534
|
+
function Z(t) {
|
|
1535
1535
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1536
1536
|
}
|
|
1537
1537
|
function O(t, e) {
|
|
@@ -1764,8 +1764,8 @@ function Zr(t, e, r) {
|
|
|
1764
1764
|
const S = s.option && s.option.globalClass || {};
|
|
1765
1765
|
Object.keys(S).forEach((M) => {
|
|
1766
1766
|
let ge = "";
|
|
1767
|
-
S[M].style && Object.keys(S[M].style).forEach((
|
|
1768
|
-
ge += ve(
|
|
1767
|
+
S[M].style && Object.keys(S[M].style).forEach((K) => {
|
|
1768
|
+
ge += ve(K) + ":" + S[M].style[K] + ";";
|
|
1769
1769
|
}), S[M].content && (ge += S[M].content + ";"), ge && (E += `.${M}{${ge}}`);
|
|
1770
1770
|
}), s.option && s.option.style && (E += s.option.style), A || (A = document.createElement("style"), A.type = "text/css", document.head.appendChild(A)), A.innerHTML = E || "";
|
|
1771
1771
|
}, () => {
|
|
@@ -1933,7 +1933,7 @@ function yt(t, e, r) {
|
|
|
1933
1933
|
(e || Ut)(q(_({}, t), {
|
|
1934
1934
|
onSuccess(n) {
|
|
1935
1935
|
let o = (l) => l;
|
|
1936
|
-
const a =
|
|
1936
|
+
const a = z(t.parse);
|
|
1937
1937
|
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => B(l, a)), Ae(o(n, t.targetRule, r)).then((l) => {
|
|
1938
1938
|
i(l);
|
|
1939
1939
|
});
|
|
@@ -1945,7 +1945,7 @@ function yt(t, e, r) {
|
|
|
1945
1945
|
});
|
|
1946
1946
|
}
|
|
1947
1947
|
function _e(t) {
|
|
1948
|
-
return
|
|
1948
|
+
return Y(t);
|
|
1949
1949
|
}
|
|
1950
1950
|
function ti(t) {
|
|
1951
1951
|
function e(n) {
|
|
@@ -2075,7 +2075,7 @@ function ti(t) {
|
|
|
2075
2075
|
}, !0), o ? o.origin : void 0;
|
|
2076
2076
|
},
|
|
2077
2077
|
removeRule(n) {
|
|
2078
|
-
const o = n &&
|
|
2078
|
+
const o = n && Z(n);
|
|
2079
2079
|
if (o)
|
|
2080
2080
|
return o.rm(), o.origin;
|
|
2081
2081
|
},
|
|
@@ -2164,7 +2164,7 @@ function ti(t) {
|
|
|
2164
2164
|
n.forEach((a) => s.sync(a));
|
|
2165
2165
|
return;
|
|
2166
2166
|
}
|
|
2167
|
-
let o = h.Object(n) ?
|
|
2167
|
+
let o = h.Object(n) ? Z(n) : t.getCtxs(n);
|
|
2168
2168
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2169
2169
|
if (!a.deleted) {
|
|
2170
2170
|
const l = t.subForm[a.id];
|
|
@@ -2301,7 +2301,7 @@ function ti(t) {
|
|
|
2301
2301
|
return o ? t.subForm[o.id] : void 0;
|
|
2302
2302
|
},
|
|
2303
2303
|
getChildrenRuleList(n) {
|
|
2304
|
-
const o = typeof n == "object", a = o ?
|
|
2304
|
+
const o = typeof n == "object", a = o ? Z(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
|
|
2305
2305
|
if (!l)
|
|
2306
2306
|
return [];
|
|
2307
2307
|
const u = [];
|
|
@@ -2312,10 +2312,10 @@ function ti(t) {
|
|
|
2312
2312
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2313
2313
|
},
|
|
2314
2314
|
getParentRule(n) {
|
|
2315
|
-
return (typeof n == "object" ?
|
|
2315
|
+
return (typeof n == "object" ? Z(n) : t.getCtx(n)).parent.rule;
|
|
2316
2316
|
},
|
|
2317
2317
|
getParentSubRule(n) {
|
|
2318
|
-
const a = typeof n == "object" ?
|
|
2318
|
+
const a = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2319
2319
|
if (a) {
|
|
2320
2320
|
const l = a.getParentGroup();
|
|
2321
2321
|
if (l)
|
|
@@ -2336,7 +2336,7 @@ function ti(t) {
|
|
|
2336
2336
|
getGlobalEvent(n) {
|
|
2337
2337
|
let o = s.options.globalEvent[n];
|
|
2338
2338
|
if (o)
|
|
2339
|
-
return typeof o == "object" && (o = o.handle),
|
|
2339
|
+
return typeof o == "object" && (o = o.handle), z(o);
|
|
2340
2340
|
},
|
|
2341
2341
|
getGlobalData(n) {
|
|
2342
2342
|
return new Promise((o, a) => {
|
|
@@ -2360,11 +2360,11 @@ function ti(t) {
|
|
|
2360
2360
|
s.setData("$var." + n, o);
|
|
2361
2361
|
},
|
|
2362
2362
|
renderRule(n, o, a) {
|
|
2363
|
-
const u = typeof n == "object" ?
|
|
2363
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2364
2364
|
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2365
2365
|
},
|
|
2366
2366
|
renderChildren(n, o, a) {
|
|
2367
|
-
const u = typeof n == "object" ?
|
|
2367
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2368
2368
|
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2369
2369
|
},
|
|
2370
2370
|
nextTick(n) {
|
|
@@ -2386,22 +2386,23 @@ function ti(t) {
|
|
|
2386
2386
|
},
|
|
2387
2387
|
fetch(n) {
|
|
2388
2388
|
return new Promise((o, a) => {
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2389
|
+
let l = _({}, n);
|
|
2390
|
+
l = t.loadFetchVar(l);
|
|
2391
|
+
const u = (f) => {
|
|
2392
|
+
O(() => l.onError && l.onError(f)), a(f);
|
|
2392
2393
|
};
|
|
2393
|
-
t.beforeFetch(
|
|
2394
|
-
O(() =>
|
|
2395
|
-
}).catch((
|
|
2396
|
-
|
|
2397
|
-
})).catch((
|
|
2398
|
-
|
|
2394
|
+
t.beforeFetch(l).then(() => yt(l, t.fc.create.fetch, s).then((f) => {
|
|
2395
|
+
O(() => l.onSuccess && l.onSuccess(f)), o(f);
|
|
2396
|
+
}).catch((f) => {
|
|
2397
|
+
u(f);
|
|
2398
|
+
})).catch((f) => {
|
|
2399
|
+
u(f);
|
|
2399
2400
|
});
|
|
2400
2401
|
});
|
|
2401
2402
|
},
|
|
2402
2403
|
watchFetch(n, o, a, l) {
|
|
2403
2404
|
return t.fc.watchLoadData((u, f) => {
|
|
2404
|
-
let p =
|
|
2405
|
+
let p = _({}, n);
|
|
2405
2406
|
p = t.loadFetchVar(p, u);
|
|
2406
2407
|
const d = (m) => {
|
|
2407
2408
|
O(() => p.onError && p.onError(m)), a && a(m);
|
|
@@ -2704,7 +2705,7 @@ function ii(t) {
|
|
|
2704
2705
|
}
|
|
2705
2706
|
});
|
|
2706
2707
|
}
|
|
2707
|
-
return
|
|
2708
|
+
return Q(a, e.prop), e.prop;
|
|
2708
2709
|
},
|
|
2709
2710
|
onMounted(e) {
|
|
2710
2711
|
e.el = this.vm.$refs[e.ref], e.el && ((e.el.$el || e.el).__rule__ = e.rule), e.parser.mounted(e), this.$handle.effect(e, "mounted"), this.$handle.targetHook(e, "mounted");
|
|
@@ -2811,7 +2812,7 @@ function si(t) {
|
|
|
2811
2812
|
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2812
2813
|
return this.parseEventLst(e, r, i, !0);
|
|
2813
2814
|
if (h.String(r)) {
|
|
2814
|
-
const n =
|
|
2815
|
+
const n = z(r);
|
|
2815
2816
|
if (n && r !== n)
|
|
2816
2817
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2817
2818
|
}
|
|
@@ -2895,7 +2896,7 @@ function si(t) {
|
|
|
2895
2896
|
},
|
|
2896
2897
|
loadFetchVar(e, r, i) {
|
|
2897
2898
|
let s;
|
|
2898
|
-
i && i.__fc__ && (s = i.__fc__.getParentGroup());
|
|
2899
|
+
i && i.__fc__ && (s = i.__fc__.getParentGroup()), !s && e.targetRule && e.targetRule.__fc__ && (s = e.targetRule.__fc__.getParentGroup());
|
|
2899
2900
|
const n = (o) => this.loadStrVar(o, r, s ? { rule: i, value: this.subRuleData[s.id] || {} } : null);
|
|
2900
2901
|
return e.action = n(e.action || ""), ["headers", "data", "query"].forEach((o) => {
|
|
2901
2902
|
if (e[o]) {
|
|
@@ -2980,7 +2981,7 @@ function Gt(t, e, r) {
|
|
|
2980
2981
|
input: s,
|
|
2981
2982
|
el: void 0,
|
|
2982
2983
|
exportEl: void 0,
|
|
2983
|
-
defaultValue: s ?
|
|
2984
|
+
defaultValue: s ? Y(r) : void 0,
|
|
2984
2985
|
field: e.field || void 0
|
|
2985
2986
|
}), this.updateKey(), ui(this), this.update(t, !0);
|
|
2986
2987
|
}
|
|
@@ -3150,7 +3151,7 @@ function fi(t) {
|
|
|
3150
3151
|
__origin__: xe(e, !0)
|
|
3151
3152
|
}), ci(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
3152
3153
|
i && this.loadFn(i, r);
|
|
3153
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
3154
|
+
}), this.loadCtrl(r), r.update && (r.update = z(r.update)), r;
|
|
3154
3155
|
},
|
|
3155
3156
|
loadFn(e, r) {
|
|
3156
3157
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -3159,12 +3160,12 @@ function fi(t) {
|
|
|
3159
3160
|
},
|
|
3160
3161
|
loadCtrl(e) {
|
|
3161
3162
|
e.control && e.control.forEach((r) => {
|
|
3162
|
-
r.handle && (r.handle =
|
|
3163
|
+
r.handle && (r.handle = z(r.handle));
|
|
3163
3164
|
});
|
|
3164
3165
|
},
|
|
3165
3166
|
syncProp(e) {
|
|
3166
3167
|
const r = e.rule;
|
|
3167
|
-
h.trueArray(r.sync) &&
|
|
3168
|
+
h.trueArray(r.sync) && Q([{
|
|
3168
3169
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
3169
3170
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
3170
3171
|
}, i), {})
|
|
@@ -3277,7 +3278,7 @@ function fi(t) {
|
|
|
3277
3278
|
});
|
|
3278
3279
|
} else {
|
|
3279
3280
|
e.ctrlRule.splice(e.ctrlRule.indexOf(m), 1);
|
|
3280
|
-
const v =
|
|
3281
|
+
const v = Z(m);
|
|
3281
3282
|
v && v.rm();
|
|
3282
3283
|
}
|
|
3283
3284
|
});
|
|
@@ -3795,7 +3796,7 @@ function yi(t) {
|
|
|
3795
3796
|
emitEvent(e, ...r) {
|
|
3796
3797
|
const i = this.options[e] || this.options[H("on-" + e)];
|
|
3797
3798
|
if (i) {
|
|
3798
|
-
const s =
|
|
3799
|
+
const s = z(i);
|
|
3799
3800
|
h.Function(s) && O(() => s(...r));
|
|
3800
3801
|
}
|
|
3801
3802
|
this.bus.$emit(e, ...r);
|
|
@@ -3913,7 +3914,7 @@ function vi(t) {
|
|
|
3913
3914
|
return r.length ? r : !1;
|
|
3914
3915
|
} else return h.String(e) ? [e] : !1;
|
|
3915
3916
|
}
|
|
3916
|
-
function
|
|
3917
|
+
function x(t) {
|
|
3917
3918
|
Bt(this, {
|
|
3918
3919
|
options() {
|
|
3919
3920
|
return t.options.value || {};
|
|
@@ -3953,7 +3954,7 @@ function X(t) {
|
|
|
3953
3954
|
return i && i !== e && C(e, i), e;
|
|
3954
3955
|
}, ti(this));
|
|
3955
3956
|
}
|
|
3956
|
-
C(
|
|
3957
|
+
C(x.prototype, {
|
|
3957
3958
|
initData(t) {
|
|
3958
3959
|
C(this, {
|
|
3959
3960
|
ctxs: {},
|
|
@@ -3991,14 +3992,14 @@ C(X.prototype, {
|
|
|
3991
3992
|
});
|
|
3992
3993
|
}
|
|
3993
3994
|
});
|
|
3994
|
-
si(
|
|
3995
|
-
oi(
|
|
3996
|
-
li(
|
|
3997
|
-
fi(
|
|
3998
|
-
pi(
|
|
3999
|
-
gi(
|
|
4000
|
-
yi(
|
|
4001
|
-
$i(
|
|
3995
|
+
si(x);
|
|
3996
|
+
oi(x);
|
|
3997
|
+
li(x);
|
|
3998
|
+
fi(x);
|
|
3999
|
+
pi(x);
|
|
4000
|
+
gi(x);
|
|
4001
|
+
yi(x);
|
|
4002
|
+
$i(x);
|
|
4002
4003
|
const _i = "fcFragment", Ne = {
|
|
4003
4004
|
name: _i,
|
|
4004
4005
|
functional: !0,
|
|
@@ -4100,7 +4101,7 @@ C(Jt.prototype, {
|
|
|
4100
4101
|
return e(this.vm);
|
|
4101
4102
|
},
|
|
4102
4103
|
mergeOptions(t, e) {
|
|
4103
|
-
return
|
|
4104
|
+
return Q(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
4104
4105
|
},
|
|
4105
4106
|
updateOptions(t) {
|
|
4106
4107
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -4134,7 +4135,7 @@ const Fi = function(t) {
|
|
|
4134
4135
|
let d;
|
|
4135
4136
|
i && i.__fc__ && (d = i.__fc__.getParentGroup());
|
|
4136
4137
|
let m;
|
|
4137
|
-
a.template ? m = t.$handle.loadStrVar(a.template, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null) : a.handler && h.Function(a.handler) ? m = a.handler(p, i, s) : m = t.$handle.loadStrVar(`{{${a.attr}}}`, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null), (m == null || m === "") && a.default != null && (m = a.default), a.copy !== !1 && (m =
|
|
4138
|
+
a.template ? m = t.$handle.loadStrVar(a.template, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null) : a.handler && h.Function(a.handler) ? m = a.handler(p, i, s) : m = t.$handle.loadStrVar(`{{${a.attr}}}`, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null), (m == null || m === "") && a.default != null && (m = a.default), a.copy !== !1 && (m = Y(m));
|
|
4138
4139
|
const $ = a.modify ? i : r.getProp();
|
|
4139
4140
|
a.to === "child" ? $.children ? k($.children, 0, m) : k($, "children", [m]) : oe($, a.to || "options", m), s.sync(i);
|
|
4140
4141
|
}, u = (p) => l(p);
|
|
@@ -4190,7 +4191,7 @@ const Fi = function(t) {
|
|
|
4190
4191
|
h.Object(i) || (i = { method: i });
|
|
4191
4192
|
const s = i.method, n = q(_({}, i), {
|
|
4192
4193
|
validator(...o) {
|
|
4193
|
-
const a =
|
|
4194
|
+
const a = Z(e);
|
|
4194
4195
|
if (a)
|
|
4195
4196
|
return r.exec(a.id, h.String(s) ? s : "formCreateValidate", ...o, {
|
|
4196
4197
|
attr: t,
|
|
@@ -4222,7 +4223,7 @@ const Fi = function(t) {
|
|
|
4222
4223
|
l(void 0);
|
|
4223
4224
|
return;
|
|
4224
4225
|
}
|
|
4225
|
-
if (a =
|
|
4226
|
+
if (a = Y(a), a.to || (a.to = "options"), a.key) {
|
|
4226
4227
|
const p = t.$handle.options.globalData[a.key];
|
|
4227
4228
|
if (!p) {
|
|
4228
4229
|
l(void 0);
|
|
@@ -4241,13 +4242,13 @@ const Fi = function(t) {
|
|
|
4241
4242
|
i._fn[s.id] = t.watchLoadData(se((p, d) => {
|
|
4242
4243
|
if (d && a.watch === !1)
|
|
4243
4244
|
return i._fn[s.id]();
|
|
4244
|
-
const m = t.$handle.loadFetchVar(
|
|
4245
|
+
const m = t.$handle.loadFetchVar(Y(a), p, n), $ = q(_({
|
|
4245
4246
|
headers: {}
|
|
4246
4247
|
}, m), {
|
|
4247
4248
|
onSuccess(v, F) {
|
|
4248
4249
|
if (f()) return;
|
|
4249
4250
|
let J = (L) => F ? L : j(L, "data") ? L.data : L;
|
|
4250
|
-
const A =
|
|
4251
|
+
const A = z(m.parse);
|
|
4251
4252
|
h.Function(A) ? J = A : A && h.String(A) && (J = (L) => B(L, A)), Ae(J(v, n, o)).then((L) => {
|
|
4252
4253
|
l(L);
|
|
4253
4254
|
});
|
|
@@ -4517,14 +4518,14 @@ function Wt(t) {
|
|
|
4517
4518
|
return Ne;
|
|
4518
4519
|
}
|
|
4519
4520
|
function ge(c, g) {
|
|
4520
|
-
return h.Function(c.install) ? c.install(
|
|
4521
|
+
return h.Function(c.install) ? c.install(K, g) : h.Function(c) && c(K, g), this;
|
|
4521
4522
|
}
|
|
4522
|
-
function
|
|
4523
|
+
function K(c, g, y) {
|
|
4523
4524
|
let b = qi(c, g || {});
|
|
4524
4525
|
const w = b.$refs.fc.formCreate;
|
|
4525
4526
|
return w.$parent = y, Mi(w.options).appendChild(b.$el), w.api();
|
|
4526
4527
|
}
|
|
4527
|
-
je(
|
|
4528
|
+
je(K, F);
|
|
4528
4529
|
function xt(c) {
|
|
4529
4530
|
let g = _({}, t);
|
|
4530
4531
|
return c ? g.inherit = {
|
|
@@ -4587,7 +4588,7 @@ function Wt(t) {
|
|
|
4587
4588
|
function Be(c) {
|
|
4588
4589
|
C(this, {
|
|
4589
4590
|
id: Hi++,
|
|
4590
|
-
create:
|
|
4591
|
+
create: K,
|
|
4591
4592
|
vm: c,
|
|
4592
4593
|
manager: Oi(t.manager),
|
|
4593
4594
|
parsers: r,
|
|
@@ -4620,7 +4621,7 @@ function Wt(t) {
|
|
|
4620
4621
|
N(this.options, () => {
|
|
4621
4622
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4622
4623
|
}, { deep: !0 });
|
|
4623
|
-
}), C(c.$options.components, e), C(c.$options.directives, i), this.$handle = new
|
|
4624
|
+
}), C(c.$options.components, e), C(c.$options.directives, i), this.$handle = new x(this), this.name && (this.inFor ? (U[this.name] || (U[this.name] = []), U[this.name].push(this)) : U[this.name] = this);
|
|
4624
4625
|
}
|
|
4625
4626
|
Be.isMobile = d, C(Be.prototype, {
|
|
4626
4627
|
init() {
|
|
@@ -4656,18 +4657,18 @@ function Wt(t) {
|
|
|
4656
4657
|
this.fetchCache.set(b, { status: !1 });
|
|
4657
4658
|
const R = se(() => {
|
|
4658
4659
|
te();
|
|
4659
|
-
const
|
|
4660
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (
|
|
4661
|
-
}, b.wait || 600), ae = (
|
|
4662
|
-
this.fetchCache.set(b, { status: !0, data:
|
|
4663
|
-
}, le = (
|
|
4660
|
+
const W = this.fetchCache.get(b);
|
|
4661
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (W && (W.loading = !0, this.fetchCache.set(b, W)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete(b);
|
|
4662
|
+
}, b.wait || 600), ae = (W) => {
|
|
4663
|
+
this.fetchCache.set(b, { status: !0, data: W }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4664
|
+
}, le = (W, ue) => {
|
|
4664
4665
|
if (ue && b.watch === !1)
|
|
4665
4666
|
return te();
|
|
4666
4667
|
if (ue) {
|
|
4667
4668
|
R();
|
|
4668
4669
|
return;
|
|
4669
4670
|
}
|
|
4670
|
-
const fe = this.$handle.loadFetchVar(Ke(b),
|
|
4671
|
+
const fe = this.$handle.loadFetchVar(Ke(b), W);
|
|
4671
4672
|
fe.targetRule = this.targetRule, this.$handle.api.fetch(fe).then((re) => {
|
|
4672
4673
|
ae(re);
|
|
4673
4674
|
}).catch((re) => {
|
|
@@ -4694,7 +4695,7 @@ function Wt(t) {
|
|
|
4694
4695
|
let g = c.split(".");
|
|
4695
4696
|
const y = g.shift(), b = this.options.value.globalVariable && this.options.value.globalVariable[y];
|
|
4696
4697
|
if (b) {
|
|
4697
|
-
const w = h.Function(b) ? b :
|
|
4698
|
+
const w = h.Function(b) ? b : z(b.handle);
|
|
4698
4699
|
if (w) {
|
|
4699
4700
|
let V = w((...R) => this.$handle.api.getData(...R), this.$handle.api);
|
|
4700
4701
|
return B(V, g);
|
|
@@ -4746,7 +4747,7 @@ function Wt(t) {
|
|
|
4746
4747
|
let le;
|
|
4747
4748
|
if (typeof R == "object" && (le = R.getValue, R = R.id), y[R])
|
|
4748
4749
|
return y[R].val;
|
|
4749
|
-
const te = $e(() => le ? le() : this.getLoadData(R, ae)),
|
|
4750
|
+
const te = $e(() => le ? le() : this.getLoadData(R, ae)), W = R.split("."), ue = W.shift(), fe = W.shift() || "", re = se(() => {
|
|
4750
4751
|
const ce = le ? le() : this.getLoadData(R, ae);
|
|
4751
4752
|
if (y[R])
|
|
4752
4753
|
((ce instanceof Function || h.Object(ce) || Array.isArray(ce)) && ce === y[R].val || JSON.stringify(ce) !== JSON.stringify(y[R].val)) && (y[R].val = ce, b(!0));
|
|
@@ -4778,14 +4779,14 @@ function Wt(t) {
|
|
|
4778
4779
|
resetBtn: {},
|
|
4779
4780
|
globalEvent: {},
|
|
4780
4781
|
globalData: {}
|
|
4781
|
-
},
|
|
4782
|
+
}, Y(p));
|
|
4782
4783
|
const g = this.isSub();
|
|
4783
4784
|
g && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$props.option || {});
|
|
4784
4785
|
const y = this.api();
|
|
4785
4786
|
this.targetFormDriver("initOptions", c, { api: y, isSubForm: g }), this.updateOptions(c);
|
|
4786
4787
|
},
|
|
4787
4788
|
mergeOptions(c, g, y) {
|
|
4788
|
-
return g = _({}, g || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4789
|
+
return g = _({}, g || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "beforeUnmount", "onBeforeUnmount", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4789
4790
|
delete g[b];
|
|
4790
4791
|
}), g.global && (c.global = zr(c.global, g.global), delete g.global), this.$handle.$manager.mergeOptions([g], c), c;
|
|
4791
4792
|
},
|
|
@@ -4802,7 +4803,7 @@ function Wt(t) {
|
|
|
4802
4803
|
this.$handle.mounted();
|
|
4803
4804
|
},
|
|
4804
4805
|
unmount() {
|
|
4805
|
-
if (this.name)
|
|
4806
|
+
if (O(() => this.$handle.lifecycle("beforeUnmount")), this.name)
|
|
4806
4807
|
if (this.inFor) {
|
|
4807
4808
|
const c = U[this.name].indexOf(this);
|
|
4808
4809
|
U[this.name].splice(c, 1);
|
|
@@ -4844,7 +4845,7 @@ function Wt(t) {
|
|
|
4844
4845
|
mergeRule: ee,
|
|
4845
4846
|
fetch: Ut,
|
|
4846
4847
|
$form: S,
|
|
4847
|
-
parseFn:
|
|
4848
|
+
parseFn: z,
|
|
4848
4849
|
parseJson: St,
|
|
4849
4850
|
toJson: Oe,
|
|
4850
4851
|
useApp: A,
|
|
@@ -4854,14 +4855,14 @@ function Wt(t) {
|
|
|
4854
4855
|
}
|
|
4855
4856
|
function rr(c) {
|
|
4856
4857
|
C(c, {
|
|
4857
|
-
create:
|
|
4858
|
+
create: K,
|
|
4858
4859
|
install(g, y) {
|
|
4859
4860
|
p = _(_({}, p), y || {});
|
|
4860
4861
|
const b = `_installedFormCreate${d ? "Mobile" : ""}_${t.ui}`;
|
|
4861
4862
|
if (g[b] === !0) return;
|
|
4862
4863
|
g[b] = !0;
|
|
4863
4864
|
const w = function(R, ae = {}) {
|
|
4864
|
-
return
|
|
4865
|
+
return K(R, ae, this);
|
|
4865
4866
|
};
|
|
4866
4867
|
ot(w), g.prototype.$formCreate = w;
|
|
4867
4868
|
const V = S();
|
|
@@ -4871,7 +4872,7 @@ function Wt(t) {
|
|
|
4871
4872
|
}
|
|
4872
4873
|
});
|
|
4873
4874
|
}
|
|
4874
|
-
if (ot(F), rr(F), Ee("$cookie", Pi), Ee("$localStorage", Ti), Ee("$sessionStorage", Bi), $.use({ fragment: "fcFragment" }), t.install &&
|
|
4875
|
+
if (ot(F), rr(F), Ee("$cookie", Pi), Ee("$localStorage", Ti), Ee("$sessionStorage", Bi), $.use({ fragment: "fcFragment" }), t.install && K.use(t), me(Di), t.inherit) {
|
|
4875
4876
|
const c = t.inherit;
|
|
4876
4877
|
c.components && C(e, c.components), c.parsers && C(r, c.parsers), c.directives && C(i, c.directives), c.modelFields && C(s, c.modelFields), c.providers && C(u, c.providers), c.useApps && C(o, c.useApps), c.maker && C(f, c.maker), c.loadData && C(m, c.loadData), c.formulas && C(v, c.formulas);
|
|
4877
4878
|
}
|
|
@@ -5043,7 +5044,7 @@ function nn(t) {
|
|
|
5043
5044
|
function Ft(t, e) {
|
|
5044
5045
|
j(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
5045
5046
|
}
|
|
5046
|
-
function
|
|
5047
|
+
function X(t) {
|
|
5047
5048
|
return t === !1;
|
|
5048
5049
|
}
|
|
5049
5050
|
function sn(t, e) {
|
|
@@ -5094,7 +5095,7 @@ const on = {
|
|
|
5094
5095
|
wrap: {}
|
|
5095
5096
|
};
|
|
5096
5097
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
5097
|
-
t.prop[r] =
|
|
5098
|
+
t.prop[r] = Q([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
5098
5099
|
});
|
|
5099
5100
|
},
|
|
5100
5101
|
getDefaultOptions() {
|
|
@@ -5120,12 +5121,12 @@ const on = {
|
|
|
5120
5121
|
});
|
|
5121
5122
|
},
|
|
5122
5123
|
render(t) {
|
|
5123
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
5124
|
+
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, X(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
5124
5125
|
},
|
|
5125
5126
|
makeWrap(t, e) {
|
|
5126
5127
|
const r = t.prop, i = `${this.key}${t.key}`, s = r.col, n = this.isTitle(r) && r.wrap.title !== !1, o = !s.labelWidth && !n ? 0 : s.labelWidth, { inline: a, col: l } = this.rule.props, u = r.wrap.class;
|
|
5127
5128
|
delete r.wrap.class, delete r.wrap.title;
|
|
5128
|
-
const f = (h.Undef(r.wrap.show) ? !t.input :
|
|
5129
|
+
const f = (h.Undef(r.wrap.show) ? !t.input : X(r.wrap.show)) ? e : this.$r(Q([r.wrap, {
|
|
5129
5130
|
props: q(_({
|
|
5130
5131
|
labelWidth: o === void 0 ? o : Et(o),
|
|
5131
5132
|
label: n ? r.title.title : void 0
|
|
@@ -5138,12 +5139,12 @@ const on = {
|
|
|
5138
5139
|
ref: t.wrapRef,
|
|
5139
5140
|
type: "formItem"
|
|
5140
5141
|
}]), _({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
5141
|
-
return a === !0 ||
|
|
5142
|
+
return a === !0 || X(l) || X(s.show) ? f : this.makeCol(r, i, [f]);
|
|
5142
5143
|
},
|
|
5143
5144
|
isTitle(t) {
|
|
5144
5145
|
if (this.options.form.title === !1) return !1;
|
|
5145
5146
|
const e = t.title;
|
|
5146
|
-
return !(!e.title && !e.native ||
|
|
5147
|
+
return !(!e.title && !e.native || X(e.show));
|
|
5147
5148
|
},
|
|
5148
5149
|
makeInfo(t, e, r) {
|
|
5149
5150
|
var f, p, d, m, $, v;
|
|
@@ -5152,7 +5153,7 @@ const on = {
|
|
|
5152
5153
|
rule: r.rule,
|
|
5153
5154
|
options: this.options
|
|
5154
5155
|
}) : ((m = (d = r.refRule) == null ? void 0 : d.__$title) == null ? void 0 : m.value) + (o.labelSuffix || o["label-suffix"] || "")];
|
|
5155
|
-
if (!
|
|
5156
|
+
if (!X(s.show) && (s.info || s.native) && !X(s.icon)) {
|
|
5156
5157
|
const F = {
|
|
5157
5158
|
type: s.type || "popover",
|
|
5158
5159
|
slot: "label",
|
|
@@ -5161,7 +5162,7 @@ const on = {
|
|
|
5161
5162
|
};
|
|
5162
5163
|
delete F.props.icon, delete F.props.show, delete F.props.info, delete F.props.align, delete F.props.native;
|
|
5163
5164
|
const J = "content";
|
|
5164
|
-
s.info && !j(F.props, J) && (F.props[J] = (v = ($ = r.refRule) == null ? void 0 : $.__$info) == null ? void 0 : v.value), l[s.align !== "left" ? "unshift" : "push"](this.$r(
|
|
5165
|
+
s.info && !j(F.props, J) && (F.props[J] = (v = ($ = r.refRule) == null ? void 0 : $.__$info) == null ? void 0 : v.value), l[s.align !== "left" ? "unshift" : "push"](this.$r(Q([s, F]), [
|
|
5165
5166
|
this.$r({
|
|
5166
5167
|
type: "i",
|
|
5167
5168
|
slot: n ? "default" : "reference",
|
|
@@ -5170,7 +5171,7 @@ const on = {
|
|
|
5170
5171
|
})
|
|
5171
5172
|
]));
|
|
5172
5173
|
}
|
|
5173
|
-
const u =
|
|
5174
|
+
const u = Q([i, {
|
|
5174
5175
|
props: Ge(i),
|
|
5175
5176
|
key: `${e}tit`,
|
|
5176
5177
|
class: "fc-form-title",
|
|
@@ -5204,7 +5205,7 @@ const on = {
|
|
|
5204
5205
|
},
|
|
5205
5206
|
makeFormBtn() {
|
|
5206
5207
|
let t = [];
|
|
5207
|
-
if (
|
|
5208
|
+
if (X(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), X(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
5208
5209
|
return;
|
|
5209
5210
|
const e = this.$r({
|
|
5210
5211
|
type: "formItem",
|
|
@@ -5438,7 +5439,7 @@ function pn(t) {
|
|
|
5438
5439
|
function mn() {
|
|
5439
5440
|
return Wt({
|
|
5440
5441
|
ui: "element-ui",
|
|
5441
|
-
version: "2.7.
|
|
5442
|
+
version: "2.7.25",
|
|
5442
5443
|
manager: on,
|
|
5443
5444
|
extendApi: hn,
|
|
5444
5445
|
install: pn,
|