@form-create/element-ui 2.7.1 → 2.7.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 +1001 -905
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +5 -5
- package/src/core/config.js +2 -2
- package/src/core/manager.js +5 -5
- package/src/core/provider.js +3 -2
package/dist/form-create.esm.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/element-ui v2.7.
|
|
3
|
+
* @form-create/element-ui v2.7.3
|
|
4
4
|
* (c) 2018-2025 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 .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{width:100%}.fc-form-row{box-sizing:border-box;display:flex;flex-wrap:wrap;position:relative}.form-create.is-preview .fc-clock,.form-create .fc-none,.form-create.is-preview .el-form-item.is-required>.el-form-item__label-wrap>.el-form-item__label:before,.form-create.is-preview .el-form-item.is-required>.el-form-item__label:before{display:none!important}.fc-wrap-right>.el-form-item__label{display:flex;justify-content:flex-end}.fc-wrap-left>.el-form-item__label{display:flex;justify-content:flex-start}.fc-wrap-top.el-form-item{display:block}.fc-wrap-top.el-form-item>.el-form-item__label{display:block;height:auto;line-height:22px;margin-bottom:8px;text-align:left}.fc-wrap-top.el-form-item>.el-form-item__content{margin-left:0!important}.el-form--large .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:12px}.el-form--default .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:8px}.el-form--small .fc-wrap-top.el-form-item>.el-form-item__label{line-height:20px;margin-bottom:4px}.fc-form-footer{margin-top:12px}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
10
|
+
var tr = Object.defineProperty, rr = Object.defineProperties;
|
|
11
|
+
var ir = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var ot = Object.getOwnPropertySymbols;
|
|
13
|
+
var nr = Object.prototype.hasOwnProperty, sr = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var at = (t, e, r) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, b = (t, e) => {
|
|
15
15
|
for (var r in e || (e = {}))
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
for (var r of
|
|
19
|
-
|
|
16
|
+
nr.call(e, r) && at(t, r, e[r]);
|
|
17
|
+
if (ot)
|
|
18
|
+
for (var r of ot(e))
|
|
19
|
+
sr.call(e, r) && at(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
},
|
|
22
|
-
import
|
|
23
|
-
function
|
|
21
|
+
}, q = (t, e) => rr(t, ir(e));
|
|
22
|
+
import ge, { getCurrentInstance as or, provide as ar, inject as lr, toRefs as lt, reactive as ie, onBeforeMount as ur, watch as L, onMounted as fr, onBeforeUnmount as cr, onUpdated as hr, nextTick as T, markRaw as pe, computed as me, toRef as De, ref as dr } from "vue";
|
|
23
|
+
function pr(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
26
26
|
function He() {
|
|
@@ -29,33 +29,33 @@ function He() {
|
|
|
29
29
|
return t;
|
|
30
30
|
}, He.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var mr = ["attrs", "props", "domProps"], gr = ["class", "style", "directives"], yr = ["on", "nativeOn"], $r = 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 (mr.indexOf(i) !== -1) e[i] = He({}, e[i], r[i]);
|
|
36
|
+
else if (gr.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 (yr.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]], l = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
|
|
42
42
|
e[i][o] = [].concat(a, l);
|
|
43
43
|
} else e[i][o] = r[i][o];
|
|
44
|
-
else if (i === "hook") for (var u in r[i]) e[i][u] = e[i][u] ?
|
|
44
|
+
else if (i === "hook") for (var u in r[i]) e[i][u] = e[i][u] ? vr(e[i][u], r[i][u]) : r[i][u];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, vr = function(t, e) {
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
},
|
|
53
|
-
const V = /* @__PURE__ */
|
|
52
|
+
}, br = $r;
|
|
53
|
+
const V = /* @__PURE__ */ pr(br);
|
|
54
54
|
function Qe(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => (r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
name:
|
|
57
|
+
const _r = "fcCheckbox", Cr = {
|
|
58
|
+
name: _r,
|
|
59
59
|
props: {
|
|
60
60
|
formCreateInject: {
|
|
61
61
|
type: Object,
|
|
@@ -126,8 +126,8 @@ const br = "fcCheckbox", _r = {
|
|
|
126
126
|
function H(t) {
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
|
-
const
|
|
130
|
-
name:
|
|
129
|
+
const wr = "fcFrame", Or = {
|
|
130
|
+
name: wr,
|
|
131
131
|
props: {
|
|
132
132
|
formCreateInject: {
|
|
133
133
|
type: Object,
|
|
@@ -168,11 +168,11 @@ const Cr = "fcFrame", wr = {
|
|
|
168
168
|
},
|
|
169
169
|
okBtnText: {
|
|
170
170
|
type: String,
|
|
171
|
-
default: "
|
|
171
|
+
default: ""
|
|
172
172
|
},
|
|
173
173
|
closeBtnText: {
|
|
174
174
|
type: String,
|
|
175
|
-
default: "
|
|
175
|
+
default: ""
|
|
176
176
|
},
|
|
177
177
|
modalTitle: String,
|
|
178
178
|
handleIcon: {
|
|
@@ -427,14 +427,14 @@ const Cr = "fcFrame", wr = {
|
|
|
427
427
|
on: {
|
|
428
428
|
click: () => this.onCancel() !== !1 && (this.frameVisible = !1)
|
|
429
429
|
}
|
|
430
|
-
}, [r]) : null, s ? t("ElButton", {
|
|
430
|
+
}, [r || this.formCreateInject.t("close") || "关闭"]) : null, s ? t("ElButton", {
|
|
431
431
|
attrs: {
|
|
432
432
|
type: "primary"
|
|
433
433
|
},
|
|
434
434
|
on: {
|
|
435
435
|
click: () => this.onOk() !== !1 && this.closeModel()
|
|
436
436
|
}
|
|
437
|
-
}, [e]) : null]);
|
|
437
|
+
}, [e || this.formCreateInject.t("ok") || "确定"]) : null]);
|
|
438
438
|
}
|
|
439
439
|
},
|
|
440
440
|
render() {
|
|
@@ -469,7 +469,7 @@ const Cr = "fcFrame", wr = {
|
|
|
469
469
|
src: this.previewImage
|
|
470
470
|
}
|
|
471
471
|
})]), t("el-dialog", V([{}, {
|
|
472
|
-
props:
|
|
472
|
+
props: q(b({
|
|
473
473
|
width: i,
|
|
474
474
|
title: o,
|
|
475
475
|
appendToBody: !0
|
|
@@ -496,7 +496,7 @@ const Cr = "fcFrame", wr = {
|
|
|
496
496
|
mounted() {
|
|
497
497
|
this.$on("fc.closeModal", this.closeModal);
|
|
498
498
|
}
|
|
499
|
-
}, Fr = "fcRadio",
|
|
499
|
+
}, Fr = "fcRadio", Rr = {
|
|
500
500
|
name: Fr,
|
|
501
501
|
props: {
|
|
502
502
|
formCreateInject: {
|
|
@@ -591,11 +591,11 @@ const Cr = "fcFrame", wr = {
|
|
|
591
591
|
return h.type(e, t);
|
|
592
592
|
};
|
|
593
593
|
});
|
|
594
|
-
function
|
|
594
|
+
function S(t, e) {
|
|
595
595
|
return {}.hasOwnProperty.call(t, e);
|
|
596
596
|
}
|
|
597
|
-
const
|
|
598
|
-
name:
|
|
597
|
+
const Er = "fcSelect", Sr = {
|
|
598
|
+
name: Er,
|
|
599
599
|
functional: !0,
|
|
600
600
|
props: {
|
|
601
601
|
formCreateInject: {
|
|
@@ -621,13 +621,13 @@ const kr = "fcSelect", Er = {
|
|
|
621
621
|
}, [h.trueArray(n.options) && n.options.map((a, l) => r(a, l))]), s = e.props.formCreateInject.options;
|
|
622
622
|
return t("ElSelect", V([{}, e.data, {
|
|
623
623
|
ref: "el"
|
|
624
|
-
}]), [(Array.isArray(s) ? s : []).map((n, o) =>
|
|
624
|
+
}]), [(Array.isArray(s) ? s : []).map((n, o) => S(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
|
+
}, kr = "fcTree", Dr = {
|
|
630
|
+
name: kr,
|
|
631
631
|
formCreateParser: {
|
|
632
632
|
mergeProp(t) {
|
|
633
633
|
const e = t.prop.props;
|
|
@@ -683,25 +683,25 @@ const kr = "fcSelect", Er = {
|
|
|
683
683
|
this.setValue(), this.$emit("fc.el", this.$refs.tree);
|
|
684
684
|
}
|
|
685
685
|
};
|
|
686
|
-
function
|
|
686
|
+
function ut(t, e) {
|
|
687
687
|
return typeof t == "object" ? t : {
|
|
688
688
|
url: t,
|
|
689
689
|
is_string: !0,
|
|
690
|
-
name:
|
|
690
|
+
name: jr(t),
|
|
691
691
|
uid: e
|
|
692
692
|
};
|
|
693
693
|
}
|
|
694
|
-
function
|
|
695
|
-
return
|
|
694
|
+
function ft(t) {
|
|
695
|
+
return q(b({}, t), {
|
|
696
696
|
file: t,
|
|
697
697
|
value: t
|
|
698
698
|
});
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function jr(t) {
|
|
701
701
|
return ("" + t).split("/").pop();
|
|
702
702
|
}
|
|
703
|
-
const
|
|
704
|
-
name:
|
|
703
|
+
const Ar = "fcUpload", Vr = {
|
|
704
|
+
name: Ar,
|
|
705
705
|
props: {
|
|
706
706
|
formCreateInject: {
|
|
707
707
|
type: Object,
|
|
@@ -727,6 +727,7 @@ const jr = "fcUpload", Ar = {
|
|
|
727
727
|
},
|
|
728
728
|
previewMask: void 0,
|
|
729
729
|
showFileList: Boolean,
|
|
730
|
+
httpRequest: Function,
|
|
730
731
|
modalTitle: String,
|
|
731
732
|
listType: {
|
|
732
733
|
type: String,
|
|
@@ -748,11 +749,11 @@ const jr = "fcUpload", Ar = {
|
|
|
748
749
|
};
|
|
749
750
|
},
|
|
750
751
|
created() {
|
|
751
|
-
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = H(this.value).map(
|
|
752
|
+
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = H(this.value).map(ut).map(ft);
|
|
752
753
|
},
|
|
753
754
|
watch: {
|
|
754
755
|
value(t) {
|
|
755
|
-
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = H(t).map(
|
|
756
|
+
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = H(t).map(ut).map(ft), this.uploadList = this.$refs.upload.uploadFiles);
|
|
756
757
|
},
|
|
757
758
|
limit(t, e) {
|
|
758
759
|
(e === 1 || t === 1) && this.update();
|
|
@@ -845,7 +846,7 @@ const jr = "fcUpload", Ar = {
|
|
|
845
846
|
attrs: {
|
|
846
847
|
type: "primary"
|
|
847
848
|
}
|
|
848
|
-
}, ["点击上传"]) : t("i", {
|
|
849
|
+
}, [this.formCreateInject.t("clickToUpload") || "点击上传"]) : t("i", {
|
|
849
850
|
class: "el-icon-upload2"
|
|
850
851
|
});
|
|
851
852
|
},
|
|
@@ -854,7 +855,8 @@ const jr = "fcUpload", Ar = {
|
|
|
854
855
|
return t("ElUpload", V([{}, this.formCreateInject.prop, {}, {
|
|
855
856
|
props: {
|
|
856
857
|
listType: this.listType,
|
|
857
|
-
showFileList: this.listType !== "picture"
|
|
858
|
+
showFileList: this.listType !== "picture",
|
|
859
|
+
httpRequest: this.doHttpRequest
|
|
858
860
|
},
|
|
859
861
|
style: {
|
|
860
862
|
display: "inline-block"
|
|
@@ -871,6 +873,11 @@ const jr = "fcUpload", Ar = {
|
|
|
871
873
|
},
|
|
872
874
|
handleCancel() {
|
|
873
875
|
this.previewVisible = !1;
|
|
876
|
+
},
|
|
877
|
+
doHttpRequest(t) {
|
|
878
|
+
if (this.httpRequest)
|
|
879
|
+
return this.httpRequest(t);
|
|
880
|
+
t.source = "upload", t.method = "post", this.formCreateInject.api.fetch(t);
|
|
874
881
|
}
|
|
875
882
|
},
|
|
876
883
|
render() {
|
|
@@ -904,13 +911,13 @@ const jr = "fcUpload", Ar = {
|
|
|
904
911
|
}), this.$emit("fc.el", this.$refs.upload);
|
|
905
912
|
}
|
|
906
913
|
};
|
|
907
|
-
function
|
|
908
|
-
|
|
914
|
+
function R(t, e, r) {
|
|
915
|
+
ge.set(t, e, r);
|
|
909
916
|
}
|
|
910
|
-
function
|
|
911
|
-
(
|
|
917
|
+
function re(t, e) {
|
|
918
|
+
(ge.del || ge.delete)(t, e);
|
|
912
919
|
}
|
|
913
|
-
function
|
|
920
|
+
function ve(t, e = {}, r) {
|
|
914
921
|
let i = !1;
|
|
915
922
|
for (let s in e)
|
|
916
923
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
@@ -918,39 +925,39 @@ function $e(t, e = {}, r) {
|
|
|
918
925
|
if ((i = Array.isArray(n)) || h.Object(n)) {
|
|
919
926
|
let o = t[s] === void 0;
|
|
920
927
|
if (i)
|
|
921
|
-
i = !1, o &&
|
|
928
|
+
i = !1, o && R(t, s, []);
|
|
922
929
|
else if (n._clone && r !== void 0)
|
|
923
930
|
if (r)
|
|
924
|
-
n = n.getRule(), o &&
|
|
931
|
+
n = n.getRule(), o && R(t, s, {});
|
|
925
932
|
else {
|
|
926
|
-
|
|
933
|
+
R(t, s, n._clone());
|
|
927
934
|
continue;
|
|
928
935
|
}
|
|
929
936
|
else
|
|
930
|
-
o &&
|
|
931
|
-
t[s] =
|
|
937
|
+
o && R(t, s, {});
|
|
938
|
+
t[s] = ve(t[s], n, r);
|
|
932
939
|
} else
|
|
933
|
-
|
|
940
|
+
R(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
|
|
934
941
|
}
|
|
935
942
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
936
943
|
}
|
|
937
944
|
function W(t) {
|
|
938
|
-
return
|
|
945
|
+
return ve({}, { value: t }).value;
|
|
939
946
|
}
|
|
940
|
-
const
|
|
947
|
+
const Ir = Object.assign || function(t) {
|
|
941
948
|
for (let e, r = 1; r < arguments.length; r++)
|
|
942
949
|
for (let i in e = arguments[r], e)
|
|
943
|
-
Object.prototype.hasOwnProperty.call(e, i) &&
|
|
950
|
+
Object.prototype.hasOwnProperty.call(e, i) && R(t, i, e[i]);
|
|
944
951
|
return t;
|
|
945
952
|
};
|
|
946
953
|
function _() {
|
|
947
|
-
return
|
|
954
|
+
return Ir.apply(this, arguments);
|
|
948
955
|
}
|
|
949
956
|
function Ge(t) {
|
|
950
957
|
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : b({}, t);
|
|
951
958
|
}
|
|
952
|
-
const
|
|
953
|
-
name:
|
|
959
|
+
const Pr = "fcGroup", Tr = {
|
|
960
|
+
name: Pr,
|
|
954
961
|
props: {
|
|
955
962
|
field: String,
|
|
956
963
|
rule: [Array, Object],
|
|
@@ -1031,7 +1038,7 @@ const Ir = "fcGroup", Pr = {
|
|
|
1031
1038
|
const s = i.$f.formData();
|
|
1032
1039
|
if (t === e)
|
|
1033
1040
|
i.$f.deferSyncValue(() => {
|
|
1034
|
-
|
|
1041
|
+
ve(i.rule, t), i.$f.setValue(s);
|
|
1035
1042
|
}, !0);
|
|
1036
1043
|
else {
|
|
1037
1044
|
const n = i.$f.formData();
|
|
@@ -1071,7 +1078,7 @@ const Ir = "fcGroup", Pr = {
|
|
|
1071
1078
|
},
|
|
1072
1079
|
methods: {
|
|
1073
1080
|
_value(t) {
|
|
1074
|
-
return t &&
|
|
1081
|
+
return t && S(t, this.field) ? t[this.field] : t;
|
|
1075
1082
|
},
|
|
1076
1083
|
cache(t, e) {
|
|
1077
1084
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1217,7 +1224,7 @@ const Ir = "fcGroup", Pr = {
|
|
|
1217
1224
|
const {
|
|
1218
1225
|
rule: l,
|
|
1219
1226
|
options: u
|
|
1220
|
-
} = this.cacheRule[o],
|
|
1227
|
+
} = this.cacheRule[o], f = r && !s ? this.makeIcon(e.length, a, o) : [];
|
|
1221
1228
|
return t("div", {
|
|
1222
1229
|
class: "_fc-group-container",
|
|
1223
1230
|
key: o
|
|
@@ -1225,9 +1232,9 @@ const Ir = "fcGroup", Pr = {
|
|
|
1225
1232
|
key: o
|
|
1226
1233
|
}, {
|
|
1227
1234
|
on: {
|
|
1228
|
-
"update:value": (
|
|
1229
|
-
"emit-event": (
|
|
1230
|
-
input: (
|
|
1235
|
+
"update:value": (d) => this.formData(o, d),
|
|
1236
|
+
"emit-event": (d, ...g) => this.emitEvent(d, g, a, o),
|
|
1237
|
+
input: (d) => this.add$f(a, o, d)
|
|
1231
1238
|
}
|
|
1232
1239
|
}, {}, {
|
|
1233
1240
|
props: {
|
|
@@ -1242,17 +1249,17 @@ const Ir = "fcGroup", Pr = {
|
|
|
1242
1249
|
}
|
|
1243
1250
|
}])), t("div", {
|
|
1244
1251
|
class: "_fc-group-idx"
|
|
1245
|
-
}, [a + 1]),
|
|
1252
|
+
}, [a + 1]), f.length ? t("div", {
|
|
1246
1253
|
class: "_fc-group-handle fc-clock"
|
|
1247
|
-
}, [
|
|
1254
|
+
}, [f]) : null]);
|
|
1248
1255
|
});
|
|
1249
1256
|
return t("div", {
|
|
1250
1257
|
key: "con",
|
|
1251
1258
|
class: "_fc-group " + (s ? "_fc-group-disabled" : "")
|
|
1252
1259
|
}, [n]);
|
|
1253
1260
|
}
|
|
1254
|
-
},
|
|
1255
|
-
name:
|
|
1261
|
+
}, Br = "fcSubForm", Lr = {
|
|
1262
|
+
name: Br,
|
|
1256
1263
|
props: {
|
|
1257
1264
|
rule: Array,
|
|
1258
1265
|
options: Object,
|
|
@@ -1335,35 +1342,35 @@ const Ir = "fcGroup", Pr = {
|
|
|
1335
1342
|
}
|
|
1336
1343
|
}]));
|
|
1337
1344
|
}
|
|
1338
|
-
},
|
|
1339
|
-
|
|
1340
|
-
wr,
|
|
1345
|
+
}, Mr = [
|
|
1346
|
+
Cr,
|
|
1341
1347
|
Or,
|
|
1342
|
-
|
|
1348
|
+
Rr,
|
|
1343
1349
|
Sr,
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1350
|
+
Dr,
|
|
1351
|
+
Vr,
|
|
1352
|
+
Tr,
|
|
1353
|
+
Lr
|
|
1347
1354
|
];
|
|
1348
|
-
function
|
|
1355
|
+
function ce(t, e) {
|
|
1349
1356
|
var r = null;
|
|
1350
1357
|
return function(...i) {
|
|
1351
1358
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
1352
1359
|
};
|
|
1353
1360
|
}
|
|
1354
|
-
function
|
|
1361
|
+
function $e(t) {
|
|
1355
1362
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
1356
1363
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
1357
1364
|
}
|
|
1358
|
-
const
|
|
1365
|
+
const Se = (t, e) => {
|
|
1359
1366
|
if (!(!t || t === e || !t.$props)) {
|
|
1360
1367
|
if (t.$props.formCreateInject)
|
|
1361
1368
|
return t.$props.formCreateInject;
|
|
1362
1369
|
if (t.$parent)
|
|
1363
|
-
return
|
|
1370
|
+
return Se(t.$parent, e);
|
|
1364
1371
|
}
|
|
1365
1372
|
};
|
|
1366
|
-
function
|
|
1373
|
+
function Nr(t, e, r) {
|
|
1367
1374
|
const i = "FormCreate" + (t.isMobile ? "Mobile" : "");
|
|
1368
1375
|
return {
|
|
1369
1376
|
name: i,
|
|
@@ -1414,100 +1421,100 @@ function Mr(t, e, r) {
|
|
|
1414
1421
|
return this.fc.render();
|
|
1415
1422
|
},
|
|
1416
1423
|
setup(s) {
|
|
1417
|
-
const n =
|
|
1418
|
-
|
|
1419
|
-
const o =
|
|
1424
|
+
const n = or().proxy;
|
|
1425
|
+
ar("parentFC", n);
|
|
1426
|
+
const o = lr("parentFC", null);
|
|
1420
1427
|
let a = o;
|
|
1421
1428
|
if (o)
|
|
1422
1429
|
for (; a.parent; )
|
|
1423
1430
|
a = a.parent;
|
|
1424
1431
|
else
|
|
1425
1432
|
a = n;
|
|
1426
|
-
const { rule: l, value: u, subForm:
|
|
1433
|
+
const { rule: l, value: u, subForm: f, inFor: d } = lt(s), g = ie({
|
|
1427
1434
|
ctxInject: {},
|
|
1428
1435
|
destroyed: !1,
|
|
1429
1436
|
isShow: !0,
|
|
1430
1437
|
unique: 1,
|
|
1431
1438
|
renderRule: [...l.value || []],
|
|
1432
1439
|
updateValue: JSON.stringify(u.value || {})
|
|
1433
|
-
}),
|
|
1440
|
+
}), m = new t(n), v = m.api(), w = d.value, j = () => {
|
|
1434
1441
|
if (o) {
|
|
1435
|
-
const F =
|
|
1442
|
+
const F = Se(n, o);
|
|
1436
1443
|
if (F) {
|
|
1437
|
-
let
|
|
1438
|
-
w ? (
|
|
1444
|
+
let D;
|
|
1445
|
+
w ? (D = H(F.getSubForm()), D.push(v)) : D = v, F.subForm(D);
|
|
1439
1446
|
}
|
|
1440
1447
|
}
|
|
1441
|
-
},
|
|
1442
|
-
const F =
|
|
1448
|
+
}, ee = () => {
|
|
1449
|
+
const F = Se(n, o);
|
|
1443
1450
|
if (F)
|
|
1444
1451
|
if (w) {
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1452
|
+
const D = H(F.getSubForm()), B = D.indexOf(v);
|
|
1453
|
+
B > -1 && D.splice(B, 1);
|
|
1447
1454
|
} else
|
|
1448
1455
|
F.subForm();
|
|
1449
1456
|
};
|
|
1450
1457
|
let P = null;
|
|
1451
|
-
|
|
1452
|
-
|
|
1458
|
+
ur(() => {
|
|
1459
|
+
L(() => {
|
|
1453
1460
|
let F = "";
|
|
1454
|
-
const
|
|
1455
|
-
Object.keys(
|
|
1456
|
-
let
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
}),
|
|
1461
|
+
const D = s.option && s.option.globalClass || {};
|
|
1462
|
+
Object.keys(D).forEach((B) => {
|
|
1463
|
+
let se = "";
|
|
1464
|
+
D[B].style && Object.keys(D[B].style).forEach((_e) => {
|
|
1465
|
+
se += $e(_e) + ":" + D[B].style[_e] + ";";
|
|
1466
|
+
}), D[B].content && (se += D[B].content + ";"), se && (F += `.${B}{${se}}`);
|
|
1460
1467
|
}), s.option && s.option.style && (F += s.option.style), P || (P = document.createElement("style"), P.type = "text/css", document.head.appendChild(P)), P.innerHTML = F || "";
|
|
1461
1468
|
}, () => {
|
|
1462
1469
|
});
|
|
1463
1470
|
});
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1466
|
-
}, 100),
|
|
1467
|
-
|
|
1468
|
-
}, 100),
|
|
1469
|
-
|
|
1471
|
+
const N = ce(() => {
|
|
1472
|
+
m.bus.$emit("$loadData.$topForm");
|
|
1473
|
+
}, 100), Ae = ce(() => {
|
|
1474
|
+
m.bus.$emit("$loadData.$form");
|
|
1475
|
+
}, 100), be = (F) => {
|
|
1476
|
+
m.bus.$emit("change-$form." + F);
|
|
1470
1477
|
};
|
|
1471
|
-
return
|
|
1472
|
-
o && (v.top.bus.$on("$loadData.$form",
|
|
1478
|
+
return fr(() => {
|
|
1479
|
+
o && (v.top.bus.$on("$loadData.$form", N), v.top.bus.$on("change", be)), m.mounted();
|
|
1473
1480
|
}), cr(() => {
|
|
1474
|
-
o && (v.top.bus.$off("$loadData.$form",
|
|
1475
|
-
}),
|
|
1476
|
-
|
|
1477
|
-
}),
|
|
1478
|
-
F ?
|
|
1479
|
-
}, { immediate: !0 }),
|
|
1480
|
-
|
|
1481
|
-
}),
|
|
1482
|
-
|
|
1483
|
-
}, { deep: !0 }),
|
|
1481
|
+
o && (v.top.bus.$off("$loadData.$form", N), v.top.bus.$off("change", be)), P && document.head.removeChild(P), ee(), g.destroyed = !0, m.unmount();
|
|
1482
|
+
}), hr(() => {
|
|
1483
|
+
m.updated();
|
|
1484
|
+
}), L(f, (F) => {
|
|
1485
|
+
F ? j() : ee();
|
|
1486
|
+
}, { immediate: !0 }), L(() => [...l.value], (F) => {
|
|
1487
|
+
m.$handle.isBreakWatch() || F.length === g.renderRule.length && F.every((D) => g.renderRule.indexOf(D) > -1) || (m.$handle.updateAppendData(), m.$handle.reloadRule(l.value), n.renderRule());
|
|
1488
|
+
}), L(() => s.option, () => {
|
|
1489
|
+
m.initOptions(), v.refresh();
|
|
1490
|
+
}, { deep: !0 }), L(() => [s.disabled, s.preview], () => {
|
|
1484
1491
|
v.refresh();
|
|
1485
|
-
}),
|
|
1486
|
-
JSON.stringify(F || {}) !==
|
|
1487
|
-
}, { deep: !0, flush: "post" }),
|
|
1488
|
-
v.coverValue({}),
|
|
1489
|
-
|
|
1492
|
+
}), L(u, (F) => {
|
|
1493
|
+
JSON.stringify(F || {}) !== g.updateValue && (v.config.forceCoverValue ? v.coverValue(F || {}) : v.setValue(F || {}));
|
|
1494
|
+
}, { deep: !0, flush: "post" }), L(() => s.index, () => {
|
|
1495
|
+
v.coverValue({}), m.$handle.updateAppendData(), T(() => {
|
|
1496
|
+
T(() => {
|
|
1490
1497
|
v.clearValidateState();
|
|
1491
1498
|
});
|
|
1492
1499
|
});
|
|
1493
|
-
}, { flush: "sync" }),
|
|
1494
|
-
fc:
|
|
1495
|
-
parent: o &&
|
|
1496
|
-
top:
|
|
1497
|
-
fapi:
|
|
1498
|
-
},
|
|
1499
|
-
getGroupInject: () =>
|
|
1500
|
+
}, { flush: "sync" }), q(b({
|
|
1501
|
+
fc: pe(m),
|
|
1502
|
+
parent: o && pe(o),
|
|
1503
|
+
top: pe(a),
|
|
1504
|
+
fapi: pe(v)
|
|
1505
|
+
}, lt(g)), {
|
|
1506
|
+
getGroupInject: () => Se(n, o),
|
|
1500
1507
|
refresh() {
|
|
1501
|
-
++
|
|
1508
|
+
++g.unique;
|
|
1502
1509
|
},
|
|
1503
1510
|
renderRule() {
|
|
1504
|
-
|
|
1511
|
+
g.renderRule = [...l.value || []];
|
|
1505
1512
|
},
|
|
1506
1513
|
updateValue(F) {
|
|
1507
|
-
if (
|
|
1508
|
-
const
|
|
1509
|
-
|
|
1510
|
-
|
|
1514
|
+
if (g.destroyed) return;
|
|
1515
|
+
const D = JSON.stringify(F);
|
|
1516
|
+
g.updateValue !== D && (g.updateValue = D, n.$emit("update:value", F), T(() => {
|
|
1517
|
+
Ae(), o || N();
|
|
1511
1518
|
}));
|
|
1512
1519
|
}
|
|
1513
1520
|
});
|
|
@@ -1517,55 +1524,55 @@ function Mr(t, e, r) {
|
|
|
1517
1524
|
}
|
|
1518
1525
|
};
|
|
1519
1526
|
}
|
|
1520
|
-
const Ft = ["attrs", "props", "domProps", "scopedSlots"],
|
|
1521
|
-
const i = [...Ft, ...r.normal || []], s = [...
|
|
1527
|
+
const Ft = ["attrs", "props", "domProps", "scopedSlots"], Rt = ["class", "style", "directives"], Et = ["on", "nativeOn", "hook"], Y = (t, e = {}, r = {}) => {
|
|
1528
|
+
const i = [...Ft, ...r.normal || []], s = [...Rt, ...r.array || []], n = [...Et, ...r.functional || []], o = r.props || [];
|
|
1522
1529
|
return t.reduce((a, l) => {
|
|
1523
1530
|
for (const u in l)
|
|
1524
1531
|
if (a[u])
|
|
1525
1532
|
if (o.indexOf(u) > -1)
|
|
1526
|
-
a[u] =
|
|
1533
|
+
a[u] = Y([l[u]], a[u]);
|
|
1527
1534
|
else if (i.indexOf(u) > -1)
|
|
1528
1535
|
a[u] = b(b({}, a[u]), l[u]);
|
|
1529
1536
|
else if (s.indexOf(u) > -1) {
|
|
1530
|
-
const
|
|
1531
|
-
a[u] = [...
|
|
1537
|
+
const f = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1538
|
+
a[u] = [...f, ...d];
|
|
1532
1539
|
} else if (n.indexOf(u) > -1)
|
|
1533
|
-
for (const
|
|
1534
|
-
if (a[u][
|
|
1535
|
-
const
|
|
1536
|
-
a[u][
|
|
1540
|
+
for (const f in l[u])
|
|
1541
|
+
if (a[u][f]) {
|
|
1542
|
+
const d = a[u][f] instanceof Array ? a[u][f] : [a[u][f]], g = l[u][f] instanceof Array ? l[u][f] : [l[u][f]];
|
|
1543
|
+
a[u][f] = [...d, ...g];
|
|
1537
1544
|
} else
|
|
1538
|
-
a[u][
|
|
1545
|
+
a[u][f] = l[u][f];
|
|
1539
1546
|
else if (u === "hook")
|
|
1540
|
-
for (let
|
|
1541
|
-
a[u][
|
|
1547
|
+
for (let f in l[u])
|
|
1548
|
+
a[u][f] ? a[u][f] = qr(a[u][f], l[u][f]) : a[u][f] = l[u][f];
|
|
1542
1549
|
else
|
|
1543
1550
|
a[u] = l[u];
|
|
1544
1551
|
else
|
|
1545
1552
|
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = b({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? b({}, l[u]) : l[u] : a[u] = l[u];
|
|
1546
1553
|
return a;
|
|
1547
1554
|
}, e);
|
|
1548
|
-
},
|
|
1555
|
+
}, qr = (t, e) => function() {
|
|
1549
1556
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1550
|
-
},
|
|
1551
|
-
function
|
|
1552
|
-
return [...
|
|
1557
|
+
}, St = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache"], Ze = ["validate", "children", "control"], Ye = ["effect", "deep", "renderSlots"];
|
|
1558
|
+
function kt() {
|
|
1559
|
+
return [...St, ...Ft, ...Rt, ...Et, ...Ze, ...Ye];
|
|
1553
1560
|
}
|
|
1554
|
-
function
|
|
1561
|
+
function Dt(t, e, r) {
|
|
1555
1562
|
return `[form-create ${t}]: ${e}`;
|
|
1556
1563
|
}
|
|
1557
1564
|
function xe(t, e) {
|
|
1558
|
-
console.error(
|
|
1565
|
+
console.error(Dt("err", t));
|
|
1559
1566
|
}
|
|
1560
1567
|
function Ur(t) {
|
|
1561
1568
|
xe(t.toString()), console.error(t);
|
|
1562
1569
|
}
|
|
1563
|
-
function
|
|
1570
|
+
function jt(t) {
|
|
1564
1571
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
1565
1572
|
}
|
|
1566
1573
|
const Je = "[[FORM-CREATE-PREFIX-", We = "-FORM-CREATE-SUFFIX]]";
|
|
1567
1574
|
function et(t, e) {
|
|
1568
|
-
return JSON.stringify(
|
|
1575
|
+
return JSON.stringify(ve(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1569
1576
|
if (!(i && i._isVue === !0)) {
|
|
1570
1577
|
if (typeof i != "function")
|
|
1571
1578
|
return i;
|
|
@@ -1576,7 +1583,7 @@ function et(t, e) {
|
|
|
1576
1583
|
}
|
|
1577
1584
|
}, e);
|
|
1578
1585
|
}
|
|
1579
|
-
function
|
|
1586
|
+
function Te(t) {
|
|
1580
1587
|
return new Function("return " + t)();
|
|
1581
1588
|
}
|
|
1582
1589
|
function K(t, e) {
|
|
@@ -1598,15 +1605,15 @@ function K(t, e) {
|
|
|
1598
1605
|
}, r.__json = t, r.__inject = !0, r;
|
|
1599
1606
|
} else {
|
|
1600
1607
|
if (r.indexOf("$FNX:") === 0)
|
|
1601
|
-
return r =
|
|
1608
|
+
return r = Te("function($inject){" + r.substring(5) + "}"), r.__json = t, r.__inject = !0, r;
|
|
1602
1609
|
(!e && r.indexOf("function ") === 0 && r !== "function " || !e && r.indexOf("function(") === 0 && r !== "function(") && (i = !0);
|
|
1603
1610
|
}
|
|
1604
1611
|
if (!i) return t;
|
|
1605
1612
|
let s;
|
|
1606
1613
|
try {
|
|
1607
|
-
s =
|
|
1614
|
+
s = Te(r);
|
|
1608
1615
|
} catch (n) {
|
|
1609
|
-
s =
|
|
1616
|
+
s = Te("function " + r);
|
|
1610
1617
|
}
|
|
1611
1618
|
return s.__json = t, s;
|
|
1612
1619
|
} catch (s) {
|
|
@@ -1618,21 +1625,21 @@ err: ${s}`);
|
|
|
1618
1625
|
}
|
|
1619
1626
|
return t;
|
|
1620
1627
|
}
|
|
1621
|
-
function
|
|
1628
|
+
function At(t, e) {
|
|
1622
1629
|
return JSON.parse(t, function(r, i) {
|
|
1623
1630
|
return h.Undef(i) || !i.indexOf ? i : K(i, e);
|
|
1624
1631
|
});
|
|
1625
1632
|
}
|
|
1626
|
-
let
|
|
1627
|
-
function
|
|
1628
|
-
const t = 370 + ++
|
|
1633
|
+
let Hr = 0;
|
|
1634
|
+
function je() {
|
|
1635
|
+
const t = 370 + ++Hr;
|
|
1629
1636
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
1630
1637
|
}
|
|
1631
|
-
function
|
|
1638
|
+
function ne(t, e, r) {
|
|
1632
1639
|
let i = t, s;
|
|
1633
1640
|
return (e || "").split(".").forEach((n) => {
|
|
1634
|
-
s && ((!i[s] || typeof i[s] != "object") &&
|
|
1635
|
-
}),
|
|
1641
|
+
s && ((!i[s] || typeof i[s] != "object") && R(i, s, {}), i = i[s]), s = n;
|
|
1642
|
+
}), R(i, s, r), i;
|
|
1636
1643
|
}
|
|
1637
1644
|
function Ke(t, e) {
|
|
1638
1645
|
return {
|
|
@@ -1642,32 +1649,32 @@ function Ke(t, e) {
|
|
|
1642
1649
|
writable: !!e
|
|
1643
1650
|
};
|
|
1644
1651
|
}
|
|
1645
|
-
function At(t, e) {
|
|
1646
|
-
return Vt([t], e || !1)[0];
|
|
1647
|
-
}
|
|
1648
1652
|
function Vt(t, e) {
|
|
1649
|
-
return
|
|
1653
|
+
return It([t], e || !1)[0];
|
|
1654
|
+
}
|
|
1655
|
+
function It(t, e) {
|
|
1656
|
+
return ve([], [...t], e || !1);
|
|
1650
1657
|
}
|
|
1651
|
-
function
|
|
1652
|
-
return
|
|
1658
|
+
function x(t, e) {
|
|
1659
|
+
return Y(Array.isArray(e) ? e : [e], t, { array: Ze, normal: Ye }), t;
|
|
1653
1660
|
}
|
|
1654
1661
|
function ct(t) {
|
|
1655
1662
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1656
1663
|
return e.type || (e.type = "input"), e;
|
|
1657
1664
|
}
|
|
1658
|
-
function
|
|
1665
|
+
function Gr(t, e) {
|
|
1659
1666
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1660
|
-
e[r] && (t[r] =
|
|
1667
|
+
e[r] && (t[r] = x(t[r] || {}, e[r]));
|
|
1661
1668
|
}), t) : e;
|
|
1662
1669
|
}
|
|
1663
|
-
function
|
|
1670
|
+
function Pt(t, e) {
|
|
1664
1671
|
Object.defineProperties(t, Object.keys(e).reduce((r, i) => (r[i] = {
|
|
1665
1672
|
get() {
|
|
1666
1673
|
return e[i]();
|
|
1667
1674
|
}
|
|
1668
1675
|
}, r), {}));
|
|
1669
1676
|
}
|
|
1670
|
-
function
|
|
1677
|
+
function Z(t) {
|
|
1671
1678
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1672
1679
|
}
|
|
1673
1680
|
function O(t, e) {
|
|
@@ -1686,7 +1693,7 @@ function Xe(t, e) {
|
|
|
1686
1693
|
});
|
|
1687
1694
|
}), r;
|
|
1688
1695
|
}
|
|
1689
|
-
function
|
|
1696
|
+
function Jr(t, e) {
|
|
1690
1697
|
if (h.Object(t)) {
|
|
1691
1698
|
const r = {};
|
|
1692
1699
|
return Object.keys(t).forEach((i) => {
|
|
@@ -1695,7 +1702,7 @@ function Gr(t, e) {
|
|
|
1695
1702
|
} else
|
|
1696
1703
|
return Xe(t, e);
|
|
1697
1704
|
}
|
|
1698
|
-
function
|
|
1705
|
+
function Fe() {
|
|
1699
1706
|
const t = {}, e = (r) => r || "default";
|
|
1700
1707
|
return {
|
|
1701
1708
|
setSlot(r, i) {
|
|
@@ -1711,7 +1718,7 @@ function Te() {
|
|
|
1711
1718
|
const n = s();
|
|
1712
1719
|
Array.isArray(n) ? i.push(...n) : i.push(n);
|
|
1713
1720
|
} else h.Undef(s) || i.push(s);
|
|
1714
|
-
}),
|
|
1721
|
+
}), Jr(i, r);
|
|
1715
1722
|
},
|
|
1716
1723
|
getSlots() {
|
|
1717
1724
|
let r = [];
|
|
@@ -1731,27 +1738,27 @@ function Te() {
|
|
|
1731
1738
|
}
|
|
1732
1739
|
};
|
|
1733
1740
|
}
|
|
1734
|
-
function
|
|
1741
|
+
function Re(t, e) {
|
|
1735
1742
|
return Object.setPrototypeOf(t, e), t;
|
|
1736
1743
|
}
|
|
1737
|
-
const
|
|
1738
|
-
"==": (t, e) => JSON.stringify(t) === JSON.stringify(
|
|
1739
|
-
"!=": (t, e) => !
|
|
1744
|
+
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, fe = {
|
|
1745
|
+
"==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
|
|
1746
|
+
"!=": (t, e) => !fe["=="](t, e),
|
|
1740
1747
|
">": (t, e) => t > e,
|
|
1741
1748
|
">=": (t, e) => t >= e,
|
|
1742
1749
|
"<": (t, e) => t < e,
|
|
1743
1750
|
"<=": (t, e) => t <= e,
|
|
1744
1751
|
on(t, e) {
|
|
1745
|
-
return t && t.indexOf && t.indexOf(
|
|
1752
|
+
return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
|
|
1746
1753
|
},
|
|
1747
1754
|
notOn(t, e) {
|
|
1748
|
-
return !
|
|
1755
|
+
return !fe.on(t, e);
|
|
1749
1756
|
},
|
|
1750
1757
|
in(t, e) {
|
|
1751
1758
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1752
1759
|
},
|
|
1753
1760
|
notIn(t, e) {
|
|
1754
|
-
return !
|
|
1761
|
+
return !fe.in(t, e);
|
|
1755
1762
|
},
|
|
1756
1763
|
between(t, e) {
|
|
1757
1764
|
return t > e[0] && t < e[1];
|
|
@@ -1769,12 +1776,12 @@ const ft = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1769
1776
|
return new RegExp(e, "g").test(t);
|
|
1770
1777
|
}
|
|
1771
1778
|
};
|
|
1772
|
-
function
|
|
1779
|
+
function M(t, e) {
|
|
1773
1780
|
return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => {
|
|
1774
1781
|
t != null && (t = t[r]);
|
|
1775
1782
|
}), t;
|
|
1776
1783
|
}
|
|
1777
|
-
function
|
|
1784
|
+
function Wr(t) {
|
|
1778
1785
|
const e = /{{\s*(.*?)\s*}}/g;
|
|
1779
1786
|
let r;
|
|
1780
1787
|
const i = {};
|
|
@@ -1782,13 +1789,13 @@ function Jr(t) {
|
|
|
1782
1789
|
r[1] && (i[r[1]] = !0);
|
|
1783
1790
|
return Object.keys(i);
|
|
1784
1791
|
}
|
|
1785
|
-
function
|
|
1792
|
+
function dt(t) {
|
|
1786
1793
|
let e = t.split("."), r = [], i = "";
|
|
1787
1794
|
return e.forEach((s, n) => {
|
|
1788
1795
|
n === 0 ? i = s : i += "." + s, r.push(i);
|
|
1789
1796
|
}), r.join(" && ");
|
|
1790
1797
|
}
|
|
1791
|
-
function
|
|
1798
|
+
function Tt() {
|
|
1792
1799
|
return {
|
|
1793
1800
|
props: {},
|
|
1794
1801
|
on: {},
|
|
@@ -1807,50 +1814,50 @@ function I(t, e) {
|
|
|
1807
1814
|
};
|
|
1808
1815
|
}
|
|
1809
1816
|
function tt(t, e, r, i, s) {
|
|
1810
|
-
this._data = _(
|
|
1817
|
+
this._data = _(Tt(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1811
1818
|
}
|
|
1812
1819
|
_(tt.prototype, {
|
|
1813
1820
|
getRule() {
|
|
1814
1821
|
return this._data;
|
|
1815
1822
|
},
|
|
1816
1823
|
setProp(t, e) {
|
|
1817
|
-
return
|
|
1824
|
+
return R(this._data, t, e), this;
|
|
1818
1825
|
},
|
|
1819
1826
|
_clone() {
|
|
1820
1827
|
const t = new this.constructor();
|
|
1821
|
-
return t._data =
|
|
1828
|
+
return t._data = Vt(this._data), t;
|
|
1822
1829
|
}
|
|
1823
1830
|
});
|
|
1824
|
-
function
|
|
1831
|
+
function Bt(t) {
|
|
1825
1832
|
t.forEach((e) => {
|
|
1826
1833
|
tt.prototype[e] = function(r) {
|
|
1827
|
-
return
|
|
1834
|
+
return x(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1828
1835
|
};
|
|
1829
1836
|
});
|
|
1830
1837
|
}
|
|
1831
|
-
|
|
1832
|
-
const
|
|
1833
|
-
function
|
|
1834
|
-
let i =
|
|
1838
|
+
Bt(kt());
|
|
1839
|
+
const Lt = I("");
|
|
1840
|
+
function Kr(t, e, r) {
|
|
1841
|
+
let i = Lt("", e);
|
|
1835
1842
|
return i._data.type = t, i._data.title = r, i;
|
|
1836
1843
|
}
|
|
1837
|
-
function
|
|
1838
|
-
let s =
|
|
1844
|
+
function pt(t, e, r, i) {
|
|
1845
|
+
let s = Lt("", r);
|
|
1839
1846
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1840
1847
|
}
|
|
1841
|
-
function
|
|
1848
|
+
function Xr() {
|
|
1842
1849
|
return {
|
|
1843
|
-
create:
|
|
1844
|
-
createTmp:
|
|
1845
|
-
template:
|
|
1850
|
+
create: Kr,
|
|
1851
|
+
createTmp: pt,
|
|
1852
|
+
template: pt,
|
|
1846
1853
|
factory: I
|
|
1847
1854
|
};
|
|
1848
1855
|
}
|
|
1849
|
-
function
|
|
1856
|
+
function zr(t, e, r) {
|
|
1850
1857
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1851
1858
|
return s.status = r.status, s.url = t, s;
|
|
1852
1859
|
}
|
|
1853
|
-
function
|
|
1860
|
+
function mt(t) {
|
|
1854
1861
|
const e = t.responseText || t.response;
|
|
1855
1862
|
if (!e)
|
|
1856
1863
|
return e;
|
|
@@ -1860,38 +1867,40 @@ function pt(t) {
|
|
|
1860
1867
|
return e;
|
|
1861
1868
|
}
|
|
1862
1869
|
}
|
|
1863
|
-
function
|
|
1870
|
+
function Mt(t) {
|
|
1864
1871
|
if (typeof XMLHttpRequest == "undefined")
|
|
1865
1872
|
return;
|
|
1866
1873
|
const e = new XMLHttpRequest();
|
|
1867
1874
|
let r = t.action || "";
|
|
1868
|
-
if (t.
|
|
1875
|
+
if (e.upload && t.onProgress && e.upload.addEventListener("progress", (n) => {
|
|
1876
|
+
n.percent = n.total > 0 ? n.loaded / n.total * 100 : 0, t.onProgress(n);
|
|
1877
|
+
}), t.query) {
|
|
1869
1878
|
const n = new URLSearchParams(t.query).toString();
|
|
1870
|
-
r.includes("?") ? r += `&${n}` : r += `?${n}
|
|
1879
|
+
n && (r.includes("?") ? r += `&${n}` : r += `?${n}`);
|
|
1871
1880
|
}
|
|
1872
1881
|
e.onerror = function(o) {
|
|
1873
1882
|
t.onError(o);
|
|
1874
1883
|
}, e.onload = function() {
|
|
1875
1884
|
if (e.status < 200 || e.status >= 300)
|
|
1876
|
-
return t.onError(
|
|
1877
|
-
t.onSuccess(
|
|
1885
|
+
return t.onError(zr(r, t, e), mt(e));
|
|
1886
|
+
t.onSuccess(mt(e));
|
|
1878
1887
|
}, e.open(t.method || "get", r, !0);
|
|
1879
1888
|
let i;
|
|
1880
|
-
t.data && ((t.dataType || "").toLowerCase() !== "json" ? (i = new FormData(), Object.keys(t.data).map((n) => {
|
|
1889
|
+
(t.data || t.file) && (t.file || (t.dataType || "").toLowerCase() !== "json" ? (i = new FormData(), Object.keys(t.data || {}).map((n) => {
|
|
1881
1890
|
i.append(n, t.data[n]);
|
|
1882
|
-
})) : (i = JSON.stringify(t.data), e.setRequestHeader("content-type", "application/json"))), t.withCredentials && "withCredentials" in e && (e.withCredentials = !0);
|
|
1891
|
+
})) : (i = JSON.stringify(t.data || {}), e.setRequestHeader("content-type", "application/json"))), t.file && i.append(t.filename, t.file, t.file.name), t.withCredentials && "withCredentials" in e && (e.withCredentials = !0);
|
|
1883
1892
|
const s = t.headers || {};
|
|
1884
1893
|
Object.keys(s).forEach((n) => {
|
|
1885
1894
|
s[n] != null && e.setRequestHeader(n, s[n]);
|
|
1886
1895
|
}), e.send(i);
|
|
1887
1896
|
}
|
|
1888
|
-
function
|
|
1897
|
+
function gt(t, e, r) {
|
|
1889
1898
|
return new Promise((i, s) => {
|
|
1890
|
-
(e ||
|
|
1899
|
+
(e || Mt)(q(b({}, t), {
|
|
1891
1900
|
onSuccess(n) {
|
|
1892
1901
|
let o = (l) => l;
|
|
1893
1902
|
const a = K(t.parse);
|
|
1894
|
-
h.Function(a) ? o = a : a && h.String(a) && (o = (l) =>
|
|
1903
|
+
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => M(l, a)), i(o(n, void 0, r));
|
|
1895
1904
|
},
|
|
1896
1905
|
onError(n) {
|
|
1897
1906
|
s(n);
|
|
@@ -1899,17 +1908,17 @@ function mt(t, e, r) {
|
|
|
1899
1908
|
}));
|
|
1900
1909
|
});
|
|
1901
1910
|
}
|
|
1902
|
-
function
|
|
1911
|
+
function ye(t) {
|
|
1903
1912
|
return W(t);
|
|
1904
1913
|
}
|
|
1905
|
-
function
|
|
1914
|
+
function Qr(t) {
|
|
1906
1915
|
function e(n) {
|
|
1907
1916
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1908
1917
|
}
|
|
1909
1918
|
function r(n, o, a) {
|
|
1910
1919
|
e(n).forEach((l) => {
|
|
1911
1920
|
t.getCtxs(l).forEach((u) => {
|
|
1912
|
-
|
|
1921
|
+
R(u.rule, o, a), t.$render.clearCache(u);
|
|
1913
1922
|
});
|
|
1914
1923
|
});
|
|
1915
1924
|
}
|
|
@@ -1967,14 +1976,14 @@ function zr(t) {
|
|
|
1967
1976
|
if (n == null) {
|
|
1968
1977
|
const o = {};
|
|
1969
1978
|
return Object.keys(t.form).forEach((a) => {
|
|
1970
|
-
t.ignoreFields.indexOf(a) === -1 && (o[a] =
|
|
1979
|
+
t.ignoreFields.indexOf(a) === -1 && (o[a] = ye(t.form[a]));
|
|
1971
1980
|
}), o;
|
|
1972
1981
|
} else
|
|
1973
1982
|
return e(n).reduce((o, a) => (o[a] = s.getValue(a), o), {});
|
|
1974
1983
|
},
|
|
1975
1984
|
getValue(n) {
|
|
1976
1985
|
const o = t.getFieldCtx(n);
|
|
1977
|
-
return o ?
|
|
1986
|
+
return o ? ye(o.rule.value) : t.options.appendValue !== !1 && S(t.appendData, n) ? ye(t.appendData[n]) : void 0;
|
|
1978
1987
|
},
|
|
1979
1988
|
coverValue(n) {
|
|
1980
1989
|
const o = b({}, n || {});
|
|
@@ -1982,9 +1991,9 @@ function zr(t) {
|
|
|
1982
1991
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
1983
1992
|
const l = t.fieldCtx[a];
|
|
1984
1993
|
if (l) {
|
|
1985
|
-
const u =
|
|
1986
|
-
l.forEach((
|
|
1987
|
-
|
|
1994
|
+
const u = S(n, a);
|
|
1995
|
+
l.forEach((f) => {
|
|
1996
|
+
f.rule.value = u ? n[a] : void 0;
|
|
1988
1997
|
}), delete o[a];
|
|
1989
1998
|
}
|
|
1990
1999
|
}), _(t.appendData, o);
|
|
@@ -2011,7 +2020,7 @@ function zr(t) {
|
|
|
2011
2020
|
}, !0), o ? o.origin : void 0;
|
|
2012
2021
|
},
|
|
2013
2022
|
removeRule(n) {
|
|
2014
|
-
const o = n &&
|
|
2023
|
+
const o = n && Z(n);
|
|
2015
2024
|
if (o)
|
|
2016
2025
|
return o.rm(), o.origin;
|
|
2017
2026
|
},
|
|
@@ -2021,24 +2030,24 @@ function zr(t) {
|
|
|
2021
2030
|
fields: () => t.fields(),
|
|
2022
2031
|
append: (n, o, a) => {
|
|
2023
2032
|
let l = t.sort.length - 1, u;
|
|
2024
|
-
const
|
|
2025
|
-
if (
|
|
2033
|
+
const f = t.getCtx(o);
|
|
2034
|
+
if (f)
|
|
2026
2035
|
if (a) {
|
|
2027
|
-
if (u =
|
|
2028
|
-
l =
|
|
2036
|
+
if (u = f.getPending("children", f.rule.children), !Array.isArray(u)) return;
|
|
2037
|
+
l = f.rule.children.length - 1;
|
|
2029
2038
|
} else
|
|
2030
|
-
l =
|
|
2039
|
+
l = f.root.indexOf(f.origin), u = f.root;
|
|
2031
2040
|
else u = t.rules;
|
|
2032
2041
|
u.splice(l + 1, 0, n);
|
|
2033
2042
|
},
|
|
2034
2043
|
prepend: (n, o, a) => {
|
|
2035
2044
|
let l = 0, u;
|
|
2036
|
-
const
|
|
2037
|
-
if (
|
|
2045
|
+
const f = t.getCtx(o);
|
|
2046
|
+
if (f)
|
|
2038
2047
|
if (a) {
|
|
2039
|
-
if (u =
|
|
2048
|
+
if (u = f.getPending("children", f.rule.children), !Array.isArray(u)) return;
|
|
2040
2049
|
} else
|
|
2041
|
-
l =
|
|
2050
|
+
l = f.root.indexOf(f.origin), u = f.root;
|
|
2042
2051
|
else u = t.rules;
|
|
2043
2052
|
u.splice(l, 0, n);
|
|
2044
2053
|
},
|
|
@@ -2061,7 +2070,7 @@ function zr(t) {
|
|
|
2061
2070
|
disabled(n, o) {
|
|
2062
2071
|
e(o).forEach((a) => {
|
|
2063
2072
|
t.getCtxs(a).forEach((l) => {
|
|
2064
|
-
|
|
2073
|
+
R(l.rule.props, "disabled", !!n);
|
|
2065
2074
|
});
|
|
2066
2075
|
}), t.refresh();
|
|
2067
2076
|
},
|
|
@@ -2100,7 +2109,7 @@ function zr(t) {
|
|
|
2100
2109
|
n.forEach((a) => s.sync(a));
|
|
2101
2110
|
return;
|
|
2102
2111
|
}
|
|
2103
|
-
let o = h.Object(n) ?
|
|
2112
|
+
let o = h.Object(n) ? Z(n) : t.getCtxs(n);
|
|
2104
2113
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2105
2114
|
if (!a.deleted) {
|
|
2106
2115
|
const l = t.subForm[a.id];
|
|
@@ -2119,7 +2128,7 @@ function zr(t) {
|
|
|
2119
2128
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2120
2129
|
},
|
|
2121
2130
|
hideForm: (n) => {
|
|
2122
|
-
|
|
2131
|
+
R(t.vm, "isShow", !n);
|
|
2123
2132
|
},
|
|
2124
2133
|
changeStatus: () => t.changeStatus,
|
|
2125
2134
|
clearChangeStatus: () => {
|
|
@@ -2137,7 +2146,7 @@ function zr(t) {
|
|
|
2137
2146
|
},
|
|
2138
2147
|
mergeRule: (n, o) => {
|
|
2139
2148
|
t.getCtxs(n).forEach((a) => {
|
|
2140
|
-
|
|
2149
|
+
x(a.rule, o);
|
|
2141
2150
|
});
|
|
2142
2151
|
},
|
|
2143
2152
|
mergeRules(n) {
|
|
@@ -2164,7 +2173,7 @@ function zr(t) {
|
|
|
2164
2173
|
},
|
|
2165
2174
|
setEffect(n, o, a) {
|
|
2166
2175
|
const l = t.getCtx(n);
|
|
2167
|
-
l && o && (o[0] === "$" && (o = o.substr(1)),
|
|
2176
|
+
l && o && (o[0] === "$" && (o = o.substr(1)), S(l.rule, "$" + o) && R(l.rule, "$" + o, a), S(l.rule, "effect") || R(l.rule, "effect", {}), R(l.rule.effect, o, a));
|
|
2168
2177
|
},
|
|
2169
2178
|
clearEffectData(n, o) {
|
|
2170
2179
|
const a = t.getCtx(n);
|
|
@@ -2184,16 +2193,20 @@ function zr(t) {
|
|
|
2184
2193
|
resetFields(n) {
|
|
2185
2194
|
e(n).forEach((o) => {
|
|
2186
2195
|
t.getCtxs(o).forEach((a) => {
|
|
2187
|
-
t.$render.clearCache(a), a.rule.value =
|
|
2196
|
+
t.$render.clearCache(a), a.rule.value = ye(a.defaultValue);
|
|
2197
|
+
});
|
|
2198
|
+
}), T(() => {
|
|
2199
|
+
T(() => {
|
|
2200
|
+
T(() => {
|
|
2201
|
+
s.clearValidateState(n);
|
|
2202
|
+
});
|
|
2188
2203
|
});
|
|
2189
|
-
}), J(() => {
|
|
2190
|
-
s.clearValidateState();
|
|
2191
2204
|
}), n == null && (h.Function(t.options.onReset) && O(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
2192
2205
|
},
|
|
2193
2206
|
method(n, o) {
|
|
2194
2207
|
const a = s.el(n);
|
|
2195
2208
|
if (!a || !a[o])
|
|
2196
|
-
throw new Error(
|
|
2209
|
+
throw new Error(Dt("err", `${o} 方法不存在`));
|
|
2197
2210
|
return (...l) => a[o](...l);
|
|
2198
2211
|
},
|
|
2199
2212
|
exec(n, o, ...a) {
|
|
@@ -2219,21 +2232,21 @@ function zr(t) {
|
|
|
2219
2232
|
return o ? t.subForm[o.id] : void 0;
|
|
2220
2233
|
},
|
|
2221
2234
|
getChildrenRuleList(n) {
|
|
2222
|
-
const o = typeof n == "object", a = o ?
|
|
2235
|
+
const o = typeof n == "object", a = o ? Z(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
|
|
2223
2236
|
if (!l)
|
|
2224
2237
|
return [];
|
|
2225
2238
|
const u = [];
|
|
2226
|
-
return ((
|
|
2227
|
-
|
|
2228
|
-
typeof
|
|
2239
|
+
return ((d) => {
|
|
2240
|
+
d && d.forEach((g) => {
|
|
2241
|
+
typeof g == "object" && (g.field && u.push(g), u.push(...s.getChildrenRuleList(g)));
|
|
2229
2242
|
});
|
|
2230
2243
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2231
2244
|
},
|
|
2232
2245
|
getParentRule(n) {
|
|
2233
|
-
return (typeof n == "object" ?
|
|
2246
|
+
return (typeof n == "object" ? Z(n) : t.getCtx(n)).parent.rule;
|
|
2234
2247
|
},
|
|
2235
2248
|
getParentSubRule(n) {
|
|
2236
|
-
const a = typeof n == "object" ?
|
|
2249
|
+
const a = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2237
2250
|
if (a) {
|
|
2238
2251
|
const l = a.getParentGroup();
|
|
2239
2252
|
if (l)
|
|
@@ -2241,13 +2254,13 @@ function zr(t) {
|
|
|
2241
2254
|
}
|
|
2242
2255
|
},
|
|
2243
2256
|
getChildrenFormData(n) {
|
|
2244
|
-
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] =
|
|
2257
|
+
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] = ye(l.value), a), {});
|
|
2245
2258
|
},
|
|
2246
2259
|
setChildrenFormData(n, o, a) {
|
|
2247
2260
|
const l = s.getChildrenRuleList(n);
|
|
2248
2261
|
t.deferSyncValue(() => {
|
|
2249
2262
|
l.forEach((u) => {
|
|
2250
|
-
|
|
2263
|
+
S(o, u.field) ? u.value = o[u.field] : a && (u.value = void 0);
|
|
2251
2264
|
});
|
|
2252
2265
|
});
|
|
2253
2266
|
},
|
|
@@ -2264,6 +2277,14 @@ function zr(t) {
|
|
|
2264
2277
|
}).catch(a) : o(l.data);
|
|
2265
2278
|
});
|
|
2266
2279
|
},
|
|
2280
|
+
renderRule(n, o, a) {
|
|
2281
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2282
|
+
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2283
|
+
},
|
|
2284
|
+
renderChildren(n, o, a) {
|
|
2285
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2286
|
+
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2287
|
+
},
|
|
2267
2288
|
nextTick(n) {
|
|
2268
2289
|
t.bus.$once("next-tick", n), t.refresh();
|
|
2269
2290
|
},
|
|
@@ -2279,7 +2300,7 @@ function zr(t) {
|
|
|
2279
2300
|
bus: t.bus,
|
|
2280
2301
|
fetch(n) {
|
|
2281
2302
|
return new Promise((o, a) => {
|
|
2282
|
-
n = W(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() =>
|
|
2303
|
+
n = W(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
2283
2304
|
O(() => n.onSuccess && n.onSuccess(l)), o(l);
|
|
2284
2305
|
}).catch((l) => {
|
|
2285
2306
|
O(() => n.onError && n.onError(l)), a(l);
|
|
@@ -2287,12 +2308,12 @@ function zr(t) {
|
|
|
2287
2308
|
});
|
|
2288
2309
|
},
|
|
2289
2310
|
watchFetch(n, o, a, l) {
|
|
2290
|
-
return t.fc.watchLoadData((u,
|
|
2291
|
-
let
|
|
2292
|
-
|
|
2293
|
-
O(() =>
|
|
2294
|
-
}).catch((
|
|
2295
|
-
O(() =>
|
|
2311
|
+
return t.fc.watchLoadData((u, f) => {
|
|
2312
|
+
let d = W(n);
|
|
2313
|
+
d = t.loadFetchVar(d, u), !(l && l(d, f) === !1) && t.beforeFetch(d).then(() => gt(d, t.fc.create.fetch, s).then((g) => {
|
|
2314
|
+
O(() => d.onSuccess && d.onSuccess(g)), o && o(g, f);
|
|
2315
|
+
}).catch((g) => {
|
|
2316
|
+
O(() => d.onError && d.onError(g)), a && a(g);
|
|
2296
2317
|
}));
|
|
2297
2318
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2298
2319
|
},
|
|
@@ -2322,7 +2343,7 @@ function zr(t) {
|
|
|
2322
2343
|
};
|
|
2323
2344
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2324
2345
|
}
|
|
2325
|
-
function
|
|
2346
|
+
function Zr(t) {
|
|
2326
2347
|
_(t.prototype, {
|
|
2327
2348
|
initCache() {
|
|
2328
2349
|
this.clearCacheAll();
|
|
@@ -2358,12 +2379,12 @@ function G(t) {
|
|
|
2358
2379
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2359
2380
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2360
2381
|
});
|
|
2361
|
-
return
|
|
2382
|
+
return Nt(e);
|
|
2362
2383
|
}
|
|
2363
|
-
function
|
|
2384
|
+
function Nt(t) {
|
|
2364
2385
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2365
2386
|
}
|
|
2366
|
-
function
|
|
2387
|
+
function Yr(t) {
|
|
2367
2388
|
_(t.prototype, {
|
|
2368
2389
|
initRender() {
|
|
2369
2390
|
this.cacheConfig = {};
|
|
@@ -2372,7 +2393,7 @@ function Zr(t) {
|
|
|
2372
2393
|
const r = (i) => {
|
|
2373
2394
|
if (i) {
|
|
2374
2395
|
let s;
|
|
2375
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2396
|
+
return e.rule.field && (s = i.$scopedSlots["field-" + $e(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + $e(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2376
2397
|
}
|
|
2377
2398
|
};
|
|
2378
2399
|
return r(this.vm);
|
|
@@ -2381,7 +2402,7 @@ function Zr(t) {
|
|
|
2381
2402
|
if (!this.vm.isShow)
|
|
2382
2403
|
return;
|
|
2383
2404
|
this.$manager.beforeRender();
|
|
2384
|
-
const e =
|
|
2405
|
+
const e = Fe();
|
|
2385
2406
|
return this.sort.forEach((r) => {
|
|
2386
2407
|
this.renderSlot(e, this.$handle.ctxs[r]);
|
|
2387
2408
|
}), this.$manager.render(e);
|
|
@@ -2392,23 +2413,23 @@ function Zr(t) {
|
|
|
2392
2413
|
})) : e.setSlot(r.rule.slot, this.renderCtx(r, i));
|
|
2393
2414
|
},
|
|
2394
2415
|
mergeGlobal(e) {
|
|
2395
|
-
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] =
|
|
2416
|
+
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] = me(() => {
|
|
2396
2417
|
const i = this.$handle.options.global;
|
|
2397
|
-
return
|
|
2398
|
-
})), e.prop =
|
|
2418
|
+
return x({}, [i["*"] || i.default || {}, i[e.originType] || i[e.type] || i[e.type] || {}]);
|
|
2419
|
+
})), e.prop = x({}, [this.cacheConfig[e.trueType].value, e.prop]));
|
|
2399
2420
|
},
|
|
2400
2421
|
setOptions(e) {
|
|
2401
2422
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
2402
|
-
e.prop.options = r, e.prop.optionsTo && r &&
|
|
2423
|
+
e.prop.options = r, e.prop.optionsTo && r && ne(e.prop, e.prop.optionsTo, r);
|
|
2403
2424
|
},
|
|
2404
2425
|
deepSet(e) {
|
|
2405
2426
|
const r = e.rule.deep;
|
|
2406
2427
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2407
|
-
|
|
2428
|
+
ne(e.prop, i, r[i]);
|
|
2408
2429
|
});
|
|
2409
2430
|
},
|
|
2410
2431
|
parseSide(e, r) {
|
|
2411
|
-
return h.Object(e) ?
|
|
2432
|
+
return h.Object(e) ? x({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2412
2433
|
},
|
|
2413
2434
|
renderSides(e, r, i) {
|
|
2414
2435
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2422,7 +2443,7 @@ function Zr(t) {
|
|
|
2422
2443
|
try {
|
|
2423
2444
|
if (e.type === "hidden") return;
|
|
2424
2445
|
const i = e.rule;
|
|
2425
|
-
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2446
|
+
if (this.force || !this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2426
2447
|
let s;
|
|
2427
2448
|
e.initProp(), this.mergeGlobal(e), e.initNone(), this.$manager.tidyRule(e), this.deepSet(e), this.setOptions(e), this.ctxProp(e);
|
|
2428
2449
|
let n = e.prop;
|
|
@@ -2443,12 +2464,22 @@ function Zr(t) {
|
|
|
2443
2464
|
slotValue: l
|
|
2444
2465
|
};
|
|
2445
2466
|
l.length && i.slotUpdate && O(() => i.slotUpdate(u));
|
|
2446
|
-
let
|
|
2447
|
-
const
|
|
2448
|
-
e.parser.renderChildren ?
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2467
|
+
let f = [];
|
|
2468
|
+
const d = e.loadChildrenPending();
|
|
2469
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach((v) => {
|
|
2470
|
+
f.push(this.renderRule({
|
|
2471
|
+
type: "template",
|
|
2472
|
+
slot: v
|
|
2473
|
+
}, (() => {
|
|
2474
|
+
if (h.Function(n.renderSlots[v]))
|
|
2475
|
+
return O(() => n.renderSlots[v]());
|
|
2476
|
+
const w = this.parseSide(n.renderSlots[v], e);
|
|
2477
|
+
return this.renderRule(w);
|
|
2478
|
+
})()));
|
|
2479
|
+
});
|
|
2480
|
+
const g = this.getTypeSlot(e);
|
|
2481
|
+
let m;
|
|
2482
|
+
return g ? (u.children = f, m = g(u)) : m = a ? e.parser.preview(Ge(f), e) : e.parser.render(Ge(f), e), m = this.renderSides(m, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), m = this.$manager.makeWrap(e, m)), e.none && (Array.isArray(m) ? m = m.map((v) => !v || !v.tag ? v : this.none(v)) : m = this.none(m)), o && this.setCache(e, () => this.stable(m), r), m;
|
|
2452
2483
|
}, this.setCache(e, s, r);
|
|
2453
2484
|
}
|
|
2454
2485
|
return (...s) => {
|
|
@@ -2505,6 +2536,7 @@ function Zr(t) {
|
|
|
2505
2536
|
field: e.field,
|
|
2506
2537
|
rule: e.rule,
|
|
2507
2538
|
input: e.input,
|
|
2539
|
+
t: (...s) => this.$handle.api.t(...s),
|
|
2508
2540
|
updateValue: (s) => {
|
|
2509
2541
|
this.$handle.onUpdateValue(e, s);
|
|
2510
2542
|
}
|
|
@@ -2541,17 +2573,21 @@ function Zr(t) {
|
|
|
2541
2573
|
}
|
|
2542
2574
|
}
|
|
2543
2575
|
];
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
this.
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2576
|
+
if (e.input) {
|
|
2577
|
+
const o = this.tmpInput;
|
|
2578
|
+
this.vm.$props.disabled === !0 && (e.prop.props.disabled = !0), e.prop.model = {
|
|
2579
|
+
value: this.$handle.getFormData(e),
|
|
2580
|
+
callback: (a) => {
|
|
2581
|
+
o && o(e.field, a, e.rule), this.onInput(e, a);
|
|
2582
|
+
},
|
|
2583
|
+
expression: `formData.${e.id}`
|
|
2584
|
+
}, e.prop.modelEmit && n.push({
|
|
2585
|
+
on: {
|
|
2586
|
+
[e.prop.modelEmit]: () => this.onEmitInput(e)
|
|
2587
|
+
}
|
|
2588
|
+
});
|
|
2589
|
+
}
|
|
2590
|
+
return Y(n, e.prop), e.prop;
|
|
2555
2591
|
},
|
|
2556
2592
|
onMounted(e) {
|
|
2557
2593
|
e.el = this.vm.$refs[e.ref], e.el && ((e.el.$el || e.el).__rule__ = e.rule), e.parser.mounted(e), this.$handle.effect(e, "mounted"), this.$handle.targetHook(e, "mounted");
|
|
@@ -2568,7 +2604,7 @@ function Zr(t) {
|
|
|
2568
2604
|
},
|
|
2569
2605
|
renderChildren(e, r, i) {
|
|
2570
2606
|
if (!h.trueArray(e)) return [];
|
|
2571
|
-
const s =
|
|
2607
|
+
const s = Fe();
|
|
2572
2608
|
return e.map((n) => {
|
|
2573
2609
|
if (n) {
|
|
2574
2610
|
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
@@ -2577,7 +2613,7 @@ function Zr(t) {
|
|
|
2577
2613
|
}) : n);
|
|
2578
2614
|
if (n.__fc__)
|
|
2579
2615
|
return this.renderSlot(s, n.__fc__, r);
|
|
2580
|
-
n.type &&
|
|
2616
|
+
n.type && T(() => {
|
|
2581
2617
|
this.$handle.loadChildren(e, r), this.$handle.refresh();
|
|
2582
2618
|
});
|
|
2583
2619
|
}
|
|
@@ -2585,7 +2621,17 @@ function Zr(t) {
|
|
|
2585
2621
|
},
|
|
2586
2622
|
defaultRender(e, r) {
|
|
2587
2623
|
const i = e.prop;
|
|
2588
|
-
return i.component ? typeof i.component == "string" ? this.vNode.make(i.component, i, r) : 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(
|
|
2624
|
+
return i.component ? typeof i.component == "string" ? this.vNode.make(i.component, i, r) : 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(Nt(i.type), i, r);
|
|
2625
|
+
},
|
|
2626
|
+
createChildrenVnodes(e, r, i) {
|
|
2627
|
+
this.force = i !== !1, this.tmpInput = r;
|
|
2628
|
+
const s = this.renderChildren(e.rule.children, e);
|
|
2629
|
+
return this.force = !1, this.tmpInput = null, s;
|
|
2630
|
+
},
|
|
2631
|
+
createRuleVnode(e, r, i) {
|
|
2632
|
+
this.force = i !== !1, this.tmpInput = r;
|
|
2633
|
+
const s = Fe();
|
|
2634
|
+
return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
|
|
2589
2635
|
},
|
|
2590
2636
|
renderRule(e, r, i) {
|
|
2591
2637
|
if (!e) return;
|
|
@@ -2599,7 +2645,7 @@ function Zr(t) {
|
|
|
2599
2645
|
a && (s = G(a));
|
|
2600
2646
|
}
|
|
2601
2647
|
if (!s) return;
|
|
2602
|
-
const n =
|
|
2648
|
+
const n = Fe();
|
|
2603
2649
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2604
2650
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2605
2651
|
});
|
|
@@ -2608,7 +2654,7 @@ function Zr(t) {
|
|
|
2608
2654
|
}
|
|
2609
2655
|
});
|
|
2610
2656
|
}
|
|
2611
|
-
let
|
|
2657
|
+
let xr = 1;
|
|
2612
2658
|
function rt(t) {
|
|
2613
2659
|
_(this, {
|
|
2614
2660
|
$handle: t,
|
|
@@ -2616,8 +2662,10 @@ function rt(t) {
|
|
|
2616
2662
|
vm: t.vm,
|
|
2617
2663
|
$manager: t.$manager,
|
|
2618
2664
|
vNode: new t.fc.CreateNode(t.vm),
|
|
2619
|
-
|
|
2620
|
-
|
|
2665
|
+
force: !1,
|
|
2666
|
+
tmpInput: null,
|
|
2667
|
+
id: xr++
|
|
2668
|
+
}), Pt(this, {
|
|
2621
2669
|
options() {
|
|
2622
2670
|
return t.options;
|
|
2623
2671
|
},
|
|
@@ -2626,9 +2674,9 @@ function rt(t) {
|
|
|
2626
2674
|
}
|
|
2627
2675
|
}), this.initCache(), this.initRender();
|
|
2628
2676
|
}
|
|
2629
|
-
Qr(rt);
|
|
2630
2677
|
Zr(rt);
|
|
2631
|
-
|
|
2678
|
+
Yr(rt);
|
|
2679
|
+
function ei(t) {
|
|
2632
2680
|
_(t.prototype, {
|
|
2633
2681
|
parseInjectEvent(e, r) {
|
|
2634
2682
|
const i = e.inject || this.options.injectEvent;
|
|
@@ -2653,19 +2701,19 @@ function xr(t) {
|
|
|
2653
2701
|
},
|
|
2654
2702
|
parseEmit(e, r) {
|
|
2655
2703
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2656
|
-
return h.trueArray(u) && u.forEach((
|
|
2657
|
-
if (!
|
|
2658
|
-
let
|
|
2659
|
-
if (h.Object(
|
|
2660
|
-
r || (
|
|
2661
|
-
const
|
|
2662
|
-
this.vm.$emit(
|
|
2704
|
+
return h.trueArray(u) && u.forEach((f) => {
|
|
2705
|
+
if (!f) return;
|
|
2706
|
+
let d, g = n || o || a;
|
|
2707
|
+
if (h.Object(f) && (d = f.inject, f = f.name, g = f.prefix || g), g) {
|
|
2708
|
+
r || (g = `native-${g}`);
|
|
2709
|
+
const m = $e(`${g}-${f}`), v = (...w) => {
|
|
2710
|
+
this.vm.$emit(m, ...w), this.vm.$emit("emit-event", m, ...w), this.bus.$emit(m, ...w);
|
|
2663
2711
|
};
|
|
2664
|
-
if (v.__emit = !0, !
|
|
2665
|
-
i[
|
|
2712
|
+
if (v.__emit = !0, !d && l === !1)
|
|
2713
|
+
i[f] = v;
|
|
2666
2714
|
else {
|
|
2667
|
-
let w =
|
|
2668
|
-
i[
|
|
2715
|
+
let w = d || l || this.options.injectEvent;
|
|
2716
|
+
i[f] = h.Undef(w) ? v : this.inject(s, v, w);
|
|
2669
2717
|
}
|
|
2670
2718
|
}
|
|
2671
2719
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2693,41 +2741,51 @@ function xr(t) {
|
|
|
2693
2741
|
};
|
|
2694
2742
|
return n.__origin = r, n.__json = r.__json, n;
|
|
2695
2743
|
},
|
|
2696
|
-
loadStrVar(e, r) {
|
|
2744
|
+
loadStrVar(e, r, i) {
|
|
2697
2745
|
if (e && typeof e == "string" && e.indexOf("{{") > -1 && e.indexOf("}}") > -1) {
|
|
2698
|
-
const
|
|
2699
|
-
let
|
|
2700
|
-
if (
|
|
2701
|
-
const
|
|
2702
|
-
if (
|
|
2703
|
-
const
|
|
2704
|
-
|
|
2746
|
+
const s = e, n = Wr(e);
|
|
2747
|
+
let o;
|
|
2748
|
+
if (n.forEach((a) => {
|
|
2749
|
+
const l = a.split("||"), u = l[0].trim();
|
|
2750
|
+
if (u) {
|
|
2751
|
+
const f = (l[1] || "").trim();
|
|
2752
|
+
let d, g = !1;
|
|
2753
|
+
if (i && u.indexOf("$form.") === 0) {
|
|
2754
|
+
const m = u.split(".");
|
|
2755
|
+
m.shift(), S(i.value, m[0]) && (g = !0, d = r ? r({
|
|
2756
|
+
id: "$form." + m[0] + "_" + i.rule.__fc__.id,
|
|
2757
|
+
getValue: () => M(i.value, m)
|
|
2758
|
+
}) : M(i.value, m));
|
|
2759
|
+
}
|
|
2760
|
+
g || (d = r ? r(u, f) : this.fc.getLoadData(u, f)), o = d, e = e.replaceAll(`{{${a}}}`, d == null ? "" : d);
|
|
2705
2761
|
}
|
|
2706
|
-
}),
|
|
2707
|
-
return
|
|
2762
|
+
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2763
|
+
return o;
|
|
2708
2764
|
}
|
|
2709
2765
|
return e;
|
|
2710
2766
|
},
|
|
2711
|
-
loadFetchVar(e, r) {
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2767
|
+
loadFetchVar(e, r, i) {
|
|
2768
|
+
let s;
|
|
2769
|
+
i && i.__fc__ && (s = i.__fc__.getParentGroup());
|
|
2770
|
+
const n = (o) => this.loadStrVar(o, r, s ? { rule: i, value: this.subRuleData[s.id] || {} } : null);
|
|
2771
|
+
return e.action = n(e.action || ""), ["headers", "data", "query"].forEach((o) => {
|
|
2772
|
+
if (e[o]) {
|
|
2773
|
+
const a = {};
|
|
2774
|
+
Object.keys(e[o]).forEach((l) => {
|
|
2775
|
+
a[n(l)] = n(e[o][l]);
|
|
2776
|
+
}), e[o] = a;
|
|
2719
2777
|
}
|
|
2720
2778
|
}), e;
|
|
2721
2779
|
}
|
|
2722
2780
|
});
|
|
2723
2781
|
}
|
|
2724
|
-
const
|
|
2725
|
-
function
|
|
2782
|
+
const yt = ["hook:updated", "hook:mounted"];
|
|
2783
|
+
function ti(t) {
|
|
2726
2784
|
_(t.prototype, {
|
|
2727
2785
|
usePage() {
|
|
2728
2786
|
const e = this.options.page;
|
|
2729
2787
|
if (!e) return;
|
|
2730
|
-
let r = 25, i =
|
|
2788
|
+
let r = 25, i = ri(this.rules);
|
|
2731
2789
|
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), _(this, {
|
|
2732
2790
|
first: r,
|
|
2733
2791
|
limit: i,
|
|
@@ -2736,16 +2794,16 @@ function ei(t) {
|
|
|
2736
2794
|
},
|
|
2737
2795
|
pageLoad() {
|
|
2738
2796
|
const e = () => {
|
|
2739
|
-
this.pageEnd ? (this.vm.$off(
|
|
2797
|
+
this.pageEnd ? (this.vm.$off(yt, e), this.bus.$emit("page-end")) : (this.first += this.limit, this.pageEnd = this.rules.length <= this.first, this.loadRule(), this.refresh());
|
|
2740
2798
|
};
|
|
2741
|
-
this.vm.$on(
|
|
2799
|
+
this.vm.$on(yt, e);
|
|
2742
2800
|
}
|
|
2743
2801
|
});
|
|
2744
2802
|
}
|
|
2745
|
-
function
|
|
2803
|
+
function ri(t) {
|
|
2746
2804
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2747
2805
|
}
|
|
2748
|
-
function
|
|
2806
|
+
function ii(t) {
|
|
2749
2807
|
_(t.prototype, {
|
|
2750
2808
|
clearNextTick() {
|
|
2751
2809
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
@@ -2760,15 +2818,15 @@ function ri(t) {
|
|
|
2760
2818
|
}
|
|
2761
2819
|
});
|
|
2762
2820
|
}
|
|
2763
|
-
function
|
|
2821
|
+
function ni(t) {
|
|
2764
2822
|
Object.defineProperties(t.origin, {
|
|
2765
|
-
__fc__: Ke(
|
|
2823
|
+
__fc__: Ke(pe(t), !0)
|
|
2766
2824
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2767
|
-
__fc__: Ke(
|
|
2825
|
+
__fc__: Ke(pe(t), !0)
|
|
2768
2826
|
});
|
|
2769
2827
|
}
|
|
2770
|
-
function
|
|
2771
|
-
const i =
|
|
2828
|
+
function qt(t, e, r) {
|
|
2829
|
+
const i = je(), s = !!e.field;
|
|
2772
2830
|
_(this, {
|
|
2773
2831
|
id: i,
|
|
2774
2832
|
ref: i,
|
|
@@ -2795,9 +2853,9 @@ function Nt(t, e, r) {
|
|
|
2795
2853
|
exportEl: void 0,
|
|
2796
2854
|
defaultValue: s ? W(r) : void 0,
|
|
2797
2855
|
field: e.field || void 0
|
|
2798
|
-
}), this.updateKey(),
|
|
2856
|
+
}), this.updateKey(), ni(this), this.update(t, !0);
|
|
2799
2857
|
}
|
|
2800
|
-
_(
|
|
2858
|
+
_(qt.prototype, {
|
|
2801
2859
|
getParentGroup() {
|
|
2802
2860
|
let t = this.parent;
|
|
2803
2861
|
for (; t; ) {
|
|
@@ -2834,8 +2892,8 @@ _(Nt.prototype, {
|
|
|
2834
2892
|
rule: this.rule,
|
|
2835
2893
|
api: this.$api,
|
|
2836
2894
|
update: (u) => {
|
|
2837
|
-
const
|
|
2838
|
-
this.setPending(e, r,
|
|
2895
|
+
const f = u || i, d = this.getPending(e, i);
|
|
2896
|
+
this.setPending(e, r, f), o && o(f, d);
|
|
2839
2897
|
},
|
|
2840
2898
|
reload: () => {
|
|
2841
2899
|
const u = this.getPending(e, i);
|
|
@@ -2843,8 +2901,8 @@ _(Nt.prototype, {
|
|
|
2843
2901
|
}
|
|
2844
2902
|
}));
|
|
2845
2903
|
l && h.Function(l.then) ? (l.then((u) => {
|
|
2846
|
-
const
|
|
2847
|
-
this.setPending(e, r,
|
|
2904
|
+
const f = u || i;
|
|
2905
|
+
this.setPending(e, r, f), s && s(f), this.$api && this.$api.sync(this.rule);
|
|
2848
2906
|
}).catch((u) => {
|
|
2849
2907
|
console.error(u);
|
|
2850
2908
|
}), a = i, this.setPending(e, r, a)) : (a = l || i, this.setPending(e, r, a), s && s(a));
|
|
@@ -2857,7 +2915,7 @@ _(Nt.prototype, {
|
|
|
2857
2915
|
setPending(t, e, r) {
|
|
2858
2916
|
this.pending[t] = {
|
|
2859
2917
|
origin: e,
|
|
2860
|
-
value:
|
|
2918
|
+
value: ie(r)
|
|
2861
2919
|
};
|
|
2862
2920
|
},
|
|
2863
2921
|
effectData(t) {
|
|
@@ -2867,7 +2925,7 @@ _(Nt.prototype, {
|
|
|
2867
2925
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2868
2926
|
},
|
|
2869
2927
|
updateKey(t) {
|
|
2870
|
-
this.key =
|
|
2928
|
+
this.key = je(), t && this.parent && this.parent.updateKey(t);
|
|
2871
2929
|
},
|
|
2872
2930
|
updateType() {
|
|
2873
2931
|
this.originType = this.rule.type, this.type = G(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
@@ -2876,8 +2934,9 @@ _(Nt.prototype, {
|
|
|
2876
2934
|
this.parser = t, t.init(this);
|
|
2877
2935
|
},
|
|
2878
2936
|
initProp() {
|
|
2937
|
+
var e, r;
|
|
2879
2938
|
const t = b({}, this.rule);
|
|
2880
|
-
delete t.children, delete t.validate, this.prop =
|
|
2939
|
+
delete t.children, delete t.validate, this.prop = x({}, [t, ...Object.keys(this.payload).map((i) => this.payload[i]), this.computed]), this.prop.validate = [...((r = (e = this.refRule) == null ? void 0 : e.__$validate) == null ? void 0 : r.value) || [], ...this.prop.validate || []];
|
|
2881
2940
|
},
|
|
2882
2941
|
initNone() {
|
|
2883
2942
|
this.none = !(h.Undef(this.prop.display) || this.prop.display);
|
|
@@ -2943,11 +3002,11 @@ _(Nt.prototype, {
|
|
|
2943
3002
|
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2944
3003
|
}
|
|
2945
3004
|
});
|
|
2946
|
-
function
|
|
3005
|
+
function si(t) {
|
|
2947
3006
|
_(t.prototype, {
|
|
2948
3007
|
nextRefresh(e) {
|
|
2949
3008
|
const r = this.loadedId;
|
|
2950
|
-
|
|
3009
|
+
T(() => {
|
|
2951
3010
|
r === this.loadedId && (e ? e() : this.refresh());
|
|
2952
3011
|
});
|
|
2953
3012
|
},
|
|
@@ -2955,7 +3014,7 @@ function ni(t) {
|
|
|
2955
3014
|
const r = ct(e);
|
|
2956
3015
|
return Object.defineProperties(r, {
|
|
2957
3016
|
__origin__: Ke(e, !0)
|
|
2958
|
-
}),
|
|
3017
|
+
}), oi(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
2959
3018
|
i && this.loadFn(i, r);
|
|
2960
3019
|
}), this.loadCtrl(r), r.update && (r.update = K(r.update)), r;
|
|
2961
3020
|
},
|
|
@@ -2971,7 +3030,7 @@ function ni(t) {
|
|
|
2971
3030
|
},
|
|
2972
3031
|
syncProp(e) {
|
|
2973
3032
|
const r = e.rule;
|
|
2974
|
-
h.trueArray(r.sync) &&
|
|
3033
|
+
h.trueArray(r.sync) && Y([{
|
|
2975
3034
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
2976
3035
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
2977
3036
|
}, i), {})
|
|
@@ -3005,34 +3064,34 @@ function ni(t) {
|
|
|
3005
3064
|
let l = ct(o);
|
|
3006
3065
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3007
3066
|
this.fc.targetFormDriver("loadRule", { rule: l, api: this.api }, this.fc), this.ruleEffect(l, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", o, this.api);
|
|
3008
|
-
let
|
|
3009
|
-
if (
|
|
3010
|
-
if (
|
|
3011
|
-
if (
|
|
3067
|
+
let f, d = !1, g = !!o.__fc__, m = l.value;
|
|
3068
|
+
if (g) {
|
|
3069
|
+
if (f = o.__fc__, m = f.defaultValue, f.deleted) {
|
|
3070
|
+
if ($t(f))
|
|
3012
3071
|
return;
|
|
3013
|
-
|
|
3014
|
-
} else if (!
|
|
3015
|
-
if (
|
|
3072
|
+
f.update(this);
|
|
3073
|
+
} else if (!f.check(this)) {
|
|
3074
|
+
if ($t(f))
|
|
3016
3075
|
return;
|
|
3017
|
-
e[a] = o = o._clone ? o._clone() :
|
|
3076
|
+
e[a] = o = o._clone ? o._clone() : At(et(o)), f = null, d = !0;
|
|
3018
3077
|
}
|
|
3019
3078
|
}
|
|
3020
|
-
if (
|
|
3021
|
-
|
|
3079
|
+
if (f)
|
|
3080
|
+
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3022
3081
|
else {
|
|
3023
|
-
const
|
|
3024
|
-
|
|
3082
|
+
const j = this.parseRule(o);
|
|
3083
|
+
f = new qt(this, j, m), this.bindParser(f);
|
|
3025
3084
|
}
|
|
3026
|
-
[!1, !0].forEach((
|
|
3027
|
-
const v =
|
|
3028
|
-
if (
|
|
3029
|
-
const
|
|
3030
|
-
|
|
3085
|
+
[!1, !0].forEach((j) => this.parseEmit(f, j)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !d && !g && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
|
|
3086
|
+
const v = f.loadChildrenPending();
|
|
3087
|
+
if (f.parser.loadChildren === !1 || s(v, f), !r) {
|
|
3088
|
+
const j = i(a);
|
|
3089
|
+
j > -1 || !a ? this.sort.splice(j + 1, 0, f.id) : this.sort.push(f.id);
|
|
3031
3090
|
}
|
|
3032
|
-
const w =
|
|
3033
|
-
return
|
|
3034
|
-
this.refreshUpdate(
|
|
3035
|
-
}), this.effect(
|
|
3091
|
+
const w = f.rule;
|
|
3092
|
+
return f.updated || (f.updated = !0, h.Function(w.update) && this.bus.$once("load-end", () => {
|
|
3093
|
+
this.refreshUpdate(f, w.value, "init");
|
|
3094
|
+
}), this.effect(f, "loaded")), this.refreshControl(f) && (this.cycleLoad = !0), f;
|
|
3036
3095
|
}).filter((o) => !!o);
|
|
3037
3096
|
r && (r.children = n);
|
|
3038
3097
|
},
|
|
@@ -3040,31 +3099,31 @@ function ni(t) {
|
|
|
3040
3099
|
return e.input && e.rule.control && this.useCtrl(e);
|
|
3041
3100
|
},
|
|
3042
3101
|
useCtrl(e) {
|
|
3043
|
-
const r =
|
|
3102
|
+
const r = ai(e), i = [], s = this.api;
|
|
3044
3103
|
if (!r.length) return !1;
|
|
3045
3104
|
for (let a = 0; a < r.length; a++) {
|
|
3046
|
-
const l = r[a], u = l.handle || function(
|
|
3047
|
-
return (
|
|
3105
|
+
const l = r[a], u = l.handle || function(d) {
|
|
3106
|
+
return (fe[l.condition || "=="] || fe["=="])(d, l.value);
|
|
3048
3107
|
};
|
|
3049
3108
|
if (!h.trueArray(l.rule)) continue;
|
|
3050
|
-
const
|
|
3109
|
+
const f = q(b({}, l), {
|
|
3051
3110
|
valid: O(() => u(e.rule.value, s)),
|
|
3052
|
-
ctrl:
|
|
3111
|
+
ctrl: li(e, l.rule),
|
|
3053
3112
|
isHidden: h.String(l.rule[0])
|
|
3054
3113
|
});
|
|
3055
|
-
|
|
3114
|
+
f.valid && f.ctrl || !f.valid && !f.ctrl && !f.isHidden || i.push(f);
|
|
3056
3115
|
}
|
|
3057
3116
|
if (!i.length) return !1;
|
|
3058
3117
|
const n = [];
|
|
3059
3118
|
let o = !1;
|
|
3060
3119
|
return this.deferSyncValue(() => {
|
|
3061
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend:
|
|
3120
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: d, child: g, ctrl: m, method: v }) => {
|
|
3062
3121
|
if (a) {
|
|
3063
3122
|
l ? e.ctrlRule.push({
|
|
3064
3123
|
__ctrl: !0,
|
|
3065
3124
|
children: u,
|
|
3066
3125
|
valid: l
|
|
3067
|
-
}) :
|
|
3126
|
+
}) : m && e.ctrlRule.splice(e.ctrlRule.indexOf(m) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3068
3127
|
v === "disabled" || v === "enabled" ? this.api.disabled(!l, u) : v === "display" ? this.api.display(l, u) : v === "required" ? (u.forEach((w) => {
|
|
3069
3128
|
this.api.setEffect(w, "required", l);
|
|
3070
3129
|
}), l || this.api.clearValidateState(u)) : this.api.hidden(!l, u);
|
|
@@ -3080,17 +3139,17 @@ function ni(t) {
|
|
|
3080
3139
|
children: u
|
|
3081
3140
|
};
|
|
3082
3141
|
e.ctrlRule.push(w), this.bus.$once("load-start", () => {
|
|
3083
|
-
|
|
3142
|
+
f ? s.prepend(w, f, g) : d || g ? s.append(w, d || e.id, g) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, w);
|
|
3084
3143
|
});
|
|
3085
3144
|
} else {
|
|
3086
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3087
|
-
const w =
|
|
3145
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(m), 1);
|
|
3146
|
+
const w = Z(m);
|
|
3088
3147
|
w && w.rm();
|
|
3089
3148
|
}
|
|
3090
3149
|
});
|
|
3091
3150
|
}), n.length && (this.loading ? n.length && this.bus.$once("load-end", () => {
|
|
3092
3151
|
n.forEach((a) => a());
|
|
3093
|
-
}) : n.length &&
|
|
3152
|
+
}) : n.length && T(() => {
|
|
3094
3153
|
n.forEach((a) => a());
|
|
3095
3154
|
})), this.vm.$emit("control", e.origin, this.api), this.effect(e, "control"), o;
|
|
3096
3155
|
},
|
|
@@ -3112,33 +3171,39 @@ function ni(t) {
|
|
|
3112
3171
|
}
|
|
3113
3172
|
});
|
|
3114
3173
|
}
|
|
3115
|
-
function
|
|
3116
|
-
const e =
|
|
3174
|
+
function oi(t) {
|
|
3175
|
+
const e = Tt();
|
|
3117
3176
|
return Object.keys(e).forEach((r) => {
|
|
3118
|
-
|
|
3177
|
+
S(t, r) || R(t, r, e[r]);
|
|
3119
3178
|
}), t;
|
|
3120
3179
|
}
|
|
3121
|
-
function
|
|
3180
|
+
function ai(t) {
|
|
3122
3181
|
const e = t.rule.control || [];
|
|
3123
3182
|
return h.Object(e) ? [e] : e;
|
|
3124
3183
|
}
|
|
3125
|
-
function
|
|
3184
|
+
function li(t, e) {
|
|
3126
3185
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
3127
3186
|
const i = t.ctrlRule[r];
|
|
3128
3187
|
if (i.children === e)
|
|
3129
3188
|
return i;
|
|
3130
3189
|
}
|
|
3131
3190
|
}
|
|
3132
|
-
function
|
|
3191
|
+
function $t(t) {
|
|
3133
3192
|
return !!t.rule.__ctrl;
|
|
3134
3193
|
}
|
|
3135
|
-
function
|
|
3194
|
+
function ui(t) {
|
|
3136
3195
|
_(t.prototype, {
|
|
3137
3196
|
setValue(e, r, i, s) {
|
|
3138
3197
|
e.deleted || (e.rule.value = 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.targetHook(e, "value", { value: r }), this.emitEvent("change", e.field, r, {
|
|
3139
3198
|
rule: e.origin,
|
|
3140
3199
|
api: this.api,
|
|
3141
3200
|
setFlag: s || !1
|
|
3201
|
+
}), s && T(() => {
|
|
3202
|
+
T(() => {
|
|
3203
|
+
T(() => {
|
|
3204
|
+
this.api.clearValidateState(e.id);
|
|
3205
|
+
});
|
|
3206
|
+
});
|
|
3142
3207
|
}));
|
|
3143
3208
|
},
|
|
3144
3209
|
onInput(e, r) {
|
|
@@ -3149,7 +3214,7 @@ function li(t) {
|
|
|
3149
3214
|
this.deferSyncValue(() => {
|
|
3150
3215
|
const i = e.getParentGroup(), s = i ? this.subRuleData[i.id] : null, n = {};
|
|
3151
3216
|
Object.keys(r || {}).forEach((o) => {
|
|
3152
|
-
s &&
|
|
3217
|
+
s && S(s, o) ? n[o] = r[o] : S(this.api.form, o) ? this.api.form[o] = r[o] : this.api.top !== this.api && S(this.api.top.form, o) && (this.api.top.form[o] = r[o]);
|
|
3153
3218
|
}), Object.keys(n).length && this.api.setChildrenFormData(i.rule, n);
|
|
3154
3219
|
});
|
|
3155
3220
|
},
|
|
@@ -3159,27 +3224,27 @@ function li(t) {
|
|
|
3159
3224
|
setFormData(e, r) {
|
|
3160
3225
|
e.modelValue = r;
|
|
3161
3226
|
const i = e.getParentGroup();
|
|
3162
|
-
i && (this.subRuleData[i.id] ||
|
|
3227
|
+
i && (this.subRuleData[i.id] || R(this.subRuleData, i.id, {}), R(this.subRuleData[i.id], e.field, e.rule.value)), R(this.formData, e.id, r);
|
|
3163
3228
|
},
|
|
3164
3229
|
rmSubRuleData(e) {
|
|
3165
3230
|
const r = e.getParentGroup();
|
|
3166
|
-
r && this.subRuleData[r.id] &&
|
|
3231
|
+
r && this.subRuleData[r.id] && re(this.subRuleData[r.id], e.field);
|
|
3167
3232
|
},
|
|
3168
3233
|
getFormData(e) {
|
|
3169
3234
|
return this.formData[e.id];
|
|
3170
3235
|
},
|
|
3171
3236
|
syncForm() {
|
|
3172
3237
|
const e = {}, r = this.fields(), i = [];
|
|
3173
|
-
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] =
|
|
3238
|
+
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] = De(this.appendData, n)), s), e), r.reduce((s, n) => {
|
|
3174
3239
|
const o = (this.fieldCtx[n] || []).filter((a) => !this.isIgnore(a.rule))[0] || this.fieldCtx[n][0];
|
|
3175
|
-
return this.isIgnore(o.rule) && i.push(n), s[n] =
|
|
3176
|
-
}, e), this.form =
|
|
3240
|
+
return this.isIgnore(o.rule) && i.push(n), s[n] = De(o.rule, "value"), s;
|
|
3241
|
+
}, e), this.form = ie(e), this.ignoreFields = i, this.syncValue();
|
|
3177
3242
|
},
|
|
3178
3243
|
isIgnore(e) {
|
|
3179
3244
|
return e.ignore === !0 || e.ignore === "hidden" && e.hidden || this.options.ignoreHiddenFields && e.hidden;
|
|
3180
3245
|
},
|
|
3181
3246
|
appendValue(e) {
|
|
3182
|
-
(!e.field || !
|
|
3247
|
+
(!e.field || !S(this.appendData, e.field)) && !this.options.forceCoverValue || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
3183
3248
|
},
|
|
3184
3249
|
addSubForm(e, r) {
|
|
3185
3250
|
this.subForm[e.id] = r;
|
|
@@ -3196,7 +3261,7 @@ function li(t) {
|
|
|
3196
3261
|
}), this.vm.updateValue(e);
|
|
3197
3262
|
},
|
|
3198
3263
|
isChange(e, r) {
|
|
3199
|
-
return JSON.stringify(this.getFormData(e),
|
|
3264
|
+
return JSON.stringify(this.getFormData(e), vt) !== JSON.stringify(r, vt);
|
|
3200
3265
|
},
|
|
3201
3266
|
isQuote(e, r) {
|
|
3202
3267
|
return (h.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
@@ -3229,10 +3294,10 @@ function li(t) {
|
|
|
3229
3294
|
}
|
|
3230
3295
|
});
|
|
3231
3296
|
}
|
|
3232
|
-
function
|
|
3297
|
+
function vt(t, e) {
|
|
3233
3298
|
return typeof e == "function" ? "" + e : e;
|
|
3234
3299
|
}
|
|
3235
|
-
const
|
|
3300
|
+
const ke = {
|
|
3236
3301
|
init(t) {
|
|
3237
3302
|
},
|
|
3238
3303
|
toFormValue(t, e) {
|
|
@@ -3251,7 +3316,7 @@ const Ee = {
|
|
|
3251
3316
|
},
|
|
3252
3317
|
mergeProp(t) {
|
|
3253
3318
|
}
|
|
3254
|
-
},
|
|
3319
|
+
}, fi = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"];
|
|
3255
3320
|
function ci(t) {
|
|
3256
3321
|
_(t.prototype, {
|
|
3257
3322
|
getCtx(e) {
|
|
@@ -3287,7 +3352,7 @@ function ci(t) {
|
|
|
3287
3352
|
if (n)
|
|
3288
3353
|
return n;
|
|
3289
3354
|
}
|
|
3290
|
-
return r[e.originType] || r[G(e.type)] || r[e.trueType] ||
|
|
3355
|
+
return r[e.originType] || r[G(e.type)] || r[e.trueType] || ke;
|
|
3291
3356
|
},
|
|
3292
3357
|
bindParser(e) {
|
|
3293
3358
|
e.setParser(this.getParser(e));
|
|
@@ -3300,18 +3365,18 @@ function ci(t) {
|
|
|
3300
3365
|
this.noWatchFn || (this.noWatchFn = e), O(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
3301
3366
|
},
|
|
3302
3367
|
watchCtx(e) {
|
|
3303
|
-
if (
|
|
3304
|
-
const s =
|
|
3305
|
-
e.refRule[i] = s, e.watch.push(
|
|
3368
|
+
if (kt().filter((i) => i[0] !== "_" && i[0] !== "$" && fi.indexOf(i) === -1).forEach((i) => {
|
|
3369
|
+
const s = De(e.rule, i), n = i === "children";
|
|
3370
|
+
e.refRule[i] = s, e.watch.push(L(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3306
3371
|
let l = s.value;
|
|
3307
3372
|
if (!this.isBreakWatch()) {
|
|
3308
3373
|
if (n && e.parser.loadChildren === !1) {
|
|
3309
3374
|
this.$render.clearCache(e), this.nextRefresh();
|
|
3310
3375
|
return;
|
|
3311
3376
|
}
|
|
3312
|
-
if (this.watching = !0,
|
|
3377
|
+
if (this.watching = !0, T(() => {
|
|
3313
3378
|
this.targetHook(e, "watch", { key: i, oldValue: a, newValue: l });
|
|
3314
|
-
}), i === "hidden" && !!l != !!a && (this.$render.clearCacheAll(),
|
|
3379
|
+
}), i === "hidden" && !!l != !!a && (this.$render.clearCacheAll(), T(() => {
|
|
3315
3380
|
this.targetHook(e, "hidden", { value: l });
|
|
3316
3381
|
})), i === "ignore" && e.input || i === "hidden" && e.input && (e.rule.ignore === "hidden" || this.options.ignoreHiddenFields))
|
|
3317
3382
|
this.syncForm();
|
|
@@ -3322,21 +3387,21 @@ function ci(t) {
|
|
|
3322
3387
|
this.$render.clearCache(e), this.refresh(), this.watching = !1;
|
|
3323
3388
|
}
|
|
3324
3389
|
}, { deep: !n, sync: n }));
|
|
3325
|
-
}), e.refRule.__$title =
|
|
3390
|
+
}), e.refRule.__$title = me(() => {
|
|
3326
3391
|
let i = (typeof e.rule.title == "object" ? e.rule.title.title : e.rule.title) || "";
|
|
3327
3392
|
if (i) {
|
|
3328
3393
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3329
3394
|
s && (i = this.api.t(s[1]));
|
|
3330
3395
|
}
|
|
3331
3396
|
return i;
|
|
3332
|
-
}), e.refRule.__$info =
|
|
3397
|
+
}), e.refRule.__$info = me(() => {
|
|
3333
3398
|
let i = (typeof e.rule.info == "object" ? e.rule.info.info : e.rule.info) || "";
|
|
3334
3399
|
if (i) {
|
|
3335
3400
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3336
3401
|
s && (i = this.api.t(s[1]));
|
|
3337
3402
|
}
|
|
3338
3403
|
return i;
|
|
3339
|
-
}), e.refRule.__$validate =
|
|
3404
|
+
}), e.refRule.__$validate = me(() => H(e.rule.validate).map((i) => {
|
|
3340
3405
|
const s = b({}, i);
|
|
3341
3406
|
if (s.message) {
|
|
3342
3407
|
const n = s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
@@ -3356,8 +3421,8 @@ function ci(t) {
|
|
|
3356
3421
|
}
|
|
3357
3422
|
return s;
|
|
3358
3423
|
})), e.input) {
|
|
3359
|
-
const i =
|
|
3360
|
-
e.watch.push(
|
|
3424
|
+
const i = De(e.rule, "value");
|
|
3425
|
+
e.watch.push(L(() => i.value, () => {
|
|
3361
3426
|
let s = e.parser.toFormValue(i.value, e);
|
|
3362
3427
|
this.isChange(e, s) && this.setValue(e, i.value, s, !0);
|
|
3363
3428
|
}));
|
|
@@ -3366,15 +3431,15 @@ function ci(t) {
|
|
|
3366
3431
|
let i = e.rule.computed;
|
|
3367
3432
|
i && (typeof i != "object" && (i = { value: i }), Object.keys(i).forEach((s) => {
|
|
3368
3433
|
let n;
|
|
3369
|
-
const o =
|
|
3434
|
+
const o = me(() => {
|
|
3370
3435
|
const l = i[s];
|
|
3371
3436
|
if (!l) return;
|
|
3372
3437
|
const u = this.compute(e, l);
|
|
3373
3438
|
return l.linkage && u === void 0 ? n : u;
|
|
3374
3439
|
}), a = (l) => {
|
|
3375
|
-
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) :
|
|
3440
|
+
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) : ne(e.rule, s, l);
|
|
3376
3441
|
};
|
|
3377
|
-
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !==
|
|
3442
|
+
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !== M(e.rule, s)) && a(o.value), e.watch.push(L(o, (l) => {
|
|
3378
3443
|
n = l, setTimeout(() => {
|
|
3379
3444
|
a(l);
|
|
3380
3445
|
});
|
|
@@ -3390,19 +3455,19 @@ function ci(t) {
|
|
|
3390
3455
|
return !0;
|
|
3391
3456
|
const l = a.mode === "OR";
|
|
3392
3457
|
let u = !0;
|
|
3393
|
-
for (let
|
|
3394
|
-
const
|
|
3395
|
-
let
|
|
3396
|
-
if (
|
|
3397
|
-
|
|
3398
|
-
else if (
|
|
3399
|
-
|
|
3458
|
+
for (let f = 0; f < a.group.length; f++) {
|
|
3459
|
+
const d = a.group[f];
|
|
3460
|
+
let g, m = null;
|
|
3461
|
+
if (d.variable)
|
|
3462
|
+
m = JSON.stringify(this.fc.getLoadData(d.variable) || "");
|
|
3463
|
+
else if (d.field)
|
|
3464
|
+
m = dt(d.field || "");
|
|
3400
3465
|
else
|
|
3401
3466
|
return !0;
|
|
3402
|
-
let v =
|
|
3403
|
-
if (v && (v =
|
|
3467
|
+
let v = d.compare;
|
|
3468
|
+
if (v && (v = dt(v || "")), d.mode ? g = n(d) : fe[d.condition] ? h.Function(d.handler) ? g = O(() => d.handler(this.api, e.rule)) : g = O(() => new Function("$condition", "$val", "$form", "$group", "$rule", `with($form){with(this){with($group){ return $condition['${d.condition}'](${m}, ${v || "$val"}); }}}`).call(this.api.form, fe, d.value, this.api.top.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : g = !1, l && g)
|
|
3404
3469
|
return !0;
|
|
3405
|
-
l || (u = u &&
|
|
3470
|
+
l || (u = u && g);
|
|
3406
3471
|
}
|
|
3407
3472
|
return l ? !1 : u;
|
|
3408
3473
|
};
|
|
@@ -3442,9 +3507,9 @@ function ci(t) {
|
|
|
3442
3507
|
rmCtx(e) {
|
|
3443
3508
|
if (e.deleted) return;
|
|
3444
3509
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3445
|
-
|
|
3510
|
+
re(this.ctxs, r), re(this.formData, r), re(this.subForm, r), re(this.vm.ctxInject, r);
|
|
3446
3511
|
const o = e.getParentGroup();
|
|
3447
|
-
o && this.subRuleData[o.id] &&
|
|
3512
|
+
o && this.subRuleData[o.id] && re(this.subRuleData[o.id], i), e.group && re(this.subRuleData, r), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !S(this.fieldCtx, i) && re(this.form, i), this.deferSyncValue(() => {
|
|
3448
3513
|
if (!this.reloading) {
|
|
3449
3514
|
if (e.parser.loadChildren !== !1) {
|
|
3450
3515
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3458,7 +3523,7 @@ function ci(t) {
|
|
|
3458
3523
|
}
|
|
3459
3524
|
});
|
|
3460
3525
|
}
|
|
3461
|
-
function
|
|
3526
|
+
function hi(t) {
|
|
3462
3527
|
_(t.prototype, {
|
|
3463
3528
|
mounted() {
|
|
3464
3529
|
const e = () => {
|
|
@@ -3481,18 +3546,18 @@ function fi(t) {
|
|
|
3481
3546
|
var n, o;
|
|
3482
3547
|
let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
|
|
3483
3548
|
s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
|
|
3484
|
-
O(() => a(
|
|
3549
|
+
O(() => a(q(b({}, i || {}), { rule: e.rule, api: this.api })));
|
|
3485
3550
|
}));
|
|
3486
3551
|
}
|
|
3487
3552
|
});
|
|
3488
3553
|
}
|
|
3489
|
-
function
|
|
3554
|
+
function di(t) {
|
|
3490
3555
|
_(t.prototype, {
|
|
3491
3556
|
useProvider() {
|
|
3492
3557
|
const e = this.fc.providers;
|
|
3493
3558
|
Object.keys(e).forEach((r) => {
|
|
3494
3559
|
let i = e[r];
|
|
3495
|
-
h.Function(i) && (i = i(this.fc)), i._c =
|
|
3560
|
+
h.Function(i) && (i = i(this.fc)), i._c = mi(i), this.onEffect(i), this.providers[r] = i;
|
|
3496
3561
|
});
|
|
3497
3562
|
},
|
|
3498
3563
|
onEffect(e) {
|
|
@@ -3508,7 +3573,7 @@ function hi(t) {
|
|
|
3508
3573
|
let r = {
|
|
3509
3574
|
required: () => {
|
|
3510
3575
|
var i, s;
|
|
3511
|
-
return (
|
|
3576
|
+
return (S(e.rule, "$required") ? e.rule.$required : (s = (i = e.rule) == null ? void 0 : i.effect) == null ? void 0 : s.required) || !1;
|
|
3512
3577
|
}
|
|
3513
3578
|
};
|
|
3514
3579
|
Object.keys(e.rule.effect || {}).forEach((i) => {
|
|
@@ -3516,7 +3581,7 @@ function hi(t) {
|
|
|
3516
3581
|
}), Object.keys(e.rule).forEach((i) => {
|
|
3517
3582
|
i[0] === "$" && (r[i.substr(1)] = () => e.rule[i]);
|
|
3518
3583
|
}), Object.keys(r).forEach((i) => {
|
|
3519
|
-
e.watch.push(
|
|
3584
|
+
e.watch.push(L(r[i], (s) => {
|
|
3520
3585
|
this.effect(e, "watch", { [i]: s });
|
|
3521
3586
|
}, { deep: !0 }));
|
|
3522
3587
|
});
|
|
@@ -3538,44 +3603,44 @@ function hi(t) {
|
|
|
3538
3603
|
}, r);
|
|
3539
3604
|
},
|
|
3540
3605
|
getEffect(e, r) {
|
|
3541
|
-
if (
|
|
3606
|
+
if (S(e, "$" + r))
|
|
3542
3607
|
return e["$" + r];
|
|
3543
|
-
if (
|
|
3608
|
+
if (S(e, "effect") && S(e.effect, r))
|
|
3544
3609
|
return e.effect[r];
|
|
3545
3610
|
},
|
|
3546
3611
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3547
3612
|
if (!s || ["fcFragment", "fragment"].indexOf(s) > -1) return;
|
|
3548
|
-
const l = n || Object.keys(r).reduce((u,
|
|
3613
|
+
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u), b({}, r.effect || {}));
|
|
3549
3614
|
Object.keys(l).forEach((u) => {
|
|
3550
|
-
const
|
|
3551
|
-
if (!
|
|
3552
|
-
let
|
|
3553
|
-
if (!
|
|
3554
|
-
|
|
3555
|
-
else if (
|
|
3556
|
-
|
|
3615
|
+
const f = this.providers[u];
|
|
3616
|
+
if (!f || f.input && !i) return;
|
|
3617
|
+
let d;
|
|
3618
|
+
if (!f._c)
|
|
3619
|
+
d = "*";
|
|
3620
|
+
else if (f._used.indexOf(s) > -1)
|
|
3621
|
+
d = s;
|
|
3557
3622
|
else
|
|
3558
3623
|
return;
|
|
3559
|
-
const
|
|
3560
|
-
e && (
|
|
3624
|
+
const g = b({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3625
|
+
e && (g.getProp = () => e.effectData(u), g.clearProp = () => e.clearEffectData(u), g.mergeProp = (m) => x(g.getProp(), [m]), g.id = e.id), this.bus.$emit(`p:${u}:${d}:${f.input ? 1 : 0}`, o, [g, r, this.api]);
|
|
3561
3626
|
});
|
|
3562
3627
|
}
|
|
3563
3628
|
});
|
|
3564
3629
|
}
|
|
3565
|
-
function
|
|
3630
|
+
function pi(t) {
|
|
3566
3631
|
return t.filter(function(e, r, i) {
|
|
3567
3632
|
return i.indexOf(e, 0) === r;
|
|
3568
3633
|
});
|
|
3569
3634
|
}
|
|
3570
|
-
function
|
|
3635
|
+
function mi(t) {
|
|
3571
3636
|
const e = t.components;
|
|
3572
3637
|
if (Array.isArray(e)) {
|
|
3573
|
-
const r =
|
|
3638
|
+
const r = pi(e.filter((i) => i !== "*"));
|
|
3574
3639
|
return r.length ? r : !1;
|
|
3575
3640
|
} else return h.String(e) ? [e] : !1;
|
|
3576
3641
|
}
|
|
3577
3642
|
function X(t) {
|
|
3578
|
-
|
|
3643
|
+
Pt(this, {
|
|
3579
3644
|
options() {
|
|
3580
3645
|
return t.options.value || {};
|
|
3581
3646
|
},
|
|
@@ -3594,10 +3659,10 @@ function X(t) {
|
|
|
3594
3659
|
noWatchFn: null,
|
|
3595
3660
|
deferSyncFn: null,
|
|
3596
3661
|
isMounted: !1,
|
|
3597
|
-
formData:
|
|
3598
|
-
subRuleData:
|
|
3662
|
+
formData: ie({}),
|
|
3663
|
+
subRuleData: ie({}),
|
|
3599
3664
|
subForm: {},
|
|
3600
|
-
form:
|
|
3665
|
+
form: ie({}),
|
|
3601
3666
|
appendData: {},
|
|
3602
3667
|
ignoreFields: [],
|
|
3603
3668
|
providers: {},
|
|
@@ -3612,7 +3677,7 @@ function X(t) {
|
|
|
3612
3677
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3613
3678
|
const i = O(() => r(e, this));
|
|
3614
3679
|
return i && i !== e && _(e, i), e;
|
|
3615
|
-
},
|
|
3680
|
+
}, Qr(this));
|
|
3616
3681
|
}
|
|
3617
3682
|
_(X.prototype, {
|
|
3618
3683
|
initData(t) {
|
|
@@ -3640,26 +3705,26 @@ _(X.prototype, {
|
|
|
3640
3705
|
});
|
|
3641
3706
|
}
|
|
3642
3707
|
});
|
|
3643
|
-
xr(X);
|
|
3644
3708
|
ei(X);
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3709
|
+
ti(X);
|
|
3710
|
+
ii(X);
|
|
3711
|
+
si(X);
|
|
3712
|
+
ui(X);
|
|
3648
3713
|
ci(X);
|
|
3649
|
-
fi(X);
|
|
3650
3714
|
hi(X);
|
|
3651
|
-
|
|
3652
|
-
|
|
3715
|
+
di(X);
|
|
3716
|
+
const gi = "fcFragment", Be = {
|
|
3717
|
+
name: gi,
|
|
3653
3718
|
functional: !0,
|
|
3654
3719
|
props: ["vnode"],
|
|
3655
3720
|
render(t, e) {
|
|
3656
3721
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3657
3722
|
}
|
|
3658
3723
|
};
|
|
3659
|
-
function
|
|
3724
|
+
function yi(t) {
|
|
3660
3725
|
return h.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3661
3726
|
}
|
|
3662
|
-
function
|
|
3727
|
+
function $i() {
|
|
3663
3728
|
const t = {};
|
|
3664
3729
|
function e(r) {
|
|
3665
3730
|
r && this.setVm(r);
|
|
@@ -3670,10 +3735,17 @@ function yi() {
|
|
|
3670
3735
|
},
|
|
3671
3736
|
make(r, i, s) {
|
|
3672
3737
|
var n, o, a;
|
|
3673
|
-
return (
|
|
3738
|
+
return (ge.isReservedTag ? ge.isReservedTag(r) : (o = (n = ge) == null ? void 0 : n.config) != null && o.isReservedTag(r)) && (i == null || delete i.nativeOn, (a = i == null ? void 0 : i.props) == null || delete a.formCreateInject), this.makeComponent(r, i, s);
|
|
3674
3739
|
},
|
|
3675
3740
|
makeComponent(r, i, s) {
|
|
3676
|
-
|
|
3741
|
+
var o;
|
|
3742
|
+
let n = this.$h(r, yi(i), s || []);
|
|
3743
|
+
if ((o = n == null ? void 0 : n.componentOptions) != null && o.propsData && (i != null && i.props)) {
|
|
3744
|
+
const a = Object.keys(n.componentOptions.propsData);
|
|
3745
|
+
n.data.attrs || (n.data.attrs = {}), Object.keys(i.props).forEach((l) => {
|
|
3746
|
+
n.data.attrs[l] == null && a.indexOf(l) === -1 && ["string", "number", "boolean"].indexOf(typeof i.props[l]) > -1 && (n.data.attrs[l] = i.props[l]);
|
|
3747
|
+
});
|
|
3748
|
+
}
|
|
3677
3749
|
return n.context = this.vm, n;
|
|
3678
3750
|
},
|
|
3679
3751
|
aliasMap: t
|
|
@@ -3684,7 +3756,7 @@ function yi() {
|
|
|
3684
3756
|
},
|
|
3685
3757
|
use(r) {
|
|
3686
3758
|
Object.keys(r).forEach((i) => {
|
|
3687
|
-
const s =
|
|
3759
|
+
const s = $e(i), n = jt(i).toLocaleLowerCase(), o = r[i];
|
|
3688
3760
|
[i, s, n].forEach((a) => {
|
|
3689
3761
|
e.alias(i, o), e.prototype[a] = function(l, u) {
|
|
3690
3762
|
return this.make(o, l, u);
|
|
@@ -3694,7 +3766,7 @@ function yi() {
|
|
|
3694
3766
|
}
|
|
3695
3767
|
}), e;
|
|
3696
3768
|
}
|
|
3697
|
-
function
|
|
3769
|
+
function vi(t) {
|
|
3698
3770
|
class e extends Ut {
|
|
3699
3771
|
}
|
|
3700
3772
|
return Object.assign(e.prototype, t), e;
|
|
@@ -3715,7 +3787,7 @@ _(Ut.prototype, {
|
|
|
3715
3787
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3716
3788
|
},
|
|
3717
3789
|
updateKey() {
|
|
3718
|
-
this.key =
|
|
3790
|
+
this.key = je();
|
|
3719
3791
|
},
|
|
3720
3792
|
//TODO interface
|
|
3721
3793
|
init() {
|
|
@@ -3737,7 +3809,7 @@ _(Ut.prototype, {
|
|
|
3737
3809
|
return e(this.vm);
|
|
3738
3810
|
},
|
|
3739
3811
|
mergeOptions(t, e) {
|
|
3740
|
-
return
|
|
3812
|
+
return Y(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3741
3813
|
},
|
|
3742
3814
|
updateOptions(t) {
|
|
3743
3815
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3755,24 +3827,24 @@ _(Ut.prototype, {
|
|
|
3755
3827
|
render(t) {
|
|
3756
3828
|
}
|
|
3757
3829
|
});
|
|
3758
|
-
const
|
|
3830
|
+
const bi = function(t) {
|
|
3759
3831
|
const e = {
|
|
3760
3832
|
name: "loadData",
|
|
3761
3833
|
_fn: [],
|
|
3762
|
-
|
|
3834
|
+
loaded(r, i, s) {
|
|
3763
3835
|
this.deleted(r);
|
|
3764
3836
|
let n = H(r.getValue());
|
|
3765
3837
|
const o = [];
|
|
3766
3838
|
n.forEach((a) => {
|
|
3767
3839
|
if (a && (a.attr || a.template)) {
|
|
3768
|
-
let l = (
|
|
3769
|
-
let
|
|
3770
|
-
a.template ?
|
|
3771
|
-
const
|
|
3772
|
-
a.to === "child" ?
|
|
3773
|
-
}, u = (
|
|
3774
|
-
const
|
|
3775
|
-
l =
|
|
3840
|
+
let l = (d) => {
|
|
3841
|
+
let g;
|
|
3842
|
+
a.template ? g = t.$handle.loadStrVar(a.template, d) : a.handler && h.Function(a.handler) ? g = a.handler(d, i, s) : g = d(a.attr, a.default), a.copy !== !1 && (g = W(g));
|
|
3843
|
+
const m = a.modify ? i : r.getProp();
|
|
3844
|
+
a.to === "child" ? m.children ? R(m.children, 0, g) : R(m, "children", [g]) : ne(m, a.to || "options", g), s.sync(i);
|
|
3845
|
+
}, u = (d) => l(d);
|
|
3846
|
+
const f = t.watchLoadData(u);
|
|
3847
|
+
l = ce(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
3776
3848
|
}
|
|
3777
3849
|
}), this._fn[r.id] = o;
|
|
3778
3850
|
},
|
|
@@ -3783,7 +3855,7 @@ const vi = function(t) {
|
|
|
3783
3855
|
}
|
|
3784
3856
|
};
|
|
3785
3857
|
return e.watch = e.mounted, e;
|
|
3786
|
-
},
|
|
3858
|
+
}, _i = function(t) {
|
|
3787
3859
|
const e = {
|
|
3788
3860
|
name: "t",
|
|
3789
3861
|
_fn: [],
|
|
@@ -3795,13 +3867,13 @@ const vi = function(t) {
|
|
|
3795
3867
|
const l = n[a];
|
|
3796
3868
|
if (l) {
|
|
3797
3869
|
const u = typeof l == "object";
|
|
3798
|
-
let
|
|
3799
|
-
let v = t.t(u ? l.attr : l, u ? l.params : null,
|
|
3870
|
+
let f = (m) => {
|
|
3871
|
+
let v = t.t(u ? l.attr : l, u ? l.params : null, m);
|
|
3800
3872
|
const w = u && l.modify ? i : r.getProp();
|
|
3801
|
-
a === "child" ? w.children ?
|
|
3802
|
-
},
|
|
3803
|
-
const
|
|
3804
|
-
|
|
3873
|
+
a === "child" ? w.children ? R(w.children, 0, v) : R(w, "children", [v]) : ne(w, a, v), s.sync(i);
|
|
3874
|
+
}, d = (m) => f(m);
|
|
3875
|
+
const g = t.watchLoadData(d);
|
|
3876
|
+
f = ce(f, l.wait || 300), l.watch !== !1 ? o.push(g) : g();
|
|
3805
3877
|
}
|
|
3806
3878
|
}), this._fn[r.id] = o;
|
|
3807
3879
|
},
|
|
@@ -3812,7 +3884,7 @@ const vi = function(t) {
|
|
|
3812
3884
|
}
|
|
3813
3885
|
};
|
|
3814
3886
|
return e.watch = e.loaded, e;
|
|
3815
|
-
},
|
|
3887
|
+
}, Ht = {
|
|
3816
3888
|
name: "componentValidate",
|
|
3817
3889
|
load(t, e, r) {
|
|
3818
3890
|
let i = t.getValue();
|
|
@@ -3821,9 +3893,9 @@ const vi = function(t) {
|
|
|
3821
3893
|
else {
|
|
3822
3894
|
h.Object(i) || (i = { method: i });
|
|
3823
3895
|
const s = i.method;
|
|
3824
|
-
delete i.method, t.getProp().validate = [
|
|
3896
|
+
delete i.method, t.getProp().validate = [q(b({}, i), {
|
|
3825
3897
|
validator(...n) {
|
|
3826
|
-
const o =
|
|
3898
|
+
const o = Z(e);
|
|
3827
3899
|
if (o)
|
|
3828
3900
|
return r.exec(o.id, h.String(s) ? s : "formCreateValidate", ...n, {
|
|
3829
3901
|
attr: t,
|
|
@@ -3835,9 +3907,9 @@ const vi = function(t) {
|
|
|
3835
3907
|
}
|
|
3836
3908
|
},
|
|
3837
3909
|
watch(...t) {
|
|
3838
|
-
|
|
3910
|
+
Ht.load(...t);
|
|
3839
3911
|
}
|
|
3840
|
-
},
|
|
3912
|
+
}, Ci = function(t) {
|
|
3841
3913
|
function e(s) {
|
|
3842
3914
|
return h.String(s) && (s = {
|
|
3843
3915
|
action: s,
|
|
@@ -3847,48 +3919,48 @@ const vi = function(t) {
|
|
|
3847
3919
|
function r(s, n, o) {
|
|
3848
3920
|
let a = s.value;
|
|
3849
3921
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
3850
|
-
const l = (
|
|
3851
|
-
|
|
3922
|
+
const l = (d) => {
|
|
3923
|
+
d === void 0 ? s.clearProp() : ne(s.getProp(), a.to || "options", d), o.sync(n);
|
|
3852
3924
|
};
|
|
3853
3925
|
if (!a || !a.action && !a.key) {
|
|
3854
3926
|
l(void 0);
|
|
3855
3927
|
return;
|
|
3856
3928
|
}
|
|
3857
3929
|
if (a = W(a), a.to || (a.to = "options"), a.key) {
|
|
3858
|
-
const
|
|
3859
|
-
if (!
|
|
3930
|
+
const d = t.$handle.options.globalData[a.key];
|
|
3931
|
+
if (!d) {
|
|
3860
3932
|
l(void 0);
|
|
3861
3933
|
return;
|
|
3862
3934
|
}
|
|
3863
|
-
if (
|
|
3864
|
-
l(
|
|
3935
|
+
if (d.type === "static") {
|
|
3936
|
+
l(d.data);
|
|
3865
3937
|
return;
|
|
3866
3938
|
} else
|
|
3867
|
-
a = b(b({}, a),
|
|
3939
|
+
a = b(b({}, a), d);
|
|
3868
3940
|
}
|
|
3869
|
-
const u = a.onError,
|
|
3941
|
+
const u = a.onError, f = () => {
|
|
3870
3942
|
if (!s.getValue())
|
|
3871
3943
|
return s.clearProp(), o.sync(n), !0;
|
|
3872
3944
|
};
|
|
3873
|
-
i._fn[s.id] = t.watchLoadData(
|
|
3874
|
-
if (
|
|
3945
|
+
i._fn[s.id] = t.watchLoadData(ce((d, g) => {
|
|
3946
|
+
if (g && a.watch === !1)
|
|
3875
3947
|
return i._fn[s.id]();
|
|
3876
|
-
const
|
|
3948
|
+
const m = t.$handle.loadFetchVar(W(a), d, n), v = q(b({
|
|
3877
3949
|
headers: {}
|
|
3878
|
-
},
|
|
3879
|
-
onSuccess(w,
|
|
3880
|
-
if (
|
|
3881
|
-
let
|
|
3882
|
-
const P = K(
|
|
3883
|
-
h.Function(P) ?
|
|
3950
|
+
}, m), {
|
|
3951
|
+
onSuccess(w, j) {
|
|
3952
|
+
if (f()) return;
|
|
3953
|
+
let ee = (N) => j ? N : S(N, "data") ? N.data : N;
|
|
3954
|
+
const P = K(m.parse);
|
|
3955
|
+
h.Function(P) ? ee = P : P && h.String(P) && (ee = (N) => M(N, P)), l(ee(w, n, o)), o.sync(n);
|
|
3884
3956
|
},
|
|
3885
3957
|
onError(w) {
|
|
3886
|
-
l(void 0), !
|
|
3958
|
+
l(void 0), !f() && (u || ((j) => xe(j.message || "fetch fail " + m.action)))(w, n, o);
|
|
3887
3959
|
}
|
|
3888
3960
|
});
|
|
3889
3961
|
t.$handle.beforeFetch(v, { rule: n, api: o }).then(() => {
|
|
3890
|
-
if (h.Function(
|
|
3891
|
-
|
|
3962
|
+
if (h.Function(m.action)) {
|
|
3963
|
+
m.action(n, o).then((w) => {
|
|
3892
3964
|
v.onSuccess(w, !0);
|
|
3893
3965
|
}).catch((w) => {
|
|
3894
3966
|
v.onError(w);
|
|
@@ -3902,7 +3974,7 @@ const vi = function(t) {
|
|
|
3902
3974
|
const i = {
|
|
3903
3975
|
name: "fetch",
|
|
3904
3976
|
_fn: [],
|
|
3905
|
-
|
|
3977
|
+
loaded(...s) {
|
|
3906
3978
|
r(...s);
|
|
3907
3979
|
},
|
|
3908
3980
|
watch(...s) {
|
|
@@ -3913,13 +3985,13 @@ const vi = function(t) {
|
|
|
3913
3985
|
}
|
|
3914
3986
|
};
|
|
3915
3987
|
return i;
|
|
3916
|
-
},
|
|
3917
|
-
fetch:
|
|
3918
|
-
loadData:
|
|
3919
|
-
t:
|
|
3920
|
-
componentValidate:
|
|
3988
|
+
}, wi = {
|
|
3989
|
+
fetch: Ci,
|
|
3990
|
+
loadData: bi,
|
|
3991
|
+
t: _i,
|
|
3992
|
+
componentValidate: Ht
|
|
3921
3993
|
};
|
|
3922
|
-
function
|
|
3994
|
+
function Oi(t) {
|
|
3923
3995
|
t = t || /* @__PURE__ */ new Map();
|
|
3924
3996
|
const e = {
|
|
3925
3997
|
$on(r, i) {
|
|
@@ -3943,7 +4015,7 @@ function wi(t) {
|
|
|
3943
4015
|
};
|
|
3944
4016
|
return e;
|
|
3945
4017
|
}
|
|
3946
|
-
const Fi = "html",
|
|
4018
|
+
const Fi = "html", Ri = {
|
|
3947
4019
|
name: Fi,
|
|
3948
4020
|
loadChildren: !1,
|
|
3949
4021
|
render(t, e) {
|
|
@@ -3953,7 +4025,7 @@ const Fi = "html", Oi = {
|
|
|
3953
4025
|
return Array.isArray(t) ? t.filter((e) => h.String(e)).join("") : "";
|
|
3954
4026
|
}
|
|
3955
4027
|
};
|
|
3956
|
-
function
|
|
4028
|
+
function Ei(t) {
|
|
3957
4029
|
t = t + "=";
|
|
3958
4030
|
const r = decodeURIComponent(document.cookie).split(";");
|
|
3959
4031
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -3971,7 +4043,7 @@ function ki(t) {
|
|
|
3971
4043
|
}
|
|
3972
4044
|
return null;
|
|
3973
4045
|
}
|
|
3974
|
-
function
|
|
4046
|
+
function Si(t) {
|
|
3975
4047
|
const e = localStorage.getItem(t);
|
|
3976
4048
|
if (e)
|
|
3977
4049
|
try {
|
|
@@ -3981,30 +4053,43 @@ function Ei(t) {
|
|
|
3981
4053
|
}
|
|
3982
4054
|
return null;
|
|
3983
4055
|
}
|
|
3984
|
-
function
|
|
4056
|
+
function ki(t) {
|
|
4057
|
+
const e = sessionStorage.getItem(t);
|
|
4058
|
+
if (e)
|
|
4059
|
+
try {
|
|
4060
|
+
return JSON.parse(e);
|
|
4061
|
+
} catch (r) {
|
|
4062
|
+
return e;
|
|
4063
|
+
}
|
|
4064
|
+
return null;
|
|
4065
|
+
}
|
|
4066
|
+
function it(t, e) {
|
|
3985
4067
|
if (!e)
|
|
3986
4068
|
return null;
|
|
3987
4069
|
const r = e.split(".");
|
|
3988
4070
|
let i = t(r.shift());
|
|
3989
|
-
return r.length ? i == null ? null :
|
|
4071
|
+
return r.length ? i == null ? null : M(i, r) : i;
|
|
3990
4072
|
}
|
|
3991
|
-
function
|
|
3992
|
-
return
|
|
4073
|
+
function Di(t) {
|
|
4074
|
+
return it(Ei, t);
|
|
3993
4075
|
}
|
|
3994
|
-
function
|
|
3995
|
-
return
|
|
4076
|
+
function ji(t) {
|
|
4077
|
+
return it(Si, t);
|
|
4078
|
+
}
|
|
4079
|
+
function Ai(t) {
|
|
4080
|
+
return it(ki, t);
|
|
3996
4081
|
}
|
|
3997
|
-
function
|
|
4082
|
+
function Vi(t, e) {
|
|
3998
4083
|
let r;
|
|
3999
4084
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
4000
4085
|
}
|
|
4001
4086
|
function Le() {
|
|
4002
|
-
return
|
|
4087
|
+
return Vi("name", ...arguments);
|
|
4003
4088
|
}
|
|
4004
|
-
function
|
|
4089
|
+
function Ii(t) {
|
|
4005
4090
|
return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
4006
4091
|
}
|
|
4007
|
-
function
|
|
4092
|
+
function Pi(t, e) {
|
|
4008
4093
|
const r = new Vue({
|
|
4009
4094
|
data() {
|
|
4010
4095
|
return { rule: t, option: e || {} };
|
|
@@ -4015,331 +4100,341 @@ function Ai(t, e) {
|
|
|
4015
4100
|
});
|
|
4016
4101
|
return r.$mount(), r;
|
|
4017
4102
|
}
|
|
4018
|
-
function
|
|
4103
|
+
function Ti(t) {
|
|
4019
4104
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
4020
|
-
|
|
4105
|
+
St.push(...e), Ze.push(...r), Ye.push(...i), Bt([...e, ...r, ...i]);
|
|
4021
4106
|
}
|
|
4022
|
-
let
|
|
4023
|
-
const U = {},
|
|
4107
|
+
let Bi = 1;
|
|
4108
|
+
const U = {}, Ee = Symbol("defValue");
|
|
4024
4109
|
function Gt(t) {
|
|
4025
4110
|
const e = {
|
|
4026
4111
|
[Be.name]: Be
|
|
4027
4112
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4028
4113
|
t.extendApi
|
|
4029
|
-
], u = b({},
|
|
4030
|
-
let
|
|
4031
|
-
const
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
if (
|
|
4038
|
-
return
|
|
4114
|
+
], u = b({}, wi), f = Xr();
|
|
4115
|
+
let d = { global: {} };
|
|
4116
|
+
const g = t.isMobile === !0, m = ie({
|
|
4117
|
+
$mobile: g
|
|
4118
|
+
}), v = $i(), w = {}, j = {};
|
|
4119
|
+
Ti(t.attrs || {});
|
|
4120
|
+
function ee(c) {
|
|
4121
|
+
const p = U[c];
|
|
4122
|
+
if (Array.isArray(p))
|
|
4123
|
+
return p.map((y) => y.api());
|
|
4124
|
+
if (p)
|
|
4125
|
+
return p.api();
|
|
4039
4126
|
}
|
|
4040
|
-
function P(
|
|
4041
|
-
o.push(
|
|
4127
|
+
function P(c) {
|
|
4128
|
+
o.push(c);
|
|
4042
4129
|
}
|
|
4043
|
-
function
|
|
4044
|
-
const
|
|
4045
|
-
|
|
4130
|
+
function N() {
|
|
4131
|
+
const c = Le(...arguments);
|
|
4132
|
+
c.id && c.prop && (i[c.id] = c.prop);
|
|
4046
4133
|
}
|
|
4047
|
-
function
|
|
4048
|
-
const
|
|
4049
|
-
|
|
4050
|
-
name:
|
|
4134
|
+
function Ae() {
|
|
4135
|
+
const c = Le(...arguments);
|
|
4136
|
+
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(b({}, c.prop), {
|
|
4137
|
+
name: c.id
|
|
4051
4138
|
}));
|
|
4052
4139
|
}
|
|
4053
|
-
function
|
|
4054
|
-
|
|
4140
|
+
function be(c) {
|
|
4141
|
+
v.use(c);
|
|
4055
4142
|
}
|
|
4056
4143
|
function F() {
|
|
4057
|
-
const
|
|
4058
|
-
if (!
|
|
4059
|
-
const
|
|
4060
|
-
r[
|
|
4144
|
+
const c = Le(...arguments);
|
|
4145
|
+
if (!c.id || !c.prop) return ke;
|
|
4146
|
+
const p = G(c.id), y = c.prop, $ = y.merge === !0 ? r[p] : void 0;
|
|
4147
|
+
r[p] = Re(y, $ || ke), f[p] = I(p), y.maker && _(f, y.maker);
|
|
4061
4148
|
}
|
|
4062
|
-
function
|
|
4063
|
-
let
|
|
4064
|
-
if (h.String(
|
|
4065
|
-
if (
|
|
4066
|
-
return ["form-create", "formcreate"].indexOf(
|
|
4149
|
+
function D(c, p) {
|
|
4150
|
+
let y;
|
|
4151
|
+
if (h.String(c)) {
|
|
4152
|
+
if (y = c, p === void 0)
|
|
4153
|
+
return ["form-create", "formcreate"].indexOf(y) > -1 ? B() : e[y];
|
|
4067
4154
|
} else
|
|
4068
|
-
|
|
4069
|
-
if (!
|
|
4070
|
-
const $ = G(
|
|
4071
|
-
e[
|
|
4155
|
+
y = G(c.name), p = c;
|
|
4156
|
+
if (!y || !p) return;
|
|
4157
|
+
const $ = G(y);
|
|
4158
|
+
e[y] = p, e[$] = p, delete v.aliasMap[y], delete v.aliasMap[$], delete r[y], delete r[$], p.formCreateParser && F(y, p.formCreateParser);
|
|
4072
4159
|
}
|
|
4073
|
-
function
|
|
4074
|
-
return
|
|
4160
|
+
function B() {
|
|
4161
|
+
return Nr(Ie, e, i);
|
|
4075
4162
|
}
|
|
4076
|
-
function
|
|
4163
|
+
function se() {
|
|
4077
4164
|
return Be;
|
|
4078
4165
|
}
|
|
4079
|
-
function
|
|
4080
|
-
return h.Function(
|
|
4166
|
+
function _e(c, p) {
|
|
4167
|
+
return h.Function(c.install) ? c.install(oe, p) : h.Function(c) && c(oe, p), this;
|
|
4081
4168
|
}
|
|
4082
|
-
function
|
|
4083
|
-
let $ =
|
|
4169
|
+
function oe(c, p, y) {
|
|
4170
|
+
let $ = Pi(c, p || {});
|
|
4084
4171
|
const C = $.$refs.fc.formCreate;
|
|
4085
|
-
return C.$parent =
|
|
4172
|
+
return C.$parent = y, Ii(C.options).appendChild($.$el), C.api();
|
|
4086
4173
|
}
|
|
4087
|
-
|
|
4088
|
-
function Wt(
|
|
4089
|
-
let
|
|
4090
|
-
return
|
|
4174
|
+
Re(oe, j);
|
|
4175
|
+
function Wt(c) {
|
|
4176
|
+
let p = b({}, t);
|
|
4177
|
+
return c ? p.inherit = {
|
|
4091
4178
|
components: e,
|
|
4092
4179
|
parsers: r,
|
|
4093
4180
|
directives: i,
|
|
4094
4181
|
modelFields: s,
|
|
4095
4182
|
providers: u,
|
|
4096
4183
|
useApps: o,
|
|
4097
|
-
maker:
|
|
4098
|
-
formulas:
|
|
4184
|
+
maker: f,
|
|
4185
|
+
formulas: w,
|
|
4099
4186
|
loadData: m
|
|
4100
|
-
} : delete
|
|
4187
|
+
} : delete p.inherit, Gt(p);
|
|
4101
4188
|
}
|
|
4102
|
-
function Kt(
|
|
4103
|
-
s[
|
|
4189
|
+
function Kt(c, p) {
|
|
4190
|
+
s[c] = p;
|
|
4104
4191
|
}
|
|
4105
|
-
function Xt(
|
|
4106
|
-
|
|
4192
|
+
function Xt(c, p) {
|
|
4193
|
+
w[c] = p;
|
|
4107
4194
|
}
|
|
4108
|
-
function zt(
|
|
4109
|
-
const
|
|
4110
|
-
|
|
4111
|
-
$[C] =
|
|
4112
|
-
}),
|
|
4195
|
+
function zt(c, p) {
|
|
4196
|
+
const y = n[c] || {}, $ = y.parsers || {};
|
|
4197
|
+
p.parsers && Object.keys(p.parsers).forEach((C) => {
|
|
4198
|
+
$[C] = Re(p.parsers[C], ke);
|
|
4199
|
+
}), p.name = c, n[c] = q(b(b({}, y), p), { parsers: $ });
|
|
4113
4200
|
}
|
|
4114
|
-
function
|
|
4115
|
-
|
|
4116
|
-
(Array.isArray(U[
|
|
4117
|
-
$.bus.$emit("$loadData." +
|
|
4201
|
+
function Ce(c) {
|
|
4202
|
+
c && Object.keys(U).forEach((p) => {
|
|
4203
|
+
(Array.isArray(U[p]) ? U[p] : [U[p]]).forEach(($) => {
|
|
4204
|
+
$.bus.$emit("$loadData." + c);
|
|
4118
4205
|
});
|
|
4119
4206
|
});
|
|
4120
4207
|
}
|
|
4121
|
-
function
|
|
4122
|
-
|
|
4208
|
+
function Ve(c, p) {
|
|
4209
|
+
ne(m, c, p), Ce(c);
|
|
4123
4210
|
}
|
|
4124
|
-
function
|
|
4125
|
-
const
|
|
4126
|
-
|
|
4211
|
+
function we(c, p) {
|
|
4212
|
+
const y = (...$) => O(() => p(...$));
|
|
4213
|
+
y._driver = !0, Ve(c, y);
|
|
4127
4214
|
}
|
|
4128
|
-
function
|
|
4129
|
-
const
|
|
4130
|
-
|
|
4131
|
-
const $ =
|
|
4132
|
-
if (
|
|
4133
|
-
let C = m[
|
|
4134
|
-
return C && C._driver ? C = C($) :
|
|
4215
|
+
function nt(c, p) {
|
|
4216
|
+
const y = (c || "").split(".");
|
|
4217
|
+
c = y.shift();
|
|
4218
|
+
const $ = y.join(".");
|
|
4219
|
+
if (S(m, c) || R(m, c, Ee), m[c] !== Ee) {
|
|
4220
|
+
let C = m[c];
|
|
4221
|
+
return C && C._driver ? C = C($) : y.length && (C = M(C, y)), C == null || C === "" ? p : C;
|
|
4135
4222
|
} else
|
|
4136
|
-
return
|
|
4223
|
+
return p;
|
|
4137
4224
|
}
|
|
4138
|
-
function Qt(
|
|
4139
|
-
l.push(
|
|
4225
|
+
function Qt(c) {
|
|
4226
|
+
l.push(c);
|
|
4140
4227
|
}
|
|
4141
|
-
function Zt(
|
|
4142
|
-
delete m[
|
|
4228
|
+
function Zt(c) {
|
|
4229
|
+
delete m[c], Ce(c);
|
|
4143
4230
|
}
|
|
4144
|
-
function Yt(
|
|
4145
|
-
a.push({ name:
|
|
4231
|
+
function Yt(c, p) {
|
|
4232
|
+
a.push({ name: c, callback: p });
|
|
4146
4233
|
}
|
|
4147
|
-
function
|
|
4234
|
+
function Ie(c) {
|
|
4148
4235
|
_(this, {
|
|
4149
|
-
id:
|
|
4150
|
-
create:
|
|
4151
|
-
vm:
|
|
4152
|
-
manager:
|
|
4236
|
+
id: Bi++,
|
|
4237
|
+
create: oe,
|
|
4238
|
+
vm: c,
|
|
4239
|
+
manager: vi(t.manager),
|
|
4153
4240
|
parsers: r,
|
|
4154
4241
|
providers: u,
|
|
4155
4242
|
modelFields: s,
|
|
4156
|
-
formulas:
|
|
4157
|
-
isMobile:
|
|
4158
|
-
rules:
|
|
4159
|
-
name:
|
|
4160
|
-
inFor:
|
|
4243
|
+
formulas: w,
|
|
4244
|
+
isMobile: g,
|
|
4245
|
+
rules: c.$options.propsData.rule,
|
|
4246
|
+
name: c.$options.propsData.name || je(),
|
|
4247
|
+
inFor: c.$options.propsData.inFor,
|
|
4161
4248
|
prop: {
|
|
4162
4249
|
components: e,
|
|
4163
4250
|
directives: i
|
|
4164
4251
|
},
|
|
4165
4252
|
drivers: n,
|
|
4166
4253
|
renderDriver: null,
|
|
4167
|
-
|
|
4168
|
-
refreshData: _e,
|
|
4254
|
+
refreshData: Ce,
|
|
4169
4255
|
loadData: m,
|
|
4170
|
-
CreateNode:
|
|
4171
|
-
bus: new
|
|
4256
|
+
CreateNode: v,
|
|
4257
|
+
bus: new Oi(),
|
|
4172
4258
|
unwatch: [],
|
|
4173
|
-
options:
|
|
4259
|
+
options: dr({}),
|
|
4174
4260
|
extendApiFn: l,
|
|
4175
4261
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4176
|
-
tmpData:
|
|
4177
|
-
}), a.forEach((
|
|
4178
|
-
this.bus.$on(
|
|
4179
|
-
}),
|
|
4180
|
-
|
|
4262
|
+
tmpData: ie({})
|
|
4263
|
+
}), a.forEach((p) => {
|
|
4264
|
+
this.bus.$on(p.name, p.callback);
|
|
4265
|
+
}), T(() => {
|
|
4266
|
+
L(this.options, () => {
|
|
4181
4267
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4182
4268
|
}, { deep: !0 });
|
|
4183
|
-
}), _(
|
|
4269
|
+
}), _(c.$options.components, e), _(c.$options.directives, i), this.$handle = new X(this), this.name && (this.inFor ? (U[this.name] || (U[this.name] = []), U[this.name].push(this)) : U[this.name] = this);
|
|
4184
4270
|
}
|
|
4185
|
-
|
|
4271
|
+
Ie.isMobile = g, _(Ie.prototype, {
|
|
4186
4272
|
init() {
|
|
4187
|
-
this.isSub() && this.unwatch.push(
|
|
4273
|
+
this.isSub() && this.unwatch.push(L(() => this.vm.parent.fc.options.value, () => {
|
|
4188
4274
|
this.initOptions(), this.$handle.api.refresh();
|
|
4189
4275
|
}, { deep: !0 })), this.vm.$options.propsData.driver && (this.renderDriver = typeof this.vm.$options.propsData.driver == "object" ? this.vm.$options.propsData.driver : this.drivers[this.vm.$options.propsData.driver]), !this.renderDriver && this.vm.parent && (this.renderDriver = this.vm.parent.renderDriver), this.renderDriver || (this.renderDriver = this.drivers.default), this.initOptions(), this.$handle.init();
|
|
4190
4276
|
},
|
|
4191
|
-
targetFormDriver(
|
|
4192
|
-
if (this.renderDriver && this.renderDriver[
|
|
4193
|
-
return O(() => this.renderDriver[
|
|
4277
|
+
targetFormDriver(c, ...p) {
|
|
4278
|
+
if (this.renderDriver && this.renderDriver[c])
|
|
4279
|
+
return O(() => this.renderDriver[c](...p));
|
|
4194
4280
|
},
|
|
4195
|
-
t(
|
|
4196
|
-
let $ =
|
|
4197
|
-
return $ == null && ($ = ""), $ &&
|
|
4198
|
-
const
|
|
4199
|
-
$ = $.replace(
|
|
4281
|
+
t(c, p, y) {
|
|
4282
|
+
let $ = y ? y("$t." + c) : this.globalLanguageDriver(c);
|
|
4283
|
+
return $ == null && ($ = ""), $ && p && Object.keys(p).forEach((C) => {
|
|
4284
|
+
const k = new RegExp(`{${C}}`, "g");
|
|
4285
|
+
$ = $.replace(k, p[C]);
|
|
4200
4286
|
}), $;
|
|
4201
4287
|
},
|
|
4202
|
-
globalDataDriver(
|
|
4203
|
-
let
|
|
4204
|
-
const
|
|
4288
|
+
globalDataDriver(c) {
|
|
4289
|
+
let p = c.split(".");
|
|
4290
|
+
const y = p.shift(), $ = this.options.value.globalData && this.options.value.globalData[y];
|
|
4205
4291
|
if ($) {
|
|
4206
4292
|
if ($.type === "static")
|
|
4207
|
-
return
|
|
4293
|
+
return M($.data, p);
|
|
4208
4294
|
{
|
|
4209
4295
|
let C;
|
|
4210
|
-
const
|
|
4211
|
-
if (
|
|
4212
|
-
if (
|
|
4296
|
+
const k = this.fetchCache.get($);
|
|
4297
|
+
if (k) {
|
|
4298
|
+
if (k.status && (C = M(k.data, p)), !k.loading)
|
|
4213
4299
|
return C;
|
|
4214
|
-
|
|
4300
|
+
k.loading = !1, this.fetchCache.set($, k);
|
|
4215
4301
|
} else
|
|
4216
4302
|
this.fetchCache.set($, { status: !1 });
|
|
4217
|
-
const
|
|
4218
|
-
|
|
4219
|
-
const
|
|
4220
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf($) !== -1 ? (
|
|
4221
|
-
}, $.wait || 600),
|
|
4222
|
-
this.fetchCache.set($, { status: !0, data:
|
|
4223
|
-
},
|
|
4224
|
-
if (
|
|
4225
|
-
return
|
|
4226
|
-
if (
|
|
4227
|
-
|
|
4303
|
+
const E = ce(() => {
|
|
4304
|
+
le();
|
|
4305
|
+
const J = this.fetchCache.get($);
|
|
4306
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf($) !== -1 ? (J && (J.loading = !0, this.fetchCache.set($, J)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete($);
|
|
4307
|
+
}, $.wait || 600), ae = (J) => {
|
|
4308
|
+
this.fetchCache.set($, { status: !0, data: J }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4309
|
+
}, z = (J, ue) => {
|
|
4310
|
+
if (ue && $.watch === !1)
|
|
4311
|
+
return le();
|
|
4312
|
+
if (ue) {
|
|
4313
|
+
E();
|
|
4228
4314
|
return;
|
|
4229
4315
|
}
|
|
4230
|
-
const
|
|
4231
|
-
this.$handle.api.fetch(
|
|
4232
|
-
|
|
4233
|
-
}).catch((
|
|
4234
|
-
|
|
4316
|
+
const de = this.$handle.loadFetchVar(Ge($), J);
|
|
4317
|
+
this.$handle.api.fetch(de).then((te) => {
|
|
4318
|
+
ae(te);
|
|
4319
|
+
}).catch((te) => {
|
|
4320
|
+
ae(null);
|
|
4235
4321
|
});
|
|
4236
|
-
},
|
|
4237
|
-
return this.unwatch.push(
|
|
4322
|
+
}, le = this.watchLoadData(z);
|
|
4323
|
+
return this.unwatch.push(le), C;
|
|
4238
4324
|
}
|
|
4239
4325
|
}
|
|
4240
4326
|
},
|
|
4241
4327
|
getLocale() {
|
|
4242
|
-
let
|
|
4243
|
-
return
|
|
4328
|
+
let c = this.vm.top.$props.locale;
|
|
4329
|
+
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4244
4330
|
},
|
|
4245
|
-
globalLanguageDriver(
|
|
4246
|
-
let
|
|
4247
|
-
if (
|
|
4331
|
+
globalLanguageDriver(c) {
|
|
4332
|
+
let p = this.vm.top.$props.locale, y;
|
|
4333
|
+
if (p && typeof p == "object" && (y = M(p, c)), y == null) {
|
|
4248
4334
|
const $ = this.options.value.language || {}, C = this.getLocale();
|
|
4249
|
-
|
|
4335
|
+
y = M($[C], c);
|
|
4250
4336
|
}
|
|
4251
|
-
return
|
|
4337
|
+
return y;
|
|
4252
4338
|
},
|
|
4253
|
-
globalVarDriver(
|
|
4254
|
-
|
|
4255
|
-
const g = d.shift(), $ = this.options.value.globalVariable && this.options.value.globalVariable[g];
|
|
4339
|
+
globalVarDriver(c) {
|
|
4340
|
+
const y = c.split(".").shift(), $ = this.options.value.globalVariable && this.options.value.globalVariable[y];
|
|
4256
4341
|
if ($) {
|
|
4257
4342
|
const C = h.Function($) ? $ : K($.handle);
|
|
4258
|
-
if (C)
|
|
4259
|
-
|
|
4343
|
+
if (C) {
|
|
4344
|
+
let k;
|
|
4345
|
+
const E = this.watchLoadData((ae, z) => {
|
|
4346
|
+
z ? (this.bus.$emit("$loadData.$var." + y), E()) : k = C(ae, this.$handle.api);
|
|
4347
|
+
});
|
|
4348
|
+
return this.unwatch.push(E), k;
|
|
4349
|
+
}
|
|
4260
4350
|
}
|
|
4261
4351
|
},
|
|
4262
|
-
setData(
|
|
4263
|
-
|
|
4352
|
+
setData(c, p, y) {
|
|
4353
|
+
y ? Ve(c, p) : (ne(this.vm.top.fc.tmpData, c, p), this.bus.$emit("$loadData." + c));
|
|
4264
4354
|
},
|
|
4265
|
-
getLoadData(
|
|
4266
|
-
let
|
|
4267
|
-
if (
|
|
4268
|
-
let $ =
|
|
4355
|
+
getLoadData(c, p) {
|
|
4356
|
+
let y = null;
|
|
4357
|
+
if (c != null) {
|
|
4358
|
+
let $ = c.split(".");
|
|
4269
4359
|
const C = $.shift();
|
|
4270
4360
|
if (C === "$topForm")
|
|
4271
|
-
|
|
4361
|
+
y = this.$handle.api.top.formData();
|
|
4272
4362
|
else if (C === "$form")
|
|
4273
|
-
|
|
4363
|
+
y = this.$handle.api.formData();
|
|
4274
4364
|
else if (C === "$options")
|
|
4275
|
-
|
|
4365
|
+
y = this.options.value;
|
|
4276
4366
|
else if (C === "$globalData")
|
|
4277
|
-
|
|
4367
|
+
y = this.globalDataDriver($.join(".")), $ = [];
|
|
4278
4368
|
else if (C === "$var")
|
|
4279
|
-
|
|
4369
|
+
y = this.globalVarDriver($.join(".")), $ = [];
|
|
4280
4370
|
else if (C === "$locale")
|
|
4281
|
-
|
|
4371
|
+
y = this.getLocale(), $ = [];
|
|
4282
4372
|
else if (C === "$t")
|
|
4283
|
-
|
|
4373
|
+
y = this.globalLanguageDriver($.join(".")), $ = [];
|
|
4284
4374
|
else {
|
|
4285
|
-
|
|
4286
|
-
|
|
4375
|
+
if (C === "$preview")
|
|
4376
|
+
return this.$handle.preview;
|
|
4377
|
+
{
|
|
4378
|
+
const k = this.vm.top.fc.tmpData;
|
|
4379
|
+
S(k, C) || R(k, C, Ee), y = k[C] !== Ee ? M(k, c) : nt(c), $ = [];
|
|
4380
|
+
}
|
|
4287
4381
|
}
|
|
4288
|
-
|
|
4382
|
+
y && $.length && (y = M(y, $));
|
|
4289
4383
|
}
|
|
4290
|
-
return
|
|
4291
|
-
},
|
|
4292
|
-
watchLoadData(
|
|
4293
|
-
let
|
|
4294
|
-
const $ = (
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
})
|
|
4298
|
-
}, C = (
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4384
|
+
return y == null || y === "" ? p : y;
|
|
4385
|
+
},
|
|
4386
|
+
watchLoadData(c, p) {
|
|
4387
|
+
let y = {};
|
|
4388
|
+
const $ = (E) => {
|
|
4389
|
+
O(() => {
|
|
4390
|
+
c(C, E);
|
|
4391
|
+
});
|
|
4392
|
+
}, C = (E, ae) => {
|
|
4393
|
+
let z;
|
|
4394
|
+
if (typeof E == "object" && (z = E.getValue, E = E.id), y[E])
|
|
4395
|
+
return y[E].val;
|
|
4396
|
+
const le = me(() => z ? z() : this.getLoadData(E, ae)), J = E.split("."), ue = J.shift(), de = J.shift() || "", te = ce(() => {
|
|
4397
|
+
const Pe = z ? z() : this.getLoadData(E, ae);
|
|
4398
|
+
if (y[E])
|
|
4399
|
+
JSON.stringify(Pe) !== JSON.stringify(y[E].val) && (y[E].val = Pe, $(!0));
|
|
4305
4400
|
else return;
|
|
4306
|
-
},
|
|
4307
|
-
|
|
4401
|
+
}, p || 0), er = L(le, (Pe) => {
|
|
4402
|
+
te();
|
|
4308
4403
|
});
|
|
4309
|
-
return this.bus.$on("$loadData." +
|
|
4404
|
+
return this.bus.$on("$loadData." + ue, te), de && this.bus.$on("$loadData." + ue + "." + de, te), y[E] = {
|
|
4310
4405
|
fn: () => {
|
|
4311
|
-
this.bus.$off("$loadData." +
|
|
4406
|
+
this.bus.$off("$loadData." + ue, te), de && this.bus.$off("$loadData." + ue + "." + de, te), er();
|
|
4312
4407
|
},
|
|
4313
|
-
val:
|
|
4314
|
-
},
|
|
4408
|
+
val: le.value
|
|
4409
|
+
}, le.value;
|
|
4315
4410
|
};
|
|
4316
4411
|
$(!1);
|
|
4317
|
-
const
|
|
4318
|
-
Object.keys(
|
|
4412
|
+
const k = () => {
|
|
4413
|
+
Object.keys(y).forEach((E) => y[E].fn()), y = {};
|
|
4319
4414
|
};
|
|
4320
|
-
return this.unwatch.push(
|
|
4415
|
+
return this.unwatch.push(k), k;
|
|
4321
4416
|
},
|
|
4322
4417
|
isSub() {
|
|
4323
4418
|
return this.vm.parent && this.vm.extendOption;
|
|
4324
4419
|
},
|
|
4325
4420
|
initOptions() {
|
|
4326
4421
|
this.options.value = {};
|
|
4327
|
-
let
|
|
4422
|
+
let c = b({
|
|
4328
4423
|
formData: {},
|
|
4329
4424
|
submitBtn: {},
|
|
4330
4425
|
resetBtn: {},
|
|
4331
4426
|
globalEvent: {},
|
|
4332
4427
|
globalData: {}
|
|
4333
|
-
}, W(
|
|
4334
|
-
this.isSub() && (
|
|
4428
|
+
}, W(d));
|
|
4429
|
+
this.isSub() && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$options.propsData.option || {}), this.updateOptions(c);
|
|
4335
4430
|
},
|
|
4336
|
-
mergeOptions(
|
|
4337
|
-
return
|
|
4338
|
-
delete
|
|
4339
|
-
}),
|
|
4431
|
+
mergeOptions(c, p, y) {
|
|
4432
|
+
return p = b({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach(($) => {
|
|
4433
|
+
delete p[$];
|
|
4434
|
+
}), p.global && (c.global = Gr(c.global, p.global), delete p.global), this.$handle.$manager.mergeOptions([p], c), c;
|
|
4340
4435
|
},
|
|
4341
|
-
updateOptions(
|
|
4342
|
-
this.options.value = this.mergeOptions(this.options.value,
|
|
4436
|
+
updateOptions(c) {
|
|
4437
|
+
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
4343
4438
|
},
|
|
4344
4439
|
api() {
|
|
4345
4440
|
return this.$handle.api;
|
|
@@ -4353,88 +4448,88 @@ function Gt(t) {
|
|
|
4353
4448
|
unmount() {
|
|
4354
4449
|
if (this.name)
|
|
4355
4450
|
if (this.inFor) {
|
|
4356
|
-
const
|
|
4357
|
-
U[this.name].splice(
|
|
4451
|
+
const c = U[this.name].indexOf(this);
|
|
4452
|
+
U[this.name].splice(c, 1);
|
|
4358
4453
|
} else
|
|
4359
4454
|
delete U[this.name];
|
|
4360
|
-
a.forEach((
|
|
4361
|
-
this.bus.$off(
|
|
4362
|
-
}), this.tmpData = {}, this.unwatch.forEach((
|
|
4455
|
+
a.forEach((c) => {
|
|
4456
|
+
this.bus.$off(c.name, c.callback);
|
|
4457
|
+
}), this.tmpData = {}, this.unwatch.forEach((c) => c()), this.unwatch = [], this.$handle.reloadRule([]);
|
|
4363
4458
|
},
|
|
4364
4459
|
updated() {
|
|
4365
4460
|
this.$handle.bindNextTick(() => this.bus.$emit("next-tick", this.$handle.api));
|
|
4366
4461
|
}
|
|
4367
4462
|
});
|
|
4368
|
-
function
|
|
4369
|
-
_(
|
|
4463
|
+
function st(c) {
|
|
4464
|
+
_(c, {
|
|
4370
4465
|
version: t.version,
|
|
4371
4466
|
ui: t.ui,
|
|
4372
|
-
isMobile:
|
|
4467
|
+
isMobile: g,
|
|
4373
4468
|
extendApi: Qt,
|
|
4374
|
-
getData:
|
|
4375
|
-
setDataDriver:
|
|
4376
|
-
setData:
|
|
4469
|
+
getData: nt,
|
|
4470
|
+
setDataDriver: we,
|
|
4471
|
+
setData: Ve,
|
|
4377
4472
|
removeData: Zt,
|
|
4378
|
-
refreshData:
|
|
4379
|
-
maker:
|
|
4380
|
-
component:
|
|
4381
|
-
directive:
|
|
4473
|
+
refreshData: Ce,
|
|
4474
|
+
maker: f,
|
|
4475
|
+
component: D,
|
|
4476
|
+
directive: N,
|
|
4382
4477
|
setModelField: Kt,
|
|
4383
4478
|
setFormula: Xt,
|
|
4384
4479
|
setDriver: zt,
|
|
4385
|
-
register:
|
|
4386
|
-
$vnode:
|
|
4480
|
+
register: Ae,
|
|
4481
|
+
$vnode: se,
|
|
4387
4482
|
parser: F,
|
|
4388
|
-
use:
|
|
4483
|
+
use: _e,
|
|
4389
4484
|
factory: Wt,
|
|
4390
|
-
componentAlias:
|
|
4391
|
-
copyRule:
|
|
4392
|
-
copyRules:
|
|
4393
|
-
mergeRule:
|
|
4394
|
-
fetch:
|
|
4395
|
-
$form:
|
|
4485
|
+
componentAlias: be,
|
|
4486
|
+
copyRule: Vt,
|
|
4487
|
+
copyRules: It,
|
|
4488
|
+
mergeRule: x,
|
|
4489
|
+
fetch: Mt,
|
|
4490
|
+
$form: B,
|
|
4396
4491
|
parseFn: K,
|
|
4397
|
-
parseJson:
|
|
4492
|
+
parseJson: At,
|
|
4398
4493
|
toJson: et,
|
|
4399
4494
|
useApp: P,
|
|
4400
|
-
getApi:
|
|
4495
|
+
getApi: ee,
|
|
4401
4496
|
on: Yt
|
|
4402
4497
|
});
|
|
4403
4498
|
}
|
|
4404
|
-
function xt(
|
|
4405
|
-
_(
|
|
4406
|
-
create:
|
|
4407
|
-
install(
|
|
4408
|
-
if (
|
|
4409
|
-
|
|
4410
|
-
const $ = function(
|
|
4411
|
-
return
|
|
4499
|
+
function xt(c) {
|
|
4500
|
+
_(c, {
|
|
4501
|
+
create: oe,
|
|
4502
|
+
install(p, y) {
|
|
4503
|
+
if (d = b(b({}, d), y || {}), p._installedFormCreate === !0) return;
|
|
4504
|
+
p._installedFormCreate = !0;
|
|
4505
|
+
const $ = function(k, E = {}) {
|
|
4506
|
+
return oe(k, E, this);
|
|
4412
4507
|
};
|
|
4413
|
-
|
|
4414
|
-
const C =
|
|
4415
|
-
|
|
4416
|
-
O(() =>
|
|
4508
|
+
st($), p.prototype.$formCreate = $;
|
|
4509
|
+
const C = B();
|
|
4510
|
+
p.component(C.name, C), p.component("FcFragment", se()), o.forEach((k) => {
|
|
4511
|
+
O(() => k(c, p));
|
|
4417
4512
|
});
|
|
4418
4513
|
}
|
|
4419
4514
|
});
|
|
4420
4515
|
}
|
|
4421
|
-
if (
|
|
4422
|
-
const
|
|
4423
|
-
|
|
4516
|
+
if (st(j), xt(j), we("$cookie", Di), we("$localStorage", ji), we("$sessionStorage", Ai), v.use({ fragment: "fcFragment" }), t.install && oe.use(t), F(Ri), t.inherit) {
|
|
4517
|
+
const c = t.inherit;
|
|
4518
|
+
c.components && _(e, c.components), c.parsers && _(r, c.parsers), c.directives && _(i, c.directives), c.modelFields && _(s, c.modelFields), c.providers && _(u, c.providers), c.useApps && _(o, c.useApps), c.maker && _(f, c.maker), c.loadData && _(m, c.loadData), c.formulas && _(w, c.formulas);
|
|
4424
4519
|
}
|
|
4425
|
-
const
|
|
4426
|
-
return
|
|
4520
|
+
const Oe = B();
|
|
4521
|
+
return Re(Oe, j), Object.defineProperties(Oe, {
|
|
4427
4522
|
fetch: {
|
|
4428
4523
|
get() {
|
|
4429
|
-
return
|
|
4524
|
+
return j.fetch;
|
|
4430
4525
|
},
|
|
4431
|
-
set(
|
|
4432
|
-
|
|
4526
|
+
set(c) {
|
|
4527
|
+
j.fetch = c;
|
|
4433
4528
|
}
|
|
4434
4529
|
}
|
|
4435
|
-
}),
|
|
4530
|
+
}), Oe.util = j, Oe;
|
|
4436
4531
|
}
|
|
4437
|
-
const
|
|
4532
|
+
const bt = {
|
|
4438
4533
|
date: "yyyy-MM-dd",
|
|
4439
4534
|
month: "yyyy-MM",
|
|
4440
4535
|
datetime: "yyyy-MM-dd HH:mm:ss",
|
|
@@ -4443,16 +4538,16 @@ const vt = {
|
|
|
4443
4538
|
monthrange: "yyyy-MM",
|
|
4444
4539
|
datetimerange: "yyyy-MM-dd HH:mm:ss",
|
|
4445
4540
|
year: "yyyy"
|
|
4446
|
-
},
|
|
4447
|
-
name:
|
|
4541
|
+
}, _t = "datePicker", Li = {
|
|
4542
|
+
name: _t,
|
|
4448
4543
|
maker: function() {
|
|
4449
|
-
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = I(
|
|
4544
|
+
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = I(_t, { type: e.toLowerCase() }), t), {});
|
|
4450
4545
|
}(),
|
|
4451
4546
|
mergeProp(t) {
|
|
4452
4547
|
const e = t.prop.props;
|
|
4453
|
-
e.valueFormat || (e.valueFormat =
|
|
4548
|
+
e.valueFormat || (e.valueFormat = bt[e.type] || bt.date);
|
|
4454
4549
|
}
|
|
4455
|
-
}, Me = "hidden",
|
|
4550
|
+
}, Me = "hidden", Mi = {
|
|
4456
4551
|
name: Me,
|
|
4457
4552
|
maker: {
|
|
4458
4553
|
[Me]: (t, e) => I(Me)("", t, e)
|
|
@@ -4460,7 +4555,7 @@ const vt = {
|
|
|
4460
4555
|
render() {
|
|
4461
4556
|
return [];
|
|
4462
4557
|
}
|
|
4463
|
-
}, Ne = "input",
|
|
4558
|
+
}, Ne = "input", Ni = {
|
|
4464
4559
|
name: Ne,
|
|
4465
4560
|
maker: function() {
|
|
4466
4561
|
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = I(Ne, { type: r }), e), {});
|
|
@@ -4470,79 +4565,79 @@ const vt = {
|
|
|
4470
4565
|
let { props: e } = t.prop;
|
|
4471
4566
|
e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4472
4567
|
}
|
|
4473
|
-
},
|
|
4474
|
-
name:
|
|
4568
|
+
}, Ct = "slider", qi = {
|
|
4569
|
+
name: Ct,
|
|
4475
4570
|
maker: {
|
|
4476
|
-
sliderRange: I(
|
|
4571
|
+
sliderRange: I(Ct, { range: !0 })
|
|
4477
4572
|
},
|
|
4478
4573
|
toFormValue(t, e) {
|
|
4479
4574
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
4480
4575
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
4481
4576
|
}
|
|
4482
|
-
},
|
|
4483
|
-
name:
|
|
4577
|
+
}, qe = "timePicker", Ui = {
|
|
4578
|
+
name: qe,
|
|
4484
4579
|
maker: {
|
|
4485
|
-
time: I(
|
|
4486
|
-
timeRange: I(
|
|
4580
|
+
time: I(qe, (t) => t.props.isRange = !1),
|
|
4581
|
+
timeRange: I(qe, (t) => t.props.isRange = !0)
|
|
4487
4582
|
},
|
|
4488
4583
|
mergeProp(t) {
|
|
4489
4584
|
const e = t.prop.props;
|
|
4490
4585
|
e.valueFormat || (e.valueFormat = "HH:mm:ss");
|
|
4491
4586
|
}
|
|
4492
|
-
},
|
|
4587
|
+
}, Hi = {
|
|
4493
4588
|
name: "FcRow",
|
|
4494
4589
|
render(t, e) {
|
|
4495
4590
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
4496
4591
|
e.vNode.row(e.prop, t)
|
|
4497
4592
|
]);
|
|
4498
4593
|
}
|
|
4499
|
-
},
|
|
4500
|
-
name:
|
|
4594
|
+
}, Gi = "select", Ji = {
|
|
4595
|
+
name: Gi,
|
|
4501
4596
|
toFormValue(t, e) {
|
|
4502
4597
|
return e.prop.props.multiple && !Array.isArray(t) ? H(t) : t;
|
|
4503
4598
|
}
|
|
4504
|
-
},
|
|
4505
|
-
Pi,
|
|
4506
|
-
Ti,
|
|
4507
|
-
Bi,
|
|
4599
|
+
}, Wi = [
|
|
4508
4600
|
Li,
|
|
4509
4601
|
Mi,
|
|
4510
4602
|
Ni,
|
|
4511
|
-
qi
|
|
4512
|
-
|
|
4513
|
-
|
|
4603
|
+
qi,
|
|
4604
|
+
Ui,
|
|
4605
|
+
Hi,
|
|
4606
|
+
Ji
|
|
4607
|
+
], A = "el", Ki = {
|
|
4608
|
+
button: A + "Button",
|
|
4514
4609
|
icon: "i",
|
|
4515
|
-
slider:
|
|
4516
|
-
rate:
|
|
4610
|
+
slider: A + "Slider",
|
|
4611
|
+
rate: A + "Rate",
|
|
4517
4612
|
upload: "fcUpload",
|
|
4518
|
-
cascader:
|
|
4519
|
-
popover:
|
|
4520
|
-
tooltip:
|
|
4521
|
-
colorPicker:
|
|
4522
|
-
timePicker:
|
|
4523
|
-
timeSelect:
|
|
4524
|
-
datePicker:
|
|
4525
|
-
switch:
|
|
4613
|
+
cascader: A + "Cascader",
|
|
4614
|
+
popover: A + "Popover",
|
|
4615
|
+
tooltip: A + "Tooltip",
|
|
4616
|
+
colorPicker: A + "ColorPicker",
|
|
4617
|
+
timePicker: A + "TimePicker",
|
|
4618
|
+
timeSelect: A + "TimeSelect",
|
|
4619
|
+
datePicker: A + "DatePicker",
|
|
4620
|
+
switch: A + "Switch",
|
|
4526
4621
|
select: "fcSelect",
|
|
4527
4622
|
checkbox: "fcCheckbox",
|
|
4528
4623
|
radio: "fcRadio",
|
|
4529
|
-
inputNumber:
|
|
4530
|
-
number:
|
|
4531
|
-
input:
|
|
4532
|
-
formItem:
|
|
4533
|
-
form:
|
|
4624
|
+
inputNumber: A + "InputNumber",
|
|
4625
|
+
number: A + "InputNumber",
|
|
4626
|
+
input: A + "Input",
|
|
4627
|
+
formItem: A + "FormItem",
|
|
4628
|
+
form: A + "Form",
|
|
4534
4629
|
frame: "fcFrame",
|
|
4535
|
-
col:
|
|
4536
|
-
row:
|
|
4630
|
+
col: A + "Col",
|
|
4631
|
+
row: A + "Row",
|
|
4537
4632
|
tree: "fcTree",
|
|
4538
|
-
autoComplete:
|
|
4539
|
-
auto:
|
|
4633
|
+
autoComplete: A + "Autocomplete",
|
|
4634
|
+
auto: A + "Autocomplete",
|
|
4540
4635
|
group: "fcGroup",
|
|
4541
4636
|
array: "fcGroup",
|
|
4542
4637
|
object: "fcSubForm",
|
|
4543
4638
|
subForm: "fcSubForm"
|
|
4544
4639
|
};
|
|
4545
|
-
function
|
|
4640
|
+
function Xi() {
|
|
4546
4641
|
return {
|
|
4547
4642
|
form: {
|
|
4548
4643
|
inline: !1,
|
|
@@ -4559,7 +4654,7 @@ function Ji() {
|
|
|
4559
4654
|
type: "primary",
|
|
4560
4655
|
loading: !1,
|
|
4561
4656
|
disabled: !1,
|
|
4562
|
-
innerText: "
|
|
4657
|
+
innerText: "",
|
|
4563
4658
|
show: !0,
|
|
4564
4659
|
col: void 0,
|
|
4565
4660
|
click: void 0
|
|
@@ -4569,30 +4664,30 @@ function Ji() {
|
|
|
4569
4664
|
loading: !1,
|
|
4570
4665
|
disabled: !1,
|
|
4571
4666
|
icon: "el-icon-refresh",
|
|
4572
|
-
innerText: "
|
|
4667
|
+
innerText: "",
|
|
4573
4668
|
show: !1,
|
|
4574
4669
|
col: void 0,
|
|
4575
4670
|
click: void 0
|
|
4576
4671
|
}
|
|
4577
4672
|
};
|
|
4578
4673
|
}
|
|
4579
|
-
function
|
|
4674
|
+
function zi(t) {
|
|
4580
4675
|
return t.type === "tooltip";
|
|
4581
4676
|
}
|
|
4582
|
-
function
|
|
4583
|
-
|
|
4677
|
+
function wt(t, e) {
|
|
4678
|
+
S(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4584
4679
|
}
|
|
4585
|
-
function
|
|
4680
|
+
function Q(t) {
|
|
4586
4681
|
return t === !1;
|
|
4587
4682
|
}
|
|
4588
|
-
function
|
|
4589
|
-
|
|
4683
|
+
function Qi(t, e) {
|
|
4684
|
+
S(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4590
4685
|
}
|
|
4591
|
-
function
|
|
4686
|
+
function Ue(t) {
|
|
4592
4687
|
const e = b({}, t);
|
|
4593
4688
|
return delete e.children, e;
|
|
4594
4689
|
}
|
|
4595
|
-
const
|
|
4690
|
+
const Zi = {
|
|
4596
4691
|
validate() {
|
|
4597
4692
|
const t = this.form();
|
|
4598
4693
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -4611,11 +4706,11 @@ const Xi = {
|
|
|
4611
4706
|
},
|
|
4612
4707
|
tidyOptions(t) {
|
|
4613
4708
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
4614
|
-
|
|
4709
|
+
Qi(t, e);
|
|
4615
4710
|
}), t;
|
|
4616
4711
|
},
|
|
4617
4712
|
tidyRule({ prop: t }) {
|
|
4618
|
-
return
|
|
4713
|
+
return wt(t, "title"), wt(t, "info"), t;
|
|
4619
4714
|
},
|
|
4620
4715
|
mergeProp(t) {
|
|
4621
4716
|
const e = {
|
|
@@ -4629,11 +4724,11 @@ const Xi = {
|
|
|
4629
4724
|
wrap: {}
|
|
4630
4725
|
};
|
|
4631
4726
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
4632
|
-
t.prop[r] =
|
|
4727
|
+
t.prop[r] = Y([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
4633
4728
|
});
|
|
4634
4729
|
},
|
|
4635
4730
|
getDefaultOptions() {
|
|
4636
|
-
return
|
|
4731
|
+
return Xi();
|
|
4637
4732
|
},
|
|
4638
4733
|
update() {
|
|
4639
4734
|
const t = this.options.form;
|
|
@@ -4656,16 +4751,16 @@ const Xi = {
|
|
|
4656
4751
|
});
|
|
4657
4752
|
},
|
|
4658
4753
|
render(t) {
|
|
4659
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
4754
|
+
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, Q(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
4660
4755
|
},
|
|
4661
4756
|
makeWrap(t, e) {
|
|
4662
4757
|
const r = t.prop, i = `${this.key}${t.key}`, s = r.col, n = this.isTitle(r) && r.wrap.title !== !1, o = !s.labelWidth && !n ? 0 : s.labelWidth, { inline: a, col: l } = this.rule.props;
|
|
4663
4758
|
delete r.wrap.title;
|
|
4664
|
-
const u =
|
|
4665
|
-
props:
|
|
4666
|
-
labelWidth: o === void 0 ? o :
|
|
4759
|
+
const u = Q(r.wrap.show) ? e : this.$r(Y([r.wrap, {
|
|
4760
|
+
props: q(b({
|
|
4761
|
+
labelWidth: o === void 0 ? o : jt(o),
|
|
4667
4762
|
label: n ? r.title.title : void 0
|
|
4668
|
-
},
|
|
4763
|
+
}, Ue(r.wrap || {})), {
|
|
4669
4764
|
prop: t.id,
|
|
4670
4765
|
rules: t.injectValidate()
|
|
4671
4766
|
}),
|
|
@@ -4674,29 +4769,30 @@ const Xi = {
|
|
|
4674
4769
|
ref: t.wrapRef,
|
|
4675
4770
|
type: "formItem"
|
|
4676
4771
|
}]), b({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
4677
|
-
return a === !0 ||
|
|
4772
|
+
return a === !0 || Q(l) || Q(s.show) ? u : this.makeCol(r, i, [u]);
|
|
4678
4773
|
},
|
|
4679
4774
|
isTitle(t) {
|
|
4680
4775
|
if (this.options.form.title === !1) return !1;
|
|
4681
4776
|
const e = t.title;
|
|
4682
|
-
return !(!e.title && !e.native ||
|
|
4777
|
+
return !(!e.title && !e.native || Q(e.show));
|
|
4683
4778
|
},
|
|
4684
4779
|
makeInfo(t, e, r) {
|
|
4685
|
-
|
|
4686
|
-
|
|
4780
|
+
var f, d, g;
|
|
4781
|
+
const i = b({}, t.title), s = b({}, t.info), n = zi(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
|
|
4782
|
+
title: (f = r.refRule) == null ? void 0 : f.__$title.value,
|
|
4687
4783
|
rule: r.rule,
|
|
4688
4784
|
options: this.options
|
|
4689
|
-
}) : r.refRule.__$title.value + (o.labelSuffix || o["label-suffix"] || "")];
|
|
4690
|
-
if (!
|
|
4691
|
-
const
|
|
4785
|
+
}) : ((d = r.refRule) == null ? void 0 : d.__$title.value) + (o.labelSuffix || o["label-suffix"] || "")];
|
|
4786
|
+
if (!Q(s.show) && (s.info || s.native) && !Q(s.icon)) {
|
|
4787
|
+
const m = {
|
|
4692
4788
|
type: s.type || "popover",
|
|
4693
4789
|
slot: "label",
|
|
4694
|
-
props:
|
|
4790
|
+
props: Ue(s),
|
|
4695
4791
|
key: `${e}pop`
|
|
4696
4792
|
};
|
|
4697
|
-
delete
|
|
4698
|
-
const
|
|
4699
|
-
s.info && !
|
|
4793
|
+
delete m.props.icon, delete m.props.show, delete m.props.info, delete m.props.align, delete m.props.native;
|
|
4794
|
+
const v = "content";
|
|
4795
|
+
s.info && !S(m.props, v) && (m.props[v] = (g = r.refRule) == null ? void 0 : g.__$info.value), l[s.align !== "left" ? "unshift" : "push"](this.$r(Y([s, m]), [
|
|
4700
4796
|
this.$r({
|
|
4701
4797
|
type: "i",
|
|
4702
4798
|
slot: n ? "default" : "reference",
|
|
@@ -4705,8 +4801,8 @@ const Xi = {
|
|
|
4705
4801
|
})
|
|
4706
4802
|
]));
|
|
4707
4803
|
}
|
|
4708
|
-
const u =
|
|
4709
|
-
props:
|
|
4804
|
+
const u = Y([i, {
|
|
4805
|
+
props: Ue(i),
|
|
4710
4806
|
key: `${e}tit`,
|
|
4711
4807
|
class: "fc-form-title",
|
|
4712
4808
|
slot: i.slot || "label",
|
|
@@ -4734,7 +4830,7 @@ const Xi = {
|
|
|
4734
4830
|
},
|
|
4735
4831
|
makeFormBtn() {
|
|
4736
4832
|
let t = [];
|
|
4737
|
-
if (
|
|
4833
|
+
if (Q(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Q(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4738
4834
|
return;
|
|
4739
4835
|
const e = this.$r({
|
|
4740
4836
|
type: "formItem",
|
|
@@ -4749,7 +4845,7 @@ const Xi = {
|
|
|
4749
4845
|
}, [e]);
|
|
4750
4846
|
},
|
|
4751
4847
|
makeResetBtn() {
|
|
4752
|
-
const t = b({}, this.options.resetBtn), e = t.innerText;
|
|
4848
|
+
const t = b({}, this.options.resetBtn), e = t.innerText || this.$handle.api.t("reset") || "重置";
|
|
4753
4849
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
4754
4850
|
type: "button",
|
|
4755
4851
|
props: t,
|
|
@@ -4765,7 +4861,7 @@ const Xi = {
|
|
|
4765
4861
|
}, [e]);
|
|
4766
4862
|
},
|
|
4767
4863
|
makeSubmitBtn() {
|
|
4768
|
-
const t = b({}, this.options.submitBtn), e = t.innerText;
|
|
4864
|
+
const t = b({}, this.options.submitBtn), e = t.innerText || this.$handle.api.t("submit") || "提交";
|
|
4769
4865
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
4770
4866
|
type: "button",
|
|
4771
4867
|
props: t,
|
|
@@ -4781,26 +4877,26 @@ const Xi = {
|
|
|
4781
4877
|
key: `${this.key}b1`
|
|
4782
4878
|
}, [e]);
|
|
4783
4879
|
}
|
|
4784
|
-
},
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
function
|
|
4880
|
+
}, he = {};
|
|
4881
|
+
Yi(he);
|
|
4882
|
+
xi(he);
|
|
4883
|
+
en(he);
|
|
4884
|
+
tn(he);
|
|
4885
|
+
rn(he);
|
|
4886
|
+
function Yi(t) {
|
|
4791
4887
|
["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
|
|
4792
4888
|
t[e] = I(e);
|
|
4793
4889
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4794
4890
|
}
|
|
4795
|
-
function
|
|
4891
|
+
function xi(t) {
|
|
4796
4892
|
const e = "select", r = "multiple";
|
|
4797
4893
|
t.selectMultiple = I(e, { [r]: !0 }), t.selectOne = I(e, { [r]: !1 });
|
|
4798
4894
|
}
|
|
4799
|
-
function
|
|
4895
|
+
function en(t) {
|
|
4800
4896
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4801
4897
|
Object.keys(r).reduce((i, s) => (i[s] = I(e, { type: r[s] }), i), t);
|
|
4802
4898
|
}
|
|
4803
|
-
function
|
|
4899
|
+
function tn(t) {
|
|
4804
4900
|
const e = "upload", r = {
|
|
4805
4901
|
image: ["image", 0],
|
|
4806
4902
|
file: ["file", 0],
|
|
@@ -4809,7 +4905,7 @@ function Yi(t) {
|
|
|
4809
4905
|
};
|
|
4810
4906
|
Object.keys(r).reduce((i, s) => (i[s] = I(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4811
4907
|
}
|
|
4812
|
-
function
|
|
4908
|
+
function rn(t) {
|
|
4813
4909
|
const e = {
|
|
4814
4910
|
frameInputs: ["input", 0],
|
|
4815
4911
|
frameFiles: ["file", 0],
|
|
@@ -4820,10 +4916,10 @@ function xi(t) {
|
|
|
4820
4916
|
};
|
|
4821
4917
|
return Object.keys(e).reduce((r, i) => (r[i] = I("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;
|
|
4822
4918
|
}
|
|
4823
|
-
function
|
|
4919
|
+
function Ot(t, e) {
|
|
4824
4920
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4825
4921
|
}
|
|
4826
|
-
function
|
|
4922
|
+
function nn(t, e) {
|
|
4827
4923
|
return {
|
|
4828
4924
|
formEl() {
|
|
4829
4925
|
return e.$manager.form();
|
|
@@ -4899,11 +4995,11 @@ function en(t, e) {
|
|
|
4899
4995
|
}
|
|
4900
4996
|
},
|
|
4901
4997
|
submitBtnProps: (r = {}) => {
|
|
4902
|
-
let i =
|
|
4998
|
+
let i = Ot(e.options.submitBtn, !0);
|
|
4903
4999
|
_(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4904
5000
|
},
|
|
4905
5001
|
resetBtnProps: (r = {}) => {
|
|
4906
|
-
let i =
|
|
5002
|
+
let i = Ot(e.options.resetBtn, !1);
|
|
4907
5003
|
_(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4908
5004
|
},
|
|
4909
5005
|
submit(r, i) {
|
|
@@ -4921,21 +5017,21 @@ function en(t, e) {
|
|
|
4921
5017
|
const Jt = {
|
|
4922
5018
|
name: "required",
|
|
4923
5019
|
load(t, e, r) {
|
|
4924
|
-
const i =
|
|
5020
|
+
const i = sn(t.getValue());
|
|
4925
5021
|
if (i.required === !1)
|
|
4926
5022
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
4927
5023
|
else {
|
|
4928
5024
|
const s = b({
|
|
4929
5025
|
required: !0,
|
|
4930
|
-
validator(
|
|
4931
|
-
h.empty(
|
|
5026
|
+
validator(o, a, l) {
|
|
5027
|
+
h.empty(a) ? l(s.message) : l();
|
|
4932
5028
|
}
|
|
4933
|
-
}, i);
|
|
5029
|
+
}, i), n = e.__fc__.refRule.__$title.value;
|
|
4934
5030
|
if (!s.message)
|
|
4935
|
-
s.message =
|
|
5031
|
+
s.message = r.t("required", { title: n }) || n + (r.getLocale() === "en" ? " is required" : "不能为空");
|
|
4936
5032
|
else {
|
|
4937
|
-
const
|
|
4938
|
-
|
|
5033
|
+
const o = s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
5034
|
+
o && (s.message = r.t(o[1], { title: n }));
|
|
4939
5035
|
}
|
|
4940
5036
|
t.getProp().validate = [s];
|
|
4941
5037
|
}
|
|
@@ -4945,25 +5041,25 @@ const Jt = {
|
|
|
4945
5041
|
Jt.load(...t);
|
|
4946
5042
|
}
|
|
4947
5043
|
};
|
|
4948
|
-
function
|
|
5044
|
+
function sn(t) {
|
|
4949
5045
|
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 : {};
|
|
4950
5046
|
}
|
|
4951
|
-
function
|
|
4952
|
-
t.componentAlias(
|
|
5047
|
+
function on(t) {
|
|
5048
|
+
t.componentAlias(Ki), Mr.forEach((e) => {
|
|
4953
5049
|
t.component(e.name, e);
|
|
4954
|
-
}), t.register(Jt),
|
|
5050
|
+
}), t.register(Jt), Wi.forEach((e) => {
|
|
4955
5051
|
t.parser(e);
|
|
4956
|
-
}), Object.keys(
|
|
4957
|
-
t.maker[e] =
|
|
5052
|
+
}), Object.keys(he).forEach((e) => {
|
|
5053
|
+
t.maker[e] = he[e];
|
|
4958
5054
|
});
|
|
4959
5055
|
}
|
|
4960
|
-
function
|
|
5056
|
+
function an() {
|
|
4961
5057
|
return Gt({
|
|
4962
5058
|
ui: "element-ui",
|
|
4963
|
-
version: "2.7.
|
|
4964
|
-
manager:
|
|
4965
|
-
extendApi:
|
|
4966
|
-
install:
|
|
5059
|
+
version: "2.7.3",
|
|
5060
|
+
manager: Zi,
|
|
5061
|
+
extendApi: nn,
|
|
5062
|
+
install: on,
|
|
4967
5063
|
attrs: {
|
|
4968
5064
|
normal: ["col", "wrap"],
|
|
4969
5065
|
array: ["className"],
|
|
@@ -4971,10 +5067,10 @@ function nn() {
|
|
|
4971
5067
|
}
|
|
4972
5068
|
});
|
|
4973
5069
|
}
|
|
4974
|
-
const ze =
|
|
5070
|
+
const ze = an();
|
|
4975
5071
|
typeof window != "undefined" && (window.formCreate = ze, window.Vue && ze.install(window.Vue));
|
|
4976
|
-
const
|
|
5072
|
+
const fn = ze.maker;
|
|
4977
5073
|
export {
|
|
4978
5074
|
ze as default,
|
|
4979
|
-
|
|
5075
|
+
fn as maker
|
|
4980
5076
|
};
|