@form-create/element-ui 2.6.1 → 2.6.2
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 +509 -506
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +13 -13
package/dist/form-create.esm.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/element-ui v2.6.
|
|
3
|
+
* @form-create/element-ui v2.6.2
|
|
4
4
|
* (c) 2018-2024 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
7
7
|
* Released under the MIT License.
|
|
8
8
|
*/
|
|
9
9
|
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode('._fc-frame .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-frame .fc-files:hover .fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame .fc-upload-btn,.fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;box-sizing:border-box}._fc-upload .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-upload .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-upload .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-upload .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-upload .fc-files:hover .fc-upload-cover{opacity:1}._fc-upload .el-upload{display:block}._fc-upload .fc-upload-btn,._fc-upload .fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;box-sizing:border-box}._fc-group{display:flex;min-height:42px;justify-content:center;flex-direction:column}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;padding:20px 20px 25px;margin:5px 5px 25px;border-radius:5px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}.form-create .form-create .el-form-item{margin-bottom:22px}.form-create .form-create .el-form-item .el-form-item{margin-bottom:0}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
10
|
+
var yt = Object.defineProperty, gt = Object.defineProperties;
|
|
11
|
+
var $t = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var we = Object.getOwnPropertySymbols;
|
|
13
|
+
var vt = Object.prototype.hasOwnProperty, bt = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var Fe = (t, e, r) => e in t ? yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, y = (t, e) => {
|
|
15
15
|
for (var r in e || (e = {}))
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
for (var r of
|
|
19
|
-
|
|
16
|
+
vt.call(e, r) && Fe(t, r, e[r]);
|
|
17
|
+
if (we)
|
|
18
|
+
for (var r of we(e))
|
|
19
|
+
bt.call(e, r) && Fe(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
},
|
|
21
|
+
}, N = (t, e) => gt(t, $t(e));
|
|
22
22
|
import T from "vue";
|
|
23
|
-
function
|
|
23
|
+
function Ct(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function oe() {
|
|
27
|
+
return oe = Object.assign ? Object.assign.bind() : function(t) {
|
|
28
28
|
for (var e, r = 1; r < arguments.length; r++) for (var i in e = arguments[r], e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
|
|
29
29
|
return t;
|
|
30
|
-
},
|
|
30
|
+
}, oe.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var _t = ["attrs", "props", "domProps"], kt = ["class", "style", "directives"], Ot = ["on", "nativeOn"], wt = function(t) {
|
|
33
33
|
return t.reduce(function(e, r) {
|
|
34
34
|
for (var i in r) if (!e[i]) e[i] = r[i];
|
|
35
|
-
else if (
|
|
36
|
-
else if (
|
|
35
|
+
else if (_t.indexOf(i) !== -1) e[i] = oe({}, e[i], r[i]);
|
|
36
|
+
else if (kt.indexOf(i) !== -1) {
|
|
37
37
|
var s = e[i] instanceof Array ? e[i] : [e[i]], n = r[i] instanceof Array ? r[i] : [r[i]];
|
|
38
38
|
e[i] = [].concat(s, n);
|
|
39
|
-
} else if (
|
|
39
|
+
} else if (Ot.indexOf(i) !== -1)
|
|
40
40
|
for (var o in r[i]) if (e[i][o]) {
|
|
41
41
|
var a = e[i][o] instanceof Array ? e[i][o] : [e[i][o]], u = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
|
|
42
42
|
e[i][o] = [].concat(a, u);
|
|
43
43
|
} else e[i][o] = r[i][o];
|
|
44
|
-
else if (i === "hook") for (var l in r[i]) e[i][l] = e[i][l] ?
|
|
44
|
+
else if (i === "hook") for (var l in r[i]) e[i][l] = e[i][l] ? Ft(e[i][l], r[i][l]) : r[i][l];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, Ft = function(t, e) {
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
},
|
|
53
|
-
const F = /* @__PURE__ */
|
|
54
|
-
function
|
|
52
|
+
}, Et = wt;
|
|
53
|
+
const F = /* @__PURE__ */ Ct(Et);
|
|
54
|
+
function Y(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => ((!e || e.indexOf(i) === -1) && r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
name:
|
|
57
|
+
const St = "fcCheckbox", Rt = {
|
|
58
|
+
name: St,
|
|
59
59
|
props: {
|
|
60
60
|
formCreateInject: {
|
|
61
61
|
type: Object,
|
|
@@ -117,7 +117,7 @@ const Rt = "fcCheckbox", jt = {
|
|
|
117
117
|
}, {
|
|
118
118
|
key: s + r + "-" + e.value
|
|
119
119
|
}]));
|
|
120
|
-
}),
|
|
120
|
+
}), Y(this.$slots)]);
|
|
121
121
|
},
|
|
122
122
|
mounted() {
|
|
123
123
|
this.$emit("fc.el", this.$refs.el);
|
|
@@ -126,8 +126,8 @@ const Rt = "fcCheckbox", jt = {
|
|
|
126
126
|
function j(t) {
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
|
-
const
|
|
130
|
-
name:
|
|
129
|
+
const jt = "fcFrame", It = {
|
|
130
|
+
name: jt,
|
|
131
131
|
props: {
|
|
132
132
|
formCreateInject: {
|
|
133
133
|
type: Object,
|
|
@@ -469,7 +469,7 @@ const It = "fcFrame", At = {
|
|
|
469
469
|
src: this.previewImage
|
|
470
470
|
}
|
|
471
471
|
})]), t("el-dialog", F([{}, {
|
|
472
|
-
props:
|
|
472
|
+
props: N(y({
|
|
473
473
|
width: i,
|
|
474
474
|
title: o,
|
|
475
475
|
appendToBody: !0
|
|
@@ -496,8 +496,8 @@ const It = "fcFrame", At = {
|
|
|
496
496
|
mounted() {
|
|
497
497
|
this.$on("fc.closeModal", this.closeModal);
|
|
498
498
|
}
|
|
499
|
-
},
|
|
500
|
-
name:
|
|
499
|
+
}, At = "fcRadio", Vt = {
|
|
500
|
+
name: At,
|
|
501
501
|
props: {
|
|
502
502
|
formCreateInject: {
|
|
503
503
|
type: Object,
|
|
@@ -556,12 +556,12 @@ const It = "fcFrame", At = {
|
|
|
556
556
|
}, {
|
|
557
557
|
key: s + r + "-" + e.value
|
|
558
558
|
}]));
|
|
559
|
-
}),
|
|
559
|
+
}), Y(this.$slots)]);
|
|
560
560
|
},
|
|
561
561
|
mounted() {
|
|
562
562
|
this.$emit("fc.el", this.$refs.el);
|
|
563
563
|
}
|
|
564
|
-
},
|
|
564
|
+
}, f = {
|
|
565
565
|
type(t, e) {
|
|
566
566
|
return Object.prototype.toString.call(t) === "[object " + e + "]";
|
|
567
567
|
},
|
|
@@ -569,7 +569,7 @@ const It = "fcFrame", At = {
|
|
|
569
569
|
return t == null;
|
|
570
570
|
},
|
|
571
571
|
Element(t) {
|
|
572
|
-
return typeof t == "object" && t !== null && t.nodeType === 1 && !
|
|
572
|
+
return typeof t == "object" && t !== null && t.nodeType === 1 && !f.Object(t);
|
|
573
573
|
},
|
|
574
574
|
trueArray(t) {
|
|
575
575
|
return Array.isArray(t) && t.length > 0;
|
|
@@ -587,15 +587,15 @@ const It = "fcFrame", At = {
|
|
|
587
587
|
}
|
|
588
588
|
};
|
|
589
589
|
["Date", "Object", "String", "Boolean", "Array", "Number"].forEach((t) => {
|
|
590
|
-
|
|
591
|
-
return
|
|
590
|
+
f[t] = function(e) {
|
|
591
|
+
return f.type(e, t);
|
|
592
592
|
};
|
|
593
593
|
});
|
|
594
594
|
function O(t, e) {
|
|
595
595
|
return {}.hasOwnProperty.call(t, e);
|
|
596
596
|
}
|
|
597
|
-
const
|
|
598
|
-
name:
|
|
597
|
+
const Pt = "fcSelect", Tt = {
|
|
598
|
+
name: Pt,
|
|
599
599
|
functional: !0,
|
|
600
600
|
props: {
|
|
601
601
|
formCreateInject: {
|
|
@@ -612,13 +612,13 @@ const Tt = "fcSelect", Dt = {
|
|
|
612
612
|
key: "" + o + "-" + n.value
|
|
613
613
|
}]), [a ? t("template", {
|
|
614
614
|
slot: n.slotName || "default"
|
|
615
|
-
}, [
|
|
615
|
+
}, [f.Function(a) ? n.slot(t) : a]) : null]);
|
|
616
616
|
}, i = (n, o) => t("ElOptionGroup", {
|
|
617
617
|
attrs: {
|
|
618
618
|
label: n.label
|
|
619
619
|
},
|
|
620
620
|
key: "" + o + "-" + n.label
|
|
621
|
-
}, [
|
|
621
|
+
}, [f.trueArray(n.options) && n.options.map((a, u) => r(a, u))]), s = e.props.formCreateInject.options;
|
|
622
622
|
return t("ElSelect", F([{}, e.data, {
|
|
623
623
|
ref: "el"
|
|
624
624
|
}]), [(Array.isArray(s) ? s : []).map((n, o) => O(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
@@ -626,8 +626,8 @@ const Tt = "fcSelect", Dt = {
|
|
|
626
626
|
mounted() {
|
|
627
627
|
this.$emit("fc.el", this.$refs.el);
|
|
628
628
|
}
|
|
629
|
-
},
|
|
630
|
-
name:
|
|
629
|
+
}, Dt = "fcTree", Bt = {
|
|
630
|
+
name: Dt,
|
|
631
631
|
formCreateParser: {
|
|
632
632
|
mergeProp(t) {
|
|
633
633
|
const e = t.prop.props;
|
|
@@ -677,23 +677,23 @@ const Tt = "fcSelect", Dt = {
|
|
|
677
677
|
check: () => this.updateValue(),
|
|
678
678
|
"node-click": () => this.updateValue()
|
|
679
679
|
}
|
|
680
|
-
}]), [
|
|
680
|
+
}]), [Y(this.$slots)]);
|
|
681
681
|
},
|
|
682
682
|
mounted() {
|
|
683
683
|
this.setValue(), this.$emit("fc.el", this.$refs.tree);
|
|
684
684
|
}
|
|
685
685
|
};
|
|
686
|
-
function
|
|
686
|
+
function Ee(t, e) {
|
|
687
687
|
return {
|
|
688
688
|
url: t,
|
|
689
|
-
name:
|
|
689
|
+
name: Lt(t),
|
|
690
690
|
uid: e
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function Lt(t) {
|
|
694
694
|
return ("" + t).split("/").pop();
|
|
695
695
|
}
|
|
696
|
-
const Mt = "fcUpload",
|
|
696
|
+
const Mt = "fcUpload", Nt = {
|
|
697
697
|
name: Mt,
|
|
698
698
|
props: {
|
|
699
699
|
formCreateInject: {
|
|
@@ -736,11 +736,11 @@ const Mt = "fcUpload", qt = {
|
|
|
736
736
|
};
|
|
737
737
|
},
|
|
738
738
|
created() {
|
|
739
|
-
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = j(this.value).map(
|
|
739
|
+
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = j(this.value).map(Ee);
|
|
740
740
|
},
|
|
741
741
|
watch: {
|
|
742
742
|
value(t) {
|
|
743
|
-
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = j(t).map(
|
|
743
|
+
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = j(t).map(Ee), this.uploadList = this.$refs.upload.uploadFiles);
|
|
744
744
|
},
|
|
745
745
|
limit(t, e) {
|
|
746
746
|
(e === 1 || t === 1) && this.update();
|
|
@@ -836,11 +836,11 @@ const Mt = "fcUpload", qt = {
|
|
|
836
836
|
class: "fc-upload-btn"
|
|
837
837
|
}, [t("i", {
|
|
838
838
|
class: "el-icon-upload2"
|
|
839
|
-
})])]) : null,
|
|
839
|
+
})])]) : null, Y(this.$slots, ["default"])]);
|
|
840
840
|
},
|
|
841
841
|
update() {
|
|
842
|
-
let t = this.$refs.upload.uploadFiles.map((e) => e.url).filter((e) => e !== void 0);
|
|
843
|
-
(
|
|
842
|
+
let t = this.$refs.upload.uploadFiles.map((e) => e.url).filter((e) => e !== void 0 && e.indexOf("blob:") !== 0);
|
|
843
|
+
JSON.stringify(t) !== JSON.stringify(this.cacheFiles) && (this.cacheFiles = [...t], this.$emit("input", this.limit === 1 ? t[0] || "" : t));
|
|
844
844
|
},
|
|
845
845
|
handleCancel() {
|
|
846
846
|
this.previewVisible = !1;
|
|
@@ -883,12 +883,12 @@ function w(t, e, r) {
|
|
|
883
883
|
function B(t, e) {
|
|
884
884
|
T.delete(t, e);
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function K(t, e = {}, r) {
|
|
887
887
|
let i = !1;
|
|
888
888
|
for (let s in e)
|
|
889
889
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
890
890
|
let n = e[s];
|
|
891
|
-
if ((i = Array.isArray(n)) ||
|
|
891
|
+
if ((i = Array.isArray(n)) || f.Object(n)) {
|
|
892
892
|
let o = t[s] === void 0;
|
|
893
893
|
if (i)
|
|
894
894
|
i = !1, o && w(t, s, []);
|
|
@@ -901,26 +901,26 @@ function W(t, e = {}, r) {
|
|
|
901
901
|
}
|
|
902
902
|
else
|
|
903
903
|
o && w(t, s, {});
|
|
904
|
-
t[s] =
|
|
904
|
+
t[s] = K(t[s], n, r);
|
|
905
905
|
} else
|
|
906
|
-
w(t, s, n),
|
|
906
|
+
w(t, s, n), f.Undef(n) || (f.Undef(n.__json) || (t[s].__json = n.__json), f.Undef(n.__origin) || (t[s].__origin = n.__origin));
|
|
907
907
|
}
|
|
908
908
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
909
909
|
}
|
|
910
910
|
function L(t) {
|
|
911
|
-
return
|
|
911
|
+
return K({}, { value: t }).value;
|
|
912
912
|
}
|
|
913
|
-
const
|
|
913
|
+
const qt = Object.assign || function(t) {
|
|
914
914
|
for (let e, r = 1; r < arguments.length; r++)
|
|
915
915
|
for (let i in e = arguments[r], e)
|
|
916
916
|
Object.prototype.hasOwnProperty.call(e, i) && w(t, i, e[i]);
|
|
917
917
|
return t;
|
|
918
918
|
};
|
|
919
919
|
function p() {
|
|
920
|
-
return
|
|
920
|
+
return qt.apply(this, arguments);
|
|
921
921
|
}
|
|
922
|
-
const
|
|
923
|
-
name:
|
|
922
|
+
const Ut = "fcGroup", Ht = {
|
|
923
|
+
name: Ut,
|
|
924
924
|
props: {
|
|
925
925
|
field: String,
|
|
926
926
|
rule: [Array, Object],
|
|
@@ -1001,7 +1001,7 @@ const Ht = "fcGroup", xt = {
|
|
|
1001
1001
|
const s = i.$f.formData();
|
|
1002
1002
|
if (t === e)
|
|
1003
1003
|
i.$f.deferSyncValue(() => {
|
|
1004
|
-
|
|
1004
|
+
K(i.rule, t), i.$f.setValue(s);
|
|
1005
1005
|
}, !0);
|
|
1006
1006
|
else {
|
|
1007
1007
|
const n = i.$f.formData();
|
|
@@ -1187,7 +1187,7 @@ const Ht = "fcGroup", xt = {
|
|
|
1187
1187
|
const {
|
|
1188
1188
|
rule: u,
|
|
1189
1189
|
options: l
|
|
1190
|
-
} = this.cacheRule[o],
|
|
1190
|
+
} = this.cacheRule[o], c = r && !s ? this.makeIcon(e.length, a, o) : [];
|
|
1191
1191
|
return t("div", {
|
|
1192
1192
|
class: "_fc-group-container",
|
|
1193
1193
|
key: o
|
|
@@ -1212,17 +1212,17 @@ const Ht = "fcGroup", xt = {
|
|
|
1212
1212
|
}
|
|
1213
1213
|
}])), t("div", {
|
|
1214
1214
|
class: "_fc-group-idx"
|
|
1215
|
-
}, [a + 1]),
|
|
1215
|
+
}, [a + 1]), c.length ? t("div", {
|
|
1216
1216
|
class: "_fc-group-handle"
|
|
1217
|
-
}, [
|
|
1217
|
+
}, [c]) : null]);
|
|
1218
1218
|
});
|
|
1219
1219
|
return t("div", {
|
|
1220
1220
|
key: "con",
|
|
1221
1221
|
class: "_fc-group " + (s ? "_fc-group-disabled" : "")
|
|
1222
1222
|
}, [n]);
|
|
1223
1223
|
}
|
|
1224
|
-
},
|
|
1225
|
-
name:
|
|
1224
|
+
}, xt = "fcSubForm", Jt = {
|
|
1225
|
+
name: xt,
|
|
1226
1226
|
props: {
|
|
1227
1227
|
rule: Array,
|
|
1228
1228
|
options: Object,
|
|
@@ -1305,27 +1305,27 @@ const Ht = "fcGroup", xt = {
|
|
|
1305
1305
|
}
|
|
1306
1306
|
}]));
|
|
1307
1307
|
}
|
|
1308
|
-
},
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
],
|
|
1308
|
+
}, Kt = [
|
|
1309
|
+
Rt,
|
|
1310
|
+
It,
|
|
1311
|
+
Vt,
|
|
1312
|
+
Tt,
|
|
1313
|
+
Bt,
|
|
1314
|
+
Nt,
|
|
1315
|
+
Ht,
|
|
1316
|
+
Jt
|
|
1317
|
+
], Se = "FormCreate", ae = (t, e) => {
|
|
1318
1318
|
if (!(!t || t === e)) {
|
|
1319
1319
|
if (t.formCreateInject)
|
|
1320
1320
|
return t.formCreateInject;
|
|
1321
1321
|
if (t.$parent)
|
|
1322
|
-
return
|
|
1322
|
+
return ae(t.$parent, e);
|
|
1323
1323
|
}
|
|
1324
1324
|
};
|
|
1325
|
-
function
|
|
1325
|
+
function Wt(t, e, r) {
|
|
1326
1326
|
return {
|
|
1327
|
-
name:
|
|
1328
|
-
componentName:
|
|
1327
|
+
name: Se,
|
|
1328
|
+
componentName: Se,
|
|
1329
1329
|
model: {
|
|
1330
1330
|
prop: "api"
|
|
1331
1331
|
},
|
|
@@ -1401,8 +1401,8 @@ function Gt(t, e, r) {
|
|
|
1401
1401
|
},
|
|
1402
1402
|
deep: !0
|
|
1403
1403
|
},
|
|
1404
|
-
rule(i) {
|
|
1405
|
-
i.length === this.renderRule.length && i.every((
|
|
1404
|
+
rule(i, s) {
|
|
1405
|
+
i.length === this.renderRule.length && i.every((n) => this.renderRule.indexOf(n) > -1) || (this.formCreate.$handle.reloadRule(i), this._renderRule(), i !== s && this.formCreate.$handle.targetReload());
|
|
1406
1406
|
},
|
|
1407
1407
|
disabled() {
|
|
1408
1408
|
this.$f.refresh();
|
|
@@ -1416,14 +1416,14 @@ function Gt(t, e, r) {
|
|
|
1416
1416
|
created() {
|
|
1417
1417
|
const i = this, s = this.formCreate.api(), n = () => {
|
|
1418
1418
|
if (i.$pfc) {
|
|
1419
|
-
const a =
|
|
1419
|
+
const a = ae(i, i.$pfc);
|
|
1420
1420
|
if (a) {
|
|
1421
1421
|
let u;
|
|
1422
1422
|
i.isMore ? (u = j(a.getSubForm()), u.push(s)) : u = s, a.subForm(u);
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
1425
|
}, o = () => {
|
|
1426
|
-
const a =
|
|
1426
|
+
const a = ae(i, i.$pfc);
|
|
1427
1427
|
if (a)
|
|
1428
1428
|
if (i.isMore) {
|
|
1429
1429
|
const u = j(a.getSubForm()), l = u.indexOf(s);
|
|
@@ -1439,8 +1439,8 @@ function Gt(t, e, r) {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
};
|
|
1441
1441
|
}
|
|
1442
|
-
const
|
|
1443
|
-
const i = [...
|
|
1442
|
+
const We = ["attrs", "props", "domProps", "scopedSlots"], Ge = ["class", "style", "directives"], Xe = ["on", "nativeOn"], D = (t, e = {}, r = {}) => {
|
|
1443
|
+
const i = [...We, ...r.normal || []], s = [...Ge, ...r.array || []], n = [...Xe, ...r.functional || []], o = r.props || [];
|
|
1444
1444
|
return t.reduce((a, u) => {
|
|
1445
1445
|
for (const l in u)
|
|
1446
1446
|
if (a[l])
|
|
@@ -1449,76 +1449,76 @@ const Ge = ["attrs", "props", "domProps", "scopedSlots"], Xe = ["class", "style"
|
|
|
1449
1449
|
else if (i.indexOf(l) > -1)
|
|
1450
1450
|
a[l] = y(y({}, a[l]), u[l]);
|
|
1451
1451
|
else if (s.indexOf(l) > -1) {
|
|
1452
|
-
const
|
|
1453
|
-
a[l] = [...
|
|
1452
|
+
const c = a[l] instanceof Array ? a[l] : [a[l]], m = u[l] instanceof Array ? u[l] : [u[l]];
|
|
1453
|
+
a[l] = [...c, ...m];
|
|
1454
1454
|
} else if (n.indexOf(l) > -1)
|
|
1455
|
-
for (const
|
|
1456
|
-
if (a[l][
|
|
1457
|
-
const m = a[l][
|
|
1458
|
-
a[l][
|
|
1455
|
+
for (const c in u[l])
|
|
1456
|
+
if (a[l][c]) {
|
|
1457
|
+
const m = a[l][c] instanceof Array ? a[l][c] : [a[l][c]], v = u[l][c] instanceof Array ? u[l][c] : [u[l][c]];
|
|
1458
|
+
a[l][c] = [...m, ...v];
|
|
1459
1459
|
} else
|
|
1460
|
-
a[l][
|
|
1460
|
+
a[l][c] = u[l][c];
|
|
1461
1461
|
else if (l === "hook")
|
|
1462
|
-
for (let
|
|
1463
|
-
a[l][
|
|
1462
|
+
for (let c in u[l])
|
|
1463
|
+
a[l][c] ? a[l][c] = Gt(a[l][c], u[l][c]) : a[l][c] = u[l][c];
|
|
1464
1464
|
else
|
|
1465
1465
|
a[l] = u[l];
|
|
1466
1466
|
else
|
|
1467
1467
|
i.indexOf(l) > -1 || n.indexOf(l) > -1 || o.indexOf(l) > -1 ? a[l] = y({}, u[l]) : s.indexOf(l) > -1 ? a[l] = u[l] instanceof Array ? [...u[l]] : typeof u[l] == "object" ? y({}, u[l]) : u[l] : a[l] = u[l];
|
|
1468
1468
|
return a;
|
|
1469
1469
|
}, e);
|
|
1470
|
-
},
|
|
1470
|
+
}, Gt = (t, e) => function() {
|
|
1471
1471
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1472
|
-
},
|
|
1473
|
-
function
|
|
1474
|
-
return [...
|
|
1472
|
+
}, ze = ["type", "slot", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "preview", "component", "cache"], ce = ["validate", "children", "control"], de = ["effect", "deep"];
|
|
1473
|
+
function Xt() {
|
|
1474
|
+
return [...ze, ...We, ...Ge, ...Xe, ...ce, ...de];
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function pe(t, e, r) {
|
|
1477
1477
|
return `[form-create ${t}]: ${e}`;
|
|
1478
1478
|
}
|
|
1479
|
-
function
|
|
1480
|
-
console.warn(
|
|
1479
|
+
function zt(t, e) {
|
|
1480
|
+
console.warn(pe("tip", t));
|
|
1481
1481
|
}
|
|
1482
|
-
function
|
|
1483
|
-
console.error(
|
|
1482
|
+
function me(t, e) {
|
|
1483
|
+
console.error(pe("err", t));
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1486
|
-
|
|
1485
|
+
function Qt(t) {
|
|
1486
|
+
me(t.toString()), console.error(t);
|
|
1487
1487
|
}
|
|
1488
|
-
const
|
|
1489
|
-
function
|
|
1490
|
-
return JSON.stringify(
|
|
1488
|
+
const le = "[[FORM-CREATE-PREFIX-", ue = "-FORM-CREATE-SUFFIX]]", Re = "$FN:", je = "$FNX:";
|
|
1489
|
+
function Qe(t, e) {
|
|
1490
|
+
return JSON.stringify(K(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1491
1491
|
if (!(i && i._isVue === !0)) {
|
|
1492
|
-
if (typeof i
|
|
1492
|
+
if (typeof i != "function")
|
|
1493
1493
|
return i;
|
|
1494
1494
|
if (i.__json)
|
|
1495
1495
|
return i.__json;
|
|
1496
1496
|
if (i.__origin && (i = i.__origin), !i.__emit)
|
|
1497
|
-
return
|
|
1497
|
+
return le + i + ue;
|
|
1498
1498
|
}
|
|
1499
1499
|
}, e);
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1501
|
+
function Ie(t) {
|
|
1502
1502
|
return new Function("return " + t)();
|
|
1503
1503
|
}
|
|
1504
1504
|
function q(t, e) {
|
|
1505
|
-
if (t &&
|
|
1505
|
+
if (t && f.String(t) && t.length > 4) {
|
|
1506
1506
|
let r = t.trim(), i = !1;
|
|
1507
1507
|
try {
|
|
1508
|
-
if (r.indexOf(
|
|
1509
|
-
r = r.replace(
|
|
1510
|
-
else if (r.indexOf(
|
|
1511
|
-
r = r.replace(
|
|
1508
|
+
if (r.indexOf(ue) > 0 && r.indexOf(le) === 0)
|
|
1509
|
+
r = r.replace(ue, "").replace(le, ""), i = !0;
|
|
1510
|
+
else if (r.indexOf(Re) === 0)
|
|
1511
|
+
r = r.replace(Re, ""), i = !0;
|
|
1512
1512
|
else {
|
|
1513
|
-
if (r.indexOf(
|
|
1514
|
-
return r =
|
|
1515
|
-
!e && r.indexOf(
|
|
1513
|
+
if (r.indexOf(je) === 0)
|
|
1514
|
+
return r = Ie("function($inject){" + r.replace(je, "") + "}"), r.__json = t, r.__inject = !0, r;
|
|
1515
|
+
!e && r.indexOf("function ") === 0 && r !== "function " && (i = !0);
|
|
1516
1516
|
}
|
|
1517
1517
|
if (!i) return t;
|
|
1518
|
-
const s =
|
|
1518
|
+
const s = Ie(r.indexOf("function ") === -1 && r.indexOf("(") !== 0 ? "function " + r : r);
|
|
1519
1519
|
return s.__json = t, s;
|
|
1520
1520
|
} catch (s) {
|
|
1521
|
-
|
|
1521
|
+
me(`解析失败:${r}
|
|
1522
1522
|
|
|
1523
1523
|
err: ${s}`);
|
|
1524
1524
|
return;
|
|
@@ -1526,12 +1526,12 @@ err: ${s}`);
|
|
|
1526
1526
|
}
|
|
1527
1527
|
return t;
|
|
1528
1528
|
}
|
|
1529
|
-
function
|
|
1529
|
+
function Zt(t, e) {
|
|
1530
1530
|
return JSON.parse(t, function(r, i) {
|
|
1531
|
-
return
|
|
1531
|
+
return f.Undef(i) || !i.indexOf ? i : q(i, e);
|
|
1532
1532
|
});
|
|
1533
1533
|
}
|
|
1534
|
-
function
|
|
1534
|
+
function Ze(t, e) {
|
|
1535
1535
|
return {
|
|
1536
1536
|
value: t,
|
|
1537
1537
|
enumerable: !1,
|
|
@@ -1539,60 +1539,60 @@ function Ye(t, e) {
|
|
|
1539
1539
|
writable: !!e
|
|
1540
1540
|
};
|
|
1541
1541
|
}
|
|
1542
|
-
function
|
|
1543
|
-
return
|
|
1542
|
+
function ye(t) {
|
|
1543
|
+
return Ye([t])[0];
|
|
1544
1544
|
}
|
|
1545
|
-
function
|
|
1546
|
-
return
|
|
1545
|
+
function Ye(t, e) {
|
|
1546
|
+
return K([], [...t], e || !1);
|
|
1547
1547
|
}
|
|
1548
1548
|
function U(t, e) {
|
|
1549
|
-
return D(Array.isArray(e) ? e : [e], t, { array:
|
|
1549
|
+
return D(Array.isArray(e) ? e : [e], t, { array: ce, normal: de }), t;
|
|
1550
1550
|
}
|
|
1551
|
-
function
|
|
1552
|
-
const e =
|
|
1551
|
+
function Ae(t) {
|
|
1552
|
+
const e = f.Function(t.getRule) ? t.getRule() : t;
|
|
1553
1553
|
return e.type || (e.type = "input"), e;
|
|
1554
1554
|
}
|
|
1555
|
-
function
|
|
1555
|
+
function Yt(t, e) {
|
|
1556
1556
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1557
1557
|
e[r] && (t[r] = U(t[r] || {}, e[r]));
|
|
1558
1558
|
}), t) : e;
|
|
1559
1559
|
}
|
|
1560
|
-
function
|
|
1560
|
+
function et(t, e) {
|
|
1561
1561
|
Object.defineProperties(t, Object.keys(e).reduce((r, i) => (r[i] = {
|
|
1562
1562
|
get() {
|
|
1563
1563
|
return e[i]();
|
|
1564
1564
|
}
|
|
1565
1565
|
}, r), {}));
|
|
1566
1566
|
}
|
|
1567
|
-
function
|
|
1567
|
+
function z(t) {
|
|
1568
1568
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1569
1569
|
}
|
|
1570
1570
|
function R(t, e) {
|
|
1571
1571
|
try {
|
|
1572
1572
|
e = t();
|
|
1573
1573
|
} catch (r) {
|
|
1574
|
-
|
|
1574
|
+
Qt(r);
|
|
1575
1575
|
}
|
|
1576
1576
|
return e;
|
|
1577
1577
|
}
|
|
1578
|
-
const
|
|
1579
|
-
"==": (t, e) => JSON.stringify(t) === JSON.stringify(
|
|
1580
|
-
"!=": (t, e) => !
|
|
1578
|
+
const Ve = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, J = {
|
|
1579
|
+
"==": (t, e) => JSON.stringify(t) === JSON.stringify(Ve(t, e)),
|
|
1580
|
+
"!=": (t, e) => !J["=="](t, e),
|
|
1581
1581
|
">": (t, e) => t > e,
|
|
1582
1582
|
">=": (t, e) => t >= e,
|
|
1583
1583
|
"<": (t, e) => t < e,
|
|
1584
1584
|
"<=": (t, e) => t <= e,
|
|
1585
1585
|
on(t, e) {
|
|
1586
|
-
return t && t.indexOf && t.indexOf(
|
|
1586
|
+
return t && t.indexOf && t.indexOf(Ve(t[0], e)) > -1;
|
|
1587
1587
|
},
|
|
1588
1588
|
notOn(t, e) {
|
|
1589
|
-
return !
|
|
1589
|
+
return !J.on(t, e);
|
|
1590
1590
|
},
|
|
1591
1591
|
in(t, e) {
|
|
1592
1592
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1593
1593
|
},
|
|
1594
1594
|
notIn(t, e) {
|
|
1595
|
-
return !
|
|
1595
|
+
return !J.in(t, e);
|
|
1596
1596
|
},
|
|
1597
1597
|
between(t, e) {
|
|
1598
1598
|
return t > e[0] && t < e[1];
|
|
@@ -1601,16 +1601,16 @@ const Pe = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1601
1601
|
return t < e[0] || t > e[1];
|
|
1602
1602
|
},
|
|
1603
1603
|
empty(t) {
|
|
1604
|
-
return
|
|
1604
|
+
return f.empty(t);
|
|
1605
1605
|
},
|
|
1606
1606
|
notEmpty(t) {
|
|
1607
|
-
return !
|
|
1607
|
+
return !f.empty(t);
|
|
1608
1608
|
},
|
|
1609
1609
|
pattern(t, e) {
|
|
1610
1610
|
return new RegExp(e, "g").test(t);
|
|
1611
1611
|
}
|
|
1612
1612
|
};
|
|
1613
|
-
function
|
|
1613
|
+
function tt() {
|
|
1614
1614
|
return {
|
|
1615
1615
|
props: {},
|
|
1616
1616
|
on: {},
|
|
@@ -1624,14 +1624,14 @@ function rt() {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
function E(t, e) {
|
|
1626
1626
|
return (r, i, s, n = {}) => {
|
|
1627
|
-
const o = new
|
|
1628
|
-
return e && (
|
|
1627
|
+
const o = new ge(t, r, i, s, n);
|
|
1628
|
+
return e && (f.Function(e) ? e(o) : o.props(e)), o;
|
|
1629
1629
|
};
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1632
|
-
this._data = p(
|
|
1631
|
+
function ge(t, e, r, i, s) {
|
|
1632
|
+
this._data = p(tt(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1633
1633
|
}
|
|
1634
|
-
p(
|
|
1634
|
+
p(ge.prototype, {
|
|
1635
1635
|
getRule() {
|
|
1636
1636
|
return this._data;
|
|
1637
1637
|
},
|
|
@@ -1640,39 +1640,39 @@ p($e.prototype, {
|
|
|
1640
1640
|
},
|
|
1641
1641
|
_clone() {
|
|
1642
1642
|
const t = new this.constructor();
|
|
1643
|
-
return t._data =
|
|
1643
|
+
return t._data = ye(this._data), t;
|
|
1644
1644
|
}
|
|
1645
1645
|
});
|
|
1646
|
-
function
|
|
1646
|
+
function rt(t) {
|
|
1647
1647
|
t.forEach((e) => {
|
|
1648
|
-
|
|
1648
|
+
ge.prototype[e] = function(r) {
|
|
1649
1649
|
return U(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1650
1650
|
};
|
|
1651
1651
|
});
|
|
1652
1652
|
}
|
|
1653
|
-
|
|
1654
|
-
const
|
|
1655
|
-
function
|
|
1656
|
-
let i =
|
|
1653
|
+
rt(Xt());
|
|
1654
|
+
const it = E("");
|
|
1655
|
+
function er(t, e, r) {
|
|
1656
|
+
let i = it("", e);
|
|
1657
1657
|
return i._data.type = t, i._data.title = r, i;
|
|
1658
1658
|
}
|
|
1659
|
-
function
|
|
1660
|
-
let s =
|
|
1659
|
+
function Pe(t, e, r, i) {
|
|
1660
|
+
let s = it("", r);
|
|
1661
1661
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1662
1662
|
}
|
|
1663
|
-
function
|
|
1663
|
+
function tr() {
|
|
1664
1664
|
return {
|
|
1665
|
-
create:
|
|
1666
|
-
createTmp:
|
|
1667
|
-
template:
|
|
1665
|
+
create: er,
|
|
1666
|
+
createTmp: Pe,
|
|
1667
|
+
template: Pe,
|
|
1668
1668
|
factory: E
|
|
1669
1669
|
};
|
|
1670
1670
|
}
|
|
1671
|
-
function
|
|
1671
|
+
function rr(t, e, r) {
|
|
1672
1672
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1673
1673
|
return s.status = r.status, s.url = t, s;
|
|
1674
1674
|
}
|
|
1675
|
-
function
|
|
1675
|
+
function Te(t) {
|
|
1676
1676
|
const e = t.responseText || t.response;
|
|
1677
1677
|
if (!e)
|
|
1678
1678
|
return e;
|
|
@@ -1682,7 +1682,7 @@ function De(t) {
|
|
|
1682
1682
|
return e;
|
|
1683
1683
|
}
|
|
1684
1684
|
}
|
|
1685
|
-
function
|
|
1685
|
+
function nt(t) {
|
|
1686
1686
|
if (typeof XMLHttpRequest == "undefined")
|
|
1687
1687
|
return;
|
|
1688
1688
|
const e = new XMLHttpRequest(), r = t.action;
|
|
@@ -1690,8 +1690,8 @@ function st(t) {
|
|
|
1690
1690
|
t.onError(o);
|
|
1691
1691
|
}, e.onload = function() {
|
|
1692
1692
|
if (e.status < 200 || e.status >= 300)
|
|
1693
|
-
return t.onError(
|
|
1694
|
-
t.onSuccess(
|
|
1693
|
+
return t.onError(rr(r, t, e), Te(e));
|
|
1694
|
+
t.onSuccess(Te(e));
|
|
1695
1695
|
}, e.open(t.method || "get", r, !0);
|
|
1696
1696
|
let i;
|
|
1697
1697
|
t.data && ((t.dataType || "").toLowerCase() !== "json" ? (i = new FormData(), Object.keys(t.data).map((n) => {
|
|
@@ -1702,13 +1702,13 @@ function st(t) {
|
|
|
1702
1702
|
s[n] !== null && e.setRequestHeader(n, s[n]);
|
|
1703
1703
|
}), e.send(i);
|
|
1704
1704
|
}
|
|
1705
|
-
function
|
|
1705
|
+
function ir(t) {
|
|
1706
1706
|
return new Promise((e, r) => {
|
|
1707
|
-
|
|
1707
|
+
nt(N(y({}, t), {
|
|
1708
1708
|
onSuccess(i) {
|
|
1709
1709
|
let s = (o) => o;
|
|
1710
1710
|
const n = q(t.parse);
|
|
1711
|
-
|
|
1711
|
+
f.Function(n) ? s = n : n && f.String(n) && (s = (o) => (n.split(".").forEach((a) => {
|
|
1712
1712
|
o && (o = o[a]);
|
|
1713
1713
|
}), o)), e(s(i));
|
|
1714
1714
|
},
|
|
@@ -1718,12 +1718,12 @@ function nr(t) {
|
|
|
1718
1718
|
}));
|
|
1719
1719
|
});
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1721
|
+
function X(t) {
|
|
1722
1722
|
return L(t);
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1724
|
+
function nr(t) {
|
|
1725
1725
|
function e(n) {
|
|
1726
|
-
return
|
|
1726
|
+
return f.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1727
1727
|
}
|
|
1728
1728
|
function r(n, o, a) {
|
|
1729
1729
|
e(n).forEach((u) => {
|
|
@@ -1764,13 +1764,13 @@ function sr(t) {
|
|
|
1764
1764
|
formData(n) {
|
|
1765
1765
|
return e(n).reduce((o, a) => {
|
|
1766
1766
|
const u = t.getFieldCtx(a);
|
|
1767
|
-
return u && (o[u.field] =
|
|
1768
|
-
}, t.options.appendValue !== !1 ?
|
|
1767
|
+
return u && (o[u.field] = X(u.rule.value)), o;
|
|
1768
|
+
}, t.options.appendValue !== !1 ? X(t.appendData) : {});
|
|
1769
1769
|
},
|
|
1770
1770
|
getValue(n) {
|
|
1771
1771
|
const o = t.getFieldCtx(n);
|
|
1772
1772
|
if (o)
|
|
1773
|
-
return
|
|
1773
|
+
return X(o.rule.value);
|
|
1774
1774
|
},
|
|
1775
1775
|
coverValue(n) {
|
|
1776
1776
|
const o = y({}, n || {});
|
|
@@ -1779,8 +1779,8 @@ function sr(t) {
|
|
|
1779
1779
|
const u = t.fieldCtx[a];
|
|
1780
1780
|
if (u) {
|
|
1781
1781
|
const l = O(o, a);
|
|
1782
|
-
u.forEach((
|
|
1783
|
-
|
|
1782
|
+
u.forEach((c) => {
|
|
1783
|
+
c.rule.value = l ? o[a] : void 0;
|
|
1784
1784
|
}), delete o[a];
|
|
1785
1785
|
}
|
|
1786
1786
|
}), p(t.appendData, o);
|
|
@@ -1807,7 +1807,7 @@ function sr(t) {
|
|
|
1807
1807
|
}, !0), o ? o.origin : void 0;
|
|
1808
1808
|
},
|
|
1809
1809
|
removeRule(n) {
|
|
1810
|
-
const o = n &&
|
|
1810
|
+
const o = n && z(n);
|
|
1811
1811
|
if (o)
|
|
1812
1812
|
return o.rm(), o.origin;
|
|
1813
1813
|
},
|
|
@@ -1817,13 +1817,13 @@ function sr(t) {
|
|
|
1817
1817
|
fields: () => t.fields(),
|
|
1818
1818
|
append: (n, o, a) => {
|
|
1819
1819
|
let u = t.sort.length - 1, l;
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1820
|
+
const c = t.getCtx(o);
|
|
1821
|
+
c ? a ? (l = c.rule.children, u = c.rule.children.length - 1) : (u = c.root.indexOf(c.origin), l = c.root) : l = t.rules, l.splice(u + 1, 0, n);
|
|
1822
1822
|
},
|
|
1823
1823
|
prepend: (n, o, a) => {
|
|
1824
1824
|
let u = 0, l;
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1825
|
+
const c = t.getCtx(o);
|
|
1826
|
+
c ? a ? l = c.rule.children : (u = c.root.indexOf(c.origin), l = c.root) : l = t.rules, l.splice(u, 0, n);
|
|
1827
1827
|
},
|
|
1828
1828
|
hidden(n, o) {
|
|
1829
1829
|
r(o, "hidden", !!n), t.refresh();
|
|
@@ -1883,7 +1883,7 @@ function sr(t) {
|
|
|
1883
1883
|
n.forEach((a) => s.sync(a));
|
|
1884
1884
|
return;
|
|
1885
1885
|
}
|
|
1886
|
-
let o =
|
|
1886
|
+
let o = f.Object(n) ? z(n) : t.getCtxs(n);
|
|
1887
1887
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
1888
1888
|
if (!a.deleted) {
|
|
1889
1889
|
const u = t.subForm[a.id];
|
|
@@ -1967,23 +1967,23 @@ function sr(t) {
|
|
|
1967
1967
|
resetFields(n) {
|
|
1968
1968
|
e(n).forEach((o) => {
|
|
1969
1969
|
t.getCtxs(o).forEach((a) => {
|
|
1970
|
-
t.$render.clearCache(a), a.rule.value =
|
|
1970
|
+
t.$render.clearCache(a), a.rule.value = X(a.defaultValue);
|
|
1971
1971
|
});
|
|
1972
1972
|
}), t.vm.$nextTick(() => {
|
|
1973
1973
|
s.clearValidateState();
|
|
1974
|
-
}), n == null && (
|
|
1974
|
+
}), n == null && (f.Function(t.options.onReset) && R(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
1975
1975
|
},
|
|
1976
1976
|
method(n, o) {
|
|
1977
1977
|
const a = s.el(n);
|
|
1978
1978
|
if (!a || !a[o])
|
|
1979
|
-
throw new Error(
|
|
1979
|
+
throw new Error(pe("err", `${o}方法不存在`));
|
|
1980
1980
|
return (...u) => a[o](...u);
|
|
1981
1981
|
},
|
|
1982
1982
|
exec(n, o, ...a) {
|
|
1983
1983
|
return R(() => s.method(n, o)(...a));
|
|
1984
1984
|
},
|
|
1985
1985
|
toJson(n) {
|
|
1986
|
-
return
|
|
1986
|
+
return Qe(s.rule, n);
|
|
1987
1987
|
},
|
|
1988
1988
|
trigger(n, o, ...a) {
|
|
1989
1989
|
const u = s.el(n);
|
|
@@ -2015,7 +2015,7 @@ function sr(t) {
|
|
|
2015
2015
|
},
|
|
2016
2016
|
fetch(n) {
|
|
2017
2017
|
return new Promise((o, a) => {
|
|
2018
|
-
t.beforeFetch(n).then(() =>
|
|
2018
|
+
t.beforeFetch(n).then(() => ir(n).then(o).catch(a));
|
|
2019
2019
|
});
|
|
2020
2020
|
},
|
|
2021
2021
|
getData(n, o) {
|
|
@@ -2035,7 +2035,7 @@ function sr(t) {
|
|
|
2035
2035
|
};
|
|
2036
2036
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2037
2037
|
}
|
|
2038
|
-
function
|
|
2038
|
+
function sr(t) {
|
|
2039
2039
|
p(t.prototype, {
|
|
2040
2040
|
initCache() {
|
|
2041
2041
|
this.clearCacheAll();
|
|
@@ -2073,30 +2073,30 @@ function I(t) {
|
|
|
2073
2073
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2074
2074
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2075
2075
|
});
|
|
2076
|
-
return
|
|
2076
|
+
return st(e);
|
|
2077
2077
|
}
|
|
2078
|
-
function
|
|
2078
|
+
function st(t) {
|
|
2079
2079
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2080
2080
|
}
|
|
2081
|
-
function
|
|
2081
|
+
function ot(t) {
|
|
2082
2082
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
2083
2083
|
}
|
|
2084
|
-
function
|
|
2084
|
+
function Q(t) {
|
|
2085
2085
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
2086
2086
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
2087
2087
|
}
|
|
2088
|
-
let
|
|
2089
|
-
function
|
|
2090
|
-
const t = 370 + ++
|
|
2088
|
+
let or = 0;
|
|
2089
|
+
function ee() {
|
|
2090
|
+
const t = 370 + ++or;
|
|
2091
2091
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
2092
2092
|
}
|
|
2093
|
-
function
|
|
2093
|
+
function Z(t, e, r) {
|
|
2094
2094
|
let i = t, s;
|
|
2095
2095
|
return (e || "").split(".").forEach((n) => {
|
|
2096
2096
|
s && ((!i[s] || typeof i[s] != "object") && (i[s] = {}), i = i[s]), s = n;
|
|
2097
2097
|
}), i[s] = r, i;
|
|
2098
2098
|
}
|
|
2099
|
-
function
|
|
2099
|
+
function ar(t) {
|
|
2100
2100
|
p(t.prototype, {
|
|
2101
2101
|
initRender() {
|
|
2102
2102
|
this.tempList = {}, this.clearOrgChildren();
|
|
@@ -2106,7 +2106,7 @@ function lr(t) {
|
|
|
2106
2106
|
this.orgChildren = Object.keys(e).reduce((r, i) => {
|
|
2107
2107
|
if (e[i].parser.loadChildren !== !1) {
|
|
2108
2108
|
const s = e[i].rule.children;
|
|
2109
|
-
r[i] =
|
|
2109
|
+
r[i] = f.trueArray(s) ? [...s] : [];
|
|
2110
2110
|
}
|
|
2111
2111
|
return r;
|
|
2112
2112
|
}, {});
|
|
@@ -2118,7 +2118,7 @@ function lr(t) {
|
|
|
2118
2118
|
const r = (i) => {
|
|
2119
2119
|
if (i) {
|
|
2120
2120
|
let s;
|
|
2121
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2121
|
+
return e.rule.field && (s = i.$scopedSlots["field-" + Q(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + Q(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2122
2122
|
}
|
|
2123
2123
|
};
|
|
2124
2124
|
return r(this.vm);
|
|
@@ -2137,7 +2137,7 @@ function lr(t) {
|
|
|
2137
2137
|
makeVm(e) {
|
|
2138
2138
|
const r = e.vm;
|
|
2139
2139
|
if (r) {
|
|
2140
|
-
if (
|
|
2140
|
+
if (f.Function(r))
|
|
2141
2141
|
return R(() => e.vm(this.$handle.getInjectData(e)));
|
|
2142
2142
|
if (!r._isVue)
|
|
2143
2143
|
return new T(r);
|
|
@@ -2149,12 +2149,12 @@ function lr(t) {
|
|
|
2149
2149
|
r && (e.cacheConfig || (e.cacheConfig = r[e.originType] || r[e.type] || r[e.trueType] || {}), e.prop = U({}, [r["*"], e.cacheConfig, e.prop]));
|
|
2150
2150
|
},
|
|
2151
2151
|
setOptions(e) {
|
|
2152
|
-
e.prop.optionsTo && e.prop.options &&
|
|
2152
|
+
e.prop.optionsTo && e.prop.options && Z(e.prop, e.prop.optionsTo, e.prop.options);
|
|
2153
2153
|
},
|
|
2154
2154
|
deepSet(e) {
|
|
2155
2155
|
const r = e.rule.deep;
|
|
2156
2156
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2157
|
-
|
|
2157
|
+
Z(e.prop, i, r[i]);
|
|
2158
2158
|
});
|
|
2159
2159
|
},
|
|
2160
2160
|
setTempProps(e, r) {
|
|
@@ -2168,7 +2168,7 @@ function lr(t) {
|
|
|
2168
2168
|
},
|
|
2169
2169
|
renderTemp(e) {
|
|
2170
2170
|
if (!T.compile)
|
|
2171
|
-
return
|
|
2171
|
+
return zt("当前使用的Vue构建版本不支持compile,无法使用template功能"), [];
|
|
2172
2172
|
const r = e.prop, { id: i, key: s } = e;
|
|
2173
2173
|
if (!this.tempList[i]) {
|
|
2174
2174
|
e.el || (e.el = this.makeVm(r), this.vm.$nextTick(() => e.parser.mounted(e)));
|
|
@@ -2183,10 +2183,10 @@ function lr(t) {
|
|
|
2183
2183
|
const { vm: n, template: o } = this.tempList[i];
|
|
2184
2184
|
this.setTempProps(n, e);
|
|
2185
2185
|
const a = o.render.call(n);
|
|
2186
|
-
return
|
|
2186
|
+
return f.Undef(a.data) && (a.data = {}), a.key = s, a.data.ref = e.ref, a.data.key = s, a;
|
|
2187
2187
|
},
|
|
2188
2188
|
parseSide(e, r) {
|
|
2189
|
-
return
|
|
2189
|
+
return f.Object(e) ? U({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2190
2190
|
},
|
|
2191
2191
|
renderSides(e, r, i) {
|
|
2192
2192
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2204,7 +2204,7 @@ function lr(t) {
|
|
|
2204
2204
|
const i = e.rule;
|
|
2205
2205
|
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2206
2206
|
let s, n = i.cache !== !1;
|
|
2207
|
-
const o = e.trueType, a = !(
|
|
2207
|
+
const o = e.trueType, a = !(f.Undef(i.display) || i.display);
|
|
2208
2208
|
if (o === "template" && !i.template)
|
|
2209
2209
|
s = this.renderSides(this.renderChildren(e), e, !0), a && this.display(s), s = this.item(e, s);
|
|
2210
2210
|
else if (o === "fcFragment")
|
|
@@ -2221,19 +2221,19 @@ function lr(t) {
|
|
|
2221
2221
|
if (o === "template" && u.template)
|
|
2222
2222
|
s = this.renderTemp(e), n = !1;
|
|
2223
2223
|
else {
|
|
2224
|
-
let
|
|
2225
|
-
e.parser.renderChildren ?
|
|
2224
|
+
let c = [];
|
|
2225
|
+
e.parser.renderChildren ? c = e.parser.renderChildren(e) : e.parser.loadChildren !== !1 && (c = this.renderChildren(e));
|
|
2226
2226
|
const m = this.getTypeSlot(e);
|
|
2227
2227
|
m ? s = m({
|
|
2228
2228
|
rule: i,
|
|
2229
2229
|
prop: u,
|
|
2230
2230
|
preview: l,
|
|
2231
|
-
children:
|
|
2231
|
+
children: c,
|
|
2232
2232
|
api: this.$handle.api,
|
|
2233
2233
|
model: u.model || {}
|
|
2234
|
-
}) : s = l ? e.parser.preview(
|
|
2234
|
+
}) : s = l ? e.parser.preview(c, e) : e.parser.render(c, e);
|
|
2235
2235
|
}
|
|
2236
|
-
s = this.renderSides(s, e), !(!e.input &&
|
|
2236
|
+
s = this.renderSides(s, e), !(!e.input && f.Undef(u.native)) && u.native !== !0 && (s = this.$manager.makeWrap(e, s)), a && (s = this.display(s)), s = this.item(e, s);
|
|
2237
2237
|
}
|
|
2238
2238
|
return n && this.setCache(e, s, r), s;
|
|
2239
2239
|
}
|
|
@@ -2251,7 +2251,7 @@ function lr(t) {
|
|
|
2251
2251
|
},
|
|
2252
2252
|
none(e) {
|
|
2253
2253
|
if (e && e.data)
|
|
2254
|
-
return Array.isArray(e.data.style) ? e.data.style.push({ display: "none" }) :
|
|
2254
|
+
return Array.isArray(e.data.style) ? e.data.style.push({ display: "none" }) : f.String(e.data.style) ? e.data.style += ";display:none;" : e.data.style = [e.data.style, { display: "none" }], e;
|
|
2255
2255
|
},
|
|
2256
2256
|
item(e, r) {
|
|
2257
2257
|
return this.$h("fcFragment", {
|
|
@@ -2323,8 +2323,8 @@ function lr(t) {
|
|
|
2323
2323
|
this.$handle.onInput(e, r);
|
|
2324
2324
|
},
|
|
2325
2325
|
renderChildren(e) {
|
|
2326
|
-
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !
|
|
2327
|
-
return !
|
|
2326
|
+
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !f.String(n) && n.__fc__ && !this.$handle.ctxs[n.__fc__.id];
|
|
2327
|
+
return !f.trueArray(r) && i ? (this.$handle.deferSyncValue(() => {
|
|
2328
2328
|
i.forEach((n) => {
|
|
2329
2329
|
n && s(n) && this.$handle.rmCtx(n.__fc__);
|
|
2330
2330
|
});
|
|
@@ -2334,7 +2334,7 @@ function lr(t) {
|
|
|
2334
2334
|
});
|
|
2335
2335
|
}), r.map((n) => {
|
|
2336
2336
|
if (n) {
|
|
2337
|
-
if (
|
|
2337
|
+
if (f.String(n)) return n;
|
|
2338
2338
|
if (n.__fc__)
|
|
2339
2339
|
return this.renderCtx(n.__fc__, e);
|
|
2340
2340
|
n.type && this.vm.$nextTick(() => {
|
|
@@ -2345,11 +2345,11 @@ function lr(t) {
|
|
|
2345
2345
|
},
|
|
2346
2346
|
defaultRender(e, r) {
|
|
2347
2347
|
const i = e.prop;
|
|
2348
|
-
return i.component ? this.vNode.makeComponent(i.component, i, r) : this.vNode[e.type] ? this.vNode[e.type](i, r) : this.vNode[e.originType] ? this.vNode[e.originType](i, r) : this.vNode.make(
|
|
2348
|
+
return i.component ? this.vNode.makeComponent(i.component, i, r) : this.vNode[e.type] ? this.vNode[e.type](i, r) : this.vNode[e.originType] ? this.vNode[e.originType](i, r) : this.vNode.make(st(e.originType), i, r);
|
|
2349
2349
|
},
|
|
2350
2350
|
renderRule(e, r, i) {
|
|
2351
2351
|
if (!e) return;
|
|
2352
|
-
if (
|
|
2352
|
+
if (f.String(e)) return e;
|
|
2353
2353
|
let s;
|
|
2354
2354
|
if (i)
|
|
2355
2355
|
s = e.type;
|
|
@@ -2360,18 +2360,18 @@ function lr(t) {
|
|
|
2360
2360
|
}
|
|
2361
2361
|
if (!s) return;
|
|
2362
2362
|
let n = [[r]];
|
|
2363
|
-
return
|
|
2363
|
+
return f.trueArray(e.children) && n.push(e.children.map((o) => this.renderRule(o))), this.$h(s, y({}, e), n);
|
|
2364
2364
|
}
|
|
2365
2365
|
});
|
|
2366
2366
|
}
|
|
2367
|
-
function
|
|
2367
|
+
function $e(t) {
|
|
2368
2368
|
p(this, {
|
|
2369
2369
|
$handle: t,
|
|
2370
2370
|
fc: t.fc,
|
|
2371
2371
|
vm: t.vm,
|
|
2372
2372
|
$manager: t.$manager,
|
|
2373
2373
|
vNode: new t.fc.CreateNode(t.vm)
|
|
2374
|
-
}),
|
|
2374
|
+
}), et(this, {
|
|
2375
2375
|
options() {
|
|
2376
2376
|
return t.options;
|
|
2377
2377
|
},
|
|
@@ -2380,9 +2380,9 @@ function ve(t) {
|
|
|
2380
2380
|
}
|
|
2381
2381
|
}), this.initCache(), this.initRender();
|
|
2382
2382
|
}
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
function
|
|
2383
|
+
sr($e);
|
|
2384
|
+
ar($e);
|
|
2385
|
+
function lr(t) {
|
|
2386
2386
|
p(t.prototype, {
|
|
2387
2387
|
parseInjectEvent(e, r) {
|
|
2388
2388
|
const i = e.inject || this.options.injectEvent;
|
|
@@ -2395,11 +2395,11 @@ function ur(t) {
|
|
|
2395
2395
|
}), r;
|
|
2396
2396
|
},
|
|
2397
2397
|
parseEvent(e, r, i, s) {
|
|
2398
|
-
if (
|
|
2398
|
+
if (f.Function(r) && (i !== !1 && !f.Undef(i) || r.__inject))
|
|
2399
2399
|
return this.inject(e, r, i);
|
|
2400
|
-
if (!s && Array.isArray(r) && r[0] && (
|
|
2400
|
+
if (!s && Array.isArray(r) && r[0] && (f.String(r[0]) || f.Function(r[0])))
|
|
2401
2401
|
return this.parseEventLst(e, r, i, !0);
|
|
2402
|
-
if (
|
|
2402
|
+
if (f.String(r)) {
|
|
2403
2403
|
const n = q(r);
|
|
2404
2404
|
if (n && r !== n)
|
|
2405
2405
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
@@ -2407,19 +2407,19 @@ function ur(t) {
|
|
|
2407
2407
|
},
|
|
2408
2408
|
parseEmit(e, r) {
|
|
2409
2409
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: u } = s, l = s[r ? "emit" : "nativeEmit"] || [];
|
|
2410
|
-
return
|
|
2411
|
-
if (!
|
|
2410
|
+
return f.trueArray(l) && l.forEach((c) => {
|
|
2411
|
+
if (!c) return;
|
|
2412
2412
|
let m, v = n || o || a;
|
|
2413
|
-
if (
|
|
2413
|
+
if (f.Object(c) && (m = c.inject, c = c.name, v = c.prefix || v), v) {
|
|
2414
2414
|
r || (v = `native-${v}`);
|
|
2415
|
-
const _ =
|
|
2415
|
+
const _ = Q(`${v}-${c}`), g = (...k) => {
|
|
2416
2416
|
this.vm.$emit(_, ...k), this.vm.$emit("emit-event", _, ...k);
|
|
2417
2417
|
};
|
|
2418
2418
|
if (g.__emit = !0, !m && u === !1)
|
|
2419
|
-
i[
|
|
2419
|
+
i[c] = g;
|
|
2420
2420
|
else {
|
|
2421
2421
|
let k = m || u || this.options.injectEvent;
|
|
2422
|
-
i[
|
|
2422
|
+
i[c] = f.Undef(k) ? g : this.inject(s, g, k);
|
|
2423
2423
|
}
|
|
2424
2424
|
}
|
|
2425
2425
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2449,14 +2449,14 @@ function ur(t) {
|
|
|
2449
2449
|
}
|
|
2450
2450
|
});
|
|
2451
2451
|
}
|
|
2452
|
-
const
|
|
2453
|
-
function
|
|
2452
|
+
const De = ["hook:updated", "hook:mounted"];
|
|
2453
|
+
function ur(t) {
|
|
2454
2454
|
p(t.prototype, {
|
|
2455
2455
|
usePage() {
|
|
2456
2456
|
const e = this.options.page;
|
|
2457
2457
|
if (!e) return;
|
|
2458
|
-
let r = 25, i =
|
|
2459
|
-
|
|
2458
|
+
let r = 25, i = hr(this.rules);
|
|
2459
|
+
f.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), p(this, {
|
|
2460
2460
|
first: r,
|
|
2461
2461
|
limit: i,
|
|
2462
2462
|
pageEnd: this.rules.length <= r
|
|
@@ -2464,13 +2464,13 @@ function hr(t) {
|
|
|
2464
2464
|
},
|
|
2465
2465
|
pageLoad() {
|
|
2466
2466
|
const e = () => {
|
|
2467
|
-
this.pageEnd ? (this.vm.$off(
|
|
2467
|
+
this.pageEnd ? (this.vm.$off(De, e), this.bus.$emit("page-end")) : (this.first += this.limit, this.pageEnd = this.rules.length <= this.first, this.loadRule(), this.refresh());
|
|
2468
2468
|
};
|
|
2469
|
-
this.vm.$on(
|
|
2469
|
+
this.vm.$on(De, e);
|
|
2470
2470
|
}
|
|
2471
2471
|
});
|
|
2472
2472
|
}
|
|
2473
|
-
function
|
|
2473
|
+
function hr(t) {
|
|
2474
2474
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2475
2475
|
}
|
|
2476
2476
|
function fr(t) {
|
|
@@ -2488,13 +2488,13 @@ function fr(t) {
|
|
|
2488
2488
|
}
|
|
2489
2489
|
});
|
|
2490
2490
|
}
|
|
2491
|
-
function
|
|
2491
|
+
function cr(t) {
|
|
2492
2492
|
Object.defineProperties(t.origin, {
|
|
2493
|
-
__fc__:
|
|
2493
|
+
__fc__: Ze(t, !0)
|
|
2494
2494
|
});
|
|
2495
2495
|
}
|
|
2496
|
-
function
|
|
2497
|
-
const i =
|
|
2496
|
+
function at(t, e, r) {
|
|
2497
|
+
const i = ee();
|
|
2498
2498
|
p(this, {
|
|
2499
2499
|
id: i,
|
|
2500
2500
|
ref: i,
|
|
@@ -2516,9 +2516,9 @@ function lt(t, e, r) {
|
|
|
2516
2516
|
exportEl: void 0,
|
|
2517
2517
|
defaultValue: e.field ? L(r) : void 0,
|
|
2518
2518
|
field: e.field || void 0
|
|
2519
|
-
}), this.updateKey(),
|
|
2519
|
+
}), this.updateKey(), cr(this), this.update(t, !0);
|
|
2520
2520
|
}
|
|
2521
|
-
p(
|
|
2521
|
+
p(at.prototype, {
|
|
2522
2522
|
effectData(t) {
|
|
2523
2523
|
return this.payload[t] || (this.payload[t] = {}), this.payload[t];
|
|
2524
2524
|
},
|
|
@@ -2526,7 +2526,7 @@ p(lt.prototype, {
|
|
|
2526
2526
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2527
2527
|
},
|
|
2528
2528
|
updateKey(t) {
|
|
2529
|
-
this.key =
|
|
2529
|
+
this.key = ee(), t && this.parent && this.parent.updateKey(t);
|
|
2530
2530
|
},
|
|
2531
2531
|
updateType() {
|
|
2532
2532
|
this.originType = this.rule.type, this.type = I(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
@@ -2540,7 +2540,7 @@ p(lt.prototype, {
|
|
|
2540
2540
|
},
|
|
2541
2541
|
injectValidate() {
|
|
2542
2542
|
return j(this.prop.validate).map((t) => {
|
|
2543
|
-
if (
|
|
2543
|
+
if (f.Function(t.validator)) {
|
|
2544
2544
|
const e = y({}, t), r = this;
|
|
2545
2545
|
return e.validator = function(...i) {
|
|
2546
2546
|
return t.validator.call({
|
|
@@ -2618,7 +2618,7 @@ p(lt.prototype, {
|
|
|
2618
2618
|
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2619
2619
|
}
|
|
2620
2620
|
});
|
|
2621
|
-
function
|
|
2621
|
+
function dr(t) {
|
|
2622
2622
|
p(t.prototype, {
|
|
2623
2623
|
nextRefresh(e) {
|
|
2624
2624
|
const r = this.loadedId;
|
|
@@ -2627,10 +2627,10 @@ function pr(t) {
|
|
|
2627
2627
|
});
|
|
2628
2628
|
},
|
|
2629
2629
|
parseRule(e) {
|
|
2630
|
-
const r =
|
|
2630
|
+
const r = Ae(e);
|
|
2631
2631
|
return Object.defineProperties(r, {
|
|
2632
|
-
__origin__:
|
|
2633
|
-
}),
|
|
2632
|
+
__origin__: Ze(e, !0)
|
|
2633
|
+
}), pr(r), this.appendValue(r), r.options = Array.isArray(r.options) ? r.options : [], [r, r.prefix, r.suffix].forEach((i) => {
|
|
2634
2634
|
i && this.loadFn(i, r);
|
|
2635
2635
|
}), this.loadCtrl(r), r.update && (r.update = q(r.update)), r;
|
|
2636
2636
|
},
|
|
@@ -2646,7 +2646,7 @@ function pr(t) {
|
|
|
2646
2646
|
},
|
|
2647
2647
|
syncProp(e) {
|
|
2648
2648
|
const r = e.rule;
|
|
2649
|
-
|
|
2649
|
+
f.trueArray(r.sync) && D([{
|
|
2650
2650
|
on: r.sync.reduce((i, s) => (i[`update:${s}`] = (n) => {
|
|
2651
2651
|
r.props[s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
2652
2652
|
}, i), {})
|
|
@@ -2672,43 +2672,43 @@ function pr(t) {
|
|
|
2672
2672
|
let a = this.sort.indexOf(o.__fc__.id);
|
|
2673
2673
|
return a > -1 ? a : i(n - 1);
|
|
2674
2674
|
}, s = (n, o) => {
|
|
2675
|
-
|
|
2675
|
+
f.trueArray(n) && this._loadRule(n, o);
|
|
2676
2676
|
};
|
|
2677
2677
|
e.map((n, o) => {
|
|
2678
|
-
if (r && !
|
|
2678
|
+
if (r && !f.Object(n) || !this.pageEnd && !r && o >= this.first) return;
|
|
2679
2679
|
if (n.__fc__ && n.__fc__.root === e && this.ctxs[n.__fc__.id])
|
|
2680
2680
|
return s(n.__fc__.rule.children, n.__fc__), n.__fc__;
|
|
2681
|
-
let a =
|
|
2681
|
+
let a = Ae(n);
|
|
2682
2682
|
const u = () => !!(a.field && this.fieldCtx[a.field] && this.fieldCtx[a.field][0] !== n.__fc__);
|
|
2683
2683
|
this.ruleEffect(a, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", n, this.api);
|
|
2684
|
-
let l,
|
|
2684
|
+
let l, c = !1, m = !!n.__fc__, v = a.value;
|
|
2685
2685
|
if (m) {
|
|
2686
2686
|
l = n.__fc__, v = l.defaultValue;
|
|
2687
2687
|
const g = !l.check(this);
|
|
2688
2688
|
if (l.deleted) {
|
|
2689
2689
|
if (g) {
|
|
2690
|
-
if (
|
|
2690
|
+
if (Be(l))
|
|
2691
2691
|
return;
|
|
2692
2692
|
l.update(this);
|
|
2693
2693
|
}
|
|
2694
2694
|
} else if (g) {
|
|
2695
|
-
if (
|
|
2695
|
+
if (Be(l))
|
|
2696
2696
|
return;
|
|
2697
|
-
e[o] = n = n._clone ? n._clone() :
|
|
2697
|
+
e[o] = n = n._clone ? n._clone() : ye(n), l = null, c = !0;
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
2700
2700
|
if (l)
|
|
2701
2701
|
l.originType !== l.rule.type && l.updateType(), this.bindParser(l), this.appendValue(l.rule);
|
|
2702
2702
|
else {
|
|
2703
2703
|
const g = this.parseRule(n);
|
|
2704
|
-
l = new
|
|
2704
|
+
l = new at(this, g, v), this.bindParser(l);
|
|
2705
2705
|
}
|
|
2706
|
-
if ([!1, !0].forEach((g) => this.parseEmit(l, g)), this.syncProp(l), l.parent = r || null, l.root = e, this.setCtx(l), !
|
|
2706
|
+
if ([!1, !0].forEach((g) => this.parseEmit(l, g)), this.syncProp(l), l.parent = r || null, l.root = e, this.setCtx(l), !c && !m && this.effect(l, "load"), this.effect(l, "created"), l.parser.loadChildren === !1 || s(l.rule.children, l), !r) {
|
|
2707
2707
|
const g = i(o);
|
|
2708
2708
|
g > -1 || !o ? this.sort.splice(g + 1, 0, l.id) : this.sort.push(l.id);
|
|
2709
2709
|
}
|
|
2710
2710
|
const _ = l.rule;
|
|
2711
|
-
return l.updated || (l.updated = !0,
|
|
2711
|
+
return l.updated || (l.updated = !0, f.Function(_.update) && this.bus.$once("load-end", () => {
|
|
2712
2712
|
this.refreshUpdate(l, _.value, "init");
|
|
2713
2713
|
}), this.effect(l, "loaded")), l.input && Object.defineProperty(_, "value", this.valueHandle(l)), this.refreshControl(l) && (this.cycleLoad = !0), l;
|
|
2714
2714
|
});
|
|
@@ -2717,25 +2717,25 @@ function pr(t) {
|
|
|
2717
2717
|
return e.input && e.rule.control && this.useCtrl(e);
|
|
2718
2718
|
},
|
|
2719
2719
|
useCtrl(e) {
|
|
2720
|
-
const r =
|
|
2720
|
+
const r = mr(e), i = [], s = this.api;
|
|
2721
2721
|
if (!r.length) return !1;
|
|
2722
2722
|
for (let a = 0; a < r.length; a++) {
|
|
2723
2723
|
const u = r[a], l = u.handle || function(m) {
|
|
2724
|
-
return (
|
|
2724
|
+
return (J[u.condition || "=="] || J["=="])(m, u.value);
|
|
2725
2725
|
};
|
|
2726
|
-
if (!
|
|
2727
|
-
const
|
|
2726
|
+
if (!f.trueArray(u.rule)) continue;
|
|
2727
|
+
const c = N(y({}, u), {
|
|
2728
2728
|
valid: R(() => l(e.rule.value, s)),
|
|
2729
|
-
ctrl:
|
|
2730
|
-
isHidden:
|
|
2729
|
+
ctrl: yr(e, u.rule),
|
|
2730
|
+
isHidden: f.String(u.rule[0])
|
|
2731
2731
|
});
|
|
2732
|
-
|
|
2732
|
+
c.valid && c.ctrl || !c.valid && !c.ctrl && !c.isHidden || i.push(c);
|
|
2733
2733
|
}
|
|
2734
2734
|
if (!i.length) return !1;
|
|
2735
2735
|
const n = [];
|
|
2736
2736
|
let o = !1;
|
|
2737
2737
|
return this.deferSyncValue(() => {
|
|
2738
|
-
i.reverse().forEach(({ isHidden: a, valid: u, rule: l, prepend:
|
|
2738
|
+
i.reverse().forEach(({ isHidden: a, valid: u, rule: l, prepend: c, append: m, child: v, ctrl: _, method: g }) => {
|
|
2739
2739
|
if (a) {
|
|
2740
2740
|
u ? e.ctrlRule.push({
|
|
2741
2741
|
__ctrl: !0,
|
|
@@ -2757,11 +2757,11 @@ function pr(t) {
|
|
|
2757
2757
|
children: l
|
|
2758
2758
|
};
|
|
2759
2759
|
e.ctrlRule.push(k), this.bus.$once("load-start", () => {
|
|
2760
|
-
|
|
2760
|
+
c ? s.prepend(k, c, v) : m || v ? s.append(k, m || e.id, v) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, k);
|
|
2761
2761
|
});
|
|
2762
2762
|
} else {
|
|
2763
2763
|
e.ctrlRule.splice(e.ctrlRule.indexOf(_), 1);
|
|
2764
|
-
const k =
|
|
2764
|
+
const k = z(_);
|
|
2765
2765
|
k && k.rm();
|
|
2766
2766
|
}
|
|
2767
2767
|
});
|
|
@@ -2779,7 +2779,7 @@ function pr(t) {
|
|
|
2779
2779
|
this.bus.$once("load-end", () => {
|
|
2780
2780
|
Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
|
|
2781
2781
|
}), this.reloading = !0, this.loadRule(), this.reloading = !1, this.refresh(), this.vm.$emit("reloading", this.api);
|
|
2782
|
-
}), this.
|
|
2782
|
+
}), this.vm.$emit("update", this.api);
|
|
2783
2783
|
},
|
|
2784
2784
|
//todo 组件生成全部通过 alias
|
|
2785
2785
|
refresh() {
|
|
@@ -2787,30 +2787,30 @@ function pr(t) {
|
|
|
2787
2787
|
}
|
|
2788
2788
|
});
|
|
2789
2789
|
}
|
|
2790
|
-
function
|
|
2791
|
-
const e =
|
|
2790
|
+
function pr(t) {
|
|
2791
|
+
const e = tt();
|
|
2792
2792
|
return Object.keys(e).forEach((r) => {
|
|
2793
2793
|
O(t, r) || w(t, r, e[r]);
|
|
2794
2794
|
}), t;
|
|
2795
2795
|
}
|
|
2796
|
-
function
|
|
2796
|
+
function mr(t) {
|
|
2797
2797
|
const e = t.rule.control || [];
|
|
2798
|
-
return
|
|
2798
|
+
return f.Object(e) ? [e] : e;
|
|
2799
2799
|
}
|
|
2800
|
-
function
|
|
2800
|
+
function yr(t, e) {
|
|
2801
2801
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
2802
2802
|
const i = t.ctrlRule[r];
|
|
2803
2803
|
if (i.children === e)
|
|
2804
2804
|
return i;
|
|
2805
2805
|
}
|
|
2806
2806
|
}
|
|
2807
|
-
function
|
|
2807
|
+
function Be(t) {
|
|
2808
2808
|
return !!t.rule.__ctrl;
|
|
2809
2809
|
}
|
|
2810
|
-
function
|
|
2810
|
+
function gr(t) {
|
|
2811
2811
|
p(t.prototype, {
|
|
2812
2812
|
getValue(e) {
|
|
2813
|
-
return
|
|
2813
|
+
return f.Undef(e.cacheValue) && (e.cacheValue = e.parser.toValue(this.getFormData(e), e)), e.cacheValue;
|
|
2814
2814
|
},
|
|
2815
2815
|
setValue(e, r, i, s) {
|
|
2816
2816
|
e.deleted || (e.cacheValue = r, this.changeStatus = !0, this.nextRefresh(), this.$render.clearCache(e), this.setFormData(e, i), this.syncValue(), this.valueChange(e, r), this.vm.$emit("change", e.field, r, e.origin, this.api, s || !1), this.effect(e, "value"), this.emitEvent("change", e.field, r, {
|
|
@@ -2873,13 +2873,13 @@ function $r(t) {
|
|
|
2873
2873
|
this.vm._updateValue(y(y({}, this.options.appendValue !== !1 ? this.appendData : {}), this.form));
|
|
2874
2874
|
},
|
|
2875
2875
|
isChange(e, r) {
|
|
2876
|
-
return JSON.stringify(e.rule.value,
|
|
2876
|
+
return JSON.stringify(e.rule.value, Le) !== JSON.stringify(r === null ? void 0 : r, Le);
|
|
2877
2877
|
},
|
|
2878
2878
|
isQuote(e, r) {
|
|
2879
|
-
return (
|
|
2879
|
+
return (f.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
2880
2880
|
},
|
|
2881
2881
|
refreshUpdate(e, r, i, s) {
|
|
2882
|
-
if (
|
|
2882
|
+
if (f.Function(e.rule.update)) {
|
|
2883
2883
|
const n = R(() => e.rule.update(r, e.origin, this.api, {
|
|
2884
2884
|
origin: i || "change",
|
|
2885
2885
|
linkField: s
|
|
@@ -2896,7 +2896,7 @@ function $r(t) {
|
|
|
2896
2896
|
},
|
|
2897
2897
|
appendLink(e) {
|
|
2898
2898
|
const r = e.rule.link;
|
|
2899
|
-
|
|
2899
|
+
f.trueArray(r) && r.forEach((i) => {
|
|
2900
2900
|
const s = () => this.refreshRule(e, e.rule.value, "link", i);
|
|
2901
2901
|
this.bus.$on("change-" + i, s), e.linkOn.push(() => this.bus.$off("change-" + i, s));
|
|
2902
2902
|
});
|
|
@@ -2906,13 +2906,13 @@ function $r(t) {
|
|
|
2906
2906
|
}
|
|
2907
2907
|
});
|
|
2908
2908
|
}
|
|
2909
|
-
function
|
|
2909
|
+
function Le(t, e) {
|
|
2910
2910
|
return typeof e == "function" ? "" + e : e;
|
|
2911
2911
|
}
|
|
2912
2912
|
function Me(t) {
|
|
2913
2913
|
Object.keys(t).forEach((e) => delete t[e]);
|
|
2914
2914
|
}
|
|
2915
|
-
const
|
|
2915
|
+
const he = {
|
|
2916
2916
|
init(t) {
|
|
2917
2917
|
},
|
|
2918
2918
|
toFormValue(t, e) {
|
|
@@ -2931,8 +2931,8 @@ const ce = {
|
|
|
2931
2931
|
},
|
|
2932
2932
|
mergeProp(t) {
|
|
2933
2933
|
}
|
|
2934
|
-
},
|
|
2935
|
-
function
|
|
2934
|
+
}, $r = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "component", "cache"];
|
|
2935
|
+
function vr(t) {
|
|
2936
2936
|
p(t.prototype, {
|
|
2937
2937
|
getCtx(e) {
|
|
2938
2938
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
@@ -2962,7 +2962,7 @@ function br(t) {
|
|
|
2962
2962
|
},
|
|
2963
2963
|
getParser(e) {
|
|
2964
2964
|
const r = this.fc.parsers;
|
|
2965
|
-
return r[e.originType] || r[I(e.type)] || r[e.trueType] ||
|
|
2965
|
+
return r[e.originType] || r[I(e.type)] || r[e.trueType] || he;
|
|
2966
2966
|
},
|
|
2967
2967
|
bindParser(e) {
|
|
2968
2968
|
e.setParser(this.getParser(e));
|
|
@@ -2976,7 +2976,7 @@ function br(t) {
|
|
|
2976
2976
|
},
|
|
2977
2977
|
watchCtx(e) {
|
|
2978
2978
|
const r = this.vm;
|
|
2979
|
-
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" &&
|
|
2979
|
+
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" && $r.indexOf(i) === -1).forEach((i) => {
|
|
2980
2980
|
const s = i === "children";
|
|
2981
2981
|
e.watch.push(r.$watch(() => e.rule[i], (n, o) => {
|
|
2982
2982
|
if (!(this.loading || this.noWatchFn || this.reloading)) {
|
|
@@ -2996,7 +2996,7 @@ function br(t) {
|
|
|
2996
2996
|
else if (i === "type")
|
|
2997
2997
|
e.updateType(), this.bindParser(e);
|
|
2998
2998
|
else if (i === "children") {
|
|
2999
|
-
const a =
|
|
2999
|
+
const a = f.trueArray(n);
|
|
3000
3000
|
this.deferSyncValue(() => {
|
|
3001
3001
|
n !== o && (this.rmSub(o, e), this.$render.initOrgChildren()), a && this.loadChildren(n, e), this.vm.$emit("update", this.api);
|
|
3002
3002
|
});
|
|
@@ -3007,7 +3007,7 @@ function br(t) {
|
|
|
3007
3007
|
}), this.watchEffect(e);
|
|
3008
3008
|
},
|
|
3009
3009
|
rmSub(e, r) {
|
|
3010
|
-
|
|
3010
|
+
f.trueArray(e) && e.forEach((i) => {
|
|
3011
3011
|
i && i.__fc__ && i.__fc__.parent === r && this.rmCtx(i.__fc__);
|
|
3012
3012
|
});
|
|
3013
3013
|
},
|
|
@@ -3018,14 +3018,14 @@ function br(t) {
|
|
|
3018
3018
|
value: e.rule.value,
|
|
3019
3019
|
writable: !0
|
|
3020
3020
|
}), B(this.ctxs, r), B(this.$render.tempList, r), B(this.$render.orgChildren, r), B(this.vm.ctxInject, r), B(this.formData, r), B(this.subForm, r), B(e, "cacheValue"), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !O(this.fieldCtx, i) && B(this.form, i), this.deferSyncValue(() => {
|
|
3021
|
-
this.reloading || (e.parser.loadChildren !== !1 &&
|
|
3021
|
+
this.reloading || (e.parser.loadChildren !== !1 && f.trueArray(e.rule.children) && e.rule.children.forEach((a) => a.__fc__ && this.rmCtx(a.__fc__)), e.root === this.rules && this.vm._renderRule());
|
|
3022
3022
|
}, s);
|
|
3023
3023
|
const o = this.sort.indexOf(r);
|
|
3024
3024
|
return o > -1 && this.sort.splice(o, 1), this.$render.clearCache(e), e.delete(), this.effect(e, "deleted"), s && !this.fieldCtx[i] && this.vm.$emit("removeField", i, e.rule, this.api), e.rule.__ctrl || this.vm.$emit("removeRule", e.rule, this.api), e;
|
|
3025
3025
|
}
|
|
3026
3026
|
});
|
|
3027
3027
|
}
|
|
3028
|
-
function
|
|
3028
|
+
function br(t) {
|
|
3029
3029
|
p(t.prototype, {
|
|
3030
3030
|
mounted() {
|
|
3031
3031
|
const e = () => {
|
|
@@ -3036,23 +3036,26 @@ function Cr(t) {
|
|
|
3036
3036
|
lifecycle(e) {
|
|
3037
3037
|
this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3038
3038
|
},
|
|
3039
|
+
targetReload() {
|
|
3040
|
+
this.bus.$off("next-tick", this.nextReload), this.bus.$once("next-tick", this.nextReload);
|
|
3041
|
+
},
|
|
3039
3042
|
emitEvent(e, ...r) {
|
|
3040
3043
|
const i = this.options[e] || this.options[I("on-" + e)];
|
|
3041
3044
|
if (i) {
|
|
3042
3045
|
const s = q(i);
|
|
3043
|
-
|
|
3046
|
+
f.Function(s) && R(() => s(...r));
|
|
3044
3047
|
}
|
|
3045
3048
|
this.bus.$emit(e, ...r);
|
|
3046
3049
|
}
|
|
3047
3050
|
});
|
|
3048
3051
|
}
|
|
3049
|
-
function
|
|
3052
|
+
function Cr(t) {
|
|
3050
3053
|
p(t.prototype, {
|
|
3051
3054
|
useProvider() {
|
|
3052
3055
|
const e = this.fc.providers;
|
|
3053
3056
|
Object.keys(e).forEach((r) => {
|
|
3054
3057
|
let i = e[r];
|
|
3055
|
-
|
|
3058
|
+
f.Function(i) && (i = i(this.fc)), i._c = kr(i), this.onEffect(i), this.providers[r] = i;
|
|
3056
3059
|
});
|
|
3057
3060
|
},
|
|
3058
3061
|
onEffect(e) {
|
|
@@ -3106,34 +3109,34 @@ function _r(t) {
|
|
|
3106
3109
|
},
|
|
3107
3110
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3108
3111
|
if (!s || s === "fcFragment") return;
|
|
3109
|
-
const u = n || Object.keys(r).reduce((l,
|
|
3112
|
+
const u = n || Object.keys(r).reduce((l, c) => (c[0] === "$" && (l[c.substr(1)] = r[c]), l), y({}, r.effect || {}));
|
|
3110
3113
|
Object.keys(u).forEach((l) => {
|
|
3111
|
-
const
|
|
3112
|
-
if (!
|
|
3114
|
+
const c = this.providers[l];
|
|
3115
|
+
if (!c || c.input && !i) return;
|
|
3113
3116
|
let m;
|
|
3114
|
-
if (!
|
|
3117
|
+
if (!c._c)
|
|
3115
3118
|
m = "*";
|
|
3116
|
-
else if (
|
|
3119
|
+
else if (c._used.indexOf(s) > -1)
|
|
3117
3120
|
m = s;
|
|
3118
3121
|
else
|
|
3119
3122
|
return;
|
|
3120
3123
|
const v = y({ value: u[l], getValue: () => this.getEffect(r, l) }, a || {});
|
|
3121
|
-
e && (v.getProp = () => e.effectData(l), v.clearProp = () => e.clearEffectData(l), v.mergeProp = (_) => U(v.getProp(), [_]), v.id = e.id), this.bus.$emit(`p:${l}:${m}:${
|
|
3124
|
+
e && (v.getProp = () => e.effectData(l), v.clearProp = () => e.clearEffectData(l), v.mergeProp = (_) => U(v.getProp(), [_]), v.id = e.id), this.bus.$emit(`p:${l}:${m}:${c.input ? 1 : 0}`, o, [v, r, this.api]);
|
|
3122
3125
|
});
|
|
3123
3126
|
}
|
|
3124
3127
|
});
|
|
3125
3128
|
}
|
|
3126
|
-
function
|
|
3129
|
+
function _r(t) {
|
|
3127
3130
|
return t.filter(function(e, r, i) {
|
|
3128
3131
|
return i.indexOf(e, 0) === r;
|
|
3129
3132
|
});
|
|
3130
3133
|
}
|
|
3131
|
-
function
|
|
3134
|
+
function kr(t) {
|
|
3132
3135
|
const e = t.components;
|
|
3133
3136
|
if (Array.isArray(e)) {
|
|
3134
|
-
const r =
|
|
3137
|
+
const r = _r(e.filter((i) => i !== "*"));
|
|
3135
3138
|
return r.length ? r : !1;
|
|
3136
|
-
} else return
|
|
3139
|
+
} else return f.String(e) ? [e] : !1;
|
|
3137
3140
|
}
|
|
3138
3141
|
function V(t) {
|
|
3139
3142
|
p(this, {
|
|
@@ -3158,14 +3161,14 @@ function V(t) {
|
|
|
3158
3161
|
nextReload: () => {
|
|
3159
3162
|
this.lifecycle("reload");
|
|
3160
3163
|
}
|
|
3161
|
-
}),
|
|
3164
|
+
}), et(this, {
|
|
3162
3165
|
options() {
|
|
3163
3166
|
return t.options;
|
|
3164
3167
|
},
|
|
3165
3168
|
bus() {
|
|
3166
3169
|
return t.bus;
|
|
3167
3170
|
}
|
|
3168
|
-
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new
|
|
3171
|
+
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new $e(this), this.api = t.extendApi(nr(this), this);
|
|
3169
3172
|
}
|
|
3170
3173
|
p(V.prototype, {
|
|
3171
3174
|
initData(t) {
|
|
@@ -3183,30 +3186,30 @@ p(V.prototype, {
|
|
|
3183
3186
|
beforeFetch(t) {
|
|
3184
3187
|
return new Promise((e) => {
|
|
3185
3188
|
const r = this.options.beforeFetch && R(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3186
|
-
r &&
|
|
3189
|
+
r && f.Function(r.then) ? r.then(e) : e();
|
|
3187
3190
|
});
|
|
3188
3191
|
}
|
|
3189
3192
|
});
|
|
3193
|
+
lr(V);
|
|
3190
3194
|
ur(V);
|
|
3191
|
-
hr(V);
|
|
3192
3195
|
fr(V);
|
|
3193
|
-
|
|
3194
|
-
|
|
3196
|
+
dr(V);
|
|
3197
|
+
gr(V);
|
|
3198
|
+
vr(V);
|
|
3195
3199
|
br(V);
|
|
3196
3200
|
Cr(V);
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
name: wr,
|
|
3201
|
+
const Or = "fcFragment", te = {
|
|
3202
|
+
name: Or,
|
|
3200
3203
|
functional: !0,
|
|
3201
3204
|
props: ["vnode"],
|
|
3202
3205
|
render(t, e) {
|
|
3203
3206
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3204
3207
|
}
|
|
3205
3208
|
};
|
|
3206
|
-
function
|
|
3207
|
-
return
|
|
3209
|
+
function wr(t) {
|
|
3210
|
+
return f.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3208
3211
|
}
|
|
3209
|
-
function
|
|
3212
|
+
function Fr() {
|
|
3210
3213
|
const t = {};
|
|
3211
3214
|
function e(r) {
|
|
3212
3215
|
r && this.setVm(r);
|
|
@@ -3219,7 +3222,7 @@ function Er() {
|
|
|
3219
3222
|
return T.config.isReservedTag(r) && i.nativeOn && delete i.nativeOn, this.makeComponent(r, i, s);
|
|
3220
3223
|
},
|
|
3221
3224
|
makeComponent(r, i, s) {
|
|
3222
|
-
let n = this.$h(r,
|
|
3225
|
+
let n = this.$h(r, wr(i), s || []);
|
|
3223
3226
|
return n.context = this.vm, n;
|
|
3224
3227
|
},
|
|
3225
3228
|
aliasMap: t
|
|
@@ -3230,7 +3233,7 @@ function Er() {
|
|
|
3230
3233
|
},
|
|
3231
3234
|
use(r) {
|
|
3232
3235
|
Object.keys(r).forEach((i) => {
|
|
3233
|
-
const s =
|
|
3236
|
+
const s = Q(i), n = ot(i).toLocaleLowerCase(), o = r[i];
|
|
3234
3237
|
[i, s, n].forEach((a) => {
|
|
3235
3238
|
e.alias(i, o), e.prototype[a] = function(u, l) {
|
|
3236
3239
|
return this.make(o, u, l);
|
|
@@ -3240,12 +3243,12 @@ function Er() {
|
|
|
3240
3243
|
}
|
|
3241
3244
|
}), e;
|
|
3242
3245
|
}
|
|
3243
|
-
function
|
|
3244
|
-
class e extends
|
|
3246
|
+
function Er(t) {
|
|
3247
|
+
class e extends lt {
|
|
3245
3248
|
}
|
|
3246
3249
|
return Object.assign(e.prototype, t), e;
|
|
3247
3250
|
}
|
|
3248
|
-
function
|
|
3251
|
+
function lt(t) {
|
|
3249
3252
|
p(this, {
|
|
3250
3253
|
$handle: t,
|
|
3251
3254
|
vm: t.vm,
|
|
@@ -3256,12 +3259,12 @@ function ut(t) {
|
|
|
3256
3259
|
}
|
|
3257
3260
|
}), this.updateKey(), this.init();
|
|
3258
3261
|
}
|
|
3259
|
-
p(
|
|
3262
|
+
p(lt.prototype, {
|
|
3260
3263
|
__init() {
|
|
3261
3264
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3262
3265
|
},
|
|
3263
3266
|
updateKey() {
|
|
3264
|
-
this.key =
|
|
3267
|
+
this.key = ee();
|
|
3265
3268
|
},
|
|
3266
3269
|
//TODO interface
|
|
3267
3270
|
init() {
|
|
@@ -3301,7 +3304,7 @@ p(ut.prototype, {
|
|
|
3301
3304
|
render(t) {
|
|
3302
3305
|
}
|
|
3303
3306
|
});
|
|
3304
|
-
const
|
|
3307
|
+
const Sr = function(t) {
|
|
3305
3308
|
const e = {
|
|
3306
3309
|
name: "loadData",
|
|
3307
3310
|
_fn: [],
|
|
@@ -3314,7 +3317,7 @@ const Rr = function(t) {
|
|
|
3314
3317
|
const u = () => {
|
|
3315
3318
|
a.watch !== !1 && (t.bus.$off("p.loadData." + a.attr, u), t.bus.$once("p.loadData." + a.attr, u));
|
|
3316
3319
|
let l;
|
|
3317
|
-
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l = L(l))),
|
|
3320
|
+
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l = L(l))), Z(r.getProp(), a.to || "options", l), s.sync(i);
|
|
3318
3321
|
};
|
|
3319
3322
|
o.push(() => t.bus.$off("p.loadData." + a.attr, u)), u();
|
|
3320
3323
|
}
|
|
@@ -3327,13 +3330,13 @@ const Rr = function(t) {
|
|
|
3327
3330
|
}
|
|
3328
3331
|
};
|
|
3329
3332
|
return e.watch = e.created, e;
|
|
3330
|
-
},
|
|
3333
|
+
}, ut = {
|
|
3331
3334
|
name: "componentValidate",
|
|
3332
3335
|
load(t, e, r) {
|
|
3333
3336
|
const i = t.getValue();
|
|
3334
3337
|
i ? t.getProp().validate = [{
|
|
3335
3338
|
validator(...s) {
|
|
3336
|
-
const n =
|
|
3339
|
+
const n = z(e);
|
|
3337
3340
|
if (n)
|
|
3338
3341
|
return r.exec(n.id, i === !0 ? "formCreateValidate" : i, ...s, {
|
|
3339
3342
|
attr: t,
|
|
@@ -3344,11 +3347,11 @@ const Rr = function(t) {
|
|
|
3344
3347
|
}] : (t.clearProp(), r.clearValidateState([e.field]));
|
|
3345
3348
|
},
|
|
3346
3349
|
watch(...t) {
|
|
3347
|
-
|
|
3350
|
+
ut.load(...t);
|
|
3348
3351
|
}
|
|
3349
|
-
},
|
|
3352
|
+
}, Rr = function(t) {
|
|
3350
3353
|
function e(i) {
|
|
3351
|
-
return
|
|
3354
|
+
return f.String(i) && (i = {
|
|
3352
3355
|
action: i,
|
|
3353
3356
|
to: "options"
|
|
3354
3357
|
}), i;
|
|
@@ -3356,9 +3359,9 @@ const Rr = function(t) {
|
|
|
3356
3359
|
function r(i, s, n) {
|
|
3357
3360
|
let o = i.value;
|
|
3358
3361
|
const a = (m) => {
|
|
3359
|
-
m === void 0 ? (i.clearProp(), n.sync(s)) :
|
|
3362
|
+
m === void 0 ? (i.clearProp(), n.sync(s)) : Z(i.getProp(), o.to || "options", m);
|
|
3360
3363
|
};
|
|
3361
|
-
if (
|
|
3364
|
+
if (f.Function(o) && (o = o(s, n)), o = e(o), !o || !o.action) {
|
|
3362
3365
|
a(void 0);
|
|
3363
3366
|
return;
|
|
3364
3367
|
}
|
|
@@ -3366,30 +3369,30 @@ const Rr = function(t) {
|
|
|
3366
3369
|
const u = o.onError, l = () => {
|
|
3367
3370
|
if (!i.getValue())
|
|
3368
3371
|
return i.clearProp(), n.sync(s), !0;
|
|
3369
|
-
},
|
|
3372
|
+
}, c = N(y({
|
|
3370
3373
|
headers: {}
|
|
3371
3374
|
}, o), {
|
|
3372
3375
|
onSuccess(m, v) {
|
|
3373
3376
|
if (l()) return;
|
|
3374
3377
|
let _ = (g) => v ? g : O(g, "data") ? g.data : g;
|
|
3375
|
-
|
|
3378
|
+
f.Function(o.parse) ? _ = o.parse : o.parse && f.String(o.parse) && (_ = (g) => (o.parse.split(".").forEach((k) => {
|
|
3376
3379
|
g && (g = g[k]);
|
|
3377
3380
|
}), g)), a(_(m, s, n)), n.sync(s);
|
|
3378
3381
|
},
|
|
3379
3382
|
onError(m) {
|
|
3380
|
-
a(void 0), !l() && (u || ((v) =>
|
|
3383
|
+
a(void 0), !l() && (u || ((v) => me(v.message || "fetch fail " + o.action)))(m, s, n);
|
|
3381
3384
|
}
|
|
3382
3385
|
});
|
|
3383
|
-
t.$handle.beforeFetch(
|
|
3384
|
-
if (
|
|
3386
|
+
t.$handle.beforeFetch(c, { rule: s, api: n }).then(() => {
|
|
3387
|
+
if (f.Function(o.action)) {
|
|
3385
3388
|
o.action(s, n).then((m) => {
|
|
3386
|
-
|
|
3389
|
+
c.onSuccess(m, !0);
|
|
3387
3390
|
}).catch((m) => {
|
|
3388
|
-
|
|
3391
|
+
c.onError(m);
|
|
3389
3392
|
});
|
|
3390
3393
|
return;
|
|
3391
3394
|
}
|
|
3392
|
-
R(() => t.create.fetch(
|
|
3395
|
+
R(() => t.create.fetch(c, { inject: i, rule: s, api: n }));
|
|
3393
3396
|
});
|
|
3394
3397
|
}
|
|
3395
3398
|
return {
|
|
@@ -3401,17 +3404,17 @@ const Rr = function(t) {
|
|
|
3401
3404
|
r(...i);
|
|
3402
3405
|
}
|
|
3403
3406
|
};
|
|
3404
|
-
},
|
|
3407
|
+
}, ht = {
|
|
3405
3408
|
name: "required",
|
|
3406
3409
|
load(t, e, r) {
|
|
3407
|
-
const i =
|
|
3410
|
+
const i = jr(t.getValue());
|
|
3408
3411
|
if (i.required === !1)
|
|
3409
3412
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
3410
3413
|
else {
|
|
3411
3414
|
const s = y({
|
|
3412
3415
|
required: !0,
|
|
3413
3416
|
validator(n, o, a) {
|
|
3414
|
-
|
|
3417
|
+
f.empty(o) ? a(s.message) : a();
|
|
3415
3418
|
}
|
|
3416
3419
|
}, i);
|
|
3417
3420
|
if (!s.message) {
|
|
@@ -3423,38 +3426,38 @@ const Rr = function(t) {
|
|
|
3423
3426
|
r.sync(e);
|
|
3424
3427
|
},
|
|
3425
3428
|
watch(...t) {
|
|
3426
|
-
|
|
3429
|
+
ht.load(...t);
|
|
3427
3430
|
}
|
|
3428
3431
|
};
|
|
3429
|
-
function
|
|
3430
|
-
return
|
|
3432
|
+
function jr(t) {
|
|
3433
|
+
return f.Boolean(t) ? { required: t } : f.String(t) ? { message: t } : f.Undef(t) ? { required: !1 } : f.Function(t) ? { validator: t } : f.Object(t) ? t : {};
|
|
3431
3434
|
}
|
|
3432
|
-
const
|
|
3433
|
-
fetch:
|
|
3434
|
-
loadData:
|
|
3435
|
-
required:
|
|
3436
|
-
componentValidate:
|
|
3437
|
-
},
|
|
3438
|
-
name:
|
|
3435
|
+
const Ir = {
|
|
3436
|
+
fetch: Rr,
|
|
3437
|
+
loadData: Sr,
|
|
3438
|
+
required: ht,
|
|
3439
|
+
componentValidate: ut
|
|
3440
|
+
}, Ar = "html", Vr = {
|
|
3441
|
+
name: Ar,
|
|
3439
3442
|
loadChildren: !1,
|
|
3440
3443
|
render(t, e) {
|
|
3441
3444
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
3442
3445
|
},
|
|
3443
3446
|
renderChildren(t) {
|
|
3444
|
-
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) =>
|
|
3447
|
+
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) => f.String(e)).join("") : "";
|
|
3445
3448
|
}
|
|
3446
3449
|
};
|
|
3447
|
-
function
|
|
3450
|
+
function Pr(t, e) {
|
|
3448
3451
|
let r;
|
|
3449
3452
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
3450
3453
|
}
|
|
3451
|
-
function
|
|
3452
|
-
return
|
|
3454
|
+
function re() {
|
|
3455
|
+
return Pr("name", ...arguments);
|
|
3453
3456
|
}
|
|
3454
|
-
function
|
|
3455
|
-
return !t || !t.el ? window.document.body :
|
|
3457
|
+
function Ne(t) {
|
|
3458
|
+
return !t || !t.el ? window.document.body : f.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
3456
3459
|
}
|
|
3457
|
-
function
|
|
3460
|
+
function qe(t, e) {
|
|
3458
3461
|
const r = new T({
|
|
3459
3462
|
data() {
|
|
3460
3463
|
return { rule: t, option: e || {} };
|
|
@@ -3465,20 +3468,20 @@ function Ue(t, e) {
|
|
|
3465
3468
|
});
|
|
3466
3469
|
return r.$mount(), r;
|
|
3467
3470
|
}
|
|
3468
|
-
function
|
|
3471
|
+
function Tr(t) {
|
|
3469
3472
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
3470
|
-
|
|
3473
|
+
ze.push(...e), ce.push(...r), de.push(...i), rt([...e, ...r, ...i]);
|
|
3471
3474
|
}
|
|
3472
|
-
let
|
|
3475
|
+
let Dr = 1;
|
|
3473
3476
|
const S = {};
|
|
3474
3477
|
function ft(t) {
|
|
3475
3478
|
const e = {
|
|
3476
|
-
[
|
|
3477
|
-
}, r = {}, i = {}, s = y({},
|
|
3479
|
+
[te.name]: te
|
|
3480
|
+
}, r = {}, i = {}, s = y({}, Ir), n = tr();
|
|
3478
3481
|
let o = { global: {} };
|
|
3479
|
-
const a = {}, u =
|
|
3480
|
-
|
|
3481
|
-
function
|
|
3482
|
+
const a = {}, u = Fr(), l = {};
|
|
3483
|
+
Tr(t.attrs || {});
|
|
3484
|
+
function c(h) {
|
|
3482
3485
|
const d = S[h];
|
|
3483
3486
|
if (Array.isArray(d))
|
|
3484
3487
|
return d.map(($) => $.api());
|
|
@@ -3486,27 +3489,27 @@ function ft(t) {
|
|
|
3486
3489
|
return d.api();
|
|
3487
3490
|
}
|
|
3488
3491
|
function m() {
|
|
3489
|
-
const h =
|
|
3492
|
+
const h = re(...arguments);
|
|
3490
3493
|
h.id && h.prop && (i[h.id] = h.prop);
|
|
3491
3494
|
}
|
|
3492
3495
|
function v() {
|
|
3493
|
-
const h =
|
|
3494
|
-
h.id && h.prop && (s[h.id] =
|
|
3496
|
+
const h = re(...arguments);
|
|
3497
|
+
h.id && h.prop && (s[h.id] = N(y({}, h.prop), { name: h.id }));
|
|
3495
3498
|
}
|
|
3496
3499
|
function _(h) {
|
|
3497
3500
|
u.use(h);
|
|
3498
3501
|
}
|
|
3499
3502
|
function g() {
|
|
3500
|
-
const h =
|
|
3501
|
-
if (!h.id || !h.prop) return
|
|
3503
|
+
const h = re(...arguments);
|
|
3504
|
+
if (!h.id || !h.prop) return he;
|
|
3502
3505
|
const d = I(h.id), $ = h.prop, b = $.merge === !0 ? r[d] : void 0;
|
|
3503
|
-
r[d] = $, Object.setPrototypeOf($, b ||
|
|
3506
|
+
r[d] = $, Object.setPrototypeOf($, b || he), n[d] = E(d), $.maker && p(n, $.maker);
|
|
3504
3507
|
}
|
|
3505
3508
|
function k(h, d) {
|
|
3506
3509
|
let $;
|
|
3507
|
-
if (
|
|
3510
|
+
if (f.String(h)) {
|
|
3508
3511
|
if ($ = I(h), ["form-create", "formcreate"].indexOf($) > -1)
|
|
3509
|
-
return
|
|
3512
|
+
return W();
|
|
3510
3513
|
if (d === void 0)
|
|
3511
3514
|
return e[$];
|
|
3512
3515
|
} else
|
|
@@ -3515,38 +3518,38 @@ function ft(t) {
|
|
|
3515
3518
|
const b = I($);
|
|
3516
3519
|
e[$] = d, e[b] = d, delete u.aliasMap[$], delete u.aliasMap[b], delete r[$], delete r[b], d.formCreateParser && g($, d.formCreateParser);
|
|
3517
3520
|
}
|
|
3518
|
-
function
|
|
3521
|
+
function ve(h) {
|
|
3519
3522
|
Object.keys(S).forEach((d) => {
|
|
3520
3523
|
(Array.isArray(S[d]) ? S[d] : [S[d]]).forEach((b) => {
|
|
3521
3524
|
b.bus.$emit("p.loadData." + h);
|
|
3522
3525
|
});
|
|
3523
3526
|
});
|
|
3524
3527
|
}
|
|
3525
|
-
function
|
|
3526
|
-
a[h] = d,
|
|
3528
|
+
function be(h, d) {
|
|
3529
|
+
a[h] = d, ve(h);
|
|
3527
3530
|
}
|
|
3528
|
-
function
|
|
3531
|
+
function Ce(h, d) {
|
|
3529
3532
|
return O(a, h) ? a[h] : d;
|
|
3530
3533
|
}
|
|
3531
|
-
function
|
|
3532
|
-
delete a[h],
|
|
3534
|
+
function ct(h) {
|
|
3535
|
+
delete a[h], ve(h);
|
|
3533
3536
|
}
|
|
3534
|
-
function
|
|
3535
|
-
return
|
|
3537
|
+
function W() {
|
|
3538
|
+
return Wt(ke, e, i);
|
|
3536
3539
|
}
|
|
3537
|
-
function
|
|
3538
|
-
return
|
|
3540
|
+
function _e() {
|
|
3541
|
+
return te;
|
|
3539
3542
|
}
|
|
3540
|
-
function
|
|
3541
|
-
return
|
|
3543
|
+
function dt(h, d) {
|
|
3544
|
+
return f.Function(h.install) ? h.install(M, d) : f.Function(h) && h(M, d), this;
|
|
3542
3545
|
}
|
|
3543
|
-
function
|
|
3544
|
-
let b =
|
|
3546
|
+
function M(h, d, $) {
|
|
3547
|
+
let b = qe(h, d || {});
|
|
3545
3548
|
const A = b.$refs.fc.formCreate;
|
|
3546
|
-
return A.$parent = $,
|
|
3549
|
+
return A.$parent = $, Ne(A.options).appendChild(b.$el), A.api();
|
|
3547
3550
|
}
|
|
3548
|
-
Object.setPrototypeOf(
|
|
3549
|
-
function
|
|
3551
|
+
Object.setPrototypeOf(M, l);
|
|
3552
|
+
function pt(h) {
|
|
3550
3553
|
let d = y({}, t);
|
|
3551
3554
|
return h ? d.inherit = {
|
|
3552
3555
|
components: e,
|
|
@@ -3557,24 +3560,24 @@ function ft(t) {
|
|
|
3557
3560
|
loadData: a
|
|
3558
3561
|
} : delete d.inherit, ft(d);
|
|
3559
3562
|
}
|
|
3560
|
-
function
|
|
3563
|
+
function ke(h) {
|
|
3561
3564
|
const d = h.$options.propsData.rule;
|
|
3562
3565
|
p(this, {
|
|
3563
|
-
id:
|
|
3566
|
+
id: Dr++,
|
|
3564
3567
|
vm: h,
|
|
3565
|
-
create:
|
|
3566
|
-
manager:
|
|
3568
|
+
create: M,
|
|
3569
|
+
manager: Er(t.manager),
|
|
3567
3570
|
parsers: r,
|
|
3568
3571
|
providers: s,
|
|
3569
3572
|
rules: Array.isArray(d) ? d : [],
|
|
3570
|
-
name: h.$options.propsData.name ||
|
|
3573
|
+
name: h.$options.propsData.name || ee(),
|
|
3571
3574
|
inFor: h.$options.propsData.inFor,
|
|
3572
3575
|
prop: {
|
|
3573
3576
|
components: e,
|
|
3574
3577
|
directives: i
|
|
3575
3578
|
},
|
|
3576
|
-
setData:
|
|
3577
|
-
getData:
|
|
3579
|
+
setData: be,
|
|
3580
|
+
getData: Ce,
|
|
3578
3581
|
loadData: a,
|
|
3579
3582
|
CreateNode: u,
|
|
3580
3583
|
bus: new T(),
|
|
@@ -3583,7 +3586,7 @@ function ft(t) {
|
|
|
3583
3586
|
extendApi: t.extendApi || (($) => $)
|
|
3584
3587
|
}), this.init(), this.initOptions(), this.name && (this.inFor ? (S[this.name] || (S[this.name] = []), S[this.name].push(this)) : S[this.name] = this);
|
|
3585
3588
|
}
|
|
3586
|
-
p(
|
|
3589
|
+
p(ke.prototype, {
|
|
3587
3590
|
init() {
|
|
3588
3591
|
const h = this.vm, d = new V(this);
|
|
3589
3592
|
this.$handle = d, h.$f = d.api, h.$emit("input", d.api), h.$on("hook:created", () => {
|
|
@@ -3612,9 +3615,9 @@ function ft(t) {
|
|
|
3612
3615
|
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0), h = this.mergeOptions(h, this.vm.$options.propsData.option), this.updateOptions(h);
|
|
3613
3616
|
},
|
|
3614
3617
|
mergeOptions(h, d, $) {
|
|
3615
|
-
return d = L(d), $ && ["page", "onSubmit", "mounted", "reload", "formData", "el"].forEach((b) => {
|
|
3618
|
+
return d = L(d), $ && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el"].forEach((b) => {
|
|
3616
3619
|
delete d[b];
|
|
3617
|
-
}), d.global && (h.global =
|
|
3620
|
+
}), d.global && (h.global = Yt(h.global, d.global), delete d.global), this.$handle.$manager.mergeOptions([d], h), h;
|
|
3618
3621
|
},
|
|
3619
3622
|
updateOptions(h) {
|
|
3620
3623
|
this.mergeOptions(this.options, h), this.$handle.$manager.updateOptions(this.options);
|
|
@@ -3632,35 +3635,35 @@ function ft(t) {
|
|
|
3632
3635
|
this.$handle.mounted();
|
|
3633
3636
|
}
|
|
3634
3637
|
});
|
|
3635
|
-
function
|
|
3638
|
+
function Oe(h) {
|
|
3636
3639
|
p(h, {
|
|
3637
3640
|
version: t.version,
|
|
3638
3641
|
ui: t.ui,
|
|
3639
|
-
setData:
|
|
3640
|
-
getData:
|
|
3641
|
-
removeData:
|
|
3642
|
+
setData: be,
|
|
3643
|
+
getData: Ce,
|
|
3644
|
+
removeData: ct,
|
|
3642
3645
|
maker: n,
|
|
3643
3646
|
component: k,
|
|
3644
3647
|
directive: m,
|
|
3645
3648
|
register: v,
|
|
3646
|
-
$vnode:
|
|
3649
|
+
$vnode: _e,
|
|
3647
3650
|
parser: g,
|
|
3648
|
-
use:
|
|
3649
|
-
factory:
|
|
3651
|
+
use: dt,
|
|
3652
|
+
factory: pt,
|
|
3650
3653
|
componentAlias: _,
|
|
3651
|
-
copyRule:
|
|
3652
|
-
copyRules:
|
|
3653
|
-
fetch:
|
|
3654
|
-
$form:
|
|
3654
|
+
copyRule: ye,
|
|
3655
|
+
copyRules: Ye,
|
|
3656
|
+
fetch: nt,
|
|
3657
|
+
$form: W,
|
|
3655
3658
|
parseFn: q,
|
|
3656
|
-
parseJson:
|
|
3657
|
-
toJson:
|
|
3658
|
-
getApi:
|
|
3659
|
+
parseJson: Zt,
|
|
3660
|
+
toJson: Qe,
|
|
3661
|
+
getApi: c,
|
|
3659
3662
|
init(d, $ = {}) {
|
|
3660
|
-
let b =
|
|
3663
|
+
let b = qe(d, $), A = b.$refs.fc.formCreate;
|
|
3661
3664
|
return {
|
|
3662
3665
|
mount(x) {
|
|
3663
|
-
return x &&
|
|
3666
|
+
return x && f.Element(x) && (A.options.el = x), Ne(A.options).appendChild(b.$el), A.api();
|
|
3664
3667
|
},
|
|
3665
3668
|
remove() {
|
|
3666
3669
|
b.$el.parentNode && b.$el.parentNode.removeChild(b.$el);
|
|
@@ -3673,25 +3676,25 @@ function ft(t) {
|
|
|
3673
3676
|
}
|
|
3674
3677
|
});
|
|
3675
3678
|
}
|
|
3676
|
-
function
|
|
3679
|
+
function mt(h) {
|
|
3677
3680
|
p(h, {
|
|
3678
|
-
create:
|
|
3681
|
+
create: M,
|
|
3679
3682
|
install(d, $) {
|
|
3680
3683
|
if (o = y(y({}, o), $ || {}), d._installedFormCreate === !0) return;
|
|
3681
3684
|
d._installedFormCreate = !0;
|
|
3682
3685
|
const b = function(A, x = {}) {
|
|
3683
|
-
return
|
|
3686
|
+
return M(A, x, this);
|
|
3684
3687
|
};
|
|
3685
|
-
|
|
3688
|
+
Oe(b), d.prototype.$formCreate = b, d.component("FormCreate", W()), d.component("FcFragment", _e());
|
|
3686
3689
|
}
|
|
3687
3690
|
});
|
|
3688
3691
|
}
|
|
3689
|
-
if (
|
|
3692
|
+
if (Oe(l), mt(l), u.use({ fragment: "fcFragment" }), g(Vr), t.install && M.use(t), t.inherit) {
|
|
3690
3693
|
const h = t.inherit;
|
|
3691
3694
|
h.components && p(e, h.components), h.parsers && p(r, h.parsers), h.directives && p(i, h.directives), h.providers && p(s, h.providers), h.maker && p(n, h.maker), h.loadData && p(a, h.loadData);
|
|
3692
3695
|
}
|
|
3693
|
-
const
|
|
3694
|
-
return Object.setPrototypeOf(
|
|
3696
|
+
const G = W();
|
|
3697
|
+
return Object.setPrototypeOf(G, l), Object.defineProperties(G, {
|
|
3695
3698
|
fetch: {
|
|
3696
3699
|
get() {
|
|
3697
3700
|
return l.fetch;
|
|
@@ -3700,9 +3703,9 @@ function ft(t) {
|
|
|
3700
3703
|
l.fetch = h;
|
|
3701
3704
|
}
|
|
3702
3705
|
}
|
|
3703
|
-
}),
|
|
3706
|
+
}), G.util = l, G;
|
|
3704
3707
|
}
|
|
3705
|
-
const
|
|
3708
|
+
const Ue = {
|
|
3706
3709
|
date: "yyyy-MM-dd",
|
|
3707
3710
|
month: "yyyy-MM",
|
|
3708
3711
|
datetime: "yyyy-MM-dd HH:mm:ss",
|
|
@@ -3711,73 +3714,73 @@ const He = {
|
|
|
3711
3714
|
monthrange: "yyyy-MM",
|
|
3712
3715
|
datetimerange: "yyyy-MM-dd HH:mm:ss",
|
|
3713
3716
|
year: "yyyy"
|
|
3714
|
-
},
|
|
3715
|
-
name:
|
|
3717
|
+
}, He = "datePicker", Br = {
|
|
3718
|
+
name: He,
|
|
3716
3719
|
maker: function() {
|
|
3717
|
-
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = E(
|
|
3720
|
+
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = E(He, { type: e.toLowerCase() }), t), {});
|
|
3718
3721
|
}(),
|
|
3719
3722
|
mergeProp(t) {
|
|
3720
3723
|
const e = t.prop.props;
|
|
3721
|
-
e.valueFormat || (e.valueFormat =
|
|
3724
|
+
e.valueFormat || (e.valueFormat = Ue[e.type] || Ue.date);
|
|
3722
3725
|
}
|
|
3723
|
-
},
|
|
3724
|
-
name:
|
|
3726
|
+
}, ie = "hidden", Lr = {
|
|
3727
|
+
name: ie,
|
|
3725
3728
|
maker: {
|
|
3726
|
-
[
|
|
3729
|
+
[ie]: (t, e) => E(ie)("", t, e)
|
|
3727
3730
|
},
|
|
3728
3731
|
render() {
|
|
3729
3732
|
return [];
|
|
3730
3733
|
}
|
|
3731
|
-
},
|
|
3732
|
-
name:
|
|
3734
|
+
}, ne = "input", Mr = {
|
|
3735
|
+
name: ne,
|
|
3733
3736
|
maker: function() {
|
|
3734
|
-
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = E(
|
|
3735
|
-
return t.idate = E(
|
|
3737
|
+
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = E(ne, { type: r }), e), {});
|
|
3738
|
+
return t.idate = E(ne, { type: "date" }), t;
|
|
3736
3739
|
}(),
|
|
3737
3740
|
mergeProp(t) {
|
|
3738
3741
|
let { props: e } = t.prop;
|
|
3739
3742
|
e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
3740
3743
|
}
|
|
3741
|
-
},
|
|
3742
|
-
name:
|
|
3744
|
+
}, xe = "slider", Nr = {
|
|
3745
|
+
name: xe,
|
|
3743
3746
|
maker: {
|
|
3744
|
-
sliderRange: E(
|
|
3747
|
+
sliderRange: E(xe, { range: !0 })
|
|
3745
3748
|
},
|
|
3746
3749
|
toFormValue(t, e) {
|
|
3747
3750
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
3748
3751
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
3749
3752
|
}
|
|
3750
|
-
},
|
|
3751
|
-
name:
|
|
3753
|
+
}, se = "timePicker", qr = {
|
|
3754
|
+
name: se,
|
|
3752
3755
|
maker: {
|
|
3753
|
-
time: E(
|
|
3754
|
-
timeRange: E(
|
|
3756
|
+
time: E(se, (t) => t.props.isRange = !1),
|
|
3757
|
+
timeRange: E(se, (t) => t.props.isRange = !0)
|
|
3755
3758
|
},
|
|
3756
3759
|
mergeProp(t) {
|
|
3757
3760
|
const e = t.prop.props;
|
|
3758
3761
|
e.valueFormat || (e.valueFormat = "HH:mm:ss");
|
|
3759
3762
|
}
|
|
3760
|
-
},
|
|
3763
|
+
}, Ur = {
|
|
3761
3764
|
name: "FcRow",
|
|
3762
3765
|
render(t, e) {
|
|
3763
3766
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
3764
3767
|
e.vNode.row(e.prop, t)
|
|
3765
3768
|
]);
|
|
3766
3769
|
}
|
|
3767
|
-
},
|
|
3768
|
-
name:
|
|
3770
|
+
}, Hr = "select", xr = {
|
|
3771
|
+
name: Hr,
|
|
3769
3772
|
toFormValue(t, e) {
|
|
3770
3773
|
return e.prop.props.multiple && !Array.isArray(t) ? j(t) : t;
|
|
3771
3774
|
}
|
|
3772
|
-
},
|
|
3775
|
+
}, Jr = [
|
|
3776
|
+
Br,
|
|
3773
3777
|
Lr,
|
|
3774
|
-
Nr,
|
|
3775
3778
|
Mr,
|
|
3779
|
+
Nr,
|
|
3776
3780
|
qr,
|
|
3777
3781
|
Ur,
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
], C = "el", Wr = {
|
|
3782
|
+
xr
|
|
3783
|
+
], C = "el", Kr = {
|
|
3781
3784
|
button: C + "Button",
|
|
3782
3785
|
icon: "i",
|
|
3783
3786
|
slider: C + "Slider",
|
|
@@ -3809,7 +3812,7 @@ const He = {
|
|
|
3809
3812
|
object: "fcSubForm",
|
|
3810
3813
|
subForm: "fcSubForm"
|
|
3811
3814
|
};
|
|
3812
|
-
function
|
|
3815
|
+
function Wr() {
|
|
3813
3816
|
return {
|
|
3814
3817
|
form: {
|
|
3815
3818
|
inline: !1,
|
|
@@ -3843,23 +3846,23 @@ function Gr() {
|
|
|
3843
3846
|
}
|
|
3844
3847
|
};
|
|
3845
3848
|
}
|
|
3846
|
-
function
|
|
3849
|
+
function Gr(t) {
|
|
3847
3850
|
return t.type === "tooltip";
|
|
3848
3851
|
}
|
|
3849
|
-
const
|
|
3850
|
-
function
|
|
3851
|
-
return !
|
|
3852
|
+
const Xr = /[A-Z]/;
|
|
3853
|
+
function zr(t, e) {
|
|
3854
|
+
return !Xr.test(t) && (f.String(e) || f.Number(e));
|
|
3852
3855
|
}
|
|
3853
|
-
function
|
|
3854
|
-
O(t, e) &&
|
|
3856
|
+
function Je(t, e) {
|
|
3857
|
+
O(t, e) && f.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
3855
3858
|
}
|
|
3856
3859
|
function P(t) {
|
|
3857
3860
|
return t === !1;
|
|
3858
3861
|
}
|
|
3859
|
-
function
|
|
3860
|
-
O(t, e) && !
|
|
3862
|
+
function Qr(t, e) {
|
|
3863
|
+
O(t, e) && !f.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
3861
3864
|
}
|
|
3862
|
-
const
|
|
3865
|
+
const Zr = {
|
|
3863
3866
|
validate() {
|
|
3864
3867
|
const t = this.form();
|
|
3865
3868
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -3878,16 +3881,16 @@ const Yr = {
|
|
|
3878
3881
|
},
|
|
3879
3882
|
tidyOptions(t) {
|
|
3880
3883
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
3881
|
-
|
|
3884
|
+
Qr(t, e);
|
|
3882
3885
|
}), t;
|
|
3883
3886
|
},
|
|
3884
3887
|
tidyRule({ prop: t }) {
|
|
3885
|
-
return
|
|
3888
|
+
return Je(t, "title"), Je(t, "info"), t;
|
|
3886
3889
|
},
|
|
3887
3890
|
mergeProp(t) {
|
|
3888
3891
|
let e = t.prop.props;
|
|
3889
3892
|
t.prop = D([{
|
|
3890
|
-
attrs: Object.keys(e).reduce((r, i) => (
|
|
3893
|
+
attrs: Object.keys(e).reduce((r, i) => (zr(i, e[i]) && (r[i] = e[i]), r), {}),
|
|
3891
3894
|
info: this.options.info || {},
|
|
3892
3895
|
wrap: this.options.wrap || {},
|
|
3893
3896
|
col: this.options.col || {},
|
|
@@ -3904,7 +3907,7 @@ const Yr = {
|
|
|
3904
3907
|
}, { normal: ["title", "info", "col", "wrap"] });
|
|
3905
3908
|
},
|
|
3906
3909
|
getDefaultOptions() {
|
|
3907
|
-
return
|
|
3910
|
+
return Wr();
|
|
3908
3911
|
},
|
|
3909
3912
|
update() {
|
|
3910
3913
|
const t = this.options.form;
|
|
@@ -3932,8 +3935,8 @@ const Yr = {
|
|
|
3932
3935
|
},
|
|
3933
3936
|
makeWrap(t, e) {
|
|
3934
3937
|
const r = t.prop, i = `${this.key}${t.key}`, s = r.col, n = this.isTitle(r), o = !s.labelWidth && !n ? 0 : s.labelWidth, { inline: a, col: u } = this.rule.props, l = P(r.wrap.show) ? e : this.$r(D([r.wrap, {
|
|
3935
|
-
props:
|
|
3936
|
-
labelWidth: o === void 0 ? o :
|
|
3938
|
+
props: N(y({
|
|
3939
|
+
labelWidth: o === void 0 ? o : ot(o),
|
|
3937
3940
|
label: n ? r.title.title : void 0
|
|
3938
3941
|
}, r.wrap || {}), {
|
|
3939
3942
|
prop: t.id,
|
|
@@ -3952,15 +3955,15 @@ const Yr = {
|
|
|
3952
3955
|
return !(!e.title && !e.native || P(e.show));
|
|
3953
3956
|
},
|
|
3954
3957
|
makeInfo(t, e, r) {
|
|
3955
|
-
const i = t.title, s = t.info, n =
|
|
3958
|
+
const i = t.title, s = t.info, n = Gr(s), o = this.options.form, a = this.getSlot("title"), u = [a ? a({ title: i.title || "", rule: r.rule, options: this.options }) : (i.title || "") + (o.labelSuffix || o["label-suffix"] || "")];
|
|
3956
3959
|
if (!P(s.show) && (s.info || s.native) && !P(s.icon)) {
|
|
3957
3960
|
const l = {
|
|
3958
3961
|
type: s.type || "popover",
|
|
3959
3962
|
props: y({}, s),
|
|
3960
3963
|
key: `${e}pop`,
|
|
3961
3964
|
slot: "label"
|
|
3962
|
-
},
|
|
3963
|
-
s.info && !O(l.props,
|
|
3965
|
+
}, c = "content";
|
|
3966
|
+
s.info && !O(l.props, c) && (l.props[c] = s.info), u[s.align !== "left" ? "unshift" : "push"](this.$r(D([s, l]), [
|
|
3964
3967
|
this.$r({
|
|
3965
3968
|
type: "i",
|
|
3966
3969
|
slot: n ? "default" : "reference",
|
|
@@ -4039,25 +4042,25 @@ const Yr = {
|
|
|
4039
4042
|
}, [t.innerText]);
|
|
4040
4043
|
}
|
|
4041
4044
|
}, H = {};
|
|
4045
|
+
Yr(H);
|
|
4042
4046
|
ei(H);
|
|
4043
4047
|
ti(H);
|
|
4044
4048
|
ri(H);
|
|
4045
4049
|
ii(H);
|
|
4046
|
-
|
|
4047
|
-
function ei(t) {
|
|
4050
|
+
function Yr(t) {
|
|
4048
4051
|
["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
|
|
4049
4052
|
t[e] = E(e);
|
|
4050
4053
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4051
4054
|
}
|
|
4052
|
-
function
|
|
4055
|
+
function ei(t) {
|
|
4053
4056
|
const e = "select", r = "multiple";
|
|
4054
4057
|
t.selectMultiple = E(e, { [r]: !0 }), t.selectOne = E(e, { [r]: !1 });
|
|
4055
4058
|
}
|
|
4056
|
-
function
|
|
4059
|
+
function ti(t) {
|
|
4057
4060
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4058
4061
|
Object.keys(r).reduce((i, s) => (i[s] = E(e, { type: r[s] }), i), t);
|
|
4059
4062
|
}
|
|
4060
|
-
function
|
|
4063
|
+
function ri(t) {
|
|
4061
4064
|
const e = "upload", r = {
|
|
4062
4065
|
image: ["image", 0],
|
|
4063
4066
|
file: ["file", 0],
|
|
@@ -4066,7 +4069,7 @@ function ii(t) {
|
|
|
4066
4069
|
};
|
|
4067
4070
|
Object.keys(r).reduce((i, s) => (i[s] = E(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4068
4071
|
}
|
|
4069
|
-
function
|
|
4072
|
+
function ii(t) {
|
|
4070
4073
|
const e = {
|
|
4071
4074
|
frameInputs: ["input", 0],
|
|
4072
4075
|
frameFiles: ["file", 0],
|
|
@@ -4077,10 +4080,10 @@ function ni(t) {
|
|
|
4077
4080
|
};
|
|
4078
4081
|
return Object.keys(e).reduce((r, i) => (r[i] = E("frame", (s) => s.props({ type: e[i][0], maxLength: e[i][1] })), r), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages, t;
|
|
4079
4082
|
}
|
|
4080
|
-
function
|
|
4081
|
-
return
|
|
4083
|
+
function Ke(t, e) {
|
|
4084
|
+
return f.Boolean(t) ? t = { show: t } : !f.Undef(t) && !f.Object(t) && (t = { show: e }), t;
|
|
4082
4085
|
}
|
|
4083
|
-
function
|
|
4086
|
+
function ni(t, e) {
|
|
4084
4087
|
return p(t, {
|
|
4085
4088
|
formEl() {
|
|
4086
4089
|
return e.$manager.form();
|
|
@@ -4154,41 +4157,41 @@ function si(t, e) {
|
|
|
4154
4157
|
}
|
|
4155
4158
|
},
|
|
4156
4159
|
submitBtnProps: (r = {}) => {
|
|
4157
|
-
let i =
|
|
4160
|
+
let i = Ke(e.options.submitBtn, !0);
|
|
4158
4161
|
p(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4159
4162
|
},
|
|
4160
4163
|
resetBtnProps: (r = {}) => {
|
|
4161
|
-
let i =
|
|
4164
|
+
let i = Ke(e.options.resetBtn, !1);
|
|
4162
4165
|
p(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4163
4166
|
},
|
|
4164
4167
|
submit(r, i) {
|
|
4165
4168
|
t.validate((s) => {
|
|
4166
4169
|
if (s) {
|
|
4167
4170
|
let n = t.formData();
|
|
4168
|
-
|
|
4171
|
+
f.Function(r) ? R(() => r(n, this)) : (f.Function(e.options.onSubmit) && R(() => e.options.onSubmit(n, this)), e.vm.$emit("submit", n, this));
|
|
4169
4172
|
} else
|
|
4170
|
-
|
|
4173
|
+
f.Function(i) && R(() => i(this, ...arguments));
|
|
4171
4174
|
}).catch((s) => {
|
|
4172
4175
|
});
|
|
4173
4176
|
}
|
|
4174
4177
|
}), t;
|
|
4175
4178
|
}
|
|
4176
|
-
function
|
|
4177
|
-
t.componentAlias(
|
|
4179
|
+
function si(t) {
|
|
4180
|
+
t.componentAlias(Kr), Kt.forEach((e) => {
|
|
4178
4181
|
t.component(e.name, e);
|
|
4179
|
-
}),
|
|
4182
|
+
}), Jr.forEach((e) => {
|
|
4180
4183
|
t.parser(e);
|
|
4181
4184
|
}), Object.keys(H).forEach((e) => {
|
|
4182
4185
|
t.maker[e] = H[e];
|
|
4183
4186
|
});
|
|
4184
4187
|
}
|
|
4185
|
-
function
|
|
4188
|
+
function oi() {
|
|
4186
4189
|
return ft({
|
|
4187
4190
|
ui: "element-ui",
|
|
4188
|
-
version: "2.6.
|
|
4189
|
-
manager:
|
|
4190
|
-
extendApi:
|
|
4191
|
-
install:
|
|
4191
|
+
version: "2.6.2",
|
|
4192
|
+
manager: Zr,
|
|
4193
|
+
extendApi: ni,
|
|
4194
|
+
install: si,
|
|
4192
4195
|
attrs: {
|
|
4193
4196
|
normal: ["col", "wrap"],
|
|
4194
4197
|
array: ["className"],
|
|
@@ -4196,10 +4199,10 @@ function ai() {
|
|
|
4196
4199
|
}
|
|
4197
4200
|
});
|
|
4198
4201
|
}
|
|
4199
|
-
const fe =
|
|
4202
|
+
const fe = oi();
|
|
4200
4203
|
typeof window != "undefined" && (window.formCreate = fe, window.Vue && fe.install(window.Vue));
|
|
4201
|
-
const
|
|
4204
|
+
const ui = fe.maker;
|
|
4202
4205
|
export {
|
|
4203
4206
|
fe as default,
|
|
4204
|
-
|
|
4207
|
+
ui as maker
|
|
4205
4208
|
};
|