@form-create/element-ui 2.7.5 → 2.7.6
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 +829 -643
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +3 -3
- package/src/core/api.js +6 -4
- package/src/core/manager.js +2 -2
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.6
|
|
4
4
|
* (c) 2018-2025 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
@@ -11,7 +11,7 @@ var tr = Object.defineProperty, rr = Object.defineProperties;
|
|
|
11
11
|
var ir = Object.getOwnPropertyDescriptors;
|
|
12
12
|
var ot = Object.getOwnPropertySymbols;
|
|
13
13
|
var nr = Object.prototype.hasOwnProperty, sr = Object.prototype.propertyIsEnumerable;
|
|
14
|
-
var at = (t, e, r) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r,
|
|
14
|
+
var at = (t, e, r) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, v = (t, e) => {
|
|
15
15
|
for (var r in e || (e = {}))
|
|
16
16
|
nr.call(e, r) && at(t, r, e[r]);
|
|
17
17
|
if (ot)
|
|
@@ -19,7 +19,7 @@ var at = (t, e, r) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
19
19
|
sr.call(e, r) && at(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
21
|
}, q = (t, e) => rr(t, ir(e));
|
|
22
|
-
import $e, { getCurrentInstance as or, provide as ar, inject as lr, toRefs as lt, reactive as ne, onBeforeMount as ur, watch as L, onMounted as
|
|
22
|
+
import $e, { getCurrentInstance as or, provide as ar, inject as lr, toRefs as lt, reactive as ne, onBeforeMount as ur, watch as L, onMounted as fr, onBeforeUnmount as cr, onUpdated as hr, nextTick as I, markRaw as ge, computed as ye, toRef as je, ref as dr } from "vue";
|
|
23
23
|
function pr(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
@@ -41,16 +41,16 @@ var mr = ["attrs", "props", "domProps"], gr = ["class", "style", "directives"],
|
|
|
41
41
|
var a = e[i][o] instanceof Array ? e[i][o] : [e[i][o]], l = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
|
|
42
42
|
e[i][o] = [].concat(a, l);
|
|
43
43
|
} else e[i][o] = r[i][o];
|
|
44
|
-
else if (i === "hook") for (var u in r[i]) e[i][u] = e[i][u] ?
|
|
44
|
+
else if (i === "hook") for (var u in r[i]) e[i][u] = e[i][u] ? br(e[i][u], r[i][u]) : r[i][u];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, br = function(t, e) {
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
},
|
|
53
|
-
const V = /* @__PURE__ */ pr(
|
|
52
|
+
}, vr = $r;
|
|
53
|
+
const V = /* @__PURE__ */ pr(vr);
|
|
54
54
|
function Ze(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => (r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
@@ -111,7 +111,7 @@ const _r = "fcCheckbox", Cr = {
|
|
|
111
111
|
input: this.onInput
|
|
112
112
|
}
|
|
113
113
|
}]), [this.options().map((e, r) => {
|
|
114
|
-
const i =
|
|
114
|
+
const i = v({}, e), s = this.type === "button" ? "ElCheckboxButton" : "ElCheckbox";
|
|
115
115
|
return delete i.value, t(s, V([{}, {
|
|
116
116
|
props: i
|
|
117
117
|
}, {
|
|
@@ -469,7 +469,7 @@ const wr = "fcFrame", Fr = {
|
|
|
469
469
|
src: this.previewImage
|
|
470
470
|
}
|
|
471
471
|
})]), t("el-dialog", V([{}, {
|
|
472
|
-
props: q(
|
|
472
|
+
props: q(v({
|
|
473
473
|
width: i,
|
|
474
474
|
title: o,
|
|
475
475
|
appendToBody: !0
|
|
@@ -496,7 +496,7 @@ const wr = "fcFrame", Fr = {
|
|
|
496
496
|
mounted() {
|
|
497
497
|
this.$on("fc.closeModal", this.closeModal);
|
|
498
498
|
}
|
|
499
|
-
}, Or = "fcRadio",
|
|
499
|
+
}, Or = "fcRadio", kr = {
|
|
500
500
|
name: Or,
|
|
501
501
|
props: {
|
|
502
502
|
formCreateInject: {
|
|
@@ -550,7 +550,7 @@ const wr = "fcFrame", Fr = {
|
|
|
550
550
|
input: this.onInput
|
|
551
551
|
}
|
|
552
552
|
}]), [this.options().map((e, r) => {
|
|
553
|
-
const i =
|
|
553
|
+
const i = v({}, e), s = this.type === "button" ? "ElRadioButton" : "ElRadio";
|
|
554
554
|
return delete i.value, t(s, V([{}, {
|
|
555
555
|
props: i
|
|
556
556
|
}, {
|
|
@@ -594,7 +594,7 @@ const wr = "fcFrame", Fr = {
|
|
|
594
594
|
function D(t, e) {
|
|
595
595
|
return {}.hasOwnProperty.call(t, e);
|
|
596
596
|
}
|
|
597
|
-
const Er = "fcSelect",
|
|
597
|
+
const Er = "fcSelect", Sr = {
|
|
598
598
|
name: Er,
|
|
599
599
|
functional: !0,
|
|
600
600
|
props: {
|
|
@@ -626,8 +626,8 @@ const Er = "fcSelect", Rr = {
|
|
|
626
626
|
mounted() {
|
|
627
627
|
this.$emit("fc.el", this.$refs.el);
|
|
628
628
|
}
|
|
629
|
-
},
|
|
630
|
-
name:
|
|
629
|
+
}, Rr = "fcTree", Dr = {
|
|
630
|
+
name: Rr,
|
|
631
631
|
formCreateParser: {
|
|
632
632
|
mergeProp(t) {
|
|
633
633
|
const e = t.prop.props;
|
|
@@ -691,8 +691,8 @@ function ut(t, e) {
|
|
|
691
691
|
uid: e
|
|
692
692
|
};
|
|
693
693
|
}
|
|
694
|
-
function
|
|
695
|
-
return q(
|
|
694
|
+
function ft(t) {
|
|
695
|
+
return q(v({}, t), {
|
|
696
696
|
file: t,
|
|
697
697
|
value: t
|
|
698
698
|
});
|
|
@@ -749,11 +749,11 @@ const Ar = "fcUpload", Vr = {
|
|
|
749
749
|
};
|
|
750
750
|
},
|
|
751
751
|
created() {
|
|
752
|
-
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = H(this.value).map(ut).map(
|
|
752
|
+
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = H(this.value).map(ut).map(ft);
|
|
753
753
|
},
|
|
754
754
|
watch: {
|
|
755
755
|
value(t) {
|
|
756
|
-
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = H(t).map(ut).map(
|
|
756
|
+
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = H(t).map(ut).map(ft), this.uploadList = this.$refs.upload.uploadFiles);
|
|
757
757
|
},
|
|
758
758
|
limit(t, e) {
|
|
759
759
|
(e === 1 || t === 1) && this.update();
|
|
@@ -941,7 +941,7 @@ function Ce(t, e = {}, r) {
|
|
|
941
941
|
}
|
|
942
942
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
943
943
|
}
|
|
944
|
-
function
|
|
944
|
+
function K(t) {
|
|
945
945
|
return Ce({}, { value: t }).value;
|
|
946
946
|
}
|
|
947
947
|
const Ir = Object.assign || function(t) {
|
|
@@ -954,7 +954,7 @@ function _() {
|
|
|
954
954
|
return Ir.apply(this, arguments);
|
|
955
955
|
}
|
|
956
956
|
function Je(t) {
|
|
957
|
-
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] :
|
|
957
|
+
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : v({}, t);
|
|
958
958
|
}
|
|
959
959
|
const Pr = "fcGroup", Tr = {
|
|
960
960
|
name: Pr,
|
|
@@ -1044,7 +1044,7 @@ const Pr = "fcGroup", Tr = {
|
|
|
1044
1044
|
const n = i.$f.formData();
|
|
1045
1045
|
i.$f.once("reloading", () => {
|
|
1046
1046
|
i.$f.setValue(n);
|
|
1047
|
-
}), i.rule =
|
|
1047
|
+
}), i.rule = K(t);
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
1050
|
});
|
|
@@ -1091,7 +1091,7 @@ const Pr = "fcGroup", Tr = {
|
|
|
1091
1091
|
if (i.filter((n) => r[n].$f).length !== i.length)
|
|
1092
1092
|
return;
|
|
1093
1093
|
const s = i.map((n) => {
|
|
1094
|
-
const o = t === n ? e :
|
|
1094
|
+
const o = t === n ? e : v({}, this.cacheRule[n].$f.form), a = this.field ? o[this.field] || null : o;
|
|
1095
1095
|
return this.cache(n, a), a;
|
|
1096
1096
|
});
|
|
1097
1097
|
this.input(s);
|
|
@@ -1103,13 +1103,13 @@ const Pr = "fcGroup", Tr = {
|
|
|
1103
1103
|
}), this.cacheValue[t] !== JSON.stringify(r ? e[r] : e) && (this.cache(t, e), i && i.coverValue(e || {}));
|
|
1104
1104
|
},
|
|
1105
1105
|
addRule(t, e) {
|
|
1106
|
-
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ?
|
|
1106
|
+
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ? v({}, this.options) : {
|
|
1107
1107
|
submitBtn: !1,
|
|
1108
1108
|
resetBtn: !1
|
|
1109
1109
|
};
|
|
1110
1110
|
if (this.defaultValue) {
|
|
1111
1111
|
i.formData || (i.formData = {});
|
|
1112
|
-
const s =
|
|
1112
|
+
const s = K(this.defaultValue);
|
|
1113
1113
|
_(i.formData, this.field ? {
|
|
1114
1114
|
[this.field]: s
|
|
1115
1115
|
} : s);
|
|
@@ -1136,7 +1136,7 @@ const Pr = "fcGroup", Tr = {
|
|
|
1136
1136
|
if (this.disabled || this.onBeforeAdd(this.value) === !1)
|
|
1137
1137
|
return;
|
|
1138
1138
|
const e = [...this.value];
|
|
1139
|
-
e.push(this.defaultValue ?
|
|
1139
|
+
e.push(this.defaultValue ? K(this.defaultValue) : this.field ? null : {}), this.input(e);
|
|
1140
1140
|
},
|
|
1141
1141
|
del(t, e) {
|
|
1142
1142
|
if (this.disabled || this.onBeforeRemove(this.value, t) === !1)
|
|
@@ -1227,7 +1227,7 @@ const Pr = "fcGroup", Tr = {
|
|
|
1227
1227
|
const {
|
|
1228
1228
|
rule: l,
|
|
1229
1229
|
options: u
|
|
1230
|
-
} = this.cacheRule[o],
|
|
1230
|
+
} = this.cacheRule[o], f = r && !s ? this.makeIcon(e.length, a, o) : [];
|
|
1231
1231
|
return t("div", {
|
|
1232
1232
|
class: "_fc-group-container",
|
|
1233
1233
|
key: o
|
|
@@ -1235,9 +1235,9 @@ const Pr = "fcGroup", Tr = {
|
|
|
1235
1235
|
key: o
|
|
1236
1236
|
}, {
|
|
1237
1237
|
on: {
|
|
1238
|
-
"update:value": (
|
|
1239
|
-
"emit-event": (
|
|
1240
|
-
input: (
|
|
1238
|
+
"update:value": (d) => this.formData(o, d),
|
|
1239
|
+
"emit-event": (d, ...g) => this.emitEvent(d, g, a, o),
|
|
1240
|
+
input: (d) => this.add$f(a, o, d)
|
|
1241
1241
|
}
|
|
1242
1242
|
}, {}, {
|
|
1243
1243
|
props: {
|
|
@@ -1252,9 +1252,9 @@ const Pr = "fcGroup", Tr = {
|
|
|
1252
1252
|
}
|
|
1253
1253
|
}])), t("div", {
|
|
1254
1254
|
class: "_fc-group-idx"
|
|
1255
|
-
}, [a + 1]),
|
|
1255
|
+
}, [a + 1]), f.length ? t("div", {
|
|
1256
1256
|
class: "_fc-group-handle fc-clock"
|
|
1257
|
-
}, [
|
|
1257
|
+
}, [f]) : null]);
|
|
1258
1258
|
});
|
|
1259
1259
|
return t("div", {
|
|
1260
1260
|
key: "con",
|
|
@@ -1308,7 +1308,7 @@ const Pr = "fcGroup", Tr = {
|
|
|
1308
1308
|
submitBtn: !1,
|
|
1309
1309
|
resetBtn: !1
|
|
1310
1310
|
};
|
|
1311
|
-
t.formData =
|
|
1311
|
+
t.formData = v({}, this.value || {}), this.cacheRule = {
|
|
1312
1312
|
rule: this.rule,
|
|
1313
1313
|
options: t
|
|
1314
1314
|
};
|
|
@@ -1348,8 +1348,8 @@ const Pr = "fcGroup", Tr = {
|
|
|
1348
1348
|
}, Mr = [
|
|
1349
1349
|
Cr,
|
|
1350
1350
|
Fr,
|
|
1351
|
+
kr,
|
|
1351
1352
|
Sr,
|
|
1352
|
-
Rr,
|
|
1353
1353
|
Dr,
|
|
1354
1354
|
Vr,
|
|
1355
1355
|
Tr,
|
|
@@ -1361,43 +1361,43 @@ function se(t, e) {
|
|
|
1361
1361
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
1362
1362
|
};
|
|
1363
1363
|
}
|
|
1364
|
-
function
|
|
1364
|
+
function ve(t) {
|
|
1365
1365
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
1366
1366
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
1367
1367
|
}
|
|
1368
|
-
const Ot = ["attrs", "props", "domProps", "scopedSlots"],
|
|
1369
|
-
const i = [...Ot, ...r.normal || []], s = [...
|
|
1368
|
+
const Ot = ["attrs", "props", "domProps", "scopedSlots"], kt = ["class", "style", "directives"], Et = ["on", "nativeOn", "hook"], ee = (t, e = {}, r = {}) => {
|
|
1369
|
+
const i = [...Ot, ...r.normal || []], s = [...kt, ...r.array || []], n = [...Et, ...r.functional || []], o = r.props || [];
|
|
1370
1370
|
return t.reduce((a, l) => {
|
|
1371
1371
|
for (const u in l)
|
|
1372
1372
|
if (a[u])
|
|
1373
1373
|
if (o.indexOf(u) > -1)
|
|
1374
1374
|
a[u] = ee([l[u]], a[u]);
|
|
1375
1375
|
else if (i.indexOf(u) > -1)
|
|
1376
|
-
a[u] =
|
|
1376
|
+
a[u] = v(v({}, a[u]), l[u]);
|
|
1377
1377
|
else if (s.indexOf(u) > -1) {
|
|
1378
|
-
const
|
|
1379
|
-
a[u] = [...
|
|
1378
|
+
const f = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1379
|
+
a[u] = [...f, ...d];
|
|
1380
1380
|
} else if (n.indexOf(u) > -1)
|
|
1381
|
-
for (const
|
|
1382
|
-
if (a[u][
|
|
1383
|
-
const
|
|
1384
|
-
a[u][
|
|
1381
|
+
for (const f in l[u])
|
|
1382
|
+
if (a[u][f]) {
|
|
1383
|
+
const d = a[u][f] instanceof Array ? a[u][f] : [a[u][f]], g = l[u][f] instanceof Array ? l[u][f] : [l[u][f]];
|
|
1384
|
+
a[u][f] = [...d, ...g];
|
|
1385
1385
|
} else
|
|
1386
|
-
a[u][
|
|
1386
|
+
a[u][f] = l[u][f];
|
|
1387
1387
|
else if (u === "hook")
|
|
1388
|
-
for (let
|
|
1389
|
-
a[u][
|
|
1388
|
+
for (let f in l[u])
|
|
1389
|
+
a[u][f] ? a[u][f] = Nr(a[u][f], l[u][f]) : a[u][f] = l[u][f];
|
|
1390
1390
|
else
|
|
1391
1391
|
a[u] = l[u];
|
|
1392
1392
|
else
|
|
1393
|
-
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] =
|
|
1393
|
+
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = v({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? v({}, l[u]) : l[u] : a[u] = l[u];
|
|
1394
1394
|
return a;
|
|
1395
1395
|
}, e);
|
|
1396
1396
|
}, Nr = (t, e) => function() {
|
|
1397
1397
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1398
|
-
},
|
|
1399
|
-
function
|
|
1400
|
-
return [...
|
|
1398
|
+
}, St = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache"], Qe = ["validate", "children", "control"], Ye = ["effect", "deep", "renderSlots"];
|
|
1399
|
+
function Rt() {
|
|
1400
|
+
return [...St, ...Ot, ...kt, ...Et, ...Qe, ...Ye];
|
|
1401
1401
|
}
|
|
1402
1402
|
function Dt(t, e, r) {
|
|
1403
1403
|
return `[form-create ${t}]: ${e}`;
|
|
@@ -1411,7 +1411,7 @@ function qr(t) {
|
|
|
1411
1411
|
function jt(t) {
|
|
1412
1412
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
1413
1413
|
}
|
|
1414
|
-
const
|
|
1414
|
+
const Ke = "[[FORM-CREATE-PREFIX-", We = "-FORM-CREATE-SUFFIX]]";
|
|
1415
1415
|
function _e(t, e) {
|
|
1416
1416
|
return JSON.stringify(Ce(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1417
1417
|
if (!(i && i._isVue === !0)) {
|
|
@@ -1420,19 +1420,19 @@ function _e(t, e) {
|
|
|
1420
1420
|
if (i.__json)
|
|
1421
1421
|
return i.__json;
|
|
1422
1422
|
if (i.__origin && (i = i.__origin), !i.__emit)
|
|
1423
|
-
return
|
|
1423
|
+
return Ke + i + We;
|
|
1424
1424
|
}
|
|
1425
1425
|
}, e);
|
|
1426
1426
|
}
|
|
1427
1427
|
function Be(t) {
|
|
1428
1428
|
return new Function("return " + t)();
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1430
|
+
function x(t, e) {
|
|
1431
1431
|
if (t && h.String(t) && t.length > 4) {
|
|
1432
1432
|
let r = t.trim(), i = !1;
|
|
1433
1433
|
try {
|
|
1434
|
-
if (r.indexOf(
|
|
1435
|
-
r = r.replace(
|
|
1434
|
+
if (r.indexOf(We) > 0 && r.indexOf(Ke) === 0)
|
|
1435
|
+
r = r.replace(We, "").replace(Ke, ""), i = !0;
|
|
1436
1436
|
else if (r.indexOf("$FN:") === 0)
|
|
1437
1437
|
r = r.substring(4), i = !0;
|
|
1438
1438
|
else if (r.indexOf("$EXEC:") === 0)
|
|
@@ -1468,7 +1468,7 @@ err: ${s}`);
|
|
|
1468
1468
|
}
|
|
1469
1469
|
function At(t, e) {
|
|
1470
1470
|
return JSON.parse(t, function(r, i) {
|
|
1471
|
-
return h.Undef(i) || !i.indexOf ? i :
|
|
1471
|
+
return h.Undef(i) || !i.indexOf ? i : x(i, e);
|
|
1472
1472
|
});
|
|
1473
1473
|
}
|
|
1474
1474
|
let Ur = 0;
|
|
@@ -1482,7 +1482,7 @@ function oe(t, e, r) {
|
|
|
1482
1482
|
s && ((!i[s] || typeof i[s] != "object") && E(i, s, {}), i = i[s]), s = n;
|
|
1483
1483
|
}), E(i, s, r), i;
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1485
|
+
function ze(t, e) {
|
|
1486
1486
|
return {
|
|
1487
1487
|
value: t,
|
|
1488
1488
|
enumerable: !1,
|
|
@@ -1497,9 +1497,9 @@ function It(t, e) {
|
|
|
1497
1497
|
return Ce([], [...t], e || !1);
|
|
1498
1498
|
}
|
|
1499
1499
|
function te(t, e) {
|
|
1500
|
-
return ee(Array.isArray(e) ? e : [e], t, { array:
|
|
1500
|
+
return ee(Array.isArray(e) ? e : [e], t, { array: Qe, normal: Ye }), t;
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1502
|
+
function ct(t) {
|
|
1503
1503
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1504
1504
|
return e.type || (e.type = "input"), e;
|
|
1505
1505
|
}
|
|
@@ -1515,7 +1515,7 @@ function Pt(t, e) {
|
|
|
1515
1515
|
}
|
|
1516
1516
|
}, r), {}));
|
|
1517
1517
|
}
|
|
1518
|
-
function
|
|
1518
|
+
function Y(t) {
|
|
1519
1519
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1520
1520
|
}
|
|
1521
1521
|
function F(t, e) {
|
|
@@ -1526,9 +1526,9 @@ function F(t, e) {
|
|
|
1526
1526
|
}
|
|
1527
1527
|
return e;
|
|
1528
1528
|
}
|
|
1529
|
-
function
|
|
1529
|
+
function xe(t, e) {
|
|
1530
1530
|
let r = null;
|
|
1531
|
-
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) =>
|
|
1531
|
+
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => xe(i, e)) : r = t, r && e && H(r).forEach((i) => {
|
|
1532
1532
|
(Array.isArray(i) ? i : [i]).forEach((n) => {
|
|
1533
1533
|
n && typeof n == "object" && (n.data || (n.data = {}), (!n.data.slot || n.data.slot === "default") && (n.data.slot = e || "default"));
|
|
1534
1534
|
});
|
|
@@ -1538,12 +1538,12 @@ function Gr(t, e) {
|
|
|
1538
1538
|
if (h.Object(t)) {
|
|
1539
1539
|
const r = {};
|
|
1540
1540
|
return Object.keys(t).forEach((i) => {
|
|
1541
|
-
r[i] =
|
|
1541
|
+
r[i] = xe(t[i], i);
|
|
1542
1542
|
}), r;
|
|
1543
1543
|
} else
|
|
1544
|
-
return
|
|
1544
|
+
return xe(t, e);
|
|
1545
1545
|
}
|
|
1546
|
-
function
|
|
1546
|
+
function ke() {
|
|
1547
1547
|
const t = {}, e = (r) => r || "default";
|
|
1548
1548
|
return {
|
|
1549
1549
|
setSlot(r, i) {
|
|
@@ -1582,9 +1582,9 @@ function Se() {
|
|
|
1582
1582
|
function Ee(t, e) {
|
|
1583
1583
|
return Object.setPrototypeOf(t, e), t;
|
|
1584
1584
|
}
|
|
1585
|
-
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e,
|
|
1585
|
+
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, fe = {
|
|
1586
1586
|
"==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
|
|
1587
|
-
"!=": (t, e) => !
|
|
1587
|
+
"!=": (t, e) => !fe["=="](t, e),
|
|
1588
1588
|
">": (t, e) => t > e,
|
|
1589
1589
|
">=": (t, e) => t >= e,
|
|
1590
1590
|
"<": (t, e) => t < e,
|
|
@@ -1593,13 +1593,13 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1593
1593
|
return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
|
|
1594
1594
|
},
|
|
1595
1595
|
notOn(t, e) {
|
|
1596
|
-
return !
|
|
1596
|
+
return !fe.on(t, e);
|
|
1597
1597
|
},
|
|
1598
1598
|
in(t, e) {
|
|
1599
1599
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1600
1600
|
},
|
|
1601
1601
|
notIn(t, e) {
|
|
1602
|
-
return !
|
|
1602
|
+
return !fe.in(t, e);
|
|
1603
1603
|
},
|
|
1604
1604
|
between(t, e) {
|
|
1605
1605
|
return t > e[0] && t < e[1];
|
|
@@ -1636,15 +1636,15 @@ function dt(t) {
|
|
|
1636
1636
|
n === 0 ? i = s : i += "." + s, r.push(i);
|
|
1637
1637
|
}), r.join(" && ");
|
|
1638
1638
|
}
|
|
1639
|
-
const
|
|
1639
|
+
const Re = (t, e) => {
|
|
1640
1640
|
if (!(!t || t === e || !t.$props)) {
|
|
1641
1641
|
if (t.$props.formCreateInject)
|
|
1642
1642
|
return t.$props.formCreateInject;
|
|
1643
1643
|
if (t.$parent)
|
|
1644
|
-
return
|
|
1644
|
+
return Re(t.$parent, e);
|
|
1645
1645
|
}
|
|
1646
1646
|
};
|
|
1647
|
-
function
|
|
1647
|
+
function Kr(t, e, r) {
|
|
1648
1648
|
const i = "FormCreate" + (t.isMobile ? "Mobile" : "");
|
|
1649
1649
|
return {
|
|
1650
1650
|
name: i,
|
|
@@ -1704,93 +1704,93 @@ function Wr(t, e, r) {
|
|
|
1704
1704
|
a = a.parent;
|
|
1705
1705
|
else
|
|
1706
1706
|
a = n;
|
|
1707
|
-
const { rule: l, value: u, subForm:
|
|
1707
|
+
const { rule: l, value: u, subForm: f, inFor: d } = lt(s), g = ne({
|
|
1708
1708
|
ctxInject: {},
|
|
1709
1709
|
destroyed: !1,
|
|
1710
1710
|
isShow: !0,
|
|
1711
1711
|
unique: 1,
|
|
1712
1712
|
renderRule: [...l.value || []],
|
|
1713
1713
|
updateValue: JSON.stringify(u.value || {})
|
|
1714
|
-
}),
|
|
1714
|
+
}), m = new t(n), $ = m.api(), w = d.value, O = () => {
|
|
1715
1715
|
if (o) {
|
|
1716
|
-
const
|
|
1717
|
-
if (
|
|
1718
|
-
let
|
|
1719
|
-
w ? (
|
|
1716
|
+
const k = Re(n, o);
|
|
1717
|
+
if (k) {
|
|
1718
|
+
let S;
|
|
1719
|
+
w ? (S = H(k.getSubForm()), S.push($)) : S = $, k.subForm(S);
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
1722
|
}, G = () => {
|
|
1723
|
-
const
|
|
1724
|
-
if (
|
|
1723
|
+
const k = Re(n, o);
|
|
1724
|
+
if (k)
|
|
1725
1725
|
if (w) {
|
|
1726
|
-
const
|
|
1727
|
-
N > -1 &&
|
|
1726
|
+
const S = H(k.getSubForm()), N = S.indexOf($);
|
|
1727
|
+
N > -1 && S.splice(N, 1);
|
|
1728
1728
|
} else
|
|
1729
|
-
|
|
1729
|
+
k.subForm();
|
|
1730
1730
|
};
|
|
1731
1731
|
let T = null;
|
|
1732
1732
|
ur(() => {
|
|
1733
1733
|
L(() => {
|
|
1734
|
-
let
|
|
1735
|
-
const
|
|
1736
|
-
Object.keys(
|
|
1734
|
+
let k = "";
|
|
1735
|
+
const S = s.option && s.option.globalClass || {};
|
|
1736
|
+
Object.keys(S).forEach((N) => {
|
|
1737
1737
|
let pe = "";
|
|
1738
|
-
|
|
1739
|
-
pe +=
|
|
1740
|
-
}),
|
|
1741
|
-
}), s.option && s.option.style && (
|
|
1738
|
+
S[N].style && Object.keys(S[N].style).forEach((W) => {
|
|
1739
|
+
pe += ve(W) + ":" + S[N].style[W] + ";";
|
|
1740
|
+
}), S[N].content && (pe += S[N].content + ";"), pe && (k += `.${N}{${pe}}`);
|
|
1741
|
+
}), s.option && s.option.style && (k += s.option.style), T || (T = document.createElement("style"), T.type = "text/css", document.head.appendChild(T)), T.innerHTML = k || "";
|
|
1742
1742
|
}, () => {
|
|
1743
1743
|
});
|
|
1744
1744
|
});
|
|
1745
1745
|
const M = se(() => {
|
|
1746
|
-
|
|
1746
|
+
m.bus.$emit("$loadData.$topForm");
|
|
1747
1747
|
}, 100), he = se(function() {
|
|
1748
|
-
|
|
1748
|
+
m.bus.$emit("$loadData.$scopeForm");
|
|
1749
1749
|
}, 100), Ve = se(() => {
|
|
1750
|
-
|
|
1751
|
-
}, 100), de = (
|
|
1752
|
-
|
|
1750
|
+
m.bus.$emit("$loadData.$form");
|
|
1751
|
+
}, 100), de = (k) => {
|
|
1752
|
+
m.bus.$emit("change-$form." + k);
|
|
1753
1753
|
};
|
|
1754
|
-
return
|
|
1755
|
-
o && ($.top.bus.$on("$loadData.$form", M), $.top.bus.$on("change", de)), $ !== $.scope && $.scope.bus.$on("$loadData.$scopeForm", he),
|
|
1756
|
-
}),
|
|
1757
|
-
o && ($.top.bus.$off("$loadData.$form", M), $.top.bus.$off("change", de)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", he), T && document.head.removeChild(T), G(),
|
|
1754
|
+
return fr(() => {
|
|
1755
|
+
o && ($.top.bus.$on("$loadData.$form", M), $.top.bus.$on("change", de)), $ !== $.scope && $.scope.bus.$on("$loadData.$scopeForm", he), m.mounted();
|
|
1756
|
+
}), cr(() => {
|
|
1757
|
+
o && ($.top.bus.$off("$loadData.$form", M), $.top.bus.$off("change", de)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", he), T && document.head.removeChild(T), G(), g.destroyed = !0, m.unmount();
|
|
1758
1758
|
}), hr(() => {
|
|
1759
|
-
|
|
1760
|
-
}), L(
|
|
1761
|
-
|
|
1759
|
+
m.updated();
|
|
1760
|
+
}), L(f, (k) => {
|
|
1761
|
+
k ? O() : G();
|
|
1762
1762
|
}, { immediate: !0 }), L(() => s.option, () => {
|
|
1763
|
-
|
|
1764
|
-
}, { deep: !0 }), L(() => [...l.value], (
|
|
1765
|
-
|
|
1763
|
+
m.initOptions(), $.refresh();
|
|
1764
|
+
}, { deep: !0 }), L(() => [...l.value], (k) => {
|
|
1765
|
+
m.$handle.isBreakWatch() || k.length === g.renderRule.length && k.every((S) => g.renderRule.indexOf(S) > -1) || (m.$handle.updateAppendData(), m.$handle.reloadRule(l.value), n.renderRule());
|
|
1766
1766
|
}), L(() => [s.disabled, s.preview], () => {
|
|
1767
1767
|
$.refresh();
|
|
1768
|
-
}), L(u, (
|
|
1769
|
-
_e(
|
|
1768
|
+
}), L(u, (k) => {
|
|
1769
|
+
_e(k || {}) !== g.updateValue && ($.config.forceCoverValue ? $.coverValue(k || {}) : $.setValue(k || {}));
|
|
1770
1770
|
}, { deep: !0, flush: "post" }), L(() => s.index, () => {
|
|
1771
|
-
$.coverValue({}),
|
|
1771
|
+
$.coverValue({}), m.$handle.updateAppendData(), I(() => {
|
|
1772
1772
|
I(() => {
|
|
1773
1773
|
$.clearValidateState();
|
|
1774
1774
|
});
|
|
1775
1775
|
});
|
|
1776
|
-
}, { flush: "sync" }), q(
|
|
1777
|
-
fc: ge(
|
|
1776
|
+
}, { flush: "sync" }), q(v({
|
|
1777
|
+
fc: ge(m),
|
|
1778
1778
|
parent: o && ge(o),
|
|
1779
1779
|
top: ge(a),
|
|
1780
1780
|
fapi: ge($)
|
|
1781
|
-
}, lt(
|
|
1782
|
-
getGroupInject: () =>
|
|
1781
|
+
}, lt(g)), {
|
|
1782
|
+
getGroupInject: () => Re(n, o),
|
|
1783
1783
|
refresh() {
|
|
1784
|
-
++
|
|
1784
|
+
++g.unique;
|
|
1785
1785
|
},
|
|
1786
1786
|
renderRule() {
|
|
1787
|
-
|
|
1787
|
+
g.renderRule = [...l.value || []];
|
|
1788
1788
|
},
|
|
1789
|
-
updateValue(
|
|
1790
|
-
if (
|
|
1791
|
-
const
|
|
1792
|
-
|
|
1793
|
-
Ve(), o ?
|
|
1789
|
+
updateValue(k) {
|
|
1790
|
+
if (g.destroyed) return;
|
|
1791
|
+
const S = _e(k);
|
|
1792
|
+
g.updateValue !== S && (g.updateValue = S, n.$emit("update:value", k), I(() => {
|
|
1793
|
+
Ve(), o ? f.value || he() : (M(), he());
|
|
1794
1794
|
}));
|
|
1795
1795
|
}
|
|
1796
1796
|
});
|
|
@@ -1840,9 +1840,9 @@ function Bt(t) {
|
|
|
1840
1840
|
};
|
|
1841
1841
|
});
|
|
1842
1842
|
}
|
|
1843
|
-
Bt(
|
|
1843
|
+
Bt(Rt());
|
|
1844
1844
|
const Lt = P("");
|
|
1845
|
-
function
|
|
1845
|
+
function Wr(t, e, r) {
|
|
1846
1846
|
let i = Lt("", e);
|
|
1847
1847
|
return i._data.type = t, i._data.title = r, i;
|
|
1848
1848
|
}
|
|
@@ -1850,15 +1850,15 @@ function pt(t, e, r, i) {
|
|
|
1850
1850
|
let s = Lt("", r);
|
|
1851
1851
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1852
1852
|
}
|
|
1853
|
-
function
|
|
1853
|
+
function zr() {
|
|
1854
1854
|
return {
|
|
1855
|
-
create:
|
|
1855
|
+
create: Wr,
|
|
1856
1856
|
createTmp: pt,
|
|
1857
1857
|
template: pt,
|
|
1858
1858
|
factory: P
|
|
1859
1859
|
};
|
|
1860
1860
|
}
|
|
1861
|
-
function
|
|
1861
|
+
function xr(t, e, r) {
|
|
1862
1862
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1863
1863
|
return s.status = r.status, s.url = t, s;
|
|
1864
1864
|
}
|
|
@@ -1887,7 +1887,7 @@ function Mt(t) {
|
|
|
1887
1887
|
t.onError(o);
|
|
1888
1888
|
}, e.onload = function() {
|
|
1889
1889
|
if (e.status < 200 || e.status >= 300)
|
|
1890
|
-
return t.onError(
|
|
1890
|
+
return t.onError(xr(r, t, e), mt(e));
|
|
1891
1891
|
t.onSuccess(mt(e));
|
|
1892
1892
|
}, e.open(t.method || "get", r, !0);
|
|
1893
1893
|
let i;
|
|
@@ -1901,10 +1901,10 @@ function Mt(t) {
|
|
|
1901
1901
|
}
|
|
1902
1902
|
function gt(t, e, r) {
|
|
1903
1903
|
return new Promise((i, s) => {
|
|
1904
|
-
(e || Mt)(q(
|
|
1904
|
+
(e || Mt)(q(v({}, t), {
|
|
1905
1905
|
onSuccess(n) {
|
|
1906
1906
|
let o = (l) => l;
|
|
1907
|
-
const a =
|
|
1907
|
+
const a = x(t.parse);
|
|
1908
1908
|
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => B(l, a)), i(o(n, void 0, r));
|
|
1909
1909
|
},
|
|
1910
1910
|
onError(n) {
|
|
@@ -1913,18 +1913,18 @@ function gt(t, e, r) {
|
|
|
1913
1913
|
}));
|
|
1914
1914
|
});
|
|
1915
1915
|
}
|
|
1916
|
-
function
|
|
1917
|
-
return
|
|
1916
|
+
function be(t) {
|
|
1917
|
+
return K(t);
|
|
1918
1918
|
}
|
|
1919
|
-
function
|
|
1919
|
+
function Xr(t) {
|
|
1920
1920
|
function e(n) {
|
|
1921
1921
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1922
1922
|
}
|
|
1923
1923
|
function r(n, o, a) {
|
|
1924
|
-
h.Undef(n) ? n = Object.keys(
|
|
1924
|
+
h.Undef(n) ? n = Object.keys(v(v({}, t.fieldCtx), t.nameCtx)) : Array.isArray(n) || (n = [n]), n.forEach((l) => {
|
|
1925
1925
|
const u = t.fieldCtx[l] || t.nameCtx[l];
|
|
1926
|
-
u && u.forEach((
|
|
1927
|
-
E(
|
|
1926
|
+
u && u.forEach((f) => {
|
|
1927
|
+
E(f.rule, o, a), t.$render.clearCache(f);
|
|
1928
1928
|
});
|
|
1929
1929
|
});
|
|
1930
1930
|
}
|
|
@@ -1993,28 +1993,31 @@ function Qr(t) {
|
|
|
1993
1993
|
return o > -1 ? o : void 0;
|
|
1994
1994
|
}
|
|
1995
1995
|
},
|
|
1996
|
+
get formulas() {
|
|
1997
|
+
return v({}, t.fc.formulas);
|
|
1998
|
+
},
|
|
1996
1999
|
formData(n) {
|
|
1997
2000
|
if (n == null || typeof n == "boolean") {
|
|
1998
2001
|
const o = {};
|
|
1999
2002
|
return Object.keys(t.form).forEach((a) => {
|
|
2000
|
-
(n === !0 || t.ignoreFields.indexOf(a) === -1) && (o[a] =
|
|
2003
|
+
(n === !0 || t.ignoreFields.indexOf(a) === -1) && (o[a] = be(t.form[a]));
|
|
2001
2004
|
}), o;
|
|
2002
2005
|
} else
|
|
2003
2006
|
return e(n).reduce((o, a) => (o[a] = s.getValue(a), o), {});
|
|
2004
2007
|
},
|
|
2005
2008
|
getValue(n) {
|
|
2006
2009
|
const o = t.getFieldCtx(n);
|
|
2007
|
-
return o ?
|
|
2010
|
+
return o ? be(o.rule.value) : t.options.appendValue !== !1 && D(t.appendData, n) ? be(t.appendData[n]) : void 0;
|
|
2008
2011
|
},
|
|
2009
2012
|
coverValue(n) {
|
|
2010
|
-
const o =
|
|
2013
|
+
const o = v({}, n || {});
|
|
2011
2014
|
t.deferSyncValue(() => {
|
|
2012
2015
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
2013
2016
|
const l = t.fieldCtx[a];
|
|
2014
2017
|
if (l) {
|
|
2015
2018
|
const u = D(n, a);
|
|
2016
|
-
l.forEach((
|
|
2017
|
-
|
|
2019
|
+
l.forEach((f) => {
|
|
2020
|
+
f.rule.value = u ? n[a] : void 0;
|
|
2018
2021
|
}), delete o[a];
|
|
2019
2022
|
}
|
|
2020
2023
|
}), _(t.appendData, o);
|
|
@@ -2041,7 +2044,7 @@ function Qr(t) {
|
|
|
2041
2044
|
}, !0), o ? o.origin : void 0;
|
|
2042
2045
|
},
|
|
2043
2046
|
removeRule(n) {
|
|
2044
|
-
const o = n &&
|
|
2047
|
+
const o = n && Y(n);
|
|
2045
2048
|
if (o)
|
|
2046
2049
|
return o.rm(), o.origin;
|
|
2047
2050
|
},
|
|
@@ -2051,24 +2054,24 @@ function Qr(t) {
|
|
|
2051
2054
|
fields: () => t.fields(),
|
|
2052
2055
|
append: (n, o, a) => {
|
|
2053
2056
|
let l = t.sort.length - 1, u;
|
|
2054
|
-
const
|
|
2055
|
-
if (
|
|
2057
|
+
const f = t.getCtx(o);
|
|
2058
|
+
if (f)
|
|
2056
2059
|
if (a) {
|
|
2057
|
-
if (u =
|
|
2058
|
-
l =
|
|
2060
|
+
if (u = f.getPending("children", f.rule.children), !Array.isArray(u)) return;
|
|
2061
|
+
l = f.rule.children.length - 1;
|
|
2059
2062
|
} else
|
|
2060
|
-
l =
|
|
2063
|
+
l = f.root.indexOf(f.origin), u = f.root;
|
|
2061
2064
|
else u = t.rules;
|
|
2062
2065
|
u.splice(l + 1, 0, n);
|
|
2063
2066
|
},
|
|
2064
2067
|
prepend: (n, o, a) => {
|
|
2065
2068
|
let l = 0, u;
|
|
2066
|
-
const
|
|
2067
|
-
if (
|
|
2069
|
+
const f = t.getCtx(o);
|
|
2070
|
+
if (f)
|
|
2068
2071
|
if (a) {
|
|
2069
|
-
if (u =
|
|
2072
|
+
if (u = f.getPending("children", f.rule.children), !Array.isArray(u)) return;
|
|
2070
2073
|
} else
|
|
2071
|
-
l =
|
|
2074
|
+
l = f.root.indexOf(f.origin), u = f.root;
|
|
2072
2075
|
else u = t.rules;
|
|
2073
2076
|
u.splice(l, 0, n);
|
|
2074
2077
|
},
|
|
@@ -2130,7 +2133,7 @@ function Qr(t) {
|
|
|
2130
2133
|
n.forEach((a) => s.sync(a));
|
|
2131
2134
|
return;
|
|
2132
2135
|
}
|
|
2133
|
-
let o = h.Object(n) ?
|
|
2136
|
+
let o = h.Object(n) ? Y(n) : t.getCtxs(n);
|
|
2134
2137
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2135
2138
|
if (!a.deleted) {
|
|
2136
2139
|
const l = t.subForm[a.id];
|
|
@@ -2214,7 +2217,7 @@ function Qr(t) {
|
|
|
2214
2217
|
resetFields(n) {
|
|
2215
2218
|
e(n).forEach((o) => {
|
|
2216
2219
|
t.getCtxs(o).forEach((a) => {
|
|
2217
|
-
t.$render.clearCache(a), a.rule.value =
|
|
2220
|
+
t.$render.clearCache(a), a.rule.value = be(a.defaultValue);
|
|
2218
2221
|
});
|
|
2219
2222
|
}), I(() => {
|
|
2220
2223
|
I(() => {
|
|
@@ -2253,29 +2256,29 @@ function Qr(t) {
|
|
|
2253
2256
|
return o ? t.subForm[o.id] : void 0;
|
|
2254
2257
|
},
|
|
2255
2258
|
getChildrenRuleList(n) {
|
|
2256
|
-
const o = typeof n == "object", a = o ?
|
|
2259
|
+
const o = typeof n == "object", a = o ? Y(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
|
|
2257
2260
|
if (!l)
|
|
2258
2261
|
return [];
|
|
2259
2262
|
const u = [];
|
|
2260
|
-
return ((
|
|
2261
|
-
|
|
2262
|
-
typeof
|
|
2263
|
+
return ((d) => {
|
|
2264
|
+
d && d.forEach((g) => {
|
|
2265
|
+
typeof g == "object" && (g.field && u.push(g), u.push(...s.getChildrenRuleList(g)));
|
|
2263
2266
|
});
|
|
2264
2267
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2265
2268
|
},
|
|
2266
2269
|
getParentRule(n) {
|
|
2267
|
-
return (typeof n == "object" ?
|
|
2270
|
+
return (typeof n == "object" ? Y(n) : t.getCtx(n)).parent.rule;
|
|
2268
2271
|
},
|
|
2269
2272
|
getParentSubRule(n) {
|
|
2270
|
-
const a = typeof n == "object" ?
|
|
2273
|
+
const a = typeof n == "object" ? Y(n) : t.getCtx(n);
|
|
2271
2274
|
if (a) {
|
|
2272
2275
|
const l = a.getParentGroup();
|
|
2273
2276
|
if (l)
|
|
2274
2277
|
return l.rule;
|
|
2275
2278
|
}
|
|
2276
2279
|
},
|
|
2277
|
-
getChildrenFormData(n) {
|
|
2278
|
-
return s.getChildrenRuleList(n).reduce((
|
|
2280
|
+
getChildrenFormData(n, o) {
|
|
2281
|
+
return s.getChildrenRuleList(n).reduce((l, u) => ((u.ignore !== !0 || o === !0) && (l[u.field] = be(u.value)), l), {});
|
|
2279
2282
|
},
|
|
2280
2283
|
setChildrenFormData(n, o, a) {
|
|
2281
2284
|
const l = s.getChildrenRuleList(n);
|
|
@@ -2288,7 +2291,7 @@ function Qr(t) {
|
|
|
2288
2291
|
getGlobalEvent(n) {
|
|
2289
2292
|
let o = s.options.globalEvent[n];
|
|
2290
2293
|
if (o)
|
|
2291
|
-
return typeof o == "object" && (o = o.handle),
|
|
2294
|
+
return typeof o == "object" && (o = o.handle), x(o);
|
|
2292
2295
|
},
|
|
2293
2296
|
getGlobalData(n) {
|
|
2294
2297
|
return new Promise((o, a) => {
|
|
@@ -2299,11 +2302,11 @@ function Qr(t) {
|
|
|
2299
2302
|
});
|
|
2300
2303
|
},
|
|
2301
2304
|
renderRule(n, o, a) {
|
|
2302
|
-
const u = typeof n == "object" ?
|
|
2305
|
+
const u = typeof n == "object" ? Y(n) : t.getCtx(n);
|
|
2303
2306
|
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2304
2307
|
},
|
|
2305
2308
|
renderChildren(n, o, a) {
|
|
2306
|
-
const u = typeof n == "object" ?
|
|
2309
|
+
const u = typeof n == "object" ? Y(n) : t.getCtx(n);
|
|
2307
2310
|
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2308
2311
|
},
|
|
2309
2312
|
nextTick(n) {
|
|
@@ -2321,21 +2324,23 @@ function Qr(t) {
|
|
|
2321
2324
|
bus: t.bus,
|
|
2322
2325
|
fetch(n) {
|
|
2323
2326
|
return new Promise((o, a) => {
|
|
2324
|
-
n =
|
|
2327
|
+
n = K(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
2325
2328
|
F(() => n.onSuccess && n.onSuccess(l)), o(l);
|
|
2326
2329
|
}).catch((l) => {
|
|
2327
2330
|
F(() => n.onError && n.onError(l)), a(l);
|
|
2328
|
-
}))
|
|
2331
|
+
})).catch((l) => {
|
|
2332
|
+
});
|
|
2329
2333
|
});
|
|
2330
2334
|
},
|
|
2331
2335
|
watchFetch(n, o, a, l) {
|
|
2332
|
-
return t.fc.watchLoadData((u,
|
|
2333
|
-
let
|
|
2334
|
-
|
|
2335
|
-
F(() =>
|
|
2336
|
-
}).catch((
|
|
2337
|
-
F(() =>
|
|
2338
|
-
}))
|
|
2336
|
+
return t.fc.watchLoadData((u, f) => {
|
|
2337
|
+
let d = K(n);
|
|
2338
|
+
d = t.loadFetchVar(d, u), !(l && l(d, f) === !1) && t.beforeFetch(d).then(() => gt(d, t.fc.create.fetch, s).then((g) => {
|
|
2339
|
+
F(() => d.onSuccess && d.onSuccess(g)), o && o(g, f);
|
|
2340
|
+
}).catch((g) => {
|
|
2341
|
+
F(() => d.onError && d.onError(g)), a && a(g);
|
|
2342
|
+
})).catch((g) => {
|
|
2343
|
+
});
|
|
2339
2344
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2340
2345
|
},
|
|
2341
2346
|
getData(n, o) {
|
|
@@ -2405,7 +2410,7 @@ function J(t) {
|
|
|
2405
2410
|
function Nt(t) {
|
|
2406
2411
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2407
2412
|
}
|
|
2408
|
-
function
|
|
2413
|
+
function Qr(t) {
|
|
2409
2414
|
_(t.prototype, {
|
|
2410
2415
|
initRender() {
|
|
2411
2416
|
this.cacheConfig = {};
|
|
@@ -2414,7 +2419,7 @@ function Yr(t) {
|
|
|
2414
2419
|
const r = (i) => {
|
|
2415
2420
|
if (i) {
|
|
2416
2421
|
let s;
|
|
2417
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2422
|
+
return e.rule.field && (s = i.$scopedSlots["field-" + ve(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + ve(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2418
2423
|
}
|
|
2419
2424
|
};
|
|
2420
2425
|
return r(this.vm);
|
|
@@ -2423,7 +2428,7 @@ function Yr(t) {
|
|
|
2423
2428
|
if (!this.vm.isShow)
|
|
2424
2429
|
return;
|
|
2425
2430
|
this.$manager.beforeRender();
|
|
2426
|
-
const e =
|
|
2431
|
+
const e = ke();
|
|
2427
2432
|
return this.sort.forEach((r) => {
|
|
2428
2433
|
this.renderSlot(e, this.$handle.ctxs[r]);
|
|
2429
2434
|
}), this.$manager.render(e);
|
|
@@ -2485,10 +2490,10 @@ function Yr(t) {
|
|
|
2485
2490
|
slotValue: l
|
|
2486
2491
|
};
|
|
2487
2492
|
l.length && i.slotUpdate && F(() => i.slotUpdate(u));
|
|
2488
|
-
let
|
|
2489
|
-
const
|
|
2490
|
-
e.parser.renderChildren ?
|
|
2491
|
-
|
|
2493
|
+
let f = [];
|
|
2494
|
+
const d = e.loadChildrenPending();
|
|
2495
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach(($) => {
|
|
2496
|
+
f.push(this.renderRule({
|
|
2492
2497
|
type: "template",
|
|
2493
2498
|
slot: $
|
|
2494
2499
|
}, (() => {
|
|
@@ -2498,9 +2503,9 @@ function Yr(t) {
|
|
|
2498
2503
|
return this.renderRule(w);
|
|
2499
2504
|
})()));
|
|
2500
2505
|
});
|
|
2501
|
-
const
|
|
2502
|
-
let
|
|
2503
|
-
return
|
|
2506
|
+
const g = this.getTypeSlot(e);
|
|
2507
|
+
let m;
|
|
2508
|
+
return g ? (u.children = f, m = g(u)) : m = a ? e.parser.preview(Je(f), e) : e.parser.render(Je(f), e), m = this.renderSides(m, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), m = this.$manager.makeWrap(e, m)), e.none && (Array.isArray(m) ? m = m.map(($) => !$ || !$.tag ? $ : this.none($)) : m = this.none(m)), o && this.setCache(e, () => this.stable(m), r), m;
|
|
2504
2509
|
}, this.setCache(e, s, r);
|
|
2505
2510
|
}
|
|
2506
2511
|
return (...s) => {
|
|
@@ -2567,8 +2572,8 @@ function Yr(t) {
|
|
|
2567
2572
|
preview: e.prop.preview,
|
|
2568
2573
|
options: e.prop.options,
|
|
2569
2574
|
prop: function() {
|
|
2570
|
-
const s =
|
|
2571
|
-
return s.on = s.on ?
|
|
2575
|
+
const s = v({}, e.prop);
|
|
2576
|
+
return s.on = s.on ? v({}, s.on) : {}, delete s.model, s;
|
|
2572
2577
|
}(),
|
|
2573
2578
|
children: e.loadChildrenPending()
|
|
2574
2579
|
}), i;
|
|
@@ -2576,7 +2581,7 @@ function Yr(t) {
|
|
|
2576
2581
|
ctxProp(e) {
|
|
2577
2582
|
const { ref: r, key: i, rule: s } = e;
|
|
2578
2583
|
this.$manager.mergeProp(e), e.parser.mergeProp(e);
|
|
2579
|
-
const n =
|
|
2584
|
+
const n = v({}, e.prop.on || {}), o = {};
|
|
2580
2585
|
Object.keys(n).forEach((l) => {
|
|
2581
2586
|
l.indexOf("native.") === 0 && (o[l.replace("native.", "")] = n[l], delete n[l]);
|
|
2582
2587
|
}), e.prop.on = n;
|
|
@@ -2632,7 +2637,7 @@ function Yr(t) {
|
|
|
2632
2637
|
},
|
|
2633
2638
|
renderChildren(e, r, i) {
|
|
2634
2639
|
if (!h.trueArray(e)) return [];
|
|
2635
|
-
const s =
|
|
2640
|
+
const s = ke();
|
|
2636
2641
|
return e.map((n) => {
|
|
2637
2642
|
if (n) {
|
|
2638
2643
|
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
@@ -2658,7 +2663,7 @@ function Yr(t) {
|
|
|
2658
2663
|
},
|
|
2659
2664
|
createRuleVnode(e, r, i) {
|
|
2660
2665
|
this.force = i !== !1, this.tmpInput = r;
|
|
2661
|
-
const s =
|
|
2666
|
+
const s = ke();
|
|
2662
2667
|
return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
|
|
2663
2668
|
},
|
|
2664
2669
|
renderRule(e, r, i) {
|
|
@@ -2673,16 +2678,16 @@ function Yr(t) {
|
|
|
2673
2678
|
a && (s = J(a));
|
|
2674
2679
|
}
|
|
2675
2680
|
if (!s) return;
|
|
2676
|
-
const n =
|
|
2681
|
+
const n = ke();
|
|
2677
2682
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2678
2683
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2679
2684
|
});
|
|
2680
|
-
const o =
|
|
2685
|
+
const o = v({}, e);
|
|
2681
2686
|
return delete o.type, delete o.is, this.vNode.make(s, o, n.mergeBag(r).getSlots());
|
|
2682
2687
|
}
|
|
2683
2688
|
});
|
|
2684
2689
|
}
|
|
2685
|
-
let
|
|
2690
|
+
let Yr = 1;
|
|
2686
2691
|
function rt(t) {
|
|
2687
2692
|
_(this, {
|
|
2688
2693
|
$handle: t,
|
|
@@ -2692,7 +2697,7 @@ function rt(t) {
|
|
|
2692
2697
|
vNode: new t.fc.CreateNode(t.vm),
|
|
2693
2698
|
force: !1,
|
|
2694
2699
|
tmpInput: null,
|
|
2695
|
-
id:
|
|
2700
|
+
id: Yr++
|
|
2696
2701
|
}), Pt(this, {
|
|
2697
2702
|
options() {
|
|
2698
2703
|
return t.options;
|
|
@@ -2703,7 +2708,7 @@ function rt(t) {
|
|
|
2703
2708
|
}), this.initCache(), this.initRender();
|
|
2704
2709
|
}
|
|
2705
2710
|
Zr(rt);
|
|
2706
|
-
|
|
2711
|
+
Qr(rt);
|
|
2707
2712
|
function ei(t) {
|
|
2708
2713
|
_(t.prototype, {
|
|
2709
2714
|
parseInjectEvent(e, r) {
|
|
@@ -2722,26 +2727,26 @@ function ei(t) {
|
|
|
2722
2727
|
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2723
2728
|
return this.parseEventLst(e, r, i, !0);
|
|
2724
2729
|
if (h.String(r)) {
|
|
2725
|
-
const n =
|
|
2730
|
+
const n = x(r);
|
|
2726
2731
|
if (n && r !== n)
|
|
2727
2732
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2728
2733
|
}
|
|
2729
2734
|
},
|
|
2730
2735
|
parseEmit(e, r) {
|
|
2731
2736
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2732
|
-
return h.trueArray(u) && u.forEach((
|
|
2733
|
-
if (!
|
|
2734
|
-
let
|
|
2735
|
-
if (h.Object(
|
|
2736
|
-
r || (
|
|
2737
|
-
const
|
|
2738
|
-
this.vm.$emit(
|
|
2737
|
+
return h.trueArray(u) && u.forEach((f) => {
|
|
2738
|
+
if (!f) return;
|
|
2739
|
+
let d, g = n || o || a;
|
|
2740
|
+
if (h.Object(f) && (d = f.inject, f = f.name, g = f.prefix || g), g) {
|
|
2741
|
+
r || (g = `native-${g}`);
|
|
2742
|
+
const m = ve(`${g}-${f}`), $ = (...w) => {
|
|
2743
|
+
this.vm.$emit(m, ...w), this.vm.$emit("emit-event", m, ...w), this.bus.$emit(m, ...w);
|
|
2739
2744
|
};
|
|
2740
|
-
if ($.__emit = !0, !
|
|
2741
|
-
i[
|
|
2745
|
+
if ($.__emit = !0, !d && l === !1)
|
|
2746
|
+
i[f] = $;
|
|
2742
2747
|
else {
|
|
2743
|
-
let w =
|
|
2744
|
-
i[
|
|
2748
|
+
let w = d || l || this.options.injectEvent;
|
|
2749
|
+
i[f] = h.Undef(w) ? $ : this.inject(s, $, w);
|
|
2745
2750
|
}
|
|
2746
2751
|
}
|
|
2747
2752
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2776,16 +2781,16 @@ function ei(t) {
|
|
|
2776
2781
|
if (n.forEach((a) => {
|
|
2777
2782
|
const l = a.split("||"), u = l[0].trim();
|
|
2778
2783
|
if (u) {
|
|
2779
|
-
const
|
|
2780
|
-
let
|
|
2784
|
+
const f = (l[1] || "").trim();
|
|
2785
|
+
let d, g = !1;
|
|
2781
2786
|
if (i && u.indexOf("$form.") === 0) {
|
|
2782
|
-
const
|
|
2783
|
-
|
|
2784
|
-
id: "$form." +
|
|
2785
|
-
getValue: () => B(i.value,
|
|
2786
|
-
}) : B(i.value,
|
|
2787
|
+
const m = u.split(".");
|
|
2788
|
+
m.shift(), D(i.value, m[0]) && (g = !0, d = r ? r({
|
|
2789
|
+
id: "$form." + m[0] + "_" + i.rule.__fc__.id,
|
|
2790
|
+
getValue: () => B(i.value, m)
|
|
2791
|
+
}) : B(i.value, m));
|
|
2787
2792
|
}
|
|
2788
|
-
|
|
2793
|
+
g || (d = r ? r(u, f) : this.fc.getLoadData(u, f)), o = d, e = e.replaceAll(`{{${a}}}`, d == null ? "" : d);
|
|
2789
2794
|
}
|
|
2790
2795
|
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2791
2796
|
return o;
|
|
@@ -2848,9 +2853,9 @@ function ii(t) {
|
|
|
2848
2853
|
}
|
|
2849
2854
|
function ni(t) {
|
|
2850
2855
|
Object.defineProperties(t.origin, {
|
|
2851
|
-
__fc__:
|
|
2856
|
+
__fc__: ze(ge(t), !0)
|
|
2852
2857
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2853
|
-
__fc__:
|
|
2858
|
+
__fc__: ze(ge(t), !0)
|
|
2854
2859
|
});
|
|
2855
2860
|
}
|
|
2856
2861
|
function qt(t, e, r) {
|
|
@@ -2872,14 +2877,14 @@ function qt(t, e, r) {
|
|
|
2872
2877
|
parent: null,
|
|
2873
2878
|
group: e.subRule ? this : null,
|
|
2874
2879
|
cacheConfig: null,
|
|
2875
|
-
prop:
|
|
2880
|
+
prop: v({}, e),
|
|
2876
2881
|
computed: {},
|
|
2877
2882
|
payload: {},
|
|
2878
2883
|
refRule: {},
|
|
2879
2884
|
input: s,
|
|
2880
2885
|
el: void 0,
|
|
2881
2886
|
exportEl: void 0,
|
|
2882
|
-
defaultValue: s ?
|
|
2887
|
+
defaultValue: s ? K(r) : void 0,
|
|
2883
2888
|
field: e.field || void 0
|
|
2884
2889
|
}), this.updateKey(), ni(this), this.update(t, !0);
|
|
2885
2890
|
}
|
|
@@ -2920,8 +2925,8 @@ _(qt.prototype, {
|
|
|
2920
2925
|
rule: this.rule,
|
|
2921
2926
|
api: this.$api,
|
|
2922
2927
|
update: (u) => {
|
|
2923
|
-
const
|
|
2924
|
-
this.setPending(e, r,
|
|
2928
|
+
const f = u || i, d = this.getPending(e, i);
|
|
2929
|
+
this.setPending(e, r, f), o && o(f, d);
|
|
2925
2930
|
},
|
|
2926
2931
|
reload: () => {
|
|
2927
2932
|
const u = this.getPending(e, i);
|
|
@@ -2929,8 +2934,8 @@ _(qt.prototype, {
|
|
|
2929
2934
|
}
|
|
2930
2935
|
}));
|
|
2931
2936
|
l && h.Function(l.then) ? (l.then((u) => {
|
|
2932
|
-
const
|
|
2933
|
-
this.setPending(e, r,
|
|
2937
|
+
const f = u || i;
|
|
2938
|
+
this.setPending(e, r, f), s && s(f), this.$api && this.$api.sync(this.rule);
|
|
2934
2939
|
}).catch((u) => {
|
|
2935
2940
|
console.error(u);
|
|
2936
2941
|
}), a = i, this.setPending(e, r, a)) : (a = l || i, this.setPending(e, r, a), s && s(a));
|
|
@@ -2963,7 +2968,7 @@ _(qt.prototype, {
|
|
|
2963
2968
|
},
|
|
2964
2969
|
initProp() {
|
|
2965
2970
|
var e, r;
|
|
2966
|
-
const t =
|
|
2971
|
+
const t = v({}, this.rule);
|
|
2967
2972
|
delete t.children, delete t.validate, this.prop = te({}, [t, ...Object.keys(this.payload).map((i) => this.payload[i]), this.computed]), this.prop.validate = [...((r = (e = this.refRule) == null ? void 0 : e.__$validate) == null ? void 0 : r.value) || [], ...this.prop.validate || []];
|
|
2968
2973
|
},
|
|
2969
2974
|
initNone() {
|
|
@@ -3039,12 +3044,12 @@ function si(t) {
|
|
|
3039
3044
|
});
|
|
3040
3045
|
},
|
|
3041
3046
|
parseRule(e) {
|
|
3042
|
-
const r =
|
|
3047
|
+
const r = ct(e);
|
|
3043
3048
|
return Object.defineProperties(r, {
|
|
3044
|
-
__origin__:
|
|
3049
|
+
__origin__: ze(e, !0)
|
|
3045
3050
|
}), oi(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
3046
3051
|
i && this.loadFn(i, r);
|
|
3047
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
3052
|
+
}), this.loadCtrl(r), r.update && (r.update = x(r.update)), r;
|
|
3048
3053
|
},
|
|
3049
3054
|
loadFn(e, r) {
|
|
3050
3055
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -3053,7 +3058,7 @@ function si(t) {
|
|
|
3053
3058
|
},
|
|
3054
3059
|
loadCtrl(e) {
|
|
3055
3060
|
e.control && e.control.forEach((r) => {
|
|
3056
|
-
r.handle && (r.handle =
|
|
3061
|
+
r.handle && (r.handle = x(r.handle));
|
|
3057
3062
|
});
|
|
3058
3063
|
},
|
|
3059
3064
|
syncProp(e) {
|
|
@@ -3089,37 +3094,37 @@ function si(t) {
|
|
|
3089
3094
|
if (r && !h.Object(o) || !this.pageEnd && !r && a >= this.first) return;
|
|
3090
3095
|
if (o.__fc__ && o.__fc__.root === e && this.ctxs[o.__fc__.id])
|
|
3091
3096
|
return s(o.__fc__.loadChildrenPending(), o.__fc__), o.__fc__;
|
|
3092
|
-
let l =
|
|
3097
|
+
let l = ct(o);
|
|
3093
3098
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3094
3099
|
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);
|
|
3095
|
-
let
|
|
3096
|
-
if (
|
|
3097
|
-
if (
|
|
3098
|
-
if ($t(
|
|
3100
|
+
let f, d = !1, g = !!o.__fc__, m = l.value;
|
|
3101
|
+
if (g) {
|
|
3102
|
+
if (f = o.__fc__, m = f.defaultValue, f.deleted) {
|
|
3103
|
+
if ($t(f))
|
|
3099
3104
|
return;
|
|
3100
|
-
|
|
3101
|
-
} else if (!
|
|
3102
|
-
if ($t(
|
|
3105
|
+
f.update(this);
|
|
3106
|
+
} else if (!f.check(this)) {
|
|
3107
|
+
if ($t(f))
|
|
3103
3108
|
return;
|
|
3104
|
-
e[a] = o = o._clone ? o._clone() : At(_e(o)),
|
|
3109
|
+
e[a] = o = o._clone ? o._clone() : At(_e(o)), f = null, d = !0;
|
|
3105
3110
|
}
|
|
3106
3111
|
}
|
|
3107
|
-
if (
|
|
3108
|
-
|
|
3112
|
+
if (f)
|
|
3113
|
+
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3109
3114
|
else {
|
|
3110
3115
|
const O = this.parseRule(o);
|
|
3111
|
-
|
|
3116
|
+
f = new qt(this, O, m), this.bindParser(f);
|
|
3112
3117
|
}
|
|
3113
|
-
[!1, !0].forEach((O) => this.parseEmit(
|
|
3114
|
-
const $ =
|
|
3115
|
-
if (
|
|
3118
|
+
[!1, !0].forEach((O) => this.parseEmit(f, O)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !d && !g && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
|
|
3119
|
+
const $ = f.loadChildrenPending();
|
|
3120
|
+
if (f.parser.loadChildren === !1 || s($, f), !r) {
|
|
3116
3121
|
const O = i(a);
|
|
3117
|
-
O > -1 || !a ? this.sort.splice(O + 1, 0,
|
|
3122
|
+
O > -1 || !a ? this.sort.splice(O + 1, 0, f.id) : this.sort.push(f.id);
|
|
3118
3123
|
}
|
|
3119
|
-
const w =
|
|
3120
|
-
return
|
|
3121
|
-
this.refreshUpdate(
|
|
3122
|
-
}), this.effect(
|
|
3124
|
+
const w = f.rule;
|
|
3125
|
+
return f.updated || (f.updated = !0, h.Function(w.update) && this.bus.$once("load-end", () => {
|
|
3126
|
+
this.refreshUpdate(f, w.value, "init");
|
|
3127
|
+
}), this.effect(f, "loaded")), this.refreshControl(f) && (this.cycleLoad = !0), f;
|
|
3123
3128
|
}).filter((o) => !!o);
|
|
3124
3129
|
r && (r.children = n);
|
|
3125
3130
|
},
|
|
@@ -3130,28 +3135,28 @@ function si(t) {
|
|
|
3130
3135
|
const r = ai(e), i = [], s = this.api;
|
|
3131
3136
|
if (!r.length) return !1;
|
|
3132
3137
|
for (let a = 0; a < r.length; a++) {
|
|
3133
|
-
const l = r[a], u = l.handle || function(
|
|
3134
|
-
return (
|
|
3138
|
+
const l = r[a], u = l.handle || function(d) {
|
|
3139
|
+
return (fe[l.condition || "=="] || fe["=="])(d, l.value);
|
|
3135
3140
|
};
|
|
3136
3141
|
if (!h.trueArray(l.rule)) continue;
|
|
3137
|
-
const
|
|
3142
|
+
const f = q(v({}, l), {
|
|
3138
3143
|
valid: F(() => u(e.rule.value, s)),
|
|
3139
3144
|
ctrl: li(e, l.rule),
|
|
3140
3145
|
isHidden: h.String(l.rule[0])
|
|
3141
3146
|
});
|
|
3142
|
-
|
|
3147
|
+
f.valid && f.ctrl || !f.valid && !f.ctrl && !f.isHidden || i.push(f);
|
|
3143
3148
|
}
|
|
3144
3149
|
if (!i.length) return !1;
|
|
3145
3150
|
const n = [];
|
|
3146
3151
|
let o = !1;
|
|
3147
3152
|
return this.deferSyncValue(() => {
|
|
3148
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend:
|
|
3153
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: d, child: g, ctrl: m, method: $ }) => {
|
|
3149
3154
|
if (a) {
|
|
3150
3155
|
l ? e.ctrlRule.push({
|
|
3151
3156
|
__ctrl: !0,
|
|
3152
3157
|
children: u,
|
|
3153
3158
|
valid: l
|
|
3154
|
-
}) :
|
|
3159
|
+
}) : m && e.ctrlRule.splice(e.ctrlRule.indexOf(m) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3155
3160
|
$ === "disabled" || $ === "enabled" ? this.api.disabled(!l, u) : $ === "display" || $ === "show" ? this.api.display(l, u) : $ === "required" ? (u.forEach((w) => {
|
|
3156
3161
|
this.api.setEffect(w, "required", l);
|
|
3157
3162
|
}), l || this.api.clearValidateState(u)) : $ === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
@@ -3167,11 +3172,11 @@ function si(t) {
|
|
|
3167
3172
|
children: u
|
|
3168
3173
|
};
|
|
3169
3174
|
e.ctrlRule.push(w), this.bus.$once("load-start", () => {
|
|
3170
|
-
|
|
3175
|
+
f ? s.prepend(w, f, g) : d || g ? s.append(w, d || e.id, g) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, w);
|
|
3171
3176
|
});
|
|
3172
3177
|
} else {
|
|
3173
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3174
|
-
const w =
|
|
3178
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(m), 1);
|
|
3179
|
+
const w = Y(m);
|
|
3175
3180
|
w && w.rm();
|
|
3176
3181
|
}
|
|
3177
3182
|
});
|
|
@@ -3186,7 +3191,7 @@ function si(t) {
|
|
|
3186
3191
|
},
|
|
3187
3192
|
_reloadRule(e) {
|
|
3188
3193
|
e || (e = this.rules);
|
|
3189
|
-
const r =
|
|
3194
|
+
const r = v({}, this.ctxs);
|
|
3190
3195
|
this.clearNextTick(), this.initData(e), this.fc.rules = e, this.deferSyncValue(() => {
|
|
3191
3196
|
this.bus.$once("load-end", () => {
|
|
3192
3197
|
Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
|
|
@@ -3289,7 +3294,7 @@ function ui(t) {
|
|
|
3289
3294
|
}), this.vm.updateValue(e);
|
|
3290
3295
|
},
|
|
3291
3296
|
isChange(e, r) {
|
|
3292
|
-
return JSON.stringify(this.getFormData(e),
|
|
3297
|
+
return JSON.stringify(this.getFormData(e), bt) !== JSON.stringify(r, bt);
|
|
3293
3298
|
},
|
|
3294
3299
|
isQuote(e, r) {
|
|
3295
3300
|
return (r instanceof Function || h.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
@@ -3322,7 +3327,7 @@ function ui(t) {
|
|
|
3322
3327
|
}
|
|
3323
3328
|
});
|
|
3324
3329
|
}
|
|
3325
|
-
function
|
|
3330
|
+
function bt(t, e) {
|
|
3326
3331
|
return typeof e == "function" ? "" + e : e;
|
|
3327
3332
|
}
|
|
3328
3333
|
const De = {
|
|
@@ -3344,8 +3349,8 @@ const De = {
|
|
|
3344
3349
|
},
|
|
3345
3350
|
mergeProp(t) {
|
|
3346
3351
|
}
|
|
3347
|
-
},
|
|
3348
|
-
function
|
|
3352
|
+
}, fi = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"];
|
|
3353
|
+
function ci(t) {
|
|
3349
3354
|
_(t.prototype, {
|
|
3350
3355
|
getCtx(e) {
|
|
3351
3356
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
@@ -3393,7 +3398,7 @@ function fi(t) {
|
|
|
3393
3398
|
this.noWatchFn || (this.noWatchFn = e), F(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
3394
3399
|
},
|
|
3395
3400
|
watchCtx(e) {
|
|
3396
|
-
if (
|
|
3401
|
+
if (Rt().filter((i) => i[0] !== "_" && i[0] !== "$" && fi.indexOf(i) === -1).forEach((i) => {
|
|
3397
3402
|
const s = je(e.rule, i), n = i === "children";
|
|
3398
3403
|
e.refRule[i] = s, e.watch.push(L(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3399
3404
|
let l = s.value;
|
|
@@ -3429,27 +3434,38 @@ function fi(t) {
|
|
|
3429
3434
|
s && (i = this.api.t(s[1]));
|
|
3430
3435
|
}
|
|
3431
3436
|
return i;
|
|
3432
|
-
}), e.refRule.__$validate = ye(() =>
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3437
|
+
}), e.refRule.__$validate = ye(() => {
|
|
3438
|
+
const i = (s) => {
|
|
3439
|
+
var o, a;
|
|
3440
|
+
const n = s.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3441
|
+
return n ? this.api.t(n[1], { title: (a = (o = e.refRule) == null ? void 0 : o.__$title) == null ? void 0 : a.value }) : s;
|
|
3442
|
+
};
|
|
3443
|
+
return H(e.rule.validate).map((s) => {
|
|
3444
|
+
const n = v({}, s);
|
|
3445
|
+
if (n.message && (n.message = i(n.message)), h.Function(n.validator)) {
|
|
3446
|
+
const o = e;
|
|
3447
|
+
n.validator = function(...a) {
|
|
3448
|
+
return s.validator.call({
|
|
3449
|
+
that: this,
|
|
3450
|
+
id: o.id,
|
|
3451
|
+
field: o.field,
|
|
3452
|
+
rule: o.rule,
|
|
3453
|
+
api: o.$handle.api
|
|
3454
|
+
}, ...a);
|
|
3455
|
+
};
|
|
3456
|
+
}
|
|
3457
|
+
if (n.adapter) {
|
|
3458
|
+
if (typeof n.error == "object") {
|
|
3459
|
+
const o = v({}, n.error);
|
|
3460
|
+
Object.keys(o).forEach((a) => {
|
|
3461
|
+
o[a] = i(o[a]);
|
|
3462
|
+
}), n.error = o;
|
|
3463
|
+
}
|
|
3464
|
+
return this.adapterValidate(n, e);
|
|
3465
|
+
}
|
|
3466
|
+
return n;
|
|
3467
|
+
});
|
|
3468
|
+
}), e.input) {
|
|
3453
3469
|
const i = je(e.rule, "value");
|
|
3454
3470
|
e.watch.push(L(() => i.value, () => {
|
|
3455
3471
|
let s = e.parser.toFormValue(i.value, e);
|
|
@@ -3476,6 +3492,115 @@ function fi(t) {
|
|
|
3476
3492
|
}));
|
|
3477
3493
|
}), this.watchEffect(e);
|
|
3478
3494
|
},
|
|
3495
|
+
adapterValidate(e, r) {
|
|
3496
|
+
const i = (s, n) => {
|
|
3497
|
+
if ((e.beforeValidate && F(() => e.beforeValidate({
|
|
3498
|
+
value: s,
|
|
3499
|
+
api: this.api,
|
|
3500
|
+
validate: e,
|
|
3501
|
+
rule: r.rule
|
|
3502
|
+
}))) === !1)
|
|
3503
|
+
n();
|
|
3504
|
+
else {
|
|
3505
|
+
const a = this.validator(s, e);
|
|
3506
|
+
if (a) {
|
|
3507
|
+
let l = "";
|
|
3508
|
+
typeof e.error == "object" && (l = e.error[a] || e.error.default), !l && typeof e.message == "string" && (l = e.message), l || (l = this.getValidateMessage(r, { key: a, rule: e[a] })), n(l);
|
|
3509
|
+
} else if (e.validator) {
|
|
3510
|
+
const l = e.validator && F(() => e.validator(s, n));
|
|
3511
|
+
l && h.Function(l.then) && l.then(() => n()).catch((u) => n(u));
|
|
3512
|
+
} else
|
|
3513
|
+
n();
|
|
3514
|
+
}
|
|
3515
|
+
};
|
|
3516
|
+
return this.$manager.adapterValidate({
|
|
3517
|
+
required: e.required,
|
|
3518
|
+
message: e.message,
|
|
3519
|
+
target: e.trigger
|
|
3520
|
+
}, i);
|
|
3521
|
+
},
|
|
3522
|
+
getValidateMessage(e, r) {
|
|
3523
|
+
var s, n;
|
|
3524
|
+
const i = Array.isArray(r.rule) ? r.rule.join(",") : "" + r.rule;
|
|
3525
|
+
return this.api.t(r.key === "required" ? r.key : "validate." + r.key, {
|
|
3526
|
+
[r.key]: i,
|
|
3527
|
+
title: (n = (s = e.refRule) == null ? void 0 : s.__$title) == null ? void 0 : n.value
|
|
3528
|
+
});
|
|
3529
|
+
},
|
|
3530
|
+
validator(e, r) {
|
|
3531
|
+
if (h.empty(e))
|
|
3532
|
+
return r.required ? "required" : void 0;
|
|
3533
|
+
for (const [s, n] of Object.entries(r))
|
|
3534
|
+
switch (s) {
|
|
3535
|
+
case "len":
|
|
3536
|
+
case "maxLen":
|
|
3537
|
+
case "minLen":
|
|
3538
|
+
const o = (m) => s === "len" ? m === n : s === "maxLen" ? m <= n : m >= n;
|
|
3539
|
+
if (Array.isArray(e)) {
|
|
3540
|
+
if (!o(e.length))
|
|
3541
|
+
return s;
|
|
3542
|
+
} else {
|
|
3543
|
+
if (typeof e == "object")
|
|
3544
|
+
return s;
|
|
3545
|
+
if (!o(("" + e).length))
|
|
3546
|
+
return s;
|
|
3547
|
+
}
|
|
3548
|
+
break;
|
|
3549
|
+
case "pattern":
|
|
3550
|
+
if (!(typeof n == "string" ? new RegExp(n) : n).test("" + e))
|
|
3551
|
+
return s;
|
|
3552
|
+
break;
|
|
3553
|
+
case "uppercase":
|
|
3554
|
+
if (n && (typeof e != "string" || !/^[A-Z]*$/.test(e)))
|
|
3555
|
+
return s;
|
|
3556
|
+
break;
|
|
3557
|
+
case "lowercase":
|
|
3558
|
+
if (n && (typeof e != "string" || !/^[a-z]*$/.test(e)))
|
|
3559
|
+
return s;
|
|
3560
|
+
break;
|
|
3561
|
+
case "min":
|
|
3562
|
+
case "max":
|
|
3563
|
+
case "positive":
|
|
3564
|
+
case "negative":
|
|
3565
|
+
case "integer":
|
|
3566
|
+
case "number":
|
|
3567
|
+
const l = Number(e);
|
|
3568
|
+
if (Number.isNaN(l) || s === "min" && l < n || s === "max" && l > n || s === "positive" && l <= 0 || s === "negative" && l >= 0 || s === "integer" && !Number.isInteger(l))
|
|
3569
|
+
return s;
|
|
3570
|
+
break;
|
|
3571
|
+
case "equal":
|
|
3572
|
+
if (e !== n)
|
|
3573
|
+
return s;
|
|
3574
|
+
break;
|
|
3575
|
+
case "enum":
|
|
3576
|
+
if (Array.isArray(n) && !n.includes(e))
|
|
3577
|
+
return s;
|
|
3578
|
+
break;
|
|
3579
|
+
case "hasKeys":
|
|
3580
|
+
if (typeof e != "object" || Array.isArray(n) && n.some((m) => !(m in e)))
|
|
3581
|
+
return s;
|
|
3582
|
+
break;
|
|
3583
|
+
case "email":
|
|
3584
|
+
if (!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test("" + e))
|
|
3585
|
+
return s;
|
|
3586
|
+
break;
|
|
3587
|
+
case "url":
|
|
3588
|
+
if (!new RegExp(
|
|
3589
|
+
"^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
|
|
3590
|
+
"i"
|
|
3591
|
+
).test("" + e))
|
|
3592
|
+
return s;
|
|
3593
|
+
break;
|
|
3594
|
+
case "ip":
|
|
3595
|
+
if (!/^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/.test("" + e))
|
|
3596
|
+
return s;
|
|
3597
|
+
break;
|
|
3598
|
+
case "phone":
|
|
3599
|
+
if (!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test("" + e))
|
|
3600
|
+
return s;
|
|
3601
|
+
break;
|
|
3602
|
+
}
|
|
3603
|
+
},
|
|
3479
3604
|
compute(e, r) {
|
|
3480
3605
|
let i;
|
|
3481
3606
|
if (typeof r == "object") {
|
|
@@ -3484,19 +3609,19 @@ function fi(t) {
|
|
|
3484
3609
|
return !0;
|
|
3485
3610
|
const l = a.mode === "OR";
|
|
3486
3611
|
let u = !0;
|
|
3487
|
-
for (let
|
|
3488
|
-
const
|
|
3489
|
-
let
|
|
3490
|
-
if (
|
|
3491
|
-
|
|
3492
|
-
else if (
|
|
3493
|
-
|
|
3494
|
-
else if (!
|
|
3612
|
+
for (let f = 0; f < a.group.length; f++) {
|
|
3613
|
+
const d = a.group[f];
|
|
3614
|
+
let g, m = null;
|
|
3615
|
+
if (d.variable)
|
|
3616
|
+
m = JSON.stringify(this.fc.getLoadData(d.variable) || "");
|
|
3617
|
+
else if (d.field)
|
|
3618
|
+
m = dt(d.field || "");
|
|
3619
|
+
else if (!d.mode)
|
|
3495
3620
|
return !0;
|
|
3496
|
-
let $ =
|
|
3497
|
-
if ($ && ($ = dt($ || "")),
|
|
3621
|
+
let $ = d.compare;
|
|
3622
|
+
if ($ && ($ = dt($ || "")), d.mode ? g = n(d) : fe[d.condition] ? h.Function(d.handler) ? g = F(() => d.handler(this.api, e.rule)) : g = F(() => new Function("$condition", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${d.condition}'](${m}, ${$ || "$val"}); }}}}`).call(this.api.form, fe, d.value, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : g = !1, l && g)
|
|
3498
3623
|
return !0;
|
|
3499
|
-
l || (u = u &&
|
|
3624
|
+
l || (u = u && g);
|
|
3500
3625
|
}
|
|
3501
3626
|
return l ? !1 : u;
|
|
3502
3627
|
};
|
|
@@ -3566,7 +3691,7 @@ function hi(t) {
|
|
|
3566
3691
|
emitEvent(e, ...r) {
|
|
3567
3692
|
const i = this.options[e] || this.options[J("on-" + e)];
|
|
3568
3693
|
if (i) {
|
|
3569
|
-
const s =
|
|
3694
|
+
const s = x(i);
|
|
3570
3695
|
h.Function(s) && F(() => s(...r));
|
|
3571
3696
|
}
|
|
3572
3697
|
this.bus.$emit(e, ...r);
|
|
@@ -3575,7 +3700,7 @@ function hi(t) {
|
|
|
3575
3700
|
var n, o;
|
|
3576
3701
|
let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
|
|
3577
3702
|
s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
|
|
3578
|
-
F(() => a(q(
|
|
3703
|
+
F(() => a(q(v({}, i || {}), { self: e.rule, rule: e.rule, $f: this.api, api: this.api, option: this.vm.$props.option })));
|
|
3579
3704
|
}));
|
|
3580
3705
|
}
|
|
3581
3706
|
});
|
|
@@ -3639,19 +3764,19 @@ function di(t) {
|
|
|
3639
3764
|
},
|
|
3640
3765
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3641
3766
|
if (!s || ["fcFragment", "fragment"].indexOf(s) > -1) return;
|
|
3642
|
-
const l = n || Object.keys(r).reduce((u,
|
|
3767
|
+
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u), v({}, r.effect || {}));
|
|
3643
3768
|
Object.keys(l).forEach((u) => {
|
|
3644
|
-
const
|
|
3645
|
-
if (!
|
|
3646
|
-
let
|
|
3647
|
-
if (!
|
|
3648
|
-
|
|
3649
|
-
else if (
|
|
3650
|
-
|
|
3769
|
+
const f = this.providers[u];
|
|
3770
|
+
if (!f || f.input && !i) return;
|
|
3771
|
+
let d;
|
|
3772
|
+
if (!f._c)
|
|
3773
|
+
d = "*";
|
|
3774
|
+
else if (f._used.indexOf(s) > -1)
|
|
3775
|
+
d = s;
|
|
3651
3776
|
else
|
|
3652
3777
|
return;
|
|
3653
|
-
const
|
|
3654
|
-
e && (
|
|
3778
|
+
const g = v({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3779
|
+
e && (g.getProp = () => e.effectData(u), g.clearProp = () => e.clearEffectData(u), g.mergeProp = (m) => te(g.getProp(), [m]), g.id = e.id), this.bus.$emit(`p:${u}:${d}:${f.input ? 1 : 0}`, o, [g, r, this.api]);
|
|
3655
3780
|
});
|
|
3656
3781
|
}
|
|
3657
3782
|
});
|
|
@@ -3668,7 +3793,7 @@ function mi(t) {
|
|
|
3668
3793
|
return r.length ? r : !1;
|
|
3669
3794
|
} else return h.String(e) ? [e] : !1;
|
|
3670
3795
|
}
|
|
3671
|
-
function
|
|
3796
|
+
function X(t) {
|
|
3672
3797
|
Pt(this, {
|
|
3673
3798
|
options() {
|
|
3674
3799
|
return t.options.value || {};
|
|
@@ -3706,9 +3831,9 @@ function Q(t) {
|
|
|
3706
3831
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3707
3832
|
const i = F(() => r(e, this));
|
|
3708
3833
|
return i && i !== e && _(e, i), e;
|
|
3709
|
-
},
|
|
3834
|
+
}, Xr(this));
|
|
3710
3835
|
}
|
|
3711
|
-
_(
|
|
3836
|
+
_(X.prototype, {
|
|
3712
3837
|
initData(t) {
|
|
3713
3838
|
_(this, {
|
|
3714
3839
|
ctxs: {},
|
|
@@ -3722,7 +3847,7 @@ _(Q.prototype, {
|
|
|
3722
3847
|
this.updateAppendData(), this.useProvider(), this.usePage(), this.loadRule(), this.$manager.__init(), this.lifecycle("created");
|
|
3723
3848
|
},
|
|
3724
3849
|
updateAppendData() {
|
|
3725
|
-
this.appendData =
|
|
3850
|
+
this.appendData = v(v(v({}, this.options.formData || {}), this.fc.vm.$options.propsData.value || {}), this.appendData);
|
|
3726
3851
|
},
|
|
3727
3852
|
isBreakWatch() {
|
|
3728
3853
|
return this.loading || this.noWatchFn || this.reloading;
|
|
@@ -3737,18 +3862,23 @@ _(Q.prototype, {
|
|
|
3737
3862
|
return new Promise((e, r) => {
|
|
3738
3863
|
const i = t && t.beforeFetch && F(() => t.beforeFetch(t, { api: this.api }));
|
|
3739
3864
|
i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
|
|
3740
|
-
}).then(() => this.globalBeforeFetch(t))
|
|
3865
|
+
}).then(() => this.globalBeforeFetch(t));
|
|
3866
|
+
},
|
|
3867
|
+
beforeSubmit(t) {
|
|
3868
|
+
return new Promise((e, r) => {
|
|
3869
|
+
const i = this.options.beforeSubmit && F(() => this.options.beforeSubmit(t, { api: this.api }));
|
|
3870
|
+
i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
|
|
3741
3871
|
});
|
|
3742
3872
|
}
|
|
3743
3873
|
});
|
|
3744
|
-
ei(
|
|
3745
|
-
ti(
|
|
3746
|
-
ii(
|
|
3747
|
-
si(
|
|
3748
|
-
ui(
|
|
3749
|
-
|
|
3750
|
-
hi(
|
|
3751
|
-
di(
|
|
3874
|
+
ei(X);
|
|
3875
|
+
ti(X);
|
|
3876
|
+
ii(X);
|
|
3877
|
+
si(X);
|
|
3878
|
+
ui(X);
|
|
3879
|
+
ci(X);
|
|
3880
|
+
hi(X);
|
|
3881
|
+
di(X);
|
|
3752
3882
|
const gi = "fcFragment", Le = {
|
|
3753
3883
|
name: gi,
|
|
3754
3884
|
functional: !0,
|
|
@@ -3792,7 +3922,7 @@ function $i() {
|
|
|
3792
3922
|
},
|
|
3793
3923
|
use(r) {
|
|
3794
3924
|
Object.keys(r).forEach((i) => {
|
|
3795
|
-
const s =
|
|
3925
|
+
const s = ve(i), n = jt(i).toLocaleLowerCase(), o = r[i];
|
|
3796
3926
|
[i, s, n].forEach((a) => {
|
|
3797
3927
|
e.alias(i, o), e.prototype[a] = function(l, u) {
|
|
3798
3928
|
return this.make(o, l, u);
|
|
@@ -3802,7 +3932,7 @@ function $i() {
|
|
|
3802
3932
|
}
|
|
3803
3933
|
}), e;
|
|
3804
3934
|
}
|
|
3805
|
-
function
|
|
3935
|
+
function bi(t) {
|
|
3806
3936
|
class e extends Ut {
|
|
3807
3937
|
}
|
|
3808
3938
|
return Object.assign(e.prototype, t), e;
|
|
@@ -3835,6 +3965,9 @@ _(Ut.prototype, {
|
|
|
3835
3965
|
form() {
|
|
3836
3966
|
return this.vm.$refs[this.ref];
|
|
3837
3967
|
},
|
|
3968
|
+
adapterValidate(t, e) {
|
|
3969
|
+
return t.validator = (r, i, s) => e(i, s), t;
|
|
3970
|
+
},
|
|
3838
3971
|
getSlot(t) {
|
|
3839
3972
|
const e = (r) => {
|
|
3840
3973
|
if (r) {
|
|
@@ -3863,7 +3996,7 @@ _(Ut.prototype, {
|
|
|
3863
3996
|
render(t) {
|
|
3864
3997
|
}
|
|
3865
3998
|
});
|
|
3866
|
-
const
|
|
3999
|
+
const vi = function(t) {
|
|
3867
4000
|
const e = {
|
|
3868
4001
|
name: "loadData",
|
|
3869
4002
|
_fn: [],
|
|
@@ -3873,14 +4006,14 @@ const bi = function(t) {
|
|
|
3873
4006
|
const o = [];
|
|
3874
4007
|
n.forEach((a) => {
|
|
3875
4008
|
if (a && (a.attr || a.template)) {
|
|
3876
|
-
let l = (
|
|
3877
|
-
let
|
|
3878
|
-
a.template ?
|
|
3879
|
-
const
|
|
3880
|
-
a.to === "child" ?
|
|
3881
|
-
}, u = (
|
|
3882
|
-
const
|
|
3883
|
-
l = se(l, a.wait || 300), a.watch !== !1 ? o.push(
|
|
4009
|
+
let l = (d) => {
|
|
4010
|
+
let g;
|
|
4011
|
+
a.template ? g = t.$handle.loadStrVar(a.template, d) : a.handler && h.Function(a.handler) ? g = a.handler(d, i, s) : g = d(a.attr, a.default), a.copy !== !1 && (g = K(g));
|
|
4012
|
+
const m = a.modify ? i : r.getProp();
|
|
4013
|
+
a.to === "child" ? m.children ? E(m.children, 0, g) : E(m, "children", [g]) : oe(m, a.to || "options", g), s.sync(i);
|
|
4014
|
+
}, u = (d) => l(d);
|
|
4015
|
+
const f = t.watchLoadData(u);
|
|
4016
|
+
l = se(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
3884
4017
|
}
|
|
3885
4018
|
}), this._fn[r.id] = o;
|
|
3886
4019
|
});
|
|
@@ -3904,13 +4037,13 @@ const bi = function(t) {
|
|
|
3904
4037
|
const l = n[a];
|
|
3905
4038
|
if (l) {
|
|
3906
4039
|
const u = typeof l == "object";
|
|
3907
|
-
let
|
|
3908
|
-
let $ = t.t(u ? l.attr : l, u ? l.params : null,
|
|
4040
|
+
let f = (m) => {
|
|
4041
|
+
let $ = t.t(u ? l.attr : l, u ? l.params : null, m);
|
|
3909
4042
|
const w = u && l.modify ? i : r.getProp();
|
|
3910
4043
|
a === "child" ? w.children ? E(w.children, 0, $) : E(w, "children", [$]) : oe(w, a, $), s.sync(i);
|
|
3911
|
-
},
|
|
3912
|
-
const
|
|
3913
|
-
|
|
4044
|
+
}, d = (m) => f(m);
|
|
4045
|
+
const g = t.watchLoadData(d);
|
|
4046
|
+
f = se(f, l.wait || 300), l.watch !== !1 ? o.push(g) : g();
|
|
3914
4047
|
}
|
|
3915
4048
|
}), this._fn[r.id] = o;
|
|
3916
4049
|
},
|
|
@@ -3930,9 +4063,9 @@ const bi = function(t) {
|
|
|
3930
4063
|
else {
|
|
3931
4064
|
h.Object(i) || (i = { method: i });
|
|
3932
4065
|
const s = i.method;
|
|
3933
|
-
delete i.method, t.getProp().validate = [q(
|
|
4066
|
+
delete i.method, t.getProp().validate = [q(v({}, i), {
|
|
3934
4067
|
validator(...n) {
|
|
3935
|
-
const o =
|
|
4068
|
+
const o = Y(e);
|
|
3936
4069
|
if (o)
|
|
3937
4070
|
return r.exec(o.id, h.String(s) ? s : "formCreateValidate", ...n, {
|
|
3938
4071
|
attr: t,
|
|
@@ -3956,48 +4089,48 @@ const bi = function(t) {
|
|
|
3956
4089
|
function r(s, n, o) {
|
|
3957
4090
|
let a = s.value;
|
|
3958
4091
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
3959
|
-
const l = (
|
|
3960
|
-
|
|
4092
|
+
const l = (d) => {
|
|
4093
|
+
d === void 0 ? s.clearProp() : oe(s.getProp(), a.to || "options", d), o.sync(n);
|
|
3961
4094
|
};
|
|
3962
4095
|
if (!a || !a.action && !a.key) {
|
|
3963
4096
|
l(void 0);
|
|
3964
4097
|
return;
|
|
3965
4098
|
}
|
|
3966
|
-
if (a =
|
|
3967
|
-
const
|
|
3968
|
-
if (!
|
|
4099
|
+
if (a = K(a), a.to || (a.to = "options"), a.key) {
|
|
4100
|
+
const d = t.$handle.options.globalData[a.key];
|
|
4101
|
+
if (!d) {
|
|
3969
4102
|
l(void 0);
|
|
3970
4103
|
return;
|
|
3971
4104
|
}
|
|
3972
|
-
if (
|
|
3973
|
-
l(
|
|
4105
|
+
if (d.type === "static") {
|
|
4106
|
+
l(d.data);
|
|
3974
4107
|
return;
|
|
3975
4108
|
} else
|
|
3976
|
-
a =
|
|
4109
|
+
a = v(v({}, a), d);
|
|
3977
4110
|
}
|
|
3978
|
-
const u = a.onError,
|
|
4111
|
+
const u = a.onError, f = () => {
|
|
3979
4112
|
if (!s.getValue())
|
|
3980
4113
|
return s.clearProp(), o.sync(n), !0;
|
|
3981
4114
|
};
|
|
3982
|
-
i._fn[s.id] = t.watchLoadData(se((
|
|
3983
|
-
if (
|
|
4115
|
+
i._fn[s.id] = t.watchLoadData(se((d, g) => {
|
|
4116
|
+
if (g && a.watch === !1)
|
|
3984
4117
|
return i._fn[s.id]();
|
|
3985
|
-
const
|
|
4118
|
+
const m = t.$handle.loadFetchVar(K(a), d, n), $ = q(v({
|
|
3986
4119
|
headers: {}
|
|
3987
|
-
},
|
|
4120
|
+
}, m), {
|
|
3988
4121
|
onSuccess(w, O) {
|
|
3989
|
-
if (
|
|
4122
|
+
if (f()) return;
|
|
3990
4123
|
let G = (M) => O ? M : D(M, "data") ? M.data : M;
|
|
3991
|
-
const T =
|
|
4124
|
+
const T = x(m.parse);
|
|
3992
4125
|
h.Function(T) ? G = T : T && h.String(T) && (G = (M) => B(M, T)), l(G(w, n, o));
|
|
3993
4126
|
},
|
|
3994
4127
|
onError(w) {
|
|
3995
|
-
l(void 0), !
|
|
4128
|
+
l(void 0), !f() && (u || ((O) => et(O.message || "fetch fail " + m.action)))(w, n, o);
|
|
3996
4129
|
}
|
|
3997
4130
|
});
|
|
3998
4131
|
t.$handle.beforeFetch($, { rule: n, api: o }).then(() => {
|
|
3999
|
-
if (h.Function(
|
|
4000
|
-
|
|
4132
|
+
if (h.Function(m.action)) {
|
|
4133
|
+
m.action(n, o).then((w) => {
|
|
4001
4134
|
$.onSuccess(w, !0);
|
|
4002
4135
|
}).catch((w) => {
|
|
4003
4136
|
$.onError(w);
|
|
@@ -4005,6 +4138,7 @@ const bi = function(t) {
|
|
|
4005
4138
|
return;
|
|
4006
4139
|
}
|
|
4007
4140
|
F(() => t.create.fetch($, { inject: s, rule: n, api: o }));
|
|
4141
|
+
}).catch((w) => {
|
|
4008
4142
|
});
|
|
4009
4143
|
}, a.wait || 600));
|
|
4010
4144
|
}
|
|
@@ -4024,7 +4158,7 @@ const bi = function(t) {
|
|
|
4024
4158
|
return i;
|
|
4025
4159
|
}, wi = {
|
|
4026
4160
|
fetch: Ci,
|
|
4027
|
-
loadData:
|
|
4161
|
+
loadData: vi,
|
|
4028
4162
|
t: _i,
|
|
4029
4163
|
componentValidate: Ht
|
|
4030
4164
|
};
|
|
@@ -4052,7 +4186,7 @@ function Fi(t) {
|
|
|
4052
4186
|
};
|
|
4053
4187
|
return e;
|
|
4054
4188
|
}
|
|
4055
|
-
const Oi = "html",
|
|
4189
|
+
const Oi = "html", ki = {
|
|
4056
4190
|
name: Oi,
|
|
4057
4191
|
loadChildren: !1,
|
|
4058
4192
|
render(t, e) {
|
|
@@ -4080,7 +4214,7 @@ function Ei(t) {
|
|
|
4080
4214
|
}
|
|
4081
4215
|
return null;
|
|
4082
4216
|
}
|
|
4083
|
-
function
|
|
4217
|
+
function Si(t) {
|
|
4084
4218
|
const e = localStorage.getItem(t);
|
|
4085
4219
|
if (e)
|
|
4086
4220
|
try {
|
|
@@ -4090,7 +4224,7 @@ function Ri(t) {
|
|
|
4090
4224
|
}
|
|
4091
4225
|
return null;
|
|
4092
4226
|
}
|
|
4093
|
-
function
|
|
4227
|
+
function Ri(t) {
|
|
4094
4228
|
const e = sessionStorage.getItem(t);
|
|
4095
4229
|
if (e)
|
|
4096
4230
|
try {
|
|
@@ -4111,22 +4245,72 @@ function Di(t) {
|
|
|
4111
4245
|
return it(Ei, t);
|
|
4112
4246
|
}
|
|
4113
4247
|
function ji(t) {
|
|
4114
|
-
return it(
|
|
4248
|
+
return it(Si, t);
|
|
4115
4249
|
}
|
|
4116
4250
|
function Ai(t) {
|
|
4117
|
-
return it(
|
|
4251
|
+
return it(Ri, t);
|
|
4118
4252
|
}
|
|
4119
|
-
|
|
4253
|
+
const Vi = {
|
|
4254
|
+
en: {
|
|
4255
|
+
required: "{title} is required",
|
|
4256
|
+
validate: {
|
|
4257
|
+
url: "{title} is not a valid url",
|
|
4258
|
+
email: "{title} is not a valid email",
|
|
4259
|
+
ip: "{title} {title} is not a valid ip",
|
|
4260
|
+
phone: "{title} {title} is not a valid phone",
|
|
4261
|
+
pattern: "{title} does not match pattern {pattern}",
|
|
4262
|
+
uppercase: "{title} must be all uppercase",
|
|
4263
|
+
lowercase: "{title} must be all lowercased",
|
|
4264
|
+
positive: "{title} is not a positive number",
|
|
4265
|
+
negative: "{title} is not a negative number",
|
|
4266
|
+
equal: "{title} is not equal to {equal}",
|
|
4267
|
+
min: "{title} cannot be less than {min}",
|
|
4268
|
+
max: "{title} cannot be greater than {max}",
|
|
4269
|
+
enum: "{title} must be one of {enum}",
|
|
4270
|
+
hasKeys: "{title} does not contain required fields {hasKeys}",
|
|
4271
|
+
minLen: "{title} must be at least {minLen}",
|
|
4272
|
+
maxLen: "{title} cannot be longer than {maxLen}",
|
|
4273
|
+
len: "{title} must be exactly {len}",
|
|
4274
|
+
integer: "{title} is not an integer",
|
|
4275
|
+
number: "{title} is not an number"
|
|
4276
|
+
}
|
|
4277
|
+
},
|
|
4278
|
+
"zh-cn": {
|
|
4279
|
+
required: "{title}不能为空",
|
|
4280
|
+
validate: {
|
|
4281
|
+
url: "{title}不是有效的 url 地址",
|
|
4282
|
+
email: "{title}不是有效的邮箱地址",
|
|
4283
|
+
ip: "{title}不是有效的 IP 地址",
|
|
4284
|
+
phone: "{title}不是正确的手机号",
|
|
4285
|
+
pattern: "{title}必须匹配 {pattern}",
|
|
4286
|
+
uppercase: "{title}必须全大写",
|
|
4287
|
+
lowercase: "{title}必须全小写",
|
|
4288
|
+
positive: "{title}不是正数",
|
|
4289
|
+
negative: "{title}不是负数",
|
|
4290
|
+
equal: "{title}必须等于 {equal}",
|
|
4291
|
+
min: "{title}必须大于等于 {min}",
|
|
4292
|
+
max: "{title}必须小于等于 {max}",
|
|
4293
|
+
enum: "{title}必须是 {enum} 之一",
|
|
4294
|
+
hasKeys: "{title}必须包含 {hasKeys} 字段",
|
|
4295
|
+
minLen: "{title}长度必须大于 {minLen}",
|
|
4296
|
+
maxLen: "{title}长度必须小于 {maxLen}",
|
|
4297
|
+
len: "{title}长度必须为 {len}",
|
|
4298
|
+
integer: "{title}必须为整数",
|
|
4299
|
+
number: "{title}必须为数字"
|
|
4300
|
+
}
|
|
4301
|
+
}
|
|
4302
|
+
};
|
|
4303
|
+
function Ii(t, e) {
|
|
4120
4304
|
let r;
|
|
4121
4305
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
4122
4306
|
}
|
|
4123
4307
|
function Me() {
|
|
4124
|
-
return
|
|
4308
|
+
return Ii("name", ...arguments);
|
|
4125
4309
|
}
|
|
4126
|
-
function
|
|
4310
|
+
function Pi(t) {
|
|
4127
4311
|
return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
4128
4312
|
}
|
|
4129
|
-
function
|
|
4313
|
+
function Ti(t, e) {
|
|
4130
4314
|
const r = new Vue({
|
|
4131
4315
|
data() {
|
|
4132
4316
|
return { rule: t, option: e || {} };
|
|
@@ -4137,151 +4321,151 @@ function Pi(t, e) {
|
|
|
4137
4321
|
});
|
|
4138
4322
|
return r.$mount(), r;
|
|
4139
4323
|
}
|
|
4140
|
-
function
|
|
4324
|
+
function Bi(t) {
|
|
4141
4325
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
4142
|
-
|
|
4326
|
+
St.push(...e), Qe.push(...r), Ye.push(...i), Bt([...e, ...r, ...i]);
|
|
4143
4327
|
}
|
|
4144
|
-
let
|
|
4145
|
-
const U = {},
|
|
4328
|
+
let Li = 1;
|
|
4329
|
+
const U = {}, Se = Symbol("defValue");
|
|
4146
4330
|
function Gt(t) {
|
|
4147
4331
|
const e = {
|
|
4148
4332
|
[Le.name]: Le
|
|
4149
4333
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4150
4334
|
t.extendApi
|
|
4151
|
-
], u =
|
|
4152
|
-
let
|
|
4153
|
-
const
|
|
4154
|
-
$mobile:
|
|
4335
|
+
], u = v({}, wi), f = zr();
|
|
4336
|
+
let d = { global: {} };
|
|
4337
|
+
const g = t.isMobile === !0, m = ne({
|
|
4338
|
+
$mobile: g
|
|
4155
4339
|
}), $ = $i(), w = {}, O = {};
|
|
4156
|
-
|
|
4157
|
-
function G(
|
|
4158
|
-
const
|
|
4159
|
-
if (Array.isArray(
|
|
4160
|
-
return
|
|
4161
|
-
if (
|
|
4162
|
-
return
|
|
4340
|
+
Bi(t.attrs || {});
|
|
4341
|
+
function G(c) {
|
|
4342
|
+
const p = U[c];
|
|
4343
|
+
if (Array.isArray(p))
|
|
4344
|
+
return p.map((y) => y.api());
|
|
4345
|
+
if (p)
|
|
4346
|
+
return p.api();
|
|
4163
4347
|
}
|
|
4164
|
-
function T(
|
|
4165
|
-
o.push(
|
|
4348
|
+
function T(c) {
|
|
4349
|
+
o.push(c);
|
|
4166
4350
|
}
|
|
4167
4351
|
function M() {
|
|
4168
|
-
const
|
|
4169
|
-
|
|
4352
|
+
const c = Me(...arguments);
|
|
4353
|
+
c.id && c.prop && (i[c.id] = c.prop);
|
|
4170
4354
|
}
|
|
4171
4355
|
function he() {
|
|
4172
|
-
const
|
|
4173
|
-
|
|
4174
|
-
name:
|
|
4356
|
+
const c = Me(...arguments);
|
|
4357
|
+
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(v({}, c.prop), {
|
|
4358
|
+
name: c.id
|
|
4175
4359
|
}));
|
|
4176
4360
|
}
|
|
4177
|
-
function Ve(
|
|
4178
|
-
$.use(
|
|
4361
|
+
function Ve(c) {
|
|
4362
|
+
$.use(c);
|
|
4179
4363
|
}
|
|
4180
4364
|
function de() {
|
|
4181
|
-
const
|
|
4182
|
-
if (!
|
|
4183
|
-
const
|
|
4184
|
-
r[
|
|
4365
|
+
const c = Me(...arguments);
|
|
4366
|
+
if (!c.id || !c.prop) return De;
|
|
4367
|
+
const p = J(c.id), y = c.prop, b = y.merge === !0 ? r[p] : void 0;
|
|
4368
|
+
r[p] = Ee(y, b || De), f[p] = P(p), y.maker && _(f, y.maker);
|
|
4185
4369
|
}
|
|
4186
|
-
function
|
|
4370
|
+
function k(c, p) {
|
|
4187
4371
|
let y;
|
|
4188
|
-
if (h.String(
|
|
4189
|
-
if (y =
|
|
4190
|
-
return ["form-create", "formcreate"].indexOf(y) > -1 ?
|
|
4372
|
+
if (h.String(c)) {
|
|
4373
|
+
if (y = c, p === void 0)
|
|
4374
|
+
return ["form-create", "formcreate"].indexOf(y) > -1 ? S() : e[y];
|
|
4191
4375
|
} else
|
|
4192
|
-
y = J(
|
|
4193
|
-
if (!y || !
|
|
4194
|
-
const
|
|
4195
|
-
e[y] =
|
|
4376
|
+
y = J(c.name), p = c;
|
|
4377
|
+
if (!y || !p) return;
|
|
4378
|
+
const b = J(y);
|
|
4379
|
+
e[y] = p, e[b] = p, delete $.aliasMap[y], delete $.aliasMap[b], delete r[y], delete r[b], p.formCreateParser && de(y, p.formCreateParser);
|
|
4196
4380
|
}
|
|
4197
|
-
function
|
|
4198
|
-
return
|
|
4381
|
+
function S() {
|
|
4382
|
+
return Kr(Pe, e, i);
|
|
4199
4383
|
}
|
|
4200
4384
|
function N() {
|
|
4201
4385
|
return Le;
|
|
4202
4386
|
}
|
|
4203
|
-
function pe(
|
|
4204
|
-
return h.Function(
|
|
4387
|
+
function pe(c, p) {
|
|
4388
|
+
return h.Function(c.install) ? c.install(W, p) : h.Function(c) && c(W, p), this;
|
|
4205
4389
|
}
|
|
4206
|
-
function
|
|
4207
|
-
let
|
|
4208
|
-
const C =
|
|
4209
|
-
return C.$parent = y,
|
|
4390
|
+
function W(c, p, y) {
|
|
4391
|
+
let b = Ti(c, p || {});
|
|
4392
|
+
const C = b.$refs.fc.formCreate;
|
|
4393
|
+
return C.$parent = y, Pi(C.options).appendChild(b.$el), C.api();
|
|
4210
4394
|
}
|
|
4211
|
-
Ee(
|
|
4212
|
-
function
|
|
4213
|
-
let
|
|
4214
|
-
return
|
|
4395
|
+
Ee(W, O);
|
|
4396
|
+
function Kt(c) {
|
|
4397
|
+
let p = v({}, t);
|
|
4398
|
+
return c ? p.inherit = {
|
|
4215
4399
|
components: e,
|
|
4216
4400
|
parsers: r,
|
|
4217
4401
|
directives: i,
|
|
4218
4402
|
modelFields: s,
|
|
4219
4403
|
providers: u,
|
|
4220
4404
|
useApps: o,
|
|
4221
|
-
maker:
|
|
4405
|
+
maker: f,
|
|
4222
4406
|
formulas: w,
|
|
4223
|
-
loadData:
|
|
4224
|
-
} : delete
|
|
4407
|
+
loadData: m
|
|
4408
|
+
} : delete p.inherit, Gt(p);
|
|
4225
4409
|
}
|
|
4226
|
-
function
|
|
4227
|
-
s[
|
|
4410
|
+
function Wt(c, p) {
|
|
4411
|
+
s[c] = p;
|
|
4228
4412
|
}
|
|
4229
|
-
function
|
|
4230
|
-
w[
|
|
4413
|
+
function zt(c, p) {
|
|
4414
|
+
w[c] = p;
|
|
4231
4415
|
}
|
|
4232
|
-
function
|
|
4233
|
-
const y = n[
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
}),
|
|
4416
|
+
function xt(c, p) {
|
|
4417
|
+
const y = n[c] || {}, b = y.parsers || {};
|
|
4418
|
+
p.parsers && Object.keys(p.parsers).forEach((C) => {
|
|
4419
|
+
b[C] = Ee(p.parsers[C], De);
|
|
4420
|
+
}), p.name = c, n[c] = q(v(v({}, y), p), { parsers: b });
|
|
4237
4421
|
}
|
|
4238
|
-
function we(
|
|
4239
|
-
|
|
4240
|
-
(Array.isArray(U[
|
|
4241
|
-
|
|
4422
|
+
function we(c) {
|
|
4423
|
+
c && Object.keys(U).forEach((p) => {
|
|
4424
|
+
(Array.isArray(U[p]) ? U[p] : [U[p]]).forEach((b) => {
|
|
4425
|
+
b.bus.$emit("$loadData." + c);
|
|
4242
4426
|
});
|
|
4243
4427
|
});
|
|
4244
4428
|
}
|
|
4245
|
-
function Ie(
|
|
4246
|
-
oe(
|
|
4429
|
+
function Ie(c, p) {
|
|
4430
|
+
oe(m, c, p), we(c);
|
|
4247
4431
|
}
|
|
4248
|
-
function Fe(
|
|
4249
|
-
const y = (...
|
|
4250
|
-
y._driver = !0, Ie(
|
|
4432
|
+
function Fe(c, p) {
|
|
4433
|
+
const y = (...b) => F(() => p(...b));
|
|
4434
|
+
y._driver = !0, Ie(c, y);
|
|
4251
4435
|
}
|
|
4252
|
-
function nt(
|
|
4253
|
-
const y = (
|
|
4254
|
-
|
|
4255
|
-
const
|
|
4256
|
-
if (D(
|
|
4257
|
-
let C =
|
|
4258
|
-
return C && C._driver ? C = C(
|
|
4436
|
+
function nt(c, p) {
|
|
4437
|
+
const y = (c || "").split(".");
|
|
4438
|
+
c = y.shift();
|
|
4439
|
+
const b = y.join(".");
|
|
4440
|
+
if (D(m, c) || E(m, c, Se), m[c] !== Se) {
|
|
4441
|
+
let C = m[c];
|
|
4442
|
+
return C && C._driver ? C = C(b) : y.length && (C = B(C, y)), C == null || C === "" ? p : C;
|
|
4259
4443
|
} else
|
|
4260
|
-
return
|
|
4444
|
+
return p;
|
|
4261
4445
|
}
|
|
4262
|
-
function
|
|
4263
|
-
l.push(
|
|
4446
|
+
function Xt(c) {
|
|
4447
|
+
l.push(c);
|
|
4264
4448
|
}
|
|
4265
|
-
function Zt(
|
|
4266
|
-
delete
|
|
4449
|
+
function Zt(c) {
|
|
4450
|
+
delete m[c], we(c);
|
|
4267
4451
|
}
|
|
4268
|
-
function
|
|
4269
|
-
a.push({ name:
|
|
4452
|
+
function Qt(c, p) {
|
|
4453
|
+
a.push({ name: c, callback: p });
|
|
4270
4454
|
}
|
|
4271
|
-
function Pe(
|
|
4455
|
+
function Pe(c) {
|
|
4272
4456
|
_(this, {
|
|
4273
|
-
id:
|
|
4274
|
-
create:
|
|
4275
|
-
vm:
|
|
4276
|
-
manager:
|
|
4457
|
+
id: Li++,
|
|
4458
|
+
create: W,
|
|
4459
|
+
vm: c,
|
|
4460
|
+
manager: bi(t.manager),
|
|
4277
4461
|
parsers: r,
|
|
4278
4462
|
providers: u,
|
|
4279
4463
|
modelFields: s,
|
|
4280
4464
|
formulas: w,
|
|
4281
|
-
isMobile:
|
|
4282
|
-
rules:
|
|
4283
|
-
name:
|
|
4284
|
-
inFor:
|
|
4465
|
+
isMobile: g,
|
|
4466
|
+
rules: c.$options.propsData.rule,
|
|
4467
|
+
name: c.$options.propsData.name || Ae(),
|
|
4468
|
+
inFor: c.$options.propsData.inFor,
|
|
4285
4469
|
prop: {
|
|
4286
4470
|
components: e,
|
|
4287
4471
|
directives: i
|
|
@@ -4290,7 +4474,7 @@ function Gt(t) {
|
|
|
4290
4474
|
drivers: n,
|
|
4291
4475
|
renderDriver: null,
|
|
4292
4476
|
refreshData: we,
|
|
4293
|
-
loadData:
|
|
4477
|
+
loadData: m,
|
|
4294
4478
|
CreateNode: $,
|
|
4295
4479
|
bus: new Fi(),
|
|
4296
4480
|
unwatch: [],
|
|
@@ -4298,60 +4482,60 @@ function Gt(t) {
|
|
|
4298
4482
|
extendApiFn: l,
|
|
4299
4483
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4300
4484
|
tmpData: ne({})
|
|
4301
|
-
}), a.forEach((
|
|
4302
|
-
this.bus.$on(
|
|
4485
|
+
}), a.forEach((p) => {
|
|
4486
|
+
this.bus.$on(p.name, p.callback);
|
|
4303
4487
|
}), I(() => {
|
|
4304
4488
|
L(this.options, () => {
|
|
4305
4489
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4306
4490
|
}, { deep: !0 });
|
|
4307
|
-
}), _(
|
|
4491
|
+
}), _(c.$options.components, e), _(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);
|
|
4308
4492
|
}
|
|
4309
|
-
Pe.isMobile =
|
|
4493
|
+
Pe.isMobile = g, _(Pe.prototype, {
|
|
4310
4494
|
init() {
|
|
4311
4495
|
this.isSub() && this.unwatch.push(L(() => this.vm.parent.fc.options.value, () => {
|
|
4312
4496
|
this.initOptions(), this.$handle.api.refresh();
|
|
4313
4497
|
}, { deep: !0 })), this.vm.$options.propsData.driver && (this.renderDriver = typeof this.vm.$options.propsData.driver == "object" ? this.vm.$options.propsData.driver : this.drivers[this.vm.$options.propsData.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();
|
|
4314
4498
|
},
|
|
4315
|
-
targetFormDriver(
|
|
4316
|
-
if (this.renderDriver && this.renderDriver[
|
|
4317
|
-
return F(() => this.renderDriver[
|
|
4499
|
+
targetFormDriver(c, ...p) {
|
|
4500
|
+
if (this.renderDriver && this.renderDriver[c])
|
|
4501
|
+
return F(() => this.renderDriver[c](...p));
|
|
4318
4502
|
},
|
|
4319
|
-
t(
|
|
4320
|
-
let
|
|
4321
|
-
return
|
|
4503
|
+
t(c, p, y) {
|
|
4504
|
+
let b = y ? y("$t." + c) : this.globalLanguageDriver(c);
|
|
4505
|
+
return b == null && (b = ""), b && p && Object.keys(p).forEach((C) => {
|
|
4322
4506
|
const j = new RegExp(`{${C}}`, "g");
|
|
4323
|
-
|
|
4324
|
-
}),
|
|
4325
|
-
},
|
|
4326
|
-
globalDataDriver(
|
|
4327
|
-
let
|
|
4328
|
-
const y =
|
|
4329
|
-
if (
|
|
4330
|
-
if (
|
|
4331
|
-
return B(
|
|
4507
|
+
b = b.replace(j, p[C]);
|
|
4508
|
+
}), b;
|
|
4509
|
+
},
|
|
4510
|
+
globalDataDriver(c) {
|
|
4511
|
+
let p = c.split(".");
|
|
4512
|
+
const y = p.shift(), b = this.options.value.globalData && this.options.value.globalData[y];
|
|
4513
|
+
if (b) {
|
|
4514
|
+
if (b.type === "static")
|
|
4515
|
+
return B(b.data, p);
|
|
4332
4516
|
{
|
|
4333
4517
|
let C;
|
|
4334
|
-
const j = this.fetchCache.get(
|
|
4518
|
+
const j = this.fetchCache.get(b);
|
|
4335
4519
|
if (j) {
|
|
4336
|
-
if (j.status && (C = B(j.data,
|
|
4520
|
+
if (j.status && (C = B(j.data, p)), !j.loading)
|
|
4337
4521
|
return C;
|
|
4338
|
-
j.loading = !1, this.fetchCache.set(
|
|
4522
|
+
j.loading = !1, this.fetchCache.set(b, j);
|
|
4339
4523
|
} else
|
|
4340
|
-
this.fetchCache.set(
|
|
4341
|
-
const
|
|
4524
|
+
this.fetchCache.set(b, { status: !1 });
|
|
4525
|
+
const R = se(() => {
|
|
4342
4526
|
le();
|
|
4343
|
-
const
|
|
4344
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(
|
|
4345
|
-
},
|
|
4346
|
-
this.fetchCache.set(
|
|
4347
|
-
}, Z = (
|
|
4348
|
-
if (ue &&
|
|
4527
|
+
const z = this.fetchCache.get(b);
|
|
4528
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (z && (z.loading = !0, this.fetchCache.set(b, z)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete(b);
|
|
4529
|
+
}, b.wait || 600), ae = (z) => {
|
|
4530
|
+
this.fetchCache.set(b, { status: !0, data: z }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4531
|
+
}, Z = (z, ue) => {
|
|
4532
|
+
if (ue && b.watch === !1)
|
|
4349
4533
|
return le();
|
|
4350
4534
|
if (ue) {
|
|
4351
|
-
|
|
4535
|
+
R();
|
|
4352
4536
|
return;
|
|
4353
4537
|
}
|
|
4354
|
-
const me = this.$handle.loadFetchVar(Je(
|
|
4538
|
+
const me = this.$handle.loadFetchVar(Je(b), z);
|
|
4355
4539
|
this.$handle.api.fetch(me).then((re) => {
|
|
4356
4540
|
ae(re);
|
|
4357
4541
|
}).catch((re) => {
|
|
@@ -4363,39 +4547,39 @@ function Gt(t) {
|
|
|
4363
4547
|
}
|
|
4364
4548
|
},
|
|
4365
4549
|
getLocale() {
|
|
4366
|
-
let
|
|
4367
|
-
return
|
|
4368
|
-
},
|
|
4369
|
-
globalLanguageDriver(
|
|
4370
|
-
let
|
|
4371
|
-
if (
|
|
4372
|
-
const
|
|
4373
|
-
y = B(
|
|
4550
|
+
let c = this.vm.top.$props.locale;
|
|
4551
|
+
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4552
|
+
},
|
|
4553
|
+
globalLanguageDriver(c) {
|
|
4554
|
+
let p = this.vm.top.$props.locale, y;
|
|
4555
|
+
if (p && typeof p == "object" && (y = B(p, c)), y == null) {
|
|
4556
|
+
const b = this.options.value.language || {}, C = this.getLocale();
|
|
4557
|
+
y = B(b[C] || {}, c), y == null && (y = B(Vi[C] || {}, c));
|
|
4374
4558
|
}
|
|
4375
4559
|
return y;
|
|
4376
4560
|
},
|
|
4377
|
-
globalVarDriver(
|
|
4378
|
-
let
|
|
4379
|
-
const y =
|
|
4380
|
-
if (
|
|
4381
|
-
const C = h.Function(
|
|
4561
|
+
globalVarDriver(c) {
|
|
4562
|
+
let p = c.split(".");
|
|
4563
|
+
const y = p.shift(), b = this.options.value.globalVariable && this.options.value.globalVariable[y];
|
|
4564
|
+
if (b) {
|
|
4565
|
+
const C = h.Function(b) ? b : x(b.handle);
|
|
4382
4566
|
if (C) {
|
|
4383
4567
|
let j;
|
|
4384
|
-
const
|
|
4385
|
-
Z ? (this.bus.$emit("$loadData.$var." + y),
|
|
4568
|
+
const R = this.watchLoadData((ae, Z) => {
|
|
4569
|
+
Z ? (this.bus.$emit("$loadData.$var." + y), R()) : j = C(ae, this.$handle.api);
|
|
4386
4570
|
});
|
|
4387
|
-
return this.unwatch.push(
|
|
4571
|
+
return this.unwatch.push(R), B(j, p);
|
|
4388
4572
|
}
|
|
4389
4573
|
}
|
|
4390
4574
|
},
|
|
4391
|
-
setData(
|
|
4392
|
-
y ? Ie(
|
|
4575
|
+
setData(c, p, y) {
|
|
4576
|
+
y ? Ie(c, p) : (oe(this.vm.top.fc.tmpData, c, p), this.bus.$emit("$loadData." + c));
|
|
4393
4577
|
},
|
|
4394
|
-
getLoadData(
|
|
4578
|
+
getLoadData(c, p) {
|
|
4395
4579
|
let y = null;
|
|
4396
|
-
if (
|
|
4397
|
-
let
|
|
4398
|
-
const C =
|
|
4580
|
+
if (c != null) {
|
|
4581
|
+
let b = c.split(".");
|
|
4582
|
+
const C = b.shift();
|
|
4399
4583
|
if (C === "$topForm")
|
|
4400
4584
|
y = this.$handle.api.top.formData(!0);
|
|
4401
4585
|
else if (C === "$scopeForm")
|
|
@@ -4405,53 +4589,53 @@ function Gt(t) {
|
|
|
4405
4589
|
else if (C === "$options")
|
|
4406
4590
|
y = this.options.value;
|
|
4407
4591
|
else if (C === "$globalData")
|
|
4408
|
-
y = this.globalDataDriver(
|
|
4592
|
+
y = this.globalDataDriver(b.join(".")), b = [];
|
|
4409
4593
|
else if (C === "$var")
|
|
4410
|
-
y = this.globalVarDriver(
|
|
4594
|
+
y = this.globalVarDriver(b.join(".")), b = [];
|
|
4411
4595
|
else if (C === "$locale")
|
|
4412
|
-
y = this.getLocale(),
|
|
4596
|
+
y = this.getLocale(), b = [];
|
|
4413
4597
|
else if (C === "$t")
|
|
4414
|
-
y = this.globalLanguageDriver(
|
|
4598
|
+
y = this.globalLanguageDriver(b.join(".")), b = [];
|
|
4415
4599
|
else {
|
|
4416
4600
|
if (C === "$preview")
|
|
4417
4601
|
return this.$handle.preview;
|
|
4418
4602
|
{
|
|
4419
4603
|
const j = this.vm.top.fc.tmpData;
|
|
4420
|
-
D(j, C) || E(j, C,
|
|
4604
|
+
D(j, C) || E(j, C, Se), y = j[C] !== Se ? B(j, c) : nt(c), b = [];
|
|
4421
4605
|
}
|
|
4422
4606
|
}
|
|
4423
|
-
y &&
|
|
4607
|
+
y && b.length && (y = B(y, b));
|
|
4424
4608
|
}
|
|
4425
|
-
return y == null || y === "" ?
|
|
4609
|
+
return y == null || y === "" ? p : y;
|
|
4426
4610
|
},
|
|
4427
|
-
watchLoadData(
|
|
4611
|
+
watchLoadData(c, p) {
|
|
4428
4612
|
let y = {};
|
|
4429
|
-
const
|
|
4613
|
+
const b = (R) => {
|
|
4430
4614
|
this.get || (this.get = C), F(() => {
|
|
4431
|
-
|
|
4615
|
+
c(C, R);
|
|
4432
4616
|
}), this.get === C && (this.get = void 0);
|
|
4433
|
-
}, C = (
|
|
4617
|
+
}, C = (R, ae) => {
|
|
4434
4618
|
let Z;
|
|
4435
|
-
if (typeof
|
|
4436
|
-
return y[
|
|
4437
|
-
const le = ye(() => Z ? Z() : this.getLoadData(
|
|
4438
|
-
const Te = Z ? Z() : this.getLoadData(
|
|
4439
|
-
if (y[
|
|
4440
|
-
JSON.stringify(Te) !== JSON.stringify(y[
|
|
4619
|
+
if (typeof R == "object" && (Z = R.getValue, R = R.id), y[R])
|
|
4620
|
+
return y[R].val;
|
|
4621
|
+
const le = ye(() => Z ? Z() : this.getLoadData(R, ae)), z = R.split("."), ue = z.shift(), me = z.shift() || "", re = se(() => {
|
|
4622
|
+
const Te = Z ? Z() : this.getLoadData(R, ae);
|
|
4623
|
+
if (y[R])
|
|
4624
|
+
JSON.stringify(Te) !== JSON.stringify(y[R].val) && (y[R].val = Te, b(!0));
|
|
4441
4625
|
else return;
|
|
4442
|
-
},
|
|
4626
|
+
}, p || 0), er = L(le, (Te) => {
|
|
4443
4627
|
re();
|
|
4444
4628
|
});
|
|
4445
|
-
return this.bus.$on("$loadData." + ue, re), me && this.bus.$on("$loadData." + ue + "." + me, re), y[
|
|
4629
|
+
return this.bus.$on("$loadData." + ue, re), me && this.bus.$on("$loadData." + ue + "." + me, re), y[R] = {
|
|
4446
4630
|
fn: () => {
|
|
4447
4631
|
this.bus.$off("$loadData." + ue, re), me && this.bus.$off("$loadData." + ue + "." + me, re), er();
|
|
4448
4632
|
},
|
|
4449
4633
|
val: le.value
|
|
4450
4634
|
}, le.value;
|
|
4451
4635
|
};
|
|
4452
|
-
|
|
4636
|
+
b(!1);
|
|
4453
4637
|
const j = () => {
|
|
4454
|
-
Object.keys(y).forEach((
|
|
4638
|
+
Object.keys(y).forEach((R) => y[R].fn()), y = {};
|
|
4455
4639
|
};
|
|
4456
4640
|
return this.unwatch.push(j), j;
|
|
4457
4641
|
},
|
|
@@ -4460,22 +4644,22 @@ function Gt(t) {
|
|
|
4460
4644
|
},
|
|
4461
4645
|
initOptions() {
|
|
4462
4646
|
this.options.value = {};
|
|
4463
|
-
let
|
|
4647
|
+
let c = v({
|
|
4464
4648
|
formData: {},
|
|
4465
4649
|
submitBtn: {},
|
|
4466
4650
|
resetBtn: {},
|
|
4467
4651
|
globalEvent: {},
|
|
4468
4652
|
globalData: {}
|
|
4469
|
-
},
|
|
4470
|
-
this.isSub() && (
|
|
4653
|
+
}, K(d));
|
|
4654
|
+
this.isSub() && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$options.propsData.option || {}), this.updateOptions(c);
|
|
4471
4655
|
},
|
|
4472
|
-
mergeOptions(
|
|
4473
|
-
return
|
|
4474
|
-
delete
|
|
4475
|
-
}),
|
|
4656
|
+
mergeOptions(c, p, y) {
|
|
4657
|
+
return p = v({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4658
|
+
delete p[b];
|
|
4659
|
+
}), p.global && (c.global = Hr(c.global, p.global), delete p.global), this.$handle.$manager.mergeOptions([p], c), c;
|
|
4476
4660
|
},
|
|
4477
|
-
updateOptions(
|
|
4478
|
-
this.options.value = this.mergeOptions(this.options.value,
|
|
4661
|
+
updateOptions(c) {
|
|
4662
|
+
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
4479
4663
|
},
|
|
4480
4664
|
api() {
|
|
4481
4665
|
return this.$handle.api;
|
|
@@ -4489,88 +4673,88 @@ function Gt(t) {
|
|
|
4489
4673
|
unmount() {
|
|
4490
4674
|
if (this.name)
|
|
4491
4675
|
if (this.inFor) {
|
|
4492
|
-
const
|
|
4493
|
-
U[this.name].splice(
|
|
4676
|
+
const c = U[this.name].indexOf(this);
|
|
4677
|
+
U[this.name].splice(c, 1);
|
|
4494
4678
|
} else
|
|
4495
4679
|
delete U[this.name];
|
|
4496
|
-
a.forEach((
|
|
4497
|
-
this.bus.$off(
|
|
4498
|
-
}), this.tmpData = {}, this.unwatch.forEach((
|
|
4680
|
+
a.forEach((c) => {
|
|
4681
|
+
this.bus.$off(c.name, c.callback);
|
|
4682
|
+
}), this.tmpData = {}, this.unwatch.forEach((c) => c()), this.unwatch = [], this.$handle.reloadRule([]);
|
|
4499
4683
|
},
|
|
4500
4684
|
updated() {
|
|
4501
4685
|
this.$handle.bindNextTick(() => this.bus.$emit("next-tick", this.$handle.api));
|
|
4502
4686
|
}
|
|
4503
4687
|
});
|
|
4504
|
-
function st(
|
|
4505
|
-
_(
|
|
4688
|
+
function st(c) {
|
|
4689
|
+
_(c, {
|
|
4506
4690
|
version: t.version,
|
|
4507
4691
|
ui: t.ui,
|
|
4508
|
-
isMobile:
|
|
4509
|
-
extendApi:
|
|
4692
|
+
isMobile: g,
|
|
4693
|
+
extendApi: Xt,
|
|
4510
4694
|
getData: nt,
|
|
4511
4695
|
setDataDriver: Fe,
|
|
4512
4696
|
setData: Ie,
|
|
4513
4697
|
removeData: Zt,
|
|
4514
4698
|
refreshData: we,
|
|
4515
|
-
maker:
|
|
4516
|
-
component:
|
|
4699
|
+
maker: f,
|
|
4700
|
+
component: k,
|
|
4517
4701
|
directive: M,
|
|
4518
|
-
setModelField:
|
|
4519
|
-
setFormula:
|
|
4520
|
-
setDriver:
|
|
4702
|
+
setModelField: Wt,
|
|
4703
|
+
setFormula: zt,
|
|
4704
|
+
setDriver: xt,
|
|
4521
4705
|
register: he,
|
|
4522
4706
|
$vnode: N,
|
|
4523
4707
|
parser: de,
|
|
4524
4708
|
use: pe,
|
|
4525
|
-
factory:
|
|
4709
|
+
factory: Kt,
|
|
4526
4710
|
componentAlias: Ve,
|
|
4527
4711
|
copyRule: Vt,
|
|
4528
4712
|
copyRules: It,
|
|
4529
4713
|
mergeRule: te,
|
|
4530
4714
|
fetch: Mt,
|
|
4531
|
-
$form:
|
|
4532
|
-
parseFn:
|
|
4715
|
+
$form: S,
|
|
4716
|
+
parseFn: x,
|
|
4533
4717
|
parseJson: At,
|
|
4534
4718
|
toJson: _e,
|
|
4535
4719
|
useApp: T,
|
|
4536
4720
|
getApi: G,
|
|
4537
|
-
on:
|
|
4721
|
+
on: Qt
|
|
4538
4722
|
});
|
|
4539
4723
|
}
|
|
4540
|
-
function
|
|
4541
|
-
_(
|
|
4542
|
-
create:
|
|
4543
|
-
install(
|
|
4544
|
-
if (
|
|
4545
|
-
|
|
4546
|
-
const
|
|
4547
|
-
return
|
|
4724
|
+
function Yt(c) {
|
|
4725
|
+
_(c, {
|
|
4726
|
+
create: W,
|
|
4727
|
+
install(p, y) {
|
|
4728
|
+
if (d = v(v({}, d), y || {}), p._installedFormCreate === !0) return;
|
|
4729
|
+
p._installedFormCreate = !0;
|
|
4730
|
+
const b = function(j, R = {}) {
|
|
4731
|
+
return W(j, R, this);
|
|
4548
4732
|
};
|
|
4549
|
-
st(
|
|
4550
|
-
const C =
|
|
4551
|
-
|
|
4552
|
-
F(() => j(
|
|
4733
|
+
st(b), p.prototype.$formCreate = b;
|
|
4734
|
+
const C = S();
|
|
4735
|
+
p.component(C.name, C), p.component("FcFragment", N()), o.forEach((j) => {
|
|
4736
|
+
F(() => j(c, p));
|
|
4553
4737
|
});
|
|
4554
4738
|
}
|
|
4555
4739
|
});
|
|
4556
4740
|
}
|
|
4557
|
-
if (st(O),
|
|
4558
|
-
const
|
|
4559
|
-
|
|
4741
|
+
if (st(O), Yt(O), Fe("$cookie", Di), Fe("$localStorage", ji), Fe("$sessionStorage", Ai), $.use({ fragment: "fcFragment" }), t.install && W.use(t), de(ki), t.inherit) {
|
|
4742
|
+
const c = t.inherit;
|
|
4743
|
+
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 && _(m, c.loadData), c.formulas && _(w, c.formulas);
|
|
4560
4744
|
}
|
|
4561
|
-
const Oe =
|
|
4745
|
+
const Oe = S();
|
|
4562
4746
|
return Ee(Oe, O), Object.defineProperties(Oe, {
|
|
4563
4747
|
fetch: {
|
|
4564
4748
|
get() {
|
|
4565
4749
|
return O.fetch;
|
|
4566
4750
|
},
|
|
4567
|
-
set(
|
|
4568
|
-
O.fetch =
|
|
4751
|
+
set(c) {
|
|
4752
|
+
O.fetch = c;
|
|
4569
4753
|
}
|
|
4570
4754
|
}
|
|
4571
4755
|
}), Oe.util = O, Oe;
|
|
4572
4756
|
}
|
|
4573
|
-
const
|
|
4757
|
+
const vt = {
|
|
4574
4758
|
date: "yyyy-MM-dd",
|
|
4575
4759
|
month: "yyyy-MM",
|
|
4576
4760
|
datetime: "yyyy-MM-dd HH:mm:ss",
|
|
@@ -4579,16 +4763,16 @@ const bt = {
|
|
|
4579
4763
|
monthrange: "yyyy-MM",
|
|
4580
4764
|
datetimerange: "yyyy-MM-dd HH:mm:ss",
|
|
4581
4765
|
year: "yyyy"
|
|
4582
|
-
}, _t = "datePicker",
|
|
4766
|
+
}, _t = "datePicker", Mi = {
|
|
4583
4767
|
name: _t,
|
|
4584
4768
|
maker: function() {
|
|
4585
4769
|
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = P(_t, { type: e.toLowerCase() }), t), {});
|
|
4586
4770
|
}(),
|
|
4587
4771
|
mergeProp(t) {
|
|
4588
4772
|
const e = t.prop.props;
|
|
4589
|
-
e.valueFormat || (e.valueFormat =
|
|
4773
|
+
e.valueFormat || (e.valueFormat = vt[e.type] || vt.date);
|
|
4590
4774
|
}
|
|
4591
|
-
}, Ne = "hidden",
|
|
4775
|
+
}, Ne = "hidden", Ni = {
|
|
4592
4776
|
name: Ne,
|
|
4593
4777
|
maker: {
|
|
4594
4778
|
[Ne]: (t, e) => P(Ne)("", t, e)
|
|
@@ -4596,7 +4780,7 @@ const bt = {
|
|
|
4596
4780
|
render() {
|
|
4597
4781
|
return [];
|
|
4598
4782
|
}
|
|
4599
|
-
}, qe = "input",
|
|
4783
|
+
}, qe = "input", qi = {
|
|
4600
4784
|
name: qe,
|
|
4601
4785
|
maker: function() {
|
|
4602
4786
|
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = P(qe, { type: r }), e), {});
|
|
@@ -4606,7 +4790,7 @@ const bt = {
|
|
|
4606
4790
|
let { props: e } = t.prop;
|
|
4607
4791
|
e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4608
4792
|
}
|
|
4609
|
-
}, Ct = "slider",
|
|
4793
|
+
}, Ct = "slider", Ui = {
|
|
4610
4794
|
name: Ct,
|
|
4611
4795
|
maker: {
|
|
4612
4796
|
sliderRange: P(Ct, { range: !0 })
|
|
@@ -4615,7 +4799,7 @@ const bt = {
|
|
|
4615
4799
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
4616
4800
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
4617
4801
|
}
|
|
4618
|
-
}, Ue = "timePicker",
|
|
4802
|
+
}, Ue = "timePicker", Hi = {
|
|
4619
4803
|
name: Ue,
|
|
4620
4804
|
maker: {
|
|
4621
4805
|
time: P(Ue, (t) => t.props.isRange = !1),
|
|
@@ -4625,27 +4809,27 @@ const bt = {
|
|
|
4625
4809
|
const e = t.prop.props;
|
|
4626
4810
|
e.valueFormat || (e.valueFormat = "HH:mm:ss");
|
|
4627
4811
|
}
|
|
4628
|
-
},
|
|
4812
|
+
}, Gi = {
|
|
4629
4813
|
name: "FcRow",
|
|
4630
4814
|
render(t, e) {
|
|
4631
4815
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
4632
4816
|
e.vNode.row(e.prop, t)
|
|
4633
4817
|
]);
|
|
4634
4818
|
}
|
|
4635
|
-
},
|
|
4636
|
-
name:
|
|
4819
|
+
}, Ji = "select", Ki = {
|
|
4820
|
+
name: Ji,
|
|
4637
4821
|
toFormValue(t, e) {
|
|
4638
4822
|
return e.prop.props.multiple && !Array.isArray(t) ? H(t) : t;
|
|
4639
4823
|
}
|
|
4640
4824
|
}, Wi = [
|
|
4641
|
-
Li,
|
|
4642
4825
|
Mi,
|
|
4643
4826
|
Ni,
|
|
4644
4827
|
qi,
|
|
4645
4828
|
Ui,
|
|
4646
4829
|
Hi,
|
|
4647
|
-
|
|
4648
|
-
|
|
4830
|
+
Gi,
|
|
4831
|
+
Ki
|
|
4832
|
+
], A = "el", zi = {
|
|
4649
4833
|
button: A + "Button",
|
|
4650
4834
|
icon: "i",
|
|
4651
4835
|
slider: A + "Slider",
|
|
@@ -4678,7 +4862,7 @@ const bt = {
|
|
|
4678
4862
|
object: "fcSubForm",
|
|
4679
4863
|
subForm: "fcSubForm"
|
|
4680
4864
|
};
|
|
4681
|
-
function
|
|
4865
|
+
function xi() {
|
|
4682
4866
|
return {
|
|
4683
4867
|
form: {
|
|
4684
4868
|
inline: !1,
|
|
@@ -4712,23 +4896,23 @@ function Xi() {
|
|
|
4712
4896
|
}
|
|
4713
4897
|
};
|
|
4714
4898
|
}
|
|
4715
|
-
function
|
|
4899
|
+
function Xi(t) {
|
|
4716
4900
|
return t.type === "tooltip";
|
|
4717
4901
|
}
|
|
4718
4902
|
function wt(t, e) {
|
|
4719
4903
|
D(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4720
4904
|
}
|
|
4721
|
-
function
|
|
4905
|
+
function Q(t) {
|
|
4722
4906
|
return t === !1;
|
|
4723
4907
|
}
|
|
4724
|
-
function
|
|
4908
|
+
function Zi(t, e) {
|
|
4725
4909
|
D(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4726
4910
|
}
|
|
4727
4911
|
function He(t) {
|
|
4728
|
-
const e =
|
|
4912
|
+
const e = v({}, t);
|
|
4729
4913
|
return delete e.children, e;
|
|
4730
4914
|
}
|
|
4731
|
-
const
|
|
4915
|
+
const Qi = {
|
|
4732
4916
|
validate() {
|
|
4733
4917
|
const t = this.form();
|
|
4734
4918
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -4747,7 +4931,7 @@ const Zi = {
|
|
|
4747
4931
|
},
|
|
4748
4932
|
tidyOptions(t) {
|
|
4749
4933
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
4750
|
-
|
|
4934
|
+
Zi(t, e);
|
|
4751
4935
|
}), t;
|
|
4752
4936
|
},
|
|
4753
4937
|
tidyRule({ prop: t }) {
|
|
@@ -4769,36 +4953,35 @@ const Zi = {
|
|
|
4769
4953
|
});
|
|
4770
4954
|
},
|
|
4771
4955
|
getDefaultOptions() {
|
|
4772
|
-
return
|
|
4956
|
+
return xi();
|
|
4773
4957
|
},
|
|
4774
4958
|
update() {
|
|
4775
4959
|
const t = this.options.form;
|
|
4776
4960
|
this.rule = {
|
|
4777
|
-
props:
|
|
4961
|
+
props: v({}, t),
|
|
4778
4962
|
nativeOn: {
|
|
4779
4963
|
submit: (e) => {
|
|
4780
4964
|
e.preventDefault();
|
|
4781
4965
|
}
|
|
4782
4966
|
},
|
|
4783
|
-
class: [t.className, t.class, "form-create", this.$handle.preview ? "is-preview" : ""],
|
|
4784
4967
|
style: t.style,
|
|
4785
4968
|
type: "form"
|
|
4786
4969
|
};
|
|
4787
4970
|
},
|
|
4788
4971
|
beforeRender() {
|
|
4789
|
-
const { key: t, ref: e, $handle: r } = this;
|
|
4790
|
-
_(this.rule, { key: t, ref: e }), _(this.rule.props, {
|
|
4972
|
+
const { key: t, ref: e, $handle: r } = this, i = this.options.form;
|
|
4973
|
+
_(this.rule, { key: t, ref: e, class: [i.className, i.class, "form-create", this.$handle.preview ? "is-preview" : ""] }), _(this.rule.props, {
|
|
4791
4974
|
model: r.formData
|
|
4792
4975
|
});
|
|
4793
4976
|
},
|
|
4794
4977
|
render(t) {
|
|
4795
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
4978
|
+
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, Q(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
4796
4979
|
},
|
|
4797
4980
|
makeWrap(t, e) {
|
|
4798
4981
|
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;
|
|
4799
4982
|
delete r.wrap.title;
|
|
4800
|
-
const u =
|
|
4801
|
-
props: q(
|
|
4983
|
+
const u = Q(r.wrap.show) ? e : this.$r(ee([r.wrap, {
|
|
4984
|
+
props: q(v({
|
|
4802
4985
|
labelWidth: o === void 0 ? o : jt(o),
|
|
4803
4986
|
label: n ? r.title.title : void 0
|
|
4804
4987
|
}, He(r.wrap || {})), {
|
|
@@ -4809,22 +4992,22 @@ const Zi = {
|
|
|
4809
4992
|
key: `${i}fi`,
|
|
4810
4993
|
ref: t.wrapRef,
|
|
4811
4994
|
type: "formItem"
|
|
4812
|
-
}]),
|
|
4813
|
-
return a === !0 ||
|
|
4995
|
+
}]), v({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
4996
|
+
return a === !0 || Q(l) || Q(s.show) ? u : this.makeCol(r, i, [u]);
|
|
4814
4997
|
},
|
|
4815
4998
|
isTitle(t) {
|
|
4816
4999
|
if (this.options.form.title === !1) return !1;
|
|
4817
5000
|
const e = t.title;
|
|
4818
|
-
return !(!e.title && !e.native ||
|
|
5001
|
+
return !(!e.title && !e.native || Q(e.show));
|
|
4819
5002
|
},
|
|
4820
5003
|
makeInfo(t, e, r) {
|
|
4821
|
-
var
|
|
4822
|
-
const i =
|
|
4823
|
-
title: (
|
|
5004
|
+
var f, d, g, m, $, w;
|
|
5005
|
+
const i = v({}, t.title), s = v({}, t.info), n = Xi(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
|
|
5006
|
+
title: (d = (f = r.refRule) == null ? void 0 : f.__$title) == null ? void 0 : d.value,
|
|
4824
5007
|
rule: r.rule,
|
|
4825
5008
|
options: this.options
|
|
4826
|
-
}) : ((
|
|
4827
|
-
if (!
|
|
5009
|
+
}) : ((m = (g = r.refRule) == null ? void 0 : g.__$title) == null ? void 0 : m.value) + (o.labelSuffix || o["label-suffix"] || "")];
|
|
5010
|
+
if (!Q(s.show) && (s.info || s.native) && !Q(s.icon)) {
|
|
4828
5011
|
const O = {
|
|
4829
5012
|
type: s.type || "popover",
|
|
4830
5013
|
slot: "label",
|
|
@@ -4871,7 +5054,7 @@ const Zi = {
|
|
|
4871
5054
|
},
|
|
4872
5055
|
makeFormBtn() {
|
|
4873
5056
|
let t = [];
|
|
4874
|
-
if (
|
|
5057
|
+
if (Q(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Q(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4875
5058
|
return;
|
|
4876
5059
|
const e = this.$r({
|
|
4877
5060
|
type: "formItem",
|
|
@@ -4886,7 +5069,7 @@ const Zi = {
|
|
|
4886
5069
|
}, [e]);
|
|
4887
5070
|
},
|
|
4888
5071
|
makeResetBtn() {
|
|
4889
|
-
const t =
|
|
5072
|
+
const t = v({}, this.options.resetBtn), e = t.innerText || this.$handle.api.t("reset") || "重置";
|
|
4890
5073
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
4891
5074
|
type: "button",
|
|
4892
5075
|
props: t,
|
|
@@ -4902,7 +5085,7 @@ const Zi = {
|
|
|
4902
5085
|
}, [e]);
|
|
4903
5086
|
},
|
|
4904
5087
|
makeSubmitBtn() {
|
|
4905
|
-
const t =
|
|
5088
|
+
const t = v({}, this.options.submitBtn), e = t.innerText || this.$handle.api.t("submit") || "提交";
|
|
4906
5089
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
4907
5090
|
type: "button",
|
|
4908
5091
|
props: t,
|
|
@@ -4918,26 +5101,26 @@ const Zi = {
|
|
|
4918
5101
|
key: `${this.key}b1`
|
|
4919
5102
|
}, [e]);
|
|
4920
5103
|
}
|
|
4921
|
-
},
|
|
4922
|
-
Yi(
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
5104
|
+
}, ce = {};
|
|
5105
|
+
Yi(ce);
|
|
5106
|
+
en(ce);
|
|
5107
|
+
tn(ce);
|
|
5108
|
+
rn(ce);
|
|
5109
|
+
nn(ce);
|
|
4927
5110
|
function Yi(t) {
|
|
4928
5111
|
["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
|
|
4929
5112
|
t[e] = P(e);
|
|
4930
5113
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4931
5114
|
}
|
|
4932
|
-
function
|
|
5115
|
+
function en(t) {
|
|
4933
5116
|
const e = "select", r = "multiple";
|
|
4934
5117
|
t.selectMultiple = P(e, { [r]: !0 }), t.selectOne = P(e, { [r]: !1 });
|
|
4935
5118
|
}
|
|
4936
|
-
function
|
|
5119
|
+
function tn(t) {
|
|
4937
5120
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4938
5121
|
Object.keys(r).reduce((i, s) => (i[s] = P(e, { type: r[s] }), i), t);
|
|
4939
5122
|
}
|
|
4940
|
-
function
|
|
5123
|
+
function rn(t) {
|
|
4941
5124
|
const e = "upload", r = {
|
|
4942
5125
|
image: ["image", 0],
|
|
4943
5126
|
file: ["file", 0],
|
|
@@ -4946,7 +5129,7 @@ function tn(t) {
|
|
|
4946
5129
|
};
|
|
4947
5130
|
Object.keys(r).reduce((i, s) => (i[s] = P(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4948
5131
|
}
|
|
4949
|
-
function
|
|
5132
|
+
function nn(t) {
|
|
4950
5133
|
const e = {
|
|
4951
5134
|
frameInputs: ["input", 0],
|
|
4952
5135
|
frameFiles: ["file", 0],
|
|
@@ -4960,7 +5143,7 @@ function rn(t) {
|
|
|
4960
5143
|
function Ft(t, e) {
|
|
4961
5144
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4962
5145
|
}
|
|
4963
|
-
function
|
|
5146
|
+
function sn(t, e) {
|
|
4964
5147
|
return {
|
|
4965
5148
|
formEl() {
|
|
4966
5149
|
return e.$manager.form();
|
|
@@ -5047,7 +5230,10 @@ function nn(t, e) {
|
|
|
5047
5230
|
return new Promise((s, n) => {
|
|
5048
5231
|
(e.options.validateOnSubmit === !1 ? Promise.resolve() : t.validate()).then(() => {
|
|
5049
5232
|
let a = t.formData();
|
|
5050
|
-
|
|
5233
|
+
e.beforeSubmit(a).then(() => {
|
|
5234
|
+
h.Function(r) && F(() => r(a, t)), h.Function(e.options.onSubmit) && F(() => e.options.onSubmit(a, t)), e.vm.$emit("submit", a, t), s(a);
|
|
5235
|
+
}).catch((l) => {
|
|
5236
|
+
});
|
|
5051
5237
|
}).catch((...a) => {
|
|
5052
5238
|
h.Function(i) && F(() => i(t, ...a)), n(...a);
|
|
5053
5239
|
});
|
|
@@ -5059,14 +5245,14 @@ const Jt = {
|
|
|
5059
5245
|
name: "required",
|
|
5060
5246
|
load(t, e, r) {
|
|
5061
5247
|
var s, n;
|
|
5062
|
-
const i =
|
|
5248
|
+
const i = on(t.getValue());
|
|
5063
5249
|
if (i.required === !1)
|
|
5064
5250
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
5065
5251
|
else {
|
|
5066
|
-
const o =
|
|
5252
|
+
const o = v({
|
|
5067
5253
|
required: !0,
|
|
5068
|
-
validator(l, u,
|
|
5069
|
-
h.empty(u) ?
|
|
5254
|
+
validator(l, u, f) {
|
|
5255
|
+
h.empty(u) ? f(o.message) : f();
|
|
5070
5256
|
}
|
|
5071
5257
|
}, i), a = (n = (s = e.__fc__.refRule) == null ? void 0 : s.__$title) == null ? void 0 : n.value;
|
|
5072
5258
|
if (!o.message)
|
|
@@ -5083,25 +5269,25 @@ const Jt = {
|
|
|
5083
5269
|
Jt.load(...t);
|
|
5084
5270
|
}
|
|
5085
5271
|
};
|
|
5086
|
-
function
|
|
5272
|
+
function on(t) {
|
|
5087
5273
|
return h.Boolean(t) ? { required: t } : h.String(t) ? { message: t } : h.Undef(t) ? { required: !1 } : h.Function(t) ? { validator: t } : h.Object(t) ? t : {};
|
|
5088
5274
|
}
|
|
5089
|
-
function
|
|
5090
|
-
t.componentAlias(
|
|
5275
|
+
function an(t) {
|
|
5276
|
+
t.componentAlias(zi), Mr.forEach((e) => {
|
|
5091
5277
|
t.component(e.name, e);
|
|
5092
5278
|
}), t.register(Jt), Wi.forEach((e) => {
|
|
5093
5279
|
t.parser(e);
|
|
5094
|
-
}), Object.keys(
|
|
5095
|
-
t.maker[e] =
|
|
5280
|
+
}), Object.keys(ce).forEach((e) => {
|
|
5281
|
+
t.maker[e] = ce[e];
|
|
5096
5282
|
});
|
|
5097
5283
|
}
|
|
5098
|
-
function
|
|
5284
|
+
function ln() {
|
|
5099
5285
|
return Gt({
|
|
5100
5286
|
ui: "element-ui",
|
|
5101
|
-
version: "2.7.
|
|
5102
|
-
manager:
|
|
5103
|
-
extendApi:
|
|
5104
|
-
install:
|
|
5287
|
+
version: "2.7.6",
|
|
5288
|
+
manager: Qi,
|
|
5289
|
+
extendApi: sn,
|
|
5290
|
+
install: an,
|
|
5105
5291
|
attrs: {
|
|
5106
5292
|
normal: ["col", "wrap"],
|
|
5107
5293
|
array: ["className"],
|
|
@@ -5109,10 +5295,10 @@ function an() {
|
|
|
5109
5295
|
}
|
|
5110
5296
|
});
|
|
5111
5297
|
}
|
|
5112
|
-
const
|
|
5113
|
-
typeof window != "undefined" && (window.formCreate =
|
|
5114
|
-
const cn =
|
|
5298
|
+
const Xe = ln();
|
|
5299
|
+
typeof window != "undefined" && (window.formCreate = Xe, window.Vue && Xe.install(window.Vue));
|
|
5300
|
+
const cn = Xe.maker;
|
|
5115
5301
|
export {
|
|
5116
|
-
|
|
5302
|
+
Xe as default,
|
|
5117
5303
|
cn as maker
|
|
5118
5304
|
};
|