@form-create/view-design 2.7.0 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form-create.esm.js +632 -594
- package/dist/form-create.js +4 -4
- package/dist/form-create.min.js +4 -4
- package/package.json +5 -13
package/dist/form-create.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/view-design v2.7.
|
|
4
|
-
* (c) 2018-
|
|
3
|
+
* @form-create/view-design v2.7.2
|
|
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.
|
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode('._fc-frame .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;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 .ivu-upload-list{margin-top:0}._fc-frame .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame .fc-upload-btn,._fc-frame .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;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-upload .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-upload .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;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 .ivu-upload-list{margin-top:0}._fc-upload .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._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;box-shadow:2px 2px 5px #0000001a;margin-right:4px;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 .ivu-form-item{margin-bottom:24px}.form-create .form-create .ivu-form-item .ivu-form-item{margin-bottom:0}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
10
10
|
var rr = Object.defineProperty, ir = Object.defineProperties;
|
|
11
11
|
var nr = Object.getOwnPropertyDescriptors;
|
|
12
|
-
var
|
|
12
|
+
var ot = Object.getOwnPropertySymbols;
|
|
13
13
|
var sr = Object.prototype.hasOwnProperty, or = Object.prototype.propertyIsEnumerable;
|
|
14
|
-
var
|
|
14
|
+
var at = (t, e, r) => e in t ? rr(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
|
-
sr.call(e, r) &&
|
|
17
|
-
if (
|
|
18
|
-
for (var r of
|
|
19
|
-
or.call(e, r) &&
|
|
16
|
+
sr.call(e, r) && at(t, r, e[r]);
|
|
17
|
+
if (ot)
|
|
18
|
+
for (var r of ot(e))
|
|
19
|
+
or.call(e, r) && at(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
},
|
|
22
|
-
import he, { getCurrentInstance as ar, provide as lr, inject as ur, toRefs as
|
|
21
|
+
}, q = (t, e) => ir(t, nr(e));
|
|
22
|
+
import he, { getCurrentInstance as ar, provide as lr, inject as ur, toRefs as lt, reactive as x, onBeforeMount as fr, watch as L, onMounted as cr, onBeforeUnmount as hr, onUpdated as dr, nextTick as P, markRaw as fe, computed as ce, toRef as Re, ref as pr } from "vue";
|
|
23
23
|
function mr(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ var gr = ["attrs", "props", "domProps"], yr = ["class", "style", "directives"],
|
|
|
51
51
|
};
|
|
52
52
|
}, _r = vr;
|
|
53
53
|
const D = /* @__PURE__ */ mr(_r);
|
|
54
|
-
function
|
|
54
|
+
function De(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => ((!e || e.indexOf(i) === -1) && r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
57
57
|
const Cr = "fcCheckbox", wr = {
|
|
@@ -117,17 +117,17 @@ const Cr = "fcCheckbox", wr = {
|
|
|
117
117
|
}, {
|
|
118
118
|
key: "" + r + "-" + e.value
|
|
119
119
|
}]));
|
|
120
|
-
}),
|
|
120
|
+
}), De(this.$slots)]);
|
|
121
121
|
},
|
|
122
122
|
mounted() {
|
|
123
123
|
this.$emit("fc.el", this.$refs.el);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
|
-
function
|
|
126
|
+
function H(t) {
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
129
|
const Or = "fcFrame";
|
|
130
|
-
function
|
|
130
|
+
function Ot(t) {
|
|
131
131
|
return {
|
|
132
132
|
name: Or,
|
|
133
133
|
props: {
|
|
@@ -170,11 +170,11 @@ function wt(t) {
|
|
|
170
170
|
},
|
|
171
171
|
okBtnText: {
|
|
172
172
|
type: String,
|
|
173
|
-
default: "
|
|
173
|
+
default: ""
|
|
174
174
|
},
|
|
175
175
|
closeBtnText: {
|
|
176
176
|
type: String,
|
|
177
|
-
default: "
|
|
177
|
+
default: ""
|
|
178
178
|
},
|
|
179
179
|
modalTitle: String,
|
|
180
180
|
handleIcon: {
|
|
@@ -250,7 +250,7 @@ function wt(t) {
|
|
|
250
250
|
},
|
|
251
251
|
data() {
|
|
252
252
|
return {
|
|
253
|
-
fileList:
|
|
253
|
+
fileList: H(this.value),
|
|
254
254
|
previewVisible: !1,
|
|
255
255
|
frameVisible: !1,
|
|
256
256
|
previewImage: ""
|
|
@@ -258,7 +258,7 @@ function wt(t) {
|
|
|
258
258
|
},
|
|
259
259
|
watch: {
|
|
260
260
|
value(e) {
|
|
261
|
-
this.fileList =
|
|
261
|
+
this.fileList = H(e);
|
|
262
262
|
},
|
|
263
263
|
fileList(e) {
|
|
264
264
|
const r = this.maxLength === 1 ? e[0] || "" : e;
|
|
@@ -425,14 +425,14 @@ function wt(t) {
|
|
|
425
425
|
on: {
|
|
426
426
|
click: () => this.onCancel() !== !1 && this.closeModel(!0)
|
|
427
427
|
}
|
|
428
|
-
}, [i])), n && a.push(e("Button", {
|
|
428
|
+
}, [i || this.formCreateInject.t("close") || "关闭"])), n && a.push(e("Button", {
|
|
429
429
|
attrs: {
|
|
430
430
|
type: "primary"
|
|
431
431
|
},
|
|
432
432
|
on: {
|
|
433
433
|
click: () => this.onOk() !== !1 && this.closeModel()
|
|
434
434
|
}
|
|
435
|
-
}, [r]))), a;
|
|
435
|
+
}, [r || this.formCreateInject.t("ok") || "确定"]))), a;
|
|
436
436
|
}
|
|
437
437
|
},
|
|
438
438
|
render() {
|
|
@@ -503,16 +503,16 @@ function wt(t) {
|
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
const
|
|
506
|
+
const Ft = Ot({
|
|
507
507
|
fileIcon: "md-document",
|
|
508
508
|
fileUpIcon: "ios-folder-open"
|
|
509
509
|
});
|
|
510
|
-
|
|
510
|
+
Ft.v2 = Ot({
|
|
511
511
|
fileIcon: "document-text",
|
|
512
512
|
fileUpIcon: "folder"
|
|
513
513
|
});
|
|
514
|
-
const
|
|
515
|
-
name:
|
|
514
|
+
const Fr = "fcRadio", Sr = {
|
|
515
|
+
name: Fr,
|
|
516
516
|
props: {
|
|
517
517
|
formCreateInject: {
|
|
518
518
|
type: Object,
|
|
@@ -569,7 +569,7 @@ const kr = "fcRadio", Fr = {
|
|
|
569
569
|
}, {
|
|
570
570
|
key: "" + r + "-" + e.value
|
|
571
571
|
}]));
|
|
572
|
-
}),
|
|
572
|
+
}), De(this.$slots)]);
|
|
573
573
|
},
|
|
574
574
|
mounted() {
|
|
575
575
|
this.$emit("fc.el", this.$refs.el);
|
|
@@ -604,11 +604,11 @@ const kr = "fcRadio", Fr = {
|
|
|
604
604
|
return h.type(e, t);
|
|
605
605
|
};
|
|
606
606
|
});
|
|
607
|
-
function
|
|
607
|
+
function k(t, e) {
|
|
608
608
|
return {}.hasOwnProperty.call(t, e);
|
|
609
609
|
}
|
|
610
|
-
const
|
|
611
|
-
name:
|
|
610
|
+
const kr = "fcSelect", Rr = {
|
|
611
|
+
name: kr,
|
|
612
612
|
functional: !0,
|
|
613
613
|
props: {
|
|
614
614
|
formCreateInject: {
|
|
@@ -634,7 +634,7 @@ const Rr = "fcSelect", Sr = {
|
|
|
634
634
|
}, [h.trueArray(n.options) && n.options.map((a, l) => r(a, l))]), s = e.props.formCreateInject.options;
|
|
635
635
|
return t("Select", D([{}, e.data, {
|
|
636
636
|
ref: "el"
|
|
637
|
-
}]), [(Array.isArray(s) ? s : []).map((n, o) =>
|
|
637
|
+
}]), [(Array.isArray(s) ? s : []).map((n, o) => k(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
638
638
|
},
|
|
639
639
|
mounted() {
|
|
640
640
|
this.$emit("fc.el", this.$refs.el);
|
|
@@ -670,7 +670,7 @@ const Rr = "fcSelect", Sr = {
|
|
|
670
670
|
},
|
|
671
671
|
methods: {
|
|
672
672
|
setStatus(t) {
|
|
673
|
-
const e =
|
|
673
|
+
const e = H(t), r = this.formCreateInject.prop.props.data;
|
|
674
674
|
this.type === "selected" ? this.checked(r, e, "selected") : this.checked(r, e, "checked"), this.$forceUpdate();
|
|
675
675
|
},
|
|
676
676
|
checked(t, e, r) {
|
|
@@ -688,21 +688,21 @@ const Rr = "fcSelect", Sr = {
|
|
|
688
688
|
ref: "tree"
|
|
689
689
|
}, {
|
|
690
690
|
on: e
|
|
691
|
-
}]), [
|
|
691
|
+
}]), [De(this.$slots)]);
|
|
692
692
|
},
|
|
693
693
|
mounted() {
|
|
694
694
|
this.$emit("fc.el", this.$refs.tree);
|
|
695
695
|
}
|
|
696
696
|
};
|
|
697
|
-
function
|
|
697
|
+
function ut(t) {
|
|
698
698
|
return typeof t == "object" ? t : {
|
|
699
699
|
url: t,
|
|
700
700
|
is_string: !0,
|
|
701
701
|
name: jr(t)
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
|
-
function
|
|
705
|
-
return
|
|
704
|
+
function ft(t) {
|
|
705
|
+
return q(b({}, t), {
|
|
706
706
|
file: t,
|
|
707
707
|
value: t
|
|
708
708
|
});
|
|
@@ -711,7 +711,7 @@ function jr(t) {
|
|
|
711
711
|
return ("" + t).split("/").pop();
|
|
712
712
|
}
|
|
713
713
|
const Ir = "fcUpload";
|
|
714
|
-
function
|
|
714
|
+
function St(t) {
|
|
715
715
|
return {
|
|
716
716
|
name: Ir,
|
|
717
717
|
props: {
|
|
@@ -754,11 +754,11 @@ function kt(t) {
|
|
|
754
754
|
};
|
|
755
755
|
},
|
|
756
756
|
created() {
|
|
757
|
-
this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = !1), this.formCreateInject.prop.props.defaultFileList =
|
|
757
|
+
this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = !1), this.formCreateInject.prop.props.defaultFileList = H(this.value).map(ut).map(ft);
|
|
758
758
|
},
|
|
759
759
|
watch: {
|
|
760
760
|
value(e) {
|
|
761
|
-
this.$refs.upload.fileList.every((r) => !r.status || r.status === "finished") && (this.$refs.upload.fileList =
|
|
761
|
+
this.$refs.upload.fileList.every((r) => !r.status || r.status === "finished") && (this.$refs.upload.fileList = H(e).map(ut).map(ft), this.uploadList = this.$refs.upload.fileList);
|
|
762
762
|
},
|
|
763
763
|
maxLength(e, r) {
|
|
764
764
|
(r === 1 || e === 1) && this.update();
|
|
@@ -864,7 +864,7 @@ function kt(t) {
|
|
|
864
864
|
type: this.uploadType === "file" ? "ios-cloud-upload-outline" : t.imgUpIcon,
|
|
865
865
|
size: 20
|
|
866
866
|
}
|
|
867
|
-
}]))])]) : null,
|
|
867
|
+
}]))])]) : null, De(this.$slots, ["default"])]);
|
|
868
868
|
},
|
|
869
869
|
update() {
|
|
870
870
|
let e = this.$refs.upload.fileList.map((r) => r.is_string ? r.url : r.value || r.url).filter((r) => r !== void 0);
|
|
@@ -907,15 +907,15 @@ function kt(t) {
|
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
|
-
const
|
|
910
|
+
const kt = St({
|
|
911
911
|
fileIcon: "md-document",
|
|
912
912
|
imgUpIcon: "md-images"
|
|
913
913
|
});
|
|
914
|
-
|
|
914
|
+
kt.v2 = St({
|
|
915
915
|
fileIcon: "document-text",
|
|
916
916
|
imgUpIcon: "image"
|
|
917
917
|
});
|
|
918
|
-
function
|
|
918
|
+
function S(t, e, r) {
|
|
919
919
|
he.set(t, e, r);
|
|
920
920
|
}
|
|
921
921
|
function Y(t, e) {
|
|
@@ -929,19 +929,19 @@ function ye(t, e = {}, r) {
|
|
|
929
929
|
if ((i = Array.isArray(n)) || h.Object(n)) {
|
|
930
930
|
let o = t[s] === void 0;
|
|
931
931
|
if (i)
|
|
932
|
-
i = !1, o &&
|
|
932
|
+
i = !1, o && S(t, s, []);
|
|
933
933
|
else if (n._clone && r !== void 0)
|
|
934
934
|
if (r)
|
|
935
|
-
n = n.getRule(), o &&
|
|
935
|
+
n = n.getRule(), o && S(t, s, {});
|
|
936
936
|
else {
|
|
937
|
-
|
|
937
|
+
S(t, s, n._clone());
|
|
938
938
|
continue;
|
|
939
939
|
}
|
|
940
940
|
else
|
|
941
|
-
o &&
|
|
941
|
+
o && S(t, s, {});
|
|
942
942
|
t[s] = ye(t[s], n, r);
|
|
943
943
|
} else
|
|
944
|
-
|
|
944
|
+
S(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
|
|
945
945
|
}
|
|
946
946
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
947
947
|
}
|
|
@@ -951,7 +951,7 @@ function J(t) {
|
|
|
951
951
|
const Ar = Object.assign || function(t) {
|
|
952
952
|
for (let e, r = 1; r < arguments.length; r++)
|
|
953
953
|
for (let i in e = arguments[r], e)
|
|
954
|
-
Object.prototype.hasOwnProperty.call(e, i) &&
|
|
954
|
+
Object.prototype.hasOwnProperty.call(e, i) && S(t, i, e[i]);
|
|
955
955
|
return t;
|
|
956
956
|
};
|
|
957
957
|
function _() {
|
|
@@ -1080,7 +1080,7 @@ const Vr = "fcGroup", Pr = {
|
|
|
1080
1080
|
},
|
|
1081
1081
|
methods: {
|
|
1082
1082
|
_value(t) {
|
|
1083
|
-
return t &&
|
|
1083
|
+
return t && k(t, this.field) ? t[this.field] : t;
|
|
1084
1084
|
},
|
|
1085
1085
|
cache(t, e) {
|
|
1086
1086
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1234,9 +1234,9 @@ const Vr = "fcGroup", Pr = {
|
|
|
1234
1234
|
key: o
|
|
1235
1235
|
}, {
|
|
1236
1236
|
on: {
|
|
1237
|
-
"update:value": (
|
|
1238
|
-
"emit-event": (
|
|
1239
|
-
input: (
|
|
1237
|
+
"update:value": (m) => this.formData(o, m),
|
|
1238
|
+
"emit-event": (m, ...p) => this.emitEvent(m, p, a, o),
|
|
1239
|
+
input: (m) => this.add$f(a, o, m)
|
|
1240
1240
|
}
|
|
1241
1241
|
}, {}, {
|
|
1242
1242
|
props: {
|
|
@@ -1346,12 +1346,12 @@ const Vr = "fcGroup", Pr = {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
}, Tr = [
|
|
1348
1348
|
wr,
|
|
1349
|
-
Fr,
|
|
1350
1349
|
Sr,
|
|
1350
|
+
Rr,
|
|
1351
1351
|
Dr,
|
|
1352
1352
|
Lr,
|
|
1353
|
-
Ot,
|
|
1354
1353
|
Ft,
|
|
1354
|
+
kt,
|
|
1355
1355
|
Pr
|
|
1356
1356
|
];
|
|
1357
1357
|
function le(t, e) {
|
|
@@ -1364,12 +1364,12 @@ function ge(t) {
|
|
|
1364
1364
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
1365
1365
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
1366
1366
|
}
|
|
1367
|
-
const
|
|
1367
|
+
const Se = (t, e) => {
|
|
1368
1368
|
if (!(!t || t === e || !t.$props)) {
|
|
1369
1369
|
if (t.$props.formCreateInject)
|
|
1370
1370
|
return t.$props.formCreateInject;
|
|
1371
1371
|
if (t.$parent)
|
|
1372
|
-
return
|
|
1372
|
+
return Se(t.$parent, e);
|
|
1373
1373
|
}
|
|
1374
1374
|
};
|
|
1375
1375
|
function Nr(t, e, r) {
|
|
@@ -1432,91 +1432,91 @@ function Nr(t, e, r) {
|
|
|
1432
1432
|
a = a.parent;
|
|
1433
1433
|
else
|
|
1434
1434
|
a = n;
|
|
1435
|
-
const { rule: l, value: u, subForm: f, inFor:
|
|
1435
|
+
const { rule: l, value: u, subForm: f, inFor: m } = lt(s), p = x({
|
|
1436
1436
|
ctxInject: {},
|
|
1437
1437
|
destroyed: !1,
|
|
1438
1438
|
isShow: !0,
|
|
1439
1439
|
unique: 1,
|
|
1440
1440
|
renderRule: [...l.value || []],
|
|
1441
1441
|
updateValue: JSON.stringify(u.value || {})
|
|
1442
|
-
}),
|
|
1442
|
+
}), y = new t(n), v = y.api(), w = m.value, j = () => {
|
|
1443
1443
|
if (o) {
|
|
1444
|
-
const O =
|
|
1444
|
+
const O = Se(n, o);
|
|
1445
1445
|
if (O) {
|
|
1446
1446
|
let E;
|
|
1447
|
-
w ? (E =
|
|
1447
|
+
w ? (E = H(O.getSubForm()), E.push(v)) : E = v, O.subForm(E);
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
1450
1450
|
}, Z = () => {
|
|
1451
|
-
const O =
|
|
1451
|
+
const O = Se(n, o);
|
|
1452
1452
|
if (O)
|
|
1453
1453
|
if (w) {
|
|
1454
|
-
const E =
|
|
1455
|
-
|
|
1454
|
+
const E = H(O.getSubForm()), B = E.indexOf(v);
|
|
1455
|
+
B > -1 && E.splice(B, 1);
|
|
1456
1456
|
} else
|
|
1457
1457
|
O.subForm();
|
|
1458
1458
|
};
|
|
1459
1459
|
let V = null;
|
|
1460
1460
|
fr(() => {
|
|
1461
|
-
|
|
1461
|
+
L(() => {
|
|
1462
1462
|
let O = "";
|
|
1463
1463
|
const E = s.option && s.option.globalClass || {};
|
|
1464
|
-
Object.keys(E).forEach((
|
|
1464
|
+
Object.keys(E).forEach((B) => {
|
|
1465
1465
|
let re = "";
|
|
1466
|
-
E[
|
|
1467
|
-
re += ge(ve) + ":" + E[
|
|
1468
|
-
}), E[
|
|
1466
|
+
E[B].style && Object.keys(E[B].style).forEach((ve) => {
|
|
1467
|
+
re += ge(ve) + ":" + E[B].style[ve] + ";";
|
|
1468
|
+
}), E[B].content && (re += E[B].content + ";"), re && (O += `.${B}{${re}}`);
|
|
1469
1469
|
}), s.option && s.option.style && (O += s.option.style), V || (V = document.createElement("style"), V.type = "text/css", document.head.appendChild(V)), V.innerHTML = O || "";
|
|
1470
1470
|
}, () => {
|
|
1471
1471
|
});
|
|
1472
1472
|
});
|
|
1473
|
-
const
|
|
1474
|
-
|
|
1475
|
-
}, 100),
|
|
1476
|
-
|
|
1473
|
+
const T = le(() => {
|
|
1474
|
+
y.bus.$emit("$loadData.$topForm");
|
|
1475
|
+
}, 100), Ie = le(() => {
|
|
1476
|
+
y.bus.$emit("$loadData.$form");
|
|
1477
1477
|
}, 100), $e = (O) => {
|
|
1478
|
-
|
|
1478
|
+
y.bus.$emit("change-$form." + O);
|
|
1479
1479
|
};
|
|
1480
1480
|
return cr(() => {
|
|
1481
|
-
o && (v.top.bus.$on("$loadData.$form",
|
|
1481
|
+
o && (v.top.bus.$on("$loadData.$form", T), v.top.bus.$on("change", $e)), y.mounted();
|
|
1482
1482
|
}), hr(() => {
|
|
1483
|
-
o && (v.top.bus.$off("$loadData.$form",
|
|
1483
|
+
o && (v.top.bus.$off("$loadData.$form", T), v.top.bus.$off("change", $e)), V && document.head.removeChild(V), Z(), p.destroyed = !0, y.unmount();
|
|
1484
1484
|
}), dr(() => {
|
|
1485
|
-
|
|
1486
|
-
}),
|
|
1485
|
+
y.updated();
|
|
1486
|
+
}), L(f, (O) => {
|
|
1487
1487
|
O ? j() : Z();
|
|
1488
|
-
}, { immediate: !0 }),
|
|
1489
|
-
|
|
1490
|
-
}),
|
|
1491
|
-
|
|
1492
|
-
}, { deep: !0 }),
|
|
1488
|
+
}, { immediate: !0 }), L(() => [...l.value], (O) => {
|
|
1489
|
+
y.$handle.isBreakWatch() || O.length === p.renderRule.length && O.every((E) => p.renderRule.indexOf(E) > -1) || (y.$handle.updateAppendData(), y.$handle.reloadRule(l.value), n.renderRule());
|
|
1490
|
+
}), L(() => s.option, () => {
|
|
1491
|
+
y.initOptions(), v.refresh();
|
|
1492
|
+
}, { deep: !0 }), L(() => [s.disabled, s.preview], () => {
|
|
1493
1493
|
v.refresh();
|
|
1494
|
-
}),
|
|
1495
|
-
JSON.stringify(O || {}) !==
|
|
1496
|
-
}, { deep: !0, flush: "post" }),
|
|
1497
|
-
v.coverValue({}),
|
|
1498
|
-
|
|
1494
|
+
}), L(u, (O) => {
|
|
1495
|
+
JSON.stringify(O || {}) !== p.updateValue && (v.config.forceCoverValue ? v.coverValue(O || {}) : v.setValue(O || {}));
|
|
1496
|
+
}, { deep: !0, flush: "post" }), L(() => s.index, () => {
|
|
1497
|
+
v.coverValue({}), y.$handle.updateAppendData(), P(() => {
|
|
1498
|
+
P(() => {
|
|
1499
1499
|
v.clearValidateState();
|
|
1500
1500
|
});
|
|
1501
1501
|
});
|
|
1502
|
-
}, { flush: "sync" }),
|
|
1503
|
-
fc: fe(
|
|
1502
|
+
}, { flush: "sync" }), q(b({
|
|
1503
|
+
fc: fe(y),
|
|
1504
1504
|
parent: o && fe(o),
|
|
1505
1505
|
top: fe(a),
|
|
1506
1506
|
fapi: fe(v)
|
|
1507
|
-
},
|
|
1508
|
-
getGroupInject: () =>
|
|
1507
|
+
}, lt(p)), {
|
|
1508
|
+
getGroupInject: () => Se(n, o),
|
|
1509
1509
|
refresh() {
|
|
1510
|
-
++
|
|
1510
|
+
++p.unique;
|
|
1511
1511
|
},
|
|
1512
1512
|
renderRule() {
|
|
1513
|
-
|
|
1513
|
+
p.renderRule = [...l.value || []];
|
|
1514
1514
|
},
|
|
1515
1515
|
updateValue(O) {
|
|
1516
|
-
if (
|
|
1516
|
+
if (p.destroyed) return;
|
|
1517
1517
|
const E = JSON.stringify(O);
|
|
1518
|
-
|
|
1519
|
-
|
|
1518
|
+
p.updateValue !== E && (p.updateValue = E, n.$emit("update:value", O), P(() => {
|
|
1519
|
+
Ie(), o || T();
|
|
1520
1520
|
}));
|
|
1521
1521
|
}
|
|
1522
1522
|
});
|
|
@@ -1526,23 +1526,23 @@ function Nr(t, e, r) {
|
|
|
1526
1526
|
}
|
|
1527
1527
|
};
|
|
1528
1528
|
}
|
|
1529
|
-
const Rt = ["attrs", "props", "domProps", "scopedSlots"],
|
|
1530
|
-
const i = [...Rt, ...r.normal || []], s = [...
|
|
1529
|
+
const Rt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style", "directives"], Dt = ["on", "nativeOn", "hook"], X = (t, e = {}, r = {}) => {
|
|
1530
|
+
const i = [...Rt, ...r.normal || []], s = [...Et, ...r.array || []], n = [...Dt, ...r.functional || []], o = r.props || [];
|
|
1531
1531
|
return t.reduce((a, l) => {
|
|
1532
1532
|
for (const u in l)
|
|
1533
1533
|
if (a[u])
|
|
1534
1534
|
if (o.indexOf(u) > -1)
|
|
1535
|
-
a[u] =
|
|
1535
|
+
a[u] = X([l[u]], a[u]);
|
|
1536
1536
|
else if (i.indexOf(u) > -1)
|
|
1537
1537
|
a[u] = b(b({}, a[u]), l[u]);
|
|
1538
1538
|
else if (s.indexOf(u) > -1) {
|
|
1539
|
-
const f = a[u] instanceof Array ? a[u] : [a[u]],
|
|
1540
|
-
a[u] = [...f, ...
|
|
1539
|
+
const f = a[u] instanceof Array ? a[u] : [a[u]], m = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1540
|
+
a[u] = [...f, ...m];
|
|
1541
1541
|
} else if (n.indexOf(u) > -1)
|
|
1542
1542
|
for (const f in l[u])
|
|
1543
1543
|
if (a[u][f]) {
|
|
1544
|
-
const
|
|
1545
|
-
a[u][f] = [...
|
|
1544
|
+
const m = a[u][f] instanceof Array ? a[u][f] : [a[u][f]], p = l[u][f] instanceof Array ? l[u][f] : [l[u][f]];
|
|
1545
|
+
a[u][f] = [...m, ...p];
|
|
1546
1546
|
} else
|
|
1547
1547
|
a[u][f] = l[u][f];
|
|
1548
1548
|
else if (u === "hook")
|
|
@@ -1556,15 +1556,15 @@ const Rt = ["attrs", "props", "domProps", "scopedSlots"], St = ["class", "style"
|
|
|
1556
1556
|
}, e);
|
|
1557
1557
|
}, Mr = (t, e) => function() {
|
|
1558
1558
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1559
|
-
},
|
|
1560
|
-
function
|
|
1561
|
-
return [...
|
|
1559
|
+
}, jt = ["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"];
|
|
1560
|
+
function It() {
|
|
1561
|
+
return [...jt, ...Rt, ...Et, ...Dt, ...Ze, ...Ye];
|
|
1562
1562
|
}
|
|
1563
|
-
function
|
|
1563
|
+
function At(t, e, r) {
|
|
1564
1564
|
return `[form-create ${t}]: ${e}`;
|
|
1565
1565
|
}
|
|
1566
1566
|
function xe(t, e) {
|
|
1567
|
-
console.error(
|
|
1567
|
+
console.error(At("err", t));
|
|
1568
1568
|
}
|
|
1569
1569
|
function Ur(t) {
|
|
1570
1570
|
xe(t.toString()), console.error(t);
|
|
@@ -1588,7 +1588,7 @@ function et(t, e) {
|
|
|
1588
1588
|
function Be(t) {
|
|
1589
1589
|
return new Function("return " + t)();
|
|
1590
1590
|
}
|
|
1591
|
-
function
|
|
1591
|
+
function W(t, e) {
|
|
1592
1592
|
if (t && h.String(t) && t.length > 4) {
|
|
1593
1593
|
let r = t.trim(), i = !1;
|
|
1594
1594
|
try {
|
|
@@ -1627,21 +1627,21 @@ err: ${s}`);
|
|
|
1627
1627
|
}
|
|
1628
1628
|
return t;
|
|
1629
1629
|
}
|
|
1630
|
-
function
|
|
1630
|
+
function Vt(t, e) {
|
|
1631
1631
|
return JSON.parse(t, function(r, i) {
|
|
1632
|
-
return h.Undef(i) || !i.indexOf ? i :
|
|
1632
|
+
return h.Undef(i) || !i.indexOf ? i : W(i, e);
|
|
1633
1633
|
});
|
|
1634
1634
|
}
|
|
1635
1635
|
let Gr = 0;
|
|
1636
|
-
function
|
|
1636
|
+
function je() {
|
|
1637
1637
|
const t = 370 + ++Gr;
|
|
1638
1638
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
1639
1639
|
}
|
|
1640
1640
|
function ee(t, e, r) {
|
|
1641
1641
|
let i = t, s;
|
|
1642
1642
|
return (e || "").split(".").forEach((n) => {
|
|
1643
|
-
s && ((!i[s] || typeof i[s] != "object") &&
|
|
1644
|
-
}),
|
|
1643
|
+
s && ((!i[s] || typeof i[s] != "object") && S(i, s, {}), i = i[s]), s = n;
|
|
1644
|
+
}), S(i, s, r), i;
|
|
1645
1645
|
}
|
|
1646
1646
|
function Ke(t, e) {
|
|
1647
1647
|
return {
|
|
@@ -1651,25 +1651,25 @@ function Ke(t, e) {
|
|
|
1651
1651
|
writable: !!e
|
|
1652
1652
|
};
|
|
1653
1653
|
}
|
|
1654
|
-
function Vt(t, e) {
|
|
1655
|
-
return Pt([t], e || !1)[0];
|
|
1656
|
-
}
|
|
1657
1654
|
function Pt(t, e) {
|
|
1655
|
+
return Bt([t], e || !1)[0];
|
|
1656
|
+
}
|
|
1657
|
+
function Bt(t, e) {
|
|
1658
1658
|
return ye([], [...t], e || !1);
|
|
1659
1659
|
}
|
|
1660
|
-
function
|
|
1661
|
-
return
|
|
1660
|
+
function Q(t, e) {
|
|
1661
|
+
return X(Array.isArray(e) ? e : [e], t, { array: Ze, normal: Ye }), t;
|
|
1662
1662
|
}
|
|
1663
|
-
function
|
|
1663
|
+
function ct(t) {
|
|
1664
1664
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1665
1665
|
return e.type || (e.type = "input"), e;
|
|
1666
1666
|
}
|
|
1667
1667
|
function Hr(t, e) {
|
|
1668
1668
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1669
|
-
e[r] && (t[r] =
|
|
1669
|
+
e[r] && (t[r] = Q(t[r] || {}, e[r]));
|
|
1670
1670
|
}), t) : e;
|
|
1671
1671
|
}
|
|
1672
|
-
function
|
|
1672
|
+
function Lt(t, e) {
|
|
1673
1673
|
Object.defineProperties(t, Object.keys(e).reduce((r, i) => (r[i] = {
|
|
1674
1674
|
get() {
|
|
1675
1675
|
return e[i]();
|
|
@@ -1679,7 +1679,7 @@ function Bt(t, e) {
|
|
|
1679
1679
|
function oe(t) {
|
|
1680
1680
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1681
1681
|
}
|
|
1682
|
-
function
|
|
1682
|
+
function F(t, e) {
|
|
1683
1683
|
try {
|
|
1684
1684
|
e = t();
|
|
1685
1685
|
} catch (r) {
|
|
@@ -1689,7 +1689,7 @@ function k(t, e) {
|
|
|
1689
1689
|
}
|
|
1690
1690
|
function Xe(t, e) {
|
|
1691
1691
|
let r = null;
|
|
1692
|
-
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e &&
|
|
1692
|
+
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e && H(r).forEach((i) => {
|
|
1693
1693
|
(Array.isArray(i) ? i : [i]).forEach((n) => {
|
|
1694
1694
|
n && typeof n == "object" && (n.data || (n.data = {}), (!n.data.slot || n.data.slot === "default") && (n.data.slot = e || "default"));
|
|
1695
1695
|
});
|
|
@@ -1740,18 +1740,18 @@ function Le() {
|
|
|
1740
1740
|
}
|
|
1741
1741
|
};
|
|
1742
1742
|
}
|
|
1743
|
-
function
|
|
1743
|
+
function Oe(t, e) {
|
|
1744
1744
|
return Object.setPrototypeOf(t, e), t;
|
|
1745
1745
|
}
|
|
1746
|
-
const
|
|
1747
|
-
"==": (t, e) => JSON.stringify(t) === JSON.stringify(
|
|
1746
|
+
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, ae = {
|
|
1747
|
+
"==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
|
|
1748
1748
|
"!=": (t, e) => !ae["=="](t, e),
|
|
1749
1749
|
">": (t, e) => t > e,
|
|
1750
1750
|
">=": (t, e) => t >= e,
|
|
1751
1751
|
"<": (t, e) => t < e,
|
|
1752
1752
|
"<=": (t, e) => t <= e,
|
|
1753
1753
|
on(t, e) {
|
|
1754
|
-
return t && t.indexOf && t.indexOf(
|
|
1754
|
+
return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
|
|
1755
1755
|
},
|
|
1756
1756
|
notOn(t, e) {
|
|
1757
1757
|
return !ae.on(t, e);
|
|
@@ -1778,7 +1778,7 @@ const ct = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1778
1778
|
return new RegExp(e, "g").test(t);
|
|
1779
1779
|
}
|
|
1780
1780
|
};
|
|
1781
|
-
function
|
|
1781
|
+
function U(t, e) {
|
|
1782
1782
|
return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => {
|
|
1783
1783
|
t != null && (t = t[r]);
|
|
1784
1784
|
}), t;
|
|
@@ -1791,13 +1791,13 @@ function Wr(t) {
|
|
|
1791
1791
|
r[1] && (i[r[1]] = !0);
|
|
1792
1792
|
return Object.keys(i);
|
|
1793
1793
|
}
|
|
1794
|
-
function
|
|
1794
|
+
function dt(t) {
|
|
1795
1795
|
let e = t.split("."), r = [], i = "";
|
|
1796
1796
|
return e.forEach((s, n) => {
|
|
1797
1797
|
n === 0 ? i = s : i += "." + s, r.push(i);
|
|
1798
1798
|
}), r.join(" && ");
|
|
1799
1799
|
}
|
|
1800
|
-
function
|
|
1800
|
+
function Tt() {
|
|
1801
1801
|
return {
|
|
1802
1802
|
props: {},
|
|
1803
1803
|
on: {},
|
|
@@ -1816,42 +1816,42 @@ function A(t, e) {
|
|
|
1816
1816
|
};
|
|
1817
1817
|
}
|
|
1818
1818
|
function tt(t, e, r, i, s) {
|
|
1819
|
-
this._data = _(
|
|
1819
|
+
this._data = _(Tt(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1820
1820
|
}
|
|
1821
1821
|
_(tt.prototype, {
|
|
1822
1822
|
getRule() {
|
|
1823
1823
|
return this._data;
|
|
1824
1824
|
},
|
|
1825
1825
|
setProp(t, e) {
|
|
1826
|
-
return
|
|
1826
|
+
return S(this._data, t, e), this;
|
|
1827
1827
|
},
|
|
1828
1828
|
_clone() {
|
|
1829
1829
|
const t = new this.constructor();
|
|
1830
|
-
return t._data =
|
|
1830
|
+
return t._data = Pt(this._data), t;
|
|
1831
1831
|
}
|
|
1832
1832
|
});
|
|
1833
|
-
function
|
|
1833
|
+
function Nt(t) {
|
|
1834
1834
|
t.forEach((e) => {
|
|
1835
1835
|
tt.prototype[e] = function(r) {
|
|
1836
|
-
return
|
|
1836
|
+
return Q(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1837
1837
|
};
|
|
1838
1838
|
});
|
|
1839
1839
|
}
|
|
1840
|
-
|
|
1841
|
-
const
|
|
1840
|
+
Nt(It());
|
|
1841
|
+
const Mt = A("");
|
|
1842
1842
|
function zr(t, e, r) {
|
|
1843
|
-
let i =
|
|
1843
|
+
let i = Mt("", e);
|
|
1844
1844
|
return i._data.type = t, i._data.title = r, i;
|
|
1845
1845
|
}
|
|
1846
|
-
function
|
|
1847
|
-
let s =
|
|
1846
|
+
function pt(t, e, r, i) {
|
|
1847
|
+
let s = Mt("", r);
|
|
1848
1848
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1849
1849
|
}
|
|
1850
1850
|
function Kr() {
|
|
1851
1851
|
return {
|
|
1852
1852
|
create: zr,
|
|
1853
|
-
createTmp:
|
|
1854
|
-
template:
|
|
1853
|
+
createTmp: pt,
|
|
1854
|
+
template: pt,
|
|
1855
1855
|
factory: A
|
|
1856
1856
|
};
|
|
1857
1857
|
}
|
|
@@ -1859,7 +1859,7 @@ function Xr(t, e, r) {
|
|
|
1859
1859
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1860
1860
|
return s.status = r.status, s.url = t, s;
|
|
1861
1861
|
}
|
|
1862
|
-
function
|
|
1862
|
+
function mt(t) {
|
|
1863
1863
|
const e = t.responseText || t.response;
|
|
1864
1864
|
if (!e)
|
|
1865
1865
|
return e;
|
|
@@ -1869,12 +1869,14 @@ function pt(t) {
|
|
|
1869
1869
|
return e;
|
|
1870
1870
|
}
|
|
1871
1871
|
}
|
|
1872
|
-
function
|
|
1872
|
+
function Ut(t) {
|
|
1873
1873
|
if (typeof XMLHttpRequest == "undefined")
|
|
1874
1874
|
return;
|
|
1875
1875
|
const e = new XMLHttpRequest();
|
|
1876
1876
|
let r = t.action || "";
|
|
1877
|
-
if (t.
|
|
1877
|
+
if (e.upload && t.onProgress && e.upload.addEventListener("progress", (n) => {
|
|
1878
|
+
n.percent = n.total > 0 ? n.loaded / n.total * 100 : 0, t.onProgress(n);
|
|
1879
|
+
}), t.query) {
|
|
1878
1880
|
const n = new URLSearchParams(t.query).toString();
|
|
1879
1881
|
r.includes("?") ? r += `&${n}` : r += `?${n}`;
|
|
1880
1882
|
}
|
|
@@ -1882,25 +1884,25 @@ function Mt(t) {
|
|
|
1882
1884
|
t.onError(o);
|
|
1883
1885
|
}, e.onload = function() {
|
|
1884
1886
|
if (e.status < 200 || e.status >= 300)
|
|
1885
|
-
return t.onError(Xr(r, t, e),
|
|
1886
|
-
t.onSuccess(
|
|
1887
|
+
return t.onError(Xr(r, t, e), mt(e));
|
|
1888
|
+
t.onSuccess(mt(e));
|
|
1887
1889
|
}, e.open(t.method || "get", r, !0);
|
|
1888
1890
|
let i;
|
|
1889
|
-
t.data && ((t.dataType || "").toLowerCase() !== "json" ? (i = new FormData(), Object.keys(t.data).map((n) => {
|
|
1891
|
+
(t.data || t.file) && (t.file || (t.dataType || "").toLowerCase() !== "json" ? (i = new FormData(), Object.keys(t.data || {}).map((n) => {
|
|
1890
1892
|
i.append(n, t.data[n]);
|
|
1891
|
-
})) : (i = JSON.stringify(t.data), e.setRequestHeader("content-type", "application/json"))), t.withCredentials && "withCredentials" in e && (e.withCredentials = !0);
|
|
1893
|
+
})) : (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);
|
|
1892
1894
|
const s = t.headers || {};
|
|
1893
1895
|
Object.keys(s).forEach((n) => {
|
|
1894
1896
|
s[n] != null && e.setRequestHeader(n, s[n]);
|
|
1895
1897
|
}), e.send(i);
|
|
1896
1898
|
}
|
|
1897
|
-
function
|
|
1899
|
+
function gt(t, e, r) {
|
|
1898
1900
|
return new Promise((i, s) => {
|
|
1899
|
-
(e ||
|
|
1901
|
+
(e || Ut)(q(b({}, t), {
|
|
1900
1902
|
onSuccess(n) {
|
|
1901
1903
|
let o = (l) => l;
|
|
1902
|
-
const a =
|
|
1903
|
-
h.Function(a) ? o = a : a && h.String(a) && (o = (l) =>
|
|
1904
|
+
const a = W(t.parse);
|
|
1905
|
+
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => U(l, a)), i(o(n, void 0, r));
|
|
1904
1906
|
},
|
|
1905
1907
|
onError(n) {
|
|
1906
1908
|
s(n);
|
|
@@ -1918,7 +1920,7 @@ function Qr(t) {
|
|
|
1918
1920
|
function r(n, o, a) {
|
|
1919
1921
|
e(n).forEach((l) => {
|
|
1920
1922
|
t.getCtxs(l).forEach((u) => {
|
|
1921
|
-
|
|
1923
|
+
S(u.rule, o, a), t.$render.clearCache(u);
|
|
1922
1924
|
});
|
|
1923
1925
|
});
|
|
1924
1926
|
}
|
|
@@ -1983,7 +1985,7 @@ function Qr(t) {
|
|
|
1983
1985
|
},
|
|
1984
1986
|
getValue(n) {
|
|
1985
1987
|
const o = t.getFieldCtx(n);
|
|
1986
|
-
return o ? me(o.rule.value) : t.options.appendValue !== !1 &&
|
|
1988
|
+
return o ? me(o.rule.value) : t.options.appendValue !== !1 && k(t.appendData, n) ? me(t.appendData[n]) : void 0;
|
|
1987
1989
|
},
|
|
1988
1990
|
coverValue(n) {
|
|
1989
1991
|
const o = b({}, n || {});
|
|
@@ -1991,7 +1993,7 @@ function Qr(t) {
|
|
|
1991
1993
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
1992
1994
|
const l = t.fieldCtx[a];
|
|
1993
1995
|
if (l) {
|
|
1994
|
-
const u =
|
|
1996
|
+
const u = k(n, a);
|
|
1995
1997
|
l.forEach((f) => {
|
|
1996
1998
|
f.rule.value = u ? n[a] : void 0;
|
|
1997
1999
|
}), delete o[a];
|
|
@@ -2070,7 +2072,7 @@ function Qr(t) {
|
|
|
2070
2072
|
disabled(n, o) {
|
|
2071
2073
|
e(o).forEach((a) => {
|
|
2072
2074
|
t.getCtxs(a).forEach((l) => {
|
|
2073
|
-
|
|
2075
|
+
S(l.rule.props, "disabled", !!n);
|
|
2074
2076
|
});
|
|
2075
2077
|
}), t.refresh();
|
|
2076
2078
|
},
|
|
@@ -2128,7 +2130,7 @@ function Qr(t) {
|
|
|
2128
2130
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2129
2131
|
},
|
|
2130
2132
|
hideForm: (n) => {
|
|
2131
|
-
|
|
2133
|
+
S(t.vm, "isShow", !n);
|
|
2132
2134
|
},
|
|
2133
2135
|
changeStatus: () => t.changeStatus,
|
|
2134
2136
|
clearChangeStatus: () => {
|
|
@@ -2146,7 +2148,7 @@ function Qr(t) {
|
|
|
2146
2148
|
},
|
|
2147
2149
|
mergeRule: (n, o) => {
|
|
2148
2150
|
t.getCtxs(n).forEach((a) => {
|
|
2149
|
-
|
|
2151
|
+
Q(a.rule, o);
|
|
2150
2152
|
});
|
|
2151
2153
|
},
|
|
2152
2154
|
mergeRules(n) {
|
|
@@ -2173,7 +2175,7 @@ function Qr(t) {
|
|
|
2173
2175
|
},
|
|
2174
2176
|
setEffect(n, o, a) {
|
|
2175
2177
|
const l = t.getCtx(n);
|
|
2176
|
-
l && o && (o[0] === "$" && (o = o.substr(1)),
|
|
2178
|
+
l && o && (o[0] === "$" && (o = o.substr(1)), k(l.rule, "$" + o) && S(l.rule, "$" + o, a), k(l.rule, "effect") || S(l.rule, "effect", {}), S(l.rule.effect, o, a));
|
|
2177
2179
|
},
|
|
2178
2180
|
clearEffectData(n, o) {
|
|
2179
2181
|
const a = t.getCtx(n);
|
|
@@ -2195,18 +2197,22 @@ function Qr(t) {
|
|
|
2195
2197
|
t.getCtxs(o).forEach((a) => {
|
|
2196
2198
|
t.$render.clearCache(a), a.rule.value = me(a.defaultValue);
|
|
2197
2199
|
});
|
|
2198
|
-
}),
|
|
2199
|
-
|
|
2200
|
-
|
|
2200
|
+
}), P(() => {
|
|
2201
|
+
P(() => {
|
|
2202
|
+
P(() => {
|
|
2203
|
+
s.clearValidateState(n);
|
|
2204
|
+
});
|
|
2205
|
+
});
|
|
2206
|
+
}), n == null && (h.Function(t.options.onReset) && F(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
2201
2207
|
},
|
|
2202
2208
|
method(n, o) {
|
|
2203
2209
|
const a = s.el(n);
|
|
2204
2210
|
if (!a || !a[o])
|
|
2205
|
-
throw new Error(
|
|
2211
|
+
throw new Error(At("err", `${o} 方法不存在`));
|
|
2206
2212
|
return (...l) => a[o](...l);
|
|
2207
2213
|
},
|
|
2208
2214
|
exec(n, o, ...a) {
|
|
2209
|
-
return
|
|
2215
|
+
return F(() => s.method(n, o)(...a));
|
|
2210
2216
|
},
|
|
2211
2217
|
toJson(n) {
|
|
2212
2218
|
return et(s.rule, n);
|
|
@@ -2232,9 +2238,9 @@ function Qr(t) {
|
|
|
2232
2238
|
if (!l)
|
|
2233
2239
|
return [];
|
|
2234
2240
|
const u = [];
|
|
2235
|
-
return ((
|
|
2236
|
-
|
|
2237
|
-
typeof
|
|
2241
|
+
return ((m) => {
|
|
2242
|
+
m && m.forEach((p) => {
|
|
2243
|
+
typeof p == "object" && (p.field && u.push(p), u.push(...s.getChildrenRuleList(p)));
|
|
2238
2244
|
});
|
|
2239
2245
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2240
2246
|
},
|
|
@@ -2256,14 +2262,14 @@ function Qr(t) {
|
|
|
2256
2262
|
const l = s.getChildrenRuleList(n);
|
|
2257
2263
|
t.deferSyncValue(() => {
|
|
2258
2264
|
l.forEach((u) => {
|
|
2259
|
-
|
|
2265
|
+
k(o, u.field) ? u.value = o[u.field] : a && (u.value = void 0);
|
|
2260
2266
|
});
|
|
2261
2267
|
});
|
|
2262
2268
|
},
|
|
2263
2269
|
getGlobalEvent(n) {
|
|
2264
2270
|
let o = s.options.globalEvent[n];
|
|
2265
2271
|
if (o)
|
|
2266
|
-
return typeof o == "object" && (o = o.handle),
|
|
2272
|
+
return typeof o == "object" && (o = o.handle), W(o);
|
|
2267
2273
|
},
|
|
2268
2274
|
getGlobalData(n) {
|
|
2269
2275
|
return new Promise((o, a) => {
|
|
@@ -2277,7 +2283,7 @@ function Qr(t) {
|
|
|
2277
2283
|
t.bus.$once("next-tick", n), t.refresh();
|
|
2278
2284
|
},
|
|
2279
2285
|
nextRefresh(n) {
|
|
2280
|
-
t.nextRefresh(), n &&
|
|
2286
|
+
t.nextRefresh(), n && F(n);
|
|
2281
2287
|
},
|
|
2282
2288
|
emit(n, ...o) {
|
|
2283
2289
|
t.vm.$emit(n, ...o);
|
|
@@ -2288,20 +2294,20 @@ function Qr(t) {
|
|
|
2288
2294
|
bus: t.bus,
|
|
2289
2295
|
fetch(n) {
|
|
2290
2296
|
return new Promise((o, a) => {
|
|
2291
|
-
n = J(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() =>
|
|
2292
|
-
|
|
2297
|
+
n = J(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
2298
|
+
F(() => n.onSuccess && n.onSuccess(l)), o(l);
|
|
2293
2299
|
}).catch((l) => {
|
|
2294
|
-
|
|
2300
|
+
F(() => n.onError && n.onError(l)), a(l);
|
|
2295
2301
|
}));
|
|
2296
2302
|
});
|
|
2297
2303
|
},
|
|
2298
2304
|
watchFetch(n, o, a, l) {
|
|
2299
2305
|
return t.fc.watchLoadData((u, f) => {
|
|
2300
|
-
let
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
}).catch((
|
|
2304
|
-
|
|
2306
|
+
let m = J(n);
|
|
2307
|
+
m = t.loadFetchVar(m, u), !(l && l(m, f) === !1) && t.beforeFetch(m).then(() => gt(m, t.fc.create.fetch, s).then((p) => {
|
|
2308
|
+
F(() => m.onSuccess && m.onSuccess(p)), o && o(p, f);
|
|
2309
|
+
}).catch((p) => {
|
|
2310
|
+
F(() => m.onError && m.onError(p)), a && a(p);
|
|
2305
2311
|
}));
|
|
2306
2312
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2307
2313
|
},
|
|
@@ -2363,13 +2369,13 @@ function Zr(t) {
|
|
|
2363
2369
|
}
|
|
2364
2370
|
});
|
|
2365
2371
|
}
|
|
2366
|
-
function
|
|
2372
|
+
function G(t) {
|
|
2367
2373
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2368
2374
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2369
2375
|
});
|
|
2370
|
-
return
|
|
2376
|
+
return qt(e);
|
|
2371
2377
|
}
|
|
2372
|
-
function
|
|
2378
|
+
function qt(t) {
|
|
2373
2379
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2374
2380
|
}
|
|
2375
2381
|
function Yr(t) {
|
|
@@ -2403,8 +2409,8 @@ function Yr(t) {
|
|
|
2403
2409
|
mergeGlobal(e) {
|
|
2404
2410
|
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] = ce(() => {
|
|
2405
2411
|
const i = this.$handle.options.global;
|
|
2406
|
-
return
|
|
2407
|
-
})), e.prop =
|
|
2412
|
+
return Q({}, [i["*"] || i.default || {}, i[e.originType] || i[e.type] || i[e.type] || {}]);
|
|
2413
|
+
})), e.prop = Q({}, [this.cacheConfig[e.trueType].value, e.prop]));
|
|
2408
2414
|
},
|
|
2409
2415
|
setOptions(e) {
|
|
2410
2416
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
@@ -2417,7 +2423,7 @@ function Yr(t) {
|
|
|
2417
2423
|
});
|
|
2418
2424
|
},
|
|
2419
2425
|
parseSide(e, r) {
|
|
2420
|
-
return h.Object(e) ?
|
|
2426
|
+
return h.Object(e) ? Q({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2421
2427
|
},
|
|
2422
2428
|
renderSides(e, r, i) {
|
|
2423
2429
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2451,13 +2457,21 @@ function Yr(t) {
|
|
|
2451
2457
|
model: n.model || {},
|
|
2452
2458
|
slotValue: l
|
|
2453
2459
|
};
|
|
2454
|
-
l.length && i.slotUpdate &&
|
|
2455
|
-
let f =
|
|
2456
|
-
const
|
|
2457
|
-
e.parser.renderChildren ? f = e.parser.renderChildren(
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2460
|
+
l.length && i.slotUpdate && F(() => i.slotUpdate(u));
|
|
2461
|
+
let f = [];
|
|
2462
|
+
const m = e.loadChildrenPending();
|
|
2463
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(m, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(m, e)), Object.keys(n.renderSlots || {}).forEach((v) => {
|
|
2464
|
+
f.push(this.renderRule({
|
|
2465
|
+
type: "template",
|
|
2466
|
+
slot: v
|
|
2467
|
+
}, (() => {
|
|
2468
|
+
const w = this.parseSide(n.renderSlots[v], e);
|
|
2469
|
+
return this.renderRule(w);
|
|
2470
|
+
})()));
|
|
2471
|
+
});
|
|
2472
|
+
const p = this.getTypeSlot(e);
|
|
2473
|
+
let y;
|
|
2474
|
+
return p ? (u.children = f, y = p(u)) : y = a ? e.parser.preview(Je(f), e) : e.parser.render(Je(f), e), y = this.renderSides(y, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), y = this.$manager.makeWrap(e, y)), e.none && (Array.isArray(y) ? y = y.map((v) => !v || !v.tag ? v : this.none(v)) : y = this.none(y)), o && this.setCache(e, () => this.stable(y), r), y;
|
|
2461
2475
|
}, this.setCache(e, s, r);
|
|
2462
2476
|
}
|
|
2463
2477
|
return (...s) => {
|
|
@@ -2514,6 +2528,7 @@ function Yr(t) {
|
|
|
2514
2528
|
field: e.field,
|
|
2515
2529
|
rule: e.rule,
|
|
2516
2530
|
input: e.input,
|
|
2531
|
+
t: (...s) => this.$handle.api.t(...s),
|
|
2517
2532
|
updateValue: (s) => {
|
|
2518
2533
|
this.$handle.onUpdateValue(e, s);
|
|
2519
2534
|
}
|
|
@@ -2560,7 +2575,7 @@ function Yr(t) {
|
|
|
2560
2575
|
on: {
|
|
2561
2576
|
[e.prop.modelEmit]: () => this.onEmitInput(e)
|
|
2562
2577
|
}
|
|
2563
|
-
})),
|
|
2578
|
+
})), X(n, e.prop), e.prop;
|
|
2564
2579
|
},
|
|
2565
2580
|
onMounted(e) {
|
|
2566
2581
|
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");
|
|
@@ -2586,7 +2601,7 @@ function Yr(t) {
|
|
|
2586
2601
|
}) : n);
|
|
2587
2602
|
if (n.__fc__)
|
|
2588
2603
|
return this.renderSlot(s, n.__fc__, r);
|
|
2589
|
-
n.type &&
|
|
2604
|
+
n.type && P(() => {
|
|
2590
2605
|
this.$handle.loadChildren(e, r), this.$handle.refresh();
|
|
2591
2606
|
});
|
|
2592
2607
|
}
|
|
@@ -2594,7 +2609,7 @@ function Yr(t) {
|
|
|
2594
2609
|
},
|
|
2595
2610
|
defaultRender(e, r) {
|
|
2596
2611
|
const i = e.prop;
|
|
2597
|
-
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(
|
|
2612
|
+
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(qt(i.type), i, r);
|
|
2598
2613
|
},
|
|
2599
2614
|
renderRule(e, r, i) {
|
|
2600
2615
|
if (!e) return;
|
|
@@ -2603,9 +2618,9 @@ function Yr(t) {
|
|
|
2603
2618
|
if (i)
|
|
2604
2619
|
s = e.type;
|
|
2605
2620
|
else if (s = e.is, e.type) {
|
|
2606
|
-
s =
|
|
2621
|
+
s = G(e.type);
|
|
2607
2622
|
const a = this.vNode.aliasMap[s];
|
|
2608
|
-
a && (s =
|
|
2623
|
+
a && (s = G(a));
|
|
2609
2624
|
}
|
|
2610
2625
|
if (!s) return;
|
|
2611
2626
|
const n = Le();
|
|
@@ -2626,7 +2641,7 @@ function rt(t) {
|
|
|
2626
2641
|
$manager: t.$manager,
|
|
2627
2642
|
vNode: new t.fc.CreateNode(t.vm),
|
|
2628
2643
|
id: xr++
|
|
2629
|
-
}),
|
|
2644
|
+
}), Lt(this, {
|
|
2630
2645
|
options() {
|
|
2631
2646
|
return t.options;
|
|
2632
2647
|
},
|
|
@@ -2655,7 +2670,7 @@ function ei(t) {
|
|
|
2655
2670
|
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2656
2671
|
return this.parseEventLst(e, r, i, !0);
|
|
2657
2672
|
if (h.String(r)) {
|
|
2658
|
-
const n =
|
|
2673
|
+
const n = W(r);
|
|
2659
2674
|
if (n && r !== n)
|
|
2660
2675
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2661
2676
|
}
|
|
@@ -2664,16 +2679,16 @@ function ei(t) {
|
|
|
2664
2679
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2665
2680
|
return h.trueArray(u) && u.forEach((f) => {
|
|
2666
2681
|
if (!f) return;
|
|
2667
|
-
let
|
|
2668
|
-
if (h.Object(f) && (
|
|
2669
|
-
r || (
|
|
2670
|
-
const
|
|
2671
|
-
this.vm.$emit(
|
|
2682
|
+
let m, p = n || o || a;
|
|
2683
|
+
if (h.Object(f) && (m = f.inject, f = f.name, p = f.prefix || p), p) {
|
|
2684
|
+
r || (p = `native-${p}`);
|
|
2685
|
+
const y = ge(`${p}-${f}`), v = (...w) => {
|
|
2686
|
+
this.vm.$emit(y, ...w), this.vm.$emit("emit-event", y, ...w), this.bus.$emit(y, ...w);
|
|
2672
2687
|
};
|
|
2673
|
-
if (v.__emit = !0, !
|
|
2688
|
+
if (v.__emit = !0, !m && l === !1)
|
|
2674
2689
|
i[f] = v;
|
|
2675
2690
|
else {
|
|
2676
|
-
let w =
|
|
2691
|
+
let w = m || l || this.options.injectEvent;
|
|
2677
2692
|
i[f] = h.Undef(w) ? v : this.inject(s, v, w);
|
|
2678
2693
|
}
|
|
2679
2694
|
}
|
|
@@ -2719,23 +2734,18 @@ function ei(t) {
|
|
|
2719
2734
|
},
|
|
2720
2735
|
loadFetchVar(e, r) {
|
|
2721
2736
|
const i = (s) => this.loadStrVar(s, r);
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
s
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
Object.keys(e.data).forEach((n) => {
|
|
2731
|
-
s[i(n)] = i(e.data[n]);
|
|
2732
|
-
}), e.data = s;
|
|
2733
|
-
}
|
|
2734
|
-
return e;
|
|
2737
|
+
return e.action = i(e.action || ""), ["headers", "data", "query"].forEach((s) => {
|
|
2738
|
+
if (e[s]) {
|
|
2739
|
+
const n = {};
|
|
2740
|
+
Object.keys(e[s]).forEach((o) => {
|
|
2741
|
+
n[i(o)] = i(e[s][o]);
|
|
2742
|
+
}), e[s] = n;
|
|
2743
|
+
}
|
|
2744
|
+
}), e;
|
|
2735
2745
|
}
|
|
2736
2746
|
});
|
|
2737
2747
|
}
|
|
2738
|
-
const
|
|
2748
|
+
const yt = ["hook:updated", "hook:mounted"];
|
|
2739
2749
|
function ti(t) {
|
|
2740
2750
|
_(t.prototype, {
|
|
2741
2751
|
usePage() {
|
|
@@ -2750,9 +2760,9 @@ function ti(t) {
|
|
|
2750
2760
|
},
|
|
2751
2761
|
pageLoad() {
|
|
2752
2762
|
const e = () => {
|
|
2753
|
-
this.pageEnd ? (this.vm.$off(
|
|
2763
|
+
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());
|
|
2754
2764
|
};
|
|
2755
|
-
this.vm.$on(
|
|
2765
|
+
this.vm.$on(yt, e);
|
|
2756
2766
|
}
|
|
2757
2767
|
});
|
|
2758
2768
|
}
|
|
@@ -2781,8 +2791,8 @@ function ni(t) {
|
|
|
2781
2791
|
__fc__: Ke(fe(t), !0)
|
|
2782
2792
|
});
|
|
2783
2793
|
}
|
|
2784
|
-
function
|
|
2785
|
-
const i =
|
|
2794
|
+
function Gt(t, e, r) {
|
|
2795
|
+
const i = je(), s = !!e.field;
|
|
2786
2796
|
_(this, {
|
|
2787
2797
|
id: i,
|
|
2788
2798
|
ref: i,
|
|
@@ -2811,7 +2821,7 @@ function qt(t, e, r) {
|
|
|
2811
2821
|
field: e.field || void 0
|
|
2812
2822
|
}), this.updateKey(), ni(this), this.update(t, !0);
|
|
2813
2823
|
}
|
|
2814
|
-
_(
|
|
2824
|
+
_(Gt.prototype, {
|
|
2815
2825
|
getParentGroup() {
|
|
2816
2826
|
let t = this.parent;
|
|
2817
2827
|
for (; t; ) {
|
|
@@ -2844,12 +2854,12 @@ _(qt.prototype, {
|
|
|
2844
2854
|
delete this.pending[e];
|
|
2845
2855
|
let a = r;
|
|
2846
2856
|
if (h.Function(r)) {
|
|
2847
|
-
let l =
|
|
2857
|
+
let l = F(() => r({
|
|
2848
2858
|
rule: this.rule,
|
|
2849
2859
|
api: this.$api,
|
|
2850
2860
|
update: (u) => {
|
|
2851
|
-
const f = u || i,
|
|
2852
|
-
this.setPending(e, r, f), o && o(f,
|
|
2861
|
+
const f = u || i, m = this.getPending(e, i);
|
|
2862
|
+
this.setPending(e, r, f), o && o(f, m);
|
|
2853
2863
|
},
|
|
2854
2864
|
reload: () => {
|
|
2855
2865
|
const u = this.getPending(e, i);
|
|
@@ -2881,17 +2891,18 @@ _(qt.prototype, {
|
|
|
2881
2891
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2882
2892
|
},
|
|
2883
2893
|
updateKey(t) {
|
|
2884
|
-
this.key =
|
|
2894
|
+
this.key = je(), t && this.parent && this.parent.updateKey(t);
|
|
2885
2895
|
},
|
|
2886
2896
|
updateType() {
|
|
2887
|
-
this.originType = this.rule.type, this.type =
|
|
2897
|
+
this.originType = this.rule.type, this.type = G(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
2888
2898
|
},
|
|
2889
2899
|
setParser(t) {
|
|
2890
2900
|
this.parser = t, t.init(this);
|
|
2891
2901
|
},
|
|
2892
2902
|
initProp() {
|
|
2903
|
+
var e, r;
|
|
2893
2904
|
const t = b({}, this.rule);
|
|
2894
|
-
delete t.children, delete t.validate, this.prop =
|
|
2905
|
+
delete t.children, delete t.validate, this.prop = Q({}, [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 || []];
|
|
2895
2906
|
},
|
|
2896
2907
|
initNone() {
|
|
2897
2908
|
this.none = !(h.Undef(this.prop.display) || this.prop.display);
|
|
@@ -2961,17 +2972,17 @@ function si(t) {
|
|
|
2961
2972
|
_(t.prototype, {
|
|
2962
2973
|
nextRefresh(e) {
|
|
2963
2974
|
const r = this.loadedId;
|
|
2964
|
-
|
|
2975
|
+
P(() => {
|
|
2965
2976
|
r === this.loadedId && (e ? e() : this.refresh());
|
|
2966
2977
|
});
|
|
2967
2978
|
},
|
|
2968
2979
|
parseRule(e) {
|
|
2969
|
-
const r =
|
|
2980
|
+
const r = ct(e);
|
|
2970
2981
|
return Object.defineProperties(r, {
|
|
2971
2982
|
__origin__: Ke(e, !0)
|
|
2972
2983
|
}), oi(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
2973
2984
|
i && this.loadFn(i, r);
|
|
2974
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
2985
|
+
}), this.loadCtrl(r), r.update && (r.update = W(r.update)), r;
|
|
2975
2986
|
},
|
|
2976
2987
|
loadFn(e, r) {
|
|
2977
2988
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -2980,12 +2991,12 @@ function si(t) {
|
|
|
2980
2991
|
},
|
|
2981
2992
|
loadCtrl(e) {
|
|
2982
2993
|
e.control && e.control.forEach((r) => {
|
|
2983
|
-
r.handle && (r.handle =
|
|
2994
|
+
r.handle && (r.handle = W(r.handle));
|
|
2984
2995
|
});
|
|
2985
2996
|
},
|
|
2986
2997
|
syncProp(e) {
|
|
2987
2998
|
const r = e.rule;
|
|
2988
|
-
h.trueArray(r.sync) &&
|
|
2999
|
+
h.trueArray(r.sync) && X([{
|
|
2989
3000
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
2990
3001
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
2991
3002
|
}, i), {})
|
|
@@ -3016,28 +3027,28 @@ function si(t) {
|
|
|
3016
3027
|
if (r && !h.Object(o) || !this.pageEnd && !r && a >= this.first) return;
|
|
3017
3028
|
if (o.__fc__ && o.__fc__.root === e && this.ctxs[o.__fc__.id])
|
|
3018
3029
|
return s(o.__fc__.loadChildrenPending(), o.__fc__), o.__fc__;
|
|
3019
|
-
let l =
|
|
3030
|
+
let l = ct(o);
|
|
3020
3031
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3021
3032
|
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);
|
|
3022
|
-
let f,
|
|
3023
|
-
if (
|
|
3024
|
-
if (f = o.__fc__,
|
|
3025
|
-
if (
|
|
3033
|
+
let f, m = !1, p = !!o.__fc__, y = l.value;
|
|
3034
|
+
if (p) {
|
|
3035
|
+
if (f = o.__fc__, y = f.defaultValue, f.deleted) {
|
|
3036
|
+
if ($t(f))
|
|
3026
3037
|
return;
|
|
3027
3038
|
f.update(this);
|
|
3028
3039
|
} else if (!f.check(this)) {
|
|
3029
|
-
if (
|
|
3040
|
+
if ($t(f))
|
|
3030
3041
|
return;
|
|
3031
|
-
e[a] = o = o._clone ? o._clone() :
|
|
3042
|
+
e[a] = o = o._clone ? o._clone() : Vt(et(o)), f = null, m = !0;
|
|
3032
3043
|
}
|
|
3033
3044
|
}
|
|
3034
3045
|
if (f)
|
|
3035
3046
|
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3036
3047
|
else {
|
|
3037
3048
|
const j = this.parseRule(o);
|
|
3038
|
-
f = new
|
|
3049
|
+
f = new Gt(this, j, y), this.bindParser(f);
|
|
3039
3050
|
}
|
|
3040
|
-
[!1, !0].forEach((j) => this.parseEmit(f, j)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !
|
|
3051
|
+
[!1, !0].forEach((j) => this.parseEmit(f, j)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !m && !p && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
|
|
3041
3052
|
const v = f.loadChildrenPending();
|
|
3042
3053
|
if (f.parser.loadChildren === !1 || s(v, f), !r) {
|
|
3043
3054
|
const j = i(a);
|
|
@@ -3057,12 +3068,12 @@ function si(t) {
|
|
|
3057
3068
|
const r = ai(e), i = [], s = this.api;
|
|
3058
3069
|
if (!r.length) return !1;
|
|
3059
3070
|
for (let a = 0; a < r.length; a++) {
|
|
3060
|
-
const l = r[a], u = l.handle || function(
|
|
3061
|
-
return (ae[l.condition || "=="] || ae["=="])(
|
|
3071
|
+
const l = r[a], u = l.handle || function(m) {
|
|
3072
|
+
return (ae[l.condition || "=="] || ae["=="])(m, l.value);
|
|
3062
3073
|
};
|
|
3063
3074
|
if (!h.trueArray(l.rule)) continue;
|
|
3064
|
-
const f =
|
|
3065
|
-
valid:
|
|
3075
|
+
const f = q(b({}, l), {
|
|
3076
|
+
valid: F(() => u(e.rule.value, s)),
|
|
3066
3077
|
ctrl: li(e, l.rule),
|
|
3067
3078
|
isHidden: h.String(l.rule[0])
|
|
3068
3079
|
});
|
|
@@ -3072,13 +3083,13 @@ function si(t) {
|
|
|
3072
3083
|
const n = [];
|
|
3073
3084
|
let o = !1;
|
|
3074
3085
|
return this.deferSyncValue(() => {
|
|
3075
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append:
|
|
3086
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: m, child: p, ctrl: y, method: v }) => {
|
|
3076
3087
|
if (a) {
|
|
3077
3088
|
l ? e.ctrlRule.push({
|
|
3078
3089
|
__ctrl: !0,
|
|
3079
3090
|
children: u,
|
|
3080
3091
|
valid: l
|
|
3081
|
-
}) :
|
|
3092
|
+
}) : y && e.ctrlRule.splice(e.ctrlRule.indexOf(y) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3082
3093
|
v === "disabled" || v === "enabled" ? this.api.disabled(!l, u) : v === "display" ? this.api.display(l, u) : v === "required" ? (u.forEach((w) => {
|
|
3083
3094
|
this.api.setEffect(w, "required", l);
|
|
3084
3095
|
}), l || this.api.clearValidateState(u)) : this.api.hidden(!l, u);
|
|
@@ -3094,17 +3105,17 @@ function si(t) {
|
|
|
3094
3105
|
children: u
|
|
3095
3106
|
};
|
|
3096
3107
|
e.ctrlRule.push(w), this.bus.$once("load-start", () => {
|
|
3097
|
-
f ? s.prepend(w, f,
|
|
3108
|
+
f ? s.prepend(w, f, p) : m || p ? s.append(w, m || e.id, p) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, w);
|
|
3098
3109
|
});
|
|
3099
3110
|
} else {
|
|
3100
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3101
|
-
const w = oe(
|
|
3111
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(y), 1);
|
|
3112
|
+
const w = oe(y);
|
|
3102
3113
|
w && w.rm();
|
|
3103
3114
|
}
|
|
3104
3115
|
});
|
|
3105
3116
|
}), n.length && (this.loading ? n.length && this.bus.$once("load-end", () => {
|
|
3106
3117
|
n.forEach((a) => a());
|
|
3107
|
-
}) : n.length &&
|
|
3118
|
+
}) : n.length && P(() => {
|
|
3108
3119
|
n.forEach((a) => a());
|
|
3109
3120
|
})), this.vm.$emit("control", e.origin, this.api), this.effect(e, "control"), o;
|
|
3110
3121
|
},
|
|
@@ -3127,9 +3138,9 @@ function si(t) {
|
|
|
3127
3138
|
});
|
|
3128
3139
|
}
|
|
3129
3140
|
function oi(t) {
|
|
3130
|
-
const e =
|
|
3141
|
+
const e = Tt();
|
|
3131
3142
|
return Object.keys(e).forEach((r) => {
|
|
3132
|
-
|
|
3143
|
+
k(t, r) || S(t, r, e[r]);
|
|
3133
3144
|
}), t;
|
|
3134
3145
|
}
|
|
3135
3146
|
function ai(t) {
|
|
@@ -3143,7 +3154,7 @@ function li(t, e) {
|
|
|
3143
3154
|
return i;
|
|
3144
3155
|
}
|
|
3145
3156
|
}
|
|
3146
|
-
function
|
|
3157
|
+
function $t(t) {
|
|
3147
3158
|
return !!t.rule.__ctrl;
|
|
3148
3159
|
}
|
|
3149
3160
|
function ui(t) {
|
|
@@ -3153,6 +3164,12 @@ function ui(t) {
|
|
|
3153
3164
|
rule: e.origin,
|
|
3154
3165
|
api: this.api,
|
|
3155
3166
|
setFlag: s || !1
|
|
3167
|
+
}), s && P(() => {
|
|
3168
|
+
P(() => {
|
|
3169
|
+
P(() => {
|
|
3170
|
+
this.api.clearValidateState(e.id);
|
|
3171
|
+
});
|
|
3172
|
+
});
|
|
3156
3173
|
}));
|
|
3157
3174
|
},
|
|
3158
3175
|
onInput(e, r) {
|
|
@@ -3163,7 +3180,7 @@ function ui(t) {
|
|
|
3163
3180
|
this.deferSyncValue(() => {
|
|
3164
3181
|
const i = e.getParentGroup(), s = i ? this.subRuleData[i.id] : null, n = {};
|
|
3165
3182
|
Object.keys(r || {}).forEach((o) => {
|
|
3166
|
-
s &&
|
|
3183
|
+
s && k(s, o) ? n[o] = r[o] : k(this.api.form, o) ? this.api.form[o] = r[o] : this.api.top !== this.api && k(this.api.top.form, o) && (this.api.top.form[o] = r[o]);
|
|
3167
3184
|
}), Object.keys(n).length && this.api.setChildrenFormData(i.rule, n);
|
|
3168
3185
|
});
|
|
3169
3186
|
},
|
|
@@ -3173,7 +3190,7 @@ function ui(t) {
|
|
|
3173
3190
|
setFormData(e, r) {
|
|
3174
3191
|
e.modelValue = r;
|
|
3175
3192
|
const i = e.getParentGroup();
|
|
3176
|
-
i && (this.subRuleData[i.id] ||
|
|
3193
|
+
i && (this.subRuleData[i.id] || S(this.subRuleData, i.id, {}), S(this.subRuleData[i.id], e.field, e.rule.value)), S(this.formData, e.id, r);
|
|
3177
3194
|
},
|
|
3178
3195
|
rmSubRuleData(e) {
|
|
3179
3196
|
const r = e.getParentGroup();
|
|
@@ -3193,13 +3210,13 @@ function ui(t) {
|
|
|
3193
3210
|
return e.ignore === !0 || e.ignore === "hidden" && e.hidden || this.options.ignoreHiddenFields && e.hidden;
|
|
3194
3211
|
},
|
|
3195
3212
|
appendValue(e) {
|
|
3196
|
-
(!e.field || !
|
|
3213
|
+
(!e.field || !k(this.appendData, e.field)) && !this.options.forceCoverValue || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
3197
3214
|
},
|
|
3198
3215
|
addSubForm(e, r) {
|
|
3199
3216
|
this.subForm[e.id] = r;
|
|
3200
3217
|
},
|
|
3201
3218
|
deferSyncValue(e, r) {
|
|
3202
|
-
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r),
|
|
3219
|
+
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r), F(e), this.deferSyncFn === e && (this.deferSyncFn = null, e.sync && this.syncForm());
|
|
3203
3220
|
},
|
|
3204
3221
|
syncValue() {
|
|
3205
3222
|
if (this.deferSyncFn)
|
|
@@ -3210,14 +3227,14 @@ function ui(t) {
|
|
|
3210
3227
|
}), this.vm.updateValue(e);
|
|
3211
3228
|
},
|
|
3212
3229
|
isChange(e, r) {
|
|
3213
|
-
return JSON.stringify(this.getFormData(e),
|
|
3230
|
+
return JSON.stringify(this.getFormData(e), vt) !== JSON.stringify(r, vt);
|
|
3214
3231
|
},
|
|
3215
3232
|
isQuote(e, r) {
|
|
3216
3233
|
return (h.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
3217
3234
|
},
|
|
3218
3235
|
refreshUpdate(e, r, i, s) {
|
|
3219
3236
|
if (h.Function(e.rule.update)) {
|
|
3220
|
-
const n =
|
|
3237
|
+
const n = F(() => e.rule.update(r, e.origin, this.api, {
|
|
3221
3238
|
origin: i || "change",
|
|
3222
3239
|
linkField: s
|
|
3223
3240
|
}));
|
|
@@ -3243,10 +3260,10 @@ function ui(t) {
|
|
|
3243
3260
|
}
|
|
3244
3261
|
});
|
|
3245
3262
|
}
|
|
3246
|
-
function
|
|
3263
|
+
function vt(t, e) {
|
|
3247
3264
|
return typeof e == "function" ? "" + e : e;
|
|
3248
3265
|
}
|
|
3249
|
-
const
|
|
3266
|
+
const ke = {
|
|
3250
3267
|
init(t) {
|
|
3251
3268
|
},
|
|
3252
3269
|
toFormValue(t, e) {
|
|
@@ -3297,35 +3314,35 @@ function ci(t) {
|
|
|
3297
3314
|
getParser(e) {
|
|
3298
3315
|
const r = this.fc.parsers, i = this.fc.renderDriver;
|
|
3299
3316
|
if (i) {
|
|
3300
|
-
const s = i.parsers || {}, n = s[e.originType] || s[
|
|
3317
|
+
const s = i.parsers || {}, n = s[e.originType] || s[G(e.type)] || s[e.trueType];
|
|
3301
3318
|
if (n)
|
|
3302
3319
|
return n;
|
|
3303
3320
|
}
|
|
3304
|
-
return r[e.originType] || r[
|
|
3321
|
+
return r[e.originType] || r[G(e.type)] || r[e.trueType] || ke;
|
|
3305
3322
|
},
|
|
3306
3323
|
bindParser(e) {
|
|
3307
3324
|
e.setParser(this.getParser(e));
|
|
3308
3325
|
},
|
|
3309
3326
|
getType(e) {
|
|
3310
|
-
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[
|
|
3311
|
-
return
|
|
3327
|
+
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[G(e)] || e;
|
|
3328
|
+
return G(i);
|
|
3312
3329
|
},
|
|
3313
3330
|
noWatch(e) {
|
|
3314
|
-
this.noWatchFn || (this.noWatchFn = e),
|
|
3331
|
+
this.noWatchFn || (this.noWatchFn = e), F(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
3315
3332
|
},
|
|
3316
3333
|
watchCtx(e) {
|
|
3317
|
-
if (
|
|
3334
|
+
if (It().filter((i) => i[0] !== "_" && i[0] !== "$" && fi.indexOf(i) === -1).forEach((i) => {
|
|
3318
3335
|
const s = Re(e.rule, i), n = i === "children";
|
|
3319
|
-
e.refRule[i] = s, e.watch.push(
|
|
3336
|
+
e.refRule[i] = s, e.watch.push(L(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3320
3337
|
let l = s.value;
|
|
3321
3338
|
if (!this.isBreakWatch()) {
|
|
3322
3339
|
if (n && e.parser.loadChildren === !1) {
|
|
3323
3340
|
this.$render.clearCache(e), this.nextRefresh();
|
|
3324
3341
|
return;
|
|
3325
3342
|
}
|
|
3326
|
-
if (this.watching = !0,
|
|
3343
|
+
if (this.watching = !0, P(() => {
|
|
3327
3344
|
this.targetHook(e, "watch", { key: i, oldValue: a, newValue: l });
|
|
3328
|
-
}), i === "hidden" && !!l != !!a && (this.$render.clearCacheAll(),
|
|
3345
|
+
}), i === "hidden" && !!l != !!a && (this.$render.clearCacheAll(), P(() => {
|
|
3329
3346
|
this.targetHook(e, "hidden", { value: l });
|
|
3330
3347
|
})), i === "ignore" && e.input || i === "hidden" && e.input && (e.rule.ignore === "hidden" || this.options.ignoreHiddenFields))
|
|
3331
3348
|
this.syncForm();
|
|
@@ -3350,7 +3367,7 @@ function ci(t) {
|
|
|
3350
3367
|
s && (i = this.api.t(s[1]));
|
|
3351
3368
|
}
|
|
3352
3369
|
return i;
|
|
3353
|
-
}), e.refRule.__$validate = ce(() =>
|
|
3370
|
+
}), e.refRule.__$validate = ce(() => H(e.rule.validate).map((i) => {
|
|
3354
3371
|
const s = b({}, i);
|
|
3355
3372
|
if (s.message) {
|
|
3356
3373
|
const n = s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
@@ -3371,7 +3388,7 @@ function ci(t) {
|
|
|
3371
3388
|
return s;
|
|
3372
3389
|
})), e.input) {
|
|
3373
3390
|
const i = Re(e.rule, "value");
|
|
3374
|
-
e.watch.push(
|
|
3391
|
+
e.watch.push(L(() => i.value, () => {
|
|
3375
3392
|
let s = e.parser.toFormValue(i.value, e);
|
|
3376
3393
|
this.isChange(e, s) && this.setValue(e, i.value, s, !0);
|
|
3377
3394
|
}));
|
|
@@ -3388,7 +3405,7 @@ function ci(t) {
|
|
|
3388
3405
|
}), a = (l) => {
|
|
3389
3406
|
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) : ee(e.rule, s, l);
|
|
3390
3407
|
};
|
|
3391
|
-
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !==
|
|
3408
|
+
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !== U(e.rule, s)) && a(o.value), e.watch.push(L(o, (l) => {
|
|
3392
3409
|
n = l, setTimeout(() => {
|
|
3393
3410
|
a(l);
|
|
3394
3411
|
});
|
|
@@ -3405,30 +3422,30 @@ function ci(t) {
|
|
|
3405
3422
|
const l = a.mode === "OR";
|
|
3406
3423
|
let u = !0;
|
|
3407
3424
|
for (let f = 0; f < a.group.length; f++) {
|
|
3408
|
-
const
|
|
3409
|
-
let
|
|
3410
|
-
if (
|
|
3411
|
-
|
|
3412
|
-
else if (
|
|
3413
|
-
|
|
3425
|
+
const m = a.group[f];
|
|
3426
|
+
let p, y = null;
|
|
3427
|
+
if (m.variable)
|
|
3428
|
+
y = JSON.stringify(this.fc.getLoadData(m.variable) || "");
|
|
3429
|
+
else if (m.field)
|
|
3430
|
+
y = dt(m.field || "");
|
|
3414
3431
|
else
|
|
3415
3432
|
return !0;
|
|
3416
|
-
let v =
|
|
3417
|
-
if (v && (v =
|
|
3433
|
+
let v = m.compare;
|
|
3434
|
+
if (v && (v = dt(v || "")), m.mode ? p = n(m) : ae[m.condition] ? h.Function(m.handler) ? p = F(() => m.handler(this.api, e.rule)) : p = new Function("$condition", "$val", "$form", "$group", "$rule", `with($form){with(this){with($group){ return $condition['${m.condition}'](${y}, ${v || "$val"}); }}}`).call(this.api.form, ae, m.value, this.api.top.form, s ? this.subRuleData[s.id] || {} : {}, e.rule) : p = !1, l && p)
|
|
3418
3435
|
return !0;
|
|
3419
|
-
l || (u = u &&
|
|
3436
|
+
l || (u = u && p);
|
|
3420
3437
|
}
|
|
3421
3438
|
return l ? !1 : u;
|
|
3422
3439
|
};
|
|
3423
3440
|
let o = n(r);
|
|
3424
|
-
return o = r.invert === !0 ? !o : o, r.linkage ? o ?
|
|
3441
|
+
return o = r.invert === !0 ? !o : o, r.linkage ? o ? F(() => this.computeValue(r.linkage, e, s), void 0) : void 0 : o;
|
|
3425
3442
|
} else if (h.Function(r))
|
|
3426
3443
|
i = () => r(this.api.form, this.api);
|
|
3427
3444
|
else {
|
|
3428
3445
|
const s = e.getParentGroup();
|
|
3429
3446
|
i = () => this.computeValue(r, e, s);
|
|
3430
3447
|
}
|
|
3431
|
-
return
|
|
3448
|
+
return F(i, void 0);
|
|
3432
3449
|
},
|
|
3433
3450
|
computeValue(e, r, i) {
|
|
3434
3451
|
const s = this, n = Object.keys(this.fc.formulas).reduce((o, a) => (o[a] = function(...l) {
|
|
@@ -3458,7 +3475,7 @@ function ci(t) {
|
|
|
3458
3475
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3459
3476
|
Y(this.ctxs, r), Y(this.formData, r), Y(this.subForm, r), Y(this.vm.ctxInject, r);
|
|
3460
3477
|
const o = e.getParentGroup();
|
|
3461
|
-
o && this.subRuleData[o.id] && Y(this.subRuleData[o.id], i), e.group && Y(this.subRuleData, r), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !
|
|
3478
|
+
o && this.subRuleData[o.id] && Y(this.subRuleData[o.id], i), e.group && Y(this.subRuleData, r), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !k(this.fieldCtx, i) && Y(this.form, i), this.deferSyncValue(() => {
|
|
3462
3479
|
if (!this.reloading) {
|
|
3463
3480
|
if (e.parser.loadChildren !== !1) {
|
|
3464
3481
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3484,10 +3501,10 @@ function hi(t) {
|
|
|
3484
3501
|
this.fc.targetFormDriver(e, this.api, this.fc), this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3485
3502
|
},
|
|
3486
3503
|
emitEvent(e, ...r) {
|
|
3487
|
-
const i = this.options[e] || this.options[
|
|
3504
|
+
const i = this.options[e] || this.options[G("on-" + e)];
|
|
3488
3505
|
if (i) {
|
|
3489
|
-
const s =
|
|
3490
|
-
h.Function(s) &&
|
|
3506
|
+
const s = W(i);
|
|
3507
|
+
h.Function(s) && F(() => s(...r));
|
|
3491
3508
|
}
|
|
3492
3509
|
this.bus.$emit(e, ...r);
|
|
3493
3510
|
},
|
|
@@ -3495,7 +3512,7 @@ function hi(t) {
|
|
|
3495
3512
|
var n, o;
|
|
3496
3513
|
let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
|
|
3497
3514
|
s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
|
|
3498
|
-
|
|
3515
|
+
F(() => a(q(b({}, i || {}), { rule: e.rule, api: this.api })));
|
|
3499
3516
|
}));
|
|
3500
3517
|
}
|
|
3501
3518
|
});
|
|
@@ -3522,7 +3539,7 @@ function di(t) {
|
|
|
3522
3539
|
let r = {
|
|
3523
3540
|
required: () => {
|
|
3524
3541
|
var i, s;
|
|
3525
|
-
return (
|
|
3542
|
+
return (k(e.rule, "$required") ? e.rule.$required : (s = (i = e.rule) == null ? void 0 : i.effect) == null ? void 0 : s.required) || !1;
|
|
3526
3543
|
}
|
|
3527
3544
|
};
|
|
3528
3545
|
Object.keys(e.rule.effect || {}).forEach((i) => {
|
|
@@ -3530,7 +3547,7 @@ function di(t) {
|
|
|
3530
3547
|
}), Object.keys(e.rule).forEach((i) => {
|
|
3531
3548
|
i[0] === "$" && (r[i.substr(1)] = () => e.rule[i]);
|
|
3532
3549
|
}), Object.keys(r).forEach((i) => {
|
|
3533
|
-
e.watch.push(
|
|
3550
|
+
e.watch.push(L(r[i], (s) => {
|
|
3534
3551
|
this.effect(e, "watch", { [i]: s });
|
|
3535
3552
|
}, { deep: !0 }));
|
|
3536
3553
|
});
|
|
@@ -3552,9 +3569,9 @@ function di(t) {
|
|
|
3552
3569
|
}, r);
|
|
3553
3570
|
},
|
|
3554
3571
|
getEffect(e, r) {
|
|
3555
|
-
if (
|
|
3572
|
+
if (k(e, "$" + r))
|
|
3556
3573
|
return e["$" + r];
|
|
3557
|
-
if (
|
|
3574
|
+
if (k(e, "effect") && k(e.effect, r))
|
|
3558
3575
|
return e.effect[r];
|
|
3559
3576
|
},
|
|
3560
3577
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
@@ -3563,15 +3580,15 @@ function di(t) {
|
|
|
3563
3580
|
Object.keys(l).forEach((u) => {
|
|
3564
3581
|
const f = this.providers[u];
|
|
3565
3582
|
if (!f || f.input && !i) return;
|
|
3566
|
-
let
|
|
3583
|
+
let m;
|
|
3567
3584
|
if (!f._c)
|
|
3568
|
-
|
|
3585
|
+
m = "*";
|
|
3569
3586
|
else if (f._used.indexOf(s) > -1)
|
|
3570
|
-
|
|
3587
|
+
m = s;
|
|
3571
3588
|
else
|
|
3572
3589
|
return;
|
|
3573
|
-
const
|
|
3574
|
-
e && (
|
|
3590
|
+
const p = b({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3591
|
+
e && (p.getProp = () => e.effectData(u), p.clearProp = () => e.clearEffectData(u), p.mergeProp = (y) => Q(p.getProp(), [y]), p.id = e.id), this.bus.$emit(`p:${u}:${m}:${f.input ? 1 : 0}`, o, [p, r, this.api]);
|
|
3575
3592
|
});
|
|
3576
3593
|
}
|
|
3577
3594
|
});
|
|
@@ -3588,8 +3605,8 @@ function mi(t) {
|
|
|
3588
3605
|
return r.length ? r : !1;
|
|
3589
3606
|
} else return h.String(e) ? [e] : !1;
|
|
3590
3607
|
}
|
|
3591
|
-
function
|
|
3592
|
-
|
|
3608
|
+
function z(t) {
|
|
3609
|
+
Lt(this, {
|
|
3593
3610
|
options() {
|
|
3594
3611
|
return t.options.value || {};
|
|
3595
3612
|
},
|
|
@@ -3624,11 +3641,11 @@ function W(t) {
|
|
|
3624
3641
|
this.lifecycle("reload");
|
|
3625
3642
|
}
|
|
3626
3643
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3627
|
-
const i =
|
|
3644
|
+
const i = F(() => r(e, this));
|
|
3628
3645
|
return i && i !== e && _(e, i), e;
|
|
3629
3646
|
}, Qr(this));
|
|
3630
3647
|
}
|
|
3631
|
-
_(
|
|
3648
|
+
_(z.prototype, {
|
|
3632
3649
|
initData(t) {
|
|
3633
3650
|
_(this, {
|
|
3634
3651
|
ctxs: {},
|
|
@@ -3649,19 +3666,19 @@ _(W.prototype, {
|
|
|
3649
3666
|
},
|
|
3650
3667
|
beforeFetch(t) {
|
|
3651
3668
|
return new Promise((e) => {
|
|
3652
|
-
const r = this.options.beforeFetch &&
|
|
3669
|
+
const r = this.options.beforeFetch && F(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3653
3670
|
r && h.Function(r.then) ? r.then(e) : e();
|
|
3654
3671
|
});
|
|
3655
3672
|
}
|
|
3656
3673
|
});
|
|
3657
|
-
ei(
|
|
3658
|
-
ti(
|
|
3659
|
-
ii(
|
|
3660
|
-
si(
|
|
3661
|
-
ui(
|
|
3662
|
-
ci(
|
|
3663
|
-
hi(
|
|
3664
|
-
di(
|
|
3674
|
+
ei(z);
|
|
3675
|
+
ti(z);
|
|
3676
|
+
ii(z);
|
|
3677
|
+
si(z);
|
|
3678
|
+
ui(z);
|
|
3679
|
+
ci(z);
|
|
3680
|
+
hi(z);
|
|
3681
|
+
di(z);
|
|
3665
3682
|
const gi = "fcFragment", Te = {
|
|
3666
3683
|
name: gi,
|
|
3667
3684
|
functional: !0,
|
|
@@ -3687,7 +3704,14 @@ function $i() {
|
|
|
3687
3704
|
return (he.isReservedTag ? he.isReservedTag(r) : (o = (n = he) == 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);
|
|
3688
3705
|
},
|
|
3689
3706
|
makeComponent(r, i, s) {
|
|
3707
|
+
var o;
|
|
3690
3708
|
let n = this.$h(r, yi(i), s || []);
|
|
3709
|
+
if ((o = n == null ? void 0 : n.componentOptions) != null && o.propsData && (i != null && i.props)) {
|
|
3710
|
+
const a = Object.keys(n.componentOptions.propsData);
|
|
3711
|
+
n.data.attrs || (n.data.attrs = {}), Object.keys(i.props).forEach((l) => {
|
|
3712
|
+
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]);
|
|
3713
|
+
});
|
|
3714
|
+
}
|
|
3691
3715
|
return n.context = this.vm, n;
|
|
3692
3716
|
},
|
|
3693
3717
|
aliasMap: t
|
|
@@ -3709,11 +3733,11 @@ function $i() {
|
|
|
3709
3733
|
}), e;
|
|
3710
3734
|
}
|
|
3711
3735
|
function vi(t) {
|
|
3712
|
-
class e extends
|
|
3736
|
+
class e extends Ht {
|
|
3713
3737
|
}
|
|
3714
3738
|
return Object.assign(e.prototype, t), e;
|
|
3715
3739
|
}
|
|
3716
|
-
function
|
|
3740
|
+
function Ht(t) {
|
|
3717
3741
|
_(this, {
|
|
3718
3742
|
$handle: t,
|
|
3719
3743
|
vm: t.vm,
|
|
@@ -3724,12 +3748,12 @@ function Gt(t) {
|
|
|
3724
3748
|
}
|
|
3725
3749
|
}), this.updateKey(), this.init();
|
|
3726
3750
|
}
|
|
3727
|
-
_(
|
|
3751
|
+
_(Ht.prototype, {
|
|
3728
3752
|
__init() {
|
|
3729
3753
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3730
3754
|
},
|
|
3731
3755
|
updateKey() {
|
|
3732
|
-
this.key =
|
|
3756
|
+
this.key = je();
|
|
3733
3757
|
},
|
|
3734
3758
|
//TODO interface
|
|
3735
3759
|
init() {
|
|
@@ -3751,7 +3775,7 @@ _(Gt.prototype, {
|
|
|
3751
3775
|
return e(this.vm);
|
|
3752
3776
|
},
|
|
3753
3777
|
mergeOptions(t, e) {
|
|
3754
|
-
return
|
|
3778
|
+
return X(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3755
3779
|
},
|
|
3756
3780
|
updateOptions(t) {
|
|
3757
3781
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3773,18 +3797,18 @@ const bi = function(t) {
|
|
|
3773
3797
|
const e = {
|
|
3774
3798
|
name: "loadData",
|
|
3775
3799
|
_fn: [],
|
|
3776
|
-
|
|
3800
|
+
loaded(r, i, s) {
|
|
3777
3801
|
this.deleted(r);
|
|
3778
|
-
let n =
|
|
3802
|
+
let n = H(r.getValue());
|
|
3779
3803
|
const o = [];
|
|
3780
3804
|
n.forEach((a) => {
|
|
3781
3805
|
if (a && (a.attr || a.template)) {
|
|
3782
|
-
let l = (
|
|
3783
|
-
let
|
|
3784
|
-
a.template ?
|
|
3785
|
-
const
|
|
3786
|
-
a.to === "child" ?
|
|
3787
|
-
}, u = (
|
|
3806
|
+
let l = (m) => {
|
|
3807
|
+
let p;
|
|
3808
|
+
a.template ? p = t.$handle.loadStrVar(a.template, m) : a.handler && h.Function(a.handler) ? p = a.handler(m, i, s) : p = m(a.attr, a.default), a.copy !== !1 && (p = J(p));
|
|
3809
|
+
const y = a.modify ? i : r.getProp();
|
|
3810
|
+
a.to === "child" ? y.children ? S(y.children, 0, p) : S(y, "children", [p]) : ee(y, a.to || "options", p), s.sync(i);
|
|
3811
|
+
}, u = (m) => l(m);
|
|
3788
3812
|
const f = t.watchLoadData(u);
|
|
3789
3813
|
l = le(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
3790
3814
|
}
|
|
@@ -3809,13 +3833,13 @@ const bi = function(t) {
|
|
|
3809
3833
|
const l = n[a];
|
|
3810
3834
|
if (l) {
|
|
3811
3835
|
const u = typeof l == "object";
|
|
3812
|
-
let f = (
|
|
3813
|
-
let v = t.t(u ? l.attr : l, u ? l.params : null,
|
|
3836
|
+
let f = (y) => {
|
|
3837
|
+
let v = t.t(u ? l.attr : l, u ? l.params : null, y);
|
|
3814
3838
|
const w = u && l.modify ? i : r.getProp();
|
|
3815
|
-
a === "child" ? w.children ?
|
|
3816
|
-
},
|
|
3817
|
-
const
|
|
3818
|
-
f = le(f, l.wait || 300), l.watch !== !1 ? o.push(
|
|
3839
|
+
a === "child" ? w.children ? S(w.children, 0, v) : S(w, "children", [v]) : ee(w, a, v), s.sync(i);
|
|
3840
|
+
}, m = (y) => f(y);
|
|
3841
|
+
const p = t.watchLoadData(m);
|
|
3842
|
+
f = le(f, l.wait || 300), l.watch !== !1 ? o.push(p) : p();
|
|
3819
3843
|
}
|
|
3820
3844
|
}), this._fn[r.id] = o;
|
|
3821
3845
|
},
|
|
@@ -3826,7 +3850,7 @@ const bi = function(t) {
|
|
|
3826
3850
|
}
|
|
3827
3851
|
};
|
|
3828
3852
|
return e.watch = e.loaded, e;
|
|
3829
|
-
},
|
|
3853
|
+
}, Jt = {
|
|
3830
3854
|
name: "componentValidate",
|
|
3831
3855
|
load(t, e, r) {
|
|
3832
3856
|
let i = t.getValue();
|
|
@@ -3835,7 +3859,7 @@ const bi = function(t) {
|
|
|
3835
3859
|
else {
|
|
3836
3860
|
h.Object(i) || (i = { method: i });
|
|
3837
3861
|
const s = i.method;
|
|
3838
|
-
delete i.method, t.getProp().validate = [
|
|
3862
|
+
delete i.method, t.getProp().validate = [q(b({}, i), {
|
|
3839
3863
|
validator(...n) {
|
|
3840
3864
|
const o = oe(e);
|
|
3841
3865
|
if (o)
|
|
@@ -3849,7 +3873,7 @@ const bi = function(t) {
|
|
|
3849
3873
|
}
|
|
3850
3874
|
},
|
|
3851
3875
|
watch(...t) {
|
|
3852
|
-
|
|
3876
|
+
Jt.load(...t);
|
|
3853
3877
|
}
|
|
3854
3878
|
}, Ci = function(t) {
|
|
3855
3879
|
function e(s) {
|
|
@@ -3861,62 +3885,62 @@ const bi = function(t) {
|
|
|
3861
3885
|
function r(s, n, o) {
|
|
3862
3886
|
let a = s.value;
|
|
3863
3887
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
3864
|
-
const l = (
|
|
3865
|
-
|
|
3888
|
+
const l = (m) => {
|
|
3889
|
+
m === void 0 ? s.clearProp() : ee(s.getProp(), a.to || "options", m), o.sync(n);
|
|
3866
3890
|
};
|
|
3867
3891
|
if (!a || !a.action && !a.key) {
|
|
3868
3892
|
l(void 0);
|
|
3869
3893
|
return;
|
|
3870
3894
|
}
|
|
3871
3895
|
if (a = J(a), a.to || (a.to = "options"), a.key) {
|
|
3872
|
-
const
|
|
3873
|
-
if (!
|
|
3896
|
+
const m = t.$handle.options.globalData[a.key];
|
|
3897
|
+
if (!m) {
|
|
3874
3898
|
l(void 0);
|
|
3875
3899
|
return;
|
|
3876
3900
|
}
|
|
3877
|
-
if (
|
|
3878
|
-
l(
|
|
3901
|
+
if (m.type === "static") {
|
|
3902
|
+
l(m.data);
|
|
3879
3903
|
return;
|
|
3880
3904
|
} else
|
|
3881
|
-
a = b(b({}, a),
|
|
3905
|
+
a = b(b({}, a), m);
|
|
3882
3906
|
}
|
|
3883
3907
|
const u = a.onError, f = () => {
|
|
3884
3908
|
if (!s.getValue())
|
|
3885
3909
|
return s.clearProp(), o.sync(n), !0;
|
|
3886
3910
|
};
|
|
3887
|
-
i._fn[s.id] = t.watchLoadData(le((
|
|
3888
|
-
if (
|
|
3911
|
+
i._fn[s.id] = t.watchLoadData(le((m, p) => {
|
|
3912
|
+
if (p && a.watch === !1)
|
|
3889
3913
|
return i._fn[s.id]();
|
|
3890
|
-
const
|
|
3914
|
+
const y = t.$handle.loadFetchVar(J(a), m), v = q(b({
|
|
3891
3915
|
headers: {}
|
|
3892
|
-
},
|
|
3916
|
+
}, y), {
|
|
3893
3917
|
onSuccess(w, j) {
|
|
3894
3918
|
if (f()) return;
|
|
3895
|
-
let Z = (
|
|
3896
|
-
const V =
|
|
3897
|
-
h.Function(V) ? Z = V : V && h.String(V) && (Z = (
|
|
3919
|
+
let Z = (T) => j ? T : k(T, "data") ? T.data : T;
|
|
3920
|
+
const V = W(y.parse);
|
|
3921
|
+
h.Function(V) ? Z = V : V && h.String(V) && (Z = (T) => U(T, V)), l(Z(w, n, o)), o.sync(n);
|
|
3898
3922
|
},
|
|
3899
3923
|
onError(w) {
|
|
3900
|
-
l(void 0), !f() && (u || ((j) => xe(j.message || "fetch fail " +
|
|
3924
|
+
l(void 0), !f() && (u || ((j) => xe(j.message || "fetch fail " + y.action)))(w, n, o);
|
|
3901
3925
|
}
|
|
3902
3926
|
});
|
|
3903
3927
|
t.$handle.beforeFetch(v, { rule: n, api: o }).then(() => {
|
|
3904
|
-
if (h.Function(
|
|
3905
|
-
|
|
3928
|
+
if (h.Function(y.action)) {
|
|
3929
|
+
y.action(n, o).then((w) => {
|
|
3906
3930
|
v.onSuccess(w, !0);
|
|
3907
3931
|
}).catch((w) => {
|
|
3908
3932
|
v.onError(w);
|
|
3909
3933
|
});
|
|
3910
3934
|
return;
|
|
3911
3935
|
}
|
|
3912
|
-
|
|
3936
|
+
F(() => t.create.fetch(v, { inject: s, rule: n, api: o }));
|
|
3913
3937
|
});
|
|
3914
3938
|
}, a.wait || 600));
|
|
3915
3939
|
}
|
|
3916
3940
|
const i = {
|
|
3917
3941
|
name: "fetch",
|
|
3918
3942
|
_fn: [],
|
|
3919
|
-
|
|
3943
|
+
loaded(...s) {
|
|
3920
3944
|
r(...s);
|
|
3921
3945
|
},
|
|
3922
3946
|
watch(...s) {
|
|
@@ -3931,7 +3955,7 @@ const bi = function(t) {
|
|
|
3931
3955
|
fetch: Ci,
|
|
3932
3956
|
loadData: bi,
|
|
3933
3957
|
t: _i,
|
|
3934
|
-
componentValidate:
|
|
3958
|
+
componentValidate: Jt
|
|
3935
3959
|
};
|
|
3936
3960
|
function Oi(t) {
|
|
3937
3961
|
t = t || /* @__PURE__ */ new Map();
|
|
@@ -3957,8 +3981,8 @@ function Oi(t) {
|
|
|
3957
3981
|
};
|
|
3958
3982
|
return e;
|
|
3959
3983
|
}
|
|
3960
|
-
const
|
|
3961
|
-
name:
|
|
3984
|
+
const Fi = "html", Si = {
|
|
3985
|
+
name: Fi,
|
|
3962
3986
|
loadChildren: !1,
|
|
3963
3987
|
render(t, e) {
|
|
3964
3988
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
@@ -3967,7 +3991,7 @@ const ki = "html", Fi = {
|
|
|
3967
3991
|
return Array.isArray(t) ? t.filter((e) => h.String(e)).join("") : "";
|
|
3968
3992
|
}
|
|
3969
3993
|
};
|
|
3970
|
-
function
|
|
3994
|
+
function ki(t) {
|
|
3971
3995
|
t = t + "=";
|
|
3972
3996
|
const r = decodeURIComponent(document.cookie).split(";");
|
|
3973
3997
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -3985,7 +4009,7 @@ function Ri(t) {
|
|
|
3985
4009
|
}
|
|
3986
4010
|
return null;
|
|
3987
4011
|
}
|
|
3988
|
-
function
|
|
4012
|
+
function Ri(t) {
|
|
3989
4013
|
const e = localStorage.getItem(t);
|
|
3990
4014
|
if (e)
|
|
3991
4015
|
try {
|
|
@@ -3995,30 +4019,43 @@ function Si(t) {
|
|
|
3995
4019
|
}
|
|
3996
4020
|
return null;
|
|
3997
4021
|
}
|
|
3998
|
-
function
|
|
4022
|
+
function Ei(t) {
|
|
4023
|
+
const e = sessionStorage.getItem(t);
|
|
4024
|
+
if (e)
|
|
4025
|
+
try {
|
|
4026
|
+
return JSON.parse(e);
|
|
4027
|
+
} catch (r) {
|
|
4028
|
+
return e;
|
|
4029
|
+
}
|
|
4030
|
+
return null;
|
|
4031
|
+
}
|
|
4032
|
+
function it(t, e) {
|
|
3999
4033
|
if (!e)
|
|
4000
4034
|
return null;
|
|
4001
4035
|
const r = e.split(".");
|
|
4002
4036
|
let i = t(r.shift());
|
|
4003
|
-
return r.length ? i == null ? null :
|
|
4004
|
-
}
|
|
4005
|
-
function Ei(t) {
|
|
4006
|
-
return Jt(Ri, t);
|
|
4037
|
+
return r.length ? i == null ? null : U(i, r) : i;
|
|
4007
4038
|
}
|
|
4008
4039
|
function Di(t) {
|
|
4009
|
-
return
|
|
4040
|
+
return it(ki, t);
|
|
4041
|
+
}
|
|
4042
|
+
function ji(t) {
|
|
4043
|
+
return it(Ri, t);
|
|
4010
4044
|
}
|
|
4011
|
-
function
|
|
4045
|
+
function Ii(t) {
|
|
4046
|
+
return it(Ei, t);
|
|
4047
|
+
}
|
|
4048
|
+
function Ai(t, e) {
|
|
4012
4049
|
let r;
|
|
4013
4050
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
4014
4051
|
}
|
|
4015
4052
|
function Ne() {
|
|
4016
|
-
return
|
|
4053
|
+
return Ai("name", ...arguments);
|
|
4017
4054
|
}
|
|
4018
|
-
function
|
|
4055
|
+
function Vi(t) {
|
|
4019
4056
|
return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
4020
4057
|
}
|
|
4021
|
-
function
|
|
4058
|
+
function Pi(t, e) {
|
|
4022
4059
|
const r = new Vue({
|
|
4023
4060
|
data() {
|
|
4024
4061
|
return { rule: t, option: e || {} };
|
|
@@ -4029,23 +4066,23 @@ function Ai(t, e) {
|
|
|
4029
4066
|
});
|
|
4030
4067
|
return r.$mount(), r;
|
|
4031
4068
|
}
|
|
4032
|
-
function
|
|
4069
|
+
function Bi(t) {
|
|
4033
4070
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
4034
|
-
|
|
4071
|
+
jt.push(...e), Ze.push(...r), Ye.push(...i), Nt([...e, ...r, ...i]);
|
|
4035
4072
|
}
|
|
4036
|
-
let
|
|
4037
|
-
const
|
|
4073
|
+
let Li = 1;
|
|
4074
|
+
const M = {}, Fe = Symbol("defValue");
|
|
4038
4075
|
function Wt(t) {
|
|
4039
4076
|
const e = {
|
|
4040
4077
|
[Te.name]: Te
|
|
4041
4078
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4042
4079
|
t.extendApi
|
|
4043
4080
|
], u = b({}, wi), f = Kr();
|
|
4044
|
-
let
|
|
4045
|
-
const
|
|
4046
|
-
|
|
4081
|
+
let m = { global: {} };
|
|
4082
|
+
const p = x({}), y = $i(), v = {}, w = t.isMobile === !0, j = {};
|
|
4083
|
+
Bi(t.attrs || {});
|
|
4047
4084
|
function Z(c) {
|
|
4048
|
-
const d =
|
|
4085
|
+
const d = M[c];
|
|
4049
4086
|
if (Array.isArray(d))
|
|
4050
4087
|
return d.map((g) => g.api());
|
|
4051
4088
|
if (d)
|
|
@@ -4054,37 +4091,37 @@ function Wt(t) {
|
|
|
4054
4091
|
function V(c) {
|
|
4055
4092
|
o.push(c);
|
|
4056
4093
|
}
|
|
4057
|
-
function
|
|
4094
|
+
function T() {
|
|
4058
4095
|
const c = Ne(...arguments);
|
|
4059
4096
|
c.id && c.prop && (i[c.id] = c.prop);
|
|
4060
4097
|
}
|
|
4061
|
-
function
|
|
4098
|
+
function Ie() {
|
|
4062
4099
|
const c = Ne(...arguments);
|
|
4063
|
-
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop :
|
|
4100
|
+
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(b({}, c.prop), {
|
|
4064
4101
|
name: c.id
|
|
4065
4102
|
}));
|
|
4066
4103
|
}
|
|
4067
4104
|
function $e(c) {
|
|
4068
|
-
|
|
4105
|
+
y.use(c);
|
|
4069
4106
|
}
|
|
4070
4107
|
function O() {
|
|
4071
4108
|
const c = Ne(...arguments);
|
|
4072
|
-
if (!c.id || !c.prop) return
|
|
4073
|
-
const d =
|
|
4074
|
-
r[d] =
|
|
4109
|
+
if (!c.id || !c.prop) return ke;
|
|
4110
|
+
const d = G(c.id), g = c.prop, $ = g.merge === !0 ? r[d] : void 0;
|
|
4111
|
+
r[d] = Oe(g, $ || ke), f[d] = A(d), g.maker && _(f, g.maker);
|
|
4075
4112
|
}
|
|
4076
4113
|
function E(c, d) {
|
|
4077
4114
|
let g;
|
|
4078
4115
|
if (h.String(c)) {
|
|
4079
4116
|
if (g = c, d === void 0)
|
|
4080
|
-
return ["form-create", "formcreate"].indexOf(g) > -1 ?
|
|
4117
|
+
return ["form-create", "formcreate"].indexOf(g) > -1 ? B() : e[g];
|
|
4081
4118
|
} else
|
|
4082
|
-
g =
|
|
4119
|
+
g = G(c.name), d = c;
|
|
4083
4120
|
if (!g || !d) return;
|
|
4084
|
-
const
|
|
4085
|
-
e[g] = d, e[
|
|
4121
|
+
const $ = G(g);
|
|
4122
|
+
e[g] = d, e[$] = d, delete y.aliasMap[g], delete y.aliasMap[$], delete r[g], delete r[$], d.formCreateParser && O(g, d.formCreateParser);
|
|
4086
4123
|
}
|
|
4087
|
-
function
|
|
4124
|
+
function B() {
|
|
4088
4125
|
return Nr(Ve, e, i);
|
|
4089
4126
|
}
|
|
4090
4127
|
function re() {
|
|
@@ -4094,11 +4131,11 @@ function Wt(t) {
|
|
|
4094
4131
|
return h.Function(c.install) ? c.install(ie, d) : h.Function(c) && c(ie, d), this;
|
|
4095
4132
|
}
|
|
4096
4133
|
function ie(c, d, g) {
|
|
4097
|
-
let
|
|
4098
|
-
const C =
|
|
4099
|
-
return C.$parent = g,
|
|
4134
|
+
let $ = Pi(c, d || {});
|
|
4135
|
+
const C = $.$refs.fc.formCreate;
|
|
4136
|
+
return C.$parent = g, Vi(C.options).appendChild($.$el), C.api();
|
|
4100
4137
|
}
|
|
4101
|
-
|
|
4138
|
+
Oe(ie, j);
|
|
4102
4139
|
function Kt(c) {
|
|
4103
4140
|
let d = b({}, t);
|
|
4104
4141
|
return c ? d.inherit = {
|
|
@@ -4110,7 +4147,7 @@ function Wt(t) {
|
|
|
4110
4147
|
useApps: o,
|
|
4111
4148
|
maker: f,
|
|
4112
4149
|
formulas: v,
|
|
4113
|
-
loadData:
|
|
4150
|
+
loadData: p
|
|
4114
4151
|
} : delete d.inherit, Wt(d);
|
|
4115
4152
|
}
|
|
4116
4153
|
function Xt(c, d) {
|
|
@@ -4120,32 +4157,32 @@ function Wt(t) {
|
|
|
4120
4157
|
v[c] = d;
|
|
4121
4158
|
}
|
|
4122
4159
|
function Zt(c, d) {
|
|
4123
|
-
const g = n[c] || {},
|
|
4160
|
+
const g = n[c] || {}, $ = g.parsers || {};
|
|
4124
4161
|
d.parsers && Object.keys(d.parsers).forEach((C) => {
|
|
4125
|
-
|
|
4126
|
-
}), d.name = c, n[c] =
|
|
4162
|
+
$[C] = Oe(d.parsers[C], ke);
|
|
4163
|
+
}), d.name = c, n[c] = q(b(b({}, g), d), { parsers: $ });
|
|
4127
4164
|
}
|
|
4128
4165
|
function be(c) {
|
|
4129
|
-
c && Object.keys(
|
|
4130
|
-
(Array.isArray(
|
|
4131
|
-
|
|
4166
|
+
c && Object.keys(M).forEach((d) => {
|
|
4167
|
+
(Array.isArray(M[d]) ? M[d] : [M[d]]).forEach(($) => {
|
|
4168
|
+
$.bus.$emit("$loadData." + c);
|
|
4132
4169
|
});
|
|
4133
4170
|
});
|
|
4134
4171
|
}
|
|
4135
|
-
function Ie(c, d) {
|
|
4136
|
-
ee(m, c, d), be(c);
|
|
4137
|
-
}
|
|
4138
4172
|
function Ae(c, d) {
|
|
4139
|
-
|
|
4140
|
-
|
|
4173
|
+
ee(p, c, d), be(c);
|
|
4174
|
+
}
|
|
4175
|
+
function _e(c, d) {
|
|
4176
|
+
const g = (...$) => F(() => d(...$));
|
|
4177
|
+
g._driver = !0, Ae(c, g);
|
|
4141
4178
|
}
|
|
4142
|
-
function
|
|
4179
|
+
function nt(c, d) {
|
|
4143
4180
|
const g = (c || "").split(".");
|
|
4144
4181
|
c = g.shift();
|
|
4145
|
-
const
|
|
4146
|
-
if (
|
|
4147
|
-
let C =
|
|
4148
|
-
return C && C._driver ? C = C(
|
|
4182
|
+
const $ = g.join(".");
|
|
4183
|
+
if (k(p, c) || S(p, c, Fe), p[c] !== Fe) {
|
|
4184
|
+
let C = p[c];
|
|
4185
|
+
return C && C._driver ? C = C($) : g.length && (C = U(C, g)), C == null || C === "" ? d : C;
|
|
4149
4186
|
} else
|
|
4150
4187
|
return d;
|
|
4151
4188
|
}
|
|
@@ -4153,14 +4190,14 @@ function Wt(t) {
|
|
|
4153
4190
|
l.push(c);
|
|
4154
4191
|
}
|
|
4155
4192
|
function xt(c) {
|
|
4156
|
-
delete
|
|
4193
|
+
delete p[c], be(c);
|
|
4157
4194
|
}
|
|
4158
4195
|
function er(c, d) {
|
|
4159
4196
|
a.push({ name: c, callback: d });
|
|
4160
4197
|
}
|
|
4161
4198
|
function Ve(c) {
|
|
4162
4199
|
_(this, {
|
|
4163
|
-
id:
|
|
4200
|
+
id: Li++,
|
|
4164
4201
|
create: ie,
|
|
4165
4202
|
vm: c,
|
|
4166
4203
|
manager: vi(t.manager),
|
|
@@ -4170,7 +4207,7 @@ function Wt(t) {
|
|
|
4170
4207
|
formulas: v,
|
|
4171
4208
|
isMobile: w,
|
|
4172
4209
|
rules: c.$options.propsData.rule,
|
|
4173
|
-
name: c.$options.propsData.name ||
|
|
4210
|
+
name: c.$options.propsData.name || je(),
|
|
4174
4211
|
inFor: c.$options.propsData.inFor,
|
|
4175
4212
|
prop: {
|
|
4176
4213
|
components: e,
|
|
@@ -4180,8 +4217,8 @@ function Wt(t) {
|
|
|
4180
4217
|
renderDriver: null,
|
|
4181
4218
|
get: null,
|
|
4182
4219
|
refreshData: be,
|
|
4183
|
-
loadData:
|
|
4184
|
-
CreateNode:
|
|
4220
|
+
loadData: p,
|
|
4221
|
+
CreateNode: y,
|
|
4185
4222
|
bus: new Oi(),
|
|
4186
4223
|
unwatch: [],
|
|
4187
4224
|
options: pr({}),
|
|
@@ -4190,61 +4227,61 @@ function Wt(t) {
|
|
|
4190
4227
|
tmpData: x({})
|
|
4191
4228
|
}), a.forEach((d) => {
|
|
4192
4229
|
this.bus.$on(d.name, d.callback);
|
|
4193
|
-
}),
|
|
4194
|
-
|
|
4230
|
+
}), P(() => {
|
|
4231
|
+
L(this.options, () => {
|
|
4195
4232
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4196
4233
|
}, { deep: !0 });
|
|
4197
|
-
}), _(c.$options.components, e), _(c.$options.directives, i), this.$handle = new
|
|
4234
|
+
}), _(c.$options.components, e), _(c.$options.directives, i), this.$handle = new z(this), this.name && (this.inFor ? (M[this.name] || (M[this.name] = []), M[this.name].push(this)) : M[this.name] = this);
|
|
4198
4235
|
}
|
|
4199
4236
|
Ve.isMobile = w, _(Ve.prototype, {
|
|
4200
4237
|
init() {
|
|
4201
|
-
this.isSub() && this.unwatch.push(
|
|
4238
|
+
this.isSub() && this.unwatch.push(L(() => this.vm.parent.fc.options.value, () => {
|
|
4202
4239
|
this.initOptions(), this.$handle.api.refresh();
|
|
4203
4240
|
}, { 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();
|
|
4204
4241
|
},
|
|
4205
4242
|
targetFormDriver(c, ...d) {
|
|
4206
4243
|
if (this.renderDriver && this.renderDriver[c])
|
|
4207
|
-
return
|
|
4244
|
+
return F(() => this.renderDriver[c](...d));
|
|
4208
4245
|
},
|
|
4209
4246
|
t(c, d, g) {
|
|
4210
|
-
let
|
|
4211
|
-
return
|
|
4212
|
-
const
|
|
4213
|
-
|
|
4214
|
-
}),
|
|
4247
|
+
let $ = g ? g("$t." + c) : this.globalLanguageDriver(c);
|
|
4248
|
+
return $ == null && ($ = ""), $ && d && Object.keys(d).forEach((C) => {
|
|
4249
|
+
const R = new RegExp(`{${C}}`, "g");
|
|
4250
|
+
$ = $.replace(R, d[C]);
|
|
4251
|
+
}), $;
|
|
4215
4252
|
},
|
|
4216
4253
|
globalDataDriver(c) {
|
|
4217
4254
|
let d = c.split(".");
|
|
4218
|
-
const g = d.shift(),
|
|
4219
|
-
if (
|
|
4220
|
-
if (
|
|
4221
|
-
return
|
|
4255
|
+
const g = d.shift(), $ = this.options.value.globalData && this.options.value.globalData[g];
|
|
4256
|
+
if ($) {
|
|
4257
|
+
if ($.type === "static")
|
|
4258
|
+
return U($.data, d);
|
|
4222
4259
|
{
|
|
4223
4260
|
let C;
|
|
4224
|
-
const
|
|
4225
|
-
if (
|
|
4226
|
-
if (
|
|
4261
|
+
const R = this.fetchCache.get($);
|
|
4262
|
+
if (R) {
|
|
4263
|
+
if (R.status && (C = U(R.data, d)), !R.loading)
|
|
4227
4264
|
return C;
|
|
4228
|
-
|
|
4265
|
+
R.loading = !1, this.fetchCache.set($, R);
|
|
4229
4266
|
} else
|
|
4230
|
-
this.fetchCache.set(
|
|
4267
|
+
this.fetchCache.set($, { status: !1 });
|
|
4231
4268
|
const I = le(() => {
|
|
4232
4269
|
ue();
|
|
4233
|
-
const
|
|
4234
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(
|
|
4235
|
-
},
|
|
4236
|
-
this.fetchCache.set(
|
|
4237
|
-
}, pe = (
|
|
4238
|
-
if (ne &&
|
|
4270
|
+
const N = this.fetchCache.get($);
|
|
4271
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf($) !== -1 ? (N && (N.loading = !0, this.fetchCache.set($, N)), this.bus.$emit("$loadData.$globalData." + g)) : this.fetchCache.delete($);
|
|
4272
|
+
}, $.wait || 600), de = (N) => {
|
|
4273
|
+
this.fetchCache.set($, { status: !0, data: N }), this.bus.$emit("$loadData.$globalData." + g);
|
|
4274
|
+
}, pe = (N, ne) => {
|
|
4275
|
+
if (ne && $.watch === !1)
|
|
4239
4276
|
return ue();
|
|
4240
4277
|
if (ne) {
|
|
4241
4278
|
I();
|
|
4242
4279
|
return;
|
|
4243
4280
|
}
|
|
4244
|
-
const se = this.$handle.loadFetchVar(Je(
|
|
4245
|
-
this.$handle.api.fetch(se).then((
|
|
4246
|
-
de(
|
|
4247
|
-
}).catch((
|
|
4281
|
+
const se = this.$handle.loadFetchVar(Je($), N);
|
|
4282
|
+
this.$handle.api.fetch(se).then((we) => {
|
|
4283
|
+
de(we);
|
|
4284
|
+
}).catch((we) => {
|
|
4248
4285
|
de(null);
|
|
4249
4286
|
});
|
|
4250
4287
|
}, ue = this.watchLoadData(pe);
|
|
@@ -4254,33 +4291,33 @@ function Wt(t) {
|
|
|
4254
4291
|
},
|
|
4255
4292
|
getLocale() {
|
|
4256
4293
|
let c = this.vm.top.$props.locale;
|
|
4257
|
-
return c && typeof c == "object" ? c.name : typeof c == "string" ? c :
|
|
4294
|
+
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4258
4295
|
},
|
|
4259
4296
|
globalLanguageDriver(c) {
|
|
4260
4297
|
let d = this.vm.top.$props.locale, g;
|
|
4261
|
-
if (d && typeof d == "object" && (g =
|
|
4262
|
-
const
|
|
4263
|
-
g =
|
|
4298
|
+
if (d && typeof d == "object" && (g = U(d, c)), g == null) {
|
|
4299
|
+
const $ = this.options.value.language || {}, C = this.getLocale();
|
|
4300
|
+
g = U($[C], c);
|
|
4264
4301
|
}
|
|
4265
4302
|
return g;
|
|
4266
4303
|
},
|
|
4267
4304
|
globalVarDriver(c) {
|
|
4268
4305
|
let d = c.split(".");
|
|
4269
|
-
const g = d.shift(),
|
|
4270
|
-
if (
|
|
4271
|
-
const C = h.Function(
|
|
4306
|
+
const g = d.shift(), $ = this.options.value.globalVariable && this.options.value.globalVariable[g];
|
|
4307
|
+
if ($) {
|
|
4308
|
+
const C = h.Function($) ? $ : W($.handle);
|
|
4272
4309
|
if (C)
|
|
4273
|
-
return
|
|
4310
|
+
return U(F(() => C(this.get || ((...R) => this.getLoadData(...R)), this.$handle.api)), d);
|
|
4274
4311
|
}
|
|
4275
4312
|
},
|
|
4276
4313
|
setData(c, d, g) {
|
|
4277
|
-
g ?
|
|
4314
|
+
g ? Ae(c, d) : (ee(this.vm.top.fc.tmpData, c, d), this.bus.$emit("$loadData." + c));
|
|
4278
4315
|
},
|
|
4279
4316
|
getLoadData(c, d) {
|
|
4280
4317
|
let g = null;
|
|
4281
4318
|
if (c != null) {
|
|
4282
|
-
let
|
|
4283
|
-
const C =
|
|
4319
|
+
let $ = c.split(".");
|
|
4320
|
+
const C = $.shift();
|
|
4284
4321
|
if (C === "$topForm")
|
|
4285
4322
|
g = this.$handle.api.top.formData();
|
|
4286
4323
|
else if (C === "$form")
|
|
@@ -4288,50 +4325,50 @@ function Wt(t) {
|
|
|
4288
4325
|
else if (C === "$options")
|
|
4289
4326
|
g = this.options.value;
|
|
4290
4327
|
else if (C === "$globalData")
|
|
4291
|
-
g = this.globalDataDriver(
|
|
4328
|
+
g = this.globalDataDriver($.join(".")), $ = [];
|
|
4292
4329
|
else if (C === "$var")
|
|
4293
|
-
g = this.globalVarDriver(
|
|
4330
|
+
g = this.globalVarDriver($.join(".")), $ = [];
|
|
4294
4331
|
else if (C === "$locale")
|
|
4295
|
-
g = this.getLocale(),
|
|
4332
|
+
g = this.getLocale(), $ = [];
|
|
4296
4333
|
else if (C === "$t")
|
|
4297
|
-
g = this.globalLanguageDriver(
|
|
4334
|
+
g = this.globalLanguageDriver($.join(".")), $ = [];
|
|
4298
4335
|
else {
|
|
4299
|
-
const
|
|
4300
|
-
R
|
|
4336
|
+
const R = this.vm.top.fc.tmpData;
|
|
4337
|
+
k(R, C) || S(R, C, Fe), g = R[C] !== Fe ? U(R, c) : nt(c), $ = [];
|
|
4301
4338
|
}
|
|
4302
|
-
g &&
|
|
4339
|
+
g && $.length && (g = U(g, $));
|
|
4303
4340
|
}
|
|
4304
4341
|
return g == null || g === "" ? d : g;
|
|
4305
4342
|
},
|
|
4306
4343
|
watchLoadData(c, d) {
|
|
4307
4344
|
let g = {};
|
|
4308
|
-
const
|
|
4309
|
-
this.get || (this.get = C),
|
|
4345
|
+
const $ = (I) => {
|
|
4346
|
+
this.get || (this.get = C), F(() => {
|
|
4310
4347
|
c(C, I);
|
|
4311
4348
|
}), this.get === C && (this.get = void 0);
|
|
4312
4349
|
}, C = (I, de) => {
|
|
4313
4350
|
if (g[I])
|
|
4314
4351
|
return g[I].val;
|
|
4315
|
-
const pe = ce(() => this.getLoadData(I, de)), ue = I.split("."),
|
|
4352
|
+
const pe = ce(() => this.getLoadData(I, de)), ue = I.split("."), N = ue.shift(), ne = ue.shift() || "", se = le(() => {
|
|
4316
4353
|
const Pe = this.getLoadData(I, de);
|
|
4317
4354
|
if (g[I])
|
|
4318
|
-
JSON.stringify(Pe) !== JSON.stringify(g[I].val) && (g[I].val = Pe,
|
|
4355
|
+
JSON.stringify(Pe) !== JSON.stringify(g[I].val) && (g[I].val = Pe, $(!0));
|
|
4319
4356
|
else return;
|
|
4320
|
-
}, d || 0),
|
|
4357
|
+
}, d || 0), we = L(pe, (Pe) => {
|
|
4321
4358
|
se();
|
|
4322
4359
|
});
|
|
4323
|
-
return this.bus.$on("$loadData." +
|
|
4360
|
+
return this.bus.$on("$loadData." + N, se), ne && this.bus.$on("$loadData." + N + "." + ne, se), g[I] = {
|
|
4324
4361
|
fn: () => {
|
|
4325
|
-
this.bus.$off("$loadData." +
|
|
4362
|
+
this.bus.$off("$loadData." + N, se), ne && this.bus.$off("$loadData." + N + "." + ne, se), we();
|
|
4326
4363
|
},
|
|
4327
4364
|
val: pe.value
|
|
4328
4365
|
}, pe.value;
|
|
4329
4366
|
};
|
|
4330
|
-
|
|
4331
|
-
const
|
|
4367
|
+
$(!1);
|
|
4368
|
+
const R = () => {
|
|
4332
4369
|
Object.keys(g).forEach((I) => g[I].fn()), g = {};
|
|
4333
4370
|
};
|
|
4334
|
-
return this.unwatch.push(
|
|
4371
|
+
return this.unwatch.push(R), R;
|
|
4335
4372
|
},
|
|
4336
4373
|
isSub() {
|
|
4337
4374
|
return this.vm.parent && this.vm.extendOption;
|
|
@@ -4344,12 +4381,12 @@ function Wt(t) {
|
|
|
4344
4381
|
resetBtn: {},
|
|
4345
4382
|
globalEvent: {},
|
|
4346
4383
|
globalData: {}
|
|
4347
|
-
}, J(
|
|
4384
|
+
}, J(m));
|
|
4348
4385
|
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);
|
|
4349
4386
|
},
|
|
4350
4387
|
mergeOptions(c, d, g) {
|
|
4351
|
-
return d = b({}, d || {}), g && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((
|
|
4352
|
-
delete d[
|
|
4388
|
+
return d = b({}, d || {}), g && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach(($) => {
|
|
4389
|
+
delete d[$];
|
|
4353
4390
|
}), d.global && (c.global = Hr(c.global, d.global), delete d.global), this.$handle.$manager.mergeOptions([d], c), c;
|
|
4354
4391
|
},
|
|
4355
4392
|
updateOptions(c) {
|
|
@@ -4367,10 +4404,10 @@ function Wt(t) {
|
|
|
4367
4404
|
unmount() {
|
|
4368
4405
|
if (this.name)
|
|
4369
4406
|
if (this.inFor) {
|
|
4370
|
-
const c =
|
|
4371
|
-
|
|
4407
|
+
const c = M[this.name].indexOf(this);
|
|
4408
|
+
M[this.name].splice(c, 1);
|
|
4372
4409
|
} else
|
|
4373
|
-
delete
|
|
4410
|
+
delete M[this.name];
|
|
4374
4411
|
a.forEach((c) => {
|
|
4375
4412
|
this.bus.$off(c.name, c.callback);
|
|
4376
4413
|
}), this.tmpData = {}, this.unwatch.forEach((c) => c()), this.unwatch = [], this.$handle.reloadRule([]);
|
|
@@ -4379,36 +4416,36 @@ function Wt(t) {
|
|
|
4379
4416
|
this.$handle.bindNextTick(() => this.bus.$emit("next-tick", this.$handle.api));
|
|
4380
4417
|
}
|
|
4381
4418
|
});
|
|
4382
|
-
function
|
|
4419
|
+
function st(c) {
|
|
4383
4420
|
_(c, {
|
|
4384
4421
|
version: t.version,
|
|
4385
4422
|
ui: t.ui,
|
|
4386
4423
|
isMobile: w,
|
|
4387
4424
|
extendApi: Yt,
|
|
4388
|
-
getData:
|
|
4389
|
-
setDataDriver:
|
|
4390
|
-
setData:
|
|
4425
|
+
getData: nt,
|
|
4426
|
+
setDataDriver: _e,
|
|
4427
|
+
setData: Ae,
|
|
4391
4428
|
removeData: xt,
|
|
4392
4429
|
refreshData: be,
|
|
4393
4430
|
maker: f,
|
|
4394
4431
|
component: E,
|
|
4395
|
-
directive:
|
|
4432
|
+
directive: T,
|
|
4396
4433
|
setModelField: Xt,
|
|
4397
4434
|
setFormula: Qt,
|
|
4398
4435
|
setDriver: Zt,
|
|
4399
|
-
register:
|
|
4436
|
+
register: Ie,
|
|
4400
4437
|
$vnode: re,
|
|
4401
4438
|
parser: O,
|
|
4402
4439
|
use: ve,
|
|
4403
4440
|
factory: Kt,
|
|
4404
4441
|
componentAlias: $e,
|
|
4405
|
-
copyRule:
|
|
4406
|
-
copyRules:
|
|
4407
|
-
mergeRule:
|
|
4408
|
-
fetch:
|
|
4409
|
-
$form:
|
|
4410
|
-
parseFn:
|
|
4411
|
-
parseJson:
|
|
4442
|
+
copyRule: Pt,
|
|
4443
|
+
copyRules: Bt,
|
|
4444
|
+
mergeRule: Q,
|
|
4445
|
+
fetch: Ut,
|
|
4446
|
+
$form: B,
|
|
4447
|
+
parseFn: W,
|
|
4448
|
+
parseJson: Vt,
|
|
4412
4449
|
toJson: et,
|
|
4413
4450
|
useApp: V,
|
|
4414
4451
|
getApi: Z,
|
|
@@ -4419,25 +4456,25 @@ function Wt(t) {
|
|
|
4419
4456
|
_(c, {
|
|
4420
4457
|
create: ie,
|
|
4421
4458
|
install(d, g) {
|
|
4422
|
-
if (
|
|
4459
|
+
if (m = b(b({}, m), g || {}), d._installedFormCreate === !0) return;
|
|
4423
4460
|
d._installedFormCreate = !0;
|
|
4424
|
-
const
|
|
4425
|
-
return ie(
|
|
4461
|
+
const $ = function(R, I = {}) {
|
|
4462
|
+
return ie(R, I, this);
|
|
4426
4463
|
};
|
|
4427
|
-
|
|
4428
|
-
const C =
|
|
4429
|
-
d.component(C.name, C), d.component("FcFragment", re()), o.forEach((
|
|
4430
|
-
|
|
4464
|
+
st($), d.prototype.$formCreate = $;
|
|
4465
|
+
const C = B();
|
|
4466
|
+
d.component(C.name, C), d.component("FcFragment", re()), o.forEach((R) => {
|
|
4467
|
+
F(() => R(c, d));
|
|
4431
4468
|
});
|
|
4432
4469
|
}
|
|
4433
4470
|
});
|
|
4434
4471
|
}
|
|
4435
|
-
if (
|
|
4472
|
+
if (st(j), tr(j), _e("$cookie", Di), _e("$localStorage", ji), _e("$sessionStorage", Ii), y.use({ fragment: "fcFragment" }), t.install && ie.use(t), O(Si), t.inherit) {
|
|
4436
4473
|
const c = t.inherit;
|
|
4437
|
-
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 && _(
|
|
4474
|
+
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 && _(p, c.loadData), c.formulas && _(v, c.formulas);
|
|
4438
4475
|
}
|
|
4439
|
-
const
|
|
4440
|
-
return
|
|
4476
|
+
const Ce = B();
|
|
4477
|
+
return Oe(Ce, j), Object.defineProperties(Ce, {
|
|
4441
4478
|
fetch: {
|
|
4442
4479
|
get() {
|
|
4443
4480
|
return j.fetch;
|
|
@@ -4446,7 +4483,7 @@ function Wt(t) {
|
|
|
4446
4483
|
j.fetch = c;
|
|
4447
4484
|
}
|
|
4448
4485
|
}
|
|
4449
|
-
}),
|
|
4486
|
+
}), Ce.util = j, Ce;
|
|
4450
4487
|
}
|
|
4451
4488
|
function Me(t) {
|
|
4452
4489
|
if (h.Date(t))
|
|
@@ -4456,10 +4493,10 @@ function Me(t) {
|
|
|
4456
4493
|
return e.toString() === "Invalid Date" ? t : e;
|
|
4457
4494
|
}
|
|
4458
4495
|
}
|
|
4459
|
-
const
|
|
4460
|
-
name:
|
|
4496
|
+
const bt = "datePicker", Ti = {
|
|
4497
|
+
name: bt,
|
|
4461
4498
|
maker: function() {
|
|
4462
|
-
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = A(
|
|
4499
|
+
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = A(bt, { type: e.toLowerCase() }), t), {});
|
|
4463
4500
|
}(),
|
|
4464
4501
|
mergeProp(t) {
|
|
4465
4502
|
let e = t.prop.props;
|
|
@@ -4488,7 +4525,7 @@ const vt = "datePicker", Bi = {
|
|
|
4488
4525
|
mounted(t) {
|
|
4489
4526
|
t.rule.value = this.toValue(t.$handle.getFormData(t), t);
|
|
4490
4527
|
}
|
|
4491
|
-
}, Ue = "hidden",
|
|
4528
|
+
}, Ue = "hidden", Ni = {
|
|
4492
4529
|
name: Ue,
|
|
4493
4530
|
maker: {
|
|
4494
4531
|
[Ue]: (t, e) => A(Ue)("", t, e)
|
|
@@ -4496,7 +4533,7 @@ const vt = "datePicker", Bi = {
|
|
|
4496
4533
|
render() {
|
|
4497
4534
|
return [];
|
|
4498
4535
|
}
|
|
4499
|
-
}, qe = "input",
|
|
4536
|
+
}, qe = "input", Mi = {
|
|
4500
4537
|
name: qe,
|
|
4501
4538
|
maker: function() {
|
|
4502
4539
|
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = A(qe, { type: r }), e), {});
|
|
@@ -4506,36 +4543,36 @@ const vt = "datePicker", Bi = {
|
|
|
4506
4543
|
let { props: e } = t.prop;
|
|
4507
4544
|
e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4508
4545
|
}
|
|
4509
|
-
},
|
|
4510
|
-
name:
|
|
4546
|
+
}, _t = "slider", Ui = {
|
|
4547
|
+
name: _t,
|
|
4511
4548
|
maker: {
|
|
4512
|
-
sliderRange: A(
|
|
4549
|
+
sliderRange: A(_t, { range: !0 })
|
|
4513
4550
|
},
|
|
4514
4551
|
toFormValue(t, e) {
|
|
4515
4552
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
4516
4553
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
4517
4554
|
}
|
|
4518
|
-
},
|
|
4555
|
+
}, qi = {
|
|
4519
4556
|
name: "switch",
|
|
4520
4557
|
mergeProp(t) {
|
|
4521
4558
|
const e = t.prop.props.slot || {}, r = t.prop.scopedSlots || {};
|
|
4522
4559
|
e.open && (r.open = () => e.open), e.close && (r.close = () => e.close), t.prop.scopedSlots = r;
|
|
4523
4560
|
}
|
|
4524
|
-
},
|
|
4561
|
+
}, Gi = {
|
|
4525
4562
|
name: "FcRow",
|
|
4526
4563
|
render(t, e) {
|
|
4527
4564
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
4528
4565
|
e.vNode.row(e.prop, t)
|
|
4529
4566
|
]);
|
|
4530
4567
|
}
|
|
4531
|
-
},
|
|
4532
|
-
Bi,
|
|
4533
|
-
Li,
|
|
4568
|
+
}, Hi = [
|
|
4534
4569
|
Ti,
|
|
4535
4570
|
Ni,
|
|
4536
4571
|
Mi,
|
|
4537
|
-
Ui
|
|
4538
|
-
|
|
4572
|
+
Ui,
|
|
4573
|
+
qi,
|
|
4574
|
+
Gi
|
|
4575
|
+
], Ji = {
|
|
4539
4576
|
button: "iButton",
|
|
4540
4577
|
icon: "Icon",
|
|
4541
4578
|
slider: "Slider",
|
|
@@ -4562,21 +4599,21 @@ const vt = "datePicker", Bi = {
|
|
|
4562
4599
|
array: "fcGroup",
|
|
4563
4600
|
subForm: "fcSubForm",
|
|
4564
4601
|
object: "fcSubForm"
|
|
4565
|
-
},
|
|
4602
|
+
}, Ee = {
|
|
4566
4603
|
resetBtnType: "default",
|
|
4567
4604
|
resetBtnIcon: "md-refresh",
|
|
4568
4605
|
infoIcon: "ios-information-circle-outline"
|
|
4569
4606
|
};
|
|
4570
|
-
function
|
|
4607
|
+
function Wi() {
|
|
4571
4608
|
return {
|
|
4572
4609
|
type: "poptip",
|
|
4573
4610
|
trigger: "hover",
|
|
4574
4611
|
placement: "top-start",
|
|
4575
4612
|
wordWrap: !0,
|
|
4576
|
-
icon:
|
|
4613
|
+
icon: Ee.infoIcon
|
|
4577
4614
|
};
|
|
4578
4615
|
}
|
|
4579
|
-
function
|
|
4616
|
+
function zi() {
|
|
4580
4617
|
return {
|
|
4581
4618
|
form: {
|
|
4582
4619
|
inline: !1,
|
|
@@ -4592,36 +4629,36 @@ function Ji() {
|
|
|
4592
4629
|
submitBtn: {
|
|
4593
4630
|
type: "primary",
|
|
4594
4631
|
disabled: !1,
|
|
4595
|
-
innerText: "
|
|
4632
|
+
innerText: "",
|
|
4596
4633
|
loading: !1,
|
|
4597
4634
|
show: !0,
|
|
4598
4635
|
click: void 0
|
|
4599
4636
|
},
|
|
4600
4637
|
resetBtn: {
|
|
4601
|
-
type:
|
|
4638
|
+
type: Ee.resetBtnType,
|
|
4602
4639
|
disabled: !1,
|
|
4603
|
-
icon:
|
|
4604
|
-
innerText: "
|
|
4640
|
+
icon: Ee.resetBtnIcon,
|
|
4641
|
+
innerText: "",
|
|
4605
4642
|
loading: !1,
|
|
4606
4643
|
show: !1,
|
|
4607
4644
|
click: void 0
|
|
4608
4645
|
}
|
|
4609
4646
|
};
|
|
4610
4647
|
}
|
|
4611
|
-
function
|
|
4612
|
-
|
|
4648
|
+
function Ct(t, e) {
|
|
4649
|
+
k(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4613
4650
|
}
|
|
4614
|
-
function
|
|
4651
|
+
function K(t) {
|
|
4615
4652
|
return t === !1;
|
|
4616
4653
|
}
|
|
4617
|
-
function
|
|
4618
|
-
|
|
4654
|
+
function Ki(t, e) {
|
|
4655
|
+
k(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4619
4656
|
}
|
|
4620
4657
|
function Ge(t) {
|
|
4621
4658
|
const e = b({}, t);
|
|
4622
4659
|
return delete e.children, e;
|
|
4623
4660
|
}
|
|
4624
|
-
const
|
|
4661
|
+
const Xi = {
|
|
4625
4662
|
validate() {
|
|
4626
4663
|
const t = this.form();
|
|
4627
4664
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -4640,28 +4677,28 @@ const zi = {
|
|
|
4640
4677
|
},
|
|
4641
4678
|
tidyOptions(t) {
|
|
4642
4679
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
4643
|
-
|
|
4680
|
+
Ki(t, e);
|
|
4644
4681
|
}), t;
|
|
4645
4682
|
},
|
|
4646
4683
|
tidyRule({ prop: t }) {
|
|
4647
|
-
return
|
|
4684
|
+
return Ct(t, "title"), Ct(t, "info"), t;
|
|
4648
4685
|
},
|
|
4649
4686
|
mergeProp(t) {
|
|
4650
4687
|
const e = {
|
|
4651
|
-
info:
|
|
4688
|
+
info: Wi(),
|
|
4652
4689
|
title: {},
|
|
4653
4690
|
col: { span: 24 },
|
|
4654
4691
|
wrap: {}
|
|
4655
4692
|
};
|
|
4656
4693
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
4657
|
-
t.prop[r] =
|
|
4694
|
+
t.prop[r] = X([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
4658
4695
|
}), this.setSize(t.prop.props);
|
|
4659
4696
|
},
|
|
4660
4697
|
setSize(t) {
|
|
4661
4698
|
!t.size && this.options.form.size && (t.size = this.options.form.size);
|
|
4662
4699
|
},
|
|
4663
4700
|
getDefaultOptions() {
|
|
4664
|
-
return
|
|
4701
|
+
return zi();
|
|
4665
4702
|
},
|
|
4666
4703
|
update() {
|
|
4667
4704
|
const t = this.options.form;
|
|
@@ -4684,13 +4721,13 @@ const zi = {
|
|
|
4684
4721
|
});
|
|
4685
4722
|
},
|
|
4686
4723
|
render(t) {
|
|
4687
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
4724
|
+
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, K(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
4688
4725
|
},
|
|
4689
4726
|
makeWrap(t, e) {
|
|
4690
4727
|
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;
|
|
4691
4728
|
delete r.wrap.title;
|
|
4692
|
-
const u =
|
|
4693
|
-
props:
|
|
4729
|
+
const u = K(r.wrap.show) ? e : this.$r(X([r.wrap, {
|
|
4730
|
+
props: q(b({
|
|
4694
4731
|
labelWidth: o
|
|
4695
4732
|
}, Ge(r.wrap || {})), {
|
|
4696
4733
|
prop: t.id,
|
|
@@ -4701,38 +4738,39 @@ const zi = {
|
|
|
4701
4738
|
ref: t.wrapRef,
|
|
4702
4739
|
type: "formItem"
|
|
4703
4740
|
}]), b({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
4704
|
-
return a === !0 ||
|
|
4741
|
+
return a === !0 || K(l) || K(s.show) ? u : this.makeCol(r, i, [u]);
|
|
4705
4742
|
},
|
|
4706
4743
|
isTitle(t) {
|
|
4707
4744
|
if (this.options.form.title === !1) return !1;
|
|
4708
4745
|
const e = t.title;
|
|
4709
|
-
return !(!e.title && !e.native ||
|
|
4746
|
+
return !(!e.title && !e.native || K(e.show));
|
|
4710
4747
|
},
|
|
4711
4748
|
makeInfo(t, e, r) {
|
|
4749
|
+
var u, f, m;
|
|
4712
4750
|
const i = b({}, t.title), s = b({}, t.info), n = this.options.form, o = this.getSlot("title"), a = [o ? o({
|
|
4713
|
-
title: r.refRule.__$title.value,
|
|
4751
|
+
title: (u = r.refRule) == null ? void 0 : u.__$title.value,
|
|
4714
4752
|
rule: r.rule,
|
|
4715
4753
|
options: this.options
|
|
4716
|
-
}) : r.refRule.__$title.value + (n.labelSuffix || n["label-suffix"] || "")];
|
|
4717
|
-
if (!
|
|
4718
|
-
const
|
|
4754
|
+
}) : ((f = r.refRule) == null ? void 0 : f.__$title.value) + (n.labelSuffix || n["label-suffix"] || "")];
|
|
4755
|
+
if (!K(s.show) && (s.info || s.native) && !K(s.icon)) {
|
|
4756
|
+
const p = {
|
|
4719
4757
|
type: s.type || "poptip",
|
|
4720
4758
|
props: Ge(s),
|
|
4721
4759
|
key: `${e}pop`,
|
|
4722
4760
|
slot: "label"
|
|
4723
4761
|
};
|
|
4724
|
-
delete
|
|
4725
|
-
const
|
|
4726
|
-
s.info && !
|
|
4762
|
+
delete p.props.icon, delete p.props.show, delete p.props.info, delete p.props.align, delete p.props.native;
|
|
4763
|
+
const y = "content";
|
|
4764
|
+
s.info && !k(p.props, y) && (p.props[y] = (m = r.refRule) == null ? void 0 : m.__$info.value), a[s.align !== "left" ? "unshift" : "push"](this.$r(X([s, p]), [
|
|
4727
4765
|
this.$r({
|
|
4728
4766
|
type: "icon",
|
|
4729
|
-
props: { type: s.icon === !0 ?
|
|
4767
|
+
props: { type: s.icon === !0 ? Ee.infoIcon : s.icon, size: 16 },
|
|
4730
4768
|
style: "margin-top: -1px",
|
|
4731
4769
|
key: `${e}i`
|
|
4732
4770
|
})
|
|
4733
4771
|
]));
|
|
4734
4772
|
}
|
|
4735
|
-
const l =
|
|
4773
|
+
const l = X([i, {
|
|
4736
4774
|
props: Ge(i),
|
|
4737
4775
|
key: `${e}tit`,
|
|
4738
4776
|
class: "fc-form-title",
|
|
@@ -4761,7 +4799,7 @@ const zi = {
|
|
|
4761
4799
|
},
|
|
4762
4800
|
makeFormBtn() {
|
|
4763
4801
|
let t = [];
|
|
4764
|
-
if (
|
|
4802
|
+
if (K(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), K(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4765
4803
|
return;
|
|
4766
4804
|
const e = this.$r({
|
|
4767
4805
|
type: "formItem",
|
|
@@ -4776,7 +4814,7 @@ const zi = {
|
|
|
4776
4814
|
}, [e]);
|
|
4777
4815
|
},
|
|
4778
4816
|
makeResetBtn() {
|
|
4779
|
-
const t = b({}, this.options.resetBtn), e = t.innerText;
|
|
4817
|
+
const t = b({}, this.options.resetBtn), e = t.innerText || this.$handle.api.t("reset") || "重置";
|
|
4780
4818
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
4781
4819
|
type: "button",
|
|
4782
4820
|
props: t,
|
|
@@ -4792,7 +4830,7 @@ const zi = {
|
|
|
4792
4830
|
}, [e]);
|
|
4793
4831
|
},
|
|
4794
4832
|
makeSubmitBtn() {
|
|
4795
|
-
const t = b({}, this.options.submitBtn), e = t.innerText;
|
|
4833
|
+
const t = b({}, this.options.submitBtn), e = t.innerText || this.$handle.api.t("submit") || "提交";
|
|
4796
4834
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
4797
4835
|
type: "button",
|
|
4798
4836
|
props: t,
|
|
@@ -4808,13 +4846,13 @@ const zi = {
|
|
|
4808
4846
|
key: `${this.key}b1`
|
|
4809
4847
|
}, [e]);
|
|
4810
4848
|
}
|
|
4811
|
-
}, te = {},
|
|
4812
|
-
function
|
|
4813
|
-
|
|
4849
|
+
}, te = {}, Qi = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
|
|
4850
|
+
function Zi(t) {
|
|
4851
|
+
Qi.forEach((e) => {
|
|
4814
4852
|
t[e] = A(e);
|
|
4815
4853
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4816
4854
|
}
|
|
4817
|
-
function
|
|
4855
|
+
function Yi(t) {
|
|
4818
4856
|
const e = "upload", r = {
|
|
4819
4857
|
image: ["image", 0],
|
|
4820
4858
|
file: ["file", 0],
|
|
@@ -4823,19 +4861,19 @@ function Qi(t) {
|
|
|
4823
4861
|
};
|
|
4824
4862
|
Object.keys(r).reduce((i, s) => (i[s] = A(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4825
4863
|
}
|
|
4826
|
-
function
|
|
4864
|
+
function xi(t) {
|
|
4827
4865
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4828
4866
|
Object.keys(r).reduce((i, s) => (i[s] = A(e, { type: r[s] }), i), t);
|
|
4829
4867
|
}
|
|
4830
|
-
function
|
|
4868
|
+
function en(t) {
|
|
4831
4869
|
const e = "timePicker";
|
|
4832
4870
|
t.time = A(e, { type: "time" }), t.timeRange = A(e, { type: "timerange" });
|
|
4833
4871
|
}
|
|
4834
|
-
function
|
|
4872
|
+
function tn(t) {
|
|
4835
4873
|
const e = "select";
|
|
4836
4874
|
t.selectMultiple = A(e, { multiple: !0 }), t.selectOne = A(e, { multiple: !1 });
|
|
4837
4875
|
}
|
|
4838
|
-
function
|
|
4876
|
+
function rn(t) {
|
|
4839
4877
|
const e = "frame", r = {
|
|
4840
4878
|
frameInputs: ["input", 0],
|
|
4841
4879
|
frameFiles: ["file", 0],
|
|
@@ -4846,16 +4884,16 @@ function en(t) {
|
|
|
4846
4884
|
};
|
|
4847
4885
|
Object.keys(r).reduce((i, s) => (i[s] = A(e, (n) => n.props({ type: r[s][0], maxLength: r[s][1] })), i), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages;
|
|
4848
4886
|
}
|
|
4849
|
-
Xi(te);
|
|
4850
|
-
Qi(te);
|
|
4851
4887
|
Zi(te);
|
|
4888
|
+
Yi(te);
|
|
4852
4889
|
xi(te);
|
|
4890
|
+
tn(te);
|
|
4891
|
+
rn(te);
|
|
4853
4892
|
en(te);
|
|
4854
|
-
|
|
4855
|
-
function Ct(t, e) {
|
|
4893
|
+
function wt(t, e) {
|
|
4856
4894
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4857
4895
|
}
|
|
4858
|
-
function
|
|
4896
|
+
function nn(t, e) {
|
|
4859
4897
|
return {
|
|
4860
4898
|
formEl() {
|
|
4861
4899
|
return e.$manager.form();
|
|
@@ -4882,7 +4920,7 @@ function tn(t, e) {
|
|
|
4882
4920
|
const o = e.getFieldCtx(r);
|
|
4883
4921
|
if (!o) return;
|
|
4884
4922
|
const a = e.subForm[o.id], l = [e.$manager.validateField(o.id)];
|
|
4885
|
-
|
|
4923
|
+
H(a).forEach((u) => {
|
|
4886
4924
|
l.push(u.validate());
|
|
4887
4925
|
}), Promise.all(l).then(() => {
|
|
4888
4926
|
s(null), i && i(null);
|
|
@@ -4931,20 +4969,20 @@ function tn(t, e) {
|
|
|
4931
4969
|
}
|
|
4932
4970
|
},
|
|
4933
4971
|
submitBtnProps: (r = {}) => {
|
|
4934
|
-
let i =
|
|
4972
|
+
let i = wt(e.options.submitBtn, !0);
|
|
4935
4973
|
_(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4936
4974
|
},
|
|
4937
4975
|
resetBtnProps: (r = {}) => {
|
|
4938
|
-
let i =
|
|
4976
|
+
let i = wt(e.options.resetBtn, !1);
|
|
4939
4977
|
_(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4940
4978
|
},
|
|
4941
4979
|
submit(r, i) {
|
|
4942
4980
|
return new Promise((s, n) => {
|
|
4943
4981
|
t.validate().then(() => {
|
|
4944
4982
|
let o = t.formData();
|
|
4945
|
-
h.Function(r) &&
|
|
4983
|
+
h.Function(r) && F(() => r(o, t)), h.Function(e.options.onSubmit) && F(() => e.options.onSubmit(o, t)), e.vm.emit("submit", o, t), s(o);
|
|
4946
4984
|
}).catch((...o) => {
|
|
4947
|
-
h.Function(i) &&
|
|
4985
|
+
h.Function(i) && F(() => i(t, ...o)), n(...o);
|
|
4948
4986
|
});
|
|
4949
4987
|
});
|
|
4950
4988
|
}
|
|
@@ -4953,21 +4991,21 @@ function tn(t, e) {
|
|
|
4953
4991
|
const zt = {
|
|
4954
4992
|
name: "required",
|
|
4955
4993
|
load(t, e, r) {
|
|
4956
|
-
const i =
|
|
4994
|
+
const i = sn(t.getValue());
|
|
4957
4995
|
if (i.required === !1)
|
|
4958
4996
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
4959
4997
|
else {
|
|
4960
4998
|
const s = b({
|
|
4961
4999
|
required: !0,
|
|
4962
|
-
validator(
|
|
4963
|
-
h.empty(
|
|
5000
|
+
validator(o, a, l) {
|
|
5001
|
+
h.empty(a) ? l(s.message) : l();
|
|
4964
5002
|
}
|
|
4965
|
-
}, i);
|
|
5003
|
+
}, i), n = e.__fc__.refRule.__$title.value;
|
|
4966
5004
|
if (!s.message)
|
|
4967
|
-
s.message =
|
|
5005
|
+
s.message = r.t("required", { title: n }) || n + (r.getLocale() === "en" ? " is required" : "不能为空");
|
|
4968
5006
|
else {
|
|
4969
|
-
const
|
|
4970
|
-
|
|
5007
|
+
const o = s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
5008
|
+
o && (s.message = r.t(o[1], { title: n }));
|
|
4971
5009
|
}
|
|
4972
5010
|
t.getProp().validate = [s];
|
|
4973
5011
|
}
|
|
@@ -4977,25 +5015,25 @@ const zt = {
|
|
|
4977
5015
|
zt.load(...t);
|
|
4978
5016
|
}
|
|
4979
5017
|
};
|
|
4980
|
-
function
|
|
5018
|
+
function sn(t) {
|
|
4981
5019
|
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 : {};
|
|
4982
5020
|
}
|
|
4983
|
-
function
|
|
4984
|
-
t.componentAlias(
|
|
5021
|
+
function on(t) {
|
|
5022
|
+
t.componentAlias(Ji), Tr.forEach((e) => {
|
|
4985
5023
|
t.component(e.name, e);
|
|
4986
|
-
}), t.register(zt),
|
|
5024
|
+
}), t.register(zt), Hi.forEach((e) => {
|
|
4987
5025
|
t.parser(e);
|
|
4988
5026
|
}), Object.keys(te).forEach((e) => {
|
|
4989
5027
|
t.maker[e] = te[e];
|
|
4990
5028
|
});
|
|
4991
5029
|
}
|
|
4992
|
-
function
|
|
5030
|
+
function an() {
|
|
4993
5031
|
return Wt({
|
|
4994
5032
|
ui: "view-design",
|
|
4995
|
-
version: "2.7.
|
|
4996
|
-
manager:
|
|
4997
|
-
install:
|
|
4998
|
-
extendApi:
|
|
5033
|
+
version: "2.7.2",
|
|
5034
|
+
manager: Xi,
|
|
5035
|
+
install: on,
|
|
5036
|
+
extendApi: nn,
|
|
4999
5037
|
attrs: {
|
|
5000
5038
|
normal: ["col", "wrap"],
|
|
5001
5039
|
array: ["className"],
|
|
@@ -5003,10 +5041,10 @@ function sn() {
|
|
|
5003
5041
|
}
|
|
5004
5042
|
});
|
|
5005
5043
|
}
|
|
5006
|
-
const Qe =
|
|
5044
|
+
const Qe = an();
|
|
5007
5045
|
typeof window != "undefined" && (window.formCreate = Qe, window.Vue && Qe.install(window.Vue));
|
|
5008
|
-
const
|
|
5046
|
+
const fn = Qe.maker;
|
|
5009
5047
|
export {
|
|
5010
5048
|
Qe as default,
|
|
5011
|
-
|
|
5049
|
+
fn as maker
|
|
5012
5050
|
};
|