@form-create/iview 2.7.2 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form-create.esm.js +792 -744
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +4 -4
package/dist/form-create.esm.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/iview v2.7.
|
|
3
|
+
* @form-create/iview v2.7.3
|
|
4
4
|
* (c) 2018-2025 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
7
7
|
* Released under the MIT License.
|
|
8
8
|
*/
|
|
9
9
|
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode('._fc-frame .fc-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
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var ir = Object.defineProperty, nr = Object.defineProperties;
|
|
11
|
+
var sr = Object.getOwnPropertyDescriptors;
|
|
12
12
|
var ot = Object.getOwnPropertySymbols;
|
|
13
|
-
var
|
|
14
|
-
var at = (t, e, r) => e in t ?
|
|
13
|
+
var or = Object.prototype.hasOwnProperty, ar = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var at = (t, e, r) => e in t ? ir(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
|
-
|
|
16
|
+
or.call(e, r) && at(t, r, e[r]);
|
|
17
17
|
if (ot)
|
|
18
18
|
for (var r of ot(e))
|
|
19
|
-
|
|
19
|
+
ar.call(e, r) && at(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
},
|
|
22
|
-
import
|
|
23
|
-
function
|
|
21
|
+
}, U = (t, e) => nr(t, sr(e));
|
|
22
|
+
import me, { getCurrentInstance as lr, provide as ur, inject as fr, toRefs as lt, reactive as re, onBeforeMount as cr, watch as L, onMounted as hr, onBeforeUnmount as dr, onUpdated as pr, nextTick as P, markRaw as de, computed as pe, toRef as Ee, ref as mr } from "vue";
|
|
23
|
+
function gr(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
26
26
|
function He() {
|
|
@@ -29,33 +29,33 @@ function He() {
|
|
|
29
29
|
return t;
|
|
30
30
|
}, He.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var yr = ["attrs", "props", "domProps"], $r = ["class", "style", "directives"], vr = ["on", "nativeOn"], br = function(t) {
|
|
33
33
|
return t.reduce(function(e, r) {
|
|
34
34
|
for (var i in r) if (!e[i]) e[i] = r[i];
|
|
35
|
-
else if (
|
|
36
|
-
else if (
|
|
35
|
+
else if (yr.indexOf(i) !== -1) e[i] = He({}, e[i], r[i]);
|
|
36
|
+
else if ($r.indexOf(i) !== -1) {
|
|
37
37
|
var s = e[i] instanceof Array ? e[i] : [e[i]], n = r[i] instanceof Array ? r[i] : [r[i]];
|
|
38
38
|
e[i] = [].concat(s, n);
|
|
39
|
-
} else if (
|
|
39
|
+
} else if (vr.indexOf(i) !== -1)
|
|
40
40
|
for (var o in r[i]) if (e[i][o]) {
|
|
41
41
|
var a = e[i][o] instanceof Array ? e[i][o] : [e[i][o]], l = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
|
|
42
42
|
e[i][o] = [].concat(a, l);
|
|
43
43
|
} else e[i][o] = r[i][o];
|
|
44
|
-
else if (i === "hook") for (var u in r[i]) e[i][u] = e[i][u] ?
|
|
44
|
+
else if (i === "hook") for (var u in r[i]) e[i][u] = e[i][u] ? _r(e[i][u], r[i][u]) : r[i][u];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, _r = function(t, e) {
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
},
|
|
53
|
-
const
|
|
54
|
-
function
|
|
52
|
+
}, Cr = br;
|
|
53
|
+
const j = /* @__PURE__ */ gr(Cr);
|
|
54
|
+
function je(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => ((!e || e.indexOf(i) === -1) && r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
name:
|
|
57
|
+
const wr = "fcCheckbox", Or = {
|
|
58
|
+
name: wr,
|
|
59
59
|
props: {
|
|
60
60
|
formCreateInject: {
|
|
61
61
|
type: Object,
|
|
@@ -100,7 +100,7 @@ const Cr = "fcCheckbox", wr = {
|
|
|
100
100
|
},
|
|
101
101
|
render() {
|
|
102
102
|
const t = arguments[0];
|
|
103
|
-
return t("CheckboxGroup",
|
|
103
|
+
return t("CheckboxGroup", j([{}, this.formCreateInject.prop, {
|
|
104
104
|
ref: "el"
|
|
105
105
|
}, {
|
|
106
106
|
props: {
|
|
@@ -112,24 +112,24 @@ const Cr = "fcCheckbox", wr = {
|
|
|
112
112
|
}
|
|
113
113
|
}]), [this.options().map((e, r) => {
|
|
114
114
|
const i = b({}, e);
|
|
115
|
-
return delete i.value, t("Checkbox",
|
|
115
|
+
return delete i.value, t("Checkbox", j([{}, {
|
|
116
116
|
props: i
|
|
117
117
|
}, {
|
|
118
118
|
key: "" + r + "-" + e.value
|
|
119
119
|
}]));
|
|
120
|
-
}),
|
|
120
|
+
}), je(this.$slots)]);
|
|
121
121
|
},
|
|
122
122
|
mounted() {
|
|
123
123
|
this.$emit("fc.el", this.$refs.el);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
|
-
function
|
|
126
|
+
function G(t) {
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
|
-
const
|
|
129
|
+
const Sr = "fcFrame";
|
|
130
130
|
function Ot(t) {
|
|
131
131
|
return {
|
|
132
|
-
name:
|
|
132
|
+
name: Sr,
|
|
133
133
|
props: {
|
|
134
134
|
formCreateInject: {
|
|
135
135
|
type: Object,
|
|
@@ -250,7 +250,7 @@ function Ot(t) {
|
|
|
250
250
|
},
|
|
251
251
|
data() {
|
|
252
252
|
return {
|
|
253
|
-
fileList:
|
|
253
|
+
fileList: G(this.value),
|
|
254
254
|
previewVisible: !1,
|
|
255
255
|
frameVisible: !1,
|
|
256
256
|
previewImage: ""
|
|
@@ -258,7 +258,7 @@ function Ot(t) {
|
|
|
258
258
|
},
|
|
259
259
|
watch: {
|
|
260
260
|
value(e) {
|
|
261
|
-
this.fileList =
|
|
261
|
+
this.fileList = G(e);
|
|
262
262
|
},
|
|
263
263
|
fileList(e) {
|
|
264
264
|
const r = this.maxLength === 1 ? e[0] || "" : e;
|
|
@@ -286,7 +286,7 @@ function Ot(t) {
|
|
|
286
286
|
readonly: !0,
|
|
287
287
|
clearable: !1
|
|
288
288
|
};
|
|
289
|
-
return e("Input",
|
|
289
|
+
return e("Input", j([{}, {
|
|
290
290
|
props: r
|
|
291
291
|
}, {}, {
|
|
292
292
|
on: {
|
|
@@ -325,7 +325,7 @@ function Ot(t) {
|
|
|
325
325
|
},
|
|
326
326
|
makeHandleIcon(e, r) {
|
|
327
327
|
const i = this.$createElement;
|
|
328
|
-
return i("icon",
|
|
328
|
+
return i("icon", j([{}, {
|
|
329
329
|
props: {
|
|
330
330
|
type: this.handleIcon === !0 || this.handleIcon === void 0 ? "ios-eye-outline" : this.handleIcon
|
|
331
331
|
}
|
|
@@ -338,7 +338,7 @@ function Ot(t) {
|
|
|
338
338
|
},
|
|
339
339
|
makeRemoveIcon(e, r) {
|
|
340
340
|
const i = this.$createElement;
|
|
341
|
-
return i("icon",
|
|
341
|
+
return i("icon", j([{}, {
|
|
342
342
|
props: {
|
|
343
343
|
type: "ios-trash-outline"
|
|
344
344
|
}
|
|
@@ -351,7 +351,7 @@ function Ot(t) {
|
|
|
351
351
|
},
|
|
352
352
|
makeFiles() {
|
|
353
353
|
const e = this.$createElement;
|
|
354
|
-
return this.makeGroup(this.fileList.map((r, i) => this.makeItem(i, [e("icon",
|
|
354
|
+
return this.makeGroup(this.fileList.map((r, i) => this.makeItem(i, [e("icon", j([{}, {
|
|
355
355
|
props: {
|
|
356
356
|
type: t.fileIcon,
|
|
357
357
|
size: 40
|
|
@@ -378,7 +378,7 @@ function Ot(t) {
|
|
|
378
378
|
click: () => this.showModel()
|
|
379
379
|
},
|
|
380
380
|
key: this.key("btn")
|
|
381
|
-
}, [e("icon",
|
|
381
|
+
}, [e("icon", j([{}, {
|
|
382
382
|
props: {
|
|
383
383
|
type: this.icon,
|
|
384
384
|
size: 20
|
|
@@ -450,7 +450,7 @@ function Ot(t) {
|
|
|
450
450
|
this.$refs.frame && this.frameLoad(this.$refs.frame.contentWindow || {});
|
|
451
451
|
}), e("div", {
|
|
452
452
|
class: "_fc-frame"
|
|
453
|
-
}, [i, e("Modal",
|
|
453
|
+
}, [i, e("Modal", j([{}, {
|
|
454
454
|
props: {
|
|
455
455
|
mask: this.previewMask,
|
|
456
456
|
title: l,
|
|
@@ -468,7 +468,7 @@ function Ot(t) {
|
|
|
468
468
|
attrs: {
|
|
469
469
|
src: this.previewImage
|
|
470
470
|
}
|
|
471
|
-
})]), e("Modal",
|
|
471
|
+
})]), e("Modal", j([{}, {
|
|
472
472
|
props: b({
|
|
473
473
|
width: s,
|
|
474
474
|
title: a
|
|
@@ -503,15 +503,15 @@ function Ot(t) {
|
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
const
|
|
506
|
+
const St = Ot({
|
|
507
507
|
fileIcon: "md-document",
|
|
508
508
|
fileUpIcon: "ios-folder-open"
|
|
509
509
|
});
|
|
510
|
-
|
|
510
|
+
St.v2 = Ot({
|
|
511
511
|
fileIcon: "document-text",
|
|
512
512
|
fileUpIcon: "folder"
|
|
513
513
|
});
|
|
514
|
-
const Fr = "fcRadio",
|
|
514
|
+
const Fr = "fcRadio", Rr = {
|
|
515
515
|
name: Fr,
|
|
516
516
|
props: {
|
|
517
517
|
formCreateInject: {
|
|
@@ -553,7 +553,7 @@ const Fr = "fcRadio", Sr = {
|
|
|
553
553
|
},
|
|
554
554
|
render() {
|
|
555
555
|
const t = arguments[0];
|
|
556
|
-
return t("RadioGroup",
|
|
556
|
+
return t("RadioGroup", j([{}, this.formCreateInject.prop, {}, {
|
|
557
557
|
props: {
|
|
558
558
|
value: this.trueValue
|
|
559
559
|
}
|
|
@@ -564,12 +564,12 @@ const Fr = "fcRadio", Sr = {
|
|
|
564
564
|
}
|
|
565
565
|
}]), [this.options().map((e, r) => {
|
|
566
566
|
const i = b({}, e);
|
|
567
|
-
return delete i.value, t("Radio",
|
|
567
|
+
return delete i.value, t("Radio", j([{}, {
|
|
568
568
|
props: i
|
|
569
569
|
}, {
|
|
570
570
|
key: "" + r + "-" + e.value
|
|
571
571
|
}]));
|
|
572
|
-
}),
|
|
572
|
+
}), je(this.$slots)]);
|
|
573
573
|
},
|
|
574
574
|
mounted() {
|
|
575
575
|
this.$emit("fc.el", this.$refs.el);
|
|
@@ -607,7 +607,7 @@ const Fr = "fcRadio", Sr = {
|
|
|
607
607
|
function k(t, e) {
|
|
608
608
|
return {}.hasOwnProperty.call(t, e);
|
|
609
609
|
}
|
|
610
|
-
const kr = "fcSelect",
|
|
610
|
+
const kr = "fcSelect", Er = {
|
|
611
611
|
name: kr,
|
|
612
612
|
functional: !0,
|
|
613
613
|
props: {
|
|
@@ -619,7 +619,7 @@ const kr = "fcSelect", Rr = {
|
|
|
619
619
|
render(t, e) {
|
|
620
620
|
const r = (n, o) => {
|
|
621
621
|
const a = n.slot;
|
|
622
|
-
return t("Option",
|
|
622
|
+
return t("Option", j([{}, {
|
|
623
623
|
props: n
|
|
624
624
|
}, {
|
|
625
625
|
key: "" + o + "-" + n.value
|
|
@@ -632,15 +632,15 @@ const kr = "fcSelect", Rr = {
|
|
|
632
632
|
},
|
|
633
633
|
key: "" + o + "-" + n.label
|
|
634
634
|
}, [h.trueArray(n.options) && n.options.map((a, l) => r(a, l))]), s = e.props.formCreateInject.options;
|
|
635
|
-
return t("Select",
|
|
635
|
+
return t("Select", j([{}, e.data, {
|
|
636
636
|
ref: "el"
|
|
637
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);
|
|
641
641
|
}
|
|
642
|
-
},
|
|
643
|
-
name:
|
|
642
|
+
}, Dr = "fcTree", jr = {
|
|
643
|
+
name: Dr,
|
|
644
644
|
props: {
|
|
645
645
|
formCreateInject: {
|
|
646
646
|
type: Object,
|
|
@@ -670,7 +670,7 @@ const kr = "fcSelect", Rr = {
|
|
|
670
670
|
},
|
|
671
671
|
methods: {
|
|
672
672
|
setStatus(t) {
|
|
673
|
-
const e =
|
|
673
|
+
const e = G(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) {
|
|
@@ -684,11 +684,11 @@ const kr = "fcSelect", Rr = {
|
|
|
684
684
|
},
|
|
685
685
|
render() {
|
|
686
686
|
const t = arguments[0], e = {};
|
|
687
|
-
return this.type === "selected" ? e["on-select-change"] = this.onInput : e["on-check-change"] = this.onInput, t("Tree",
|
|
687
|
+
return this.type === "selected" ? e["on-select-change"] = this.onInput : e["on-check-change"] = this.onInput, t("Tree", j([{}, this.formCreateInject.prop, {
|
|
688
688
|
ref: "tree"
|
|
689
689
|
}, {
|
|
690
690
|
on: e
|
|
691
|
-
}]), [
|
|
691
|
+
}]), [je(this.$slots)]);
|
|
692
692
|
},
|
|
693
693
|
mounted() {
|
|
694
694
|
this.$emit("fc.el", this.$refs.tree);
|
|
@@ -698,22 +698,22 @@ function ut(t) {
|
|
|
698
698
|
return typeof t == "object" ? t : {
|
|
699
699
|
url: t,
|
|
700
700
|
is_string: !0,
|
|
701
|
-
name:
|
|
701
|
+
name: Ir(t)
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
704
|
function ft(t) {
|
|
705
|
-
return
|
|
705
|
+
return U(b({}, t), {
|
|
706
706
|
file: t,
|
|
707
707
|
value: t
|
|
708
708
|
});
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Ir(t) {
|
|
711
711
|
return ("" + t).split("/").pop();
|
|
712
712
|
}
|
|
713
|
-
const
|
|
714
|
-
function
|
|
713
|
+
const Ar = "fcUpload";
|
|
714
|
+
function Ft(t) {
|
|
715
715
|
return {
|
|
716
|
-
name:
|
|
716
|
+
name: Ar,
|
|
717
717
|
props: {
|
|
718
718
|
formCreateInject: {
|
|
719
719
|
type: Object,
|
|
@@ -754,11 +754,11 @@ function St(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 = G(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 = G(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();
|
|
@@ -784,7 +784,7 @@ function St(t) {
|
|
|
784
784
|
src: e.url
|
|
785
785
|
},
|
|
786
786
|
key: this.key("img" + r)
|
|
787
|
-
}) : i("icon",
|
|
787
|
+
}) : i("icon", j([{}, {
|
|
788
788
|
props: {
|
|
789
789
|
type: t.fileIcon,
|
|
790
790
|
size: 40
|
|
@@ -819,7 +819,7 @@ function St(t) {
|
|
|
819
819
|
},
|
|
820
820
|
makeProgress(e, r) {
|
|
821
821
|
const i = this.$createElement;
|
|
822
|
-
return i("Progress",
|
|
822
|
+
return i("Progress", j([{}, {
|
|
823
823
|
props: {
|
|
824
824
|
percent: e.percentage,
|
|
825
825
|
hideInfo: !0
|
|
@@ -849,7 +849,7 @@ function St(t) {
|
|
|
849
849
|
},
|
|
850
850
|
makeUpload() {
|
|
851
851
|
const e = this.$createElement, r = !this.maxLength || this.maxLength > this.uploadList.length;
|
|
852
|
-
return e("Upload",
|
|
852
|
+
return e("Upload", j([{}, this.formCreateInject.prop, {}, {
|
|
853
853
|
style: {
|
|
854
854
|
display: "inline-block"
|
|
855
855
|
},
|
|
@@ -859,12 +859,12 @@ function St(t) {
|
|
|
859
859
|
slot: "default"
|
|
860
860
|
}, [this.$slots.default || e("div", {
|
|
861
861
|
class: "fc-upload-btn"
|
|
862
|
-
}, [e("icon",
|
|
862
|
+
}, [e("icon", j([{}, {
|
|
863
863
|
props: {
|
|
864
864
|
type: this.uploadType === "file" ? "ios-cloud-upload-outline" : t.imgUpIcon,
|
|
865
865
|
size: 20
|
|
866
866
|
}
|
|
867
|
-
}]))])]) : null,
|
|
867
|
+
}]))])]) : null, je(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);
|
|
@@ -878,7 +878,7 @@ function St(t) {
|
|
|
878
878
|
const e = arguments[0];
|
|
879
879
|
return this.$refs.upload && (this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = this.$refs.upload.showUploadList), this.formCreateInject.prop.props.defaultFileList = this.$refs.upload.defaultFileList), e("div", {
|
|
880
880
|
class: "_fc-upload"
|
|
881
|
-
}, [[this.formCreateInject.prop.props.showUploadList ? [] : this.makeFiles(), this.makeUpload()], e("Modal",
|
|
881
|
+
}, [[this.formCreateInject.prop.props.showUploadList ? [] : this.makeFiles(), this.makeUpload()], e("Modal", j([{}, {
|
|
882
882
|
props: {
|
|
883
883
|
title: this.modalTitle,
|
|
884
884
|
footerHide: !0
|
|
@@ -907,21 +907,21 @@ function St(t) {
|
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
|
-
const
|
|
910
|
+
const Rt = Ft({
|
|
911
911
|
fileIcon: "md-document",
|
|
912
912
|
imgUpIcon: "md-images"
|
|
913
913
|
});
|
|
914
|
-
|
|
914
|
+
Rt.v2 = Ft({
|
|
915
915
|
fileIcon: "document-text",
|
|
916
916
|
imgUpIcon: "image"
|
|
917
917
|
});
|
|
918
|
-
function
|
|
919
|
-
|
|
918
|
+
function F(t, e, r) {
|
|
919
|
+
me.set(t, e, r);
|
|
920
920
|
}
|
|
921
|
-
function
|
|
922
|
-
(
|
|
921
|
+
function te(t, e) {
|
|
922
|
+
(me.del || me.delete)(t, e);
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function $e(t, e = {}, r) {
|
|
925
925
|
let i = !1;
|
|
926
926
|
for (let s in e)
|
|
927
927
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
@@ -929,39 +929,39 @@ 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 && F(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 && F(t, s, {});
|
|
936
936
|
else {
|
|
937
|
-
|
|
937
|
+
F(t, s, n._clone());
|
|
938
938
|
continue;
|
|
939
939
|
}
|
|
940
940
|
else
|
|
941
|
-
o &&
|
|
942
|
-
t[s] =
|
|
941
|
+
o && F(t, s, {});
|
|
942
|
+
t[s] = $e(t[s], n, r);
|
|
943
943
|
} else
|
|
944
|
-
|
|
944
|
+
F(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
|
}
|
|
948
948
|
function J(t) {
|
|
949
|
-
return
|
|
949
|
+
return $e({}, { value: t }).value;
|
|
950
950
|
}
|
|
951
|
-
const
|
|
951
|
+
const Vr = 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) && F(t, i, e[i]);
|
|
955
955
|
return t;
|
|
956
956
|
};
|
|
957
957
|
function _() {
|
|
958
|
-
return
|
|
958
|
+
return Vr.apply(this, arguments);
|
|
959
959
|
}
|
|
960
960
|
function Je(t) {
|
|
961
961
|
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : b({}, t);
|
|
962
962
|
}
|
|
963
|
-
const
|
|
964
|
-
name:
|
|
963
|
+
const Pr = "fcGroup", Br = {
|
|
964
|
+
name: Pr,
|
|
965
965
|
props: {
|
|
966
966
|
field: String,
|
|
967
967
|
rule: [Array, Object],
|
|
@@ -1042,7 +1042,7 @@ const Vr = "fcGroup", Pr = {
|
|
|
1042
1042
|
const s = i.$f.formData();
|
|
1043
1043
|
if (t === e)
|
|
1044
1044
|
i.$f.deferSyncValue(() => {
|
|
1045
|
-
|
|
1045
|
+
$e(i.rule, t), i.$f.setValue(s);
|
|
1046
1046
|
}, !0);
|
|
1047
1047
|
else {
|
|
1048
1048
|
const n = i.$f.formData();
|
|
@@ -1069,10 +1069,12 @@ const Vr = "fcGroup", Pr = {
|
|
|
1069
1069
|
for (let n = 0; n < i; n++)
|
|
1070
1070
|
this.setValue(r[n], t[n]);
|
|
1071
1071
|
} else {
|
|
1072
|
-
if (s > 0)
|
|
1072
|
+
if (s > 0) {
|
|
1073
1073
|
for (let n = 0; n < s; n++)
|
|
1074
1074
|
this.removeRule(r[i - n - 1]);
|
|
1075
|
-
|
|
1075
|
+
this.sort = Object.keys(this.cacheRule);
|
|
1076
|
+
}
|
|
1077
|
+
t.forEach((n, o) => {
|
|
1076
1078
|
this.setValue(r[o], t[o]);
|
|
1077
1079
|
});
|
|
1078
1080
|
}
|
|
@@ -1230,13 +1232,13 @@ const Vr = "fcGroup", Pr = {
|
|
|
1230
1232
|
return t("div", {
|
|
1231
1233
|
class: "_fc-group-container",
|
|
1232
1234
|
key: o
|
|
1233
|
-
}, [t(i,
|
|
1235
|
+
}, [t(i, j([{
|
|
1234
1236
|
key: o
|
|
1235
1237
|
}, {
|
|
1236
1238
|
on: {
|
|
1237
|
-
"update:value": (
|
|
1238
|
-
"emit-event": (
|
|
1239
|
-
input: (
|
|
1239
|
+
"update:value": (d) => this.formData(o, d),
|
|
1240
|
+
"emit-event": (d, ...m) => this.emitEvent(d, m, a, o),
|
|
1241
|
+
input: (d) => this.add$f(a, o, d)
|
|
1240
1242
|
}
|
|
1241
1243
|
}, {}, {
|
|
1242
1244
|
props: {
|
|
@@ -1260,8 +1262,8 @@ const Vr = "fcGroup", Pr = {
|
|
|
1260
1262
|
class: "_fc-group " + (s ? "_fc-group-disabled" : "")
|
|
1261
1263
|
}, [n]);
|
|
1262
1264
|
}
|
|
1263
|
-
},
|
|
1264
|
-
name:
|
|
1265
|
+
}, Lr = "fcSubForm", Tr = {
|
|
1266
|
+
name: Lr,
|
|
1265
1267
|
props: {
|
|
1266
1268
|
rule: Array,
|
|
1267
1269
|
options: Object,
|
|
@@ -1329,7 +1331,7 @@ const Vr = "fcGroup", Pr = {
|
|
|
1329
1331
|
rule: e,
|
|
1330
1332
|
options: r
|
|
1331
1333
|
} = this.cacheRule, i = this.type;
|
|
1332
|
-
return t(i,
|
|
1334
|
+
return t(i, j([{}, {
|
|
1333
1335
|
on: {
|
|
1334
1336
|
"update:value": this.formData,
|
|
1335
1337
|
"emit-event": this.emitEvent,
|
|
@@ -1344,35 +1346,35 @@ const Vr = "fcGroup", Pr = {
|
|
|
1344
1346
|
}
|
|
1345
1347
|
}]));
|
|
1346
1348
|
}
|
|
1347
|
-
},
|
|
1348
|
-
|
|
1349
|
-
Sr,
|
|
1349
|
+
}, Nr = [
|
|
1350
|
+
Or,
|
|
1350
1351
|
Rr,
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1352
|
+
Er,
|
|
1353
|
+
jr,
|
|
1354
|
+
Tr,
|
|
1355
|
+
St,
|
|
1356
|
+
Rt,
|
|
1357
|
+
Br
|
|
1356
1358
|
];
|
|
1357
|
-
function
|
|
1359
|
+
function ce(t, e) {
|
|
1358
1360
|
var r = null;
|
|
1359
1361
|
return function(...i) {
|
|
1360
1362
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
1361
1363
|
};
|
|
1362
1364
|
}
|
|
1363
|
-
function
|
|
1365
|
+
function ye(t) {
|
|
1364
1366
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
1365
1367
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
1366
1368
|
}
|
|
1367
|
-
const
|
|
1369
|
+
const Re = (t, e) => {
|
|
1368
1370
|
if (!(!t || t === e || !t.$props)) {
|
|
1369
1371
|
if (t.$props.formCreateInject)
|
|
1370
1372
|
return t.$props.formCreateInject;
|
|
1371
1373
|
if (t.$parent)
|
|
1372
|
-
return
|
|
1374
|
+
return Re(t.$parent, e);
|
|
1373
1375
|
}
|
|
1374
1376
|
};
|
|
1375
|
-
function
|
|
1377
|
+
function Mr(t, e, r) {
|
|
1376
1378
|
const i = "FormCreate" + (t.isMobile ? "Mobile" : "");
|
|
1377
1379
|
return {
|
|
1378
1380
|
name: i,
|
|
@@ -1423,100 +1425,100 @@ function Nr(t, e, r) {
|
|
|
1423
1425
|
return this.fc.render();
|
|
1424
1426
|
},
|
|
1425
1427
|
setup(s) {
|
|
1426
|
-
const n =
|
|
1427
|
-
|
|
1428
|
-
const o =
|
|
1428
|
+
const n = lr().proxy;
|
|
1429
|
+
ur("parentFC", n);
|
|
1430
|
+
const o = fr("parentFC", null);
|
|
1429
1431
|
let a = o;
|
|
1430
1432
|
if (o)
|
|
1431
1433
|
for (; a.parent; )
|
|
1432
1434
|
a = a.parent;
|
|
1433
1435
|
else
|
|
1434
1436
|
a = n;
|
|
1435
|
-
const { rule: l, value: u, subForm: f, inFor:
|
|
1437
|
+
const { rule: l, value: u, subForm: f, inFor: d } = lt(s), m = re({
|
|
1436
1438
|
ctxInject: {},
|
|
1437
1439
|
destroyed: !1,
|
|
1438
1440
|
isShow: !0,
|
|
1439
1441
|
unique: 1,
|
|
1440
1442
|
renderRule: [...l.value || []],
|
|
1441
1443
|
updateValue: JSON.stringify(u.value || {})
|
|
1442
|
-
}),
|
|
1444
|
+
}), g = new t(n), v = g.api(), w = d.value, I = () => {
|
|
1443
1445
|
if (o) {
|
|
1444
|
-
const
|
|
1445
|
-
if (
|
|
1446
|
-
let
|
|
1447
|
-
w ? (
|
|
1446
|
+
const S = Re(n, o);
|
|
1447
|
+
if (S) {
|
|
1448
|
+
let D;
|
|
1449
|
+
w ? (D = G(S.getSubForm()), D.push(v)) : D = v, S.subForm(D);
|
|
1448
1450
|
}
|
|
1449
1451
|
}
|
|
1450
|
-
},
|
|
1451
|
-
const
|
|
1452
|
-
if (
|
|
1452
|
+
}, x = () => {
|
|
1453
|
+
const S = Re(n, o);
|
|
1454
|
+
if (S)
|
|
1453
1455
|
if (w) {
|
|
1454
|
-
const
|
|
1455
|
-
B > -1 &&
|
|
1456
|
+
const D = G(S.getSubForm()), B = D.indexOf(v);
|
|
1457
|
+
B > -1 && D.splice(B, 1);
|
|
1456
1458
|
} else
|
|
1457
|
-
|
|
1459
|
+
S.subForm();
|
|
1458
1460
|
};
|
|
1459
1461
|
let V = null;
|
|
1460
|
-
|
|
1462
|
+
cr(() => {
|
|
1461
1463
|
L(() => {
|
|
1462
|
-
let
|
|
1463
|
-
const
|
|
1464
|
-
Object.keys(
|
|
1465
|
-
let
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
}),
|
|
1469
|
-
}), s.option && s.option.style && (
|
|
1464
|
+
let S = "";
|
|
1465
|
+
const D = s.option && s.option.globalClass || {};
|
|
1466
|
+
Object.keys(D).forEach((B) => {
|
|
1467
|
+
let se = "";
|
|
1468
|
+
D[B].style && Object.keys(D[B].style).forEach((be) => {
|
|
1469
|
+
se += ye(be) + ":" + D[B].style[be] + ";";
|
|
1470
|
+
}), D[B].content && (se += D[B].content + ";"), se && (S += `.${B}{${se}}`);
|
|
1471
|
+
}), s.option && s.option.style && (S += s.option.style), V || (V = document.createElement("style"), V.type = "text/css", document.head.appendChild(V)), V.innerHTML = S || "";
|
|
1470
1472
|
}, () => {
|
|
1471
1473
|
});
|
|
1472
1474
|
});
|
|
1473
|
-
const
|
|
1474
|
-
|
|
1475
|
-
}, 100),
|
|
1476
|
-
|
|
1477
|
-
}, 100),
|
|
1478
|
-
|
|
1475
|
+
const N = ce(() => {
|
|
1476
|
+
g.bus.$emit("$loadData.$topForm");
|
|
1477
|
+
}, 100), Ae = ce(() => {
|
|
1478
|
+
g.bus.$emit("$loadData.$form");
|
|
1479
|
+
}, 100), ve = (S) => {
|
|
1480
|
+
g.bus.$emit("change-$form." + S);
|
|
1479
1481
|
};
|
|
1480
|
-
return
|
|
1481
|
-
o && (v.top.bus.$on("$loadData.$form",
|
|
1482
|
-
}), hr(() => {
|
|
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();
|
|
1482
|
+
return hr(() => {
|
|
1483
|
+
o && (v.top.bus.$on("$loadData.$form", N), v.top.bus.$on("change", ve)), g.mounted();
|
|
1484
1484
|
}), dr(() => {
|
|
1485
|
-
|
|
1486
|
-
}),
|
|
1487
|
-
|
|
1488
|
-
}
|
|
1489
|
-
|
|
1485
|
+
o && (v.top.bus.$off("$loadData.$form", N), v.top.bus.$off("change", ve)), V && document.head.removeChild(V), x(), m.destroyed = !0, g.unmount();
|
|
1486
|
+
}), pr(() => {
|
|
1487
|
+
g.updated();
|
|
1488
|
+
}), L(f, (S) => {
|
|
1489
|
+
S ? I() : x();
|
|
1490
|
+
}, { immediate: !0 }), L(() => [...l.value], (S) => {
|
|
1491
|
+
g.$handle.isBreakWatch() || S.length === m.renderRule.length && S.every((D) => m.renderRule.indexOf(D) > -1) || (g.$handle.updateAppendData(), g.$handle.reloadRule(l.value), n.renderRule());
|
|
1490
1492
|
}), L(() => s.option, () => {
|
|
1491
|
-
|
|
1493
|
+
g.initOptions(), v.refresh();
|
|
1492
1494
|
}, { deep: !0 }), L(() => [s.disabled, s.preview], () => {
|
|
1493
1495
|
v.refresh();
|
|
1494
|
-
}), L(u, (
|
|
1495
|
-
JSON.stringify(
|
|
1496
|
+
}), L(u, (S) => {
|
|
1497
|
+
JSON.stringify(S || {}) !== m.updateValue && (v.config.forceCoverValue ? v.coverValue(S || {}) : v.setValue(S || {}));
|
|
1496
1498
|
}, { deep: !0, flush: "post" }), L(() => s.index, () => {
|
|
1497
|
-
v.coverValue({}),
|
|
1499
|
+
v.coverValue({}), g.$handle.updateAppendData(), P(() => {
|
|
1498
1500
|
P(() => {
|
|
1499
1501
|
v.clearValidateState();
|
|
1500
1502
|
});
|
|
1501
1503
|
});
|
|
1502
|
-
}, { flush: "sync" }),
|
|
1503
|
-
fc:
|
|
1504
|
-
parent: o &&
|
|
1505
|
-
top:
|
|
1506
|
-
fapi:
|
|
1507
|
-
}, lt(
|
|
1508
|
-
getGroupInject: () =>
|
|
1504
|
+
}, { flush: "sync" }), U(b({
|
|
1505
|
+
fc: de(g),
|
|
1506
|
+
parent: o && de(o),
|
|
1507
|
+
top: de(a),
|
|
1508
|
+
fapi: de(v)
|
|
1509
|
+
}, lt(m)), {
|
|
1510
|
+
getGroupInject: () => Re(n, o),
|
|
1509
1511
|
refresh() {
|
|
1510
|
-
++
|
|
1512
|
+
++m.unique;
|
|
1511
1513
|
},
|
|
1512
1514
|
renderRule() {
|
|
1513
|
-
|
|
1515
|
+
m.renderRule = [...l.value || []];
|
|
1514
1516
|
},
|
|
1515
|
-
updateValue(
|
|
1516
|
-
if (
|
|
1517
|
-
const
|
|
1518
|
-
|
|
1519
|
-
|
|
1517
|
+
updateValue(S) {
|
|
1518
|
+
if (m.destroyed) return;
|
|
1519
|
+
const D = JSON.stringify(S);
|
|
1520
|
+
m.updateValue !== D && (m.updateValue = D, n.$emit("update:value", S), P(() => {
|
|
1521
|
+
Ae(), o || N();
|
|
1520
1522
|
}));
|
|
1521
1523
|
}
|
|
1522
1524
|
});
|
|
@@ -1526,39 +1528,39 @@ function Nr(t, e, r) {
|
|
|
1526
1528
|
}
|
|
1527
1529
|
};
|
|
1528
1530
|
}
|
|
1529
|
-
const
|
|
1530
|
-
const i = [...
|
|
1531
|
+
const kt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style", "directives"], Dt = ["on", "nativeOn", "hook"], Z = (t, e = {}, r = {}) => {
|
|
1532
|
+
const i = [...kt, ...r.normal || []], s = [...Et, ...r.array || []], n = [...Dt, ...r.functional || []], o = r.props || [];
|
|
1531
1533
|
return t.reduce((a, l) => {
|
|
1532
1534
|
for (const u in l)
|
|
1533
1535
|
if (a[u])
|
|
1534
1536
|
if (o.indexOf(u) > -1)
|
|
1535
|
-
a[u] =
|
|
1537
|
+
a[u] = Z([l[u]], a[u]);
|
|
1536
1538
|
else if (i.indexOf(u) > -1)
|
|
1537
1539
|
a[u] = b(b({}, a[u]), l[u]);
|
|
1538
1540
|
else if (s.indexOf(u) > -1) {
|
|
1539
|
-
const f = a[u] instanceof Array ? a[u] : [a[u]],
|
|
1540
|
-
a[u] = [...f, ...
|
|
1541
|
+
const f = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1542
|
+
a[u] = [...f, ...d];
|
|
1541
1543
|
} else if (n.indexOf(u) > -1)
|
|
1542
1544
|
for (const f in l[u])
|
|
1543
1545
|
if (a[u][f]) {
|
|
1544
|
-
const
|
|
1545
|
-
a[u][f] = [...
|
|
1546
|
+
const d = a[u][f] instanceof Array ? a[u][f] : [a[u][f]], m = l[u][f] instanceof Array ? l[u][f] : [l[u][f]];
|
|
1547
|
+
a[u][f] = [...d, ...m];
|
|
1546
1548
|
} else
|
|
1547
1549
|
a[u][f] = l[u][f];
|
|
1548
1550
|
else if (u === "hook")
|
|
1549
1551
|
for (let f in l[u])
|
|
1550
|
-
a[u][f] ? a[u][f] =
|
|
1552
|
+
a[u][f] ? a[u][f] = Ur(a[u][f], l[u][f]) : a[u][f] = l[u][f];
|
|
1551
1553
|
else
|
|
1552
1554
|
a[u] = l[u];
|
|
1553
1555
|
else
|
|
1554
1556
|
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = b({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? b({}, l[u]) : l[u] : a[u] = l[u];
|
|
1555
1557
|
return a;
|
|
1556
1558
|
}, e);
|
|
1557
|
-
},
|
|
1559
|
+
}, Ur = (t, e) => function() {
|
|
1558
1560
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1559
1561
|
}, 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
1562
|
function It() {
|
|
1561
|
-
return [...jt, ...
|
|
1563
|
+
return [...jt, ...kt, ...Et, ...Dt, ...Ze, ...Ye];
|
|
1562
1564
|
}
|
|
1563
1565
|
function At(t, e, r) {
|
|
1564
1566
|
return `[form-create ${t}]: ${e}`;
|
|
@@ -1566,15 +1568,15 @@ function At(t, e, r) {
|
|
|
1566
1568
|
function xe(t, e) {
|
|
1567
1569
|
console.error(At("err", t));
|
|
1568
1570
|
}
|
|
1569
|
-
function
|
|
1571
|
+
function qr(t) {
|
|
1570
1572
|
xe(t.toString()), console.error(t);
|
|
1571
1573
|
}
|
|
1572
|
-
function
|
|
1574
|
+
function Gr(t) {
|
|
1573
1575
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
1574
1576
|
}
|
|
1575
1577
|
const We = "[[FORM-CREATE-PREFIX-", ze = "-FORM-CREATE-SUFFIX]]";
|
|
1576
1578
|
function et(t, e) {
|
|
1577
|
-
return JSON.stringify(
|
|
1579
|
+
return JSON.stringify($e(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1578
1580
|
if (!(i && i._isVue === !0)) {
|
|
1579
1581
|
if (typeof i != "function")
|
|
1580
1582
|
return i;
|
|
@@ -1585,7 +1587,7 @@ function et(t, e) {
|
|
|
1585
1587
|
}
|
|
1586
1588
|
}, e);
|
|
1587
1589
|
}
|
|
1588
|
-
function
|
|
1590
|
+
function Le(t) {
|
|
1589
1591
|
return new Function("return " + t)();
|
|
1590
1592
|
}
|
|
1591
1593
|
function W(t, e) {
|
|
@@ -1607,15 +1609,15 @@ function W(t, e) {
|
|
|
1607
1609
|
}, r.__json = t, r.__inject = !0, r;
|
|
1608
1610
|
} else {
|
|
1609
1611
|
if (r.indexOf("$FNX:") === 0)
|
|
1610
|
-
return r =
|
|
1612
|
+
return r = Le("function($inject){" + r.substring(5) + "}"), r.__json = t, r.__inject = !0, r;
|
|
1611
1613
|
(!e && r.indexOf("function ") === 0 && r !== "function " || !e && r.indexOf("function(") === 0 && r !== "function(") && (i = !0);
|
|
1612
1614
|
}
|
|
1613
1615
|
if (!i) return t;
|
|
1614
1616
|
let s;
|
|
1615
1617
|
try {
|
|
1616
|
-
s =
|
|
1618
|
+
s = Le(r);
|
|
1617
1619
|
} catch (n) {
|
|
1618
|
-
s =
|
|
1620
|
+
s = Le("function " + r);
|
|
1619
1621
|
}
|
|
1620
1622
|
return s.__json = t, s;
|
|
1621
1623
|
} catch (s) {
|
|
@@ -1632,16 +1634,16 @@ function Vt(t, e) {
|
|
|
1632
1634
|
return h.Undef(i) || !i.indexOf ? i : W(i, e);
|
|
1633
1635
|
});
|
|
1634
1636
|
}
|
|
1635
|
-
let
|
|
1636
|
-
function
|
|
1637
|
-
const t = 370 + ++
|
|
1637
|
+
let Hr = 0;
|
|
1638
|
+
function Ie() {
|
|
1639
|
+
const t = 370 + ++Hr;
|
|
1638
1640
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
1639
1641
|
}
|
|
1640
|
-
function
|
|
1642
|
+
function ie(t, e, r) {
|
|
1641
1643
|
let i = t, s;
|
|
1642
1644
|
return (e || "").split(".").forEach((n) => {
|
|
1643
|
-
s && ((!i[s] || typeof i[s] != "object") &&
|
|
1644
|
-
}),
|
|
1645
|
+
s && ((!i[s] || typeof i[s] != "object") && F(i, s, {}), i = i[s]), s = n;
|
|
1646
|
+
}), F(i, s, r), i;
|
|
1645
1647
|
}
|
|
1646
1648
|
function Ke(t, e) {
|
|
1647
1649
|
return {
|
|
@@ -1655,18 +1657,18 @@ function Pt(t, e) {
|
|
|
1655
1657
|
return Bt([t], e || !1)[0];
|
|
1656
1658
|
}
|
|
1657
1659
|
function Bt(t, e) {
|
|
1658
|
-
return
|
|
1660
|
+
return $e([], [...t], e || !1);
|
|
1659
1661
|
}
|
|
1660
|
-
function
|
|
1661
|
-
return
|
|
1662
|
+
function Y(t, e) {
|
|
1663
|
+
return Z(Array.isArray(e) ? e : [e], t, { array: Ze, normal: Ye }), t;
|
|
1662
1664
|
}
|
|
1663
1665
|
function ct(t) {
|
|
1664
1666
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1665
1667
|
return e.type || (e.type = "input"), e;
|
|
1666
1668
|
}
|
|
1667
|
-
function
|
|
1669
|
+
function Jr(t, e) {
|
|
1668
1670
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1669
|
-
e[r] && (t[r] =
|
|
1671
|
+
e[r] && (t[r] = Y(t[r] || {}, e[r]));
|
|
1670
1672
|
}), t) : e;
|
|
1671
1673
|
}
|
|
1672
1674
|
function Lt(t, e) {
|
|
@@ -1676,26 +1678,26 @@ function Lt(t, e) {
|
|
|
1676
1678
|
}
|
|
1677
1679
|
}, r), {}));
|
|
1678
1680
|
}
|
|
1679
|
-
function
|
|
1681
|
+
function Q(t) {
|
|
1680
1682
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1681
1683
|
}
|
|
1682
|
-
function
|
|
1684
|
+
function O(t, e) {
|
|
1683
1685
|
try {
|
|
1684
1686
|
e = t();
|
|
1685
1687
|
} catch (r) {
|
|
1686
|
-
|
|
1688
|
+
qr(r);
|
|
1687
1689
|
}
|
|
1688
1690
|
return e;
|
|
1689
1691
|
}
|
|
1690
1692
|
function Xe(t, e) {
|
|
1691
1693
|
let r = null;
|
|
1692
|
-
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e &&
|
|
1694
|
+
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e && G(r).forEach((i) => {
|
|
1693
1695
|
(Array.isArray(i) ? i : [i]).forEach((n) => {
|
|
1694
1696
|
n && typeof n == "object" && (n.data || (n.data = {}), (!n.data.slot || n.data.slot === "default") && (n.data.slot = e || "default"));
|
|
1695
1697
|
});
|
|
1696
1698
|
}), r;
|
|
1697
1699
|
}
|
|
1698
|
-
function
|
|
1700
|
+
function Wr(t, e) {
|
|
1699
1701
|
if (h.Object(t)) {
|
|
1700
1702
|
const r = {};
|
|
1701
1703
|
return Object.keys(t).forEach((i) => {
|
|
@@ -1704,7 +1706,7 @@ function Jr(t, e) {
|
|
|
1704
1706
|
} else
|
|
1705
1707
|
return Xe(t, e);
|
|
1706
1708
|
}
|
|
1707
|
-
function
|
|
1709
|
+
function Oe() {
|
|
1708
1710
|
const t = {}, e = (r) => r || "default";
|
|
1709
1711
|
return {
|
|
1710
1712
|
setSlot(r, i) {
|
|
@@ -1720,7 +1722,7 @@ function Le() {
|
|
|
1720
1722
|
const n = s();
|
|
1721
1723
|
Array.isArray(n) ? i.push(...n) : i.push(n);
|
|
1722
1724
|
} else h.Undef(s) || i.push(s);
|
|
1723
|
-
}),
|
|
1725
|
+
}), Wr(i, r);
|
|
1724
1726
|
},
|
|
1725
1727
|
getSlots() {
|
|
1726
1728
|
let r = [];
|
|
@@ -1740,12 +1742,12 @@ function Le() {
|
|
|
1740
1742
|
}
|
|
1741
1743
|
};
|
|
1742
1744
|
}
|
|
1743
|
-
function
|
|
1745
|
+
function Se(t, e) {
|
|
1744
1746
|
return Object.setPrototypeOf(t, e), t;
|
|
1745
1747
|
}
|
|
1746
|
-
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e,
|
|
1748
|
+
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, fe = {
|
|
1747
1749
|
"==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
|
|
1748
|
-
"!=": (t, e) => !
|
|
1750
|
+
"!=": (t, e) => !fe["=="](t, e),
|
|
1749
1751
|
">": (t, e) => t > e,
|
|
1750
1752
|
">=": (t, e) => t >= e,
|
|
1751
1753
|
"<": (t, e) => t < e,
|
|
@@ -1754,13 +1756,13 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1754
1756
|
return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
|
|
1755
1757
|
},
|
|
1756
1758
|
notOn(t, e) {
|
|
1757
|
-
return !
|
|
1759
|
+
return !fe.on(t, e);
|
|
1758
1760
|
},
|
|
1759
1761
|
in(t, e) {
|
|
1760
1762
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1761
1763
|
},
|
|
1762
1764
|
notIn(t, e) {
|
|
1763
|
-
return !
|
|
1765
|
+
return !fe.in(t, e);
|
|
1764
1766
|
},
|
|
1765
1767
|
between(t, e) {
|
|
1766
1768
|
return t > e[0] && t < e[1];
|
|
@@ -1778,12 +1780,12 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1778
1780
|
return new RegExp(e, "g").test(t);
|
|
1779
1781
|
}
|
|
1780
1782
|
};
|
|
1781
|
-
function
|
|
1783
|
+
function T(t, e) {
|
|
1782
1784
|
return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => {
|
|
1783
1785
|
t != null && (t = t[r]);
|
|
1784
1786
|
}), t;
|
|
1785
1787
|
}
|
|
1786
|
-
function
|
|
1788
|
+
function zr(t) {
|
|
1787
1789
|
const e = /{{\s*(.*?)\s*}}/g;
|
|
1788
1790
|
let r;
|
|
1789
1791
|
const i = {};
|
|
@@ -1823,7 +1825,7 @@ _(tt.prototype, {
|
|
|
1823
1825
|
return this._data;
|
|
1824
1826
|
},
|
|
1825
1827
|
setProp(t, e) {
|
|
1826
|
-
return
|
|
1828
|
+
return F(this._data, t, e), this;
|
|
1827
1829
|
},
|
|
1828
1830
|
_clone() {
|
|
1829
1831
|
const t = new this.constructor();
|
|
@@ -1833,13 +1835,13 @@ _(tt.prototype, {
|
|
|
1833
1835
|
function Nt(t) {
|
|
1834
1836
|
t.forEach((e) => {
|
|
1835
1837
|
tt.prototype[e] = function(r) {
|
|
1836
|
-
return
|
|
1838
|
+
return Y(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1837
1839
|
};
|
|
1838
1840
|
});
|
|
1839
1841
|
}
|
|
1840
1842
|
Nt(It());
|
|
1841
1843
|
const Mt = A("");
|
|
1842
|
-
function
|
|
1844
|
+
function Kr(t, e, r) {
|
|
1843
1845
|
let i = Mt("", e);
|
|
1844
1846
|
return i._data.type = t, i._data.title = r, i;
|
|
1845
1847
|
}
|
|
@@ -1847,15 +1849,15 @@ function pt(t, e, r, i) {
|
|
|
1847
1849
|
let s = Mt("", r);
|
|
1848
1850
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1849
1851
|
}
|
|
1850
|
-
function
|
|
1852
|
+
function Xr() {
|
|
1851
1853
|
return {
|
|
1852
|
-
create:
|
|
1854
|
+
create: Kr,
|
|
1853
1855
|
createTmp: pt,
|
|
1854
1856
|
template: pt,
|
|
1855
1857
|
factory: A
|
|
1856
1858
|
};
|
|
1857
1859
|
}
|
|
1858
|
-
function
|
|
1860
|
+
function Qr(t, e, r) {
|
|
1859
1861
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1860
1862
|
return s.status = r.status, s.url = t, s;
|
|
1861
1863
|
}
|
|
@@ -1878,13 +1880,13 @@ function Ut(t) {
|
|
|
1878
1880
|
n.percent = n.total > 0 ? n.loaded / n.total * 100 : 0, t.onProgress(n);
|
|
1879
1881
|
}), t.query) {
|
|
1880
1882
|
const n = new URLSearchParams(t.query).toString();
|
|
1881
|
-
r.includes("?") ? r += `&${n}` : r += `?${n}
|
|
1883
|
+
n && (r.includes("?") ? r += `&${n}` : r += `?${n}`);
|
|
1882
1884
|
}
|
|
1883
1885
|
e.onerror = function(o) {
|
|
1884
1886
|
t.onError(o);
|
|
1885
1887
|
}, e.onload = function() {
|
|
1886
1888
|
if (e.status < 200 || e.status >= 300)
|
|
1887
|
-
return t.onError(
|
|
1889
|
+
return t.onError(Qr(r, t, e), mt(e));
|
|
1888
1890
|
t.onSuccess(mt(e));
|
|
1889
1891
|
}, e.open(t.method || "get", r, !0);
|
|
1890
1892
|
let i;
|
|
@@ -1898,11 +1900,11 @@ function Ut(t) {
|
|
|
1898
1900
|
}
|
|
1899
1901
|
function gt(t, e, r) {
|
|
1900
1902
|
return new Promise((i, s) => {
|
|
1901
|
-
(e || Ut)(
|
|
1903
|
+
(e || Ut)(U(b({}, t), {
|
|
1902
1904
|
onSuccess(n) {
|
|
1903
1905
|
let o = (l) => l;
|
|
1904
1906
|
const a = W(t.parse);
|
|
1905
|
-
h.Function(a) ? o = a : a && h.String(a) && (o = (l) =>
|
|
1907
|
+
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => T(l, a)), i(o(n, void 0, r));
|
|
1906
1908
|
},
|
|
1907
1909
|
onError(n) {
|
|
1908
1910
|
s(n);
|
|
@@ -1910,17 +1912,17 @@ function gt(t, e, r) {
|
|
|
1910
1912
|
}));
|
|
1911
1913
|
});
|
|
1912
1914
|
}
|
|
1913
|
-
function
|
|
1915
|
+
function ge(t) {
|
|
1914
1916
|
return J(t);
|
|
1915
1917
|
}
|
|
1916
|
-
function
|
|
1918
|
+
function Zr(t) {
|
|
1917
1919
|
function e(n) {
|
|
1918
1920
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1919
1921
|
}
|
|
1920
1922
|
function r(n, o, a) {
|
|
1921
1923
|
e(n).forEach((l) => {
|
|
1922
1924
|
t.getCtxs(l).forEach((u) => {
|
|
1923
|
-
|
|
1925
|
+
F(u.rule, o, a), t.$render.clearCache(u);
|
|
1924
1926
|
});
|
|
1925
1927
|
});
|
|
1926
1928
|
}
|
|
@@ -1978,14 +1980,14 @@ function Qr(t) {
|
|
|
1978
1980
|
if (n == null) {
|
|
1979
1981
|
const o = {};
|
|
1980
1982
|
return Object.keys(t.form).forEach((a) => {
|
|
1981
|
-
t.ignoreFields.indexOf(a) === -1 && (o[a] =
|
|
1983
|
+
t.ignoreFields.indexOf(a) === -1 && (o[a] = ge(t.form[a]));
|
|
1982
1984
|
}), o;
|
|
1983
1985
|
} else
|
|
1984
1986
|
return e(n).reduce((o, a) => (o[a] = s.getValue(a), o), {});
|
|
1985
1987
|
},
|
|
1986
1988
|
getValue(n) {
|
|
1987
1989
|
const o = t.getFieldCtx(n);
|
|
1988
|
-
return o ?
|
|
1990
|
+
return o ? ge(o.rule.value) : t.options.appendValue !== !1 && k(t.appendData, n) ? ge(t.appendData[n]) : void 0;
|
|
1989
1991
|
},
|
|
1990
1992
|
coverValue(n) {
|
|
1991
1993
|
const o = b({}, n || {});
|
|
@@ -2022,7 +2024,7 @@ function Qr(t) {
|
|
|
2022
2024
|
}, !0), o ? o.origin : void 0;
|
|
2023
2025
|
},
|
|
2024
2026
|
removeRule(n) {
|
|
2025
|
-
const o = n &&
|
|
2027
|
+
const o = n && Q(n);
|
|
2026
2028
|
if (o)
|
|
2027
2029
|
return o.rm(), o.origin;
|
|
2028
2030
|
},
|
|
@@ -2072,7 +2074,7 @@ function Qr(t) {
|
|
|
2072
2074
|
disabled(n, o) {
|
|
2073
2075
|
e(o).forEach((a) => {
|
|
2074
2076
|
t.getCtxs(a).forEach((l) => {
|
|
2075
|
-
|
|
2077
|
+
F(l.rule.props, "disabled", !!n);
|
|
2076
2078
|
});
|
|
2077
2079
|
}), t.refresh();
|
|
2078
2080
|
},
|
|
@@ -2111,7 +2113,7 @@ function Qr(t) {
|
|
|
2111
2113
|
n.forEach((a) => s.sync(a));
|
|
2112
2114
|
return;
|
|
2113
2115
|
}
|
|
2114
|
-
let o = h.Object(n) ?
|
|
2116
|
+
let o = h.Object(n) ? Q(n) : t.getCtxs(n);
|
|
2115
2117
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2116
2118
|
if (!a.deleted) {
|
|
2117
2119
|
const l = t.subForm[a.id];
|
|
@@ -2130,7 +2132,7 @@ function Qr(t) {
|
|
|
2130
2132
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2131
2133
|
},
|
|
2132
2134
|
hideForm: (n) => {
|
|
2133
|
-
|
|
2135
|
+
F(t.vm, "isShow", !n);
|
|
2134
2136
|
},
|
|
2135
2137
|
changeStatus: () => t.changeStatus,
|
|
2136
2138
|
clearChangeStatus: () => {
|
|
@@ -2148,7 +2150,7 @@ function Qr(t) {
|
|
|
2148
2150
|
},
|
|
2149
2151
|
mergeRule: (n, o) => {
|
|
2150
2152
|
t.getCtxs(n).forEach((a) => {
|
|
2151
|
-
|
|
2153
|
+
Y(a.rule, o);
|
|
2152
2154
|
});
|
|
2153
2155
|
},
|
|
2154
2156
|
mergeRules(n) {
|
|
@@ -2175,7 +2177,7 @@ function Qr(t) {
|
|
|
2175
2177
|
},
|
|
2176
2178
|
setEffect(n, o, a) {
|
|
2177
2179
|
const l = t.getCtx(n);
|
|
2178
|
-
l && o && (o[0] === "$" && (o = o.substr(1)), k(l.rule, "$" + o) &&
|
|
2180
|
+
l && o && (o[0] === "$" && (o = o.substr(1)), k(l.rule, "$" + o) && F(l.rule, "$" + o, a), k(l.rule, "effect") || F(l.rule, "effect", {}), F(l.rule.effect, o, a));
|
|
2179
2181
|
},
|
|
2180
2182
|
clearEffectData(n, o) {
|
|
2181
2183
|
const a = t.getCtx(n);
|
|
@@ -2195,7 +2197,7 @@ function Qr(t) {
|
|
|
2195
2197
|
resetFields(n) {
|
|
2196
2198
|
e(n).forEach((o) => {
|
|
2197
2199
|
t.getCtxs(o).forEach((a) => {
|
|
2198
|
-
t.$render.clearCache(a), a.rule.value =
|
|
2200
|
+
t.$render.clearCache(a), a.rule.value = ge(a.defaultValue);
|
|
2199
2201
|
});
|
|
2200
2202
|
}), P(() => {
|
|
2201
2203
|
P(() => {
|
|
@@ -2203,7 +2205,7 @@ function Qr(t) {
|
|
|
2203
2205
|
s.clearValidateState(n);
|
|
2204
2206
|
});
|
|
2205
2207
|
});
|
|
2206
|
-
}), n == null && (h.Function(t.options.onReset) &&
|
|
2208
|
+
}), n == null && (h.Function(t.options.onReset) && O(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
2207
2209
|
},
|
|
2208
2210
|
method(n, o) {
|
|
2209
2211
|
const a = s.el(n);
|
|
@@ -2212,7 +2214,7 @@ function Qr(t) {
|
|
|
2212
2214
|
return (...l) => a[o](...l);
|
|
2213
2215
|
},
|
|
2214
2216
|
exec(n, o, ...a) {
|
|
2215
|
-
return
|
|
2217
|
+
return O(() => s.method(n, o)(...a));
|
|
2216
2218
|
},
|
|
2217
2219
|
toJson(n) {
|
|
2218
2220
|
return et(s.rule, n);
|
|
@@ -2234,21 +2236,21 @@ function Qr(t) {
|
|
|
2234
2236
|
return o ? t.subForm[o.id] : void 0;
|
|
2235
2237
|
},
|
|
2236
2238
|
getChildrenRuleList(n) {
|
|
2237
|
-
const o = typeof n == "object", a = o ?
|
|
2239
|
+
const o = typeof n == "object", a = o ? Q(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
|
|
2238
2240
|
if (!l)
|
|
2239
2241
|
return [];
|
|
2240
2242
|
const u = [];
|
|
2241
|
-
return ((
|
|
2242
|
-
|
|
2243
|
-
typeof
|
|
2243
|
+
return ((d) => {
|
|
2244
|
+
d && d.forEach((m) => {
|
|
2245
|
+
typeof m == "object" && (m.field && u.push(m), u.push(...s.getChildrenRuleList(m)));
|
|
2244
2246
|
});
|
|
2245
2247
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2246
2248
|
},
|
|
2247
2249
|
getParentRule(n) {
|
|
2248
|
-
return (typeof n == "object" ?
|
|
2250
|
+
return (typeof n == "object" ? Q(n) : t.getCtx(n)).parent.rule;
|
|
2249
2251
|
},
|
|
2250
2252
|
getParentSubRule(n) {
|
|
2251
|
-
const a = typeof n == "object" ?
|
|
2253
|
+
const a = typeof n == "object" ? Q(n) : t.getCtx(n);
|
|
2252
2254
|
if (a) {
|
|
2253
2255
|
const l = a.getParentGroup();
|
|
2254
2256
|
if (l)
|
|
@@ -2256,7 +2258,7 @@ function Qr(t) {
|
|
|
2256
2258
|
}
|
|
2257
2259
|
},
|
|
2258
2260
|
getChildrenFormData(n) {
|
|
2259
|
-
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] =
|
|
2261
|
+
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] = ge(l.value), a), {});
|
|
2260
2262
|
},
|
|
2261
2263
|
setChildrenFormData(n, o, a) {
|
|
2262
2264
|
const l = s.getChildrenRuleList(n);
|
|
@@ -2279,11 +2281,19 @@ function Qr(t) {
|
|
|
2279
2281
|
}).catch(a) : o(l.data);
|
|
2280
2282
|
});
|
|
2281
2283
|
},
|
|
2284
|
+
renderRule(n, o, a) {
|
|
2285
|
+
const u = typeof n == "object" ? Q(n) : t.getCtx(n);
|
|
2286
|
+
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2287
|
+
},
|
|
2288
|
+
renderChildren(n, o, a) {
|
|
2289
|
+
const u = typeof n == "object" ? Q(n) : t.getCtx(n);
|
|
2290
|
+
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2291
|
+
},
|
|
2282
2292
|
nextTick(n) {
|
|
2283
2293
|
t.bus.$once("next-tick", n), t.refresh();
|
|
2284
2294
|
},
|
|
2285
2295
|
nextRefresh(n) {
|
|
2286
|
-
t.nextRefresh(), n &&
|
|
2296
|
+
t.nextRefresh(), n && O(n);
|
|
2287
2297
|
},
|
|
2288
2298
|
emit(n, ...o) {
|
|
2289
2299
|
t.vm.$emit(n, ...o);
|
|
@@ -2295,19 +2305,19 @@ function Qr(t) {
|
|
|
2295
2305
|
fetch(n) {
|
|
2296
2306
|
return new Promise((o, a) => {
|
|
2297
2307
|
n = J(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
2298
|
-
|
|
2308
|
+
O(() => n.onSuccess && n.onSuccess(l)), o(l);
|
|
2299
2309
|
}).catch((l) => {
|
|
2300
|
-
|
|
2310
|
+
O(() => n.onError && n.onError(l)), a(l);
|
|
2301
2311
|
}));
|
|
2302
2312
|
});
|
|
2303
2313
|
},
|
|
2304
2314
|
watchFetch(n, o, a, l) {
|
|
2305
2315
|
return t.fc.watchLoadData((u, f) => {
|
|
2306
|
-
let
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
}).catch((
|
|
2310
|
-
|
|
2316
|
+
let d = J(n);
|
|
2317
|
+
d = t.loadFetchVar(d, u), !(l && l(d, f) === !1) && t.beforeFetch(d).then(() => gt(d, t.fc.create.fetch, s).then((m) => {
|
|
2318
|
+
O(() => d.onSuccess && d.onSuccess(m)), o && o(m, f);
|
|
2319
|
+
}).catch((m) => {
|
|
2320
|
+
O(() => d.onError && d.onError(m)), a && a(m);
|
|
2311
2321
|
}));
|
|
2312
2322
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2313
2323
|
},
|
|
@@ -2337,7 +2347,7 @@ function Qr(t) {
|
|
|
2337
2347
|
};
|
|
2338
2348
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2339
2349
|
}
|
|
2340
|
-
function
|
|
2350
|
+
function Yr(t) {
|
|
2341
2351
|
_(t.prototype, {
|
|
2342
2352
|
initCache() {
|
|
2343
2353
|
this.clearCacheAll();
|
|
@@ -2369,7 +2379,7 @@ function Zr(t) {
|
|
|
2369
2379
|
}
|
|
2370
2380
|
});
|
|
2371
2381
|
}
|
|
2372
|
-
function
|
|
2382
|
+
function q(t) {
|
|
2373
2383
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2374
2384
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2375
2385
|
});
|
|
@@ -2378,7 +2388,7 @@ function G(t) {
|
|
|
2378
2388
|
function qt(t) {
|
|
2379
2389
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2380
2390
|
}
|
|
2381
|
-
function
|
|
2391
|
+
function xr(t) {
|
|
2382
2392
|
_(t.prototype, {
|
|
2383
2393
|
initRender() {
|
|
2384
2394
|
this.cacheConfig = {};
|
|
@@ -2387,7 +2397,7 @@ function Yr(t) {
|
|
|
2387
2397
|
const r = (i) => {
|
|
2388
2398
|
if (i) {
|
|
2389
2399
|
let s;
|
|
2390
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2400
|
+
return e.rule.field && (s = i.$scopedSlots["field-" + ye(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + ye(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2391
2401
|
}
|
|
2392
2402
|
};
|
|
2393
2403
|
return r(this.vm);
|
|
@@ -2396,7 +2406,7 @@ function Yr(t) {
|
|
|
2396
2406
|
if (!this.vm.isShow)
|
|
2397
2407
|
return;
|
|
2398
2408
|
this.$manager.beforeRender();
|
|
2399
|
-
const e =
|
|
2409
|
+
const e = Oe();
|
|
2400
2410
|
return this.sort.forEach((r) => {
|
|
2401
2411
|
this.renderSlot(e, this.$handle.ctxs[r]);
|
|
2402
2412
|
}), this.$manager.render(e);
|
|
@@ -2407,23 +2417,23 @@ function Yr(t) {
|
|
|
2407
2417
|
})) : e.setSlot(r.rule.slot, this.renderCtx(r, i));
|
|
2408
2418
|
},
|
|
2409
2419
|
mergeGlobal(e) {
|
|
2410
|
-
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] =
|
|
2420
|
+
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] = pe(() => {
|
|
2411
2421
|
const i = this.$handle.options.global;
|
|
2412
|
-
return
|
|
2413
|
-
})), e.prop =
|
|
2422
|
+
return Y({}, [i["*"] || i.default || {}, i[e.originType] || i[e.type] || i[e.type] || {}]);
|
|
2423
|
+
})), e.prop = Y({}, [this.cacheConfig[e.trueType].value, e.prop]));
|
|
2414
2424
|
},
|
|
2415
2425
|
setOptions(e) {
|
|
2416
2426
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
2417
|
-
e.prop.options = r, e.prop.optionsTo && r &&
|
|
2427
|
+
e.prop.options = r, e.prop.optionsTo && r && ie(e.prop, e.prop.optionsTo, r);
|
|
2418
2428
|
},
|
|
2419
2429
|
deepSet(e) {
|
|
2420
2430
|
const r = e.rule.deep;
|
|
2421
2431
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2422
|
-
|
|
2432
|
+
ie(e.prop, i, r[i]);
|
|
2423
2433
|
});
|
|
2424
2434
|
},
|
|
2425
2435
|
parseSide(e, r) {
|
|
2426
|
-
return h.Object(e) ?
|
|
2436
|
+
return h.Object(e) ? Y({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2427
2437
|
},
|
|
2428
2438
|
renderSides(e, r, i) {
|
|
2429
2439
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2437,7 +2447,7 @@ function Yr(t) {
|
|
|
2437
2447
|
try {
|
|
2438
2448
|
if (e.type === "hidden") return;
|
|
2439
2449
|
const i = e.rule;
|
|
2440
|
-
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2450
|
+
if (this.force || !this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2441
2451
|
let s;
|
|
2442
2452
|
e.initProp(), this.mergeGlobal(e), e.initNone(), this.$manager.tidyRule(e), this.deepSet(e), this.setOptions(e), this.ctxProp(e);
|
|
2443
2453
|
let n = e.prop;
|
|
@@ -2457,21 +2467,23 @@ function Yr(t) {
|
|
|
2457
2467
|
model: n.model || {},
|
|
2458
2468
|
slotValue: l
|
|
2459
2469
|
};
|
|
2460
|
-
l.length && i.slotUpdate &&
|
|
2470
|
+
l.length && i.slotUpdate && O(() => i.slotUpdate(u));
|
|
2461
2471
|
let f = [];
|
|
2462
|
-
const
|
|
2463
|
-
e.parser.renderChildren ? f = e.parser.renderChildren(
|
|
2472
|
+
const d = e.loadChildrenPending();
|
|
2473
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach((v) => {
|
|
2464
2474
|
f.push(this.renderRule({
|
|
2465
2475
|
type: "template",
|
|
2466
2476
|
slot: v
|
|
2467
2477
|
}, (() => {
|
|
2478
|
+
if (h.Function(n.renderSlots[v]))
|
|
2479
|
+
return O(() => n.renderSlots[v]());
|
|
2468
2480
|
const w = this.parseSide(n.renderSlots[v], e);
|
|
2469
2481
|
return this.renderRule(w);
|
|
2470
2482
|
})()));
|
|
2471
2483
|
});
|
|
2472
|
-
const
|
|
2473
|
-
let
|
|
2474
|
-
return
|
|
2484
|
+
const m = this.getTypeSlot(e);
|
|
2485
|
+
let g;
|
|
2486
|
+
return m ? (u.children = f, g = m(u)) : g = a ? e.parser.preview(Je(f), e) : e.parser.render(Je(f), e), g = this.renderSides(g, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), g = this.$manager.makeWrap(e, g)), e.none && (Array.isArray(g) ? g = g.map((v) => !v || !v.tag ? v : this.none(v)) : g = this.none(g)), o && this.setCache(e, () => this.stable(g), r), g;
|
|
2475
2487
|
}, this.setCache(e, s, r);
|
|
2476
2488
|
}
|
|
2477
2489
|
return (...s) => {
|
|
@@ -2565,17 +2577,21 @@ function Yr(t) {
|
|
|
2565
2577
|
}
|
|
2566
2578
|
}
|
|
2567
2579
|
];
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
this.
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2580
|
+
if (e.input) {
|
|
2581
|
+
const o = this.tmpInput;
|
|
2582
|
+
this.vm.$props.disabled === !0 && (e.prop.props.disabled = !0), e.prop.model = {
|
|
2583
|
+
value: this.$handle.getFormData(e),
|
|
2584
|
+
callback: (a) => {
|
|
2585
|
+
o && o(e.field, a, e.rule), this.onInput(e, a);
|
|
2586
|
+
},
|
|
2587
|
+
expression: `formData.${e.id}`
|
|
2588
|
+
}, e.prop.modelEmit && n.push({
|
|
2589
|
+
on: {
|
|
2590
|
+
[e.prop.modelEmit]: () => this.onEmitInput(e)
|
|
2591
|
+
}
|
|
2592
|
+
});
|
|
2593
|
+
}
|
|
2594
|
+
return Z(n, e.prop), e.prop;
|
|
2579
2595
|
},
|
|
2580
2596
|
onMounted(e) {
|
|
2581
2597
|
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");
|
|
@@ -2592,7 +2608,7 @@ function Yr(t) {
|
|
|
2592
2608
|
},
|
|
2593
2609
|
renderChildren(e, r, i) {
|
|
2594
2610
|
if (!h.trueArray(e)) return [];
|
|
2595
|
-
const s =
|
|
2611
|
+
const s = Oe();
|
|
2596
2612
|
return e.map((n) => {
|
|
2597
2613
|
if (n) {
|
|
2598
2614
|
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
@@ -2611,6 +2627,16 @@ function Yr(t) {
|
|
|
2611
2627
|
const i = e.prop;
|
|
2612
2628
|
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);
|
|
2613
2629
|
},
|
|
2630
|
+
createChildrenVnodes(e, r, i) {
|
|
2631
|
+
this.force = i !== !1, this.tmpInput = r;
|
|
2632
|
+
const s = this.renderChildren(e.rule.children, e);
|
|
2633
|
+
return this.force = !1, this.tmpInput = null, s;
|
|
2634
|
+
},
|
|
2635
|
+
createRuleVnode(e, r, i) {
|
|
2636
|
+
this.force = i !== !1, this.tmpInput = r;
|
|
2637
|
+
const s = Oe();
|
|
2638
|
+
return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
|
|
2639
|
+
},
|
|
2614
2640
|
renderRule(e, r, i) {
|
|
2615
2641
|
if (!e) return;
|
|
2616
2642
|
if (h.String(e)) return e;
|
|
@@ -2618,12 +2644,12 @@ function Yr(t) {
|
|
|
2618
2644
|
if (i)
|
|
2619
2645
|
s = e.type;
|
|
2620
2646
|
else if (s = e.is, e.type) {
|
|
2621
|
-
s =
|
|
2647
|
+
s = q(e.type);
|
|
2622
2648
|
const a = this.vNode.aliasMap[s];
|
|
2623
|
-
a && (s =
|
|
2649
|
+
a && (s = q(a));
|
|
2624
2650
|
}
|
|
2625
2651
|
if (!s) return;
|
|
2626
|
-
const n =
|
|
2652
|
+
const n = Oe();
|
|
2627
2653
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2628
2654
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2629
2655
|
});
|
|
@@ -2632,7 +2658,7 @@ function Yr(t) {
|
|
|
2632
2658
|
}
|
|
2633
2659
|
});
|
|
2634
2660
|
}
|
|
2635
|
-
let
|
|
2661
|
+
let ei = 1;
|
|
2636
2662
|
function rt(t) {
|
|
2637
2663
|
_(this, {
|
|
2638
2664
|
$handle: t,
|
|
@@ -2640,7 +2666,9 @@ function rt(t) {
|
|
|
2640
2666
|
vm: t.vm,
|
|
2641
2667
|
$manager: t.$manager,
|
|
2642
2668
|
vNode: new t.fc.CreateNode(t.vm),
|
|
2643
|
-
|
|
2669
|
+
force: !1,
|
|
2670
|
+
tmpInput: null,
|
|
2671
|
+
id: ei++
|
|
2644
2672
|
}), Lt(this, {
|
|
2645
2673
|
options() {
|
|
2646
2674
|
return t.options;
|
|
@@ -2650,9 +2678,9 @@ function rt(t) {
|
|
|
2650
2678
|
}
|
|
2651
2679
|
}), this.initCache(), this.initRender();
|
|
2652
2680
|
}
|
|
2653
|
-
Zr(rt);
|
|
2654
2681
|
Yr(rt);
|
|
2655
|
-
|
|
2682
|
+
xr(rt);
|
|
2683
|
+
function ti(t) {
|
|
2656
2684
|
_(t.prototype, {
|
|
2657
2685
|
parseInjectEvent(e, r) {
|
|
2658
2686
|
const i = e.inject || this.options.injectEvent;
|
|
@@ -2679,16 +2707,16 @@ function ei(t) {
|
|
|
2679
2707
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2680
2708
|
return h.trueArray(u) && u.forEach((f) => {
|
|
2681
2709
|
if (!f) return;
|
|
2682
|
-
let
|
|
2683
|
-
if (h.Object(f) && (
|
|
2684
|
-
r || (
|
|
2685
|
-
const
|
|
2686
|
-
this.vm.$emit(
|
|
2710
|
+
let d, m = n || o || a;
|
|
2711
|
+
if (h.Object(f) && (d = f.inject, f = f.name, m = f.prefix || m), m) {
|
|
2712
|
+
r || (m = `native-${m}`);
|
|
2713
|
+
const g = ye(`${m}-${f}`), v = (...w) => {
|
|
2714
|
+
this.vm.$emit(g, ...w), this.vm.$emit("emit-event", g, ...w), this.bus.$emit(g, ...w);
|
|
2687
2715
|
};
|
|
2688
|
-
if (v.__emit = !0, !
|
|
2716
|
+
if (v.__emit = !0, !d && l === !1)
|
|
2689
2717
|
i[f] = v;
|
|
2690
2718
|
else {
|
|
2691
|
-
let w =
|
|
2719
|
+
let w = d || l || this.options.injectEvent;
|
|
2692
2720
|
i[f] = h.Undef(w) ? v : this.inject(s, v, w);
|
|
2693
2721
|
}
|
|
2694
2722
|
}
|
|
@@ -2717,41 +2745,51 @@ function ei(t) {
|
|
|
2717
2745
|
};
|
|
2718
2746
|
return n.__origin = r, n.__json = r.__json, n;
|
|
2719
2747
|
},
|
|
2720
|
-
loadStrVar(e, r) {
|
|
2748
|
+
loadStrVar(e, r, i) {
|
|
2721
2749
|
if (e && typeof e == "string" && e.indexOf("{{") > -1 && e.indexOf("}}") > -1) {
|
|
2722
|
-
const
|
|
2723
|
-
let
|
|
2724
|
-
if (
|
|
2725
|
-
const
|
|
2726
|
-
if (
|
|
2727
|
-
const
|
|
2728
|
-
|
|
2750
|
+
const s = e, n = zr(e);
|
|
2751
|
+
let o;
|
|
2752
|
+
if (n.forEach((a) => {
|
|
2753
|
+
const l = a.split("||"), u = l[0].trim();
|
|
2754
|
+
if (u) {
|
|
2755
|
+
const f = (l[1] || "").trim();
|
|
2756
|
+
let d, m = !1;
|
|
2757
|
+
if (i && u.indexOf("$form.") === 0) {
|
|
2758
|
+
const g = u.split(".");
|
|
2759
|
+
g.shift(), k(i.value, g[0]) && (m = !0, d = r ? r({
|
|
2760
|
+
id: "$form." + g[0] + "_" + i.rule.__fc__.id,
|
|
2761
|
+
getValue: () => T(i.value, g)
|
|
2762
|
+
}) : T(i.value, g));
|
|
2763
|
+
}
|
|
2764
|
+
m || (d = r ? r(u, f) : this.fc.getLoadData(u, f)), o = d, e = e.replaceAll(`{{${a}}}`, d == null ? "" : d);
|
|
2729
2765
|
}
|
|
2730
|
-
}),
|
|
2731
|
-
return
|
|
2766
|
+
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2767
|
+
return o;
|
|
2732
2768
|
}
|
|
2733
2769
|
return e;
|
|
2734
2770
|
},
|
|
2735
|
-
loadFetchVar(e, r) {
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2771
|
+
loadFetchVar(e, r, i) {
|
|
2772
|
+
let s;
|
|
2773
|
+
i && i.__fc__ && (s = i.__fc__.getParentGroup());
|
|
2774
|
+
const n = (o) => this.loadStrVar(o, r, s ? { rule: i, value: this.subRuleData[s.id] || {} } : null);
|
|
2775
|
+
return e.action = n(e.action || ""), ["headers", "data", "query"].forEach((o) => {
|
|
2776
|
+
if (e[o]) {
|
|
2777
|
+
const a = {};
|
|
2778
|
+
Object.keys(e[o]).forEach((l) => {
|
|
2779
|
+
a[n(l)] = n(e[o][l]);
|
|
2780
|
+
}), e[o] = a;
|
|
2743
2781
|
}
|
|
2744
2782
|
}), e;
|
|
2745
2783
|
}
|
|
2746
2784
|
});
|
|
2747
2785
|
}
|
|
2748
2786
|
const yt = ["hook:updated", "hook:mounted"];
|
|
2749
|
-
function
|
|
2787
|
+
function ri(t) {
|
|
2750
2788
|
_(t.prototype, {
|
|
2751
2789
|
usePage() {
|
|
2752
2790
|
const e = this.options.page;
|
|
2753
2791
|
if (!e) return;
|
|
2754
|
-
let r = 25, i =
|
|
2792
|
+
let r = 25, i = ii(this.rules);
|
|
2755
2793
|
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), _(this, {
|
|
2756
2794
|
first: r,
|
|
2757
2795
|
limit: i,
|
|
@@ -2766,10 +2804,10 @@ function ti(t) {
|
|
|
2766
2804
|
}
|
|
2767
2805
|
});
|
|
2768
2806
|
}
|
|
2769
|
-
function
|
|
2807
|
+
function ii(t) {
|
|
2770
2808
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2771
2809
|
}
|
|
2772
|
-
function
|
|
2810
|
+
function ni(t) {
|
|
2773
2811
|
_(t.prototype, {
|
|
2774
2812
|
clearNextTick() {
|
|
2775
2813
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
@@ -2784,15 +2822,15 @@ function ii(t) {
|
|
|
2784
2822
|
}
|
|
2785
2823
|
});
|
|
2786
2824
|
}
|
|
2787
|
-
function
|
|
2825
|
+
function si(t) {
|
|
2788
2826
|
Object.defineProperties(t.origin, {
|
|
2789
|
-
__fc__: Ke(
|
|
2827
|
+
__fc__: Ke(de(t), !0)
|
|
2790
2828
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2791
|
-
__fc__: Ke(
|
|
2829
|
+
__fc__: Ke(de(t), !0)
|
|
2792
2830
|
});
|
|
2793
2831
|
}
|
|
2794
2832
|
function Gt(t, e, r) {
|
|
2795
|
-
const i =
|
|
2833
|
+
const i = Ie(), s = !!e.field;
|
|
2796
2834
|
_(this, {
|
|
2797
2835
|
id: i,
|
|
2798
2836
|
ref: i,
|
|
@@ -2819,7 +2857,7 @@ function Gt(t, e, r) {
|
|
|
2819
2857
|
exportEl: void 0,
|
|
2820
2858
|
defaultValue: s ? J(r) : void 0,
|
|
2821
2859
|
field: e.field || void 0
|
|
2822
|
-
}), this.updateKey(),
|
|
2860
|
+
}), this.updateKey(), si(this), this.update(t, !0);
|
|
2823
2861
|
}
|
|
2824
2862
|
_(Gt.prototype, {
|
|
2825
2863
|
getParentGroup() {
|
|
@@ -2854,12 +2892,12 @@ _(Gt.prototype, {
|
|
|
2854
2892
|
delete this.pending[e];
|
|
2855
2893
|
let a = r;
|
|
2856
2894
|
if (h.Function(r)) {
|
|
2857
|
-
let l =
|
|
2895
|
+
let l = O(() => r({
|
|
2858
2896
|
rule: this.rule,
|
|
2859
2897
|
api: this.$api,
|
|
2860
2898
|
update: (u) => {
|
|
2861
|
-
const f = u || i,
|
|
2862
|
-
this.setPending(e, r, f), o && o(f,
|
|
2899
|
+
const f = u || i, d = this.getPending(e, i);
|
|
2900
|
+
this.setPending(e, r, f), o && o(f, d);
|
|
2863
2901
|
},
|
|
2864
2902
|
reload: () => {
|
|
2865
2903
|
const u = this.getPending(e, i);
|
|
@@ -2881,7 +2919,7 @@ _(Gt.prototype, {
|
|
|
2881
2919
|
setPending(t, e, r) {
|
|
2882
2920
|
this.pending[t] = {
|
|
2883
2921
|
origin: e,
|
|
2884
|
-
value:
|
|
2922
|
+
value: re(r)
|
|
2885
2923
|
};
|
|
2886
2924
|
},
|
|
2887
2925
|
effectData(t) {
|
|
@@ -2891,10 +2929,10 @@ _(Gt.prototype, {
|
|
|
2891
2929
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2892
2930
|
},
|
|
2893
2931
|
updateKey(t) {
|
|
2894
|
-
this.key =
|
|
2932
|
+
this.key = Ie(), t && this.parent && this.parent.updateKey(t);
|
|
2895
2933
|
},
|
|
2896
2934
|
updateType() {
|
|
2897
|
-
this.originType = this.rule.type, this.type =
|
|
2935
|
+
this.originType = this.rule.type, this.type = q(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
2898
2936
|
},
|
|
2899
2937
|
setParser(t) {
|
|
2900
2938
|
this.parser = t, t.init(this);
|
|
@@ -2902,7 +2940,7 @@ _(Gt.prototype, {
|
|
|
2902
2940
|
initProp() {
|
|
2903
2941
|
var e, r;
|
|
2904
2942
|
const t = b({}, this.rule);
|
|
2905
|
-
delete t.children, delete t.validate, this.prop =
|
|
2943
|
+
delete t.children, delete t.validate, this.prop = Y({}, [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 || []];
|
|
2906
2944
|
},
|
|
2907
2945
|
initNone() {
|
|
2908
2946
|
this.none = !(h.Undef(this.prop.display) || this.prop.display);
|
|
@@ -2968,7 +3006,7 @@ _(Gt.prototype, {
|
|
|
2968
3006
|
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2969
3007
|
}
|
|
2970
3008
|
});
|
|
2971
|
-
function
|
|
3009
|
+
function oi(t) {
|
|
2972
3010
|
_(t.prototype, {
|
|
2973
3011
|
nextRefresh(e) {
|
|
2974
3012
|
const r = this.loadedId;
|
|
@@ -2980,7 +3018,7 @@ function si(t) {
|
|
|
2980
3018
|
const r = ct(e);
|
|
2981
3019
|
return Object.defineProperties(r, {
|
|
2982
3020
|
__origin__: Ke(e, !0)
|
|
2983
|
-
}),
|
|
3021
|
+
}), ai(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
2984
3022
|
i && this.loadFn(i, r);
|
|
2985
3023
|
}), this.loadCtrl(r), r.update && (r.update = W(r.update)), r;
|
|
2986
3024
|
},
|
|
@@ -2996,7 +3034,7 @@ function si(t) {
|
|
|
2996
3034
|
},
|
|
2997
3035
|
syncProp(e) {
|
|
2998
3036
|
const r = e.rule;
|
|
2999
|
-
h.trueArray(r.sync) &&
|
|
3037
|
+
h.trueArray(r.sync) && Z([{
|
|
3000
3038
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
3001
3039
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
3002
3040
|
}, i), {})
|
|
@@ -3030,29 +3068,29 @@ function si(t) {
|
|
|
3030
3068
|
let l = ct(o);
|
|
3031
3069
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3032
3070
|
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);
|
|
3033
|
-
let f,
|
|
3034
|
-
if (
|
|
3035
|
-
if (f = o.__fc__,
|
|
3071
|
+
let f, d = !1, m = !!o.__fc__, g = l.value;
|
|
3072
|
+
if (m) {
|
|
3073
|
+
if (f = o.__fc__, g = f.defaultValue, f.deleted) {
|
|
3036
3074
|
if ($t(f))
|
|
3037
3075
|
return;
|
|
3038
3076
|
f.update(this);
|
|
3039
3077
|
} else if (!f.check(this)) {
|
|
3040
3078
|
if ($t(f))
|
|
3041
3079
|
return;
|
|
3042
|
-
e[a] = o = o._clone ? o._clone() : Vt(et(o)), f = null,
|
|
3080
|
+
e[a] = o = o._clone ? o._clone() : Vt(et(o)), f = null, d = !0;
|
|
3043
3081
|
}
|
|
3044
3082
|
}
|
|
3045
3083
|
if (f)
|
|
3046
3084
|
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3047
3085
|
else {
|
|
3048
|
-
const
|
|
3049
|
-
f = new Gt(this,
|
|
3086
|
+
const I = this.parseRule(o);
|
|
3087
|
+
f = new Gt(this, I, g), this.bindParser(f);
|
|
3050
3088
|
}
|
|
3051
|
-
[!1, !0].forEach((
|
|
3089
|
+
[!1, !0].forEach((I) => this.parseEmit(f, I)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !d && !m && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
|
|
3052
3090
|
const v = f.loadChildrenPending();
|
|
3053
3091
|
if (f.parser.loadChildren === !1 || s(v, f), !r) {
|
|
3054
|
-
const
|
|
3055
|
-
|
|
3092
|
+
const I = i(a);
|
|
3093
|
+
I > -1 || !a ? this.sort.splice(I + 1, 0, f.id) : this.sort.push(f.id);
|
|
3056
3094
|
}
|
|
3057
3095
|
const w = f.rule;
|
|
3058
3096
|
return f.updated || (f.updated = !0, h.Function(w.update) && this.bus.$once("load-end", () => {
|
|
@@ -3065,16 +3103,16 @@ function si(t) {
|
|
|
3065
3103
|
return e.input && e.rule.control && this.useCtrl(e);
|
|
3066
3104
|
},
|
|
3067
3105
|
useCtrl(e) {
|
|
3068
|
-
const r =
|
|
3106
|
+
const r = li(e), i = [], s = this.api;
|
|
3069
3107
|
if (!r.length) return !1;
|
|
3070
3108
|
for (let a = 0; a < r.length; a++) {
|
|
3071
|
-
const l = r[a], u = l.handle || function(
|
|
3072
|
-
return (
|
|
3109
|
+
const l = r[a], u = l.handle || function(d) {
|
|
3110
|
+
return (fe[l.condition || "=="] || fe["=="])(d, l.value);
|
|
3073
3111
|
};
|
|
3074
3112
|
if (!h.trueArray(l.rule)) continue;
|
|
3075
|
-
const f =
|
|
3076
|
-
valid:
|
|
3077
|
-
ctrl:
|
|
3113
|
+
const f = U(b({}, l), {
|
|
3114
|
+
valid: O(() => u(e.rule.value, s)),
|
|
3115
|
+
ctrl: ui(e, l.rule),
|
|
3078
3116
|
isHidden: h.String(l.rule[0])
|
|
3079
3117
|
});
|
|
3080
3118
|
f.valid && f.ctrl || !f.valid && !f.ctrl && !f.isHidden || i.push(f);
|
|
@@ -3083,13 +3121,13 @@ function si(t) {
|
|
|
3083
3121
|
const n = [];
|
|
3084
3122
|
let o = !1;
|
|
3085
3123
|
return this.deferSyncValue(() => {
|
|
3086
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append:
|
|
3124
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: d, child: m, ctrl: g, method: v }) => {
|
|
3087
3125
|
if (a) {
|
|
3088
3126
|
l ? e.ctrlRule.push({
|
|
3089
3127
|
__ctrl: !0,
|
|
3090
3128
|
children: u,
|
|
3091
3129
|
valid: l
|
|
3092
|
-
}) :
|
|
3130
|
+
}) : g && e.ctrlRule.splice(e.ctrlRule.indexOf(g) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3093
3131
|
v === "disabled" || v === "enabled" ? this.api.disabled(!l, u) : v === "display" ? this.api.display(l, u) : v === "required" ? (u.forEach((w) => {
|
|
3094
3132
|
this.api.setEffect(w, "required", l);
|
|
3095
3133
|
}), l || this.api.clearValidateState(u)) : this.api.hidden(!l, u);
|
|
@@ -3105,11 +3143,11 @@ function si(t) {
|
|
|
3105
3143
|
children: u
|
|
3106
3144
|
};
|
|
3107
3145
|
e.ctrlRule.push(w), this.bus.$once("load-start", () => {
|
|
3108
|
-
f ? s.prepend(w, f,
|
|
3146
|
+
f ? s.prepend(w, f, m) : d || m ? s.append(w, d || e.id, m) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, w);
|
|
3109
3147
|
});
|
|
3110
3148
|
} else {
|
|
3111
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3112
|
-
const w =
|
|
3149
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(g), 1);
|
|
3150
|
+
const w = Q(g);
|
|
3113
3151
|
w && w.rm();
|
|
3114
3152
|
}
|
|
3115
3153
|
});
|
|
@@ -3137,17 +3175,17 @@ function si(t) {
|
|
|
3137
3175
|
}
|
|
3138
3176
|
});
|
|
3139
3177
|
}
|
|
3140
|
-
function
|
|
3178
|
+
function ai(t) {
|
|
3141
3179
|
const e = Tt();
|
|
3142
3180
|
return Object.keys(e).forEach((r) => {
|
|
3143
|
-
k(t, r) ||
|
|
3181
|
+
k(t, r) || F(t, r, e[r]);
|
|
3144
3182
|
}), t;
|
|
3145
3183
|
}
|
|
3146
|
-
function
|
|
3184
|
+
function li(t) {
|
|
3147
3185
|
const e = t.rule.control || [];
|
|
3148
3186
|
return h.Object(e) ? [e] : e;
|
|
3149
3187
|
}
|
|
3150
|
-
function
|
|
3188
|
+
function ui(t, e) {
|
|
3151
3189
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
3152
3190
|
const i = t.ctrlRule[r];
|
|
3153
3191
|
if (i.children === e)
|
|
@@ -3157,7 +3195,7 @@ function li(t, e) {
|
|
|
3157
3195
|
function $t(t) {
|
|
3158
3196
|
return !!t.rule.__ctrl;
|
|
3159
3197
|
}
|
|
3160
|
-
function
|
|
3198
|
+
function fi(t) {
|
|
3161
3199
|
_(t.prototype, {
|
|
3162
3200
|
setValue(e, r, i, s) {
|
|
3163
3201
|
e.deleted || (e.rule.value = r, this.changeStatus = !0, this.nextRefresh(), this.$render.clearCache(e), this.setFormData(e, i), this.syncValue(), this.valueChange(e, r), this.vm.$emit("change", e.field, r, e.origin, this.api, s || !1), this.effect(e, "value"), this.targetHook(e, "value", { value: r }), this.emitEvent("change", e.field, r, {
|
|
@@ -3190,21 +3228,21 @@ function ui(t) {
|
|
|
3190
3228
|
setFormData(e, r) {
|
|
3191
3229
|
e.modelValue = r;
|
|
3192
3230
|
const i = e.getParentGroup();
|
|
3193
|
-
i && (this.subRuleData[i.id] ||
|
|
3231
|
+
i && (this.subRuleData[i.id] || F(this.subRuleData, i.id, {}), F(this.subRuleData[i.id], e.field, e.rule.value)), F(this.formData, e.id, r);
|
|
3194
3232
|
},
|
|
3195
3233
|
rmSubRuleData(e) {
|
|
3196
3234
|
const r = e.getParentGroup();
|
|
3197
|
-
r && this.subRuleData[r.id] &&
|
|
3235
|
+
r && this.subRuleData[r.id] && te(this.subRuleData[r.id], e.field);
|
|
3198
3236
|
},
|
|
3199
3237
|
getFormData(e) {
|
|
3200
3238
|
return this.formData[e.id];
|
|
3201
3239
|
},
|
|
3202
3240
|
syncForm() {
|
|
3203
3241
|
const e = {}, r = this.fields(), i = [];
|
|
3204
|
-
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] =
|
|
3242
|
+
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] = Ee(this.appendData, n)), s), e), r.reduce((s, n) => {
|
|
3205
3243
|
const o = (this.fieldCtx[n] || []).filter((a) => !this.isIgnore(a.rule))[0] || this.fieldCtx[n][0];
|
|
3206
|
-
return this.isIgnore(o.rule) && i.push(n), s[n] =
|
|
3207
|
-
}, e), this.form =
|
|
3244
|
+
return this.isIgnore(o.rule) && i.push(n), s[n] = Ee(o.rule, "value"), s;
|
|
3245
|
+
}, e), this.form = re(e), this.ignoreFields = i, this.syncValue();
|
|
3208
3246
|
},
|
|
3209
3247
|
isIgnore(e) {
|
|
3210
3248
|
return e.ignore === !0 || e.ignore === "hidden" && e.hidden || this.options.ignoreHiddenFields && e.hidden;
|
|
@@ -3216,7 +3254,7 @@ function ui(t) {
|
|
|
3216
3254
|
this.subForm[e.id] = r;
|
|
3217
3255
|
},
|
|
3218
3256
|
deferSyncValue(e, r) {
|
|
3219
|
-
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r),
|
|
3257
|
+
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r), O(e), this.deferSyncFn === e && (this.deferSyncFn = null, e.sync && this.syncForm());
|
|
3220
3258
|
},
|
|
3221
3259
|
syncValue() {
|
|
3222
3260
|
if (this.deferSyncFn)
|
|
@@ -3234,7 +3272,7 @@ function ui(t) {
|
|
|
3234
3272
|
},
|
|
3235
3273
|
refreshUpdate(e, r, i, s) {
|
|
3236
3274
|
if (h.Function(e.rule.update)) {
|
|
3237
|
-
const n =
|
|
3275
|
+
const n = O(() => e.rule.update(r, e.origin, this.api, {
|
|
3238
3276
|
origin: i || "change",
|
|
3239
3277
|
linkField: s
|
|
3240
3278
|
}));
|
|
@@ -3282,8 +3320,8 @@ const ke = {
|
|
|
3282
3320
|
},
|
|
3283
3321
|
mergeProp(t) {
|
|
3284
3322
|
}
|
|
3285
|
-
},
|
|
3286
|
-
function
|
|
3323
|
+
}, ci = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"];
|
|
3324
|
+
function hi(t) {
|
|
3287
3325
|
_(t.prototype, {
|
|
3288
3326
|
getCtx(e) {
|
|
3289
3327
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
@@ -3314,25 +3352,25 @@ function ci(t) {
|
|
|
3314
3352
|
getParser(e) {
|
|
3315
3353
|
const r = this.fc.parsers, i = this.fc.renderDriver;
|
|
3316
3354
|
if (i) {
|
|
3317
|
-
const s = i.parsers || {}, n = s[e.originType] || s[
|
|
3355
|
+
const s = i.parsers || {}, n = s[e.originType] || s[q(e.type)] || s[e.trueType];
|
|
3318
3356
|
if (n)
|
|
3319
3357
|
return n;
|
|
3320
3358
|
}
|
|
3321
|
-
return r[e.originType] || r[
|
|
3359
|
+
return r[e.originType] || r[q(e.type)] || r[e.trueType] || ke;
|
|
3322
3360
|
},
|
|
3323
3361
|
bindParser(e) {
|
|
3324
3362
|
e.setParser(this.getParser(e));
|
|
3325
3363
|
},
|
|
3326
3364
|
getType(e) {
|
|
3327
|
-
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[
|
|
3328
|
-
return
|
|
3365
|
+
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[q(e)] || e;
|
|
3366
|
+
return q(i);
|
|
3329
3367
|
},
|
|
3330
3368
|
noWatch(e) {
|
|
3331
|
-
this.noWatchFn || (this.noWatchFn = e),
|
|
3369
|
+
this.noWatchFn || (this.noWatchFn = e), O(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
3332
3370
|
},
|
|
3333
3371
|
watchCtx(e) {
|
|
3334
|
-
if (It().filter((i) => i[0] !== "_" && i[0] !== "$" &&
|
|
3335
|
-
const s =
|
|
3372
|
+
if (It().filter((i) => i[0] !== "_" && i[0] !== "$" && ci.indexOf(i) === -1).forEach((i) => {
|
|
3373
|
+
const s = Ee(e.rule, i), n = i === "children";
|
|
3336
3374
|
e.refRule[i] = s, e.watch.push(L(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3337
3375
|
let l = s.value;
|
|
3338
3376
|
if (!this.isBreakWatch()) {
|
|
@@ -3353,21 +3391,21 @@ function ci(t) {
|
|
|
3353
3391
|
this.$render.clearCache(e), this.refresh(), this.watching = !1;
|
|
3354
3392
|
}
|
|
3355
3393
|
}, { deep: !n, sync: n }));
|
|
3356
|
-
}), e.refRule.__$title =
|
|
3394
|
+
}), e.refRule.__$title = pe(() => {
|
|
3357
3395
|
let i = (typeof e.rule.title == "object" ? e.rule.title.title : e.rule.title) || "";
|
|
3358
3396
|
if (i) {
|
|
3359
3397
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3360
3398
|
s && (i = this.api.t(s[1]));
|
|
3361
3399
|
}
|
|
3362
3400
|
return i;
|
|
3363
|
-
}), e.refRule.__$info =
|
|
3401
|
+
}), e.refRule.__$info = pe(() => {
|
|
3364
3402
|
let i = (typeof e.rule.info == "object" ? e.rule.info.info : e.rule.info) || "";
|
|
3365
3403
|
if (i) {
|
|
3366
3404
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3367
3405
|
s && (i = this.api.t(s[1]));
|
|
3368
3406
|
}
|
|
3369
3407
|
return i;
|
|
3370
|
-
}), e.refRule.__$validate =
|
|
3408
|
+
}), e.refRule.__$validate = pe(() => G(e.rule.validate).map((i) => {
|
|
3371
3409
|
const s = b({}, i);
|
|
3372
3410
|
if (s.message) {
|
|
3373
3411
|
const n = s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
@@ -3387,7 +3425,7 @@ function ci(t) {
|
|
|
3387
3425
|
}
|
|
3388
3426
|
return s;
|
|
3389
3427
|
})), e.input) {
|
|
3390
|
-
const i =
|
|
3428
|
+
const i = Ee(e.rule, "value");
|
|
3391
3429
|
e.watch.push(L(() => i.value, () => {
|
|
3392
3430
|
let s = e.parser.toFormValue(i.value, e);
|
|
3393
3431
|
this.isChange(e, s) && this.setValue(e, i.value, s, !0);
|
|
@@ -3397,15 +3435,15 @@ function ci(t) {
|
|
|
3397
3435
|
let i = e.rule.computed;
|
|
3398
3436
|
i && (typeof i != "object" && (i = { value: i }), Object.keys(i).forEach((s) => {
|
|
3399
3437
|
let n;
|
|
3400
|
-
const o =
|
|
3438
|
+
const o = pe(() => {
|
|
3401
3439
|
const l = i[s];
|
|
3402
3440
|
if (!l) return;
|
|
3403
3441
|
const u = this.compute(e, l);
|
|
3404
3442
|
return l.linkage && u === void 0 ? n : u;
|
|
3405
3443
|
}), a = (l) => {
|
|
3406
|
-
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) :
|
|
3444
|
+
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) : ie(e.rule, s, l);
|
|
3407
3445
|
};
|
|
3408
|
-
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !==
|
|
3446
|
+
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !== T(e.rule, s)) && a(o.value), e.watch.push(L(o, (l) => {
|
|
3409
3447
|
n = l, setTimeout(() => {
|
|
3410
3448
|
a(l);
|
|
3411
3449
|
});
|
|
@@ -3422,30 +3460,30 @@ function ci(t) {
|
|
|
3422
3460
|
const l = a.mode === "OR";
|
|
3423
3461
|
let u = !0;
|
|
3424
3462
|
for (let f = 0; f < a.group.length; f++) {
|
|
3425
|
-
const
|
|
3426
|
-
let
|
|
3427
|
-
if (
|
|
3428
|
-
|
|
3429
|
-
else if (
|
|
3430
|
-
|
|
3463
|
+
const d = a.group[f];
|
|
3464
|
+
let m, g = null;
|
|
3465
|
+
if (d.variable)
|
|
3466
|
+
g = JSON.stringify(this.fc.getLoadData(d.variable) || "");
|
|
3467
|
+
else if (d.field)
|
|
3468
|
+
g = dt(d.field || "");
|
|
3431
3469
|
else
|
|
3432
3470
|
return !0;
|
|
3433
|
-
let v =
|
|
3434
|
-
if (v && (v = dt(v || "")),
|
|
3471
|
+
let v = d.compare;
|
|
3472
|
+
if (v && (v = dt(v || "")), d.mode ? m = n(d) : fe[d.condition] ? h.Function(d.handler) ? m = O(() => d.handler(this.api, e.rule)) : m = O(() => new Function("$condition", "$val", "$form", "$group", "$rule", `with($form){with(this){with($group){ return $condition['${d.condition}'](${g}, ${v || "$val"}); }}}`).call(this.api.form, fe, d.value, this.api.top.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : m = !1, l && m)
|
|
3435
3473
|
return !0;
|
|
3436
|
-
l || (u = u &&
|
|
3474
|
+
l || (u = u && m);
|
|
3437
3475
|
}
|
|
3438
3476
|
return l ? !1 : u;
|
|
3439
3477
|
};
|
|
3440
3478
|
let o = n(r);
|
|
3441
|
-
return o = r.invert === !0 ? !o : o, r.linkage ? o ?
|
|
3479
|
+
return o = r.invert === !0 ? !o : o, r.linkage ? o ? O(() => this.computeValue(r.linkage, e, s), void 0) : void 0 : o;
|
|
3442
3480
|
} else if (h.Function(r))
|
|
3443
3481
|
i = () => r(this.api.form, this.api);
|
|
3444
3482
|
else {
|
|
3445
3483
|
const s = e.getParentGroup();
|
|
3446
3484
|
i = () => this.computeValue(r, e, s);
|
|
3447
3485
|
}
|
|
3448
|
-
return
|
|
3486
|
+
return O(i, void 0);
|
|
3449
3487
|
},
|
|
3450
3488
|
computeValue(e, r, i) {
|
|
3451
3489
|
const s = this, n = Object.keys(this.fc.formulas).reduce((o, a) => (o[a] = function(...l) {
|
|
@@ -3473,9 +3511,9 @@ function ci(t) {
|
|
|
3473
3511
|
rmCtx(e) {
|
|
3474
3512
|
if (e.deleted) return;
|
|
3475
3513
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3476
|
-
|
|
3514
|
+
te(this.ctxs, r), te(this.formData, r), te(this.subForm, r), te(this.vm.ctxInject, r);
|
|
3477
3515
|
const o = e.getParentGroup();
|
|
3478
|
-
o && this.subRuleData[o.id] &&
|
|
3516
|
+
o && this.subRuleData[o.id] && te(this.subRuleData[o.id], i), e.group && te(this.subRuleData, r), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !k(this.fieldCtx, i) && te(this.form, i), this.deferSyncValue(() => {
|
|
3479
3517
|
if (!this.reloading) {
|
|
3480
3518
|
if (e.parser.loadChildren !== !1) {
|
|
3481
3519
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3489,7 +3527,7 @@ function ci(t) {
|
|
|
3489
3527
|
}
|
|
3490
3528
|
});
|
|
3491
3529
|
}
|
|
3492
|
-
function
|
|
3530
|
+
function di(t) {
|
|
3493
3531
|
_(t.prototype, {
|
|
3494
3532
|
mounted() {
|
|
3495
3533
|
const e = () => {
|
|
@@ -3501,10 +3539,10 @@ function hi(t) {
|
|
|
3501
3539
|
this.fc.targetFormDriver(e, this.api, this.fc), this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3502
3540
|
},
|
|
3503
3541
|
emitEvent(e, ...r) {
|
|
3504
|
-
const i = this.options[e] || this.options[
|
|
3542
|
+
const i = this.options[e] || this.options[q("on-" + e)];
|
|
3505
3543
|
if (i) {
|
|
3506
3544
|
const s = W(i);
|
|
3507
|
-
h.Function(s) &&
|
|
3545
|
+
h.Function(s) && O(() => s(...r));
|
|
3508
3546
|
}
|
|
3509
3547
|
this.bus.$emit(e, ...r);
|
|
3510
3548
|
},
|
|
@@ -3512,18 +3550,18 @@ function hi(t) {
|
|
|
3512
3550
|
var n, o;
|
|
3513
3551
|
let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
|
|
3514
3552
|
s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
|
|
3515
|
-
|
|
3553
|
+
O(() => a(U(b({}, i || {}), { rule: e.rule, api: this.api })));
|
|
3516
3554
|
}));
|
|
3517
3555
|
}
|
|
3518
3556
|
});
|
|
3519
3557
|
}
|
|
3520
|
-
function
|
|
3558
|
+
function pi(t) {
|
|
3521
3559
|
_(t.prototype, {
|
|
3522
3560
|
useProvider() {
|
|
3523
3561
|
const e = this.fc.providers;
|
|
3524
3562
|
Object.keys(e).forEach((r) => {
|
|
3525
3563
|
let i = e[r];
|
|
3526
|
-
h.Function(i) && (i = i(this.fc)), i._c =
|
|
3564
|
+
h.Function(i) && (i = i(this.fc)), i._c = gi(i), this.onEffect(i), this.providers[r] = i;
|
|
3527
3565
|
});
|
|
3528
3566
|
},
|
|
3529
3567
|
onEffect(e) {
|
|
@@ -3580,28 +3618,28 @@ function di(t) {
|
|
|
3580
3618
|
Object.keys(l).forEach((u) => {
|
|
3581
3619
|
const f = this.providers[u];
|
|
3582
3620
|
if (!f || f.input && !i) return;
|
|
3583
|
-
let
|
|
3621
|
+
let d;
|
|
3584
3622
|
if (!f._c)
|
|
3585
|
-
|
|
3623
|
+
d = "*";
|
|
3586
3624
|
else if (f._used.indexOf(s) > -1)
|
|
3587
|
-
|
|
3625
|
+
d = s;
|
|
3588
3626
|
else
|
|
3589
3627
|
return;
|
|
3590
|
-
const
|
|
3591
|
-
e && (
|
|
3628
|
+
const m = b({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3629
|
+
e && (m.getProp = () => e.effectData(u), m.clearProp = () => e.clearEffectData(u), m.mergeProp = (g) => Y(m.getProp(), [g]), m.id = e.id), this.bus.$emit(`p:${u}:${d}:${f.input ? 1 : 0}`, o, [m, r, this.api]);
|
|
3592
3630
|
});
|
|
3593
3631
|
}
|
|
3594
3632
|
});
|
|
3595
3633
|
}
|
|
3596
|
-
function
|
|
3634
|
+
function mi(t) {
|
|
3597
3635
|
return t.filter(function(e, r, i) {
|
|
3598
3636
|
return i.indexOf(e, 0) === r;
|
|
3599
3637
|
});
|
|
3600
3638
|
}
|
|
3601
|
-
function
|
|
3639
|
+
function gi(t) {
|
|
3602
3640
|
const e = t.components;
|
|
3603
3641
|
if (Array.isArray(e)) {
|
|
3604
|
-
const r =
|
|
3642
|
+
const r = mi(e.filter((i) => i !== "*"));
|
|
3605
3643
|
return r.length ? r : !1;
|
|
3606
3644
|
} else return h.String(e) ? [e] : !1;
|
|
3607
3645
|
}
|
|
@@ -3625,10 +3663,10 @@ function z(t) {
|
|
|
3625
3663
|
noWatchFn: null,
|
|
3626
3664
|
deferSyncFn: null,
|
|
3627
3665
|
isMounted: !1,
|
|
3628
|
-
formData:
|
|
3629
|
-
subRuleData:
|
|
3666
|
+
formData: re({}),
|
|
3667
|
+
subRuleData: re({}),
|
|
3630
3668
|
subForm: {},
|
|
3631
|
-
form:
|
|
3669
|
+
form: re({}),
|
|
3632
3670
|
appendData: {},
|
|
3633
3671
|
ignoreFields: [],
|
|
3634
3672
|
providers: {},
|
|
@@ -3641,9 +3679,9 @@ function z(t) {
|
|
|
3641
3679
|
this.lifecycle("reload");
|
|
3642
3680
|
}
|
|
3643
3681
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3644
|
-
const i =
|
|
3682
|
+
const i = O(() => r(e, this));
|
|
3645
3683
|
return i && i !== e && _(e, i), e;
|
|
3646
|
-
},
|
|
3684
|
+
}, Zr(this));
|
|
3647
3685
|
}
|
|
3648
3686
|
_(z.prototype, {
|
|
3649
3687
|
initData(t) {
|
|
@@ -3666,31 +3704,31 @@ _(z.prototype, {
|
|
|
3666
3704
|
},
|
|
3667
3705
|
beforeFetch(t) {
|
|
3668
3706
|
return new Promise((e) => {
|
|
3669
|
-
const r = this.options.beforeFetch &&
|
|
3707
|
+
const r = this.options.beforeFetch && O(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3670
3708
|
r && h.Function(r.then) ? r.then(e) : e();
|
|
3671
3709
|
});
|
|
3672
3710
|
}
|
|
3673
3711
|
});
|
|
3674
|
-
ei(z);
|
|
3675
3712
|
ti(z);
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3713
|
+
ri(z);
|
|
3714
|
+
ni(z);
|
|
3715
|
+
oi(z);
|
|
3716
|
+
fi(z);
|
|
3680
3717
|
hi(z);
|
|
3681
3718
|
di(z);
|
|
3682
|
-
|
|
3683
|
-
|
|
3719
|
+
pi(z);
|
|
3720
|
+
const yi = "fcFragment", Te = {
|
|
3721
|
+
name: yi,
|
|
3684
3722
|
functional: !0,
|
|
3685
3723
|
props: ["vnode"],
|
|
3686
3724
|
render(t, e) {
|
|
3687
3725
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3688
3726
|
}
|
|
3689
3727
|
};
|
|
3690
|
-
function
|
|
3728
|
+
function $i(t) {
|
|
3691
3729
|
return h.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3692
3730
|
}
|
|
3693
|
-
function
|
|
3731
|
+
function vi() {
|
|
3694
3732
|
const t = {};
|
|
3695
3733
|
function e(r) {
|
|
3696
3734
|
r && this.setVm(r);
|
|
@@ -3701,11 +3739,11 @@ function $i() {
|
|
|
3701
3739
|
},
|
|
3702
3740
|
make(r, i, s) {
|
|
3703
3741
|
var n, o, a;
|
|
3704
|
-
return (
|
|
3742
|
+
return (me.isReservedTag ? me.isReservedTag(r) : (o = (n = me) == 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);
|
|
3705
3743
|
},
|
|
3706
3744
|
makeComponent(r, i, s) {
|
|
3707
3745
|
var o;
|
|
3708
|
-
let n = this.$h(r,
|
|
3746
|
+
let n = this.$h(r, $i(i), s || []);
|
|
3709
3747
|
if ((o = n == null ? void 0 : n.componentOptions) != null && o.propsData && (i != null && i.props)) {
|
|
3710
3748
|
const a = Object.keys(n.componentOptions.propsData);
|
|
3711
3749
|
n.data.attrs || (n.data.attrs = {}), Object.keys(i.props).forEach((l) => {
|
|
@@ -3722,7 +3760,7 @@ function $i() {
|
|
|
3722
3760
|
},
|
|
3723
3761
|
use(r) {
|
|
3724
3762
|
Object.keys(r).forEach((i) => {
|
|
3725
|
-
const s =
|
|
3763
|
+
const s = ye(i), n = Gr(i).toLocaleLowerCase(), o = r[i];
|
|
3726
3764
|
[i, s, n].forEach((a) => {
|
|
3727
3765
|
e.alias(i, o), e.prototype[a] = function(l, u) {
|
|
3728
3766
|
return this.make(o, l, u);
|
|
@@ -3732,7 +3770,7 @@ function $i() {
|
|
|
3732
3770
|
}
|
|
3733
3771
|
}), e;
|
|
3734
3772
|
}
|
|
3735
|
-
function
|
|
3773
|
+
function bi(t) {
|
|
3736
3774
|
class e extends Ht {
|
|
3737
3775
|
}
|
|
3738
3776
|
return Object.assign(e.prototype, t), e;
|
|
@@ -3753,7 +3791,7 @@ _(Ht.prototype, {
|
|
|
3753
3791
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3754
3792
|
},
|
|
3755
3793
|
updateKey() {
|
|
3756
|
-
this.key =
|
|
3794
|
+
this.key = Ie();
|
|
3757
3795
|
},
|
|
3758
3796
|
//TODO interface
|
|
3759
3797
|
init() {
|
|
@@ -3775,7 +3813,7 @@ _(Ht.prototype, {
|
|
|
3775
3813
|
return e(this.vm);
|
|
3776
3814
|
},
|
|
3777
3815
|
mergeOptions(t, e) {
|
|
3778
|
-
return
|
|
3816
|
+
return Z(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3779
3817
|
},
|
|
3780
3818
|
updateOptions(t) {
|
|
3781
3819
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3793,24 +3831,24 @@ _(Ht.prototype, {
|
|
|
3793
3831
|
render(t) {
|
|
3794
3832
|
}
|
|
3795
3833
|
});
|
|
3796
|
-
const
|
|
3834
|
+
const _i = function(t) {
|
|
3797
3835
|
const e = {
|
|
3798
3836
|
name: "loadData",
|
|
3799
3837
|
_fn: [],
|
|
3800
3838
|
loaded(r, i, s) {
|
|
3801
3839
|
this.deleted(r);
|
|
3802
|
-
let n =
|
|
3840
|
+
let n = G(r.getValue());
|
|
3803
3841
|
const o = [];
|
|
3804
3842
|
n.forEach((a) => {
|
|
3805
3843
|
if (a && (a.attr || a.template)) {
|
|
3806
|
-
let l = (
|
|
3807
|
-
let
|
|
3808
|
-
a.template ?
|
|
3809
|
-
const
|
|
3810
|
-
a.to === "child" ?
|
|
3811
|
-
}, u = (
|
|
3844
|
+
let l = (d) => {
|
|
3845
|
+
let m;
|
|
3846
|
+
a.template ? m = t.$handle.loadStrVar(a.template, d) : a.handler && h.Function(a.handler) ? m = a.handler(d, i, s) : m = d(a.attr, a.default), a.copy !== !1 && (m = J(m));
|
|
3847
|
+
const g = a.modify ? i : r.getProp();
|
|
3848
|
+
a.to === "child" ? g.children ? F(g.children, 0, m) : F(g, "children", [m]) : ie(g, a.to || "options", m), s.sync(i);
|
|
3849
|
+
}, u = (d) => l(d);
|
|
3812
3850
|
const f = t.watchLoadData(u);
|
|
3813
|
-
l =
|
|
3851
|
+
l = ce(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
3814
3852
|
}
|
|
3815
3853
|
}), this._fn[r.id] = o;
|
|
3816
3854
|
},
|
|
@@ -3821,7 +3859,7 @@ const bi = function(t) {
|
|
|
3821
3859
|
}
|
|
3822
3860
|
};
|
|
3823
3861
|
return e.watch = e.mounted, e;
|
|
3824
|
-
},
|
|
3862
|
+
}, Ci = function(t) {
|
|
3825
3863
|
const e = {
|
|
3826
3864
|
name: "t",
|
|
3827
3865
|
_fn: [],
|
|
@@ -3833,13 +3871,13 @@ const bi = function(t) {
|
|
|
3833
3871
|
const l = n[a];
|
|
3834
3872
|
if (l) {
|
|
3835
3873
|
const u = typeof l == "object";
|
|
3836
|
-
let f = (
|
|
3837
|
-
let v = t.t(u ? l.attr : l, u ? l.params : null,
|
|
3874
|
+
let f = (g) => {
|
|
3875
|
+
let v = t.t(u ? l.attr : l, u ? l.params : null, g);
|
|
3838
3876
|
const w = u && l.modify ? i : r.getProp();
|
|
3839
|
-
a === "child" ? w.children ?
|
|
3840
|
-
},
|
|
3841
|
-
const
|
|
3842
|
-
f =
|
|
3877
|
+
a === "child" ? w.children ? F(w.children, 0, v) : F(w, "children", [v]) : ie(w, a, v), s.sync(i);
|
|
3878
|
+
}, d = (g) => f(g);
|
|
3879
|
+
const m = t.watchLoadData(d);
|
|
3880
|
+
f = ce(f, l.wait || 300), l.watch !== !1 ? o.push(m) : m();
|
|
3843
3881
|
}
|
|
3844
3882
|
}), this._fn[r.id] = o;
|
|
3845
3883
|
},
|
|
@@ -3859,9 +3897,9 @@ const bi = function(t) {
|
|
|
3859
3897
|
else {
|
|
3860
3898
|
h.Object(i) || (i = { method: i });
|
|
3861
3899
|
const s = i.method;
|
|
3862
|
-
delete i.method, t.getProp().validate = [
|
|
3900
|
+
delete i.method, t.getProp().validate = [U(b({}, i), {
|
|
3863
3901
|
validator(...n) {
|
|
3864
|
-
const o =
|
|
3902
|
+
const o = Q(e);
|
|
3865
3903
|
if (o)
|
|
3866
3904
|
return r.exec(o.id, h.String(s) ? s : "formCreateValidate", ...n, {
|
|
3867
3905
|
attr: t,
|
|
@@ -3875,7 +3913,7 @@ const bi = function(t) {
|
|
|
3875
3913
|
watch(...t) {
|
|
3876
3914
|
Jt.load(...t);
|
|
3877
3915
|
}
|
|
3878
|
-
},
|
|
3916
|
+
}, wi = function(t) {
|
|
3879
3917
|
function e(s) {
|
|
3880
3918
|
return h.String(s) && (s = {
|
|
3881
3919
|
action: s,
|
|
@@ -3885,55 +3923,55 @@ const bi = function(t) {
|
|
|
3885
3923
|
function r(s, n, o) {
|
|
3886
3924
|
let a = s.value;
|
|
3887
3925
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
3888
|
-
const l = (
|
|
3889
|
-
|
|
3926
|
+
const l = (d) => {
|
|
3927
|
+
d === void 0 ? s.clearProp() : ie(s.getProp(), a.to || "options", d), o.sync(n);
|
|
3890
3928
|
};
|
|
3891
3929
|
if (!a || !a.action && !a.key) {
|
|
3892
3930
|
l(void 0);
|
|
3893
3931
|
return;
|
|
3894
3932
|
}
|
|
3895
3933
|
if (a = J(a), a.to || (a.to = "options"), a.key) {
|
|
3896
|
-
const
|
|
3897
|
-
if (!
|
|
3934
|
+
const d = t.$handle.options.globalData[a.key];
|
|
3935
|
+
if (!d) {
|
|
3898
3936
|
l(void 0);
|
|
3899
3937
|
return;
|
|
3900
3938
|
}
|
|
3901
|
-
if (
|
|
3902
|
-
l(
|
|
3939
|
+
if (d.type === "static") {
|
|
3940
|
+
l(d.data);
|
|
3903
3941
|
return;
|
|
3904
3942
|
} else
|
|
3905
|
-
a = b(b({}, a),
|
|
3943
|
+
a = b(b({}, a), d);
|
|
3906
3944
|
}
|
|
3907
3945
|
const u = a.onError, f = () => {
|
|
3908
3946
|
if (!s.getValue())
|
|
3909
3947
|
return s.clearProp(), o.sync(n), !0;
|
|
3910
3948
|
};
|
|
3911
|
-
i._fn[s.id] = t.watchLoadData(
|
|
3912
|
-
if (
|
|
3949
|
+
i._fn[s.id] = t.watchLoadData(ce((d, m) => {
|
|
3950
|
+
if (m && a.watch === !1)
|
|
3913
3951
|
return i._fn[s.id]();
|
|
3914
|
-
const
|
|
3952
|
+
const g = t.$handle.loadFetchVar(J(a), d, n), v = U(b({
|
|
3915
3953
|
headers: {}
|
|
3916
|
-
},
|
|
3917
|
-
onSuccess(w,
|
|
3954
|
+
}, g), {
|
|
3955
|
+
onSuccess(w, I) {
|
|
3918
3956
|
if (f()) return;
|
|
3919
|
-
let
|
|
3920
|
-
const V = W(
|
|
3921
|
-
h.Function(V) ?
|
|
3957
|
+
let x = (N) => I ? N : k(N, "data") ? N.data : N;
|
|
3958
|
+
const V = W(g.parse);
|
|
3959
|
+
h.Function(V) ? x = V : V && h.String(V) && (x = (N) => T(N, V)), l(x(w, n, o)), o.sync(n);
|
|
3922
3960
|
},
|
|
3923
3961
|
onError(w) {
|
|
3924
|
-
l(void 0), !f() && (u || ((
|
|
3962
|
+
l(void 0), !f() && (u || ((I) => xe(I.message || "fetch fail " + g.action)))(w, n, o);
|
|
3925
3963
|
}
|
|
3926
3964
|
});
|
|
3927
3965
|
t.$handle.beforeFetch(v, { rule: n, api: o }).then(() => {
|
|
3928
|
-
if (h.Function(
|
|
3929
|
-
|
|
3966
|
+
if (h.Function(g.action)) {
|
|
3967
|
+
g.action(n, o).then((w) => {
|
|
3930
3968
|
v.onSuccess(w, !0);
|
|
3931
3969
|
}).catch((w) => {
|
|
3932
3970
|
v.onError(w);
|
|
3933
3971
|
});
|
|
3934
3972
|
return;
|
|
3935
3973
|
}
|
|
3936
|
-
|
|
3974
|
+
O(() => t.create.fetch(v, { inject: s, rule: n, api: o }));
|
|
3937
3975
|
});
|
|
3938
3976
|
}, a.wait || 600));
|
|
3939
3977
|
}
|
|
@@ -3951,13 +3989,13 @@ const bi = function(t) {
|
|
|
3951
3989
|
}
|
|
3952
3990
|
};
|
|
3953
3991
|
return i;
|
|
3954
|
-
},
|
|
3955
|
-
fetch:
|
|
3956
|
-
loadData:
|
|
3957
|
-
t:
|
|
3992
|
+
}, Oi = {
|
|
3993
|
+
fetch: wi,
|
|
3994
|
+
loadData: _i,
|
|
3995
|
+
t: Ci,
|
|
3958
3996
|
componentValidate: Jt
|
|
3959
3997
|
};
|
|
3960
|
-
function
|
|
3998
|
+
function Si(t) {
|
|
3961
3999
|
t = t || /* @__PURE__ */ new Map();
|
|
3962
4000
|
const e = {
|
|
3963
4001
|
$on(r, i) {
|
|
@@ -3981,7 +4019,7 @@ function Oi(t) {
|
|
|
3981
4019
|
};
|
|
3982
4020
|
return e;
|
|
3983
4021
|
}
|
|
3984
|
-
const Fi = "html",
|
|
4022
|
+
const Fi = "html", Ri = {
|
|
3985
4023
|
name: Fi,
|
|
3986
4024
|
loadChildren: !1,
|
|
3987
4025
|
render(t, e) {
|
|
@@ -4009,7 +4047,7 @@ function ki(t) {
|
|
|
4009
4047
|
}
|
|
4010
4048
|
return null;
|
|
4011
4049
|
}
|
|
4012
|
-
function
|
|
4050
|
+
function Ei(t) {
|
|
4013
4051
|
const e = localStorage.getItem(t);
|
|
4014
4052
|
if (e)
|
|
4015
4053
|
try {
|
|
@@ -4019,7 +4057,7 @@ function Ri(t) {
|
|
|
4019
4057
|
}
|
|
4020
4058
|
return null;
|
|
4021
4059
|
}
|
|
4022
|
-
function
|
|
4060
|
+
function Di(t) {
|
|
4023
4061
|
const e = sessionStorage.getItem(t);
|
|
4024
4062
|
if (e)
|
|
4025
4063
|
try {
|
|
@@ -4034,28 +4072,28 @@ function it(t, e) {
|
|
|
4034
4072
|
return null;
|
|
4035
4073
|
const r = e.split(".");
|
|
4036
4074
|
let i = t(r.shift());
|
|
4037
|
-
return r.length ? i == null ? null :
|
|
4038
|
-
}
|
|
4039
|
-
function Di(t) {
|
|
4040
|
-
return it(ki, t);
|
|
4075
|
+
return r.length ? i == null ? null : T(i, r) : i;
|
|
4041
4076
|
}
|
|
4042
4077
|
function ji(t) {
|
|
4043
|
-
return it(
|
|
4078
|
+
return it(ki, t);
|
|
4044
4079
|
}
|
|
4045
4080
|
function Ii(t) {
|
|
4046
4081
|
return it(Ei, t);
|
|
4047
4082
|
}
|
|
4048
|
-
function Ai(t
|
|
4083
|
+
function Ai(t) {
|
|
4084
|
+
return it(Di, t);
|
|
4085
|
+
}
|
|
4086
|
+
function Vi(t, e) {
|
|
4049
4087
|
let r;
|
|
4050
4088
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
4051
4089
|
}
|
|
4052
4090
|
function Ne() {
|
|
4053
|
-
return
|
|
4091
|
+
return Vi("name", ...arguments);
|
|
4054
4092
|
}
|
|
4055
|
-
function
|
|
4093
|
+
function Pi(t) {
|
|
4056
4094
|
return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
4057
4095
|
}
|
|
4058
|
-
function
|
|
4096
|
+
function Bi(t, e) {
|
|
4059
4097
|
const r = new Vue({
|
|
4060
4098
|
data() {
|
|
4061
4099
|
return { rule: t, option: e || {} };
|
|
@@ -4066,79 +4104,81 @@ function Pi(t, e) {
|
|
|
4066
4104
|
});
|
|
4067
4105
|
return r.$mount(), r;
|
|
4068
4106
|
}
|
|
4069
|
-
function
|
|
4107
|
+
function Li(t) {
|
|
4070
4108
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
4071
4109
|
jt.push(...e), Ze.push(...r), Ye.push(...i), Nt([...e, ...r, ...i]);
|
|
4072
4110
|
}
|
|
4073
|
-
let
|
|
4111
|
+
let Ti = 1;
|
|
4074
4112
|
const M = {}, Fe = Symbol("defValue");
|
|
4075
4113
|
function Wt(t) {
|
|
4076
4114
|
const e = {
|
|
4077
4115
|
[Te.name]: Te
|
|
4078
4116
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4079
4117
|
t.extendApi
|
|
4080
|
-
], u = b({},
|
|
4081
|
-
let
|
|
4082
|
-
const
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
if (
|
|
4089
|
-
return
|
|
4118
|
+
], u = b({}, Oi), f = Xr();
|
|
4119
|
+
let d = { global: {} };
|
|
4120
|
+
const m = t.isMobile === !0, g = re({
|
|
4121
|
+
$mobile: m
|
|
4122
|
+
}), v = vi(), w = {}, I = {};
|
|
4123
|
+
Li(t.attrs || {});
|
|
4124
|
+
function x(c) {
|
|
4125
|
+
const p = M[c];
|
|
4126
|
+
if (Array.isArray(p))
|
|
4127
|
+
return p.map((y) => y.api());
|
|
4128
|
+
if (p)
|
|
4129
|
+
return p.api();
|
|
4090
4130
|
}
|
|
4091
4131
|
function V(c) {
|
|
4092
4132
|
o.push(c);
|
|
4093
4133
|
}
|
|
4094
|
-
function
|
|
4134
|
+
function N() {
|
|
4095
4135
|
const c = Ne(...arguments);
|
|
4096
4136
|
c.id && c.prop && (i[c.id] = c.prop);
|
|
4097
4137
|
}
|
|
4098
|
-
function
|
|
4138
|
+
function Ae() {
|
|
4099
4139
|
const c = Ne(...arguments);
|
|
4100
|
-
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop :
|
|
4140
|
+
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : U(b({}, c.prop), {
|
|
4101
4141
|
name: c.id
|
|
4102
4142
|
}));
|
|
4103
4143
|
}
|
|
4104
|
-
function
|
|
4105
|
-
|
|
4144
|
+
function ve(c) {
|
|
4145
|
+
v.use(c);
|
|
4106
4146
|
}
|
|
4107
|
-
function
|
|
4147
|
+
function S() {
|
|
4108
4148
|
const c = Ne(...arguments);
|
|
4109
4149
|
if (!c.id || !c.prop) return ke;
|
|
4110
|
-
const
|
|
4111
|
-
r[
|
|
4150
|
+
const p = q(c.id), y = c.prop, $ = y.merge === !0 ? r[p] : void 0;
|
|
4151
|
+
r[p] = Se(y, $ || ke), f[p] = A(p), y.maker && _(f, y.maker);
|
|
4112
4152
|
}
|
|
4113
|
-
function
|
|
4114
|
-
let
|
|
4153
|
+
function D(c, p) {
|
|
4154
|
+
let y;
|
|
4115
4155
|
if (h.String(c)) {
|
|
4116
|
-
if (
|
|
4117
|
-
return ["form-create", "formcreate"].indexOf(
|
|
4156
|
+
if (y = c, p === void 0)
|
|
4157
|
+
return ["form-create", "formcreate"].indexOf(y) > -1 ? B() : e[y];
|
|
4118
4158
|
} else
|
|
4119
|
-
|
|
4120
|
-
if (!
|
|
4121
|
-
const $ =
|
|
4122
|
-
e[
|
|
4159
|
+
y = q(c.name), p = c;
|
|
4160
|
+
if (!y || !p) return;
|
|
4161
|
+
const $ = q(y);
|
|
4162
|
+
e[y] = p, e[$] = p, delete v.aliasMap[y], delete v.aliasMap[$], delete r[y], delete r[$], p.formCreateParser && S(y, p.formCreateParser);
|
|
4123
4163
|
}
|
|
4124
4164
|
function B() {
|
|
4125
|
-
return
|
|
4165
|
+
return Mr(Pe, e, i);
|
|
4126
4166
|
}
|
|
4127
|
-
function
|
|
4167
|
+
function se() {
|
|
4128
4168
|
return Te;
|
|
4129
4169
|
}
|
|
4130
|
-
function
|
|
4131
|
-
return h.Function(c.install) ? c.install(
|
|
4170
|
+
function be(c, p) {
|
|
4171
|
+
return h.Function(c.install) ? c.install(oe, p) : h.Function(c) && c(oe, p), this;
|
|
4132
4172
|
}
|
|
4133
|
-
function
|
|
4134
|
-
let $ =
|
|
4173
|
+
function oe(c, p, y) {
|
|
4174
|
+
let $ = Bi(c, p || {});
|
|
4135
4175
|
const C = $.$refs.fc.formCreate;
|
|
4136
|
-
return C.$parent =
|
|
4176
|
+
return C.$parent = y, Pi(C.options).appendChild($.$el), C.api();
|
|
4137
4177
|
}
|
|
4138
|
-
|
|
4178
|
+
Se(oe, I);
|
|
4139
4179
|
function Kt(c) {
|
|
4140
|
-
let
|
|
4141
|
-
return c ?
|
|
4180
|
+
let p = b({}, t);
|
|
4181
|
+
return c ? p.inherit = {
|
|
4142
4182
|
components: e,
|
|
4143
4183
|
parsers: r,
|
|
4144
4184
|
directives: i,
|
|
@@ -4146,68 +4186,68 @@ function Wt(t) {
|
|
|
4146
4186
|
providers: u,
|
|
4147
4187
|
useApps: o,
|
|
4148
4188
|
maker: f,
|
|
4149
|
-
formulas:
|
|
4150
|
-
loadData:
|
|
4151
|
-
} : delete
|
|
4189
|
+
formulas: w,
|
|
4190
|
+
loadData: g
|
|
4191
|
+
} : delete p.inherit, Wt(p);
|
|
4152
4192
|
}
|
|
4153
|
-
function Xt(c,
|
|
4154
|
-
s[c] =
|
|
4193
|
+
function Xt(c, p) {
|
|
4194
|
+
s[c] = p;
|
|
4155
4195
|
}
|
|
4156
|
-
function Qt(c,
|
|
4157
|
-
|
|
4196
|
+
function Qt(c, p) {
|
|
4197
|
+
w[c] = p;
|
|
4158
4198
|
}
|
|
4159
|
-
function Zt(c,
|
|
4160
|
-
const
|
|
4161
|
-
|
|
4162
|
-
$[C] =
|
|
4163
|
-
}),
|
|
4199
|
+
function Zt(c, p) {
|
|
4200
|
+
const y = n[c] || {}, $ = y.parsers || {};
|
|
4201
|
+
p.parsers && Object.keys(p.parsers).forEach((C) => {
|
|
4202
|
+
$[C] = Se(p.parsers[C], ke);
|
|
4203
|
+
}), p.name = c, n[c] = U(b(b({}, y), p), { parsers: $ });
|
|
4164
4204
|
}
|
|
4165
|
-
function
|
|
4166
|
-
c && Object.keys(M).forEach((
|
|
4167
|
-
(Array.isArray(M[
|
|
4205
|
+
function _e(c) {
|
|
4206
|
+
c && Object.keys(M).forEach((p) => {
|
|
4207
|
+
(Array.isArray(M[p]) ? M[p] : [M[p]]).forEach(($) => {
|
|
4168
4208
|
$.bus.$emit("$loadData." + c);
|
|
4169
4209
|
});
|
|
4170
4210
|
});
|
|
4171
4211
|
}
|
|
4172
|
-
function
|
|
4173
|
-
|
|
4212
|
+
function Ve(c, p) {
|
|
4213
|
+
ie(g, c, p), _e(c);
|
|
4174
4214
|
}
|
|
4175
|
-
function
|
|
4176
|
-
const
|
|
4177
|
-
|
|
4215
|
+
function Ce(c, p) {
|
|
4216
|
+
const y = (...$) => O(() => p(...$));
|
|
4217
|
+
y._driver = !0, Ve(c, y);
|
|
4178
4218
|
}
|
|
4179
|
-
function nt(c,
|
|
4180
|
-
const
|
|
4181
|
-
c =
|
|
4182
|
-
const $ =
|
|
4183
|
-
if (k(
|
|
4184
|
-
let C =
|
|
4185
|
-
return C && C._driver ? C = C($) :
|
|
4219
|
+
function nt(c, p) {
|
|
4220
|
+
const y = (c || "").split(".");
|
|
4221
|
+
c = y.shift();
|
|
4222
|
+
const $ = y.join(".");
|
|
4223
|
+
if (k(g, c) || F(g, c, Fe), g[c] !== Fe) {
|
|
4224
|
+
let C = g[c];
|
|
4225
|
+
return C && C._driver ? C = C($) : y.length && (C = T(C, y)), C == null || C === "" ? p : C;
|
|
4186
4226
|
} else
|
|
4187
|
-
return
|
|
4227
|
+
return p;
|
|
4188
4228
|
}
|
|
4189
4229
|
function Yt(c) {
|
|
4190
4230
|
l.push(c);
|
|
4191
4231
|
}
|
|
4192
4232
|
function xt(c) {
|
|
4193
|
-
delete
|
|
4233
|
+
delete g[c], _e(c);
|
|
4194
4234
|
}
|
|
4195
|
-
function er(c,
|
|
4196
|
-
a.push({ name: c, callback:
|
|
4235
|
+
function er(c, p) {
|
|
4236
|
+
a.push({ name: c, callback: p });
|
|
4197
4237
|
}
|
|
4198
|
-
function
|
|
4238
|
+
function Pe(c) {
|
|
4199
4239
|
_(this, {
|
|
4200
|
-
id:
|
|
4201
|
-
create:
|
|
4240
|
+
id: Ti++,
|
|
4241
|
+
create: oe,
|
|
4202
4242
|
vm: c,
|
|
4203
|
-
manager:
|
|
4243
|
+
manager: bi(t.manager),
|
|
4204
4244
|
parsers: r,
|
|
4205
4245
|
providers: u,
|
|
4206
4246
|
modelFields: s,
|
|
4207
|
-
formulas:
|
|
4208
|
-
isMobile:
|
|
4247
|
+
formulas: w,
|
|
4248
|
+
isMobile: m,
|
|
4209
4249
|
rules: c.$options.propsData.rule,
|
|
4210
|
-
name: c.$options.propsData.name ||
|
|
4250
|
+
name: c.$options.propsData.name || Ie(),
|
|
4211
4251
|
inFor: c.$options.propsData.inFor,
|
|
4212
4252
|
prop: {
|
|
4213
4253
|
components: e,
|
|
@@ -4215,77 +4255,76 @@ function Wt(t) {
|
|
|
4215
4255
|
},
|
|
4216
4256
|
drivers: n,
|
|
4217
4257
|
renderDriver: null,
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
bus: new Oi(),
|
|
4258
|
+
refreshData: _e,
|
|
4259
|
+
loadData: g,
|
|
4260
|
+
CreateNode: v,
|
|
4261
|
+
bus: new Si(),
|
|
4223
4262
|
unwatch: [],
|
|
4224
|
-
options:
|
|
4263
|
+
options: mr({}),
|
|
4225
4264
|
extendApiFn: l,
|
|
4226
4265
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4227
|
-
tmpData:
|
|
4228
|
-
}), a.forEach((
|
|
4229
|
-
this.bus.$on(
|
|
4266
|
+
tmpData: re({})
|
|
4267
|
+
}), a.forEach((p) => {
|
|
4268
|
+
this.bus.$on(p.name, p.callback);
|
|
4230
4269
|
}), P(() => {
|
|
4231
4270
|
L(this.options, () => {
|
|
4232
4271
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4233
4272
|
}, { deep: !0 });
|
|
4234
4273
|
}), _(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);
|
|
4235
4274
|
}
|
|
4236
|
-
|
|
4275
|
+
Pe.isMobile = m, _(Pe.prototype, {
|
|
4237
4276
|
init() {
|
|
4238
4277
|
this.isSub() && this.unwatch.push(L(() => this.vm.parent.fc.options.value, () => {
|
|
4239
4278
|
this.initOptions(), this.$handle.api.refresh();
|
|
4240
4279
|
}, { 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();
|
|
4241
4280
|
},
|
|
4242
|
-
targetFormDriver(c, ...
|
|
4281
|
+
targetFormDriver(c, ...p) {
|
|
4243
4282
|
if (this.renderDriver && this.renderDriver[c])
|
|
4244
|
-
return
|
|
4283
|
+
return O(() => this.renderDriver[c](...p));
|
|
4245
4284
|
},
|
|
4246
|
-
t(c,
|
|
4247
|
-
let $ =
|
|
4248
|
-
return $ == null && ($ = ""), $ &&
|
|
4249
|
-
const
|
|
4250
|
-
$ = $.replace(
|
|
4285
|
+
t(c, p, y) {
|
|
4286
|
+
let $ = y ? y("$t." + c) : this.globalLanguageDriver(c);
|
|
4287
|
+
return $ == null && ($ = ""), $ && p && Object.keys(p).forEach((C) => {
|
|
4288
|
+
const E = new RegExp(`{${C}}`, "g");
|
|
4289
|
+
$ = $.replace(E, p[C]);
|
|
4251
4290
|
}), $;
|
|
4252
4291
|
},
|
|
4253
4292
|
globalDataDriver(c) {
|
|
4254
|
-
let
|
|
4255
|
-
const
|
|
4293
|
+
let p = c.split(".");
|
|
4294
|
+
const y = p.shift(), $ = this.options.value.globalData && this.options.value.globalData[y];
|
|
4256
4295
|
if ($) {
|
|
4257
4296
|
if ($.type === "static")
|
|
4258
|
-
return
|
|
4297
|
+
return T($.data, p);
|
|
4259
4298
|
{
|
|
4260
4299
|
let C;
|
|
4261
|
-
const
|
|
4262
|
-
if (
|
|
4263
|
-
if (
|
|
4300
|
+
const E = this.fetchCache.get($);
|
|
4301
|
+
if (E) {
|
|
4302
|
+
if (E.status && (C = T(E.data, p)), !E.loading)
|
|
4264
4303
|
return C;
|
|
4265
|
-
|
|
4304
|
+
E.loading = !1, this.fetchCache.set($, E);
|
|
4266
4305
|
} else
|
|
4267
4306
|
this.fetchCache.set($, { status: !1 });
|
|
4268
|
-
const
|
|
4269
|
-
|
|
4270
|
-
const
|
|
4271
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf($) !== -1 ? (
|
|
4272
|
-
}, $.wait || 600),
|
|
4273
|
-
this.fetchCache.set($, { status: !0, data:
|
|
4274
|
-
},
|
|
4275
|
-
if (
|
|
4276
|
-
return
|
|
4277
|
-
if (
|
|
4278
|
-
|
|
4307
|
+
const R = ce(() => {
|
|
4308
|
+
le();
|
|
4309
|
+
const H = this.fetchCache.get($);
|
|
4310
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf($) !== -1 ? (H && (H.loading = !0, this.fetchCache.set($, H)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete($);
|
|
4311
|
+
}, $.wait || 600), ae = (H) => {
|
|
4312
|
+
this.fetchCache.set($, { status: !0, data: H }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4313
|
+
}, K = (H, ue) => {
|
|
4314
|
+
if (ue && $.watch === !1)
|
|
4315
|
+
return le();
|
|
4316
|
+
if (ue) {
|
|
4317
|
+
R();
|
|
4279
4318
|
return;
|
|
4280
4319
|
}
|
|
4281
|
-
const
|
|
4282
|
-
this.$handle.api.fetch(
|
|
4283
|
-
|
|
4284
|
-
}).catch((
|
|
4285
|
-
|
|
4320
|
+
const he = this.$handle.loadFetchVar(Je($), H);
|
|
4321
|
+
this.$handle.api.fetch(he).then((ee) => {
|
|
4322
|
+
ae(ee);
|
|
4323
|
+
}).catch((ee) => {
|
|
4324
|
+
ae(null);
|
|
4286
4325
|
});
|
|
4287
|
-
},
|
|
4288
|
-
return this.unwatch.push(
|
|
4326
|
+
}, le = this.watchLoadData(K);
|
|
4327
|
+
return this.unwatch.push(le), C;
|
|
4289
4328
|
}
|
|
4290
4329
|
}
|
|
4291
4330
|
},
|
|
@@ -4294,81 +4333,90 @@ function Wt(t) {
|
|
|
4294
4333
|
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4295
4334
|
},
|
|
4296
4335
|
globalLanguageDriver(c) {
|
|
4297
|
-
let
|
|
4298
|
-
if (
|
|
4336
|
+
let p = this.vm.top.$props.locale, y;
|
|
4337
|
+
if (p && typeof p == "object" && (y = T(p, c)), y == null) {
|
|
4299
4338
|
const $ = this.options.value.language || {}, C = this.getLocale();
|
|
4300
|
-
|
|
4339
|
+
y = T($[C], c);
|
|
4301
4340
|
}
|
|
4302
|
-
return
|
|
4341
|
+
return y;
|
|
4303
4342
|
},
|
|
4304
4343
|
globalVarDriver(c) {
|
|
4305
|
-
|
|
4306
|
-
const g = d.shift(), $ = this.options.value.globalVariable && this.options.value.globalVariable[g];
|
|
4344
|
+
const y = c.split(".").shift(), $ = this.options.value.globalVariable && this.options.value.globalVariable[y];
|
|
4307
4345
|
if ($) {
|
|
4308
4346
|
const C = h.Function($) ? $ : W($.handle);
|
|
4309
|
-
if (C)
|
|
4310
|
-
|
|
4347
|
+
if (C) {
|
|
4348
|
+
let E;
|
|
4349
|
+
const R = this.watchLoadData((ae, K) => {
|
|
4350
|
+
K ? (this.bus.$emit("$loadData.$var." + y), R()) : E = C(ae, this.$handle.api);
|
|
4351
|
+
});
|
|
4352
|
+
return this.unwatch.push(R), E;
|
|
4353
|
+
}
|
|
4311
4354
|
}
|
|
4312
4355
|
},
|
|
4313
|
-
setData(c,
|
|
4314
|
-
|
|
4356
|
+
setData(c, p, y) {
|
|
4357
|
+
y ? Ve(c, p) : (ie(this.vm.top.fc.tmpData, c, p), this.bus.$emit("$loadData." + c));
|
|
4315
4358
|
},
|
|
4316
|
-
getLoadData(c,
|
|
4317
|
-
let
|
|
4359
|
+
getLoadData(c, p) {
|
|
4360
|
+
let y = null;
|
|
4318
4361
|
if (c != null) {
|
|
4319
4362
|
let $ = c.split(".");
|
|
4320
4363
|
const C = $.shift();
|
|
4321
4364
|
if (C === "$topForm")
|
|
4322
|
-
|
|
4365
|
+
y = this.$handle.api.top.formData();
|
|
4323
4366
|
else if (C === "$form")
|
|
4324
|
-
|
|
4367
|
+
y = this.$handle.api.formData();
|
|
4325
4368
|
else if (C === "$options")
|
|
4326
|
-
|
|
4369
|
+
y = this.options.value;
|
|
4327
4370
|
else if (C === "$globalData")
|
|
4328
|
-
|
|
4371
|
+
y = this.globalDataDriver($.join(".")), $ = [];
|
|
4329
4372
|
else if (C === "$var")
|
|
4330
|
-
|
|
4373
|
+
y = this.globalVarDriver($.join(".")), $ = [];
|
|
4331
4374
|
else if (C === "$locale")
|
|
4332
|
-
|
|
4375
|
+
y = this.getLocale(), $ = [];
|
|
4333
4376
|
else if (C === "$t")
|
|
4334
|
-
|
|
4377
|
+
y = this.globalLanguageDriver($.join(".")), $ = [];
|
|
4335
4378
|
else {
|
|
4336
|
-
|
|
4337
|
-
|
|
4379
|
+
if (C === "$preview")
|
|
4380
|
+
return this.$handle.preview;
|
|
4381
|
+
{
|
|
4382
|
+
const E = this.vm.top.fc.tmpData;
|
|
4383
|
+
k(E, C) || F(E, C, Fe), y = E[C] !== Fe ? T(E, c) : nt(c), $ = [];
|
|
4384
|
+
}
|
|
4338
4385
|
}
|
|
4339
|
-
|
|
4386
|
+
y && $.length && (y = T(y, $));
|
|
4340
4387
|
}
|
|
4341
|
-
return
|
|
4342
|
-
},
|
|
4343
|
-
watchLoadData(c,
|
|
4344
|
-
let
|
|
4345
|
-
const $ = (
|
|
4346
|
-
|
|
4347
|
-
c(C,
|
|
4348
|
-
})
|
|
4349
|
-
}, C = (
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4388
|
+
return y == null || y === "" ? p : y;
|
|
4389
|
+
},
|
|
4390
|
+
watchLoadData(c, p) {
|
|
4391
|
+
let y = {};
|
|
4392
|
+
const $ = (R) => {
|
|
4393
|
+
O(() => {
|
|
4394
|
+
c(C, R);
|
|
4395
|
+
});
|
|
4396
|
+
}, C = (R, ae) => {
|
|
4397
|
+
let K;
|
|
4398
|
+
if (typeof R == "object" && (K = R.getValue, R = R.id), y[R])
|
|
4399
|
+
return y[R].val;
|
|
4400
|
+
const le = pe(() => K ? K() : this.getLoadData(R, ae)), H = R.split("."), ue = H.shift(), he = H.shift() || "", ee = ce(() => {
|
|
4401
|
+
const Be = K ? K() : this.getLoadData(R, ae);
|
|
4402
|
+
if (y[R])
|
|
4403
|
+
JSON.stringify(Be) !== JSON.stringify(y[R].val) && (y[R].val = Be, $(!0));
|
|
4356
4404
|
else return;
|
|
4357
|
-
},
|
|
4358
|
-
|
|
4405
|
+
}, p || 0), rr = L(le, (Be) => {
|
|
4406
|
+
ee();
|
|
4359
4407
|
});
|
|
4360
|
-
return this.bus.$on("$loadData." +
|
|
4408
|
+
return this.bus.$on("$loadData." + ue, ee), he && this.bus.$on("$loadData." + ue + "." + he, ee), y[R] = {
|
|
4361
4409
|
fn: () => {
|
|
4362
|
-
this.bus.$off("$loadData." +
|
|
4410
|
+
this.bus.$off("$loadData." + ue, ee), he && this.bus.$off("$loadData." + ue + "." + he, ee), rr();
|
|
4363
4411
|
},
|
|
4364
|
-
val:
|
|
4365
|
-
},
|
|
4412
|
+
val: le.value
|
|
4413
|
+
}, le.value;
|
|
4366
4414
|
};
|
|
4367
4415
|
$(!1);
|
|
4368
|
-
const
|
|
4369
|
-
Object.keys(
|
|
4416
|
+
const E = () => {
|
|
4417
|
+
Object.keys(y).forEach((R) => y[R].fn()), y = {};
|
|
4370
4418
|
};
|
|
4371
|
-
return this.unwatch.push(
|
|
4419
|
+
return this.unwatch.push(E), E;
|
|
4372
4420
|
},
|
|
4373
4421
|
isSub() {
|
|
4374
4422
|
return this.vm.parent && this.vm.extendOption;
|
|
@@ -4381,13 +4429,13 @@ function Wt(t) {
|
|
|
4381
4429
|
resetBtn: {},
|
|
4382
4430
|
globalEvent: {},
|
|
4383
4431
|
globalData: {}
|
|
4384
|
-
}, J(
|
|
4432
|
+
}, J(d));
|
|
4385
4433
|
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);
|
|
4386
4434
|
},
|
|
4387
|
-
mergeOptions(c,
|
|
4388
|
-
return
|
|
4389
|
-
delete
|
|
4390
|
-
}),
|
|
4435
|
+
mergeOptions(c, p, y) {
|
|
4436
|
+
return p = b({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach(($) => {
|
|
4437
|
+
delete p[$];
|
|
4438
|
+
}), p.global && (c.global = Jr(c.global, p.global), delete p.global), this.$handle.$manager.mergeOptions([p], c), c;
|
|
4391
4439
|
},
|
|
4392
4440
|
updateOptions(c) {
|
|
4393
4441
|
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
@@ -4420,70 +4468,70 @@ function Wt(t) {
|
|
|
4420
4468
|
_(c, {
|
|
4421
4469
|
version: t.version,
|
|
4422
4470
|
ui: t.ui,
|
|
4423
|
-
isMobile:
|
|
4471
|
+
isMobile: m,
|
|
4424
4472
|
extendApi: Yt,
|
|
4425
4473
|
getData: nt,
|
|
4426
|
-
setDataDriver:
|
|
4427
|
-
setData:
|
|
4474
|
+
setDataDriver: Ce,
|
|
4475
|
+
setData: Ve,
|
|
4428
4476
|
removeData: xt,
|
|
4429
|
-
refreshData:
|
|
4477
|
+
refreshData: _e,
|
|
4430
4478
|
maker: f,
|
|
4431
|
-
component:
|
|
4432
|
-
directive:
|
|
4479
|
+
component: D,
|
|
4480
|
+
directive: N,
|
|
4433
4481
|
setModelField: Xt,
|
|
4434
4482
|
setFormula: Qt,
|
|
4435
4483
|
setDriver: Zt,
|
|
4436
|
-
register:
|
|
4437
|
-
$vnode:
|
|
4438
|
-
parser:
|
|
4439
|
-
use:
|
|
4484
|
+
register: Ae,
|
|
4485
|
+
$vnode: se,
|
|
4486
|
+
parser: S,
|
|
4487
|
+
use: be,
|
|
4440
4488
|
factory: Kt,
|
|
4441
|
-
componentAlias:
|
|
4489
|
+
componentAlias: ve,
|
|
4442
4490
|
copyRule: Pt,
|
|
4443
4491
|
copyRules: Bt,
|
|
4444
|
-
mergeRule:
|
|
4492
|
+
mergeRule: Y,
|
|
4445
4493
|
fetch: Ut,
|
|
4446
4494
|
$form: B,
|
|
4447
4495
|
parseFn: W,
|
|
4448
4496
|
parseJson: Vt,
|
|
4449
4497
|
toJson: et,
|
|
4450
4498
|
useApp: V,
|
|
4451
|
-
getApi:
|
|
4499
|
+
getApi: x,
|
|
4452
4500
|
on: er
|
|
4453
4501
|
});
|
|
4454
4502
|
}
|
|
4455
4503
|
function tr(c) {
|
|
4456
4504
|
_(c, {
|
|
4457
|
-
create:
|
|
4458
|
-
install(
|
|
4459
|
-
if (
|
|
4460
|
-
|
|
4461
|
-
const $ = function(
|
|
4462
|
-
return
|
|
4505
|
+
create: oe,
|
|
4506
|
+
install(p, y) {
|
|
4507
|
+
if (d = b(b({}, d), y || {}), p._installedFormCreate === !0) return;
|
|
4508
|
+
p._installedFormCreate = !0;
|
|
4509
|
+
const $ = function(E, R = {}) {
|
|
4510
|
+
return oe(E, R, this);
|
|
4463
4511
|
};
|
|
4464
|
-
st($),
|
|
4512
|
+
st($), p.prototype.$formCreate = $;
|
|
4465
4513
|
const C = B();
|
|
4466
|
-
|
|
4467
|
-
|
|
4514
|
+
p.component(C.name, C), p.component("FcFragment", se()), o.forEach((E) => {
|
|
4515
|
+
O(() => E(c, p));
|
|
4468
4516
|
});
|
|
4469
4517
|
}
|
|
4470
4518
|
});
|
|
4471
4519
|
}
|
|
4472
|
-
if (st(
|
|
4520
|
+
if (st(I), tr(I), Ce("$cookie", ji), Ce("$localStorage", Ii), Ce("$sessionStorage", Ai), v.use({ fragment: "fcFragment" }), t.install && oe.use(t), S(Ri), t.inherit) {
|
|
4473
4521
|
const c = t.inherit;
|
|
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 && _(
|
|
4522
|
+
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 && _(g, c.loadData), c.formulas && _(w, c.formulas);
|
|
4475
4523
|
}
|
|
4476
|
-
const
|
|
4477
|
-
return
|
|
4524
|
+
const we = B();
|
|
4525
|
+
return Se(we, I), Object.defineProperties(we, {
|
|
4478
4526
|
fetch: {
|
|
4479
4527
|
get() {
|
|
4480
|
-
return
|
|
4528
|
+
return I.fetch;
|
|
4481
4529
|
},
|
|
4482
4530
|
set(c) {
|
|
4483
|
-
|
|
4531
|
+
I.fetch = c;
|
|
4484
4532
|
}
|
|
4485
4533
|
}
|
|
4486
|
-
}),
|
|
4534
|
+
}), we.util = I, we;
|
|
4487
4535
|
}
|
|
4488
4536
|
function Me(t) {
|
|
4489
4537
|
if (h.Date(t))
|
|
@@ -4493,7 +4541,7 @@ function Me(t) {
|
|
|
4493
4541
|
return e.toString() === "Invalid Date" ? t : e;
|
|
4494
4542
|
}
|
|
4495
4543
|
}
|
|
4496
|
-
const bt = "datePicker",
|
|
4544
|
+
const bt = "datePicker", Ni = {
|
|
4497
4545
|
name: bt,
|
|
4498
4546
|
maker: function() {
|
|
4499
4547
|
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = A(bt, { type: e.toLowerCase() }), t), {});
|
|
@@ -4525,7 +4573,7 @@ const bt = "datePicker", Ti = {
|
|
|
4525
4573
|
mounted(t) {
|
|
4526
4574
|
t.rule.value = this.toValue(t.$handle.getFormData(t), t);
|
|
4527
4575
|
}
|
|
4528
|
-
}, Ue = "hidden",
|
|
4576
|
+
}, Ue = "hidden", Mi = {
|
|
4529
4577
|
name: Ue,
|
|
4530
4578
|
maker: {
|
|
4531
4579
|
[Ue]: (t, e) => A(Ue)("", t, e)
|
|
@@ -4533,7 +4581,7 @@ const bt = "datePicker", Ti = {
|
|
|
4533
4581
|
render() {
|
|
4534
4582
|
return [];
|
|
4535
4583
|
}
|
|
4536
|
-
}, qe = "input",
|
|
4584
|
+
}, qe = "input", Ui = {
|
|
4537
4585
|
name: qe,
|
|
4538
4586
|
maker: function() {
|
|
4539
4587
|
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = A(qe, { type: r }), e), {});
|
|
@@ -4543,7 +4591,7 @@ const bt = "datePicker", Ti = {
|
|
|
4543
4591
|
let { props: e } = t.prop;
|
|
4544
4592
|
e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4545
4593
|
}
|
|
4546
|
-
}, _t = "slider",
|
|
4594
|
+
}, _t = "slider", qi = {
|
|
4547
4595
|
name: _t,
|
|
4548
4596
|
maker: {
|
|
4549
4597
|
sliderRange: A(_t, { range: !0 })
|
|
@@ -4552,27 +4600,27 @@ const bt = "datePicker", Ti = {
|
|
|
4552
4600
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
4553
4601
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
4554
4602
|
}
|
|
4555
|
-
},
|
|
4603
|
+
}, Gi = {
|
|
4556
4604
|
name: "switch",
|
|
4557
4605
|
mergeProp(t) {
|
|
4558
4606
|
const e = t.prop.props.slot || {}, r = t.prop.scopedSlots || {};
|
|
4559
4607
|
e.open && (r.open = () => e.open), e.close && (r.close = () => e.close), t.prop.scopedSlots = r;
|
|
4560
4608
|
}
|
|
4561
|
-
},
|
|
4609
|
+
}, Hi = {
|
|
4562
4610
|
name: "FcRow",
|
|
4563
4611
|
render(t, e) {
|
|
4564
4612
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
4565
4613
|
e.vNode.row(e.prop, t)
|
|
4566
4614
|
]);
|
|
4567
4615
|
}
|
|
4568
|
-
},
|
|
4569
|
-
Ti,
|
|
4616
|
+
}, Ji = [
|
|
4570
4617
|
Ni,
|
|
4571
4618
|
Mi,
|
|
4572
4619
|
Ui,
|
|
4573
4620
|
qi,
|
|
4574
|
-
Gi
|
|
4575
|
-
|
|
4621
|
+
Gi,
|
|
4622
|
+
Hi
|
|
4623
|
+
], Wi = {
|
|
4576
4624
|
button: "iButton",
|
|
4577
4625
|
icon: "Icon",
|
|
4578
4626
|
slider: "Slider",
|
|
@@ -4599,21 +4647,21 @@ const bt = "datePicker", Ti = {
|
|
|
4599
4647
|
array: "fcGroup",
|
|
4600
4648
|
subForm: "fcSubForm",
|
|
4601
4649
|
object: "fcSubForm"
|
|
4602
|
-
},
|
|
4650
|
+
}, De = {
|
|
4603
4651
|
resetBtnType: "default",
|
|
4604
4652
|
resetBtnIcon: "md-refresh",
|
|
4605
4653
|
infoIcon: "ios-information-circle-outline"
|
|
4606
4654
|
};
|
|
4607
|
-
function
|
|
4655
|
+
function zi() {
|
|
4608
4656
|
return {
|
|
4609
4657
|
type: "poptip",
|
|
4610
4658
|
trigger: "hover",
|
|
4611
4659
|
placement: "top-start",
|
|
4612
4660
|
wordWrap: !0,
|
|
4613
|
-
icon:
|
|
4661
|
+
icon: De.infoIcon
|
|
4614
4662
|
};
|
|
4615
4663
|
}
|
|
4616
|
-
function
|
|
4664
|
+
function Ki() {
|
|
4617
4665
|
return {
|
|
4618
4666
|
form: {
|
|
4619
4667
|
inline: !1,
|
|
@@ -4635,9 +4683,9 @@ function zi() {
|
|
|
4635
4683
|
click: void 0
|
|
4636
4684
|
},
|
|
4637
4685
|
resetBtn: {
|
|
4638
|
-
type:
|
|
4686
|
+
type: De.resetBtnType,
|
|
4639
4687
|
disabled: !1,
|
|
4640
|
-
icon:
|
|
4688
|
+
icon: De.resetBtnIcon,
|
|
4641
4689
|
innerText: "",
|
|
4642
4690
|
loading: !1,
|
|
4643
4691
|
show: !1,
|
|
@@ -4648,17 +4696,17 @@ function zi() {
|
|
|
4648
4696
|
function Ct(t, e) {
|
|
4649
4697
|
k(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4650
4698
|
}
|
|
4651
|
-
function
|
|
4699
|
+
function X(t) {
|
|
4652
4700
|
return t === !1;
|
|
4653
4701
|
}
|
|
4654
|
-
function
|
|
4702
|
+
function Xi(t, e) {
|
|
4655
4703
|
k(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4656
4704
|
}
|
|
4657
4705
|
function Ge(t) {
|
|
4658
4706
|
const e = b({}, t);
|
|
4659
4707
|
return delete e.children, e;
|
|
4660
4708
|
}
|
|
4661
|
-
const
|
|
4709
|
+
const Qi = {
|
|
4662
4710
|
validate() {
|
|
4663
4711
|
const t = this.form();
|
|
4664
4712
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -4677,7 +4725,7 @@ const Xi = {
|
|
|
4677
4725
|
},
|
|
4678
4726
|
tidyOptions(t) {
|
|
4679
4727
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
4680
|
-
|
|
4728
|
+
Xi(t, e);
|
|
4681
4729
|
}), t;
|
|
4682
4730
|
},
|
|
4683
4731
|
tidyRule({ prop: t }) {
|
|
@@ -4685,20 +4733,20 @@ const Xi = {
|
|
|
4685
4733
|
},
|
|
4686
4734
|
mergeProp(t) {
|
|
4687
4735
|
const e = {
|
|
4688
|
-
info:
|
|
4736
|
+
info: zi(),
|
|
4689
4737
|
title: {},
|
|
4690
4738
|
col: { span: 24 },
|
|
4691
4739
|
wrap: {}
|
|
4692
4740
|
};
|
|
4693
4741
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
4694
|
-
t.prop[r] =
|
|
4742
|
+
t.prop[r] = Z([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
4695
4743
|
}), this.setSize(t.prop.props);
|
|
4696
4744
|
},
|
|
4697
4745
|
setSize(t) {
|
|
4698
4746
|
!t.size && this.options.form.size && (t.size = this.options.form.size);
|
|
4699
4747
|
},
|
|
4700
4748
|
getDefaultOptions() {
|
|
4701
|
-
return
|
|
4749
|
+
return Ki();
|
|
4702
4750
|
},
|
|
4703
4751
|
update() {
|
|
4704
4752
|
const t = this.options.form;
|
|
@@ -4721,13 +4769,13 @@ const Xi = {
|
|
|
4721
4769
|
});
|
|
4722
4770
|
},
|
|
4723
4771
|
render(t) {
|
|
4724
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
4772
|
+
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, X(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
4725
4773
|
},
|
|
4726
4774
|
makeWrap(t, e) {
|
|
4727
4775
|
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;
|
|
4728
4776
|
delete r.wrap.title;
|
|
4729
|
-
const u =
|
|
4730
|
-
props:
|
|
4777
|
+
const u = X(r.wrap.show) ? e : this.$r(Z([r.wrap, {
|
|
4778
|
+
props: U(b({
|
|
4731
4779
|
labelWidth: o
|
|
4732
4780
|
}, Ge(r.wrap || {})), {
|
|
4733
4781
|
prop: t.id,
|
|
@@ -4738,39 +4786,39 @@ const Xi = {
|
|
|
4738
4786
|
ref: t.wrapRef,
|
|
4739
4787
|
type: "formItem"
|
|
4740
4788
|
}]), b({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
4741
|
-
return a === !0 ||
|
|
4789
|
+
return a === !0 || X(l) || X(s.show) ? u : this.makeCol(r, i, [u]);
|
|
4742
4790
|
},
|
|
4743
4791
|
isTitle(t) {
|
|
4744
4792
|
if (this.options.form.title === !1) return !1;
|
|
4745
4793
|
const e = t.title;
|
|
4746
|
-
return !(!e.title && !e.native ||
|
|
4794
|
+
return !(!e.title && !e.native || X(e.show));
|
|
4747
4795
|
},
|
|
4748
4796
|
makeInfo(t, e, r) {
|
|
4749
|
-
var u, f,
|
|
4797
|
+
var u, f, d;
|
|
4750
4798
|
const i = b({}, t.title), s = b({}, t.info), n = this.options.form, o = this.getSlot("title"), a = [o ? o({
|
|
4751
4799
|
title: (u = r.refRule) == null ? void 0 : u.__$title.value,
|
|
4752
4800
|
rule: r.rule,
|
|
4753
4801
|
options: this.options
|
|
4754
4802
|
}) : ((f = r.refRule) == null ? void 0 : f.__$title.value) + (n.labelSuffix || n["label-suffix"] || "")];
|
|
4755
|
-
if (!
|
|
4756
|
-
const
|
|
4803
|
+
if (!X(s.show) && (s.info || s.native) && !X(s.icon)) {
|
|
4804
|
+
const m = {
|
|
4757
4805
|
type: s.type || "poptip",
|
|
4758
4806
|
props: Ge(s),
|
|
4759
4807
|
key: `${e}pop`,
|
|
4760
4808
|
slot: "label"
|
|
4761
4809
|
};
|
|
4762
|
-
delete
|
|
4763
|
-
const
|
|
4764
|
-
s.info && !k(
|
|
4810
|
+
delete m.props.icon, delete m.props.show, delete m.props.info, delete m.props.align, delete m.props.native;
|
|
4811
|
+
const g = "content";
|
|
4812
|
+
s.info && !k(m.props, g) && (m.props[g] = (d = r.refRule) == null ? void 0 : d.__$info.value), a[s.align !== "left" ? "unshift" : "push"](this.$r(Z([s, m]), [
|
|
4765
4813
|
this.$r({
|
|
4766
4814
|
type: "icon",
|
|
4767
|
-
props: { type: s.icon === !0 ?
|
|
4815
|
+
props: { type: s.icon === !0 ? De.infoIcon : s.icon, size: 16 },
|
|
4768
4816
|
style: "margin-top: -1px",
|
|
4769
4817
|
key: `${e}i`
|
|
4770
4818
|
})
|
|
4771
4819
|
]));
|
|
4772
4820
|
}
|
|
4773
|
-
const l =
|
|
4821
|
+
const l = Z([i, {
|
|
4774
4822
|
props: Ge(i),
|
|
4775
4823
|
key: `${e}tit`,
|
|
4776
4824
|
class: "fc-form-title",
|
|
@@ -4799,7 +4847,7 @@ const Xi = {
|
|
|
4799
4847
|
},
|
|
4800
4848
|
makeFormBtn() {
|
|
4801
4849
|
let t = [];
|
|
4802
|
-
if (
|
|
4850
|
+
if (X(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), X(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4803
4851
|
return;
|
|
4804
4852
|
const e = this.$r({
|
|
4805
4853
|
type: "formItem",
|
|
@@ -4846,13 +4894,13 @@ const Xi = {
|
|
|
4846
4894
|
key: `${this.key}b1`
|
|
4847
4895
|
}, [e]);
|
|
4848
4896
|
}
|
|
4849
|
-
},
|
|
4850
|
-
function
|
|
4851
|
-
|
|
4897
|
+
}, ne = {}, Zi = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
|
|
4898
|
+
function Yi(t) {
|
|
4899
|
+
Zi.forEach((e) => {
|
|
4852
4900
|
t[e] = A(e);
|
|
4853
4901
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4854
4902
|
}
|
|
4855
|
-
function
|
|
4903
|
+
function xi(t) {
|
|
4856
4904
|
const e = "upload", r = {
|
|
4857
4905
|
image: ["image", 0],
|
|
4858
4906
|
file: ["file", 0],
|
|
@@ -4861,19 +4909,19 @@ function Yi(t) {
|
|
|
4861
4909
|
};
|
|
4862
4910
|
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;
|
|
4863
4911
|
}
|
|
4864
|
-
function
|
|
4912
|
+
function en(t) {
|
|
4865
4913
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4866
4914
|
Object.keys(r).reduce((i, s) => (i[s] = A(e, { type: r[s] }), i), t);
|
|
4867
4915
|
}
|
|
4868
|
-
function
|
|
4916
|
+
function tn(t) {
|
|
4869
4917
|
const e = "timePicker";
|
|
4870
4918
|
t.time = A(e, { type: "time" }), t.timeRange = A(e, { type: "timerange" });
|
|
4871
4919
|
}
|
|
4872
|
-
function
|
|
4920
|
+
function rn(t) {
|
|
4873
4921
|
const e = "select";
|
|
4874
4922
|
t.selectMultiple = A(e, { multiple: !0 }), t.selectOne = A(e, { multiple: !1 });
|
|
4875
4923
|
}
|
|
4876
|
-
function
|
|
4924
|
+
function nn(t) {
|
|
4877
4925
|
const e = "frame", r = {
|
|
4878
4926
|
frameInputs: ["input", 0],
|
|
4879
4927
|
frameFiles: ["file", 0],
|
|
@@ -4884,16 +4932,16 @@ function rn(t) {
|
|
|
4884
4932
|
};
|
|
4885
4933
|
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;
|
|
4886
4934
|
}
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4935
|
+
Yi(ne);
|
|
4936
|
+
xi(ne);
|
|
4937
|
+
en(ne);
|
|
4938
|
+
rn(ne);
|
|
4939
|
+
nn(ne);
|
|
4940
|
+
tn(ne);
|
|
4893
4941
|
function wt(t, e) {
|
|
4894
4942
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4895
4943
|
}
|
|
4896
|
-
function
|
|
4944
|
+
function sn(t, e) {
|
|
4897
4945
|
return {
|
|
4898
4946
|
formEl() {
|
|
4899
4947
|
return e.$manager.form();
|
|
@@ -4920,7 +4968,7 @@ function nn(t, e) {
|
|
|
4920
4968
|
const o = e.getFieldCtx(r);
|
|
4921
4969
|
if (!o) return;
|
|
4922
4970
|
const a = e.subForm[o.id], l = [e.$manager.validateField(o.id)];
|
|
4923
|
-
|
|
4971
|
+
G(a).forEach((u) => {
|
|
4924
4972
|
l.push(u.validate());
|
|
4925
4973
|
}), Promise.all(l).then(() => {
|
|
4926
4974
|
s(null), i && i(null);
|
|
@@ -4980,9 +5028,9 @@ function nn(t, e) {
|
|
|
4980
5028
|
return new Promise((s, n) => {
|
|
4981
5029
|
t.validate().then(() => {
|
|
4982
5030
|
let o = t.formData();
|
|
4983
|
-
h.Function(r) &&
|
|
5031
|
+
h.Function(r) && O(() => r(o, t)), h.Function(e.options.onSubmit) && O(() => e.options.onSubmit(o, t)), e.vm.emit("submit", o, t), s(o);
|
|
4984
5032
|
}).catch((...o) => {
|
|
4985
|
-
h.Function(i) &&
|
|
5033
|
+
h.Function(i) && O(() => i(t, ...o)), n(...o);
|
|
4986
5034
|
});
|
|
4987
5035
|
});
|
|
4988
5036
|
}
|
|
@@ -4991,7 +5039,7 @@ function nn(t, e) {
|
|
|
4991
5039
|
const zt = {
|
|
4992
5040
|
name: "required",
|
|
4993
5041
|
load(t, e, r) {
|
|
4994
|
-
const i =
|
|
5042
|
+
const i = on(t.getValue());
|
|
4995
5043
|
if (i.required === !1)
|
|
4996
5044
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
4997
5045
|
else {
|
|
@@ -5015,25 +5063,25 @@ const zt = {
|
|
|
5015
5063
|
zt.load(...t);
|
|
5016
5064
|
}
|
|
5017
5065
|
};
|
|
5018
|
-
function
|
|
5066
|
+
function on(t) {
|
|
5019
5067
|
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 : {};
|
|
5020
5068
|
}
|
|
5021
|
-
function
|
|
5022
|
-
t.componentAlias(
|
|
5069
|
+
function an(t) {
|
|
5070
|
+
t.componentAlias(Wi), Nr.forEach((e) => {
|
|
5023
5071
|
t.component(e.name, e);
|
|
5024
|
-
}), t.register(zt),
|
|
5072
|
+
}), t.register(zt), Ji.forEach((e) => {
|
|
5025
5073
|
t.parser(e);
|
|
5026
|
-
}), Object.keys(
|
|
5027
|
-
t.maker[e] =
|
|
5074
|
+
}), Object.keys(ne).forEach((e) => {
|
|
5075
|
+
t.maker[e] = ne[e];
|
|
5028
5076
|
});
|
|
5029
5077
|
}
|
|
5030
|
-
function
|
|
5078
|
+
function ln() {
|
|
5031
5079
|
return Wt({
|
|
5032
5080
|
ui: "iview",
|
|
5033
|
-
version: "2.7.
|
|
5034
|
-
manager:
|
|
5035
|
-
install:
|
|
5036
|
-
extendApi:
|
|
5081
|
+
version: "2.7.3",
|
|
5082
|
+
manager: Qi,
|
|
5083
|
+
install: an,
|
|
5084
|
+
extendApi: sn,
|
|
5037
5085
|
attrs: {
|
|
5038
5086
|
normal: ["col", "wrap"],
|
|
5039
5087
|
array: ["className"],
|
|
@@ -5041,10 +5089,10 @@ function an() {
|
|
|
5041
5089
|
}
|
|
5042
5090
|
});
|
|
5043
5091
|
}
|
|
5044
|
-
const Qe =
|
|
5092
|
+
const Qe = ln();
|
|
5045
5093
|
typeof window != "undefined" && (window.formCreate = Qe, window.Vue && Qe.install(window.Vue));
|
|
5046
|
-
const
|
|
5094
|
+
const cn = Qe.maker;
|
|
5047
5095
|
export {
|
|
5048
5096
|
Qe as default,
|
|
5049
|
-
|
|
5097
|
+
cn as maker
|
|
5050
5098
|
};
|