@form-create/view-design 2.6.0-alpha.0 → 2.6.1
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/README.md +0 -0
- package/dist/form-create.esm.js +703 -669
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +7 -6
- package/types/config.d.ts +18 -18
package/dist/form-create.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/view-design v2.6.
|
|
3
|
+
* @form-create/view-design v2.6.1
|
|
4
4
|
* (c) 2018-2024 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
@@ -10,29 +10,29 @@
|
|
|
10
10
|
var vt = Object.defineProperty, bt = Object.defineProperties;
|
|
11
11
|
var Ct = Object.getOwnPropertyDescriptors;
|
|
12
12
|
var Fe = Object.getOwnPropertySymbols;
|
|
13
|
-
var _t = Object.prototype.hasOwnProperty,
|
|
13
|
+
var _t = Object.prototype.hasOwnProperty, Ot = Object.prototype.propertyIsEnumerable;
|
|
14
14
|
var Se = (t, e, r) => e in t ? vt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, y = (t, e) => {
|
|
15
15
|
for (var r in e || (e = {}))
|
|
16
16
|
_t.call(e, r) && Se(t, r, e[r]);
|
|
17
17
|
if (Fe)
|
|
18
18
|
for (var r of Fe(e))
|
|
19
|
-
|
|
19
|
+
Ot.call(e, r) && Se(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
},
|
|
22
|
-
import
|
|
23
|
-
function
|
|
21
|
+
}, q = (t, e) => bt(t, Ct(e));
|
|
22
|
+
import P from "vue";
|
|
23
|
+
function kt(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function ae() {
|
|
27
|
+
return ae = Object.assign ? Object.assign.bind() : function(t) {
|
|
28
28
|
for (var e, r = 1; r < arguments.length; r++) for (var i in e = arguments[r], e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
|
|
29
29
|
return t;
|
|
30
|
-
},
|
|
30
|
+
}, ae.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
var wt = ["attrs", "props", "domProps"], Ft = ["class", "style", "directives"], St = ["on", "nativeOn"],
|
|
32
|
+
var wt = ["attrs", "props", "domProps"], Ft = ["class", "style", "directives"], St = ["on", "nativeOn"], Et = 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 (wt.indexOf(i) !== -1) e[i] =
|
|
35
|
+
else if (wt.indexOf(i) !== -1) e[i] = ae({}, e[i], r[i]);
|
|
36
36
|
else if (Ft.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);
|
|
@@ -41,16 +41,16 @@ var wt = ["attrs", "props", "domProps"], Ft = ["class", "style", "directives"],
|
|
|
41
41
|
var a = e[i][o] instanceof Array ? e[i][o] : [e[i][o]], u = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
|
|
42
42
|
e[i][o] = [].concat(a, u);
|
|
43
43
|
} else e[i][o] = r[i][o];
|
|
44
|
-
else if (i === "hook") for (var l in r[i]) e[i][l] = e[i][l] ?
|
|
44
|
+
else if (i === "hook") for (var l in r[i]) e[i][l] = e[i][l] ? Rt(e[i][l], r[i][l]) : r[i][l];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, Rt = function(t, e) {
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
}, It =
|
|
53
|
-
const
|
|
52
|
+
}, It = Et;
|
|
53
|
+
const C = /* @__PURE__ */ kt(It);
|
|
54
54
|
function ee(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => ((!e || e.indexOf(i) === -1) && r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
@@ -99,7 +99,8 @@ const jt = "fcCheckbox", At = {
|
|
|
99
99
|
this.update();
|
|
100
100
|
},
|
|
101
101
|
render() {
|
|
102
|
-
|
|
102
|
+
const t = arguments[0];
|
|
103
|
+
return t("CheckboxGroup", C([{}, this.formCreateInject.prop, {
|
|
103
104
|
ref: "el"
|
|
104
105
|
}, {
|
|
105
106
|
props: {
|
|
@@ -109,12 +110,12 @@ const jt = "fcCheckbox", At = {
|
|
|
109
110
|
on: {
|
|
110
111
|
input: this.onInput
|
|
111
112
|
}
|
|
112
|
-
}]), [this.options().map((
|
|
113
|
-
const
|
|
114
|
-
return delete
|
|
115
|
-
props:
|
|
113
|
+
}]), [this.options().map((e, r) => {
|
|
114
|
+
const i = y({}, e);
|
|
115
|
+
return delete i.value, t("Checkbox", C([{}, {
|
|
116
|
+
props: i
|
|
116
117
|
}, {
|
|
117
|
-
key: "" +
|
|
118
|
+
key: "" + r + "-" + e.value
|
|
118
119
|
}]));
|
|
119
120
|
}), ee(this.$slots)]);
|
|
120
121
|
},
|
|
@@ -122,7 +123,7 @@ const jt = "fcCheckbox", At = {
|
|
|
122
123
|
this.$emit("fc.el", this.$refs.el);
|
|
123
124
|
}
|
|
124
125
|
};
|
|
125
|
-
function
|
|
126
|
+
function I(t) {
|
|
126
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
127
128
|
}
|
|
128
129
|
const Vt = "fcFrame";
|
|
@@ -249,7 +250,7 @@ function xe(t) {
|
|
|
249
250
|
},
|
|
250
251
|
data() {
|
|
251
252
|
return {
|
|
252
|
-
fileList:
|
|
253
|
+
fileList: I(this.value),
|
|
253
254
|
previewVisible: !1,
|
|
254
255
|
frameVisible: !1,
|
|
255
256
|
previewImage: ""
|
|
@@ -257,7 +258,7 @@ function xe(t) {
|
|
|
257
258
|
},
|
|
258
259
|
watch: {
|
|
259
260
|
value(e) {
|
|
260
|
-
this.fileList =
|
|
261
|
+
this.fileList = I(e);
|
|
261
262
|
},
|
|
262
263
|
fileList(e) {
|
|
263
264
|
const r = this.maxLength === 1 ? e[0] || "" : e;
|
|
@@ -278,15 +279,15 @@ function xe(t) {
|
|
|
278
279
|
this.disabled || this.onOpen() === !1 || (this.frameVisible = !0);
|
|
279
280
|
},
|
|
280
281
|
makeInput() {
|
|
281
|
-
const e = {
|
|
282
|
+
const e = this.$createElement, r = {
|
|
282
283
|
type: "text",
|
|
283
|
-
value: this.fileList.map((
|
|
284
|
+
value: this.fileList.map((i) => this.getSrc(i)).toString(),
|
|
284
285
|
icon: this.icon,
|
|
285
286
|
readonly: !0,
|
|
286
287
|
clearable: !1
|
|
287
288
|
};
|
|
288
|
-
return
|
|
289
|
-
props:
|
|
289
|
+
return e("Input", C([{}, {
|
|
290
|
+
props: r
|
|
290
291
|
}, {}, {
|
|
291
292
|
on: {
|
|
292
293
|
"on-click": () => this.showModel()
|
|
@@ -296,12 +297,14 @@ function xe(t) {
|
|
|
296
297
|
}]));
|
|
297
298
|
},
|
|
298
299
|
makeGroup(e) {
|
|
299
|
-
|
|
300
|
+
const r = this.$createElement;
|
|
301
|
+
return (!this.maxLength || this.fileList.length < this.maxLength) && e.push(this.makeBtn()), r("div", {
|
|
300
302
|
key: this.key("group")
|
|
301
303
|
}, [...e]);
|
|
302
304
|
},
|
|
303
305
|
makeItem(e, r) {
|
|
304
|
-
|
|
306
|
+
const i = this.$createElement;
|
|
307
|
+
return i("div", {
|
|
305
308
|
class: "fc-files",
|
|
306
309
|
key: this.key("file" + e)
|
|
307
310
|
}, [...r]);
|
|
@@ -311,16 +314,18 @@ function xe(t) {
|
|
|
311
314
|
if (r && e !== r) throw new Error("[frame]无效的字段值");
|
|
312
315
|
},
|
|
313
316
|
makeIcons(e, r) {
|
|
317
|
+
const i = this.$createElement;
|
|
314
318
|
if (this.handleIcon !== !1 || this.allowRemove === !0) {
|
|
315
|
-
const
|
|
316
|
-
return (this.type !== "file" && this.handleIcon !== !1 || this.type === "file" && this.handleIcon) &&
|
|
319
|
+
const s = [];
|
|
320
|
+
return (this.type !== "file" && this.handleIcon !== !1 || this.type === "file" && this.handleIcon) && s.push(this.makeHandleIcon(e, r)), this.allowRemove && s.push(this.makeRemoveIcon(e, r)), i("div", {
|
|
317
321
|
class: "fc-upload-cover",
|
|
318
322
|
key: this.key("uc")
|
|
319
|
-
}, [
|
|
323
|
+
}, [s]);
|
|
320
324
|
}
|
|
321
325
|
},
|
|
322
326
|
makeHandleIcon(e, r) {
|
|
323
|
-
|
|
327
|
+
const i = this.$createElement;
|
|
328
|
+
return i("icon", C([{}, {
|
|
324
329
|
props: {
|
|
325
330
|
type: this.handleIcon === !0 || this.handleIcon === void 0 ? "ios-eye-outline" : this.handleIcon
|
|
326
331
|
}
|
|
@@ -332,7 +337,8 @@ function xe(t) {
|
|
|
332
337
|
}]));
|
|
333
338
|
},
|
|
334
339
|
makeRemoveIcon(e, r) {
|
|
335
|
-
|
|
340
|
+
const i = this.$createElement;
|
|
341
|
+
return i("icon", C([{}, {
|
|
336
342
|
props: {
|
|
337
343
|
type: "ios-trash-outline"
|
|
338
344
|
}
|
|
@@ -344,32 +350,35 @@ function xe(t) {
|
|
|
344
350
|
}]));
|
|
345
351
|
},
|
|
346
352
|
makeFiles() {
|
|
347
|
-
|
|
353
|
+
const e = this.$createElement;
|
|
354
|
+
return this.makeGroup(this.fileList.map((r, i) => this.makeItem(i, [e("icon", C([{}, {
|
|
348
355
|
props: {
|
|
349
356
|
type: t.fileIcon,
|
|
350
357
|
size: 40
|
|
351
358
|
}
|
|
352
359
|
}, {
|
|
353
360
|
on: {
|
|
354
|
-
click: () => this.handleClick(
|
|
361
|
+
click: () => this.handleClick(r)
|
|
355
362
|
}
|
|
356
|
-
}])), this.makeIcons(
|
|
363
|
+
}])), this.makeIcons(r, i)])));
|
|
357
364
|
},
|
|
358
365
|
makeImages() {
|
|
359
|
-
|
|
366
|
+
const e = this.$createElement;
|
|
367
|
+
return this.makeGroup(this.fileList.map((r, i) => this.makeItem(i, [e("img", {
|
|
360
368
|
attrs: {
|
|
361
|
-
src: this.getSrc(
|
|
369
|
+
src: this.getSrc(r)
|
|
362
370
|
}
|
|
363
|
-
}), this.makeIcons(
|
|
371
|
+
}), this.makeIcons(r, i)])));
|
|
364
372
|
},
|
|
365
373
|
makeBtn() {
|
|
366
|
-
|
|
374
|
+
const e = this.$createElement;
|
|
375
|
+
return e("div", {
|
|
367
376
|
class: "fc-upload-btn",
|
|
368
377
|
on: {
|
|
369
378
|
click: () => this.showModel()
|
|
370
379
|
},
|
|
371
380
|
key: this.key("btn")
|
|
372
|
-
}, [
|
|
381
|
+
}, [e("icon", C([{}, {
|
|
373
382
|
props: {
|
|
374
383
|
type: this.icon,
|
|
375
384
|
size: 20
|
|
@@ -405,64 +414,64 @@ function xe(t) {
|
|
|
405
414
|
}
|
|
406
415
|
},
|
|
407
416
|
makeFooter() {
|
|
408
|
-
const {
|
|
409
|
-
okBtnText:
|
|
410
|
-
closeBtnText:
|
|
411
|
-
closeBtn:
|
|
412
|
-
okBtn:
|
|
413
|
-
footer:
|
|
414
|
-
} = this.$props,
|
|
415
|
-
return
|
|
417
|
+
const e = this.$createElement, {
|
|
418
|
+
okBtnText: r,
|
|
419
|
+
closeBtnText: i,
|
|
420
|
+
closeBtn: s,
|
|
421
|
+
okBtn: n,
|
|
422
|
+
footer: o
|
|
423
|
+
} = this.$props, a = [];
|
|
424
|
+
return o && (s && a.push(e("Button", {
|
|
416
425
|
on: {
|
|
417
426
|
click: () => this.onCancel() !== !1 && this.closeModel(!0)
|
|
418
427
|
}
|
|
419
|
-
}, [
|
|
428
|
+
}, [i])), n && a.push(e("Button", {
|
|
420
429
|
attrs: {
|
|
421
430
|
type: "primary"
|
|
422
431
|
},
|
|
423
432
|
on: {
|
|
424
433
|
click: () => this.onOk() !== !1 && this.closeModel()
|
|
425
434
|
}
|
|
426
|
-
}, [
|
|
435
|
+
}, [r]))), a;
|
|
427
436
|
}
|
|
428
437
|
},
|
|
429
438
|
render() {
|
|
430
|
-
const e = this.type;
|
|
431
|
-
let
|
|
432
|
-
|
|
439
|
+
const e = arguments[0], r = this.type;
|
|
440
|
+
let i;
|
|
441
|
+
r === "input" ? i = this.makeInput() : r === "image" ? i = this.makeImages() : i = this.makeFiles();
|
|
433
442
|
const {
|
|
434
|
-
width:
|
|
435
|
-
height:
|
|
436
|
-
src:
|
|
437
|
-
title:
|
|
438
|
-
modalTitle:
|
|
443
|
+
width: s,
|
|
444
|
+
height: n,
|
|
445
|
+
src: o,
|
|
446
|
+
title: a,
|
|
447
|
+
modalTitle: u
|
|
439
448
|
} = this.$props;
|
|
440
449
|
return this.$nextTick(() => {
|
|
441
450
|
this.$refs.frame && this.frameLoad(this.$refs.frame.contentWindow || {});
|
|
442
|
-
}),
|
|
451
|
+
}), e("div", {
|
|
443
452
|
class: "_fc-frame"
|
|
444
|
-
}, [
|
|
453
|
+
}, [i, e("Modal", C([{}, {
|
|
445
454
|
props: {
|
|
446
455
|
mask: this.previewMask,
|
|
447
|
-
title:
|
|
456
|
+
title: u,
|
|
448
457
|
footerHide: !0
|
|
449
458
|
}
|
|
450
459
|
}, {
|
|
451
460
|
model: {
|
|
452
461
|
value: this.previewVisible,
|
|
453
|
-
callback: (
|
|
454
|
-
this.previewVisible =
|
|
462
|
+
callback: (l) => {
|
|
463
|
+
this.previewVisible = l;
|
|
455
464
|
}
|
|
456
465
|
}
|
|
457
|
-
}]), [
|
|
466
|
+
}]), [e("img", {
|
|
458
467
|
style: "width: 100%",
|
|
459
468
|
attrs: {
|
|
460
469
|
src: this.previewImage
|
|
461
470
|
}
|
|
462
|
-
})]),
|
|
471
|
+
})]), e("Modal", C([{}, {
|
|
463
472
|
props: y({
|
|
464
|
-
width:
|
|
465
|
-
title:
|
|
473
|
+
width: s,
|
|
474
|
+
title: a
|
|
466
475
|
}, this.modal)
|
|
467
476
|
}, {
|
|
468
477
|
on: {
|
|
@@ -470,22 +479,22 @@ function xe(t) {
|
|
|
470
479
|
},
|
|
471
480
|
model: {
|
|
472
481
|
value: this.frameVisible,
|
|
473
|
-
callback: (
|
|
474
|
-
this.frameVisible =
|
|
482
|
+
callback: (l) => {
|
|
483
|
+
this.frameVisible = l;
|
|
475
484
|
}
|
|
476
485
|
}
|
|
477
|
-
}]), [this.frameVisible || !this.reload ?
|
|
486
|
+
}]), [this.frameVisible || !this.reload ? e("iframe", {
|
|
478
487
|
ref: "frame",
|
|
479
488
|
attrs: {
|
|
480
|
-
src:
|
|
489
|
+
src: o,
|
|
481
490
|
frameBorder: "0"
|
|
482
491
|
},
|
|
483
492
|
style: {
|
|
484
|
-
height:
|
|
493
|
+
height: n,
|
|
485
494
|
border: "0 none",
|
|
486
495
|
width: "100%"
|
|
487
496
|
}
|
|
488
|
-
}) : null,
|
|
497
|
+
}) : null, e("div", {
|
|
489
498
|
slot: "footer"
|
|
490
499
|
}, [this.makeFooter()])])]);
|
|
491
500
|
},
|
|
@@ -543,7 +552,8 @@ const Pt = "fcRadio", Dt = {
|
|
|
543
552
|
this.update();
|
|
544
553
|
},
|
|
545
554
|
render() {
|
|
546
|
-
|
|
555
|
+
const t = arguments[0];
|
|
556
|
+
return t("RadioGroup", C([{}, this.formCreateInject.prop, {}, {
|
|
547
557
|
props: {
|
|
548
558
|
value: this.trueValue
|
|
549
559
|
}
|
|
@@ -552,19 +562,19 @@ const Pt = "fcRadio", Dt = {
|
|
|
552
562
|
on: {
|
|
553
563
|
input: this.onInput
|
|
554
564
|
}
|
|
555
|
-
}]), [this.options().map((
|
|
556
|
-
const
|
|
557
|
-
return delete
|
|
558
|
-
props:
|
|
565
|
+
}]), [this.options().map((e, r) => {
|
|
566
|
+
const i = y({}, e);
|
|
567
|
+
return delete i.value, t("Radio", C([{}, {
|
|
568
|
+
props: i
|
|
559
569
|
}, {
|
|
560
|
-
key: "" +
|
|
570
|
+
key: "" + r + "-" + e.value
|
|
561
571
|
}]));
|
|
562
572
|
}), ee(this.$slots)]);
|
|
563
573
|
},
|
|
564
574
|
mounted() {
|
|
565
575
|
this.$emit("fc.el", this.$refs.el);
|
|
566
576
|
}
|
|
567
|
-
},
|
|
577
|
+
}, f = {
|
|
568
578
|
type(t, e) {
|
|
569
579
|
return Object.prototype.toString.call(t) === "[object " + e + "]";
|
|
570
580
|
},
|
|
@@ -572,7 +582,7 @@ const Pt = "fcRadio", Dt = {
|
|
|
572
582
|
return t == null;
|
|
573
583
|
},
|
|
574
584
|
Element(t) {
|
|
575
|
-
return typeof t == "object" && t !== null && t.nodeType === 1 && !
|
|
585
|
+
return typeof t == "object" && t !== null && t.nodeType === 1 && !f.Object(t);
|
|
576
586
|
},
|
|
577
587
|
trueArray(t) {
|
|
578
588
|
return Array.isArray(t) && t.length > 0;
|
|
@@ -590,11 +600,11 @@ const Pt = "fcRadio", Dt = {
|
|
|
590
600
|
}
|
|
591
601
|
};
|
|
592
602
|
["Date", "Object", "String", "Boolean", "Array", "Number"].forEach((t) => {
|
|
593
|
-
|
|
594
|
-
return
|
|
603
|
+
f[t] = function(e) {
|
|
604
|
+
return f.type(e, t);
|
|
595
605
|
};
|
|
596
606
|
});
|
|
597
|
-
function
|
|
607
|
+
function k(t, e) {
|
|
598
608
|
return {}.hasOwnProperty.call(t, e);
|
|
599
609
|
}
|
|
600
610
|
const Tt = "fcSelect", Bt = {
|
|
@@ -609,22 +619,22 @@ const Tt = "fcSelect", Bt = {
|
|
|
609
619
|
render(t, e) {
|
|
610
620
|
const r = (n, o) => {
|
|
611
621
|
const a = n.slot;
|
|
612
|
-
return t("Option",
|
|
622
|
+
return t("Option", C([{}, {
|
|
613
623
|
props: n
|
|
614
624
|
}, {
|
|
615
625
|
key: "" + o + "-" + n.value
|
|
616
626
|
}]), [a ? t("template", {
|
|
617
627
|
slot: n.slotName || "default"
|
|
618
|
-
}, [
|
|
628
|
+
}, [f.Function(a) ? n.slot(t) : a]) : null]);
|
|
619
629
|
}, i = (n, o) => t("OptionGroup", {
|
|
620
630
|
attrs: {
|
|
621
631
|
label: n.label
|
|
622
632
|
},
|
|
623
633
|
key: "" + o + "-" + n.label
|
|
624
|
-
}, [
|
|
625
|
-
return t("Select",
|
|
634
|
+
}, [f.trueArray(n.options) && n.options.map((a, u) => r(a, u))]), s = e.props.formCreateInject.options;
|
|
635
|
+
return t("Select", C([{}, e.data, {
|
|
626
636
|
ref: "el"
|
|
627
|
-
}]), [(Array.isArray(s) ? s : []).map((n, o) =>
|
|
637
|
+
}]), [(Array.isArray(s) ? s : []).map((n, o) => k(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
628
638
|
},
|
|
629
639
|
mounted() {
|
|
630
640
|
this.$emit("fc.el", this.$refs.el);
|
|
@@ -660,7 +670,7 @@ const Tt = "fcSelect", Bt = {
|
|
|
660
670
|
},
|
|
661
671
|
methods: {
|
|
662
672
|
setStatus(t) {
|
|
663
|
-
const e =
|
|
673
|
+
const e = I(t), r = this.formCreateInject.prop.props.data;
|
|
664
674
|
this.type === "selected" ? this.checked(r, e, "selected") : this.checked(r, e, "checked"), this.$forceUpdate();
|
|
665
675
|
},
|
|
666
676
|
checked(t, e, r) {
|
|
@@ -673,18 +683,18 @@ const Tt = "fcSelect", Bt = {
|
|
|
673
683
|
}
|
|
674
684
|
},
|
|
675
685
|
render() {
|
|
676
|
-
const t = {};
|
|
677
|
-
return this.type === "selected" ?
|
|
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", C([{}, this.formCreateInject.prop, {
|
|
678
688
|
ref: "tree"
|
|
679
689
|
}, {
|
|
680
|
-
on:
|
|
690
|
+
on: e
|
|
681
691
|
}]), [ee(this.$slots)]);
|
|
682
692
|
},
|
|
683
693
|
mounted() {
|
|
684
694
|
this.$emit("fc.el", this.$refs.tree);
|
|
685
695
|
}
|
|
686
696
|
};
|
|
687
|
-
function
|
|
697
|
+
function Ee(t) {
|
|
688
698
|
return {
|
|
689
699
|
url: t,
|
|
690
700
|
name: Mt(t)
|
|
@@ -737,11 +747,11 @@ function Ke(t) {
|
|
|
737
747
|
};
|
|
738
748
|
},
|
|
739
749
|
created() {
|
|
740
|
-
this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = !1), this.formCreateInject.prop.props.defaultFileList =
|
|
750
|
+
this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = !1), this.formCreateInject.prop.props.defaultFileList = I(this.value).map(Ee);
|
|
741
751
|
},
|
|
742
752
|
watch: {
|
|
743
753
|
value(e) {
|
|
744
|
-
this.$refs.upload.fileList.every((r) => !r.status || r.status === "finished") && (this.$refs.upload.fileList =
|
|
754
|
+
this.$refs.upload.fileList.every((r) => !r.status || r.status === "finished") && (this.$refs.upload.fileList = I(e).map(Ee), this.uploadList = this.$refs.upload.fileList);
|
|
745
755
|
},
|
|
746
756
|
maxLength(e, r) {
|
|
747
757
|
(r === 1 || e === 1) && this.update();
|
|
@@ -761,12 +771,13 @@ function Ke(t) {
|
|
|
761
771
|
this.onHandle(e);
|
|
762
772
|
},
|
|
763
773
|
makeItem(e, r) {
|
|
764
|
-
|
|
774
|
+
const i = this.$createElement;
|
|
775
|
+
return this.uploadType === "image" ? i("img", {
|
|
765
776
|
attrs: {
|
|
766
777
|
src: e.url
|
|
767
778
|
},
|
|
768
779
|
key: this.key("img" + r)
|
|
769
|
-
}) :
|
|
780
|
+
}) : i("icon", C([{}, {
|
|
770
781
|
props: {
|
|
771
782
|
type: t.fileIcon,
|
|
772
783
|
size: 40
|
|
@@ -776,7 +787,8 @@ function Ke(t) {
|
|
|
776
787
|
}]));
|
|
777
788
|
},
|
|
778
789
|
makeRemoveIcon(e, r) {
|
|
779
|
-
|
|
790
|
+
const i = this.$createElement;
|
|
791
|
+
return i("icon", {
|
|
780
792
|
attrs: {
|
|
781
793
|
type: "ios-trash-outline"
|
|
782
794
|
},
|
|
@@ -787,7 +799,8 @@ function Ke(t) {
|
|
|
787
799
|
});
|
|
788
800
|
},
|
|
789
801
|
makeHandleIcon(e, r) {
|
|
790
|
-
|
|
802
|
+
const i = this.$createElement;
|
|
803
|
+
return i("icon", {
|
|
791
804
|
attrs: {
|
|
792
805
|
type: this.handleIcon === !0 || this.handleIcon === void 0 ? "ios-eye-outline" : this.handleIcon
|
|
793
806
|
},
|
|
@@ -798,7 +811,8 @@ function Ke(t) {
|
|
|
798
811
|
});
|
|
799
812
|
},
|
|
800
813
|
makeProgress(e, r) {
|
|
801
|
-
|
|
814
|
+
const i = this.$createElement;
|
|
815
|
+
return i("Progress", C([{}, {
|
|
802
816
|
props: {
|
|
803
817
|
percent: e.percentage,
|
|
804
818
|
hideInfo: !0
|
|
@@ -809,35 +823,36 @@ function Ke(t) {
|
|
|
809
823
|
}]));
|
|
810
824
|
},
|
|
811
825
|
makeIcons(e, r) {
|
|
812
|
-
const i = [];
|
|
826
|
+
const i = this.$createElement, s = [];
|
|
813
827
|
if (this.allowRemove || this.handleIcon !== !1)
|
|
814
|
-
return (this.uploadType !== "file" && this.handleIcon !== !1 || this.uploadType === "file" && this.handleIcon) &&
|
|
828
|
+
return (this.uploadType !== "file" && this.handleIcon !== !1 || this.uploadType === "file" && this.handleIcon) && s.push(this.makeHandleIcon(e, r)), this.allowRemove && s.push(this.makeRemoveIcon(e, r)), i("div", {
|
|
815
829
|
class: "fc-upload-cover"
|
|
816
|
-
}, [
|
|
830
|
+
}, [s]);
|
|
817
831
|
},
|
|
818
832
|
makeFiles() {
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
833
|
+
const e = this.$createElement;
|
|
834
|
+
return this.uploadList.map((r, i) => this.$scopedSlots.fileList ? this.$scopedSlots.fileList({
|
|
835
|
+
file: r,
|
|
836
|
+
index: i,
|
|
822
837
|
vm: this
|
|
823
|
-
}) :
|
|
824
|
-
key: this.key(
|
|
838
|
+
}) : e("div", {
|
|
839
|
+
key: this.key(i),
|
|
825
840
|
class: "fc-files"
|
|
826
|
-
}, [
|
|
841
|
+
}, [r.showProgress ? this.makeProgress(r, i) : [this.makeItem(r, i), this.makeIcons(r, i)]]));
|
|
827
842
|
},
|
|
828
843
|
makeUpload() {
|
|
829
|
-
const e = !this.maxLength || this.maxLength > this.uploadList.length;
|
|
830
|
-
return
|
|
844
|
+
const e = this.$createElement, r = !this.maxLength || this.maxLength > this.uploadList.length;
|
|
845
|
+
return e("Upload", C([{}, this.formCreateInject.prop, {}, {
|
|
831
846
|
style: {
|
|
832
847
|
display: "inline-block"
|
|
833
848
|
},
|
|
834
849
|
key: this.key("upload"),
|
|
835
850
|
ref: "upload"
|
|
836
|
-
}]), [
|
|
851
|
+
}]), [r ? e("template", {
|
|
837
852
|
slot: "default"
|
|
838
|
-
}, [this.$slots.default ||
|
|
853
|
+
}, [this.$slots.default || e("div", {
|
|
839
854
|
class: "fc-upload-btn"
|
|
840
|
-
}, [
|
|
855
|
+
}, [e("icon", C([{}, {
|
|
841
856
|
props: {
|
|
842
857
|
type: this.uploadType === "file" ? "ios-cloud-upload-outline" : t.imgUpIcon,
|
|
843
858
|
size: 20
|
|
@@ -853,9 +868,10 @@ function Ke(t) {
|
|
|
853
868
|
}
|
|
854
869
|
},
|
|
855
870
|
render() {
|
|
856
|
-
|
|
871
|
+
const e = arguments[0];
|
|
872
|
+
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", {
|
|
857
873
|
class: "_fc-upload"
|
|
858
|
-
}, [[this.formCreateInject.prop.props.showUploadList ? [] : this.makeFiles(), this.makeUpload()],
|
|
874
|
+
}, [[this.formCreateInject.prop.props.showUploadList ? [] : this.makeFiles(), this.makeUpload()], e("Modal", C([{}, {
|
|
859
875
|
props: {
|
|
860
876
|
title: this.modalTitle,
|
|
861
877
|
footerHide: !0
|
|
@@ -863,11 +879,11 @@ function Ke(t) {
|
|
|
863
879
|
}, {
|
|
864
880
|
model: {
|
|
865
881
|
value: this.previewVisible,
|
|
866
|
-
callback: (
|
|
867
|
-
this.previewVisible =
|
|
882
|
+
callback: (r) => {
|
|
883
|
+
this.previewVisible = r;
|
|
868
884
|
}
|
|
869
885
|
}
|
|
870
|
-
}]), [
|
|
886
|
+
}]), [e("img", {
|
|
871
887
|
attrs: {
|
|
872
888
|
alt: "example",
|
|
873
889
|
src: this.previewImage
|
|
@@ -892,46 +908,46 @@ Xe.v2 = Ke({
|
|
|
892
908
|
fileIcon: "document-text",
|
|
893
909
|
imgUpIcon: "image"
|
|
894
910
|
});
|
|
895
|
-
function
|
|
896
|
-
|
|
911
|
+
function w(t, e, r) {
|
|
912
|
+
P.set(t, e, r);
|
|
897
913
|
}
|
|
898
|
-
function
|
|
899
|
-
|
|
914
|
+
function T(t, e) {
|
|
915
|
+
P.delete(t, e);
|
|
900
916
|
}
|
|
901
|
-
function
|
|
917
|
+
function W(t, e = {}, r) {
|
|
902
918
|
let i = !1;
|
|
903
919
|
for (let s in e)
|
|
904
920
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
905
921
|
let n = e[s];
|
|
906
|
-
if ((i = Array.isArray(n)) ||
|
|
922
|
+
if ((i = Array.isArray(n)) || f.Object(n)) {
|
|
907
923
|
let o = t[s] === void 0;
|
|
908
924
|
if (i)
|
|
909
|
-
i = !1, o &&
|
|
925
|
+
i = !1, o && w(t, s, []);
|
|
910
926
|
else if (n._clone && r !== void 0)
|
|
911
927
|
if (r)
|
|
912
|
-
n = n.getRule(), o &&
|
|
928
|
+
n = n.getRule(), o && w(t, s, {});
|
|
913
929
|
else {
|
|
914
|
-
|
|
930
|
+
w(t, s, n._clone());
|
|
915
931
|
continue;
|
|
916
932
|
}
|
|
917
933
|
else
|
|
918
|
-
o &&
|
|
919
|
-
t[s] =
|
|
934
|
+
o && w(t, s, {});
|
|
935
|
+
t[s] = W(t[s], n, r);
|
|
920
936
|
} else
|
|
921
|
-
|
|
937
|
+
w(t, s, n), f.Undef(n) || (f.Undef(n.__json) || (t[s].__json = n.__json), f.Undef(n.__origin) || (t[s].__origin = n.__origin));
|
|
922
938
|
}
|
|
923
939
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
924
940
|
}
|
|
925
|
-
function
|
|
926
|
-
return
|
|
941
|
+
function B(t) {
|
|
942
|
+
return W({}, { value: t }).value;
|
|
927
943
|
}
|
|
928
944
|
const qt = Object.assign || function(t) {
|
|
929
945
|
for (let e, r = 1; r < arguments.length; r++)
|
|
930
946
|
for (let i in e = arguments[r], e)
|
|
931
|
-
Object.prototype.hasOwnProperty.call(e, i) &&
|
|
947
|
+
Object.prototype.hasOwnProperty.call(e, i) && w(t, i, e[i]);
|
|
932
948
|
return t;
|
|
933
949
|
};
|
|
934
|
-
function
|
|
950
|
+
function p() {
|
|
935
951
|
return qt.apply(this, arguments);
|
|
936
952
|
}
|
|
937
953
|
const Ht = "fcGroup", Jt = {
|
|
@@ -1016,13 +1032,13 @@ const Ht = "fcGroup", Jt = {
|
|
|
1016
1032
|
const s = i.$f.formData();
|
|
1017
1033
|
if (t === e)
|
|
1018
1034
|
i.$f.deferSyncValue(() => {
|
|
1019
|
-
|
|
1035
|
+
W(i.rule, t), i.$f.setValue(s);
|
|
1020
1036
|
}, !0);
|
|
1021
1037
|
else {
|
|
1022
1038
|
const n = i.$f.formData();
|
|
1023
1039
|
i.$f.once("reloading", () => {
|
|
1024
1040
|
i.$f.setValue(n);
|
|
1025
|
-
}), i.rule =
|
|
1041
|
+
}), i.rule = B(t);
|
|
1026
1042
|
}
|
|
1027
1043
|
}
|
|
1028
1044
|
});
|
|
@@ -1054,7 +1070,7 @@ const Ht = "fcGroup", Jt = {
|
|
|
1054
1070
|
},
|
|
1055
1071
|
methods: {
|
|
1056
1072
|
_value(t) {
|
|
1057
|
-
return t &&
|
|
1073
|
+
return t && k(t, this.field) ? t[this.field] : t;
|
|
1058
1074
|
},
|
|
1059
1075
|
cache(t, e) {
|
|
1060
1076
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1085,8 +1101,8 @@ const Ht = "fcGroup", Jt = {
|
|
|
1085
1101
|
};
|
|
1086
1102
|
if (this.defaultValue) {
|
|
1087
1103
|
i.formData || (i.formData = {});
|
|
1088
|
-
const s =
|
|
1089
|
-
|
|
1104
|
+
const s = B(this.defaultValue);
|
|
1105
|
+
p(i.formData, this.field ? {
|
|
1090
1106
|
[this.field]: s
|
|
1091
1107
|
} : s);
|
|
1092
1108
|
}
|
|
@@ -1119,7 +1135,8 @@ const Ht = "fcGroup", Jt = {
|
|
|
1119
1135
|
r.splice(t, 1), this.input(r);
|
|
1120
1136
|
},
|
|
1121
1137
|
addIcon(t) {
|
|
1122
|
-
|
|
1138
|
+
const e = this.$createElement;
|
|
1139
|
+
return e("div", {
|
|
1123
1140
|
class: "_fc-group-btn _fc-group-plus-minus",
|
|
1124
1141
|
on: {
|
|
1125
1142
|
click: this.add
|
|
@@ -1127,7 +1144,8 @@ const Ht = "fcGroup", Jt = {
|
|
|
1127
1144
|
});
|
|
1128
1145
|
},
|
|
1129
1146
|
delIcon(t, e) {
|
|
1130
|
-
|
|
1147
|
+
const r = this.$createElement;
|
|
1148
|
+
return r("div", {
|
|
1131
1149
|
class: "_fc-group-btn _fc-group-plus-minus _fc-group-minus",
|
|
1132
1150
|
on: {
|
|
1133
1151
|
click: () => this.del(t, e)
|
|
@@ -1135,7 +1153,8 @@ const Ht = "fcGroup", Jt = {
|
|
|
1135
1153
|
});
|
|
1136
1154
|
},
|
|
1137
1155
|
sortUpIcon(t) {
|
|
1138
|
-
|
|
1156
|
+
const e = this.$createElement;
|
|
1157
|
+
return e("div", {
|
|
1139
1158
|
class: "_fc-group-btn _fc-group-arrow _fc-group-up",
|
|
1140
1159
|
on: {
|
|
1141
1160
|
click: () => this.changeSort(t, -1)
|
|
@@ -1143,7 +1162,8 @@ const Ht = "fcGroup", Jt = {
|
|
|
1143
1162
|
});
|
|
1144
1163
|
},
|
|
1145
1164
|
sortDownIcon(t) {
|
|
1146
|
-
|
|
1165
|
+
const e = this.$createElement;
|
|
1166
|
+
return e("div", {
|
|
1147
1167
|
class: "_fc-group-btn _fc-group-arrow _fc-group-down",
|
|
1148
1168
|
on: {
|
|
1149
1169
|
click: () => this.changeSort(t, 1)
|
|
@@ -1183,52 +1203,52 @@ const Ht = "fcGroup", Jt = {
|
|
|
1183
1203
|
this.addRule(e);
|
|
1184
1204
|
},
|
|
1185
1205
|
render() {
|
|
1186
|
-
const t = this.sort,
|
|
1206
|
+
const t = arguments[0], e = this.sort, r = this.button, i = this.type, s = this.disabled, n = e.length === 0 ? this.$scopedSlots.default ? this.$scopedSlots.default({
|
|
1187
1207
|
vm: this,
|
|
1188
1208
|
add: this.add
|
|
1189
|
-
}) :
|
|
1209
|
+
}) : t("div", {
|
|
1190
1210
|
key: "a_def",
|
|
1191
1211
|
class: "_fc-group-plus-minus _fc-group-add",
|
|
1192
1212
|
on: {
|
|
1193
1213
|
click: this.add
|
|
1194
1214
|
}
|
|
1195
|
-
}) :
|
|
1215
|
+
}) : e.map((o, a) => {
|
|
1196
1216
|
const {
|
|
1197
|
-
rule:
|
|
1198
|
-
options:
|
|
1199
|
-
} = this.cacheRule[
|
|
1200
|
-
return
|
|
1217
|
+
rule: u,
|
|
1218
|
+
options: l
|
|
1219
|
+
} = this.cacheRule[o], c = r && !s ? this.makeIcon(e.length, a, o) : [];
|
|
1220
|
+
return t("div", {
|
|
1201
1221
|
class: "_fc-group-container",
|
|
1202
|
-
key:
|
|
1203
|
-
}, [
|
|
1204
|
-
key:
|
|
1222
|
+
key: o
|
|
1223
|
+
}, [t(i, C([{
|
|
1224
|
+
key: o
|
|
1205
1225
|
}, {
|
|
1206
1226
|
on: {
|
|
1207
|
-
"update:value": (
|
|
1208
|
-
"emit-event": (
|
|
1209
|
-
input: (
|
|
1227
|
+
"update:value": (m) => this.formData(o, m),
|
|
1228
|
+
"emit-event": (m, ...v) => this.emitEvent(m, v, a, o),
|
|
1229
|
+
input: (m) => this.add$f(a, o, m)
|
|
1210
1230
|
}
|
|
1211
1231
|
}, {}, {
|
|
1212
1232
|
props: {
|
|
1213
|
-
disabled:
|
|
1233
|
+
disabled: s,
|
|
1214
1234
|
inFor: !0,
|
|
1215
1235
|
value: this.field ? {
|
|
1216
|
-
[this.field]: this._value(this.value[
|
|
1217
|
-
} : this.value[
|
|
1218
|
-
rule:
|
|
1219
|
-
option:
|
|
1236
|
+
[this.field]: this._value(this.value[a])
|
|
1237
|
+
} : this.value[a],
|
|
1238
|
+
rule: u,
|
|
1239
|
+
option: l,
|
|
1220
1240
|
extendOption: !0
|
|
1221
1241
|
}
|
|
1222
|
-
}])),
|
|
1242
|
+
}])), t("div", {
|
|
1223
1243
|
class: "_fc-group-idx"
|
|
1224
|
-
}, [
|
|
1244
|
+
}, [a + 1]), c.length ? t("div", {
|
|
1225
1245
|
class: "_fc-group-handle"
|
|
1226
|
-
}, [
|
|
1246
|
+
}, [c]) : null]);
|
|
1227
1247
|
});
|
|
1228
|
-
return
|
|
1248
|
+
return t("div", {
|
|
1229
1249
|
key: "con",
|
|
1230
|
-
class: "_fc-group " + (
|
|
1231
|
-
}, [
|
|
1250
|
+
class: "_fc-group " + (s ? "_fc-group-disabled" : "")
|
|
1251
|
+
}, [n]);
|
|
1232
1252
|
}
|
|
1233
1253
|
}, zt = "fcSubForm", Wt = {
|
|
1234
1254
|
name: zt,
|
|
@@ -1295,11 +1315,11 @@ const Ht = "fcGroup", Jt = {
|
|
|
1295
1315
|
this.addRule(), this.type = this.formCreateInject.form.$form();
|
|
1296
1316
|
},
|
|
1297
1317
|
render() {
|
|
1298
|
-
const {
|
|
1299
|
-
rule:
|
|
1300
|
-
options:
|
|
1301
|
-
} = this.cacheRule,
|
|
1302
|
-
return
|
|
1318
|
+
const t = arguments[0], {
|
|
1319
|
+
rule: e,
|
|
1320
|
+
options: r
|
|
1321
|
+
} = this.cacheRule, i = this.type;
|
|
1322
|
+
return t(i, C([{}, {
|
|
1303
1323
|
on: {
|
|
1304
1324
|
"update:value": this.formData,
|
|
1305
1325
|
"emit-event": this.emitEvent,
|
|
@@ -1307,8 +1327,8 @@ const Ht = "fcGroup", Jt = {
|
|
|
1307
1327
|
}
|
|
1308
1328
|
}, {}, {
|
|
1309
1329
|
props: {
|
|
1310
|
-
rule:
|
|
1311
|
-
option:
|
|
1330
|
+
rule: e,
|
|
1331
|
+
option: r,
|
|
1312
1332
|
disabled: this.disabled,
|
|
1313
1333
|
extendOption: !0
|
|
1314
1334
|
}
|
|
@@ -1323,21 +1343,23 @@ const Ht = "fcGroup", Jt = {
|
|
|
1323
1343
|
Ge,
|
|
1324
1344
|
Xe,
|
|
1325
1345
|
Jt
|
|
1326
|
-
],
|
|
1346
|
+
], Re = "FormCreate", le = (t, e) => {
|
|
1327
1347
|
if (!(!t || t === e)) {
|
|
1328
1348
|
if (t.formCreateInject)
|
|
1329
1349
|
return t.formCreateInject;
|
|
1330
1350
|
if (t.$parent)
|
|
1331
|
-
return
|
|
1351
|
+
return le(t.$parent, e);
|
|
1332
1352
|
}
|
|
1333
1353
|
};
|
|
1334
|
-
function Gt(t) {
|
|
1354
|
+
function Gt(t, e, r) {
|
|
1335
1355
|
return {
|
|
1336
|
-
name:
|
|
1337
|
-
componentName:
|
|
1356
|
+
name: Re,
|
|
1357
|
+
componentName: Re,
|
|
1338
1358
|
model: {
|
|
1339
1359
|
prop: "api"
|
|
1340
1360
|
},
|
|
1361
|
+
components: e,
|
|
1362
|
+
directives: r,
|
|
1341
1363
|
provide() {
|
|
1342
1364
|
return {
|
|
1343
1365
|
$pfc: this
|
|
@@ -1391,14 +1413,14 @@ function Gt(t) {
|
|
|
1391
1413
|
_renderRule() {
|
|
1392
1414
|
this.renderRule = [...this.rule || []];
|
|
1393
1415
|
},
|
|
1394
|
-
_updateValue(
|
|
1395
|
-
this.destroyed || (this.updateValue = JSON.stringify(
|
|
1416
|
+
_updateValue(i) {
|
|
1417
|
+
this.destroyed || (this.updateValue = JSON.stringify(i), this.$emit("update:value", i));
|
|
1396
1418
|
}
|
|
1397
1419
|
},
|
|
1398
1420
|
watch: {
|
|
1399
1421
|
value: {
|
|
1400
|
-
handler(
|
|
1401
|
-
JSON.stringify(
|
|
1422
|
+
handler(i) {
|
|
1423
|
+
JSON.stringify(i || {}) !== this.updateValue && (this.$f.config.forceCoverValue ? this.$f.coverValue(i || {}) : this.$f.setValue(i || {}));
|
|
1402
1424
|
},
|
|
1403
1425
|
deep: !0
|
|
1404
1426
|
},
|
|
@@ -1408,66 +1430,66 @@ function Gt(t) {
|
|
|
1408
1430
|
},
|
|
1409
1431
|
deep: !0
|
|
1410
1432
|
},
|
|
1411
|
-
rule(
|
|
1412
|
-
|
|
1433
|
+
rule(i) {
|
|
1434
|
+
i.length === this.renderRule.length && i.every((s) => this.renderRule.indexOf(s) > -1) || (this.formCreate.$handle.reloadRule(i), this._renderRule());
|
|
1413
1435
|
},
|
|
1414
1436
|
disabled() {
|
|
1415
1437
|
this.$f.refresh();
|
|
1416
1438
|
}
|
|
1417
1439
|
},
|
|
1418
1440
|
beforeCreate() {
|
|
1419
|
-
this.formCreate = new t(this), Object.keys(this.formCreate.prop).forEach((
|
|
1420
|
-
|
|
1441
|
+
this.formCreate = new t(this), Object.keys(this.formCreate.prop).forEach((i) => {
|
|
1442
|
+
p(this.$options[i], this.formCreate.prop[i]);
|
|
1421
1443
|
}), this.$emit("beforeCreate", this.formCreate.api());
|
|
1422
1444
|
},
|
|
1423
1445
|
created() {
|
|
1424
|
-
const
|
|
1425
|
-
if (
|
|
1426
|
-
const
|
|
1427
|
-
if (
|
|
1428
|
-
let
|
|
1429
|
-
|
|
1446
|
+
const i = this, s = this.formCreate.api(), n = () => {
|
|
1447
|
+
if (i.$pfc) {
|
|
1448
|
+
const a = le(i, i.$pfc);
|
|
1449
|
+
if (a) {
|
|
1450
|
+
let u;
|
|
1451
|
+
i.isMore ? (u = I(a.getSubForm()), u.push(s)) : u = s, a.subForm(u);
|
|
1430
1452
|
}
|
|
1431
1453
|
}
|
|
1432
|
-
},
|
|
1433
|
-
const
|
|
1434
|
-
if (
|
|
1435
|
-
if (
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1454
|
+
}, o = () => {
|
|
1455
|
+
const a = le(i, i.$pfc);
|
|
1456
|
+
if (a)
|
|
1457
|
+
if (i.isMore) {
|
|
1458
|
+
const u = I(a.getSubForm()), l = u.indexOf(s);
|
|
1459
|
+
l > -1 && u.splice(l, 1);
|
|
1438
1460
|
} else
|
|
1439
|
-
|
|
1461
|
+
a.subForm();
|
|
1440
1462
|
};
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
}), this.$watch(() => this.subForm, (
|
|
1444
|
-
|
|
1463
|
+
i.$on("hook:beforeDestroy", () => {
|
|
1464
|
+
o();
|
|
1465
|
+
}), this.$watch(() => this.subForm, (a) => {
|
|
1466
|
+
a ? n() : o();
|
|
1445
1467
|
}, { immediate: !0 });
|
|
1446
1468
|
}
|
|
1447
1469
|
};
|
|
1448
1470
|
}
|
|
1449
|
-
const Qe = ["attrs", "props", "domProps", "scopedSlots"], Ze = ["class", "style", "directives"], Ye = ["on", "nativeOn"],
|
|
1471
|
+
const Qe = ["attrs", "props", "domProps", "scopedSlots"], Ze = ["class", "style", "directives"], Ye = ["on", "nativeOn"], D = (t, e = {}, r = {}) => {
|
|
1450
1472
|
const i = [...Qe, ...r.normal || []], s = [...Ze, ...r.array || []], n = [...Ye, ...r.functional || []], o = r.props || [];
|
|
1451
1473
|
return t.reduce((a, u) => {
|
|
1452
1474
|
for (const l in u)
|
|
1453
1475
|
if (a[l])
|
|
1454
1476
|
if (o.indexOf(l) > -1)
|
|
1455
|
-
a[l] =
|
|
1477
|
+
a[l] = D([u[l]], a[l]);
|
|
1456
1478
|
else if (i.indexOf(l) > -1)
|
|
1457
1479
|
a[l] = y(y({}, a[l]), u[l]);
|
|
1458
1480
|
else if (s.indexOf(l) > -1) {
|
|
1459
|
-
const
|
|
1460
|
-
a[l] = [...
|
|
1481
|
+
const c = a[l] instanceof Array ? a[l] : [a[l]], m = u[l] instanceof Array ? u[l] : [u[l]];
|
|
1482
|
+
a[l] = [...c, ...m];
|
|
1461
1483
|
} else if (n.indexOf(l) > -1)
|
|
1462
|
-
for (const
|
|
1463
|
-
if (a[l][
|
|
1464
|
-
const
|
|
1465
|
-
a[l][
|
|
1484
|
+
for (const c in u[l])
|
|
1485
|
+
if (a[l][c]) {
|
|
1486
|
+
const m = a[l][c] instanceof Array ? a[l][c] : [a[l][c]], v = u[l][c] instanceof Array ? u[l][c] : [u[l][c]];
|
|
1487
|
+
a[l][c] = [...m, ...v];
|
|
1466
1488
|
} else
|
|
1467
|
-
a[l][
|
|
1489
|
+
a[l][c] = u[l][c];
|
|
1468
1490
|
else if (l === "hook")
|
|
1469
|
-
for (let
|
|
1470
|
-
a[l][
|
|
1491
|
+
for (let c in u[l])
|
|
1492
|
+
a[l][c] ? a[l][c] = Kt(a[l][c], u[l][c]) : a[l][c] = u[l][c];
|
|
1471
1493
|
else
|
|
1472
1494
|
a[l] = u[l];
|
|
1473
1495
|
else
|
|
@@ -1476,56 +1498,56 @@ const Qe = ["attrs", "props", "domProps", "scopedSlots"], Ze = ["class", "style"
|
|
|
1476
1498
|
}, e);
|
|
1477
1499
|
}, Kt = (t, e) => function() {
|
|
1478
1500
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1479
|
-
}, et = ["type", "slot", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "preview", "component", "cache"],
|
|
1501
|
+
}, et = ["type", "slot", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "preview", "component", "cache"], de = ["validate", "children", "control"], pe = ["effect", "deep"];
|
|
1480
1502
|
function Xt() {
|
|
1481
|
-
return [...et, ...Qe, ...Ze, ...Ye, ...
|
|
1503
|
+
return [...et, ...Qe, ...Ze, ...Ye, ...de, ...pe];
|
|
1482
1504
|
}
|
|
1483
|
-
function
|
|
1505
|
+
function me(t, e, r) {
|
|
1484
1506
|
return `[form-create ${t}]: ${e}`;
|
|
1485
1507
|
}
|
|
1486
1508
|
function Qt(t, e) {
|
|
1487
|
-
console.warn(
|
|
1509
|
+
console.warn(me("tip", t));
|
|
1488
1510
|
}
|
|
1489
|
-
function
|
|
1490
|
-
console.error(
|
|
1511
|
+
function ye(t, e) {
|
|
1512
|
+
console.error(me("err", t));
|
|
1491
1513
|
}
|
|
1492
1514
|
function Zt(t) {
|
|
1493
|
-
|
|
1515
|
+
ye(t.toString()), console.error(t);
|
|
1494
1516
|
}
|
|
1495
|
-
const
|
|
1517
|
+
const ue = "[[FORM-CREATE-PREFIX-", he = "-FORM-CREATE-SUFFIX]]", Ie = "$FN:", je = "$FNX:", J = "function";
|
|
1496
1518
|
function tt(t, e) {
|
|
1497
|
-
return JSON.stringify(
|
|
1519
|
+
return JSON.stringify(W(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1498
1520
|
if (!(i && i._isVue === !0)) {
|
|
1499
|
-
if (typeof i !==
|
|
1521
|
+
if (typeof i !== J)
|
|
1500
1522
|
return i;
|
|
1501
1523
|
if (i.__json)
|
|
1502
1524
|
return i.__json;
|
|
1503
1525
|
if (i.__origin && (i = i.__origin), !i.__emit)
|
|
1504
|
-
return
|
|
1526
|
+
return ue + i + he;
|
|
1505
1527
|
}
|
|
1506
1528
|
}, e);
|
|
1507
1529
|
}
|
|
1508
1530
|
function Ae(t) {
|
|
1509
1531
|
return new Function("return " + t)();
|
|
1510
1532
|
}
|
|
1511
|
-
function
|
|
1512
|
-
if (t &&
|
|
1533
|
+
function M(t, e) {
|
|
1534
|
+
if (t && f.String(t) && t.length > 4) {
|
|
1513
1535
|
let r = t.trim(), i = !1;
|
|
1514
1536
|
try {
|
|
1515
|
-
if (r.indexOf(he) > 0 && r.indexOf(
|
|
1516
|
-
r = r.replace(he, "").replace(
|
|
1537
|
+
if (r.indexOf(he) > 0 && r.indexOf(ue) === 0)
|
|
1538
|
+
r = r.replace(he, "").replace(ue, ""), i = !0;
|
|
1517
1539
|
else if (r.indexOf(Ie) === 0)
|
|
1518
1540
|
r = r.replace(Ie, ""), i = !0;
|
|
1519
1541
|
else {
|
|
1520
1542
|
if (r.indexOf(je) === 0)
|
|
1521
1543
|
return r = Ae("function($inject){" + r.replace(je, "") + "}"), r.__json = t, r.__inject = !0, r;
|
|
1522
|
-
!e && r.indexOf(
|
|
1544
|
+
!e && r.indexOf(J) === 0 && r !== J && (i = !0);
|
|
1523
1545
|
}
|
|
1524
1546
|
if (!i) return t;
|
|
1525
|
-
const s = Ae(r.indexOf(
|
|
1547
|
+
const s = Ae(r.indexOf(J) === -1 && r.indexOf("(") !== 0 ? J + " " + r : r);
|
|
1526
1548
|
return s.__json = t, s;
|
|
1527
1549
|
} catch (s) {
|
|
1528
|
-
|
|
1550
|
+
ye(`解析失败:${r}
|
|
1529
1551
|
|
|
1530
1552
|
err: ${s}`);
|
|
1531
1553
|
return;
|
|
@@ -1535,7 +1557,7 @@ err: ${s}`);
|
|
|
1535
1557
|
}
|
|
1536
1558
|
function Yt(t, e) {
|
|
1537
1559
|
return JSON.parse(t, function(r, i) {
|
|
1538
|
-
return
|
|
1560
|
+
return f.Undef(i) || !i.indexOf ? i : M(i, e);
|
|
1539
1561
|
});
|
|
1540
1562
|
}
|
|
1541
1563
|
function rt(t, e) {
|
|
@@ -1546,22 +1568,22 @@ function rt(t, e) {
|
|
|
1546
1568
|
writable: !!e
|
|
1547
1569
|
};
|
|
1548
1570
|
}
|
|
1549
|
-
function
|
|
1571
|
+
function ge(t) {
|
|
1550
1572
|
return it([t])[0];
|
|
1551
1573
|
}
|
|
1552
1574
|
function it(t, e) {
|
|
1553
|
-
return
|
|
1575
|
+
return W([], [...t], e || !1);
|
|
1554
1576
|
}
|
|
1555
|
-
function
|
|
1556
|
-
return
|
|
1577
|
+
function U(t, e) {
|
|
1578
|
+
return D(Array.isArray(e) ? e : [e], t, { array: de, normal: pe }), t;
|
|
1557
1579
|
}
|
|
1558
1580
|
function Ve(t) {
|
|
1559
|
-
const e =
|
|
1581
|
+
const e = f.Function(t.getRule) ? t.getRule() : t;
|
|
1560
1582
|
return e.type || (e.type = "input"), e;
|
|
1561
1583
|
}
|
|
1562
1584
|
function er(t, e) {
|
|
1563
1585
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1564
|
-
e[r] && (t[r] =
|
|
1586
|
+
e[r] && (t[r] = U(t[r] || {}, e[r]));
|
|
1565
1587
|
}), t) : e;
|
|
1566
1588
|
}
|
|
1567
1589
|
function nt(t, e) {
|
|
@@ -1571,7 +1593,7 @@ function nt(t, e) {
|
|
|
1571
1593
|
}
|
|
1572
1594
|
}, r), {}));
|
|
1573
1595
|
}
|
|
1574
|
-
function
|
|
1596
|
+
function X(t) {
|
|
1575
1597
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1576
1598
|
}
|
|
1577
1599
|
function E(t, e) {
|
|
@@ -1582,9 +1604,9 @@ function E(t, e) {
|
|
|
1582
1604
|
}
|
|
1583
1605
|
return e;
|
|
1584
1606
|
}
|
|
1585
|
-
const Pe = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e,
|
|
1607
|
+
const Pe = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, z = {
|
|
1586
1608
|
"==": (t, e) => JSON.stringify(t) === JSON.stringify(Pe(t, e)),
|
|
1587
|
-
"!=": (t, e) => !
|
|
1609
|
+
"!=": (t, e) => !z["=="](t, e),
|
|
1588
1610
|
">": (t, e) => t > e,
|
|
1589
1611
|
">=": (t, e) => t >= e,
|
|
1590
1612
|
"<": (t, e) => t < e,
|
|
@@ -1593,13 +1615,13 @@ const Pe = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1593
1615
|
return t && t.indexOf && t.indexOf(Pe(t[0], e)) > -1;
|
|
1594
1616
|
},
|
|
1595
1617
|
notOn(t, e) {
|
|
1596
|
-
return !
|
|
1618
|
+
return !z.on(t, e);
|
|
1597
1619
|
},
|
|
1598
1620
|
in(t, e) {
|
|
1599
1621
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1600
1622
|
},
|
|
1601
1623
|
notIn(t, e) {
|
|
1602
|
-
return !
|
|
1624
|
+
return !z.in(t, e);
|
|
1603
1625
|
},
|
|
1604
1626
|
between(t, e) {
|
|
1605
1627
|
return t > e[0] && t < e[1];
|
|
@@ -1608,10 +1630,10 @@ const Pe = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1608
1630
|
return t < e[0] || t > e[1];
|
|
1609
1631
|
},
|
|
1610
1632
|
empty(t) {
|
|
1611
|
-
return
|
|
1633
|
+
return f.empty(t);
|
|
1612
1634
|
},
|
|
1613
1635
|
notEmpty(t) {
|
|
1614
|
-
return !
|
|
1636
|
+
return !f.empty(t);
|
|
1615
1637
|
},
|
|
1616
1638
|
pattern(t, e) {
|
|
1617
1639
|
return new RegExp(e, "g").test(t);
|
|
@@ -1629,36 +1651,36 @@ function st() {
|
|
|
1629
1651
|
value: void 0
|
|
1630
1652
|
};
|
|
1631
1653
|
}
|
|
1632
|
-
function
|
|
1654
|
+
function F(t, e) {
|
|
1633
1655
|
return (r, i, s, n = {}) => {
|
|
1634
|
-
const o = new
|
|
1635
|
-
return e && (
|
|
1656
|
+
const o = new $e(t, r, i, s, n);
|
|
1657
|
+
return e && (f.Function(e) ? e(o) : o.props(e)), o;
|
|
1636
1658
|
};
|
|
1637
1659
|
}
|
|
1638
|
-
function
|
|
1639
|
-
this._data =
|
|
1660
|
+
function $e(t, e, r, i, s) {
|
|
1661
|
+
this._data = p(st(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1640
1662
|
}
|
|
1641
|
-
|
|
1663
|
+
p($e.prototype, {
|
|
1642
1664
|
getRule() {
|
|
1643
1665
|
return this._data;
|
|
1644
1666
|
},
|
|
1645
1667
|
setProp(t, e) {
|
|
1646
|
-
return
|
|
1668
|
+
return w(this._data, t, e), this;
|
|
1647
1669
|
},
|
|
1648
1670
|
_clone() {
|
|
1649
1671
|
const t = new this.constructor();
|
|
1650
|
-
return t._data =
|
|
1672
|
+
return t._data = ge(this._data), t;
|
|
1651
1673
|
}
|
|
1652
1674
|
});
|
|
1653
1675
|
function ot(t) {
|
|
1654
1676
|
t.forEach((e) => {
|
|
1655
|
-
|
|
1656
|
-
return
|
|
1677
|
+
$e.prototype[e] = function(r) {
|
|
1678
|
+
return U(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1657
1679
|
};
|
|
1658
1680
|
});
|
|
1659
1681
|
}
|
|
1660
1682
|
ot(Xt());
|
|
1661
|
-
const at =
|
|
1683
|
+
const at = F("");
|
|
1662
1684
|
function tr(t, e, r) {
|
|
1663
1685
|
let i = at("", e);
|
|
1664
1686
|
return i._data.type = t, i._data.title = r, i;
|
|
@@ -1672,7 +1694,7 @@ function rr() {
|
|
|
1672
1694
|
create: tr,
|
|
1673
1695
|
createTmp: De,
|
|
1674
1696
|
template: De,
|
|
1675
|
-
factory:
|
|
1697
|
+
factory: F
|
|
1676
1698
|
};
|
|
1677
1699
|
}
|
|
1678
1700
|
function ir(t, e, r) {
|
|
@@ -1711,11 +1733,11 @@ function lt(t) {
|
|
|
1711
1733
|
}
|
|
1712
1734
|
function nr(t) {
|
|
1713
1735
|
return new Promise((e, r) => {
|
|
1714
|
-
lt(
|
|
1736
|
+
lt(q(y({}, t), {
|
|
1715
1737
|
onSuccess(i) {
|
|
1716
1738
|
let s = (o) => o;
|
|
1717
|
-
const n =
|
|
1718
|
-
|
|
1739
|
+
const n = M(t.parse);
|
|
1740
|
+
f.Function(n) ? s = n : n && f.String(n) && (s = (o) => (n.split(".").forEach((a) => {
|
|
1719
1741
|
o && (o = o[a]);
|
|
1720
1742
|
}), o)), e(s(i));
|
|
1721
1743
|
},
|
|
@@ -1725,17 +1747,17 @@ function nr(t) {
|
|
|
1725
1747
|
}));
|
|
1726
1748
|
});
|
|
1727
1749
|
}
|
|
1728
|
-
function
|
|
1729
|
-
return
|
|
1750
|
+
function K(t) {
|
|
1751
|
+
return B(t);
|
|
1730
1752
|
}
|
|
1731
1753
|
function sr(t) {
|
|
1732
1754
|
function e(n) {
|
|
1733
|
-
return
|
|
1755
|
+
return f.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1734
1756
|
}
|
|
1735
1757
|
function r(n, o, a) {
|
|
1736
1758
|
e(n).forEach((u) => {
|
|
1737
1759
|
t.getCtxs(u).forEach((l) => {
|
|
1738
|
-
|
|
1760
|
+
w(l.rule, o, a), t.$render.clearCache(l);
|
|
1739
1761
|
});
|
|
1740
1762
|
});
|
|
1741
1763
|
}
|
|
@@ -1771,13 +1793,13 @@ function sr(t) {
|
|
|
1771
1793
|
formData(n) {
|
|
1772
1794
|
return e(n).reduce((o, a) => {
|
|
1773
1795
|
const u = t.getFieldCtx(a);
|
|
1774
|
-
return u && (o[u.field] =
|
|
1775
|
-
}, t.options.appendValue !== !1 ?
|
|
1796
|
+
return u && (o[u.field] = K(u.rule.value)), o;
|
|
1797
|
+
}, t.options.appendValue !== !1 ? K(t.appendData) : {});
|
|
1776
1798
|
},
|
|
1777
1799
|
getValue(n) {
|
|
1778
1800
|
const o = t.getFieldCtx(n);
|
|
1779
1801
|
if (o)
|
|
1780
|
-
return
|
|
1802
|
+
return K(o.rule.value);
|
|
1781
1803
|
},
|
|
1782
1804
|
coverValue(n) {
|
|
1783
1805
|
const o = y({}, n || {});
|
|
@@ -1785,12 +1807,12 @@ function sr(t) {
|
|
|
1785
1807
|
s.fields().forEach((a) => {
|
|
1786
1808
|
const u = t.fieldCtx[a];
|
|
1787
1809
|
if (u) {
|
|
1788
|
-
const l =
|
|
1789
|
-
u.forEach((
|
|
1790
|
-
|
|
1810
|
+
const l = k(o, a);
|
|
1811
|
+
u.forEach((c) => {
|
|
1812
|
+
c.rule.value = l ? o[a] : void 0;
|
|
1791
1813
|
}), delete o[a];
|
|
1792
1814
|
}
|
|
1793
|
-
}),
|
|
1815
|
+
}), p(t.appendData, o);
|
|
1794
1816
|
});
|
|
1795
1817
|
},
|
|
1796
1818
|
setValue(n) {
|
|
@@ -1814,7 +1836,7 @@ function sr(t) {
|
|
|
1814
1836
|
}, !0), o ? o.origin : void 0;
|
|
1815
1837
|
},
|
|
1816
1838
|
removeRule(n) {
|
|
1817
|
-
const o = n &&
|
|
1839
|
+
const o = n && X(n);
|
|
1818
1840
|
if (o)
|
|
1819
1841
|
return o.rm(), o.origin;
|
|
1820
1842
|
},
|
|
@@ -1824,13 +1846,13 @@ function sr(t) {
|
|
|
1824
1846
|
fields: () => t.fields(),
|
|
1825
1847
|
append: (n, o, a) => {
|
|
1826
1848
|
let u = t.sort.length - 1, l;
|
|
1827
|
-
const
|
|
1828
|
-
|
|
1849
|
+
const c = t.getCtx(o);
|
|
1850
|
+
c ? a ? (l = c.rule.children, u = c.rule.children.length - 1) : (u = c.root.indexOf(c.origin), l = c.root) : l = t.rules, l.splice(u + 1, 0, n);
|
|
1829
1851
|
},
|
|
1830
1852
|
prepend: (n, o, a) => {
|
|
1831
1853
|
let u = 0, l;
|
|
1832
|
-
const
|
|
1833
|
-
|
|
1854
|
+
const c = t.getCtx(o);
|
|
1855
|
+
c ? a ? l = c.rule.children : (u = c.root.indexOf(c.origin), l = c.root) : l = t.rules, l.splice(u, 0, n);
|
|
1834
1856
|
},
|
|
1835
1857
|
hidden(n, o) {
|
|
1836
1858
|
r(o, "hidden", !!n), t.refresh();
|
|
@@ -1851,7 +1873,7 @@ function sr(t) {
|
|
|
1851
1873
|
disabled(n, o) {
|
|
1852
1874
|
e(o).forEach((a) => {
|
|
1853
1875
|
t.getCtxs(a).forEach((u) => {
|
|
1854
|
-
u.rule.props &&
|
|
1876
|
+
u.rule.props && w(u.rule.props, "disabled", !!n);
|
|
1855
1877
|
});
|
|
1856
1878
|
}), t.refresh();
|
|
1857
1879
|
},
|
|
@@ -1890,7 +1912,7 @@ function sr(t) {
|
|
|
1890
1912
|
n.forEach((a) => s.sync(a));
|
|
1891
1913
|
return;
|
|
1892
1914
|
}
|
|
1893
|
-
let o =
|
|
1915
|
+
let o = f.Object(n) ? X(n) : t.getCtxs(n);
|
|
1894
1916
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
1895
1917
|
if (!a.deleted) {
|
|
1896
1918
|
const u = t.subForm[a.id];
|
|
@@ -1909,7 +1931,7 @@ function sr(t) {
|
|
|
1909
1931
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
1910
1932
|
},
|
|
1911
1933
|
hideForm: (n) => {
|
|
1912
|
-
|
|
1934
|
+
w(t.vm, "isShow", !n);
|
|
1913
1935
|
},
|
|
1914
1936
|
changeStatus: () => t.changeStatus,
|
|
1915
1937
|
clearChangeStatus: () => {
|
|
@@ -1917,7 +1939,7 @@ function sr(t) {
|
|
|
1917
1939
|
},
|
|
1918
1940
|
updateRule(n, o) {
|
|
1919
1941
|
t.getCtxs(n).forEach((a) => {
|
|
1920
|
-
|
|
1942
|
+
p(a.rule, o);
|
|
1921
1943
|
});
|
|
1922
1944
|
},
|
|
1923
1945
|
updateRules(n) {
|
|
@@ -1927,7 +1949,7 @@ function sr(t) {
|
|
|
1927
1949
|
},
|
|
1928
1950
|
mergeRule: (n, o) => {
|
|
1929
1951
|
t.getCtxs(n).forEach((a) => {
|
|
1930
|
-
|
|
1952
|
+
U(a.rule, o);
|
|
1931
1953
|
});
|
|
1932
1954
|
},
|
|
1933
1955
|
mergeRules(n) {
|
|
@@ -1954,7 +1976,7 @@ function sr(t) {
|
|
|
1954
1976
|
},
|
|
1955
1977
|
setEffect(n, o, a) {
|
|
1956
1978
|
const u = t.getCtx(n);
|
|
1957
|
-
u && o && (o[0] === "$" && (o = o.substr(1)),
|
|
1979
|
+
u && o && (o[0] === "$" && (o = o.substr(1)), k(u.rule, "$" + o) && w(u.rule, "$" + o, a), k(u.rule, "effect") || w(u.rule, "effect", {}), w(u.rule.effect, o, a));
|
|
1958
1980
|
},
|
|
1959
1981
|
clearEffectData(n, o) {
|
|
1960
1982
|
const a = t.getCtx(n);
|
|
@@ -1974,14 +1996,16 @@ function sr(t) {
|
|
|
1974
1996
|
resetFields(n) {
|
|
1975
1997
|
e(n).forEach((o) => {
|
|
1976
1998
|
t.getCtxs(o).forEach((a) => {
|
|
1977
|
-
t.$render.clearCache(a), a.rule.value =
|
|
1999
|
+
t.$render.clearCache(a), a.rule.value = K(a.defaultValue);
|
|
1978
2000
|
});
|
|
1979
|
-
})
|
|
2001
|
+
}), t.vm.$nextTick(() => {
|
|
2002
|
+
s.clearValidateState();
|
|
2003
|
+
}), n == null && (f.Function(t.options.onReset) && E(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
1980
2004
|
},
|
|
1981
2005
|
method(n, o) {
|
|
1982
2006
|
const a = s.el(n);
|
|
1983
2007
|
if (!a || !a[o])
|
|
1984
|
-
throw new Error(
|
|
2008
|
+
throw new Error(me("err", `${o}方法不存在`));
|
|
1985
2009
|
return (...u) => a[o](...u);
|
|
1986
2010
|
},
|
|
1987
2011
|
exec(n, o, ...a) {
|
|
@@ -2041,7 +2065,7 @@ function sr(t) {
|
|
|
2041
2065
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2042
2066
|
}
|
|
2043
2067
|
function or(t) {
|
|
2044
|
-
|
|
2068
|
+
p(t.prototype, {
|
|
2045
2069
|
initCache() {
|
|
2046
2070
|
this.clearCacheAll();
|
|
2047
2071
|
},
|
|
@@ -2074,7 +2098,7 @@ function or(t) {
|
|
|
2074
2098
|
}
|
|
2075
2099
|
});
|
|
2076
2100
|
}
|
|
2077
|
-
function
|
|
2101
|
+
function R(t) {
|
|
2078
2102
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2079
2103
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2080
2104
|
});
|
|
@@ -2086,7 +2110,7 @@ function ut(t) {
|
|
|
2086
2110
|
function ar(t) {
|
|
2087
2111
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
2088
2112
|
}
|
|
2089
|
-
function
|
|
2113
|
+
function Q(t) {
|
|
2090
2114
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
2091
2115
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
2092
2116
|
}
|
|
@@ -2095,14 +2119,14 @@ function te() {
|
|
|
2095
2119
|
const t = 370 + ++lr;
|
|
2096
2120
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
2097
2121
|
}
|
|
2098
|
-
function
|
|
2122
|
+
function Z(t, e, r) {
|
|
2099
2123
|
let i = t, s;
|
|
2100
2124
|
return (e || "").split(".").forEach((n) => {
|
|
2101
2125
|
s && ((!i[s] || typeof i[s] != "object") && (i[s] = {}), i = i[s]), s = n;
|
|
2102
2126
|
}), i[s] = r, i;
|
|
2103
2127
|
}
|
|
2104
2128
|
function ur(t) {
|
|
2105
|
-
|
|
2129
|
+
p(t.prototype, {
|
|
2106
2130
|
initRender() {
|
|
2107
2131
|
this.tempList = {}, this.clearOrgChildren();
|
|
2108
2132
|
},
|
|
@@ -2111,7 +2135,7 @@ function ur(t) {
|
|
|
2111
2135
|
this.orgChildren = Object.keys(e).reduce((r, i) => {
|
|
2112
2136
|
if (e[i].parser.loadChildren !== !1) {
|
|
2113
2137
|
const s = e[i].rule.children;
|
|
2114
|
-
r[i] =
|
|
2138
|
+
r[i] = f.trueArray(s) ? [...s] : [];
|
|
2115
2139
|
}
|
|
2116
2140
|
return r;
|
|
2117
2141
|
}, {});
|
|
@@ -2123,7 +2147,7 @@ function ur(t) {
|
|
|
2123
2147
|
const r = (i) => {
|
|
2124
2148
|
if (i) {
|
|
2125
2149
|
let s;
|
|
2126
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2150
|
+
return e.rule.field && (s = i.$scopedSlots["field-" + Q(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + Q(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2127
2151
|
}
|
|
2128
2152
|
};
|
|
2129
2153
|
return r(this.vm);
|
|
@@ -2142,37 +2166,37 @@ function ur(t) {
|
|
|
2142
2166
|
makeVm(e) {
|
|
2143
2167
|
const r = e.vm;
|
|
2144
2168
|
if (r) {
|
|
2145
|
-
if (
|
|
2169
|
+
if (f.Function(r))
|
|
2146
2170
|
return E(() => e.vm(this.$handle.getInjectData(e)));
|
|
2147
2171
|
if (!r._isVue)
|
|
2148
|
-
return new
|
|
2149
|
-
} else return new
|
|
2172
|
+
return new P(r);
|
|
2173
|
+
} else return new P();
|
|
2150
2174
|
return r;
|
|
2151
2175
|
},
|
|
2152
2176
|
mergeGlobal(e) {
|
|
2153
2177
|
const r = this.$handle.options.global;
|
|
2154
|
-
r && (e.cacheConfig || (e.cacheConfig = r[e.originType] || r[e.type] || r[e.trueType] || {}), e.prop =
|
|
2178
|
+
r && (e.cacheConfig || (e.cacheConfig = r[e.originType] || r[e.type] || r[e.trueType] || {}), e.prop = U({}, [r["*"], e.cacheConfig, e.prop]));
|
|
2155
2179
|
},
|
|
2156
2180
|
setOptions(e) {
|
|
2157
|
-
e.prop.optionsTo && e.prop.options &&
|
|
2181
|
+
e.prop.optionsTo && e.prop.options && Z(e.prop, e.prop.optionsTo, e.prop.options);
|
|
2158
2182
|
},
|
|
2159
2183
|
deepSet(e) {
|
|
2160
2184
|
const r = e.rule.deep;
|
|
2161
2185
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2162
|
-
|
|
2186
|
+
Z(e.prop, i, r[i]);
|
|
2163
2187
|
});
|
|
2164
2188
|
},
|
|
2165
2189
|
setTempProps(e, r) {
|
|
2166
2190
|
if (!e.$props) return;
|
|
2167
2191
|
const { prop: i } = r, s = Object.keys(e.$props), n = this.injectProp(r), o = Object.keys(n);
|
|
2168
2192
|
s.forEach((u) => {
|
|
2169
|
-
|
|
2193
|
+
k(i.props, u) ? e.$props[u] = i.props[u] : o.indexOf(u) > -1 && (e.$props[u] = n[u]);
|
|
2170
2194
|
});
|
|
2171
2195
|
const a = e.$options.model && e.$options.model.prop || "value";
|
|
2172
2196
|
s.indexOf(a) > -1 && (e.$props[a] = i.value);
|
|
2173
2197
|
},
|
|
2174
2198
|
renderTemp(e) {
|
|
2175
|
-
if (!
|
|
2199
|
+
if (!P.compile)
|
|
2176
2200
|
return Qt("当前使用的Vue构建版本不支持compile,无法使用template功能"), [];
|
|
2177
2201
|
const r = e.prop, { id: i, key: s } = e;
|
|
2178
2202
|
if (!this.tempList[i]) {
|
|
@@ -2182,16 +2206,16 @@ function ur(t) {
|
|
|
2182
2206
|
this.onInput(e, l);
|
|
2183
2207
|
}), this.tempList[i] = {
|
|
2184
2208
|
vm: u,
|
|
2185
|
-
template:
|
|
2209
|
+
template: P.compile(r.template)
|
|
2186
2210
|
};
|
|
2187
2211
|
}
|
|
2188
2212
|
const { vm: n, template: o } = this.tempList[i];
|
|
2189
2213
|
this.setTempProps(n, e);
|
|
2190
2214
|
const a = o.render.call(n);
|
|
2191
|
-
return
|
|
2215
|
+
return f.Undef(a.data) && (a.data = {}), a.key = s, a.data.ref = e.ref, a.data.key = s, a;
|
|
2192
2216
|
},
|
|
2193
2217
|
parseSide(e, r) {
|
|
2194
|
-
return
|
|
2218
|
+
return f.Object(e) ? U({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2195
2219
|
},
|
|
2196
2220
|
renderSides(e, r, i) {
|
|
2197
2221
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2209,7 +2233,7 @@ function ur(t) {
|
|
|
2209
2233
|
const i = e.rule;
|
|
2210
2234
|
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2211
2235
|
let s, n = i.cache !== !1;
|
|
2212
|
-
const o = e.trueType, a = !(
|
|
2236
|
+
const o = e.trueType, a = !(f.Undef(i.display) || i.display);
|
|
2213
2237
|
if (o === "template" && !i.template)
|
|
2214
2238
|
s = this.renderSides(this.renderChildren(e), e, !0), a && this.display(s), s = this.item(e, s);
|
|
2215
2239
|
else if (o === "fcFragment")
|
|
@@ -2217,7 +2241,7 @@ function ur(t) {
|
|
|
2217
2241
|
else {
|
|
2218
2242
|
e.initProp(), this.mergeGlobal(e), this.$manager.tidyRule(e), this.deepSet(e), this.setOptions(e), this.ctxProp(e);
|
|
2219
2243
|
let u = e.prop;
|
|
2220
|
-
u.preview = !!(
|
|
2244
|
+
u.preview = !!(k(u, "preview") ? u.preview : this.options.preview), u.props.formCreateInject = this.injectProp(e);
|
|
2221
2245
|
const l = u.preview;
|
|
2222
2246
|
if (u.hidden) {
|
|
2223
2247
|
this.setCache(e, void 0, r);
|
|
@@ -2226,19 +2250,19 @@ function ur(t) {
|
|
|
2226
2250
|
if (o === "template" && u.template)
|
|
2227
2251
|
s = this.renderTemp(e), n = !1;
|
|
2228
2252
|
else {
|
|
2229
|
-
let
|
|
2230
|
-
e.parser.renderChildren ?
|
|
2231
|
-
const
|
|
2232
|
-
|
|
2253
|
+
let c = [];
|
|
2254
|
+
e.parser.renderChildren ? c = e.parser.renderChildren(e) : e.parser.loadChildren !== !1 && (c = this.renderChildren(e));
|
|
2255
|
+
const m = this.getTypeSlot(e);
|
|
2256
|
+
m ? s = m({
|
|
2233
2257
|
rule: i,
|
|
2234
2258
|
prop: u,
|
|
2235
2259
|
preview: l,
|
|
2236
|
-
children:
|
|
2260
|
+
children: c,
|
|
2237
2261
|
api: this.$handle.api,
|
|
2238
2262
|
model: u.model || {}
|
|
2239
|
-
}) : s = l ? e.parser.preview(
|
|
2263
|
+
}) : s = l ? e.parser.preview(c, e) : e.parser.render(c, e);
|
|
2240
2264
|
}
|
|
2241
|
-
s = this.renderSides(s, e), !(!e.input &&
|
|
2265
|
+
s = this.renderSides(s, e), !(!e.input && f.Undef(u.native)) && u.native !== !0 && (s = this.$manager.makeWrap(e, s)), a && (s = this.display(s)), s = this.item(e, s);
|
|
2242
2266
|
}
|
|
2243
2267
|
return n && this.setCache(e, s, r), s;
|
|
2244
2268
|
}
|
|
@@ -2256,7 +2280,7 @@ function ur(t) {
|
|
|
2256
2280
|
},
|
|
2257
2281
|
none(e) {
|
|
2258
2282
|
if (e && e.data)
|
|
2259
|
-
return Array.isArray(e.data.style) ? e.data.style.push({ display: "none" }) :
|
|
2283
|
+
return Array.isArray(e.data.style) ? e.data.style.push({ display: "none" }) : f.String(e.data.style) ? e.data.style += ";display:none;" : e.data.style = [e.data.style, { display: "none" }], e;
|
|
2260
2284
|
},
|
|
2261
2285
|
item(e, r) {
|
|
2262
2286
|
return this.$h("fcFragment", {
|
|
@@ -2265,7 +2289,7 @@ function ur(t) {
|
|
|
2265
2289
|
}, [r]);
|
|
2266
2290
|
},
|
|
2267
2291
|
injectProp(e) {
|
|
2268
|
-
this.vm.ctxInject[e.id] ||
|
|
2292
|
+
this.vm.ctxInject[e.id] || w(this.vm.ctxInject, e.id, {
|
|
2269
2293
|
api: this.$handle.api,
|
|
2270
2294
|
form: this.fc.create,
|
|
2271
2295
|
subForm: (i) => {
|
|
@@ -2282,7 +2306,7 @@ function ur(t) {
|
|
|
2282
2306
|
input: e.input
|
|
2283
2307
|
});
|
|
2284
2308
|
const r = this.vm.ctxInject[e.id];
|
|
2285
|
-
return
|
|
2309
|
+
return p(r, {
|
|
2286
2310
|
preview: e.prop.preview,
|
|
2287
2311
|
options: e.prop.options,
|
|
2288
2312
|
children: e.rule.children,
|
|
@@ -2319,7 +2343,7 @@ function ur(t) {
|
|
|
2319
2343
|
this.onInput(e, o);
|
|
2320
2344
|
},
|
|
2321
2345
|
expression: `formData.${e.id}`
|
|
2322
|
-
}),
|
|
2346
|
+
}), D(n, e.prop), e.prop;
|
|
2323
2347
|
},
|
|
2324
2348
|
onMounted(e) {
|
|
2325
2349
|
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");
|
|
@@ -2328,8 +2352,8 @@ function ur(t) {
|
|
|
2328
2352
|
this.$handle.onInput(e, r);
|
|
2329
2353
|
},
|
|
2330
2354
|
renderChildren(e) {
|
|
2331
|
-
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !
|
|
2332
|
-
return !
|
|
2355
|
+
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !f.String(n) && n.__fc__ && !this.$handle.ctxs[n.__fc__.id];
|
|
2356
|
+
return !f.trueArray(r) && i ? (this.$handle.deferSyncValue(() => {
|
|
2333
2357
|
i.forEach((n) => {
|
|
2334
2358
|
n && s(n) && this.$handle.rmCtx(n.__fc__);
|
|
2335
2359
|
});
|
|
@@ -2339,7 +2363,7 @@ function ur(t) {
|
|
|
2339
2363
|
});
|
|
2340
2364
|
}), r.map((n) => {
|
|
2341
2365
|
if (n) {
|
|
2342
|
-
if (
|
|
2366
|
+
if (f.String(n)) return n;
|
|
2343
2367
|
if (n.__fc__)
|
|
2344
2368
|
return this.renderCtx(n.__fc__, e);
|
|
2345
2369
|
n.type && this.vm.$nextTick(() => {
|
|
@@ -2354,23 +2378,23 @@ function ur(t) {
|
|
|
2354
2378
|
},
|
|
2355
2379
|
renderRule(e, r, i) {
|
|
2356
2380
|
if (!e) return;
|
|
2357
|
-
if (
|
|
2381
|
+
if (f.String(e)) return e;
|
|
2358
2382
|
let s;
|
|
2359
2383
|
if (i)
|
|
2360
2384
|
s = e.type;
|
|
2361
2385
|
else if (s = e.is, e.type) {
|
|
2362
|
-
s =
|
|
2386
|
+
s = R(e.type);
|
|
2363
2387
|
const o = this.vNode.aliasMap[s];
|
|
2364
|
-
o && (s =
|
|
2388
|
+
o && (s = R(o));
|
|
2365
2389
|
}
|
|
2366
2390
|
if (!s) return;
|
|
2367
2391
|
let n = [[r]];
|
|
2368
|
-
return
|
|
2392
|
+
return f.trueArray(e.children) && n.push(e.children.map((o) => this.renderRule(o))), this.$h(s, y({}, e), n);
|
|
2369
2393
|
}
|
|
2370
2394
|
});
|
|
2371
2395
|
}
|
|
2372
|
-
function
|
|
2373
|
-
|
|
2396
|
+
function ve(t) {
|
|
2397
|
+
p(this, {
|
|
2374
2398
|
$handle: t,
|
|
2375
2399
|
fc: t.fc,
|
|
2376
2400
|
vm: t.vm,
|
|
@@ -2385,10 +2409,10 @@ function be(t) {
|
|
|
2385
2409
|
}
|
|
2386
2410
|
}), this.initCache(), this.initRender();
|
|
2387
2411
|
}
|
|
2388
|
-
or(
|
|
2389
|
-
ur(
|
|
2390
|
-
function
|
|
2391
|
-
|
|
2412
|
+
or(ve);
|
|
2413
|
+
ur(ve);
|
|
2414
|
+
function hr(t) {
|
|
2415
|
+
p(t.prototype, {
|
|
2392
2416
|
parseInjectEvent(e, r) {
|
|
2393
2417
|
const i = e.inject || this.options.injectEvent;
|
|
2394
2418
|
return this.parseEventLst(e, r, i);
|
|
@@ -2400,31 +2424,31 @@ function fr(t) {
|
|
|
2400
2424
|
}), r;
|
|
2401
2425
|
},
|
|
2402
2426
|
parseEvent(e, r, i, s) {
|
|
2403
|
-
if (
|
|
2427
|
+
if (f.Function(r) && (i !== !1 && !f.Undef(i) || r.__inject))
|
|
2404
2428
|
return this.inject(e, r, i);
|
|
2405
|
-
if (!s && Array.isArray(r) && r[0] && (
|
|
2429
|
+
if (!s && Array.isArray(r) && r[0] && (f.String(r[0]) || f.Function(r[0])))
|
|
2406
2430
|
return this.parseEventLst(e, r, i, !0);
|
|
2407
|
-
if (
|
|
2408
|
-
const n =
|
|
2431
|
+
if (f.String(r)) {
|
|
2432
|
+
const n = M(r);
|
|
2409
2433
|
if (n && r !== n)
|
|
2410
2434
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2411
2435
|
}
|
|
2412
2436
|
},
|
|
2413
2437
|
parseEmit(e, r) {
|
|
2414
2438
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: u } = s, l = s[r ? "emit" : "nativeEmit"] || [];
|
|
2415
|
-
return
|
|
2416
|
-
if (!
|
|
2417
|
-
let
|
|
2418
|
-
if (
|
|
2419
|
-
r || (
|
|
2420
|
-
const
|
|
2421
|
-
this.vm.$emit(
|
|
2439
|
+
return f.trueArray(l) && l.forEach((c) => {
|
|
2440
|
+
if (!c) return;
|
|
2441
|
+
let m, v = n || o || a;
|
|
2442
|
+
if (f.Object(c) && (m = c.inject, c = c.name, v = c.prefix || v), v) {
|
|
2443
|
+
r || (v = `native-${v}`);
|
|
2444
|
+
const _ = Q(`${v}-${c}`), g = (...O) => {
|
|
2445
|
+
this.vm.$emit(_, ...O), this.vm.$emit("emit-event", _, ...O);
|
|
2422
2446
|
};
|
|
2423
|
-
if (
|
|
2424
|
-
i[
|
|
2447
|
+
if (g.__emit = !0, !m && u === !1)
|
|
2448
|
+
i[c] = g;
|
|
2425
2449
|
else {
|
|
2426
|
-
let O =
|
|
2427
|
-
i[
|
|
2450
|
+
let O = m || u || this.options.injectEvent;
|
|
2451
|
+
i[c] = f.Undef(O) ? g : this.inject(s, g, O);
|
|
2428
2452
|
}
|
|
2429
2453
|
}
|
|
2430
2454
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2455,13 +2479,13 @@ function fr(t) {
|
|
|
2455
2479
|
});
|
|
2456
2480
|
}
|
|
2457
2481
|
const Be = ["hook:updated", "hook:mounted"];
|
|
2458
|
-
function
|
|
2459
|
-
|
|
2482
|
+
function fr(t) {
|
|
2483
|
+
p(t.prototype, {
|
|
2460
2484
|
usePage() {
|
|
2461
2485
|
const e = this.options.page;
|
|
2462
2486
|
if (!e) return;
|
|
2463
2487
|
let r = 25, i = cr(this.rules);
|
|
2464
|
-
|
|
2488
|
+
f.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), p(this, {
|
|
2465
2489
|
first: r,
|
|
2466
2490
|
limit: i,
|
|
2467
2491
|
pageEnd: this.rules.length <= r
|
|
@@ -2479,7 +2503,7 @@ function cr(t) {
|
|
|
2479
2503
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2480
2504
|
}
|
|
2481
2505
|
function dr(t) {
|
|
2482
|
-
|
|
2506
|
+
p(t.prototype, {
|
|
2483
2507
|
clearNextTick() {
|
|
2484
2508
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
2485
2509
|
},
|
|
@@ -2498,9 +2522,9 @@ function pr(t) {
|
|
|
2498
2522
|
__fc__: rt(t, !0)
|
|
2499
2523
|
});
|
|
2500
2524
|
}
|
|
2501
|
-
function
|
|
2525
|
+
function ht(t, e, r) {
|
|
2502
2526
|
const i = te();
|
|
2503
|
-
|
|
2527
|
+
p(this, {
|
|
2504
2528
|
id: i,
|
|
2505
2529
|
ref: i,
|
|
2506
2530
|
wrapRef: i + "fi",
|
|
@@ -2519,11 +2543,11 @@ function ft(t, e, r) {
|
|
|
2519
2543
|
input: !!e.field,
|
|
2520
2544
|
el: void 0,
|
|
2521
2545
|
exportEl: void 0,
|
|
2522
|
-
defaultValue: e.field ?
|
|
2546
|
+
defaultValue: e.field ? B(r) : void 0,
|
|
2523
2547
|
field: e.field || void 0
|
|
2524
|
-
}), this.
|
|
2548
|
+
}), this.updateKey(), pr(this), this.update(t, !0);
|
|
2525
2549
|
}
|
|
2526
|
-
|
|
2550
|
+
p(ht.prototype, {
|
|
2527
2551
|
effectData(t) {
|
|
2528
2552
|
return this.payload[t] || (this.payload[t] = {}), this.payload[t];
|
|
2529
2553
|
},
|
|
@@ -2534,18 +2558,18 @@ m(ft.prototype, {
|
|
|
2534
2558
|
this.key = te(), t && this.parent && this.parent.updateKey(t);
|
|
2535
2559
|
},
|
|
2536
2560
|
updateType() {
|
|
2537
|
-
this.originType = this.rule.type, this.type =
|
|
2561
|
+
this.originType = this.rule.type, this.type = R(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
2538
2562
|
},
|
|
2539
2563
|
setParser(t) {
|
|
2540
2564
|
this.parser = t, t.init(this);
|
|
2541
2565
|
},
|
|
2542
2566
|
initProp() {
|
|
2543
2567
|
const t = y({}, this.rule);
|
|
2544
|
-
delete t.children, this.prop =
|
|
2568
|
+
delete t.children, this.prop = U({}, [t, ...Object.keys(this.payload).map((e) => this.payload[e]), this.computed]);
|
|
2545
2569
|
},
|
|
2546
2570
|
injectValidate() {
|
|
2547
|
-
return
|
|
2548
|
-
if (
|
|
2571
|
+
return I(this.prop.validate).map((t) => {
|
|
2572
|
+
if (f.Function(t.validator)) {
|
|
2549
2573
|
const e = y({}, t), r = this;
|
|
2550
2574
|
return e.validator = function(...i) {
|
|
2551
2575
|
return t.validator.call({
|
|
@@ -2576,7 +2600,7 @@ m(ft.prototype, {
|
|
|
2576
2600
|
this.$handle.watchCtx(this);
|
|
2577
2601
|
},
|
|
2578
2602
|
delete() {
|
|
2579
|
-
this.unwatch(), this.unlink(), this.rmCtrl(),
|
|
2603
|
+
this.unwatch(), this.unlink(), this.rmCtrl(), p(this, {
|
|
2580
2604
|
deleted: !0,
|
|
2581
2605
|
prop: y({}, this.rule),
|
|
2582
2606
|
computed: {},
|
|
@@ -2604,28 +2628,27 @@ m(ft.prototype, {
|
|
|
2604
2628
|
}
|
|
2605
2629
|
this.$handle.noWatch(() => {
|
|
2606
2630
|
this.$handle.deferSyncValue(() => {
|
|
2607
|
-
this.rmCtrl(), t(), this.$handle.rmCtx(this),
|
|
2631
|
+
this.rmCtrl(), t(), this.$handle.rmCtx(this), p(this, {
|
|
2608
2632
|
root: []
|
|
2609
2633
|
});
|
|
2610
2634
|
}, this.input);
|
|
2611
2635
|
});
|
|
2612
2636
|
},
|
|
2613
2637
|
update(t, e) {
|
|
2614
|
-
|
|
2638
|
+
p(this, {
|
|
2615
2639
|
deleted: !1,
|
|
2616
2640
|
$handle: t,
|
|
2617
2641
|
$render: t.$render,
|
|
2618
2642
|
$api: t.api,
|
|
2619
2643
|
vm: t.vm,
|
|
2620
|
-
trueType: t.getType(this.originType),
|
|
2621
2644
|
vNode: t.$render.vNode,
|
|
2622
2645
|
updated: !1,
|
|
2623
2646
|
cacheValue: this.rule.value
|
|
2624
|
-
}), !e && this.unwatch(), this.watchTo(), this.link();
|
|
2647
|
+
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2625
2648
|
}
|
|
2626
2649
|
});
|
|
2627
2650
|
function mr(t) {
|
|
2628
|
-
|
|
2651
|
+
p(t.prototype, {
|
|
2629
2652
|
nextRefresh(e) {
|
|
2630
2653
|
const r = this.loadedId;
|
|
2631
2654
|
this.vm.$nextTick(() => {
|
|
@@ -2638,7 +2661,7 @@ function mr(t) {
|
|
|
2638
2661
|
__origin__: rt(e, !0)
|
|
2639
2662
|
}), yr(r), this.appendValue(r), r.options = Array.isArray(r.options) ? r.options : [], [r, r.prefix, r.suffix].forEach((i) => {
|
|
2640
2663
|
i && this.loadFn(i, r);
|
|
2641
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
2664
|
+
}), this.loadCtrl(r), r.update && (r.update = M(r.update)), r;
|
|
2642
2665
|
},
|
|
2643
2666
|
loadFn(e, r) {
|
|
2644
2667
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -2647,12 +2670,12 @@ function mr(t) {
|
|
|
2647
2670
|
},
|
|
2648
2671
|
loadCtrl(e) {
|
|
2649
2672
|
e.control && e.control.forEach((r) => {
|
|
2650
|
-
r.handle && (r.handle =
|
|
2673
|
+
r.handle && (r.handle = M(r.handle));
|
|
2651
2674
|
});
|
|
2652
2675
|
},
|
|
2653
2676
|
syncProp(e) {
|
|
2654
2677
|
const r = e.rule;
|
|
2655
|
-
|
|
2678
|
+
f.trueArray(r.sync) && D([{
|
|
2656
2679
|
on: r.sync.reduce((i, s) => (i[`update:${s}`] = (n) => {
|
|
2657
2680
|
r.props[s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
2658
2681
|
}, i), {})
|
|
@@ -2678,45 +2701,45 @@ function mr(t) {
|
|
|
2678
2701
|
let a = this.sort.indexOf(o.__fc__.id);
|
|
2679
2702
|
return a > -1 ? a : i(n - 1);
|
|
2680
2703
|
}, s = (n, o) => {
|
|
2681
|
-
|
|
2704
|
+
f.trueArray(n) && this._loadRule(n, o);
|
|
2682
2705
|
};
|
|
2683
2706
|
e.map((n, o) => {
|
|
2684
|
-
if (r && !
|
|
2707
|
+
if (r && !f.Object(n) || !this.pageEnd && !r && o >= this.first) return;
|
|
2685
2708
|
if (n.__fc__ && n.__fc__.root === e && this.ctxs[n.__fc__.id])
|
|
2686
2709
|
return s(n.__fc__.rule.children, n.__fc__), n.__fc__;
|
|
2687
2710
|
let a = Ve(n);
|
|
2688
2711
|
const u = () => !!(a.field && this.fieldCtx[a.field] && this.fieldCtx[a.field][0] !== n.__fc__);
|
|
2689
2712
|
this.ruleEffect(a, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", n, this.api);
|
|
2690
|
-
let l,
|
|
2691
|
-
if (
|
|
2692
|
-
l = n.__fc__,
|
|
2693
|
-
const
|
|
2713
|
+
let l, c = !1, m = !!n.__fc__, v = a.value;
|
|
2714
|
+
if (m) {
|
|
2715
|
+
l = n.__fc__, v = l.defaultValue;
|
|
2716
|
+
const g = !l.check(this);
|
|
2694
2717
|
if (l.deleted) {
|
|
2695
|
-
if (
|
|
2718
|
+
if (g) {
|
|
2696
2719
|
if (Le(l))
|
|
2697
2720
|
return;
|
|
2698
2721
|
l.update(this);
|
|
2699
2722
|
}
|
|
2700
|
-
} else if (
|
|
2723
|
+
} else if (g) {
|
|
2701
2724
|
if (Le(l))
|
|
2702
2725
|
return;
|
|
2703
|
-
e[o] = n = n._clone ? n._clone() :
|
|
2726
|
+
e[o] = n = n._clone ? n._clone() : ge(n), l = null, c = !0;
|
|
2704
2727
|
}
|
|
2705
2728
|
}
|
|
2706
2729
|
if (l)
|
|
2707
|
-
l.originType !== l.rule.type &&
|
|
2730
|
+
l.originType !== l.rule.type && l.updateType(), this.bindParser(l), this.appendValue(l.rule);
|
|
2708
2731
|
else {
|
|
2709
|
-
const
|
|
2710
|
-
l = new
|
|
2732
|
+
const g = this.parseRule(n);
|
|
2733
|
+
l = new ht(this, g, v), this.bindParser(l);
|
|
2711
2734
|
}
|
|
2712
|
-
if ([!1, !0].forEach((
|
|
2713
|
-
const
|
|
2714
|
-
|
|
2735
|
+
if ([!1, !0].forEach((g) => this.parseEmit(l, g)), this.syncProp(l), l.parent = r || null, l.root = e, this.setCtx(l), !c && !m && this.effect(l, "load"), this.effect(l, "created"), l.parser.loadChildren === !1 || s(l.rule.children, l), !r) {
|
|
2736
|
+
const g = i(o);
|
|
2737
|
+
g > -1 || !o ? this.sort.splice(g + 1, 0, l.id) : this.sort.push(l.id);
|
|
2715
2738
|
}
|
|
2716
|
-
const
|
|
2717
|
-
return l.updated || (l.updated = !0,
|
|
2718
|
-
this.refreshUpdate(l,
|
|
2719
|
-
}), this.effect(l, "loaded")), l.input && Object.defineProperty(
|
|
2739
|
+
const _ = l.rule;
|
|
2740
|
+
return l.updated || (l.updated = !0, f.Function(_.update) && this.bus.$once("load-end", () => {
|
|
2741
|
+
this.refreshUpdate(l, _.value, "init");
|
|
2742
|
+
}), this.effect(l, "loaded")), l.input && Object.defineProperty(_, "value", this.valueHandle(l)), this.refreshControl(l) && (this.cycleLoad = !0), l;
|
|
2720
2743
|
});
|
|
2721
2744
|
},
|
|
2722
2745
|
refreshControl(e) {
|
|
@@ -2726,29 +2749,29 @@ function mr(t) {
|
|
|
2726
2749
|
const r = gr(e), i = [], s = this.api;
|
|
2727
2750
|
if (!r.length) return !1;
|
|
2728
2751
|
for (let a = 0; a < r.length; a++) {
|
|
2729
|
-
const u = r[a], l = u.handle || function(
|
|
2730
|
-
return (
|
|
2752
|
+
const u = r[a], l = u.handle || function(m) {
|
|
2753
|
+
return (z[u.condition || "=="] || z["=="])(m, u.value);
|
|
2731
2754
|
};
|
|
2732
|
-
if (!
|
|
2733
|
-
const
|
|
2755
|
+
if (!f.trueArray(u.rule)) continue;
|
|
2756
|
+
const c = q(y({}, u), {
|
|
2734
2757
|
valid: E(() => l(e.rule.value, s)),
|
|
2735
2758
|
ctrl: $r(e, u.rule),
|
|
2736
|
-
isHidden:
|
|
2759
|
+
isHidden: f.String(u.rule[0])
|
|
2737
2760
|
});
|
|
2738
|
-
|
|
2761
|
+
c.valid && c.ctrl || !c.valid && !c.ctrl && !c.isHidden || i.push(c);
|
|
2739
2762
|
}
|
|
2740
2763
|
if (!i.length) return !1;
|
|
2741
2764
|
const n = [];
|
|
2742
2765
|
let o = !1;
|
|
2743
2766
|
return this.deferSyncValue(() => {
|
|
2744
|
-
i.reverse().forEach(({ isHidden: a, valid: u, rule: l, prepend:
|
|
2767
|
+
i.reverse().forEach(({ isHidden: a, valid: u, rule: l, prepend: c, append: m, child: v, ctrl: _, method: g }) => {
|
|
2745
2768
|
if (a) {
|
|
2746
2769
|
u ? e.ctrlRule.push({
|
|
2747
2770
|
__ctrl: !0,
|
|
2748
2771
|
children: l,
|
|
2749
2772
|
valid: u
|
|
2750
|
-
}) : e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
2751
|
-
|
|
2773
|
+
}) : _ && e.ctrlRule.splice(e.ctrlRule.indexOf(_) >>> 0, 1), n[u ? "push" : "unshift"](() => {
|
|
2774
|
+
g === "disabled" || g === "enabled" ? this.api.disabled(!u, l) : g === "display" ? this.api.display(u, l) : g === "required" ? (l.forEach((O) => {
|
|
2752
2775
|
this.api.setEffect(O, "required", u);
|
|
2753
2776
|
}), u || this.api.clearValidateState(l)) : this.api.hidden(!u, l);
|
|
2754
2777
|
});
|
|
@@ -2763,11 +2786,11 @@ function mr(t) {
|
|
|
2763
2786
|
children: l
|
|
2764
2787
|
};
|
|
2765
2788
|
e.ctrlRule.push(O), this.bus.$once("load-start", () => {
|
|
2766
|
-
|
|
2789
|
+
c ? s.prepend(O, c, v) : m || v ? s.append(O, m || e.id, v) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, O);
|
|
2767
2790
|
});
|
|
2768
2791
|
} else {
|
|
2769
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
2770
|
-
const O =
|
|
2792
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(_), 1);
|
|
2793
|
+
const O = X(_);
|
|
2771
2794
|
O && O.rm();
|
|
2772
2795
|
}
|
|
2773
2796
|
});
|
|
@@ -2796,12 +2819,12 @@ function mr(t) {
|
|
|
2796
2819
|
function yr(t) {
|
|
2797
2820
|
const e = st();
|
|
2798
2821
|
return Object.keys(e).forEach((r) => {
|
|
2799
|
-
|
|
2822
|
+
k(t, r) || w(t, r, e[r]);
|
|
2800
2823
|
}), t;
|
|
2801
2824
|
}
|
|
2802
2825
|
function gr(t) {
|
|
2803
2826
|
const e = t.rule.control || [];
|
|
2804
|
-
return
|
|
2827
|
+
return f.Object(e) ? [e] : e;
|
|
2805
2828
|
}
|
|
2806
2829
|
function $r(t, e) {
|
|
2807
2830
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
@@ -2814,9 +2837,9 @@ function Le(t) {
|
|
|
2814
2837
|
return !!t.rule.__ctrl;
|
|
2815
2838
|
}
|
|
2816
2839
|
function vr(t) {
|
|
2817
|
-
|
|
2840
|
+
p(t.prototype, {
|
|
2818
2841
|
getValue(e) {
|
|
2819
|
-
return
|
|
2842
|
+
return f.Undef(e.cacheValue) && (e.cacheValue = e.parser.toValue(this.getFormData(e), e)), e.cacheValue;
|
|
2820
2843
|
},
|
|
2821
2844
|
setValue(e, r, i, s) {
|
|
2822
2845
|
e.deleted || (e.cacheValue = r, this.changeStatus = !0, this.nextRefresh(), this.$render.clearCache(e), this.setFormData(e, i), this.syncValue(), this.valueChange(e, r), this.vm.$emit("change", e.field, r, e.origin, this.api, s || !1), this.effect(e, "value"), this.emitEvent("change", e.field, r, {
|
|
@@ -2830,7 +2853,7 @@ function vr(t) {
|
|
|
2830
2853
|
e.input && (this.isQuote(e, i = e.parser.toValue(r, e)) || this.isChange(e, i)) && this.setValue(e, i, r);
|
|
2831
2854
|
},
|
|
2832
2855
|
setFormData(e, r) {
|
|
2833
|
-
|
|
2856
|
+
w(this.formData, e.id, r === null ? void 0 : r);
|
|
2834
2857
|
},
|
|
2835
2858
|
getFormData(e) {
|
|
2836
2859
|
return this.formData[e.id];
|
|
@@ -2838,7 +2861,7 @@ function vr(t) {
|
|
|
2838
2861
|
validate() {
|
|
2839
2862
|
return Me(this.vm.validate), this.fields().forEach((e) => {
|
|
2840
2863
|
this.fieldCtx[e].forEach((r) => {
|
|
2841
|
-
this.vm.validate[r.id] =
|
|
2864
|
+
this.vm.validate[r.id] = I(r.rule.validate);
|
|
2842
2865
|
});
|
|
2843
2866
|
}), this.vm.validate;
|
|
2844
2867
|
},
|
|
@@ -2865,7 +2888,7 @@ function vr(t) {
|
|
|
2865
2888
|
};
|
|
2866
2889
|
},
|
|
2867
2890
|
appendValue(e) {
|
|
2868
|
-
!e.field || !
|
|
2891
|
+
!e.field || !k(this.appendData, e.field) || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
2869
2892
|
},
|
|
2870
2893
|
addSubForm(e, r) {
|
|
2871
2894
|
this.subForm[e.id] = r;
|
|
@@ -2882,10 +2905,10 @@ function vr(t) {
|
|
|
2882
2905
|
return JSON.stringify(e.rule.value, Ne) !== JSON.stringify(r === null ? void 0 : r, Ne);
|
|
2883
2906
|
},
|
|
2884
2907
|
isQuote(e, r) {
|
|
2885
|
-
return (
|
|
2908
|
+
return (f.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
2886
2909
|
},
|
|
2887
2910
|
refreshUpdate(e, r, i, s) {
|
|
2888
|
-
if (
|
|
2911
|
+
if (f.Function(e.rule.update)) {
|
|
2889
2912
|
const n = E(() => e.rule.update(r, e.origin, this.api, {
|
|
2890
2913
|
origin: i || "change",
|
|
2891
2914
|
linkField: s
|
|
@@ -2902,7 +2925,7 @@ function vr(t) {
|
|
|
2902
2925
|
},
|
|
2903
2926
|
appendLink(e) {
|
|
2904
2927
|
const r = e.rule.link;
|
|
2905
|
-
|
|
2928
|
+
f.trueArray(r) && r.forEach((i) => {
|
|
2906
2929
|
const s = () => this.refreshRule(e, e.rule.value, "link", i);
|
|
2907
2930
|
this.bus.$on("change-" + i, s), e.linkOn.push(() => this.bus.$off("change-" + i, s));
|
|
2908
2931
|
});
|
|
@@ -2918,7 +2941,7 @@ function Ne(t, e) {
|
|
|
2918
2941
|
function Me(t) {
|
|
2919
2942
|
Object.keys(t).forEach((e) => delete t[e]);
|
|
2920
2943
|
}
|
|
2921
|
-
const
|
|
2944
|
+
const fe = {
|
|
2922
2945
|
init(t) {
|
|
2923
2946
|
},
|
|
2924
2947
|
toFormValue(t, e) {
|
|
@@ -2939,7 +2962,7 @@ const ce = {
|
|
|
2939
2962
|
}
|
|
2940
2963
|
}, br = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "component", "cache"];
|
|
2941
2964
|
function Cr(t) {
|
|
2942
|
-
|
|
2965
|
+
p(t.prototype, {
|
|
2943
2966
|
getCtx(e) {
|
|
2944
2967
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
2945
2968
|
},
|
|
@@ -2968,14 +2991,14 @@ function Cr(t) {
|
|
|
2968
2991
|
},
|
|
2969
2992
|
getParser(e) {
|
|
2970
2993
|
const r = this.fc.parsers;
|
|
2971
|
-
return r[e.originType] || r[
|
|
2994
|
+
return r[e.originType] || r[R(e.type)] || r[e.trueType] || fe;
|
|
2972
2995
|
},
|
|
2973
2996
|
bindParser(e) {
|
|
2974
2997
|
e.setParser(this.getParser(e));
|
|
2975
2998
|
},
|
|
2976
2999
|
getType(e) {
|
|
2977
|
-
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[
|
|
2978
|
-
return
|
|
3000
|
+
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[R(e)] || e;
|
|
3001
|
+
return R(i);
|
|
2979
3002
|
},
|
|
2980
3003
|
noWatch(e) {
|
|
2981
3004
|
this.noWatchFn || (this.noWatchFn = e), E(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
@@ -3002,7 +3025,7 @@ function Cr(t) {
|
|
|
3002
3025
|
else if (i === "type")
|
|
3003
3026
|
e.updateType(), this.bindParser(e);
|
|
3004
3027
|
else if (i === "children") {
|
|
3005
|
-
const a =
|
|
3028
|
+
const a = f.trueArray(n);
|
|
3006
3029
|
this.deferSyncValue(() => {
|
|
3007
3030
|
n !== o && (this.rmSub(o, e), this.$render.initOrgChildren()), a && this.loadChildren(n, e), this.vm.$emit("update", this.api);
|
|
3008
3031
|
});
|
|
@@ -3013,7 +3036,7 @@ function Cr(t) {
|
|
|
3013
3036
|
}), this.watchEffect(e);
|
|
3014
3037
|
},
|
|
3015
3038
|
rmSub(e, r) {
|
|
3016
|
-
|
|
3039
|
+
f.trueArray(e) && e.forEach((i) => {
|
|
3017
3040
|
i && i.__fc__ && i.__fc__.parent === r && this.rmCtx(i.__fc__);
|
|
3018
3041
|
});
|
|
3019
3042
|
},
|
|
@@ -3023,8 +3046,8 @@ function Cr(t) {
|
|
|
3023
3046
|
e.input && Object.defineProperty(e.rule, "value", {
|
|
3024
3047
|
value: e.rule.value,
|
|
3025
3048
|
writable: !0
|
|
3026
|
-
}),
|
|
3027
|
-
this.reloading || (e.parser.loadChildren !== !1 &&
|
|
3049
|
+
}), T(this.ctxs, r), T(this.$render.tempList, r), T(this.$render.orgChildren, r), T(this.vm.ctxInject, r), T(this.formData, r), T(this.subForm, r), T(e, "cacheValue"), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !k(this.fieldCtx, i) && T(this.form, i), this.deferSyncValue(() => {
|
|
3050
|
+
this.reloading || (e.parser.loadChildren !== !1 && f.trueArray(e.rule.children) && e.rule.children.forEach((a) => a.__fc__ && this.rmCtx(a.__fc__)), e.root === this.rules && this.vm._renderRule());
|
|
3028
3051
|
}, s);
|
|
3029
3052
|
const o = this.sort.indexOf(r);
|
|
3030
3053
|
return o > -1 && this.sort.splice(o, 1), this.$render.clearCache(e), e.delete(), this.effect(e, "deleted"), s && !this.fieldCtx[i] && this.vm.$emit("removeField", i, e.rule, this.api), e.rule.__ctrl || this.vm.$emit("removeRule", e.rule, this.api), e;
|
|
@@ -3032,7 +3055,7 @@ function Cr(t) {
|
|
|
3032
3055
|
});
|
|
3033
3056
|
}
|
|
3034
3057
|
function _r(t) {
|
|
3035
|
-
|
|
3058
|
+
p(t.prototype, {
|
|
3036
3059
|
mounted() {
|
|
3037
3060
|
const e = () => {
|
|
3038
3061
|
this.isMounted = !0, this.lifecycle("mounted");
|
|
@@ -3043,22 +3066,22 @@ function _r(t) {
|
|
|
3043
3066
|
this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3044
3067
|
},
|
|
3045
3068
|
emitEvent(e, ...r) {
|
|
3046
|
-
const i = this.options[e] || this.options[
|
|
3069
|
+
const i = this.options[e] || this.options[R("on-" + e)];
|
|
3047
3070
|
if (i) {
|
|
3048
|
-
const s =
|
|
3049
|
-
|
|
3071
|
+
const s = M(i);
|
|
3072
|
+
f.Function(s) && E(() => s(...r));
|
|
3050
3073
|
}
|
|
3051
3074
|
this.bus.$emit(e, ...r);
|
|
3052
3075
|
}
|
|
3053
3076
|
});
|
|
3054
3077
|
}
|
|
3055
|
-
function
|
|
3056
|
-
|
|
3078
|
+
function Or(t) {
|
|
3079
|
+
p(t.prototype, {
|
|
3057
3080
|
useProvider() {
|
|
3058
3081
|
const e = this.fc.providers;
|
|
3059
3082
|
Object.keys(e).forEach((r) => {
|
|
3060
3083
|
let i = e[r];
|
|
3061
|
-
|
|
3084
|
+
f.Function(i) && (i = i(this.fc)), i._c = wr(i), this.onEffect(i), this.providers[r] = i;
|
|
3062
3085
|
});
|
|
3063
3086
|
},
|
|
3064
3087
|
onEffect(e) {
|
|
@@ -3075,7 +3098,7 @@ function kr(t) {
|
|
|
3075
3098
|
let i = {
|
|
3076
3099
|
required: () => {
|
|
3077
3100
|
var s, n;
|
|
3078
|
-
return (
|
|
3101
|
+
return (k(e.rule, "$required") ? e.rule.$required : (n = (s = e.rule) == null ? void 0 : s.effect) == null ? void 0 : n.required) || !1;
|
|
3079
3102
|
}
|
|
3080
3103
|
};
|
|
3081
3104
|
Object.keys(e.rule.effect || {}).forEach((s) => {
|
|
@@ -3105,31 +3128,31 @@ function kr(t) {
|
|
|
3105
3128
|
}, r);
|
|
3106
3129
|
},
|
|
3107
3130
|
getEffect(e, r) {
|
|
3108
|
-
if (
|
|
3131
|
+
if (k(e, "$" + r))
|
|
3109
3132
|
return e["$" + r];
|
|
3110
|
-
if (
|
|
3133
|
+
if (k(e, "effect") && k(e.effect, r))
|
|
3111
3134
|
return e.effect[r];
|
|
3112
3135
|
},
|
|
3113
3136
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3114
3137
|
if (!s || s === "fcFragment") return;
|
|
3115
|
-
const u = n || Object.keys(r).reduce((l,
|
|
3138
|
+
const u = n || Object.keys(r).reduce((l, c) => (c[0] === "$" && (l[c.substr(1)] = r[c]), l), y({}, r.effect || {}));
|
|
3116
3139
|
Object.keys(u).forEach((l) => {
|
|
3117
|
-
const
|
|
3118
|
-
if (!
|
|
3119
|
-
let
|
|
3120
|
-
if (!
|
|
3121
|
-
|
|
3122
|
-
else if (
|
|
3123
|
-
|
|
3140
|
+
const c = this.providers[l];
|
|
3141
|
+
if (!c || c.input && !i) return;
|
|
3142
|
+
let m;
|
|
3143
|
+
if (!c._c)
|
|
3144
|
+
m = "*";
|
|
3145
|
+
else if (c._used.indexOf(s) > -1)
|
|
3146
|
+
m = s;
|
|
3124
3147
|
else
|
|
3125
3148
|
return;
|
|
3126
|
-
const
|
|
3127
|
-
e && (
|
|
3149
|
+
const v = y({ value: u[l], getValue: () => this.getEffect(r, l) }, a || {});
|
|
3150
|
+
e && (v.getProp = () => e.effectData(l), v.clearProp = () => e.clearEffectData(l), v.mergeProp = (_) => U(v.getProp(), [_]), v.id = e.id), this.bus.$emit(`p:${l}:${m}:${c.input ? 1 : 0}`, o, [v, r, this.api]);
|
|
3128
3151
|
});
|
|
3129
3152
|
}
|
|
3130
3153
|
});
|
|
3131
3154
|
}
|
|
3132
|
-
function
|
|
3155
|
+
function kr(t) {
|
|
3133
3156
|
return t.filter(function(e, r, i) {
|
|
3134
3157
|
return i.indexOf(e, 0) === r;
|
|
3135
3158
|
});
|
|
@@ -3137,12 +3160,12 @@ function Or(t) {
|
|
|
3137
3160
|
function wr(t) {
|
|
3138
3161
|
const e = t.components;
|
|
3139
3162
|
if (Array.isArray(e)) {
|
|
3140
|
-
const r =
|
|
3163
|
+
const r = kr(e.filter((i) => i !== "*"));
|
|
3141
3164
|
return r.length ? r : !1;
|
|
3142
|
-
} else return
|
|
3165
|
+
} else return f.String(e) ? [e] : !1;
|
|
3143
3166
|
}
|
|
3144
|
-
function
|
|
3145
|
-
|
|
3167
|
+
function A(t) {
|
|
3168
|
+
p(this, {
|
|
3146
3169
|
fc: t,
|
|
3147
3170
|
vm: t.vm,
|
|
3148
3171
|
watching: !1,
|
|
@@ -3171,11 +3194,11 @@ function V(t) {
|
|
|
3171
3194
|
bus() {
|
|
3172
3195
|
return t.bus;
|
|
3173
3196
|
}
|
|
3174
|
-
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new
|
|
3197
|
+
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new ve(this), this.api = t.extendApi(sr(this), this);
|
|
3175
3198
|
}
|
|
3176
|
-
|
|
3199
|
+
p(A.prototype, {
|
|
3177
3200
|
initData(t) {
|
|
3178
|
-
|
|
3201
|
+
p(this, {
|
|
3179
3202
|
ctxs: {},
|
|
3180
3203
|
fieldCtx: {},
|
|
3181
3204
|
nameCtx: {},
|
|
@@ -3189,19 +3212,19 @@ m(V.prototype, {
|
|
|
3189
3212
|
beforeFetch(t) {
|
|
3190
3213
|
return new Promise((e) => {
|
|
3191
3214
|
const r = this.options.beforeFetch && E(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3192
|
-
r &&
|
|
3215
|
+
r && f.Function(r.then) ? r.then(e) : e();
|
|
3193
3216
|
});
|
|
3194
3217
|
}
|
|
3195
3218
|
});
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
dr(
|
|
3199
|
-
mr(
|
|
3200
|
-
vr(
|
|
3201
|
-
Cr(
|
|
3202
|
-
_r(
|
|
3203
|
-
|
|
3204
|
-
const Fr = "fcFragment",
|
|
3219
|
+
hr(A);
|
|
3220
|
+
fr(A);
|
|
3221
|
+
dr(A);
|
|
3222
|
+
mr(A);
|
|
3223
|
+
vr(A);
|
|
3224
|
+
Cr(A);
|
|
3225
|
+
_r(A);
|
|
3226
|
+
Or(A);
|
|
3227
|
+
const Fr = "fcFragment", re = {
|
|
3205
3228
|
name: Fr,
|
|
3206
3229
|
functional: !0,
|
|
3207
3230
|
props: ["vnode"],
|
|
@@ -3210,33 +3233,33 @@ const Fr = "fcFragment", ie = {
|
|
|
3210
3233
|
}
|
|
3211
3234
|
};
|
|
3212
3235
|
function Sr(t) {
|
|
3213
|
-
return
|
|
3236
|
+
return f.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3214
3237
|
}
|
|
3215
|
-
function
|
|
3238
|
+
function Er() {
|
|
3216
3239
|
const t = {};
|
|
3217
3240
|
function e(r) {
|
|
3218
3241
|
r && this.setVm(r);
|
|
3219
3242
|
}
|
|
3220
|
-
return
|
|
3243
|
+
return p(e.prototype, {
|
|
3221
3244
|
setVm(r) {
|
|
3222
3245
|
this.vm = r, this.$h = r.$createElement;
|
|
3223
3246
|
},
|
|
3224
3247
|
make(r, i, s) {
|
|
3225
|
-
return
|
|
3248
|
+
return P.config.isReservedTag(r) && i.nativeOn && delete i.nativeOn, this.makeComponent(r, i, s);
|
|
3226
3249
|
},
|
|
3227
3250
|
makeComponent(r, i, s) {
|
|
3228
3251
|
let n = this.$h(r, Sr(i), s || []);
|
|
3229
3252
|
return n.context = this.vm, n;
|
|
3230
3253
|
},
|
|
3231
3254
|
aliasMap: t
|
|
3232
|
-
}),
|
|
3255
|
+
}), p(e, {
|
|
3233
3256
|
aliasMap: t,
|
|
3234
3257
|
alias(r, i) {
|
|
3235
3258
|
t[r] = i;
|
|
3236
3259
|
},
|
|
3237
3260
|
use(r) {
|
|
3238
3261
|
Object.keys(r).forEach((i) => {
|
|
3239
|
-
const s =
|
|
3262
|
+
const s = Q(i), n = ar(i).toLocaleLowerCase(), o = r[i];
|
|
3240
3263
|
[i, s, n].forEach((a) => {
|
|
3241
3264
|
e.alias(i, o), e.prototype[a] = function(u, l) {
|
|
3242
3265
|
return this.make(o, u, l);
|
|
@@ -3246,13 +3269,13 @@ function Rr() {
|
|
|
3246
3269
|
}
|
|
3247
3270
|
}), e;
|
|
3248
3271
|
}
|
|
3249
|
-
function
|
|
3250
|
-
class e extends
|
|
3272
|
+
function Rr(t) {
|
|
3273
|
+
class e extends ft {
|
|
3251
3274
|
}
|
|
3252
3275
|
return Object.assign(e.prototype, t), e;
|
|
3253
3276
|
}
|
|
3254
|
-
function
|
|
3255
|
-
|
|
3277
|
+
function ft(t) {
|
|
3278
|
+
p(this, {
|
|
3256
3279
|
$handle: t,
|
|
3257
3280
|
vm: t.vm,
|
|
3258
3281
|
options: {},
|
|
@@ -3262,7 +3285,7 @@ function ht(t) {
|
|
|
3262
3285
|
}
|
|
3263
3286
|
}), this.updateKey(), this.init();
|
|
3264
3287
|
}
|
|
3265
|
-
|
|
3288
|
+
p(ft.prototype, {
|
|
3266
3289
|
__init() {
|
|
3267
3290
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3268
3291
|
},
|
|
@@ -3289,7 +3312,7 @@ m(ht.prototype, {
|
|
|
3289
3312
|
return e(this.vm);
|
|
3290
3313
|
},
|
|
3291
3314
|
mergeOptions(t, e) {
|
|
3292
|
-
return
|
|
3315
|
+
return D(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3293
3316
|
},
|
|
3294
3317
|
updateOptions(t) {
|
|
3295
3318
|
this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3313,14 +3336,14 @@ const Ir = function(t) {
|
|
|
3313
3336
|
_fn: [],
|
|
3314
3337
|
created(r, i, s) {
|
|
3315
3338
|
this.deleted(r);
|
|
3316
|
-
let n =
|
|
3339
|
+
let n = I(r.getValue());
|
|
3317
3340
|
const o = [];
|
|
3318
3341
|
n.forEach((a) => {
|
|
3319
3342
|
if (a) {
|
|
3320
3343
|
const u = () => {
|
|
3321
3344
|
a.watch !== !1 && (t.bus.$off("p.loadData." + a.attr, u), t.bus.$once("p.loadData." + a.attr, u));
|
|
3322
3345
|
let l;
|
|
3323
|
-
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l =
|
|
3346
|
+
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l = B(l))), Z(r.getProp(), a.to || "options", l), s.sync(i);
|
|
3324
3347
|
};
|
|
3325
3348
|
o.push(() => t.bus.$off("p.loadData." + a.attr, u)), u();
|
|
3326
3349
|
}
|
|
@@ -3339,7 +3362,7 @@ const Ir = function(t) {
|
|
|
3339
3362
|
const i = t.getValue();
|
|
3340
3363
|
i ? t.getProp().validate = [{
|
|
3341
3364
|
validator(...s) {
|
|
3342
|
-
const n =
|
|
3365
|
+
const n = X(e);
|
|
3343
3366
|
if (n)
|
|
3344
3367
|
return r.exec(n.id, i === !0 ? "formCreateValidate" : i, ...s, {
|
|
3345
3368
|
attr: t,
|
|
@@ -3354,48 +3377,48 @@ const Ir = function(t) {
|
|
|
3354
3377
|
}
|
|
3355
3378
|
}, jr = function(t) {
|
|
3356
3379
|
function e(i) {
|
|
3357
|
-
return
|
|
3380
|
+
return f.String(i) && (i = {
|
|
3358
3381
|
action: i,
|
|
3359
3382
|
to: "options"
|
|
3360
3383
|
}), i;
|
|
3361
3384
|
}
|
|
3362
3385
|
function r(i, s, n) {
|
|
3363
3386
|
let o = i.value;
|
|
3364
|
-
const a = (
|
|
3365
|
-
|
|
3387
|
+
const a = (m) => {
|
|
3388
|
+
m === void 0 ? (i.clearProp(), n.sync(s)) : Z(i.getProp(), o.to || "options", m);
|
|
3366
3389
|
};
|
|
3367
|
-
if (
|
|
3390
|
+
if (f.Function(o) && (o = o(s, n)), o = e(o), !o || !o.action) {
|
|
3368
3391
|
a(void 0);
|
|
3369
3392
|
return;
|
|
3370
3393
|
}
|
|
3371
|
-
o =
|
|
3394
|
+
o = B(o), o.to || (o.to = "options");
|
|
3372
3395
|
const u = o.onError, l = () => {
|
|
3373
3396
|
if (!i.getValue())
|
|
3374
3397
|
return i.clearProp(), n.sync(s), !0;
|
|
3375
|
-
},
|
|
3398
|
+
}, c = q(y({
|
|
3376
3399
|
headers: {}
|
|
3377
3400
|
}, o), {
|
|
3378
|
-
onSuccess(
|
|
3401
|
+
onSuccess(m, v) {
|
|
3379
3402
|
if (l()) return;
|
|
3380
|
-
let
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
}),
|
|
3403
|
+
let _ = (g) => v ? g : k(g, "data") ? g.data : g;
|
|
3404
|
+
f.Function(o.parse) ? _ = o.parse : o.parse && f.String(o.parse) && (_ = (g) => (o.parse.split(".").forEach((O) => {
|
|
3405
|
+
g && (g = g[O]);
|
|
3406
|
+
}), g)), a(_(m, s, n)), n.sync(s);
|
|
3384
3407
|
},
|
|
3385
|
-
onError(
|
|
3386
|
-
a(void 0), !l() && (u || ((
|
|
3408
|
+
onError(m) {
|
|
3409
|
+
a(void 0), !l() && (u || ((v) => ye(v.message || "fetch fail " + o.action)))(m, s, n);
|
|
3387
3410
|
}
|
|
3388
3411
|
});
|
|
3389
|
-
t.$handle.beforeFetch(
|
|
3390
|
-
if (
|
|
3391
|
-
o.action(s, n).then((
|
|
3392
|
-
|
|
3393
|
-
}).catch((
|
|
3394
|
-
|
|
3412
|
+
t.$handle.beforeFetch(c, { rule: s, api: n }).then(() => {
|
|
3413
|
+
if (f.Function(o.action)) {
|
|
3414
|
+
o.action(s, n).then((m) => {
|
|
3415
|
+
c.onSuccess(m, !0);
|
|
3416
|
+
}).catch((m) => {
|
|
3417
|
+
c.onError(m);
|
|
3395
3418
|
});
|
|
3396
3419
|
return;
|
|
3397
3420
|
}
|
|
3398
|
-
E(() => t.create.fetch(
|
|
3421
|
+
E(() => t.create.fetch(c, { inject: i, rule: s, api: n }));
|
|
3399
3422
|
});
|
|
3400
3423
|
}
|
|
3401
3424
|
return {
|
|
@@ -3417,7 +3440,7 @@ const Ir = function(t) {
|
|
|
3417
3440
|
const s = y({
|
|
3418
3441
|
required: !0,
|
|
3419
3442
|
validator(n, o, a) {
|
|
3420
|
-
|
|
3443
|
+
f.empty(o) ? a(s.message) : a();
|
|
3421
3444
|
}
|
|
3422
3445
|
}, i);
|
|
3423
3446
|
if (!s.message) {
|
|
@@ -3433,7 +3456,7 @@ const Ir = function(t) {
|
|
|
3433
3456
|
}
|
|
3434
3457
|
};
|
|
3435
3458
|
function Ar(t) {
|
|
3436
|
-
return
|
|
3459
|
+
return f.Boolean(t) ? { required: t } : f.String(t) ? { message: t } : f.Undef(t) ? { required: !1 } : f.Function(t) ? { validator: t } : f.Object(t) ? t : {};
|
|
3437
3460
|
}
|
|
3438
3461
|
const Vr = {
|
|
3439
3462
|
fetch: jr,
|
|
@@ -3447,22 +3470,21 @@ const Vr = {
|
|
|
3447
3470
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
3448
3471
|
},
|
|
3449
3472
|
renderChildren(t) {
|
|
3450
|
-
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) =>
|
|
3473
|
+
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) => f.String(e)).join("") : "";
|
|
3451
3474
|
}
|
|
3452
3475
|
};
|
|
3453
|
-
let B = typeof window != "undefined" && window.Vue ? window.Vue : Y;
|
|
3454
3476
|
function Tr(t, e) {
|
|
3455
3477
|
let r;
|
|
3456
3478
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
3457
3479
|
}
|
|
3458
|
-
function
|
|
3480
|
+
function ie() {
|
|
3459
3481
|
return Tr("name", ...arguments);
|
|
3460
3482
|
}
|
|
3461
3483
|
function Ue(t) {
|
|
3462
|
-
return !t || !t.el ? window.document.body :
|
|
3484
|
+
return !t || !t.el ? window.document.body : f.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
3463
3485
|
}
|
|
3464
3486
|
function qe(t, e) {
|
|
3465
|
-
const r = new
|
|
3487
|
+
const r = new P({
|
|
3466
3488
|
data() {
|
|
3467
3489
|
return { rule: t, option: e || {} };
|
|
3468
3490
|
},
|
|
@@ -3474,87 +3496,88 @@ function qe(t, e) {
|
|
|
3474
3496
|
}
|
|
3475
3497
|
function Br(t) {
|
|
3476
3498
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
3477
|
-
et.push(...e),
|
|
3499
|
+
et.push(...e), de.push(...r), pe.push(...i), ot([...e, ...r, ...i]);
|
|
3478
3500
|
}
|
|
3479
3501
|
let Lr = 1;
|
|
3480
|
-
const
|
|
3502
|
+
const S = {};
|
|
3481
3503
|
function pt(t) {
|
|
3482
3504
|
const e = {
|
|
3483
|
-
[
|
|
3505
|
+
[re.name]: re
|
|
3484
3506
|
}, r = {}, i = {}, s = y({}, Vr), n = rr();
|
|
3485
3507
|
let o = { global: {} };
|
|
3486
|
-
const a = {}, u =
|
|
3508
|
+
const a = {}, u = Er(), l = {};
|
|
3487
3509
|
Br(t.attrs || {});
|
|
3488
|
-
function
|
|
3489
|
-
const d =
|
|
3510
|
+
function c(h) {
|
|
3511
|
+
const d = S[h];
|
|
3490
3512
|
if (Array.isArray(d))
|
|
3491
3513
|
return d.map(($) => $.api());
|
|
3492
3514
|
if (d)
|
|
3493
3515
|
return d.api();
|
|
3494
3516
|
}
|
|
3495
|
-
function
|
|
3496
|
-
const
|
|
3497
|
-
|
|
3517
|
+
function m() {
|
|
3518
|
+
const h = ie(...arguments);
|
|
3519
|
+
h.id && h.prop && (i[h.id] = h.prop);
|
|
3498
3520
|
}
|
|
3499
|
-
function
|
|
3500
|
-
const
|
|
3501
|
-
|
|
3521
|
+
function v() {
|
|
3522
|
+
const h = ie(...arguments);
|
|
3523
|
+
h.id && h.prop && (s[h.id] = q(y({}, h.prop), { name: h.id }));
|
|
3502
3524
|
}
|
|
3503
|
-
function
|
|
3504
|
-
u.use(
|
|
3525
|
+
function _(h) {
|
|
3526
|
+
u.use(h);
|
|
3505
3527
|
}
|
|
3506
|
-
function
|
|
3507
|
-
const
|
|
3508
|
-
if (!
|
|
3509
|
-
const d =
|
|
3510
|
-
r[d] = $, Object.setPrototypeOf($,
|
|
3528
|
+
function g() {
|
|
3529
|
+
const h = ie(...arguments);
|
|
3530
|
+
if (!h.id || !h.prop) return fe;
|
|
3531
|
+
const d = R(h.id), $ = h.prop, b = $.merge === !0 ? r[d] : void 0;
|
|
3532
|
+
r[d] = $, Object.setPrototypeOf($, b || fe), n[d] = F(d), $.maker && p(n, $.maker);
|
|
3511
3533
|
}
|
|
3512
|
-
function
|
|
3534
|
+
function O(h, d) {
|
|
3513
3535
|
let $;
|
|
3514
|
-
if (
|
|
3515
|
-
if ($ =
|
|
3516
|
-
return
|
|
3536
|
+
if (f.String(h)) {
|
|
3537
|
+
if ($ = R(h), ["form-create", "formcreate"].indexOf($) > -1)
|
|
3538
|
+
return x();
|
|
3517
3539
|
if (d === void 0)
|
|
3518
3540
|
return e[$];
|
|
3519
3541
|
} else
|
|
3520
|
-
$ =
|
|
3542
|
+
$ = R(h.name), d = h;
|
|
3521
3543
|
if (!$ || !d) return;
|
|
3522
|
-
const
|
|
3523
|
-
e[$] = d, e[
|
|
3544
|
+
const b = R($);
|
|
3545
|
+
e[$] = d, e[b] = d, delete u.aliasMap[$], delete u.aliasMap[b], delete r[$], delete r[b], d.formCreateParser && g($, d.formCreateParser);
|
|
3524
3546
|
}
|
|
3525
|
-
function
|
|
3526
|
-
Object.keys(
|
|
3527
|
-
(Array.isArray(
|
|
3528
|
-
|
|
3547
|
+
function be(h) {
|
|
3548
|
+
Object.keys(S).forEach((d) => {
|
|
3549
|
+
(Array.isArray(S[d]) ? S[d] : [S[d]]).forEach((b) => {
|
|
3550
|
+
b.bus.$emit("p.loadData." + h);
|
|
3529
3551
|
});
|
|
3530
3552
|
});
|
|
3531
3553
|
}
|
|
3532
|
-
function Ce(
|
|
3533
|
-
a[
|
|
3554
|
+
function Ce(h, d) {
|
|
3555
|
+
a[h] = d, be(h);
|
|
3534
3556
|
}
|
|
3535
|
-
function _e(
|
|
3536
|
-
return
|
|
3557
|
+
function _e(h, d) {
|
|
3558
|
+
return k(a, h) ? a[h] : d;
|
|
3537
3559
|
}
|
|
3538
|
-
function mt(
|
|
3539
|
-
delete a[
|
|
3560
|
+
function mt(h) {
|
|
3561
|
+
delete a[h], be(h);
|
|
3540
3562
|
}
|
|
3541
|
-
function
|
|
3542
|
-
return
|
|
3563
|
+
function x() {
|
|
3564
|
+
return Gt(ke, e, i);
|
|
3543
3565
|
}
|
|
3544
|
-
function
|
|
3545
|
-
return
|
|
3566
|
+
function Oe() {
|
|
3567
|
+
return re;
|
|
3546
3568
|
}
|
|
3547
|
-
function yt(
|
|
3548
|
-
return
|
|
3569
|
+
function yt(h, d) {
|
|
3570
|
+
return f.Function(h.install) ? h.install(N, d) : f.Function(h) && h(N, d), this;
|
|
3549
3571
|
}
|
|
3550
|
-
function
|
|
3551
|
-
let
|
|
3552
|
-
const
|
|
3553
|
-
return
|
|
3572
|
+
function N(h, d, $) {
|
|
3573
|
+
let b = qe(h, d || {});
|
|
3574
|
+
const j = b.$refs.fc.formCreate;
|
|
3575
|
+
return j.$parent = $, Ue(j.options).appendChild(b.$el), j.api();
|
|
3554
3576
|
}
|
|
3555
|
-
|
|
3577
|
+
Object.setPrototypeOf(N, l);
|
|
3578
|
+
function gt(h) {
|
|
3556
3579
|
let d = y({}, t);
|
|
3557
|
-
return
|
|
3580
|
+
return h ? d.inherit = {
|
|
3558
3581
|
components: e,
|
|
3559
3582
|
parsers: r,
|
|
3560
3583
|
directives: i,
|
|
@@ -3563,18 +3586,18 @@ function pt(t) {
|
|
|
3563
3586
|
loadData: a
|
|
3564
3587
|
} : delete d.inherit, pt(d);
|
|
3565
3588
|
}
|
|
3566
|
-
function
|
|
3567
|
-
const d =
|
|
3568
|
-
|
|
3589
|
+
function ke(h) {
|
|
3590
|
+
const d = h.$options.propsData.rule;
|
|
3591
|
+
p(this, {
|
|
3569
3592
|
id: Lr++,
|
|
3570
|
-
vm:
|
|
3571
|
-
create:
|
|
3572
|
-
manager:
|
|
3593
|
+
vm: h,
|
|
3594
|
+
create: N,
|
|
3595
|
+
manager: Rr(t.manager),
|
|
3573
3596
|
parsers: r,
|
|
3574
3597
|
providers: s,
|
|
3575
3598
|
rules: Array.isArray(d) ? d : [],
|
|
3576
|
-
name:
|
|
3577
|
-
inFor:
|
|
3599
|
+
name: h.$options.propsData.name || te(),
|
|
3600
|
+
inFor: h.$options.propsData.inFor,
|
|
3578
3601
|
prop: {
|
|
3579
3602
|
components: e,
|
|
3580
3603
|
directives: i
|
|
@@ -3583,29 +3606,29 @@ function pt(t) {
|
|
|
3583
3606
|
getData: _e,
|
|
3584
3607
|
loadData: a,
|
|
3585
3608
|
CreateNode: u,
|
|
3586
|
-
bus: new
|
|
3609
|
+
bus: new P(),
|
|
3587
3610
|
unwatch: null,
|
|
3588
3611
|
options: {},
|
|
3589
3612
|
extendApi: t.extendApi || (($) => $)
|
|
3590
|
-
}), this.init(), this.initOptions(), this.name && (this.inFor ? (
|
|
3613
|
+
}), this.init(), this.initOptions(), this.name && (this.inFor ? (S[this.name] || (S[this.name] = []), S[this.name].push(this)) : S[this.name] = this);
|
|
3591
3614
|
}
|
|
3592
|
-
|
|
3615
|
+
p(ke.prototype, {
|
|
3593
3616
|
init() {
|
|
3594
|
-
const
|
|
3595
|
-
this.$handle = d,
|
|
3596
|
-
this.isSub() && (this.unwatch =
|
|
3597
|
-
this.initOptions(),
|
|
3617
|
+
const h = this.vm, d = new A(this);
|
|
3618
|
+
this.$handle = d, h.$f = d.api, h.$emit("input", d.api), h.$on("hook:created", () => {
|
|
3619
|
+
this.isSub() && (this.unwatch = h.$watch(() => h.$pfc.option, () => {
|
|
3620
|
+
this.initOptions(), h.$f.refresh();
|
|
3598
3621
|
}, { deep: !0 }), this.initOptions()), this.created();
|
|
3599
|
-
}),
|
|
3622
|
+
}), h.$on("hook:mounted", () => {
|
|
3600
3623
|
this.mounted();
|
|
3601
|
-
}),
|
|
3602
|
-
if (
|
|
3624
|
+
}), h.$on("hook:beforeDestroy", () => {
|
|
3625
|
+
if (h.destroyed = !0, this.unwatch && this.unwatch(), d.reloadRule([]), this.name)
|
|
3603
3626
|
if (this.inFor) {
|
|
3604
|
-
const $ =
|
|
3605
|
-
|
|
3627
|
+
const $ = S[this.name].indexOf(this);
|
|
3628
|
+
S[this.name].splice($, 1), S[this.name].length || delete S[this.name];
|
|
3606
3629
|
} else
|
|
3607
|
-
delete
|
|
3608
|
-
}),
|
|
3630
|
+
delete S[this.name];
|
|
3631
|
+
}), h.$on("hook:updated", () => {
|
|
3609
3632
|
d.bindNextTick(() => this.bus.$emit("next-tick", d.api));
|
|
3610
3633
|
});
|
|
3611
3634
|
},
|
|
@@ -3614,16 +3637,16 @@ function pt(t) {
|
|
|
3614
3637
|
},
|
|
3615
3638
|
initOptions() {
|
|
3616
3639
|
this.options = {};
|
|
3617
|
-
let
|
|
3618
|
-
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0),
|
|
3640
|
+
let h = y({ formData: {}, submitBtn: {}, resetBtn: {} }, B(o));
|
|
3641
|
+
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0), h = this.mergeOptions(h, this.vm.$options.propsData.option), this.updateOptions(h);
|
|
3619
3642
|
},
|
|
3620
|
-
mergeOptions(
|
|
3621
|
-
return d =
|
|
3622
|
-
delete d[
|
|
3623
|
-
}), d.global && (
|
|
3643
|
+
mergeOptions(h, d, $) {
|
|
3644
|
+
return d = B(d), $ && ["page", "onSubmit", "mounted", "reload", "formData", "el"].forEach((b) => {
|
|
3645
|
+
delete d[b];
|
|
3646
|
+
}), d.global && (h.global = er(h.global, d.global), delete d.global), this.$handle.$manager.mergeOptions([d], h), h;
|
|
3624
3647
|
},
|
|
3625
|
-
updateOptions(
|
|
3626
|
-
this.mergeOptions(this.options,
|
|
3648
|
+
updateOptions(h) {
|
|
3649
|
+
this.mergeOptions(this.options, h), this.$handle.$manager.updateOptions(this.options);
|
|
3627
3650
|
},
|
|
3628
3651
|
created() {
|
|
3629
3652
|
this.$handle.init(), this.vm.$emit("created", this.api());
|
|
@@ -3638,68 +3661,78 @@ function pt(t) {
|
|
|
3638
3661
|
this.$handle.mounted();
|
|
3639
3662
|
}
|
|
3640
3663
|
});
|
|
3641
|
-
function we(
|
|
3642
|
-
|
|
3664
|
+
function we(h) {
|
|
3665
|
+
p(h, {
|
|
3643
3666
|
version: t.version,
|
|
3644
3667
|
ui: t.ui,
|
|
3645
3668
|
setData: Ce,
|
|
3646
3669
|
getData: _e,
|
|
3647
3670
|
removeData: mt,
|
|
3648
3671
|
maker: n,
|
|
3649
|
-
component:
|
|
3650
|
-
directive:
|
|
3651
|
-
register:
|
|
3652
|
-
$vnode:
|
|
3653
|
-
parser:
|
|
3672
|
+
component: O,
|
|
3673
|
+
directive: m,
|
|
3674
|
+
register: v,
|
|
3675
|
+
$vnode: Oe,
|
|
3676
|
+
parser: g,
|
|
3654
3677
|
use: yt,
|
|
3655
3678
|
factory: gt,
|
|
3656
|
-
componentAlias:
|
|
3657
|
-
copyRule:
|
|
3679
|
+
componentAlias: _,
|
|
3680
|
+
copyRule: ge,
|
|
3658
3681
|
copyRules: it,
|
|
3659
3682
|
fetch: lt,
|
|
3660
|
-
$form:
|
|
3661
|
-
parseFn:
|
|
3683
|
+
$form: x,
|
|
3684
|
+
parseFn: M,
|
|
3662
3685
|
parseJson: Yt,
|
|
3663
3686
|
toJson: tt,
|
|
3664
|
-
getApi:
|
|
3687
|
+
getApi: c,
|
|
3665
3688
|
init(d, $ = {}) {
|
|
3666
|
-
let
|
|
3689
|
+
let b = qe(d, $), j = b.$refs.fc.formCreate;
|
|
3667
3690
|
return {
|
|
3668
|
-
mount(
|
|
3669
|
-
return
|
|
3691
|
+
mount(H) {
|
|
3692
|
+
return H && f.Element(H) && (j.options.el = H), Ue(j.options).appendChild(b.$el), j.api();
|
|
3670
3693
|
},
|
|
3671
3694
|
remove() {
|
|
3672
|
-
|
|
3695
|
+
b.$el.parentNode && b.$el.parentNode.removeChild(b.$el);
|
|
3673
3696
|
},
|
|
3674
3697
|
destroy() {
|
|
3675
|
-
this.remove(),
|
|
3698
|
+
this.remove(), b.$destroy();
|
|
3676
3699
|
},
|
|
3677
|
-
$f:
|
|
3700
|
+
$f: j.api()
|
|
3678
3701
|
};
|
|
3679
3702
|
}
|
|
3680
3703
|
});
|
|
3681
3704
|
}
|
|
3682
|
-
function $t(
|
|
3683
|
-
|
|
3684
|
-
create:
|
|
3705
|
+
function $t(h) {
|
|
3706
|
+
p(h, {
|
|
3707
|
+
create: N,
|
|
3685
3708
|
install(d, $) {
|
|
3686
3709
|
if (o = y(y({}, o), $ || {}), d._installedFormCreate === !0) return;
|
|
3687
|
-
d._installedFormCreate = !0
|
|
3688
|
-
const
|
|
3689
|
-
return
|
|
3710
|
+
d._installedFormCreate = !0;
|
|
3711
|
+
const b = function(j, H = {}) {
|
|
3712
|
+
return N(j, H, this);
|
|
3690
3713
|
};
|
|
3691
|
-
we(
|
|
3714
|
+
we(b), d.prototype.$formCreate = b, d.component("FormCreate", x()), d.component("FcFragment", Oe());
|
|
3692
3715
|
}
|
|
3693
3716
|
});
|
|
3694
3717
|
}
|
|
3695
|
-
if (we(
|
|
3696
|
-
const
|
|
3697
|
-
|
|
3718
|
+
if (we(l), $t(l), u.use({ fragment: "fcFragment" }), g(Dr), t.install && N.use(t), t.inherit) {
|
|
3719
|
+
const h = t.inherit;
|
|
3720
|
+
h.components && p(e, h.components), h.parsers && p(r, h.parsers), h.directives && p(i, h.directives), h.providers && p(s, h.providers), h.maker && p(n, h.maker), h.loadData && p(a, h.loadData);
|
|
3698
3721
|
}
|
|
3699
|
-
|
|
3722
|
+
const G = x();
|
|
3723
|
+
return Object.setPrototypeOf(G, l), Object.defineProperties(G, {
|
|
3724
|
+
fetch: {
|
|
3725
|
+
get() {
|
|
3726
|
+
return l.fetch;
|
|
3727
|
+
},
|
|
3728
|
+
set(h) {
|
|
3729
|
+
l.fetch = h;
|
|
3730
|
+
}
|
|
3731
|
+
}
|
|
3732
|
+
}), G.util = l, G;
|
|
3700
3733
|
}
|
|
3701
|
-
function
|
|
3702
|
-
if (
|
|
3734
|
+
function ne(t) {
|
|
3735
|
+
if (f.Date(t))
|
|
3703
3736
|
return t;
|
|
3704
3737
|
{
|
|
3705
3738
|
let e = new Date(t);
|
|
@@ -3709,11 +3742,11 @@ function se(t) {
|
|
|
3709
3742
|
const He = "datePicker", Nr = {
|
|
3710
3743
|
name: He,
|
|
3711
3744
|
maker: function() {
|
|
3712
|
-
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] =
|
|
3745
|
+
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = F(He, { type: e.toLowerCase() }), t), {});
|
|
3713
3746
|
}(),
|
|
3714
3747
|
mergeProp(t) {
|
|
3715
3748
|
let e = t.prop.props;
|
|
3716
|
-
e.startDate && (e.startDate = e.startDate &&
|
|
3749
|
+
e.startDate && (e.startDate = e.startDate && ne(e.startDate));
|
|
3717
3750
|
},
|
|
3718
3751
|
isRange(t) {
|
|
3719
3752
|
return t.type.includes("range") || t.multiple;
|
|
@@ -3732,25 +3765,25 @@ const He = "datePicker", Nr = {
|
|
|
3732
3765
|
return this.isRange(e.el) ? r : r[0];
|
|
3733
3766
|
} else {
|
|
3734
3767
|
let r = Array.isArray(t), i = e.prop.props, s, n = i.type || "date";
|
|
3735
|
-
return ["daterange", "datetimerange"].indexOf(n) !== -1 ? r ? s = t.map((o) => o ?
|
|
3768
|
+
return ["daterange", "datetimerange"].indexOf(n) !== -1 ? r ? s = t.map((o) => o ? ne(o) : "") : s = ["", ""] : n === "date" && i.multiple === !0 ? s = toString(t) : (s = r ? t[0] || "" : t, s = s ? ne(s) : ""), s;
|
|
3736
3769
|
}
|
|
3737
3770
|
},
|
|
3738
3771
|
mounted(t) {
|
|
3739
3772
|
t.rule.value = this.toValue(t.$handle.getFormData(t), t);
|
|
3740
3773
|
}
|
|
3741
|
-
},
|
|
3742
|
-
name:
|
|
3774
|
+
}, se = "hidden", Mr = {
|
|
3775
|
+
name: se,
|
|
3743
3776
|
maker: {
|
|
3744
|
-
[
|
|
3777
|
+
[se]: (t, e) => F(se)("", t, e)
|
|
3745
3778
|
},
|
|
3746
3779
|
render() {
|
|
3747
3780
|
return [];
|
|
3748
3781
|
}
|
|
3749
|
-
},
|
|
3750
|
-
name:
|
|
3782
|
+
}, oe = "input", Ur = {
|
|
3783
|
+
name: oe,
|
|
3751
3784
|
maker: function() {
|
|
3752
|
-
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] =
|
|
3753
|
-
return t.idate =
|
|
3785
|
+
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = F(oe, { type: r }), e), {});
|
|
3786
|
+
return t.idate = F(oe, { type: "date" }), t;
|
|
3754
3787
|
}(),
|
|
3755
3788
|
mergeProp(t) {
|
|
3756
3789
|
let { props: e } = t.prop;
|
|
@@ -3759,7 +3792,7 @@ const He = "datePicker", Nr = {
|
|
|
3759
3792
|
}, Je = "slider", qr = {
|
|
3760
3793
|
name: Je,
|
|
3761
3794
|
maker: {
|
|
3762
|
-
sliderRange:
|
|
3795
|
+
sliderRange: F(Je, { range: !0 })
|
|
3763
3796
|
},
|
|
3764
3797
|
toFormValue(t, e) {
|
|
3765
3798
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
@@ -3811,7 +3844,7 @@ const He = "datePicker", Nr = {
|
|
|
3811
3844
|
group: "fcGroup",
|
|
3812
3845
|
subForm: "fcSubForm",
|
|
3813
3846
|
object: "fcSubForm"
|
|
3814
|
-
},
|
|
3847
|
+
}, Y = {
|
|
3815
3848
|
resetBtnType: "default",
|
|
3816
3849
|
resetBtnIcon: "md-refresh",
|
|
3817
3850
|
infoIcon: "ios-information-circle-outline"
|
|
@@ -3822,7 +3855,7 @@ function xr() {
|
|
|
3822
3855
|
trigger: "hover",
|
|
3823
3856
|
placement: "top-start",
|
|
3824
3857
|
wordWrap: !0,
|
|
3825
|
-
icon:
|
|
3858
|
+
icon: Y.infoIcon
|
|
3826
3859
|
};
|
|
3827
3860
|
}
|
|
3828
3861
|
function Gr() {
|
|
@@ -3847,9 +3880,9 @@ function Gr() {
|
|
|
3847
3880
|
click: void 0
|
|
3848
3881
|
},
|
|
3849
3882
|
resetBtn: {
|
|
3850
|
-
type:
|
|
3883
|
+
type: Y.resetBtnType,
|
|
3851
3884
|
disabled: !1,
|
|
3852
|
-
icon:
|
|
3885
|
+
icon: Y.resetBtnIcon,
|
|
3853
3886
|
innerText: "重置",
|
|
3854
3887
|
loading: !1,
|
|
3855
3888
|
show: !1,
|
|
@@ -3858,13 +3891,13 @@ function Gr() {
|
|
|
3858
3891
|
};
|
|
3859
3892
|
}
|
|
3860
3893
|
function ze(t, e) {
|
|
3861
|
-
|
|
3894
|
+
k(t, e) && f.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
3862
3895
|
}
|
|
3863
|
-
function
|
|
3896
|
+
function V(t) {
|
|
3864
3897
|
return t === !1;
|
|
3865
3898
|
}
|
|
3866
3899
|
function Kr(t, e) {
|
|
3867
|
-
|
|
3900
|
+
k(t, e) && !f.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
3868
3901
|
}
|
|
3869
3902
|
const Xr = {
|
|
3870
3903
|
validate() {
|
|
@@ -3896,7 +3929,7 @@ const Xr = {
|
|
|
3896
3929
|
return ze(t, "title"), ze(t, "info"), t;
|
|
3897
3930
|
},
|
|
3898
3931
|
mergeProp(t) {
|
|
3899
|
-
t.prop =
|
|
3932
|
+
t.prop = D([{
|
|
3900
3933
|
info: this.options.info || {},
|
|
3901
3934
|
wrap: this.options.wrap || {},
|
|
3902
3935
|
col: this.options.col || {},
|
|
@@ -3930,17 +3963,17 @@ const Xr = {
|
|
|
3930
3963
|
},
|
|
3931
3964
|
beforeRender() {
|
|
3932
3965
|
const { key: t, ref: e, $handle: r } = this;
|
|
3933
|
-
|
|
3966
|
+
p(this.rule, { key: t, ref: e }), p(this.rule.props, {
|
|
3934
3967
|
model: r.formData
|
|
3935
3968
|
// rules: $handle.validate(),
|
|
3936
3969
|
});
|
|
3937
3970
|
},
|
|
3938
3971
|
render(t) {
|
|
3939
|
-
return t.length && t.push(this.makeFormBtn()), this.$r(this.rule,
|
|
3972
|
+
return t.length && t.push(this.makeFormBtn()), this.$r(this.rule, V(this.options.row.show) ? t : [this.makeRow(t)]);
|
|
3940
3973
|
},
|
|
3941
3974
|
makeWrap(t, e) {
|
|
3942
|
-
const r = t.prop, i = `${this.key}${t.key}`, s = r.col, n = this.isTitle(r), o = !s.labelWidth && !n ? 0 : s.labelWidth, { inline: a, col: u } = this.rule.props, l =
|
|
3943
|
-
props:
|
|
3975
|
+
const r = t.prop, i = `${this.key}${t.key}`, s = r.col, n = this.isTitle(r), o = !s.labelWidth && !n ? 0 : s.labelWidth, { inline: a, col: u } = this.rule.props, l = V(r.wrap.show) ? e : this.$r(D([r.wrap, {
|
|
3976
|
+
props: q(y({
|
|
3944
3977
|
labelWidth: o
|
|
3945
3978
|
}, r.wrap || {}), {
|
|
3946
3979
|
prop: t.id,
|
|
@@ -3951,32 +3984,32 @@ const Xr = {
|
|
|
3951
3984
|
ref: t.wrapRef,
|
|
3952
3985
|
type: "formItem"
|
|
3953
3986
|
}]), [e, n ? this.makeInfo(r, i, t) : null]);
|
|
3954
|
-
return a === !0 ||
|
|
3987
|
+
return a === !0 || V(u) || V(s.show) ? l : this.makeCol(r, i, [l]);
|
|
3955
3988
|
},
|
|
3956
3989
|
isTitle(t) {
|
|
3957
3990
|
if (this.options.form.title === !1) return !1;
|
|
3958
3991
|
const e = t.title;
|
|
3959
|
-
return !(!e.title && !e.native ||
|
|
3992
|
+
return !(!e.title && !e.native || V(e.show));
|
|
3960
3993
|
},
|
|
3961
3994
|
makeInfo(t, e, r) {
|
|
3962
3995
|
const i = t.title, s = t.info, n = this.getSlot("title"), o = [n ? n({ title: i.title || "", rule: r.rule, options: this.options }) : i.title];
|
|
3963
|
-
if (!
|
|
3996
|
+
if (!V(s.show) && (s.info || s.native) && !V(s.icon)) {
|
|
3964
3997
|
const a = {
|
|
3965
3998
|
type: s.type || "poptip",
|
|
3966
3999
|
props: y({}, s),
|
|
3967
4000
|
key: `${e}pop`,
|
|
3968
4001
|
slot: "label"
|
|
3969
4002
|
}, u = "content";
|
|
3970
|
-
s.info && !
|
|
4003
|
+
s.info && !k(a.props, u) && (a.props[u] = s.info), o[s.align !== "left" ? "unshift" : "push"](this.$r(D([s, a]), [
|
|
3971
4004
|
this.$r({
|
|
3972
4005
|
type: "icon",
|
|
3973
|
-
props: { type: s.icon === !0 ?
|
|
4006
|
+
props: { type: s.icon === !0 ? Y.infoIcon : s.icon, size: 16 },
|
|
3974
4007
|
style: "margin-top: -1px",
|
|
3975
4008
|
key: `${e}i`
|
|
3976
4009
|
})
|
|
3977
4010
|
]));
|
|
3978
4011
|
}
|
|
3979
|
-
return this.$r(
|
|
4012
|
+
return this.$r(D([i, {
|
|
3980
4013
|
props: i,
|
|
3981
4014
|
slot: i.slot || "label",
|
|
3982
4015
|
key: `${e}tit`,
|
|
@@ -4003,7 +4036,7 @@ const Xr = {
|
|
|
4003
4036
|
},
|
|
4004
4037
|
makeFormBtn() {
|
|
4005
4038
|
let t = [];
|
|
4006
|
-
if (
|
|
4039
|
+
if (V(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), V(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4007
4040
|
return;
|
|
4008
4041
|
const e = this.$r({
|
|
4009
4042
|
type: "formItem",
|
|
@@ -4045,10 +4078,10 @@ const Xr = {
|
|
|
4045
4078
|
key: `${this.key}b1`
|
|
4046
4079
|
}, [t.innerText]);
|
|
4047
4080
|
}
|
|
4048
|
-
},
|
|
4081
|
+
}, L = {}, Qr = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
|
|
4049
4082
|
function Zr(t) {
|
|
4050
4083
|
Qr.forEach((e) => {
|
|
4051
|
-
t[e] =
|
|
4084
|
+
t[e] = F(e);
|
|
4052
4085
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4053
4086
|
}
|
|
4054
4087
|
function Yr(t) {
|
|
@@ -4058,19 +4091,19 @@ function Yr(t) {
|
|
|
4058
4091
|
uploadFileOne: ["file", 1],
|
|
4059
4092
|
uploadImageOne: ["image", 1]
|
|
4060
4093
|
};
|
|
4061
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4094
|
+
Object.keys(r).reduce((i, s) => (i[s] = F(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4062
4095
|
}
|
|
4063
4096
|
function ei(t) {
|
|
4064
4097
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4065
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4098
|
+
Object.keys(r).reduce((i, s) => (i[s] = F(e, { type: r[s] }), i), t);
|
|
4066
4099
|
}
|
|
4067
4100
|
function ti(t) {
|
|
4068
4101
|
const e = "timePicker";
|
|
4069
|
-
t.time =
|
|
4102
|
+
t.time = F(e, { type: "time" }), t.timeRange = F(e, { type: "timerange" });
|
|
4070
4103
|
}
|
|
4071
4104
|
function ri(t) {
|
|
4072
4105
|
const e = "select";
|
|
4073
|
-
t.selectMultiple =
|
|
4106
|
+
t.selectMultiple = F(e, { multiple: !0 }), t.selectOne = F(e, { multiple: !1 });
|
|
4074
4107
|
}
|
|
4075
4108
|
function ii(t) {
|
|
4076
4109
|
const e = "frame", r = {
|
|
@@ -4081,19 +4114,19 @@ function ii(t) {
|
|
|
4081
4114
|
frameFileOne: ["file", 1],
|
|
4082
4115
|
frameImageOne: ["image", 1]
|
|
4083
4116
|
};
|
|
4084
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4117
|
+
Object.keys(r).reduce((i, s) => (i[s] = F(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;
|
|
4085
4118
|
}
|
|
4086
|
-
Zr(
|
|
4087
|
-
Yr(
|
|
4088
|
-
ei(
|
|
4089
|
-
ri(
|
|
4090
|
-
ii(
|
|
4091
|
-
ti(
|
|
4119
|
+
Zr(L);
|
|
4120
|
+
Yr(L);
|
|
4121
|
+
ei(L);
|
|
4122
|
+
ri(L);
|
|
4123
|
+
ii(L);
|
|
4124
|
+
ti(L);
|
|
4092
4125
|
function We(t, e) {
|
|
4093
|
-
return
|
|
4126
|
+
return f.Boolean(t) ? t = { show: t } : !f.Undef(t) && !f.Object(t) && (t = { show: e }), t;
|
|
4094
4127
|
}
|
|
4095
4128
|
function ni(t, e) {
|
|
4096
|
-
return
|
|
4129
|
+
return p(t, {
|
|
4097
4130
|
formEl() {
|
|
4098
4131
|
return e.$manager.form();
|
|
4099
4132
|
},
|
|
@@ -4118,7 +4151,7 @@ function ni(t, e) {
|
|
|
4118
4151
|
const o = e.getFieldCtx(r);
|
|
4119
4152
|
if (!o) return;
|
|
4120
4153
|
const a = e.subForm[o.id], u = [e.$manager.validateField(o.id)];
|
|
4121
|
-
|
|
4154
|
+
I(a).forEach((l) => {
|
|
4122
4155
|
u.push(l.validate().catch(() => Promise.reject("子表单验证未通过")));
|
|
4123
4156
|
}), Promise.all(u).then(() => {
|
|
4124
4157
|
s(null), i && i(null);
|
|
@@ -4167,19 +4200,20 @@ function ni(t, e) {
|
|
|
4167
4200
|
},
|
|
4168
4201
|
submitBtnProps: (r = {}) => {
|
|
4169
4202
|
let i = We(e.options.submitBtn, !0);
|
|
4170
|
-
|
|
4203
|
+
p(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4171
4204
|
},
|
|
4172
4205
|
resetBtnProps: (r = {}) => {
|
|
4173
4206
|
let i = We(e.options.resetBtn, !1);
|
|
4174
|
-
|
|
4207
|
+
p(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4175
4208
|
},
|
|
4176
4209
|
submit(r, i) {
|
|
4177
4210
|
t.validate((s) => {
|
|
4178
4211
|
if (s) {
|
|
4179
4212
|
let n = t.formData();
|
|
4180
|
-
|
|
4213
|
+
f.Function(r) ? E(() => r(n, this)) : (f.Function(e.options.onSubmit) && E(() => e.options.onSubmit(n, this)), e.vm.$emit("submit", n, this));
|
|
4181
4214
|
} else
|
|
4182
|
-
|
|
4215
|
+
f.Function(i) && E(() => i(this, ...arguments));
|
|
4216
|
+
}).catch((s) => {
|
|
4183
4217
|
});
|
|
4184
4218
|
}
|
|
4185
4219
|
}), t;
|
|
@@ -4189,14 +4223,14 @@ function si(t) {
|
|
|
4189
4223
|
t.component(e.name, e);
|
|
4190
4224
|
}), zr.forEach((e) => {
|
|
4191
4225
|
t.parser(e);
|
|
4192
|
-
}), Object.keys(
|
|
4193
|
-
t.maker[e] =
|
|
4226
|
+
}), Object.keys(L).forEach((e) => {
|
|
4227
|
+
t.maker[e] = L[e];
|
|
4194
4228
|
});
|
|
4195
4229
|
}
|
|
4196
4230
|
function oi() {
|
|
4197
4231
|
return pt({
|
|
4198
4232
|
ui: "view-design",
|
|
4199
|
-
version: "2.6.
|
|
4233
|
+
version: "2.6.1",
|
|
4200
4234
|
manager: Xr,
|
|
4201
4235
|
install: si,
|
|
4202
4236
|
extendApi: ni,
|
|
@@ -4207,10 +4241,10 @@ function oi() {
|
|
|
4207
4241
|
}
|
|
4208
4242
|
});
|
|
4209
4243
|
}
|
|
4210
|
-
const
|
|
4211
|
-
typeof window != "undefined" && (window.formCreate =
|
|
4212
|
-
const ui =
|
|
4244
|
+
const ce = oi();
|
|
4245
|
+
typeof window != "undefined" && (window.formCreate = ce, window.Vue && ce.install(window.Vue));
|
|
4246
|
+
const ui = ce.maker;
|
|
4213
4247
|
export {
|
|
4214
|
-
|
|
4248
|
+
ce as default,
|
|
4215
4249
|
ui as maker
|
|
4216
4250
|
};
|