@form-create/element-ui 2.6.1 → 2.6.3
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 +575 -556
- 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,26 +1,26 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/element-ui v2.6.
|
|
3
|
+
* @form-create/element-ui v2.6.3
|
|
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 pt = Object.defineProperty, mt = Object.defineProperties;
|
|
11
|
+
var yt = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var Ee = Object.getOwnPropertySymbols;
|
|
13
|
+
var gt = Object.prototype.hasOwnProperty, $t = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var Se = (t, e, r) => e in t ? pt(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
|
+
gt.call(e, r) && Se(t, r, e[r]);
|
|
17
|
+
if (Ee)
|
|
18
|
+
for (var r of Ee(e))
|
|
19
|
+
$t.call(e, r) && Se(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
},
|
|
21
|
+
}, N = (t, e) => mt(t, yt(e));
|
|
22
22
|
import T from "vue";
|
|
23
|
-
function
|
|
23
|
+
function vt(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
26
26
|
function ae() {
|
|
@@ -29,33 +29,33 @@ function ae() {
|
|
|
29
29
|
return t;
|
|
30
30
|
}, ae.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var bt = ["attrs", "props", "domProps"], Ct = ["class", "style", "directives"], _t = ["on", "nativeOn"], Ot = 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 (bt.indexOf(i) !== -1) e[i] = ae({}, e[i], r[i]);
|
|
36
|
+
else if (Ct.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 (_t.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] ? kt(e[i][l], r[i][l]) : r[i][l];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, kt = 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
|
+
}, wt = Ot;
|
|
53
|
+
const F = /* @__PURE__ */ vt(wt);
|
|
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 Ft = "fcCheckbox", Et = {
|
|
58
|
+
name: Ft,
|
|
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 St = "fcFrame", Rt = {
|
|
130
|
+
name: St,
|
|
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
|
+
}, jt = "fcRadio", It = {
|
|
500
|
+
name: jt,
|
|
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
|
+
}, h = {
|
|
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 && !h.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
|
+
h[t] = function(e) {
|
|
591
|
+
return h.type(e, t);
|
|
592
592
|
};
|
|
593
593
|
});
|
|
594
|
-
function
|
|
594
|
+
function k(t, e) {
|
|
595
595
|
return {}.hasOwnProperty.call(t, e);
|
|
596
596
|
}
|
|
597
|
-
const
|
|
598
|
-
name:
|
|
597
|
+
const At = "fcSelect", Vt = {
|
|
598
|
+
name: At,
|
|
599
599
|
functional: !0,
|
|
600
600
|
props: {
|
|
601
601
|
formCreateInject: {
|
|
@@ -612,22 +612,22 @@ const Tt = "fcSelect", Dt = {
|
|
|
612
612
|
key: "" + o + "-" + n.value
|
|
613
613
|
}]), [a ? t("template", {
|
|
614
614
|
slot: n.slotName || "default"
|
|
615
|
-
}, [
|
|
615
|
+
}, [h.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
|
+
}, [h.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
|
-
}]), [(Array.isArray(s) ? s : []).map((n, o) =>
|
|
624
|
+
}]), [(Array.isArray(s) ? s : []).map((n, o) => k(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
625
625
|
},
|
|
626
626
|
mounted() {
|
|
627
627
|
this.$emit("fc.el", this.$refs.el);
|
|
628
628
|
}
|
|
629
|
-
},
|
|
630
|
-
name:
|
|
629
|
+
}, Pt = "fcTree", Tt = {
|
|
630
|
+
name: Pt,
|
|
631
631
|
formCreateParser: {
|
|
632
632
|
mergeProp(t) {
|
|
633
633
|
const e = t.prop.props;
|
|
@@ -677,24 +677,24 @@ 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 Re(t, e) {
|
|
687
687
|
return {
|
|
688
688
|
url: t,
|
|
689
|
-
name:
|
|
689
|
+
name: Dt(t),
|
|
690
690
|
uid: e
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function Dt(t) {
|
|
694
694
|
return ("" + t).split("/").pop();
|
|
695
695
|
}
|
|
696
|
-
const
|
|
697
|
-
name:
|
|
696
|
+
const Bt = "fcUpload", Lt = {
|
|
697
|
+
name: Bt,
|
|
698
698
|
props: {
|
|
699
699
|
formCreateInject: {
|
|
700
700
|
type: Object,
|
|
@@ -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(Re);
|
|
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(Re), 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)) || h.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), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.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 Mt = 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 Mt.apply(this, arguments);
|
|
921
921
|
}
|
|
922
|
-
const
|
|
923
|
-
name:
|
|
922
|
+
const Nt = "fcGroup", qt = {
|
|
923
|
+
name: Nt,
|
|
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();
|
|
@@ -1041,7 +1041,7 @@ const Ht = "fcGroup", xt = {
|
|
|
1041
1041
|
},
|
|
1042
1042
|
methods: {
|
|
1043
1043
|
_value(t) {
|
|
1044
|
-
return t &&
|
|
1044
|
+
return t && k(t, this.field) ? t[this.field] : t;
|
|
1045
1045
|
},
|
|
1046
1046
|
cache(t, e) {
|
|
1047
1047
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -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
|
+
}, Ut = "fcSubForm", Ht = {
|
|
1225
|
+
name: Ut,
|
|
1226
1226
|
props: {
|
|
1227
1227
|
rule: Array,
|
|
1228
1228
|
options: Object,
|
|
@@ -1305,16 +1305,16 @@ const Ht = "fcGroup", xt = {
|
|
|
1305
1305
|
}
|
|
1306
1306
|
}]));
|
|
1307
1307
|
}
|
|
1308
|
-
},
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1308
|
+
}, Jt = [
|
|
1309
|
+
Et,
|
|
1310
|
+
Rt,
|
|
1311
|
+
It,
|
|
1312
|
+
Vt,
|
|
1313
|
+
Tt,
|
|
1313
1314
|
Lt,
|
|
1314
1315
|
qt,
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
], Re = "FormCreate", le = (t, e) => {
|
|
1316
|
+
Ht
|
|
1317
|
+
], je = "FormCreate", le = (t, e) => {
|
|
1318
1318
|
if (!(!t || t === e)) {
|
|
1319
1319
|
if (t.formCreateInject)
|
|
1320
1320
|
return t.formCreateInject;
|
|
@@ -1322,10 +1322,10 @@ const Ht = "fcGroup", xt = {
|
|
|
1322
1322
|
return le(t.$parent, e);
|
|
1323
1323
|
}
|
|
1324
1324
|
};
|
|
1325
|
-
function
|
|
1325
|
+
function xt(t, e, r) {
|
|
1326
1326
|
return {
|
|
1327
|
-
name:
|
|
1328
|
-
componentName:
|
|
1327
|
+
name: je,
|
|
1328
|
+
componentName: je,
|
|
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();
|
|
@@ -1439,8 +1439,8 @@ function Gt(t, e, r) {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
};
|
|
1441
1441
|
}
|
|
1442
|
-
const
|
|
1443
|
-
const i = [...
|
|
1442
|
+
const Ke = ["attrs", "props", "domProps", "scopedSlots"], We = ["class", "style", "directives"], Ge = ["on", "nativeOn"], D = (t, e = {}, r = {}) => {
|
|
1443
|
+
const i = [...Ke, ...r.normal || []], s = [...We, ...r.array || []], n = [...Ge, ...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,90 @@ 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] = Kt(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
|
+
}, Kt = (t, e) => function() {
|
|
1471
1471
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1472
|
-
},
|
|
1473
|
-
function
|
|
1474
|
-
return [...
|
|
1472
|
+
}, Xe = ["type", "slot", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "preview", "component", "cache"], pe = ["validate", "children", "control"], me = ["effect", "deep"];
|
|
1473
|
+
function Wt() {
|
|
1474
|
+
return [...Xe, ...Ke, ...We, ...Ge, ...pe, ...me];
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function ye(t, e, r) {
|
|
1477
1477
|
return `[form-create ${t}]: ${e}`;
|
|
1478
1478
|
}
|
|
1479
|
-
function
|
|
1480
|
-
console.warn(
|
|
1479
|
+
function Gt(t, e) {
|
|
1480
|
+
console.warn(ye("tip", t));
|
|
1481
1481
|
}
|
|
1482
|
-
function
|
|
1483
|
-
console.error(
|
|
1482
|
+
function ge(t, e) {
|
|
1483
|
+
console.error(ye("err", t));
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1486
|
-
|
|
1485
|
+
function Xt(t) {
|
|
1486
|
+
ge(t.toString()), console.error(t);
|
|
1487
1487
|
}
|
|
1488
|
-
const ue = "[[FORM-CREATE-PREFIX-",
|
|
1489
|
-
function
|
|
1490
|
-
return JSON.stringify(
|
|
1488
|
+
const ue = "[[FORM-CREATE-PREFIX-", fe = "-FORM-CREATE-SUFFIX]]";
|
|
1489
|
+
function ze(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 ue + i +
|
|
1497
|
+
return ue + i + fe;
|
|
1498
1498
|
}
|
|
1499
1499
|
}, e);
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1501
|
+
function te(t) {
|
|
1502
1502
|
return new Function("return " + t)();
|
|
1503
1503
|
}
|
|
1504
1504
|
function q(t, e) {
|
|
1505
|
-
if (t &&
|
|
1505
|
+
if (t && h.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.
|
|
1512
|
-
else
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1508
|
+
if (r.indexOf(fe) > 0 && r.indexOf(ue) === 0)
|
|
1509
|
+
r = r.replace(fe, "").replace(ue, ""), i = !0;
|
|
1510
|
+
else if (r.indexOf("$FN:") === 0)
|
|
1511
|
+
r = r.substring(4), i = !0;
|
|
1512
|
+
else if (r.indexOf("$EXEC:") === 0)
|
|
1513
|
+
r = r.substring(6), i = !0;
|
|
1514
|
+
else if (r.indexOf("$GLOBAL:") === 0) {
|
|
1515
|
+
const n = r.substring(8);
|
|
1516
|
+
return r = function(...o) {
|
|
1517
|
+
const a = o[0].api.getGlobalEvent(n);
|
|
1518
|
+
if (a)
|
|
1519
|
+
return a.call(this, ...o);
|
|
1520
|
+
}, r.__json = t, r.__inject = !0, r;
|
|
1521
|
+
} else {
|
|
1522
|
+
if (r.indexOf("$FNX:") === 0)
|
|
1523
|
+
return r = te("function($inject){" + r.substring(5) + "}"), r.__json = t, r.__inject = !0, r;
|
|
1524
|
+
(!e && r.indexOf("function ") === 0 && r !== "function " || !e && r.indexOf("function(") === 0 && r !== "function(") && (i = !0);
|
|
1516
1525
|
}
|
|
1517
1526
|
if (!i) return t;
|
|
1518
|
-
|
|
1527
|
+
let s;
|
|
1528
|
+
try {
|
|
1529
|
+
s = te(r);
|
|
1530
|
+
} catch (n) {
|
|
1531
|
+
s = te("function " + r);
|
|
1532
|
+
}
|
|
1519
1533
|
return s.__json = t, s;
|
|
1520
1534
|
} catch (s) {
|
|
1521
|
-
|
|
1535
|
+
ge(`解析失败:${r}
|
|
1522
1536
|
|
|
1523
1537
|
err: ${s}`);
|
|
1524
1538
|
return;
|
|
@@ -1526,12 +1540,12 @@ err: ${s}`);
|
|
|
1526
1540
|
}
|
|
1527
1541
|
return t;
|
|
1528
1542
|
}
|
|
1529
|
-
function
|
|
1543
|
+
function zt(t, e) {
|
|
1530
1544
|
return JSON.parse(t, function(r, i) {
|
|
1531
|
-
return
|
|
1545
|
+
return h.Undef(i) || !i.indexOf ? i : q(i, e);
|
|
1532
1546
|
});
|
|
1533
1547
|
}
|
|
1534
|
-
function
|
|
1548
|
+
function he(t, e) {
|
|
1535
1549
|
return {
|
|
1536
1550
|
value: t,
|
|
1537
1551
|
enumerable: !1,
|
|
@@ -1539,60 +1553,60 @@ function Ye(t, e) {
|
|
|
1539
1553
|
writable: !!e
|
|
1540
1554
|
};
|
|
1541
1555
|
}
|
|
1542
|
-
function
|
|
1543
|
-
return
|
|
1556
|
+
function $e(t) {
|
|
1557
|
+
return Qe([t])[0];
|
|
1544
1558
|
}
|
|
1545
|
-
function
|
|
1546
|
-
return
|
|
1559
|
+
function Qe(t, e) {
|
|
1560
|
+
return K([], [...t], e || !1);
|
|
1547
1561
|
}
|
|
1548
1562
|
function U(t, e) {
|
|
1549
|
-
return D(Array.isArray(e) ? e : [e], t, { array:
|
|
1563
|
+
return D(Array.isArray(e) ? e : [e], t, { array: pe, normal: me }), t;
|
|
1550
1564
|
}
|
|
1551
|
-
function
|
|
1552
|
-
const e =
|
|
1565
|
+
function Ie(t) {
|
|
1566
|
+
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1553
1567
|
return e.type || (e.type = "input"), e;
|
|
1554
1568
|
}
|
|
1555
|
-
function
|
|
1569
|
+
function Qt(t, e) {
|
|
1556
1570
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1557
1571
|
e[r] && (t[r] = U(t[r] || {}, e[r]));
|
|
1558
1572
|
}), t) : e;
|
|
1559
1573
|
}
|
|
1560
|
-
function
|
|
1574
|
+
function Ze(t, e) {
|
|
1561
1575
|
Object.defineProperties(t, Object.keys(e).reduce((r, i) => (r[i] = {
|
|
1562
1576
|
get() {
|
|
1563
1577
|
return e[i]();
|
|
1564
1578
|
}
|
|
1565
1579
|
}, r), {}));
|
|
1566
1580
|
}
|
|
1567
|
-
function
|
|
1581
|
+
function z(t) {
|
|
1568
1582
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1569
1583
|
}
|
|
1570
1584
|
function R(t, e) {
|
|
1571
1585
|
try {
|
|
1572
1586
|
e = t();
|
|
1573
1587
|
} catch (r) {
|
|
1574
|
-
|
|
1588
|
+
Xt(r);
|
|
1575
1589
|
}
|
|
1576
1590
|
return e;
|
|
1577
1591
|
}
|
|
1578
|
-
const
|
|
1579
|
-
"==": (t, e) => JSON.stringify(t) === JSON.stringify(
|
|
1580
|
-
"!=": (t, e) => !
|
|
1592
|
+
const Ae = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, x = {
|
|
1593
|
+
"==": (t, e) => JSON.stringify(t) === JSON.stringify(Ae(t, e)),
|
|
1594
|
+
"!=": (t, e) => !x["=="](t, e),
|
|
1581
1595
|
">": (t, e) => t > e,
|
|
1582
1596
|
">=": (t, e) => t >= e,
|
|
1583
1597
|
"<": (t, e) => t < e,
|
|
1584
1598
|
"<=": (t, e) => t <= e,
|
|
1585
1599
|
on(t, e) {
|
|
1586
|
-
return t && t.indexOf && t.indexOf(
|
|
1600
|
+
return t && t.indexOf && t.indexOf(Ae(t[0], e)) > -1;
|
|
1587
1601
|
},
|
|
1588
1602
|
notOn(t, e) {
|
|
1589
|
-
return !
|
|
1603
|
+
return !x.on(t, e);
|
|
1590
1604
|
},
|
|
1591
1605
|
in(t, e) {
|
|
1592
1606
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1593
1607
|
},
|
|
1594
1608
|
notIn(t, e) {
|
|
1595
|
-
return !
|
|
1609
|
+
return !x.in(t, e);
|
|
1596
1610
|
},
|
|
1597
1611
|
between(t, e) {
|
|
1598
1612
|
return t > e[0] && t < e[1];
|
|
@@ -1601,16 +1615,16 @@ const Pe = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1601
1615
|
return t < e[0] || t > e[1];
|
|
1602
1616
|
},
|
|
1603
1617
|
empty(t) {
|
|
1604
|
-
return
|
|
1618
|
+
return h.empty(t);
|
|
1605
1619
|
},
|
|
1606
1620
|
notEmpty(t) {
|
|
1607
|
-
return !
|
|
1621
|
+
return !h.empty(t);
|
|
1608
1622
|
},
|
|
1609
1623
|
pattern(t, e) {
|
|
1610
1624
|
return new RegExp(e, "g").test(t);
|
|
1611
1625
|
}
|
|
1612
1626
|
};
|
|
1613
|
-
function
|
|
1627
|
+
function Ye() {
|
|
1614
1628
|
return {
|
|
1615
1629
|
props: {},
|
|
1616
1630
|
on: {},
|
|
@@ -1624,14 +1638,14 @@ function rt() {
|
|
|
1624
1638
|
}
|
|
1625
1639
|
function E(t, e) {
|
|
1626
1640
|
return (r, i, s, n = {}) => {
|
|
1627
|
-
const o = new
|
|
1628
|
-
return e && (
|
|
1641
|
+
const o = new ve(t, r, i, s, n);
|
|
1642
|
+
return e && (h.Function(e) ? e(o) : o.props(e)), o;
|
|
1629
1643
|
};
|
|
1630
1644
|
}
|
|
1631
|
-
function
|
|
1632
|
-
this._data = p(
|
|
1645
|
+
function ve(t, e, r, i, s) {
|
|
1646
|
+
this._data = p(Ye(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1633
1647
|
}
|
|
1634
|
-
p(
|
|
1648
|
+
p(ve.prototype, {
|
|
1635
1649
|
getRule() {
|
|
1636
1650
|
return this._data;
|
|
1637
1651
|
},
|
|
@@ -1640,39 +1654,39 @@ p($e.prototype, {
|
|
|
1640
1654
|
},
|
|
1641
1655
|
_clone() {
|
|
1642
1656
|
const t = new this.constructor();
|
|
1643
|
-
return t._data =
|
|
1657
|
+
return t._data = $e(this._data), t;
|
|
1644
1658
|
}
|
|
1645
1659
|
});
|
|
1646
|
-
function
|
|
1660
|
+
function et(t) {
|
|
1647
1661
|
t.forEach((e) => {
|
|
1648
|
-
|
|
1662
|
+
ve.prototype[e] = function(r) {
|
|
1649
1663
|
return U(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1650
1664
|
};
|
|
1651
1665
|
});
|
|
1652
1666
|
}
|
|
1653
|
-
|
|
1654
|
-
const
|
|
1655
|
-
function
|
|
1656
|
-
let i =
|
|
1667
|
+
et(Wt());
|
|
1668
|
+
const tt = E("");
|
|
1669
|
+
function Zt(t, e, r) {
|
|
1670
|
+
let i = tt("", e);
|
|
1657
1671
|
return i._data.type = t, i._data.title = r, i;
|
|
1658
1672
|
}
|
|
1659
|
-
function
|
|
1660
|
-
let s =
|
|
1673
|
+
function Ve(t, e, r, i) {
|
|
1674
|
+
let s = tt("", r);
|
|
1661
1675
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1662
1676
|
}
|
|
1663
|
-
function
|
|
1677
|
+
function Yt() {
|
|
1664
1678
|
return {
|
|
1665
|
-
create:
|
|
1666
|
-
createTmp:
|
|
1667
|
-
template:
|
|
1679
|
+
create: Zt,
|
|
1680
|
+
createTmp: Ve,
|
|
1681
|
+
template: Ve,
|
|
1668
1682
|
factory: E
|
|
1669
1683
|
};
|
|
1670
1684
|
}
|
|
1671
|
-
function
|
|
1685
|
+
function er(t, e, r) {
|
|
1672
1686
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1673
1687
|
return s.status = r.status, s.url = t, s;
|
|
1674
1688
|
}
|
|
1675
|
-
function
|
|
1689
|
+
function Pe(t) {
|
|
1676
1690
|
const e = t.responseText || t.response;
|
|
1677
1691
|
if (!e)
|
|
1678
1692
|
return e;
|
|
@@ -1682,7 +1696,7 @@ function De(t) {
|
|
|
1682
1696
|
return e;
|
|
1683
1697
|
}
|
|
1684
1698
|
}
|
|
1685
|
-
function
|
|
1699
|
+
function rt(t) {
|
|
1686
1700
|
if (typeof XMLHttpRequest == "undefined")
|
|
1687
1701
|
return;
|
|
1688
1702
|
const e = new XMLHttpRequest(), r = t.action;
|
|
@@ -1690,8 +1704,8 @@ function st(t) {
|
|
|
1690
1704
|
t.onError(o);
|
|
1691
1705
|
}, e.onload = function() {
|
|
1692
1706
|
if (e.status < 200 || e.status >= 300)
|
|
1693
|
-
return t.onError(
|
|
1694
|
-
t.onSuccess(
|
|
1707
|
+
return t.onError(er(r, t, e), Pe(e));
|
|
1708
|
+
t.onSuccess(Pe(e));
|
|
1695
1709
|
}, e.open(t.method || "get", r, !0);
|
|
1696
1710
|
let i;
|
|
1697
1711
|
t.data && ((t.dataType || "").toLowerCase() !== "json" ? (i = new FormData(), Object.keys(t.data).map((n) => {
|
|
@@ -1702,13 +1716,13 @@ function st(t) {
|
|
|
1702
1716
|
s[n] !== null && e.setRequestHeader(n, s[n]);
|
|
1703
1717
|
}), e.send(i);
|
|
1704
1718
|
}
|
|
1705
|
-
function
|
|
1719
|
+
function tr(t) {
|
|
1706
1720
|
return new Promise((e, r) => {
|
|
1707
|
-
|
|
1721
|
+
rt(N(y({}, t), {
|
|
1708
1722
|
onSuccess(i) {
|
|
1709
1723
|
let s = (o) => o;
|
|
1710
1724
|
const n = q(t.parse);
|
|
1711
|
-
|
|
1725
|
+
h.Function(n) ? s = n : n && h.String(n) && (s = (o) => (n.split(".").forEach((a) => {
|
|
1712
1726
|
o && (o = o[a]);
|
|
1713
1727
|
}), o)), e(s(i));
|
|
1714
1728
|
},
|
|
@@ -1718,12 +1732,12 @@ function nr(t) {
|
|
|
1718
1732
|
}));
|
|
1719
1733
|
});
|
|
1720
1734
|
}
|
|
1721
|
-
function
|
|
1735
|
+
function X(t) {
|
|
1722
1736
|
return L(t);
|
|
1723
1737
|
}
|
|
1724
|
-
function
|
|
1738
|
+
function rr(t) {
|
|
1725
1739
|
function e(n) {
|
|
1726
|
-
return
|
|
1740
|
+
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1727
1741
|
}
|
|
1728
1742
|
function r(n, o, a) {
|
|
1729
1743
|
e(n).forEach((u) => {
|
|
@@ -1764,13 +1778,13 @@ function sr(t) {
|
|
|
1764
1778
|
formData(n) {
|
|
1765
1779
|
return e(n).reduce((o, a) => {
|
|
1766
1780
|
const u = t.getFieldCtx(a);
|
|
1767
|
-
return u && (o[u.field] =
|
|
1768
|
-
}, t.options.appendValue !== !1 ?
|
|
1781
|
+
return u && (o[u.field] = X(u.rule.value)), o;
|
|
1782
|
+
}, t.options.appendValue !== !1 ? X(t.appendData) : {});
|
|
1769
1783
|
},
|
|
1770
1784
|
getValue(n) {
|
|
1771
1785
|
const o = t.getFieldCtx(n);
|
|
1772
1786
|
if (o)
|
|
1773
|
-
return
|
|
1787
|
+
return X(o.rule.value);
|
|
1774
1788
|
},
|
|
1775
1789
|
coverValue(n) {
|
|
1776
1790
|
const o = y({}, n || {});
|
|
@@ -1778,9 +1792,9 @@ function sr(t) {
|
|
|
1778
1792
|
s.fields().forEach((a) => {
|
|
1779
1793
|
const u = t.fieldCtx[a];
|
|
1780
1794
|
if (u) {
|
|
1781
|
-
const l =
|
|
1782
|
-
u.forEach((
|
|
1783
|
-
|
|
1795
|
+
const l = k(o, a);
|
|
1796
|
+
u.forEach((c) => {
|
|
1797
|
+
c.rule.value = l ? o[a] : void 0;
|
|
1784
1798
|
}), delete o[a];
|
|
1785
1799
|
}
|
|
1786
1800
|
}), p(t.appendData, o);
|
|
@@ -1807,7 +1821,7 @@ function sr(t) {
|
|
|
1807
1821
|
}, !0), o ? o.origin : void 0;
|
|
1808
1822
|
},
|
|
1809
1823
|
removeRule(n) {
|
|
1810
|
-
const o = n &&
|
|
1824
|
+
const o = n && z(n);
|
|
1811
1825
|
if (o)
|
|
1812
1826
|
return o.rm(), o.origin;
|
|
1813
1827
|
},
|
|
@@ -1817,13 +1831,13 @@ function sr(t) {
|
|
|
1817
1831
|
fields: () => t.fields(),
|
|
1818
1832
|
append: (n, o, a) => {
|
|
1819
1833
|
let u = t.sort.length - 1, l;
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1834
|
+
const c = t.getCtx(o);
|
|
1835
|
+
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
1836
|
},
|
|
1823
1837
|
prepend: (n, o, a) => {
|
|
1824
1838
|
let u = 0, l;
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1839
|
+
const c = t.getCtx(o);
|
|
1840
|
+
c ? a ? l = c.rule.children : (u = c.root.indexOf(c.origin), l = c.root) : l = t.rules, l.splice(u, 0, n);
|
|
1827
1841
|
},
|
|
1828
1842
|
hidden(n, o) {
|
|
1829
1843
|
r(o, "hidden", !!n), t.refresh();
|
|
@@ -1883,7 +1897,7 @@ function sr(t) {
|
|
|
1883
1897
|
n.forEach((a) => s.sync(a));
|
|
1884
1898
|
return;
|
|
1885
1899
|
}
|
|
1886
|
-
let o =
|
|
1900
|
+
let o = h.Object(n) ? z(n) : t.getCtxs(n);
|
|
1887
1901
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
1888
1902
|
if (!a.deleted) {
|
|
1889
1903
|
const u = t.subForm[a.id];
|
|
@@ -1947,7 +1961,7 @@ function sr(t) {
|
|
|
1947
1961
|
},
|
|
1948
1962
|
setEffect(n, o, a) {
|
|
1949
1963
|
const u = t.getCtx(n);
|
|
1950
|
-
u && o && (o[0] === "$" && (o = o.substr(1)),
|
|
1964
|
+
u && o && (o[0] === "$" && (o = o.substr(1)), k(u.rule, "$" + o) && w(u.rule, "$" + o, a), k(u.rule, "effect") || w(u.rule, "effect", {}), w(u.rule.effect, o, a));
|
|
1951
1965
|
},
|
|
1952
1966
|
clearEffectData(n, o) {
|
|
1953
1967
|
const a = t.getCtx(n);
|
|
@@ -1967,23 +1981,23 @@ function sr(t) {
|
|
|
1967
1981
|
resetFields(n) {
|
|
1968
1982
|
e(n).forEach((o) => {
|
|
1969
1983
|
t.getCtxs(o).forEach((a) => {
|
|
1970
|
-
t.$render.clearCache(a), a.rule.value =
|
|
1984
|
+
t.$render.clearCache(a), a.rule.value = X(a.defaultValue);
|
|
1971
1985
|
});
|
|
1972
1986
|
}), t.vm.$nextTick(() => {
|
|
1973
1987
|
s.clearValidateState();
|
|
1974
|
-
}), n == null && (
|
|
1988
|
+
}), n == null && (h.Function(t.options.onReset) && R(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
1975
1989
|
},
|
|
1976
1990
|
method(n, o) {
|
|
1977
1991
|
const a = s.el(n);
|
|
1978
1992
|
if (!a || !a[o])
|
|
1979
|
-
throw new Error(
|
|
1993
|
+
throw new Error(ye("err", `${o}方法不存在`));
|
|
1980
1994
|
return (...u) => a[o](...u);
|
|
1981
1995
|
},
|
|
1982
1996
|
exec(n, o, ...a) {
|
|
1983
1997
|
return R(() => s.method(n, o)(...a));
|
|
1984
1998
|
},
|
|
1985
1999
|
toJson(n) {
|
|
1986
|
-
return
|
|
2000
|
+
return ze(s.rule, n);
|
|
1987
2001
|
},
|
|
1988
2002
|
trigger(n, o, ...a) {
|
|
1989
2003
|
const u = s.el(n);
|
|
@@ -2015,7 +2029,7 @@ function sr(t) {
|
|
|
2015
2029
|
},
|
|
2016
2030
|
fetch(n) {
|
|
2017
2031
|
return new Promise((o, a) => {
|
|
2018
|
-
t.beforeFetch(n).then(() =>
|
|
2032
|
+
t.beforeFetch(n).then(() => tr(n).then(o).catch(a));
|
|
2019
2033
|
});
|
|
2020
2034
|
},
|
|
2021
2035
|
getData(n, o) {
|
|
@@ -2035,7 +2049,7 @@ function sr(t) {
|
|
|
2035
2049
|
};
|
|
2036
2050
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2037
2051
|
}
|
|
2038
|
-
function
|
|
2052
|
+
function ir(t) {
|
|
2039
2053
|
p(t.prototype, {
|
|
2040
2054
|
initCache() {
|
|
2041
2055
|
this.clearCacheAll();
|
|
@@ -2073,30 +2087,30 @@ function I(t) {
|
|
|
2073
2087
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2074
2088
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2075
2089
|
});
|
|
2076
|
-
return
|
|
2090
|
+
return it(e);
|
|
2077
2091
|
}
|
|
2078
|
-
function
|
|
2092
|
+
function it(t) {
|
|
2079
2093
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2080
2094
|
}
|
|
2081
|
-
function
|
|
2095
|
+
function nt(t) {
|
|
2082
2096
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
2083
2097
|
}
|
|
2084
|
-
function
|
|
2098
|
+
function Q(t) {
|
|
2085
2099
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
2086
2100
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
2087
2101
|
}
|
|
2088
|
-
let
|
|
2089
|
-
function
|
|
2090
|
-
const t = 370 + ++
|
|
2102
|
+
let nr = 0;
|
|
2103
|
+
function ee() {
|
|
2104
|
+
const t = 370 + ++nr;
|
|
2091
2105
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
2092
2106
|
}
|
|
2093
|
-
function
|
|
2107
|
+
function Z(t, e, r) {
|
|
2094
2108
|
let i = t, s;
|
|
2095
2109
|
return (e || "").split(".").forEach((n) => {
|
|
2096
2110
|
s && ((!i[s] || typeof i[s] != "object") && (i[s] = {}), i = i[s]), s = n;
|
|
2097
2111
|
}), i[s] = r, i;
|
|
2098
2112
|
}
|
|
2099
|
-
function
|
|
2113
|
+
function sr(t) {
|
|
2100
2114
|
p(t.prototype, {
|
|
2101
2115
|
initRender() {
|
|
2102
2116
|
this.tempList = {}, this.clearOrgChildren();
|
|
@@ -2106,7 +2120,7 @@ function lr(t) {
|
|
|
2106
2120
|
this.orgChildren = Object.keys(e).reduce((r, i) => {
|
|
2107
2121
|
if (e[i].parser.loadChildren !== !1) {
|
|
2108
2122
|
const s = e[i].rule.children;
|
|
2109
|
-
r[i] =
|
|
2123
|
+
r[i] = h.trueArray(s) ? [...s] : [];
|
|
2110
2124
|
}
|
|
2111
2125
|
return r;
|
|
2112
2126
|
}, {});
|
|
@@ -2118,7 +2132,7 @@ function lr(t) {
|
|
|
2118
2132
|
const r = (i) => {
|
|
2119
2133
|
if (i) {
|
|
2120
2134
|
let s;
|
|
2121
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2135
|
+
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
2136
|
}
|
|
2123
2137
|
};
|
|
2124
2138
|
return r(this.vm);
|
|
@@ -2137,7 +2151,7 @@ function lr(t) {
|
|
|
2137
2151
|
makeVm(e) {
|
|
2138
2152
|
const r = e.vm;
|
|
2139
2153
|
if (r) {
|
|
2140
|
-
if (
|
|
2154
|
+
if (h.Function(r))
|
|
2141
2155
|
return R(() => e.vm(this.$handle.getInjectData(e)));
|
|
2142
2156
|
if (!r._isVue)
|
|
2143
2157
|
return new T(r);
|
|
@@ -2149,26 +2163,26 @@ function lr(t) {
|
|
|
2149
2163
|
r && (e.cacheConfig || (e.cacheConfig = r[e.originType] || r[e.type] || r[e.trueType] || {}), e.prop = U({}, [r["*"], e.cacheConfig, e.prop]));
|
|
2150
2164
|
},
|
|
2151
2165
|
setOptions(e) {
|
|
2152
|
-
e.prop.optionsTo && e.prop.options &&
|
|
2166
|
+
e.prop.optionsTo && e.prop.options && Z(e.prop, e.prop.optionsTo, e.prop.options);
|
|
2153
2167
|
},
|
|
2154
2168
|
deepSet(e) {
|
|
2155
2169
|
const r = e.rule.deep;
|
|
2156
2170
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2157
|
-
|
|
2171
|
+
Z(e.prop, i, r[i]);
|
|
2158
2172
|
});
|
|
2159
2173
|
},
|
|
2160
2174
|
setTempProps(e, r) {
|
|
2161
2175
|
if (!e.$props) return;
|
|
2162
2176
|
const { prop: i } = r, s = Object.keys(e.$props), n = this.injectProp(r), o = Object.keys(n);
|
|
2163
2177
|
s.forEach((u) => {
|
|
2164
|
-
|
|
2178
|
+
k(i.props, u) ? e.$props[u] = i.props[u] : o.indexOf(u) > -1 && (e.$props[u] = n[u]);
|
|
2165
2179
|
});
|
|
2166
2180
|
const a = e.$options.model && e.$options.model.prop || "value";
|
|
2167
2181
|
s.indexOf(a) > -1 && (e.$props[a] = i.value);
|
|
2168
2182
|
},
|
|
2169
2183
|
renderTemp(e) {
|
|
2170
2184
|
if (!T.compile)
|
|
2171
|
-
return
|
|
2185
|
+
return Gt("当前使用的Vue构建版本不支持compile,无法使用template功能"), [];
|
|
2172
2186
|
const r = e.prop, { id: i, key: s } = e;
|
|
2173
2187
|
if (!this.tempList[i]) {
|
|
2174
2188
|
e.el || (e.el = this.makeVm(r), this.vm.$nextTick(() => e.parser.mounted(e)));
|
|
@@ -2183,10 +2197,10 @@ function lr(t) {
|
|
|
2183
2197
|
const { vm: n, template: o } = this.tempList[i];
|
|
2184
2198
|
this.setTempProps(n, e);
|
|
2185
2199
|
const a = o.render.call(n);
|
|
2186
|
-
return
|
|
2200
|
+
return h.Undef(a.data) && (a.data = {}), a.key = s, a.data.ref = e.ref, a.data.key = s, a;
|
|
2187
2201
|
},
|
|
2188
2202
|
parseSide(e, r) {
|
|
2189
|
-
return
|
|
2203
|
+
return h.Object(e) ? U({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2190
2204
|
},
|
|
2191
2205
|
renderSides(e, r, i) {
|
|
2192
2206
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2204,7 +2218,7 @@ function lr(t) {
|
|
|
2204
2218
|
const i = e.rule;
|
|
2205
2219
|
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2206
2220
|
let s, n = i.cache !== !1;
|
|
2207
|
-
const o = e.trueType, a = !(
|
|
2221
|
+
const o = e.trueType, a = !(h.Undef(i.display) || i.display);
|
|
2208
2222
|
if (o === "template" && !i.template)
|
|
2209
2223
|
s = this.renderSides(this.renderChildren(e), e, !0), a && this.display(s), s = this.item(e, s);
|
|
2210
2224
|
else if (o === "fcFragment")
|
|
@@ -2212,7 +2226,7 @@ function lr(t) {
|
|
|
2212
2226
|
else {
|
|
2213
2227
|
e.initProp(), this.mergeGlobal(e), this.$manager.tidyRule(e), this.deepSet(e), this.setOptions(e), this.ctxProp(e);
|
|
2214
2228
|
let u = e.prop;
|
|
2215
|
-
u.preview = !!(
|
|
2229
|
+
u.preview = !!(k(u, "preview") ? u.preview : this.options.preview), u.props.formCreateInject = this.injectProp(e);
|
|
2216
2230
|
const l = u.preview;
|
|
2217
2231
|
if (u.hidden) {
|
|
2218
2232
|
this.setCache(e, void 0, r);
|
|
@@ -2221,19 +2235,19 @@ function lr(t) {
|
|
|
2221
2235
|
if (o === "template" && u.template)
|
|
2222
2236
|
s = this.renderTemp(e), n = !1;
|
|
2223
2237
|
else {
|
|
2224
|
-
let
|
|
2225
|
-
e.parser.renderChildren ?
|
|
2238
|
+
let c = [];
|
|
2239
|
+
e.parser.renderChildren ? c = e.parser.renderChildren(e) : e.parser.loadChildren !== !1 && (c = this.renderChildren(e));
|
|
2226
2240
|
const m = this.getTypeSlot(e);
|
|
2227
2241
|
m ? s = m({
|
|
2228
2242
|
rule: i,
|
|
2229
2243
|
prop: u,
|
|
2230
2244
|
preview: l,
|
|
2231
|
-
children:
|
|
2245
|
+
children: c,
|
|
2232
2246
|
api: this.$handle.api,
|
|
2233
2247
|
model: u.model || {}
|
|
2234
|
-
}) : s = l ? e.parser.preview(
|
|
2248
|
+
}) : s = l ? e.parser.preview(c, e) : e.parser.render(c, e);
|
|
2235
2249
|
}
|
|
2236
|
-
s = this.renderSides(s, e), !(!e.input &&
|
|
2250
|
+
s = this.renderSides(s, e), !(!e.input && h.Undef(u.native)) && u.native !== !0 && (s = this.$manager.makeWrap(e, s)), a && (s = this.display(s)), s = this.item(e, s);
|
|
2237
2251
|
}
|
|
2238
2252
|
return n && this.setCache(e, s, r), s;
|
|
2239
2253
|
}
|
|
@@ -2251,7 +2265,7 @@ function lr(t) {
|
|
|
2251
2265
|
},
|
|
2252
2266
|
none(e) {
|
|
2253
2267
|
if (e && e.data)
|
|
2254
|
-
return Array.isArray(e.data.style) ? e.data.style.push({ display: "none" }) :
|
|
2268
|
+
return Array.isArray(e.data.style) ? e.data.style.push({ display: "none" }) : h.String(e.data.style) ? e.data.style += ";display:none;" : e.data.style = [e.data.style, { display: "none" }], e;
|
|
2255
2269
|
},
|
|
2256
2270
|
item(e, r) {
|
|
2257
2271
|
return this.$h("fcFragment", {
|
|
@@ -2323,8 +2337,8 @@ function lr(t) {
|
|
|
2323
2337
|
this.$handle.onInput(e, r);
|
|
2324
2338
|
},
|
|
2325
2339
|
renderChildren(e) {
|
|
2326
|
-
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !
|
|
2327
|
-
return !
|
|
2340
|
+
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !h.String(n) && n.__fc__ && !this.$handle.ctxs[n.__fc__.id];
|
|
2341
|
+
return !h.trueArray(r) && i ? (this.$handle.deferSyncValue(() => {
|
|
2328
2342
|
i.forEach((n) => {
|
|
2329
2343
|
n && s(n) && this.$handle.rmCtx(n.__fc__);
|
|
2330
2344
|
});
|
|
@@ -2334,7 +2348,7 @@ function lr(t) {
|
|
|
2334
2348
|
});
|
|
2335
2349
|
}), r.map((n) => {
|
|
2336
2350
|
if (n) {
|
|
2337
|
-
if (
|
|
2351
|
+
if (h.String(n)) return n;
|
|
2338
2352
|
if (n.__fc__)
|
|
2339
2353
|
return this.renderCtx(n.__fc__, e);
|
|
2340
2354
|
n.type && this.vm.$nextTick(() => {
|
|
@@ -2345,11 +2359,11 @@ function lr(t) {
|
|
|
2345
2359
|
},
|
|
2346
2360
|
defaultRender(e, r) {
|
|
2347
2361
|
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(
|
|
2362
|
+
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(it(e.originType), i, r);
|
|
2349
2363
|
},
|
|
2350
2364
|
renderRule(e, r, i) {
|
|
2351
2365
|
if (!e) return;
|
|
2352
|
-
if (
|
|
2366
|
+
if (h.String(e)) return e;
|
|
2353
2367
|
let s;
|
|
2354
2368
|
if (i)
|
|
2355
2369
|
s = e.type;
|
|
@@ -2360,18 +2374,18 @@ function lr(t) {
|
|
|
2360
2374
|
}
|
|
2361
2375
|
if (!s) return;
|
|
2362
2376
|
let n = [[r]];
|
|
2363
|
-
return
|
|
2377
|
+
return h.trueArray(e.children) && n.push(e.children.map((o) => this.renderRule(o))), this.$h(s, y({}, e), n);
|
|
2364
2378
|
}
|
|
2365
2379
|
});
|
|
2366
2380
|
}
|
|
2367
|
-
function
|
|
2381
|
+
function be(t) {
|
|
2368
2382
|
p(this, {
|
|
2369
2383
|
$handle: t,
|
|
2370
2384
|
fc: t.fc,
|
|
2371
2385
|
vm: t.vm,
|
|
2372
2386
|
$manager: t.$manager,
|
|
2373
2387
|
vNode: new t.fc.CreateNode(t.vm)
|
|
2374
|
-
}),
|
|
2388
|
+
}), Ze(this, {
|
|
2375
2389
|
options() {
|
|
2376
2390
|
return t.options;
|
|
2377
2391
|
},
|
|
@@ -2380,9 +2394,9 @@ function ve(t) {
|
|
|
2380
2394
|
}
|
|
2381
2395
|
}), this.initCache(), this.initRender();
|
|
2382
2396
|
}
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
function
|
|
2397
|
+
ir(be);
|
|
2398
|
+
sr(be);
|
|
2399
|
+
function or(t) {
|
|
2386
2400
|
p(t.prototype, {
|
|
2387
2401
|
parseInjectEvent(e, r) {
|
|
2388
2402
|
const i = e.inject || this.options.injectEvent;
|
|
@@ -2395,11 +2409,11 @@ function ur(t) {
|
|
|
2395
2409
|
}), r;
|
|
2396
2410
|
},
|
|
2397
2411
|
parseEvent(e, r, i, s) {
|
|
2398
|
-
if (
|
|
2412
|
+
if (h.Function(r) && (i !== !1 && !h.Undef(i) || r.__inject))
|
|
2399
2413
|
return this.inject(e, r, i);
|
|
2400
|
-
if (!s && Array.isArray(r) && r[0] && (
|
|
2414
|
+
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2401
2415
|
return this.parseEventLst(e, r, i, !0);
|
|
2402
|
-
if (
|
|
2416
|
+
if (h.String(r)) {
|
|
2403
2417
|
const n = q(r);
|
|
2404
2418
|
if (n && r !== n)
|
|
2405
2419
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
@@ -2407,19 +2421,19 @@ function ur(t) {
|
|
|
2407
2421
|
},
|
|
2408
2422
|
parseEmit(e, r) {
|
|
2409
2423
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: u } = s, l = s[r ? "emit" : "nativeEmit"] || [];
|
|
2410
|
-
return
|
|
2411
|
-
if (!
|
|
2424
|
+
return h.trueArray(l) && l.forEach((c) => {
|
|
2425
|
+
if (!c) return;
|
|
2412
2426
|
let m, v = n || o || a;
|
|
2413
|
-
if (
|
|
2427
|
+
if (h.Object(c) && (m = c.inject, c = c.name, v = c.prefix || v), v) {
|
|
2414
2428
|
r || (v = `native-${v}`);
|
|
2415
|
-
const _ =
|
|
2416
|
-
this.vm.$emit(_, ...
|
|
2429
|
+
const _ = Q(`${v}-${c}`), g = (...O) => {
|
|
2430
|
+
this.vm.$emit(_, ...O), this.vm.$emit("emit-event", _, ...O);
|
|
2417
2431
|
};
|
|
2418
2432
|
if (g.__emit = !0, !m && u === !1)
|
|
2419
|
-
i[
|
|
2433
|
+
i[c] = g;
|
|
2420
2434
|
else {
|
|
2421
|
-
let
|
|
2422
|
-
i[
|
|
2435
|
+
let O = m || u || this.options.injectEvent;
|
|
2436
|
+
i[c] = h.Undef(O) ? g : this.inject(s, g, O);
|
|
2423
2437
|
}
|
|
2424
2438
|
}
|
|
2425
2439
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2449,14 +2463,14 @@ function ur(t) {
|
|
|
2449
2463
|
}
|
|
2450
2464
|
});
|
|
2451
2465
|
}
|
|
2452
|
-
const
|
|
2453
|
-
function
|
|
2466
|
+
const Te = ["hook:updated", "hook:mounted"];
|
|
2467
|
+
function ar(t) {
|
|
2454
2468
|
p(t.prototype, {
|
|
2455
2469
|
usePage() {
|
|
2456
2470
|
const e = this.options.page;
|
|
2457
2471
|
if (!e) return;
|
|
2458
|
-
let r = 25, i =
|
|
2459
|
-
|
|
2472
|
+
let r = 25, i = lr(this.rules);
|
|
2473
|
+
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), p(this, {
|
|
2460
2474
|
first: r,
|
|
2461
2475
|
limit: i,
|
|
2462
2476
|
pageEnd: this.rules.length <= r
|
|
@@ -2464,16 +2478,16 @@ function hr(t) {
|
|
|
2464
2478
|
},
|
|
2465
2479
|
pageLoad() {
|
|
2466
2480
|
const e = () => {
|
|
2467
|
-
this.pageEnd ? (this.vm.$off(
|
|
2481
|
+
this.pageEnd ? (this.vm.$off(Te, e), this.bus.$emit("page-end")) : (this.first += this.limit, this.pageEnd = this.rules.length <= this.first, this.loadRule(), this.refresh());
|
|
2468
2482
|
};
|
|
2469
|
-
this.vm.$on(
|
|
2483
|
+
this.vm.$on(Te, e);
|
|
2470
2484
|
}
|
|
2471
2485
|
});
|
|
2472
2486
|
}
|
|
2473
|
-
function
|
|
2487
|
+
function lr(t) {
|
|
2474
2488
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2475
2489
|
}
|
|
2476
|
-
function
|
|
2490
|
+
function ur(t) {
|
|
2477
2491
|
p(t.prototype, {
|
|
2478
2492
|
clearNextTick() {
|
|
2479
2493
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
@@ -2488,13 +2502,15 @@ function fr(t) {
|
|
|
2488
2502
|
}
|
|
2489
2503
|
});
|
|
2490
2504
|
}
|
|
2491
|
-
function
|
|
2505
|
+
function fr(t) {
|
|
2492
2506
|
Object.defineProperties(t.origin, {
|
|
2493
|
-
__fc__:
|
|
2507
|
+
__fc__: he(t, !0)
|
|
2508
|
+
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2509
|
+
__fc__: he(t, !0)
|
|
2494
2510
|
});
|
|
2495
2511
|
}
|
|
2496
|
-
function
|
|
2497
|
-
const i =
|
|
2512
|
+
function st(t, e, r) {
|
|
2513
|
+
const i = ee();
|
|
2498
2514
|
p(this, {
|
|
2499
2515
|
id: i,
|
|
2500
2516
|
ref: i,
|
|
@@ -2516,9 +2532,9 @@ function lt(t, e, r) {
|
|
|
2516
2532
|
exportEl: void 0,
|
|
2517
2533
|
defaultValue: e.field ? L(r) : void 0,
|
|
2518
2534
|
field: e.field || void 0
|
|
2519
|
-
}), this.updateKey(),
|
|
2535
|
+
}), this.updateKey(), fr(this), this.update(t, !0);
|
|
2520
2536
|
}
|
|
2521
|
-
p(
|
|
2537
|
+
p(st.prototype, {
|
|
2522
2538
|
effectData(t) {
|
|
2523
2539
|
return this.payload[t] || (this.payload[t] = {}), this.payload[t];
|
|
2524
2540
|
},
|
|
@@ -2526,7 +2542,7 @@ p(lt.prototype, {
|
|
|
2526
2542
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2527
2543
|
},
|
|
2528
2544
|
updateKey(t) {
|
|
2529
|
-
this.key =
|
|
2545
|
+
this.key = ee(), t && this.parent && this.parent.updateKey(t);
|
|
2530
2546
|
},
|
|
2531
2547
|
updateType() {
|
|
2532
2548
|
this.originType = this.rule.type, this.type = I(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
@@ -2540,7 +2556,7 @@ p(lt.prototype, {
|
|
|
2540
2556
|
},
|
|
2541
2557
|
injectValidate() {
|
|
2542
2558
|
return j(this.prop.validate).map((t) => {
|
|
2543
|
-
if (
|
|
2559
|
+
if (h.Function(t.validator)) {
|
|
2544
2560
|
const e = y({}, t), r = this;
|
|
2545
2561
|
return e.validator = function(...i) {
|
|
2546
2562
|
return t.validator.call({
|
|
@@ -2618,7 +2634,7 @@ p(lt.prototype, {
|
|
|
2618
2634
|
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2619
2635
|
}
|
|
2620
2636
|
});
|
|
2621
|
-
function
|
|
2637
|
+
function hr(t) {
|
|
2622
2638
|
p(t.prototype, {
|
|
2623
2639
|
nextRefresh(e) {
|
|
2624
2640
|
const r = this.loadedId;
|
|
@@ -2627,10 +2643,10 @@ function pr(t) {
|
|
|
2627
2643
|
});
|
|
2628
2644
|
},
|
|
2629
2645
|
parseRule(e) {
|
|
2630
|
-
const r =
|
|
2646
|
+
const r = Ie(e);
|
|
2631
2647
|
return Object.defineProperties(r, {
|
|
2632
|
-
__origin__:
|
|
2633
|
-
}),
|
|
2648
|
+
__origin__: he(e, !0)
|
|
2649
|
+
}), cr(r), this.appendValue(r), r.options = Array.isArray(r.options) ? r.options : [], [r, r.prefix, r.suffix].forEach((i) => {
|
|
2634
2650
|
i && this.loadFn(i, r);
|
|
2635
2651
|
}), this.loadCtrl(r), r.update && (r.update = q(r.update)), r;
|
|
2636
2652
|
},
|
|
@@ -2646,7 +2662,7 @@ function pr(t) {
|
|
|
2646
2662
|
},
|
|
2647
2663
|
syncProp(e) {
|
|
2648
2664
|
const r = e.rule;
|
|
2649
|
-
|
|
2665
|
+
h.trueArray(r.sync) && D([{
|
|
2650
2666
|
on: r.sync.reduce((i, s) => (i[`update:${s}`] = (n) => {
|
|
2651
2667
|
r.props[s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
2652
2668
|
}, i), {})
|
|
@@ -2672,43 +2688,43 @@ function pr(t) {
|
|
|
2672
2688
|
let a = this.sort.indexOf(o.__fc__.id);
|
|
2673
2689
|
return a > -1 ? a : i(n - 1);
|
|
2674
2690
|
}, s = (n, o) => {
|
|
2675
|
-
|
|
2691
|
+
h.trueArray(n) && this._loadRule(n, o);
|
|
2676
2692
|
};
|
|
2677
2693
|
e.map((n, o) => {
|
|
2678
|
-
if (r && !
|
|
2694
|
+
if (r && !h.Object(n) || !this.pageEnd && !r && o >= this.first) return;
|
|
2679
2695
|
if (n.__fc__ && n.__fc__.root === e && this.ctxs[n.__fc__.id])
|
|
2680
2696
|
return s(n.__fc__.rule.children, n.__fc__), n.__fc__;
|
|
2681
|
-
let a =
|
|
2697
|
+
let a = Ie(n);
|
|
2682
2698
|
const u = () => !!(a.field && this.fieldCtx[a.field] && this.fieldCtx[a.field][0] !== n.__fc__);
|
|
2683
2699
|
this.ruleEffect(a, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", n, this.api);
|
|
2684
|
-
let l,
|
|
2700
|
+
let l, c = !1, m = !!n.__fc__, v = a.value;
|
|
2685
2701
|
if (m) {
|
|
2686
2702
|
l = n.__fc__, v = l.defaultValue;
|
|
2687
2703
|
const g = !l.check(this);
|
|
2688
2704
|
if (l.deleted) {
|
|
2689
2705
|
if (g) {
|
|
2690
|
-
if (
|
|
2706
|
+
if (De(l))
|
|
2691
2707
|
return;
|
|
2692
2708
|
l.update(this);
|
|
2693
2709
|
}
|
|
2694
2710
|
} else if (g) {
|
|
2695
|
-
if (
|
|
2711
|
+
if (De(l))
|
|
2696
2712
|
return;
|
|
2697
|
-
e[o] = n = n._clone ? n._clone() :
|
|
2713
|
+
e[o] = n = n._clone ? n._clone() : $e(n), l = null, c = !0;
|
|
2698
2714
|
}
|
|
2699
2715
|
}
|
|
2700
2716
|
if (l)
|
|
2701
2717
|
l.originType !== l.rule.type && l.updateType(), this.bindParser(l), this.appendValue(l.rule);
|
|
2702
2718
|
else {
|
|
2703
2719
|
const g = this.parseRule(n);
|
|
2704
|
-
l = new
|
|
2720
|
+
l = new st(this, g, v), this.bindParser(l);
|
|
2705
2721
|
}
|
|
2706
|
-
if ([!1, !0].forEach((g) => this.parseEmit(l, g)), this.syncProp(l), l.parent = r || null, l.root = e, this.setCtx(l), !
|
|
2722
|
+
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
2723
|
const g = i(o);
|
|
2708
2724
|
g > -1 || !o ? this.sort.splice(g + 1, 0, l.id) : this.sort.push(l.id);
|
|
2709
2725
|
}
|
|
2710
2726
|
const _ = l.rule;
|
|
2711
|
-
return l.updated || (l.updated = !0,
|
|
2727
|
+
return l.updated || (l.updated = !0, h.Function(_.update) && this.bus.$once("load-end", () => {
|
|
2712
2728
|
this.refreshUpdate(l, _.value, "init");
|
|
2713
2729
|
}), this.effect(l, "loaded")), l.input && Object.defineProperty(_, "value", this.valueHandle(l)), this.refreshControl(l) && (this.cycleLoad = !0), l;
|
|
2714
2730
|
});
|
|
@@ -2717,52 +2733,52 @@ function pr(t) {
|
|
|
2717
2733
|
return e.input && e.rule.control && this.useCtrl(e);
|
|
2718
2734
|
},
|
|
2719
2735
|
useCtrl(e) {
|
|
2720
|
-
const r =
|
|
2736
|
+
const r = dr(e), i = [], s = this.api;
|
|
2721
2737
|
if (!r.length) return !1;
|
|
2722
2738
|
for (let a = 0; a < r.length; a++) {
|
|
2723
2739
|
const u = r[a], l = u.handle || function(m) {
|
|
2724
|
-
return (
|
|
2740
|
+
return (x[u.condition || "=="] || x["=="])(m, u.value);
|
|
2725
2741
|
};
|
|
2726
|
-
if (!
|
|
2727
|
-
const
|
|
2742
|
+
if (!h.trueArray(u.rule)) continue;
|
|
2743
|
+
const c = N(y({}, u), {
|
|
2728
2744
|
valid: R(() => l(e.rule.value, s)),
|
|
2729
|
-
ctrl:
|
|
2730
|
-
isHidden:
|
|
2745
|
+
ctrl: pr(e, u.rule),
|
|
2746
|
+
isHidden: h.String(u.rule[0])
|
|
2731
2747
|
});
|
|
2732
|
-
|
|
2748
|
+
c.valid && c.ctrl || !c.valid && !c.ctrl && !c.isHidden || i.push(c);
|
|
2733
2749
|
}
|
|
2734
2750
|
if (!i.length) return !1;
|
|
2735
2751
|
const n = [];
|
|
2736
2752
|
let o = !1;
|
|
2737
2753
|
return this.deferSyncValue(() => {
|
|
2738
|
-
i.reverse().forEach(({ isHidden: a, valid: u, rule: l, prepend:
|
|
2754
|
+
i.reverse().forEach(({ isHidden: a, valid: u, rule: l, prepend: c, append: m, child: v, ctrl: _, method: g }) => {
|
|
2739
2755
|
if (a) {
|
|
2740
2756
|
u ? e.ctrlRule.push({
|
|
2741
2757
|
__ctrl: !0,
|
|
2742
2758
|
children: l,
|
|
2743
2759
|
valid: u
|
|
2744
2760
|
}) : _ && e.ctrlRule.splice(e.ctrlRule.indexOf(_) >>> 0, 1), n[u ? "push" : "unshift"](() => {
|
|
2745
|
-
g === "disabled" || g === "enabled" ? this.api.disabled(!u, l) : g === "display" ? this.api.display(u, l) : g === "required" ? (l.forEach((
|
|
2746
|
-
this.api.setEffect(
|
|
2761
|
+
g === "disabled" || g === "enabled" ? this.api.disabled(!u, l) : g === "display" ? this.api.display(u, l) : g === "required" ? (l.forEach((O) => {
|
|
2762
|
+
this.api.setEffect(O, "required", u);
|
|
2747
2763
|
}), u || this.api.clearValidateState(l)) : this.api.hidden(!u, l);
|
|
2748
2764
|
});
|
|
2749
2765
|
return;
|
|
2750
2766
|
}
|
|
2751
2767
|
if (u) {
|
|
2752
2768
|
o = !0;
|
|
2753
|
-
const
|
|
2769
|
+
const O = {
|
|
2754
2770
|
type: "fcFragment",
|
|
2755
2771
|
native: !0,
|
|
2756
2772
|
__ctrl: !0,
|
|
2757
2773
|
children: l
|
|
2758
2774
|
};
|
|
2759
|
-
e.ctrlRule.push(
|
|
2760
|
-
|
|
2775
|
+
e.ctrlRule.push(O), this.bus.$once("load-start", () => {
|
|
2776
|
+
c ? s.prepend(O, c, v) : m || v ? s.append(O, m || e.id, v) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, O);
|
|
2761
2777
|
});
|
|
2762
2778
|
} else {
|
|
2763
2779
|
e.ctrlRule.splice(e.ctrlRule.indexOf(_), 1);
|
|
2764
|
-
const
|
|
2765
|
-
|
|
2780
|
+
const O = z(_);
|
|
2781
|
+
O && O.rm();
|
|
2766
2782
|
}
|
|
2767
2783
|
});
|
|
2768
2784
|
}), n.length && this.vm.$nextTick(() => {
|
|
@@ -2779,7 +2795,7 @@ function pr(t) {
|
|
|
2779
2795
|
this.bus.$once("load-end", () => {
|
|
2780
2796
|
Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
|
|
2781
2797
|
}), this.reloading = !0, this.loadRule(), this.reloading = !1, this.refresh(), this.vm.$emit("reloading", this.api);
|
|
2782
|
-
}), this.
|
|
2798
|
+
}), this.vm.$emit("update", this.api);
|
|
2783
2799
|
},
|
|
2784
2800
|
//todo 组件生成全部通过 alias
|
|
2785
2801
|
refresh() {
|
|
@@ -2787,30 +2803,30 @@ function pr(t) {
|
|
|
2787
2803
|
}
|
|
2788
2804
|
});
|
|
2789
2805
|
}
|
|
2790
|
-
function
|
|
2791
|
-
const e =
|
|
2806
|
+
function cr(t) {
|
|
2807
|
+
const e = Ye();
|
|
2792
2808
|
return Object.keys(e).forEach((r) => {
|
|
2793
|
-
|
|
2809
|
+
k(t, r) || w(t, r, e[r]);
|
|
2794
2810
|
}), t;
|
|
2795
2811
|
}
|
|
2796
|
-
function
|
|
2812
|
+
function dr(t) {
|
|
2797
2813
|
const e = t.rule.control || [];
|
|
2798
|
-
return
|
|
2814
|
+
return h.Object(e) ? [e] : e;
|
|
2799
2815
|
}
|
|
2800
|
-
function
|
|
2816
|
+
function pr(t, e) {
|
|
2801
2817
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
2802
2818
|
const i = t.ctrlRule[r];
|
|
2803
2819
|
if (i.children === e)
|
|
2804
2820
|
return i;
|
|
2805
2821
|
}
|
|
2806
2822
|
}
|
|
2807
|
-
function
|
|
2823
|
+
function De(t) {
|
|
2808
2824
|
return !!t.rule.__ctrl;
|
|
2809
2825
|
}
|
|
2810
|
-
function
|
|
2826
|
+
function mr(t) {
|
|
2811
2827
|
p(t.prototype, {
|
|
2812
2828
|
getValue(e) {
|
|
2813
|
-
return
|
|
2829
|
+
return h.Undef(e.cacheValue) && (e.cacheValue = e.parser.toValue(this.getFormData(e), e)), e.cacheValue;
|
|
2814
2830
|
},
|
|
2815
2831
|
setValue(e, r, i, s) {
|
|
2816
2832
|
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, {
|
|
@@ -2830,14 +2846,14 @@ function $r(t) {
|
|
|
2830
2846
|
return this.formData[e.id];
|
|
2831
2847
|
},
|
|
2832
2848
|
validate() {
|
|
2833
|
-
return
|
|
2849
|
+
return Le(this.vm.validate), this.fields().forEach((e) => {
|
|
2834
2850
|
this.fieldCtx[e].forEach((r) => {
|
|
2835
2851
|
this.vm.validate[r.id] = j(r.rule.validate);
|
|
2836
2852
|
});
|
|
2837
2853
|
}), this.vm.validate;
|
|
2838
2854
|
},
|
|
2839
2855
|
syncForm() {
|
|
2840
|
-
|
|
2856
|
+
Le(this.form), Object.defineProperties(this.form, this.fields().reduce((e, r) => {
|
|
2841
2857
|
const i = this.getFieldCtx(r), s = this.valueHandle(i);
|
|
2842
2858
|
return s.configurable = !0, e[r] = s, e;
|
|
2843
2859
|
}, this.options.appendValue !== !1 ? Object.keys(this.appendData).reduce((e, r) => (e[r] = {
|
|
@@ -2859,7 +2875,7 @@ function $r(t) {
|
|
|
2859
2875
|
};
|
|
2860
2876
|
},
|
|
2861
2877
|
appendValue(e) {
|
|
2862
|
-
!e.field || !
|
|
2878
|
+
!e.field || !k(this.appendData, e.field) || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
2863
2879
|
},
|
|
2864
2880
|
addSubForm(e, r) {
|
|
2865
2881
|
this.subForm[e.id] = r;
|
|
@@ -2873,13 +2889,13 @@ function $r(t) {
|
|
|
2873
2889
|
this.vm._updateValue(y(y({}, this.options.appendValue !== !1 ? this.appendData : {}), this.form));
|
|
2874
2890
|
},
|
|
2875
2891
|
isChange(e, r) {
|
|
2876
|
-
return JSON.stringify(e.rule.value,
|
|
2892
|
+
return JSON.stringify(e.rule.value, Be) !== JSON.stringify(r === null ? void 0 : r, Be);
|
|
2877
2893
|
},
|
|
2878
2894
|
isQuote(e, r) {
|
|
2879
|
-
return (
|
|
2895
|
+
return (h.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
2880
2896
|
},
|
|
2881
2897
|
refreshUpdate(e, r, i, s) {
|
|
2882
|
-
if (
|
|
2898
|
+
if (h.Function(e.rule.update)) {
|
|
2883
2899
|
const n = R(() => e.rule.update(r, e.origin, this.api, {
|
|
2884
2900
|
origin: i || "change",
|
|
2885
2901
|
linkField: s
|
|
@@ -2896,7 +2912,7 @@ function $r(t) {
|
|
|
2896
2912
|
},
|
|
2897
2913
|
appendLink(e) {
|
|
2898
2914
|
const r = e.rule.link;
|
|
2899
|
-
|
|
2915
|
+
h.trueArray(r) && r.forEach((i) => {
|
|
2900
2916
|
const s = () => this.refreshRule(e, e.rule.value, "link", i);
|
|
2901
2917
|
this.bus.$on("change-" + i, s), e.linkOn.push(() => this.bus.$off("change-" + i, s));
|
|
2902
2918
|
});
|
|
@@ -2906,10 +2922,10 @@ function $r(t) {
|
|
|
2906
2922
|
}
|
|
2907
2923
|
});
|
|
2908
2924
|
}
|
|
2909
|
-
function
|
|
2925
|
+
function Be(t, e) {
|
|
2910
2926
|
return typeof e == "function" ? "" + e : e;
|
|
2911
2927
|
}
|
|
2912
|
-
function
|
|
2928
|
+
function Le(t) {
|
|
2913
2929
|
Object.keys(t).forEach((e) => delete t[e]);
|
|
2914
2930
|
}
|
|
2915
2931
|
const ce = {
|
|
@@ -2931,8 +2947,8 @@ const ce = {
|
|
|
2931
2947
|
},
|
|
2932
2948
|
mergeProp(t) {
|
|
2933
2949
|
}
|
|
2934
|
-
},
|
|
2935
|
-
function
|
|
2950
|
+
}, yr = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "component", "cache"];
|
|
2951
|
+
function gr(t) {
|
|
2936
2952
|
p(t.prototype, {
|
|
2937
2953
|
getCtx(e) {
|
|
2938
2954
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
@@ -2976,7 +2992,7 @@ function br(t) {
|
|
|
2976
2992
|
},
|
|
2977
2993
|
watchCtx(e) {
|
|
2978
2994
|
const r = this.vm;
|
|
2979
|
-
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" &&
|
|
2995
|
+
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" && yr.indexOf(i) === -1).forEach((i) => {
|
|
2980
2996
|
const s = i === "children";
|
|
2981
2997
|
e.watch.push(r.$watch(() => e.rule[i], (n, o) => {
|
|
2982
2998
|
if (!(this.loading || this.noWatchFn || this.reloading)) {
|
|
@@ -2996,7 +3012,7 @@ function br(t) {
|
|
|
2996
3012
|
else if (i === "type")
|
|
2997
3013
|
e.updateType(), this.bindParser(e);
|
|
2998
3014
|
else if (i === "children") {
|
|
2999
|
-
const a =
|
|
3015
|
+
const a = h.trueArray(n);
|
|
3000
3016
|
this.deferSyncValue(() => {
|
|
3001
3017
|
n !== o && (this.rmSub(o, e), this.$render.initOrgChildren()), a && this.loadChildren(n, e), this.vm.$emit("update", this.api);
|
|
3002
3018
|
});
|
|
@@ -3007,7 +3023,7 @@ function br(t) {
|
|
|
3007
3023
|
}), this.watchEffect(e);
|
|
3008
3024
|
},
|
|
3009
3025
|
rmSub(e, r) {
|
|
3010
|
-
|
|
3026
|
+
h.trueArray(e) && e.forEach((i) => {
|
|
3011
3027
|
i && i.__fc__ && i.__fc__.parent === r && this.rmCtx(i.__fc__);
|
|
3012
3028
|
});
|
|
3013
3029
|
},
|
|
@@ -3017,15 +3033,15 @@ function br(t) {
|
|
|
3017
3033
|
e.input && Object.defineProperty(e.rule, "value", {
|
|
3018
3034
|
value: e.rule.value,
|
|
3019
3035
|
writable: !0
|
|
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 && !
|
|
3021
|
-
this.reloading || (e.parser.loadChildren !== !1 &&
|
|
3036
|
+
}), 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 && !k(this.fieldCtx, i) && B(this.form, i), this.deferSyncValue(() => {
|
|
3037
|
+
this.reloading || (e.parser.loadChildren !== !1 && h.trueArray(e.rule.children) && e.rule.children.forEach((a) => a.__fc__ && this.rmCtx(a.__fc__)), e.root === this.rules && this.vm._renderRule());
|
|
3022
3038
|
}, s);
|
|
3023
3039
|
const o = this.sort.indexOf(r);
|
|
3024
3040
|
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
3041
|
}
|
|
3026
3042
|
});
|
|
3027
3043
|
}
|
|
3028
|
-
function
|
|
3044
|
+
function $r(t) {
|
|
3029
3045
|
p(t.prototype, {
|
|
3030
3046
|
mounted() {
|
|
3031
3047
|
const e = () => {
|
|
@@ -3036,23 +3052,26 @@ function Cr(t) {
|
|
|
3036
3052
|
lifecycle(e) {
|
|
3037
3053
|
this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3038
3054
|
},
|
|
3055
|
+
targetReload() {
|
|
3056
|
+
this.bus.$off("next-tick", this.nextReload), this.bus.$once("next-tick", this.nextReload);
|
|
3057
|
+
},
|
|
3039
3058
|
emitEvent(e, ...r) {
|
|
3040
3059
|
const i = this.options[e] || this.options[I("on-" + e)];
|
|
3041
3060
|
if (i) {
|
|
3042
3061
|
const s = q(i);
|
|
3043
|
-
|
|
3062
|
+
h.Function(s) && R(() => s(...r));
|
|
3044
3063
|
}
|
|
3045
3064
|
this.bus.$emit(e, ...r);
|
|
3046
3065
|
}
|
|
3047
3066
|
});
|
|
3048
3067
|
}
|
|
3049
|
-
function
|
|
3068
|
+
function vr(t) {
|
|
3050
3069
|
p(t.prototype, {
|
|
3051
3070
|
useProvider() {
|
|
3052
3071
|
const e = this.fc.providers;
|
|
3053
3072
|
Object.keys(e).forEach((r) => {
|
|
3054
3073
|
let i = e[r];
|
|
3055
|
-
|
|
3074
|
+
h.Function(i) && (i = i(this.fc)), i._c = Cr(i), this.onEffect(i), this.providers[r] = i;
|
|
3056
3075
|
});
|
|
3057
3076
|
},
|
|
3058
3077
|
onEffect(e) {
|
|
@@ -3069,7 +3088,7 @@ function _r(t) {
|
|
|
3069
3088
|
let i = {
|
|
3070
3089
|
required: () => {
|
|
3071
3090
|
var s, n;
|
|
3072
|
-
return (
|
|
3091
|
+
return (k(e.rule, "$required") ? e.rule.$required : (n = (s = e.rule) == null ? void 0 : s.effect) == null ? void 0 : n.required) || !1;
|
|
3073
3092
|
}
|
|
3074
3093
|
};
|
|
3075
3094
|
Object.keys(e.rule.effect || {}).forEach((s) => {
|
|
@@ -3099,41 +3118,41 @@ function _r(t) {
|
|
|
3099
3118
|
}, r);
|
|
3100
3119
|
},
|
|
3101
3120
|
getEffect(e, r) {
|
|
3102
|
-
if (
|
|
3121
|
+
if (k(e, "$" + r))
|
|
3103
3122
|
return e["$" + r];
|
|
3104
|
-
if (
|
|
3123
|
+
if (k(e, "effect") && k(e.effect, r))
|
|
3105
3124
|
return e.effect[r];
|
|
3106
3125
|
},
|
|
3107
3126
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3108
3127
|
if (!s || s === "fcFragment") return;
|
|
3109
|
-
const u = n || Object.keys(r).reduce((l,
|
|
3128
|
+
const u = n || Object.keys(r).reduce((l, c) => (c[0] === "$" && (l[c.substr(1)] = r[c]), l), y({}, r.effect || {}));
|
|
3110
3129
|
Object.keys(u).forEach((l) => {
|
|
3111
|
-
const
|
|
3112
|
-
if (!
|
|
3130
|
+
const c = this.providers[l];
|
|
3131
|
+
if (!c || c.input && !i) return;
|
|
3113
3132
|
let m;
|
|
3114
|
-
if (!
|
|
3133
|
+
if (!c._c)
|
|
3115
3134
|
m = "*";
|
|
3116
|
-
else if (
|
|
3135
|
+
else if (c._used.indexOf(s) > -1)
|
|
3117
3136
|
m = s;
|
|
3118
3137
|
else
|
|
3119
3138
|
return;
|
|
3120
3139
|
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}:${
|
|
3140
|
+
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
3141
|
});
|
|
3123
3142
|
}
|
|
3124
3143
|
});
|
|
3125
3144
|
}
|
|
3126
|
-
function
|
|
3145
|
+
function br(t) {
|
|
3127
3146
|
return t.filter(function(e, r, i) {
|
|
3128
3147
|
return i.indexOf(e, 0) === r;
|
|
3129
3148
|
});
|
|
3130
3149
|
}
|
|
3131
|
-
function
|
|
3150
|
+
function Cr(t) {
|
|
3132
3151
|
const e = t.components;
|
|
3133
3152
|
if (Array.isArray(e)) {
|
|
3134
|
-
const r =
|
|
3153
|
+
const r = br(e.filter((i) => i !== "*"));
|
|
3135
3154
|
return r.length ? r : !1;
|
|
3136
|
-
} else return
|
|
3155
|
+
} else return h.String(e) ? [e] : !1;
|
|
3137
3156
|
}
|
|
3138
3157
|
function V(t) {
|
|
3139
3158
|
p(this, {
|
|
@@ -3158,14 +3177,14 @@ function V(t) {
|
|
|
3158
3177
|
nextReload: () => {
|
|
3159
3178
|
this.lifecycle("reload");
|
|
3160
3179
|
}
|
|
3161
|
-
}),
|
|
3180
|
+
}), Ze(this, {
|
|
3162
3181
|
options() {
|
|
3163
3182
|
return t.options;
|
|
3164
3183
|
},
|
|
3165
3184
|
bus() {
|
|
3166
3185
|
return t.bus;
|
|
3167
3186
|
}
|
|
3168
|
-
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new
|
|
3187
|
+
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new be(this), this.api = t.extendApi(rr(this), this);
|
|
3169
3188
|
}
|
|
3170
3189
|
p(V.prototype, {
|
|
3171
3190
|
initData(t) {
|
|
@@ -3183,30 +3202,30 @@ p(V.prototype, {
|
|
|
3183
3202
|
beforeFetch(t) {
|
|
3184
3203
|
return new Promise((e) => {
|
|
3185
3204
|
const r = this.options.beforeFetch && R(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3186
|
-
r &&
|
|
3205
|
+
r && h.Function(r.then) ? r.then(e) : e();
|
|
3187
3206
|
});
|
|
3188
3207
|
}
|
|
3189
3208
|
});
|
|
3209
|
+
or(V);
|
|
3210
|
+
ar(V);
|
|
3190
3211
|
ur(V);
|
|
3191
3212
|
hr(V);
|
|
3192
|
-
|
|
3193
|
-
|
|
3213
|
+
mr(V);
|
|
3214
|
+
gr(V);
|
|
3194
3215
|
$r(V);
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
_r
|
|
3198
|
-
const wr = "fcFragment", re = {
|
|
3199
|
-
name: wr,
|
|
3216
|
+
vr(V);
|
|
3217
|
+
const _r = "fcFragment", re = {
|
|
3218
|
+
name: _r,
|
|
3200
3219
|
functional: !0,
|
|
3201
3220
|
props: ["vnode"],
|
|
3202
3221
|
render(t, e) {
|
|
3203
3222
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3204
3223
|
}
|
|
3205
3224
|
};
|
|
3206
|
-
function
|
|
3207
|
-
return
|
|
3225
|
+
function Or(t) {
|
|
3226
|
+
return h.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3208
3227
|
}
|
|
3209
|
-
function
|
|
3228
|
+
function kr() {
|
|
3210
3229
|
const t = {};
|
|
3211
3230
|
function e(r) {
|
|
3212
3231
|
r && this.setVm(r);
|
|
@@ -3219,7 +3238,7 @@ function Er() {
|
|
|
3219
3238
|
return T.config.isReservedTag(r) && i.nativeOn && delete i.nativeOn, this.makeComponent(r, i, s);
|
|
3220
3239
|
},
|
|
3221
3240
|
makeComponent(r, i, s) {
|
|
3222
|
-
let n = this.$h(r,
|
|
3241
|
+
let n = this.$h(r, Or(i), s || []);
|
|
3223
3242
|
return n.context = this.vm, n;
|
|
3224
3243
|
},
|
|
3225
3244
|
aliasMap: t
|
|
@@ -3230,7 +3249,7 @@ function Er() {
|
|
|
3230
3249
|
},
|
|
3231
3250
|
use(r) {
|
|
3232
3251
|
Object.keys(r).forEach((i) => {
|
|
3233
|
-
const s =
|
|
3252
|
+
const s = Q(i), n = nt(i).toLocaleLowerCase(), o = r[i];
|
|
3234
3253
|
[i, s, n].forEach((a) => {
|
|
3235
3254
|
e.alias(i, o), e.prototype[a] = function(u, l) {
|
|
3236
3255
|
return this.make(o, u, l);
|
|
@@ -3240,12 +3259,12 @@ function Er() {
|
|
|
3240
3259
|
}
|
|
3241
3260
|
}), e;
|
|
3242
3261
|
}
|
|
3243
|
-
function
|
|
3244
|
-
class e extends
|
|
3262
|
+
function wr(t) {
|
|
3263
|
+
class e extends ot {
|
|
3245
3264
|
}
|
|
3246
3265
|
return Object.assign(e.prototype, t), e;
|
|
3247
3266
|
}
|
|
3248
|
-
function
|
|
3267
|
+
function ot(t) {
|
|
3249
3268
|
p(this, {
|
|
3250
3269
|
$handle: t,
|
|
3251
3270
|
vm: t.vm,
|
|
@@ -3256,12 +3275,12 @@ function ut(t) {
|
|
|
3256
3275
|
}
|
|
3257
3276
|
}), this.updateKey(), this.init();
|
|
3258
3277
|
}
|
|
3259
|
-
p(
|
|
3278
|
+
p(ot.prototype, {
|
|
3260
3279
|
__init() {
|
|
3261
3280
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3262
3281
|
},
|
|
3263
3282
|
updateKey() {
|
|
3264
|
-
this.key =
|
|
3283
|
+
this.key = ee();
|
|
3265
3284
|
},
|
|
3266
3285
|
//TODO interface
|
|
3267
3286
|
init() {
|
|
@@ -3301,7 +3320,7 @@ p(ut.prototype, {
|
|
|
3301
3320
|
render(t) {
|
|
3302
3321
|
}
|
|
3303
3322
|
});
|
|
3304
|
-
const
|
|
3323
|
+
const Fr = function(t) {
|
|
3305
3324
|
const e = {
|
|
3306
3325
|
name: "loadData",
|
|
3307
3326
|
_fn: [],
|
|
@@ -3314,7 +3333,7 @@ const Rr = function(t) {
|
|
|
3314
3333
|
const u = () => {
|
|
3315
3334
|
a.watch !== !1 && (t.bus.$off("p.loadData." + a.attr, u), t.bus.$once("p.loadData." + a.attr, u));
|
|
3316
3335
|
let l;
|
|
3317
|
-
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l = L(l))),
|
|
3336
|
+
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
3337
|
};
|
|
3319
3338
|
o.push(() => t.bus.$off("p.loadData." + a.attr, u)), u();
|
|
3320
3339
|
}
|
|
@@ -3327,13 +3346,13 @@ const Rr = function(t) {
|
|
|
3327
3346
|
}
|
|
3328
3347
|
};
|
|
3329
3348
|
return e.watch = e.created, e;
|
|
3330
|
-
},
|
|
3349
|
+
}, at = {
|
|
3331
3350
|
name: "componentValidate",
|
|
3332
3351
|
load(t, e, r) {
|
|
3333
3352
|
const i = t.getValue();
|
|
3334
3353
|
i ? t.getProp().validate = [{
|
|
3335
3354
|
validator(...s) {
|
|
3336
|
-
const n =
|
|
3355
|
+
const n = z(e);
|
|
3337
3356
|
if (n)
|
|
3338
3357
|
return r.exec(n.id, i === !0 ? "formCreateValidate" : i, ...s, {
|
|
3339
3358
|
attr: t,
|
|
@@ -3344,11 +3363,11 @@ const Rr = function(t) {
|
|
|
3344
3363
|
}] : (t.clearProp(), r.clearValidateState([e.field]));
|
|
3345
3364
|
},
|
|
3346
3365
|
watch(...t) {
|
|
3347
|
-
|
|
3366
|
+
at.load(...t);
|
|
3348
3367
|
}
|
|
3349
|
-
},
|
|
3368
|
+
}, Er = function(t) {
|
|
3350
3369
|
function e(i) {
|
|
3351
|
-
return
|
|
3370
|
+
return h.String(i) && (i = {
|
|
3352
3371
|
action: i,
|
|
3353
3372
|
to: "options"
|
|
3354
3373
|
}), i;
|
|
@@ -3356,9 +3375,9 @@ const Rr = function(t) {
|
|
|
3356
3375
|
function r(i, s, n) {
|
|
3357
3376
|
let o = i.value;
|
|
3358
3377
|
const a = (m) => {
|
|
3359
|
-
m === void 0 ? (i.clearProp(), n.sync(s)) :
|
|
3378
|
+
m === void 0 ? (i.clearProp(), n.sync(s)) : Z(i.getProp(), o.to || "options", m);
|
|
3360
3379
|
};
|
|
3361
|
-
if (
|
|
3380
|
+
if (h.Function(o) && (o = o(s, n)), o = e(o), !o || !o.action) {
|
|
3362
3381
|
a(void 0);
|
|
3363
3382
|
return;
|
|
3364
3383
|
}
|
|
@@ -3366,30 +3385,30 @@ const Rr = function(t) {
|
|
|
3366
3385
|
const u = o.onError, l = () => {
|
|
3367
3386
|
if (!i.getValue())
|
|
3368
3387
|
return i.clearProp(), n.sync(s), !0;
|
|
3369
|
-
},
|
|
3388
|
+
}, c = N(y({
|
|
3370
3389
|
headers: {}
|
|
3371
3390
|
}, o), {
|
|
3372
3391
|
onSuccess(m, v) {
|
|
3373
3392
|
if (l()) return;
|
|
3374
|
-
let _ = (g) => v ? g :
|
|
3375
|
-
|
|
3376
|
-
g && (g = g[
|
|
3393
|
+
let _ = (g) => v ? g : k(g, "data") ? g.data : g;
|
|
3394
|
+
h.Function(o.parse) ? _ = o.parse : o.parse && h.String(o.parse) && (_ = (g) => (o.parse.split(".").forEach((O) => {
|
|
3395
|
+
g && (g = g[O]);
|
|
3377
3396
|
}), g)), a(_(m, s, n)), n.sync(s);
|
|
3378
3397
|
},
|
|
3379
3398
|
onError(m) {
|
|
3380
|
-
a(void 0), !l() && (u || ((v) =>
|
|
3399
|
+
a(void 0), !l() && (u || ((v) => ge(v.message || "fetch fail " + o.action)))(m, s, n);
|
|
3381
3400
|
}
|
|
3382
3401
|
});
|
|
3383
|
-
t.$handle.beforeFetch(
|
|
3384
|
-
if (
|
|
3402
|
+
t.$handle.beforeFetch(c, { rule: s, api: n }).then(() => {
|
|
3403
|
+
if (h.Function(o.action)) {
|
|
3385
3404
|
o.action(s, n).then((m) => {
|
|
3386
|
-
|
|
3405
|
+
c.onSuccess(m, !0);
|
|
3387
3406
|
}).catch((m) => {
|
|
3388
|
-
|
|
3407
|
+
c.onError(m);
|
|
3389
3408
|
});
|
|
3390
3409
|
return;
|
|
3391
3410
|
}
|
|
3392
|
-
R(() => t.create.fetch(
|
|
3411
|
+
R(() => t.create.fetch(c, { inject: i, rule: s, api: n }));
|
|
3393
3412
|
});
|
|
3394
3413
|
}
|
|
3395
3414
|
return {
|
|
@@ -3401,17 +3420,17 @@ const Rr = function(t) {
|
|
|
3401
3420
|
r(...i);
|
|
3402
3421
|
}
|
|
3403
3422
|
};
|
|
3404
|
-
},
|
|
3423
|
+
}, lt = {
|
|
3405
3424
|
name: "required",
|
|
3406
3425
|
load(t, e, r) {
|
|
3407
|
-
const i =
|
|
3426
|
+
const i = Sr(t.getValue());
|
|
3408
3427
|
if (i.required === !1)
|
|
3409
3428
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
3410
3429
|
else {
|
|
3411
3430
|
const s = y({
|
|
3412
3431
|
required: !0,
|
|
3413
3432
|
validator(n, o, a) {
|
|
3414
|
-
|
|
3433
|
+
h.empty(o) ? a(s.message) : a();
|
|
3415
3434
|
}
|
|
3416
3435
|
}, i);
|
|
3417
3436
|
if (!s.message) {
|
|
@@ -3423,38 +3442,38 @@ const Rr = function(t) {
|
|
|
3423
3442
|
r.sync(e);
|
|
3424
3443
|
},
|
|
3425
3444
|
watch(...t) {
|
|
3426
|
-
|
|
3445
|
+
lt.load(...t);
|
|
3427
3446
|
}
|
|
3428
3447
|
};
|
|
3429
|
-
function
|
|
3430
|
-
return
|
|
3448
|
+
function Sr(t) {
|
|
3449
|
+
return h.Boolean(t) ? { required: t } : h.String(t) ? { message: t } : h.Undef(t) ? { required: !1 } : h.Function(t) ? { validator: t } : h.Object(t) ? t : {};
|
|
3431
3450
|
}
|
|
3432
|
-
const
|
|
3433
|
-
fetch:
|
|
3434
|
-
loadData:
|
|
3435
|
-
required:
|
|
3436
|
-
componentValidate:
|
|
3437
|
-
},
|
|
3438
|
-
name:
|
|
3451
|
+
const Rr = {
|
|
3452
|
+
fetch: Er,
|
|
3453
|
+
loadData: Fr,
|
|
3454
|
+
required: lt,
|
|
3455
|
+
componentValidate: at
|
|
3456
|
+
}, jr = "html", Ir = {
|
|
3457
|
+
name: jr,
|
|
3439
3458
|
loadChildren: !1,
|
|
3440
3459
|
render(t, e) {
|
|
3441
3460
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
3442
3461
|
},
|
|
3443
3462
|
renderChildren(t) {
|
|
3444
|
-
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) =>
|
|
3463
|
+
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) => h.String(e)).join("") : "";
|
|
3445
3464
|
}
|
|
3446
3465
|
};
|
|
3447
|
-
function
|
|
3466
|
+
function Ar(t, e) {
|
|
3448
3467
|
let r;
|
|
3449
3468
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
3450
3469
|
}
|
|
3451
3470
|
function ie() {
|
|
3452
|
-
return
|
|
3471
|
+
return Ar("name", ...arguments);
|
|
3453
3472
|
}
|
|
3454
|
-
function
|
|
3455
|
-
return !t || !t.el ? window.document.body :
|
|
3473
|
+
function Me(t) {
|
|
3474
|
+
return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
3456
3475
|
}
|
|
3457
|
-
function
|
|
3476
|
+
function Ne(t, e) {
|
|
3458
3477
|
const r = new T({
|
|
3459
3478
|
data() {
|
|
3460
3479
|
return { rule: t, option: e || {} };
|
|
@@ -3465,116 +3484,116 @@ function Ue(t, e) {
|
|
|
3465
3484
|
});
|
|
3466
3485
|
return r.$mount(), r;
|
|
3467
3486
|
}
|
|
3468
|
-
function
|
|
3487
|
+
function Vr(t) {
|
|
3469
3488
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
3470
|
-
|
|
3489
|
+
Xe.push(...e), pe.push(...r), me.push(...i), et([...e, ...r, ...i]);
|
|
3471
3490
|
}
|
|
3472
|
-
let
|
|
3491
|
+
let Pr = 1;
|
|
3473
3492
|
const S = {};
|
|
3474
|
-
function
|
|
3493
|
+
function ut(t) {
|
|
3475
3494
|
const e = {
|
|
3476
3495
|
[re.name]: re
|
|
3477
|
-
}, r = {}, i = {}, s = y({},
|
|
3496
|
+
}, r = {}, i = {}, s = y({}, Rr), n = Yt();
|
|
3478
3497
|
let o = { global: {} };
|
|
3479
|
-
const a = {}, u =
|
|
3480
|
-
|
|
3481
|
-
function f
|
|
3482
|
-
const d = S[
|
|
3498
|
+
const a = {}, u = kr(), l = {};
|
|
3499
|
+
Vr(t.attrs || {});
|
|
3500
|
+
function c(f) {
|
|
3501
|
+
const d = S[f];
|
|
3483
3502
|
if (Array.isArray(d))
|
|
3484
3503
|
return d.map(($) => $.api());
|
|
3485
3504
|
if (d)
|
|
3486
3505
|
return d.api();
|
|
3487
3506
|
}
|
|
3488
3507
|
function m() {
|
|
3489
|
-
const
|
|
3490
|
-
|
|
3508
|
+
const f = ie(...arguments);
|
|
3509
|
+
f.id && f.prop && (i[f.id] = f.prop);
|
|
3491
3510
|
}
|
|
3492
3511
|
function v() {
|
|
3493
|
-
const
|
|
3494
|
-
|
|
3512
|
+
const f = ie(...arguments);
|
|
3513
|
+
f.id && f.prop && (s[f.id] = N(y({}, f.prop), { name: f.id }));
|
|
3495
3514
|
}
|
|
3496
|
-
function _(
|
|
3497
|
-
u.use(
|
|
3515
|
+
function _(f) {
|
|
3516
|
+
u.use(f);
|
|
3498
3517
|
}
|
|
3499
3518
|
function g() {
|
|
3500
|
-
const
|
|
3501
|
-
if (!
|
|
3502
|
-
const d = I(
|
|
3519
|
+
const f = ie(...arguments);
|
|
3520
|
+
if (!f.id || !f.prop) return ce;
|
|
3521
|
+
const d = I(f.id), $ = f.prop, b = $.merge === !0 ? r[d] : void 0;
|
|
3503
3522
|
r[d] = $, Object.setPrototypeOf($, b || ce), n[d] = E(d), $.maker && p(n, $.maker);
|
|
3504
3523
|
}
|
|
3505
|
-
function
|
|
3524
|
+
function O(f, d) {
|
|
3506
3525
|
let $;
|
|
3507
|
-
if (
|
|
3508
|
-
if ($ = I(
|
|
3509
|
-
return
|
|
3526
|
+
if (h.String(f)) {
|
|
3527
|
+
if ($ = I(f), ["form-create", "formcreate"].indexOf($) > -1)
|
|
3528
|
+
return W();
|
|
3510
3529
|
if (d === void 0)
|
|
3511
3530
|
return e[$];
|
|
3512
3531
|
} else
|
|
3513
|
-
$ = I(
|
|
3532
|
+
$ = I(f.name), d = f;
|
|
3514
3533
|
if (!$ || !d) return;
|
|
3515
3534
|
const b = I($);
|
|
3516
3535
|
e[$] = d, e[b] = d, delete u.aliasMap[$], delete u.aliasMap[b], delete r[$], delete r[b], d.formCreateParser && g($, d.formCreateParser);
|
|
3517
3536
|
}
|
|
3518
|
-
function
|
|
3537
|
+
function Ce(f) {
|
|
3519
3538
|
Object.keys(S).forEach((d) => {
|
|
3520
3539
|
(Array.isArray(S[d]) ? S[d] : [S[d]]).forEach((b) => {
|
|
3521
|
-
b.bus.$emit("p.loadData." +
|
|
3540
|
+
b.bus.$emit("p.loadData." + f);
|
|
3522
3541
|
});
|
|
3523
3542
|
});
|
|
3524
3543
|
}
|
|
3525
|
-
function
|
|
3526
|
-
a[
|
|
3544
|
+
function _e(f, d) {
|
|
3545
|
+
a[f] = d, Ce(f);
|
|
3527
3546
|
}
|
|
3528
|
-
function
|
|
3529
|
-
return
|
|
3547
|
+
function Oe(f, d) {
|
|
3548
|
+
return k(a, f) ? a[f] : d;
|
|
3530
3549
|
}
|
|
3531
|
-
function
|
|
3532
|
-
delete a[
|
|
3550
|
+
function ft(f) {
|
|
3551
|
+
delete a[f], Ce(f);
|
|
3533
3552
|
}
|
|
3534
|
-
function
|
|
3535
|
-
return
|
|
3553
|
+
function W() {
|
|
3554
|
+
return xt(we, e, i);
|
|
3536
3555
|
}
|
|
3537
3556
|
function ke() {
|
|
3538
3557
|
return re;
|
|
3539
3558
|
}
|
|
3540
|
-
function
|
|
3541
|
-
return
|
|
3559
|
+
function ht(f, d) {
|
|
3560
|
+
return h.Function(f.install) ? f.install(M, d) : h.Function(f) && f(M, d), this;
|
|
3542
3561
|
}
|
|
3543
|
-
function
|
|
3544
|
-
let b =
|
|
3562
|
+
function M(f, d, $) {
|
|
3563
|
+
let b = Ne(f, d || {});
|
|
3545
3564
|
const A = b.$refs.fc.formCreate;
|
|
3546
|
-
return A.$parent = $,
|
|
3565
|
+
return A.$parent = $, Me(A.options).appendChild(b.$el), A.api();
|
|
3547
3566
|
}
|
|
3548
|
-
Object.setPrototypeOf(
|
|
3549
|
-
function
|
|
3567
|
+
Object.setPrototypeOf(M, l);
|
|
3568
|
+
function ct(f) {
|
|
3550
3569
|
let d = y({}, t);
|
|
3551
|
-
return
|
|
3570
|
+
return f ? d.inherit = {
|
|
3552
3571
|
components: e,
|
|
3553
3572
|
parsers: r,
|
|
3554
3573
|
directives: i,
|
|
3555
3574
|
providers: s,
|
|
3556
3575
|
maker: n,
|
|
3557
3576
|
loadData: a
|
|
3558
|
-
} : delete d.inherit,
|
|
3577
|
+
} : delete d.inherit, ut(d);
|
|
3559
3578
|
}
|
|
3560
|
-
function
|
|
3561
|
-
const d =
|
|
3579
|
+
function we(f) {
|
|
3580
|
+
const d = f.$options.propsData.rule;
|
|
3562
3581
|
p(this, {
|
|
3563
|
-
id:
|
|
3564
|
-
vm:
|
|
3565
|
-
create:
|
|
3566
|
-
manager:
|
|
3582
|
+
id: Pr++,
|
|
3583
|
+
vm: f,
|
|
3584
|
+
create: M,
|
|
3585
|
+
manager: wr(t.manager),
|
|
3567
3586
|
parsers: r,
|
|
3568
3587
|
providers: s,
|
|
3569
3588
|
rules: Array.isArray(d) ? d : [],
|
|
3570
|
-
name:
|
|
3571
|
-
inFor:
|
|
3589
|
+
name: f.$options.propsData.name || ee(),
|
|
3590
|
+
inFor: f.$options.propsData.inFor,
|
|
3572
3591
|
prop: {
|
|
3573
3592
|
components: e,
|
|
3574
3593
|
directives: i
|
|
3575
3594
|
},
|
|
3576
|
-
setData:
|
|
3577
|
-
getData:
|
|
3595
|
+
setData: _e,
|
|
3596
|
+
getData: Oe,
|
|
3578
3597
|
loadData: a,
|
|
3579
3598
|
CreateNode: u,
|
|
3580
3599
|
bus: new T(),
|
|
@@ -3583,23 +3602,23 @@ function ft(t) {
|
|
|
3583
3602
|
extendApi: t.extendApi || (($) => $)
|
|
3584
3603
|
}), this.init(), this.initOptions(), this.name && (this.inFor ? (S[this.name] || (S[this.name] = []), S[this.name].push(this)) : S[this.name] = this);
|
|
3585
3604
|
}
|
|
3586
|
-
p(
|
|
3605
|
+
p(we.prototype, {
|
|
3587
3606
|
init() {
|
|
3588
|
-
const
|
|
3589
|
-
this.$handle = d,
|
|
3590
|
-
this.isSub() && (this.unwatch =
|
|
3591
|
-
this.initOptions(),
|
|
3607
|
+
const f = this.vm, d = new V(this);
|
|
3608
|
+
this.$handle = d, f.$f = d.api, f.$emit("input", d.api), f.$on("hook:created", () => {
|
|
3609
|
+
this.isSub() && (this.unwatch = f.$watch(() => f.$pfc.option, () => {
|
|
3610
|
+
this.initOptions(), f.$f.refresh();
|
|
3592
3611
|
}, { deep: !0 }), this.initOptions()), this.created();
|
|
3593
|
-
}),
|
|
3612
|
+
}), f.$on("hook:mounted", () => {
|
|
3594
3613
|
this.mounted();
|
|
3595
|
-
}),
|
|
3596
|
-
if (
|
|
3614
|
+
}), f.$on("hook:beforeDestroy", () => {
|
|
3615
|
+
if (f.destroyed = !0, this.unwatch && this.unwatch(), d.reloadRule([]), this.name)
|
|
3597
3616
|
if (this.inFor) {
|
|
3598
3617
|
const $ = S[this.name].indexOf(this);
|
|
3599
3618
|
S[this.name].splice($, 1), S[this.name].length || delete S[this.name];
|
|
3600
3619
|
} else
|
|
3601
3620
|
delete S[this.name];
|
|
3602
|
-
}),
|
|
3621
|
+
}), f.$on("hook:updated", () => {
|
|
3603
3622
|
d.bindNextTick(() => this.bus.$emit("next-tick", d.api));
|
|
3604
3623
|
});
|
|
3605
3624
|
},
|
|
@@ -3608,16 +3627,16 @@ function ft(t) {
|
|
|
3608
3627
|
},
|
|
3609
3628
|
initOptions() {
|
|
3610
3629
|
this.options = {};
|
|
3611
|
-
let
|
|
3612
|
-
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0),
|
|
3630
|
+
let f = y({ formData: {}, submitBtn: {}, resetBtn: {} }, L(o));
|
|
3631
|
+
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0), f = this.mergeOptions(f, this.vm.$options.propsData.option), this.updateOptions(f);
|
|
3613
3632
|
},
|
|
3614
|
-
mergeOptions(
|
|
3615
|
-
return d = L(d), $ && ["page", "onSubmit", "mounted", "reload", "formData", "el"].forEach((b) => {
|
|
3633
|
+
mergeOptions(f, d, $) {
|
|
3634
|
+
return d = L(d), $ && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el"].forEach((b) => {
|
|
3616
3635
|
delete d[b];
|
|
3617
|
-
}), d.global && (
|
|
3636
|
+
}), d.global && (f.global = Qt(f.global, d.global), delete d.global), this.$handle.$manager.mergeOptions([d], f), f;
|
|
3618
3637
|
},
|
|
3619
|
-
updateOptions(
|
|
3620
|
-
this.mergeOptions(this.options,
|
|
3638
|
+
updateOptions(f) {
|
|
3639
|
+
this.mergeOptions(this.options, f), this.$handle.$manager.updateOptions(this.options);
|
|
3621
3640
|
},
|
|
3622
3641
|
created() {
|
|
3623
3642
|
this.$handle.init(), this.vm.$emit("created", this.api());
|
|
@@ -3632,35 +3651,35 @@ function ft(t) {
|
|
|
3632
3651
|
this.$handle.mounted();
|
|
3633
3652
|
}
|
|
3634
3653
|
});
|
|
3635
|
-
function
|
|
3636
|
-
p(
|
|
3654
|
+
function Fe(f) {
|
|
3655
|
+
p(f, {
|
|
3637
3656
|
version: t.version,
|
|
3638
3657
|
ui: t.ui,
|
|
3639
|
-
setData:
|
|
3640
|
-
getData:
|
|
3641
|
-
removeData:
|
|
3658
|
+
setData: _e,
|
|
3659
|
+
getData: Oe,
|
|
3660
|
+
removeData: ft,
|
|
3642
3661
|
maker: n,
|
|
3643
|
-
component:
|
|
3662
|
+
component: O,
|
|
3644
3663
|
directive: m,
|
|
3645
3664
|
register: v,
|
|
3646
3665
|
$vnode: ke,
|
|
3647
3666
|
parser: g,
|
|
3648
|
-
use:
|
|
3649
|
-
factory:
|
|
3667
|
+
use: ht,
|
|
3668
|
+
factory: ct,
|
|
3650
3669
|
componentAlias: _,
|
|
3651
|
-
copyRule:
|
|
3652
|
-
copyRules:
|
|
3653
|
-
fetch:
|
|
3654
|
-
$form:
|
|
3670
|
+
copyRule: $e,
|
|
3671
|
+
copyRules: Qe,
|
|
3672
|
+
fetch: rt,
|
|
3673
|
+
$form: W,
|
|
3655
3674
|
parseFn: q,
|
|
3656
|
-
parseJson:
|
|
3657
|
-
toJson:
|
|
3658
|
-
getApi:
|
|
3675
|
+
parseJson: zt,
|
|
3676
|
+
toJson: ze,
|
|
3677
|
+
getApi: c,
|
|
3659
3678
|
init(d, $ = {}) {
|
|
3660
|
-
let b =
|
|
3679
|
+
let b = Ne(d, $), A = b.$refs.fc.formCreate;
|
|
3661
3680
|
return {
|
|
3662
|
-
mount(
|
|
3663
|
-
return
|
|
3681
|
+
mount(J) {
|
|
3682
|
+
return J && h.Element(J) && (A.options.el = J), Me(A.options).appendChild(b.$el), A.api();
|
|
3664
3683
|
},
|
|
3665
3684
|
remove() {
|
|
3666
3685
|
b.$el.parentNode && b.$el.parentNode.removeChild(b.$el);
|
|
@@ -3673,36 +3692,36 @@ function ft(t) {
|
|
|
3673
3692
|
}
|
|
3674
3693
|
});
|
|
3675
3694
|
}
|
|
3676
|
-
function
|
|
3677
|
-
p(
|
|
3678
|
-
create:
|
|
3695
|
+
function dt(f) {
|
|
3696
|
+
p(f, {
|
|
3697
|
+
create: M,
|
|
3679
3698
|
install(d, $) {
|
|
3680
3699
|
if (o = y(y({}, o), $ || {}), d._installedFormCreate === !0) return;
|
|
3681
3700
|
d._installedFormCreate = !0;
|
|
3682
|
-
const b = function(A,
|
|
3683
|
-
return
|
|
3701
|
+
const b = function(A, J = {}) {
|
|
3702
|
+
return M(A, J, this);
|
|
3684
3703
|
};
|
|
3685
|
-
|
|
3704
|
+
Fe(b), d.prototype.$formCreate = b, d.component("FormCreate", W()), d.component("FcFragment", ke());
|
|
3686
3705
|
}
|
|
3687
3706
|
});
|
|
3688
3707
|
}
|
|
3689
|
-
if (
|
|
3690
|
-
const
|
|
3691
|
-
|
|
3708
|
+
if (Fe(l), dt(l), u.use({ fragment: "fcFragment" }), g(Ir), t.install && M.use(t), t.inherit) {
|
|
3709
|
+
const f = t.inherit;
|
|
3710
|
+
f.components && p(e, f.components), f.parsers && p(r, f.parsers), f.directives && p(i, f.directives), f.providers && p(s, f.providers), f.maker && p(n, f.maker), f.loadData && p(a, f.loadData);
|
|
3692
3711
|
}
|
|
3693
|
-
const
|
|
3694
|
-
return Object.setPrototypeOf(
|
|
3712
|
+
const G = W();
|
|
3713
|
+
return Object.setPrototypeOf(G, l), Object.defineProperties(G, {
|
|
3695
3714
|
fetch: {
|
|
3696
3715
|
get() {
|
|
3697
3716
|
return l.fetch;
|
|
3698
3717
|
},
|
|
3699
|
-
set(
|
|
3700
|
-
l.fetch =
|
|
3718
|
+
set(f) {
|
|
3719
|
+
l.fetch = f;
|
|
3701
3720
|
}
|
|
3702
3721
|
}
|
|
3703
|
-
}),
|
|
3722
|
+
}), G.util = l, G;
|
|
3704
3723
|
}
|
|
3705
|
-
const
|
|
3724
|
+
const qe = {
|
|
3706
3725
|
date: "yyyy-MM-dd",
|
|
3707
3726
|
month: "yyyy-MM",
|
|
3708
3727
|
datetime: "yyyy-MM-dd HH:mm:ss",
|
|
@@ -3711,16 +3730,16 @@ const He = {
|
|
|
3711
3730
|
monthrange: "yyyy-MM",
|
|
3712
3731
|
datetimerange: "yyyy-MM-dd HH:mm:ss",
|
|
3713
3732
|
year: "yyyy"
|
|
3714
|
-
},
|
|
3715
|
-
name:
|
|
3733
|
+
}, Ue = "datePicker", Tr = {
|
|
3734
|
+
name: Ue,
|
|
3716
3735
|
maker: function() {
|
|
3717
|
-
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = E(
|
|
3736
|
+
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = E(Ue, { type: e.toLowerCase() }), t), {});
|
|
3718
3737
|
}(),
|
|
3719
3738
|
mergeProp(t) {
|
|
3720
3739
|
const e = t.prop.props;
|
|
3721
|
-
e.valueFormat || (e.valueFormat =
|
|
3740
|
+
e.valueFormat || (e.valueFormat = qe[e.type] || qe.date);
|
|
3722
3741
|
}
|
|
3723
|
-
}, ne = "hidden",
|
|
3742
|
+
}, ne = "hidden", Dr = {
|
|
3724
3743
|
name: ne,
|
|
3725
3744
|
maker: {
|
|
3726
3745
|
[ne]: (t, e) => E(ne)("", t, e)
|
|
@@ -3728,7 +3747,7 @@ const He = {
|
|
|
3728
3747
|
render() {
|
|
3729
3748
|
return [];
|
|
3730
3749
|
}
|
|
3731
|
-
}, se = "input",
|
|
3750
|
+
}, se = "input", Br = {
|
|
3732
3751
|
name: se,
|
|
3733
3752
|
maker: function() {
|
|
3734
3753
|
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = E(se, { type: r }), e), {});
|
|
@@ -3738,16 +3757,16 @@ const He = {
|
|
|
3738
3757
|
let { props: e } = t.prop;
|
|
3739
3758
|
e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
3740
3759
|
}
|
|
3741
|
-
},
|
|
3742
|
-
name:
|
|
3760
|
+
}, He = "slider", Lr = {
|
|
3761
|
+
name: He,
|
|
3743
3762
|
maker: {
|
|
3744
|
-
sliderRange: E(
|
|
3763
|
+
sliderRange: E(He, { range: !0 })
|
|
3745
3764
|
},
|
|
3746
3765
|
toFormValue(t, e) {
|
|
3747
3766
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
3748
3767
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
3749
3768
|
}
|
|
3750
|
-
}, oe = "timePicker",
|
|
3769
|
+
}, oe = "timePicker", Mr = {
|
|
3751
3770
|
name: oe,
|
|
3752
3771
|
maker: {
|
|
3753
3772
|
time: E(oe, (t) => t.props.isRange = !1),
|
|
@@ -3757,27 +3776,27 @@ const He = {
|
|
|
3757
3776
|
const e = t.prop.props;
|
|
3758
3777
|
e.valueFormat || (e.valueFormat = "HH:mm:ss");
|
|
3759
3778
|
}
|
|
3760
|
-
},
|
|
3779
|
+
}, Nr = {
|
|
3761
3780
|
name: "FcRow",
|
|
3762
3781
|
render(t, e) {
|
|
3763
3782
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
3764
3783
|
e.vNode.row(e.prop, t)
|
|
3765
3784
|
]);
|
|
3766
3785
|
}
|
|
3767
|
-
},
|
|
3768
|
-
name:
|
|
3786
|
+
}, qr = "select", Ur = {
|
|
3787
|
+
name: qr,
|
|
3769
3788
|
toFormValue(t, e) {
|
|
3770
3789
|
return e.prop.props.multiple && !Array.isArray(t) ? j(t) : t;
|
|
3771
3790
|
}
|
|
3772
|
-
},
|
|
3791
|
+
}, Hr = [
|
|
3792
|
+
Tr,
|
|
3793
|
+
Dr,
|
|
3794
|
+
Br,
|
|
3773
3795
|
Lr,
|
|
3774
|
-
Nr,
|
|
3775
3796
|
Mr,
|
|
3776
|
-
|
|
3777
|
-
Ur
|
|
3778
|
-
|
|
3779
|
-
Jr
|
|
3780
|
-
], C = "el", Wr = {
|
|
3797
|
+
Nr,
|
|
3798
|
+
Ur
|
|
3799
|
+
], C = "el", Jr = {
|
|
3781
3800
|
button: C + "Button",
|
|
3782
3801
|
icon: "i",
|
|
3783
3802
|
slider: C + "Slider",
|
|
@@ -3809,7 +3828,7 @@ const He = {
|
|
|
3809
3828
|
object: "fcSubForm",
|
|
3810
3829
|
subForm: "fcSubForm"
|
|
3811
3830
|
};
|
|
3812
|
-
function
|
|
3831
|
+
function xr() {
|
|
3813
3832
|
return {
|
|
3814
3833
|
form: {
|
|
3815
3834
|
inline: !1,
|
|
@@ -3843,23 +3862,23 @@ function Gr() {
|
|
|
3843
3862
|
}
|
|
3844
3863
|
};
|
|
3845
3864
|
}
|
|
3846
|
-
function
|
|
3865
|
+
function Kr(t) {
|
|
3847
3866
|
return t.type === "tooltip";
|
|
3848
3867
|
}
|
|
3849
|
-
const
|
|
3850
|
-
function
|
|
3851
|
-
return !
|
|
3868
|
+
const Wr = /[A-Z]/;
|
|
3869
|
+
function Gr(t, e) {
|
|
3870
|
+
return !Wr.test(t) && (h.String(e) || h.Number(e));
|
|
3852
3871
|
}
|
|
3853
|
-
function
|
|
3854
|
-
|
|
3872
|
+
function Je(t, e) {
|
|
3873
|
+
k(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
3855
3874
|
}
|
|
3856
3875
|
function P(t) {
|
|
3857
3876
|
return t === !1;
|
|
3858
3877
|
}
|
|
3859
|
-
function
|
|
3860
|
-
|
|
3878
|
+
function Xr(t, e) {
|
|
3879
|
+
k(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
3861
3880
|
}
|
|
3862
|
-
const
|
|
3881
|
+
const zr = {
|
|
3863
3882
|
validate() {
|
|
3864
3883
|
const t = this.form();
|
|
3865
3884
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -3878,16 +3897,16 @@ const Yr = {
|
|
|
3878
3897
|
},
|
|
3879
3898
|
tidyOptions(t) {
|
|
3880
3899
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
3881
|
-
|
|
3900
|
+
Xr(t, e);
|
|
3882
3901
|
}), t;
|
|
3883
3902
|
},
|
|
3884
3903
|
tidyRule({ prop: t }) {
|
|
3885
|
-
return
|
|
3904
|
+
return Je(t, "title"), Je(t, "info"), t;
|
|
3886
3905
|
},
|
|
3887
3906
|
mergeProp(t) {
|
|
3888
3907
|
let e = t.prop.props;
|
|
3889
3908
|
t.prop = D([{
|
|
3890
|
-
attrs: Object.keys(e).reduce((r, i) => (
|
|
3909
|
+
attrs: Object.keys(e).reduce((r, i) => (Gr(i, e[i]) && (r[i] = e[i]), r), {}),
|
|
3891
3910
|
info: this.options.info || {},
|
|
3892
3911
|
wrap: this.options.wrap || {},
|
|
3893
3912
|
col: this.options.col || {},
|
|
@@ -3904,7 +3923,7 @@ const Yr = {
|
|
|
3904
3923
|
}, { normal: ["title", "info", "col", "wrap"] });
|
|
3905
3924
|
},
|
|
3906
3925
|
getDefaultOptions() {
|
|
3907
|
-
return
|
|
3926
|
+
return xr();
|
|
3908
3927
|
},
|
|
3909
3928
|
update() {
|
|
3910
3929
|
const t = this.options.form;
|
|
@@ -3932,8 +3951,8 @@ const Yr = {
|
|
|
3932
3951
|
},
|
|
3933
3952
|
makeWrap(t, e) {
|
|
3934
3953
|
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 :
|
|
3954
|
+
props: N(y({
|
|
3955
|
+
labelWidth: o === void 0 ? o : nt(o),
|
|
3937
3956
|
label: n ? r.title.title : void 0
|
|
3938
3957
|
}, r.wrap || {}), {
|
|
3939
3958
|
prop: t.id,
|
|
@@ -3952,15 +3971,15 @@ const Yr = {
|
|
|
3952
3971
|
return !(!e.title && !e.native || P(e.show));
|
|
3953
3972
|
},
|
|
3954
3973
|
makeInfo(t, e, r) {
|
|
3955
|
-
const i = t.title, s = t.info, n =
|
|
3974
|
+
const i = t.title, s = t.info, n = Kr(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
3975
|
if (!P(s.show) && (s.info || s.native) && !P(s.icon)) {
|
|
3957
3976
|
const l = {
|
|
3958
3977
|
type: s.type || "popover",
|
|
3959
3978
|
props: y({}, s),
|
|
3960
3979
|
key: `${e}pop`,
|
|
3961
3980
|
slot: "label"
|
|
3962
|
-
},
|
|
3963
|
-
s.info && !
|
|
3981
|
+
}, c = "content";
|
|
3982
|
+
s.info && !k(l.props, c) && (l.props[c] = s.info), u[s.align !== "left" ? "unshift" : "push"](this.$r(D([s, l]), [
|
|
3964
3983
|
this.$r({
|
|
3965
3984
|
type: "i",
|
|
3966
3985
|
slot: n ? "default" : "reference",
|
|
@@ -4039,25 +4058,25 @@ const Yr = {
|
|
|
4039
4058
|
}, [t.innerText]);
|
|
4040
4059
|
}
|
|
4041
4060
|
}, H = {};
|
|
4061
|
+
Qr(H);
|
|
4062
|
+
Zr(H);
|
|
4063
|
+
Yr(H);
|
|
4042
4064
|
ei(H);
|
|
4043
4065
|
ti(H);
|
|
4044
|
-
|
|
4045
|
-
ii(H);
|
|
4046
|
-
ni(H);
|
|
4047
|
-
function ei(t) {
|
|
4066
|
+
function Qr(t) {
|
|
4048
4067
|
["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
|
|
4049
4068
|
t[e] = E(e);
|
|
4050
4069
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4051
4070
|
}
|
|
4052
|
-
function
|
|
4071
|
+
function Zr(t) {
|
|
4053
4072
|
const e = "select", r = "multiple";
|
|
4054
4073
|
t.selectMultiple = E(e, { [r]: !0 }), t.selectOne = E(e, { [r]: !1 });
|
|
4055
4074
|
}
|
|
4056
|
-
function
|
|
4075
|
+
function Yr(t) {
|
|
4057
4076
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4058
4077
|
Object.keys(r).reduce((i, s) => (i[s] = E(e, { type: r[s] }), i), t);
|
|
4059
4078
|
}
|
|
4060
|
-
function
|
|
4079
|
+
function ei(t) {
|
|
4061
4080
|
const e = "upload", r = {
|
|
4062
4081
|
image: ["image", 0],
|
|
4063
4082
|
file: ["file", 0],
|
|
@@ -4066,7 +4085,7 @@ function ii(t) {
|
|
|
4066
4085
|
};
|
|
4067
4086
|
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
4087
|
}
|
|
4069
|
-
function
|
|
4088
|
+
function ti(t) {
|
|
4070
4089
|
const e = {
|
|
4071
4090
|
frameInputs: ["input", 0],
|
|
4072
4091
|
frameFiles: ["file", 0],
|
|
@@ -4077,10 +4096,10 @@ function ni(t) {
|
|
|
4077
4096
|
};
|
|
4078
4097
|
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
4098
|
}
|
|
4080
|
-
function
|
|
4081
|
-
return
|
|
4099
|
+
function xe(t, e) {
|
|
4100
|
+
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4082
4101
|
}
|
|
4083
|
-
function
|
|
4102
|
+
function ri(t, e) {
|
|
4084
4103
|
return p(t, {
|
|
4085
4104
|
formEl() {
|
|
4086
4105
|
return e.$manager.form();
|
|
@@ -4154,41 +4173,41 @@ function si(t, e) {
|
|
|
4154
4173
|
}
|
|
4155
4174
|
},
|
|
4156
4175
|
submitBtnProps: (r = {}) => {
|
|
4157
|
-
let i =
|
|
4176
|
+
let i = xe(e.options.submitBtn, !0);
|
|
4158
4177
|
p(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4159
4178
|
},
|
|
4160
4179
|
resetBtnProps: (r = {}) => {
|
|
4161
|
-
let i =
|
|
4180
|
+
let i = xe(e.options.resetBtn, !1);
|
|
4162
4181
|
p(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4163
4182
|
},
|
|
4164
4183
|
submit(r, i) {
|
|
4165
4184
|
t.validate((s) => {
|
|
4166
4185
|
if (s) {
|
|
4167
4186
|
let n = t.formData();
|
|
4168
|
-
|
|
4187
|
+
h.Function(r) ? R(() => r(n, this)) : (h.Function(e.options.onSubmit) && R(() => e.options.onSubmit(n, this)), e.vm.$emit("submit", n, this));
|
|
4169
4188
|
} else
|
|
4170
|
-
|
|
4189
|
+
h.Function(i) && R(() => i(this, ...arguments));
|
|
4171
4190
|
}).catch((s) => {
|
|
4172
4191
|
});
|
|
4173
4192
|
}
|
|
4174
4193
|
}), t;
|
|
4175
4194
|
}
|
|
4176
|
-
function
|
|
4177
|
-
t.componentAlias(
|
|
4195
|
+
function ii(t) {
|
|
4196
|
+
t.componentAlias(Jr), Jt.forEach((e) => {
|
|
4178
4197
|
t.component(e.name, e);
|
|
4179
|
-
}),
|
|
4198
|
+
}), Hr.forEach((e) => {
|
|
4180
4199
|
t.parser(e);
|
|
4181
4200
|
}), Object.keys(H).forEach((e) => {
|
|
4182
4201
|
t.maker[e] = H[e];
|
|
4183
4202
|
});
|
|
4184
4203
|
}
|
|
4185
|
-
function
|
|
4186
|
-
return
|
|
4204
|
+
function ni() {
|
|
4205
|
+
return ut({
|
|
4187
4206
|
ui: "element-ui",
|
|
4188
|
-
version: "2.6.
|
|
4189
|
-
manager:
|
|
4190
|
-
extendApi:
|
|
4191
|
-
install:
|
|
4207
|
+
version: "2.6.3",
|
|
4208
|
+
manager: zr,
|
|
4209
|
+
extendApi: ri,
|
|
4210
|
+
install: ii,
|
|
4192
4211
|
attrs: {
|
|
4193
4212
|
normal: ["col", "wrap"],
|
|
4194
4213
|
array: ["className"],
|
|
@@ -4196,10 +4215,10 @@ function ai() {
|
|
|
4196
4215
|
}
|
|
4197
4216
|
});
|
|
4198
4217
|
}
|
|
4199
|
-
const
|
|
4200
|
-
typeof window != "undefined" && (window.formCreate =
|
|
4201
|
-
const
|
|
4218
|
+
const de = ni();
|
|
4219
|
+
typeof window != "undefined" && (window.formCreate = de, window.Vue && de.install(window.Vue));
|
|
4220
|
+
const ai = de.maker;
|
|
4202
4221
|
export {
|
|
4203
|
-
|
|
4204
|
-
|
|
4222
|
+
de as default,
|
|
4223
|
+
ai as maker
|
|
4205
4224
|
};
|