@form-create/view-design 2.6.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 +870 -851
- 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,61 +1,61 @@
|
|
|
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/
|
|
7
7
|
* Released under the MIT License.
|
|
8
8
|
*/
|
|
9
9
|
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode('._fc-frame .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;transition:opacity .3s}._fc-frame .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-frame .fc-files:hover .fc-upload-cover{opacity:1}._fc-frame .ivu-upload-list{margin-top:0}._fc-frame .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame .fc-upload-btn,._fc-frame .fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-upload .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-upload .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;transition:opacity .3s}._fc-upload .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-upload .fc-files:hover .fc-upload-cover{opacity:1}._fc-upload .ivu-upload-list{margin-top:0}._fc-upload .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-upload .fc-upload-btn,._fc-upload .fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-group{display:flex;min-height:42px;justify-content:center;flex-direction:column}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;padding:20px 20px 25px;margin:5px 5px 25px;border-radius:5px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}.form-create .form-create .ivu-form-item{margin-bottom:24px}.form-create .form-create .ivu-form-item .ivu-form-item{margin-bottom:0}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
10
|
+
var vt = Object.defineProperty, bt = Object.defineProperties;
|
|
11
|
+
var Ct = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var Fe = Object.getOwnPropertySymbols;
|
|
13
|
+
var _t = Object.prototype.hasOwnProperty, Ot = Object.prototype.propertyIsEnumerable;
|
|
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
|
-
|
|
17
|
-
if (
|
|
18
|
-
for (var r of
|
|
19
|
-
|
|
16
|
+
_t.call(e, r) && Se(t, r, e[r]);
|
|
17
|
+
if (Fe)
|
|
18
|
+
for (var r of Fe(e))
|
|
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
|
|
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 (
|
|
36
|
-
else if (
|
|
35
|
+
else if (wt.indexOf(i) !== -1) e[i] = ae({}, e[i], r[i]);
|
|
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);
|
|
39
|
-
} else if (
|
|
39
|
+
} else if (St.indexOf(i) !== -1)
|
|
40
40
|
for (var o in r[i]) if (e[i][o]) {
|
|
41
41
|
var a = e[i][o] instanceof Array ? e[i][o] : [e[i][o]], u = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
|
|
42
42
|
e[i][o] = [].concat(a, u);
|
|
43
43
|
} else e[i][o] = r[i][o];
|
|
44
|
-
else if (i === "hook") for (var l in r[i]) e[i][l] = e[i][l] ?
|
|
44
|
+
else if (i === "hook") for (var l in r[i]) e[i][l] = e[i][l] ? 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
|
-
},
|
|
53
|
-
const
|
|
54
|
-
function
|
|
52
|
+
}, It = Et;
|
|
53
|
+
const C = /* @__PURE__ */ kt(It);
|
|
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
|
}
|
|
57
|
-
const
|
|
58
|
-
name:
|
|
57
|
+
const jt = "fcCheckbox", At = {
|
|
58
|
+
name: jt,
|
|
59
59
|
props: {
|
|
60
60
|
formCreateInject: {
|
|
61
61
|
type: Object,
|
|
@@ -99,7 +99,8 @@ const At = "fcCheckbox", Vt = {
|
|
|
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,26 +110,26 @@ const At = "fcCheckbox", Vt = {
|
|
|
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
|
},
|
|
121
122
|
mounted() {
|
|
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
|
-
const
|
|
129
|
-
function
|
|
129
|
+
const Vt = "fcFrame";
|
|
130
|
+
function xe(t) {
|
|
130
131
|
return {
|
|
131
|
-
name:
|
|
132
|
+
name: Vt,
|
|
132
133
|
props: {
|
|
133
134
|
formCreateInject: {
|
|
134
135
|
type: Object,
|
|
@@ -249,7 +250,7 @@ function Ge(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 Ge(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 Ge(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 Ge(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 Ge(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 Ge(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 Ge(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 Ge(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 Ge(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
|
},
|
|
@@ -494,16 +503,16 @@ function Ge(t) {
|
|
|
494
503
|
}
|
|
495
504
|
};
|
|
496
505
|
}
|
|
497
|
-
const
|
|
506
|
+
const Ge = xe({
|
|
498
507
|
fileIcon: "md-document",
|
|
499
508
|
fileUpIcon: "ios-folder-open"
|
|
500
509
|
});
|
|
501
|
-
|
|
510
|
+
Ge.v2 = xe({
|
|
502
511
|
fileIcon: "document-text",
|
|
503
512
|
fileUpIcon: "folder"
|
|
504
513
|
});
|
|
505
|
-
const
|
|
506
|
-
name:
|
|
514
|
+
const Pt = "fcRadio", Dt = {
|
|
515
|
+
name: Pt,
|
|
507
516
|
props: {
|
|
508
517
|
formCreateInject: {
|
|
509
518
|
type: Object,
|
|
@@ -543,7 +552,8 @@ const Dt = "fcRadio", Tt = {
|
|
|
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 Dt = "fcRadio", Tt = {
|
|
|
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 Dt = "fcRadio", Tt = {
|
|
|
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,15 +600,15 @@ const Dt = "fcRadio", Tt = {
|
|
|
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
|
-
const
|
|
601
|
-
name:
|
|
610
|
+
const Tt = "fcSelect", Bt = {
|
|
611
|
+
name: Tt,
|
|
602
612
|
functional: !0,
|
|
603
613
|
props: {
|
|
604
614
|
formCreateInject: {
|
|
@@ -609,28 +619,28 @@ const Bt = "fcSelect", Lt = {
|
|
|
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);
|
|
631
641
|
}
|
|
632
|
-
},
|
|
633
|
-
name:
|
|
642
|
+
}, Lt = "fcTree", Nt = {
|
|
643
|
+
name: Lt,
|
|
634
644
|
props: {
|
|
635
645
|
formCreateInject: {
|
|
636
646
|
type: Object,
|
|
@@ -660,7 +670,7 @@ const Bt = "fcSelect", Lt = {
|
|
|
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,12 +683,12 @@ const Bt = "fcSelect", Lt = {
|
|
|
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:
|
|
681
|
-
}]), [
|
|
690
|
+
on: e
|
|
691
|
+
}]), [ee(this.$slots)]);
|
|
682
692
|
},
|
|
683
693
|
mounted() {
|
|
684
694
|
this.$emit("fc.el", this.$refs.tree);
|
|
@@ -687,16 +697,16 @@ const Bt = "fcSelect", Lt = {
|
|
|
687
697
|
function Ee(t) {
|
|
688
698
|
return {
|
|
689
699
|
url: t,
|
|
690
|
-
name:
|
|
700
|
+
name: Mt(t)
|
|
691
701
|
};
|
|
692
702
|
}
|
|
693
|
-
function
|
|
703
|
+
function Mt(t) {
|
|
694
704
|
return ("" + t).split("/").pop();
|
|
695
705
|
}
|
|
696
|
-
const
|
|
697
|
-
function
|
|
706
|
+
const Ut = "fcUpload";
|
|
707
|
+
function Ke(t) {
|
|
698
708
|
return {
|
|
699
|
-
name:
|
|
709
|
+
name: Ut,
|
|
700
710
|
props: {
|
|
701
711
|
formCreateInject: {
|
|
702
712
|
type: Object,
|
|
@@ -737,11 +747,11 @@ function Xe(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 Xe(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 Xe(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 Xe(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 Xe(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,40 +823,41 @@ function Xe(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
|
|
844
859
|
}
|
|
845
|
-
}]))])]) : null,
|
|
860
|
+
}]))])]) : null, ee(this.$slots, ["default"])]);
|
|
846
861
|
},
|
|
847
862
|
update() {
|
|
848
863
|
let e = this.$refs.upload.fileList.map((r) => r.url).filter((r) => r !== void 0);
|
|
@@ -853,9 +868,10 @@ function Xe(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 Xe(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
|
|
@@ -884,58 +900,58 @@ function Xe(t) {
|
|
|
884
900
|
}
|
|
885
901
|
};
|
|
886
902
|
}
|
|
887
|
-
const
|
|
903
|
+
const Xe = Ke({
|
|
888
904
|
fileIcon: "md-document",
|
|
889
905
|
imgUpIcon: "md-images"
|
|
890
906
|
});
|
|
891
|
-
|
|
907
|
+
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
|
-
const
|
|
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
|
|
935
|
-
return
|
|
950
|
+
function p() {
|
|
951
|
+
return qt.apply(this, arguments);
|
|
936
952
|
}
|
|
937
|
-
const
|
|
938
|
-
name:
|
|
953
|
+
const Ht = "fcGroup", Jt = {
|
|
954
|
+
name: Ht,
|
|
939
955
|
props: {
|
|
940
956
|
field: String,
|
|
941
957
|
rule: [Array, Object],
|
|
@@ -1016,13 +1032,13 @@ const Jt = "fcGroup", zt = {
|
|
|
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 Jt = "fcGroup", zt = {
|
|
|
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 Jt = "fcGroup", zt = {
|
|
|
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 Jt = "fcGroup", zt = {
|
|
|
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 Jt = "fcGroup", zt = {
|
|
|
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 Jt = "fcGroup", zt = {
|
|
|
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 Jt = "fcGroup", zt = {
|
|
|
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,55 +1203,55 @@ const Jt = "fcGroup", zt = {
|
|
|
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
|
-
},
|
|
1234
|
-
name:
|
|
1253
|
+
}, zt = "fcSubForm", Wt = {
|
|
1254
|
+
name: zt,
|
|
1235
1255
|
props: {
|
|
1236
1256
|
rule: Array,
|
|
1237
1257
|
options: Object,
|
|
@@ -1295,11 +1315,11 @@ const Jt = "fcGroup", zt = {
|
|
|
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,34 +1327,34 @@ const Jt = "fcGroup", zt = {
|
|
|
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
|
}
|
|
1315
1335
|
}]));
|
|
1316
1336
|
}
|
|
1317
|
-
},
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
],
|
|
1337
|
+
}, xt = [
|
|
1338
|
+
At,
|
|
1339
|
+
Dt,
|
|
1340
|
+
Bt,
|
|
1341
|
+
Nt,
|
|
1342
|
+
Wt,
|
|
1343
|
+
Ge,
|
|
1344
|
+
Xe,
|
|
1345
|
+
Jt
|
|
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
|
|
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
|
},
|
|
@@ -1419,23 +1439,23 @@ function Kt(t, e, r) {
|
|
|
1419
1439
|
},
|
|
1420
1440
|
beforeCreate() {
|
|
1421
1441
|
this.formCreate = new t(this), Object.keys(this.formCreate.prop).forEach((i) => {
|
|
1422
|
-
|
|
1442
|
+
p(this.$options[i], this.formCreate.prop[i]);
|
|
1423
1443
|
}), this.$emit("beforeCreate", this.formCreate.api());
|
|
1424
1444
|
},
|
|
1425
1445
|
created() {
|
|
1426
1446
|
const i = this, s = this.formCreate.api(), n = () => {
|
|
1427
1447
|
if (i.$pfc) {
|
|
1428
|
-
const a =
|
|
1448
|
+
const a = le(i, i.$pfc);
|
|
1429
1449
|
if (a) {
|
|
1430
1450
|
let u;
|
|
1431
|
-
i.isMore ? (u =
|
|
1451
|
+
i.isMore ? (u = I(a.getSubForm()), u.push(s)) : u = s, a.subForm(u);
|
|
1432
1452
|
}
|
|
1433
1453
|
}
|
|
1434
1454
|
}, o = () => {
|
|
1435
|
-
const a =
|
|
1455
|
+
const a = le(i, i.$pfc);
|
|
1436
1456
|
if (a)
|
|
1437
1457
|
if (i.isMore) {
|
|
1438
|
-
const u =
|
|
1458
|
+
const u = I(a.getSubForm()), l = u.indexOf(s);
|
|
1439
1459
|
l > -1 && u.splice(l, 1);
|
|
1440
1460
|
} else
|
|
1441
1461
|
a.subForm();
|
|
@@ -1448,86 +1468,86 @@ function Kt(t, e, r) {
|
|
|
1448
1468
|
}
|
|
1449
1469
|
};
|
|
1450
1470
|
}
|
|
1451
|
-
const
|
|
1452
|
-
const i = [...
|
|
1471
|
+
const Qe = ["attrs", "props", "domProps", "scopedSlots"], Ze = ["class", "style", "directives"], Ye = ["on", "nativeOn"], D = (t, e = {}, r = {}) => {
|
|
1472
|
+
const i = [...Qe, ...r.normal || []], s = [...Ze, ...r.array || []], n = [...Ye, ...r.functional || []], o = r.props || [];
|
|
1453
1473
|
return t.reduce((a, u) => {
|
|
1454
1474
|
for (const l in u)
|
|
1455
1475
|
if (a[l])
|
|
1456
1476
|
if (o.indexOf(l) > -1)
|
|
1457
|
-
a[l] =
|
|
1477
|
+
a[l] = D([u[l]], a[l]);
|
|
1458
1478
|
else if (i.indexOf(l) > -1)
|
|
1459
1479
|
a[l] = y(y({}, a[l]), u[l]);
|
|
1460
1480
|
else if (s.indexOf(l) > -1) {
|
|
1461
|
-
const c = a[l] instanceof Array ? a[l] : [a[l]],
|
|
1462
|
-
a[l] = [...c, ...
|
|
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];
|
|
1463
1483
|
} else if (n.indexOf(l) > -1)
|
|
1464
1484
|
for (const c in u[l])
|
|
1465
1485
|
if (a[l][c]) {
|
|
1466
|
-
const
|
|
1467
|
-
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];
|
|
1468
1488
|
} else
|
|
1469
1489
|
a[l][c] = u[l][c];
|
|
1470
1490
|
else if (l === "hook")
|
|
1471
1491
|
for (let c in u[l])
|
|
1472
|
-
a[l][c] ? a[l][c] =
|
|
1492
|
+
a[l][c] ? a[l][c] = Kt(a[l][c], u[l][c]) : a[l][c] = u[l][c];
|
|
1473
1493
|
else
|
|
1474
1494
|
a[l] = u[l];
|
|
1475
1495
|
else
|
|
1476
1496
|
i.indexOf(l) > -1 || n.indexOf(l) > -1 || o.indexOf(l) > -1 ? a[l] = y({}, u[l]) : s.indexOf(l) > -1 ? a[l] = u[l] instanceof Array ? [...u[l]] : typeof u[l] == "object" ? y({}, u[l]) : u[l] : a[l] = u[l];
|
|
1477
1497
|
return a;
|
|
1478
1498
|
}, e);
|
|
1479
|
-
},
|
|
1499
|
+
}, Kt = (t, e) => function() {
|
|
1480
1500
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1481
|
-
},
|
|
1482
|
-
function
|
|
1483
|
-
return [...
|
|
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"];
|
|
1502
|
+
function Xt() {
|
|
1503
|
+
return [...et, ...Qe, ...Ze, ...Ye, ...de, ...pe];
|
|
1484
1504
|
}
|
|
1485
|
-
function
|
|
1505
|
+
function me(t, e, r) {
|
|
1486
1506
|
return `[form-create ${t}]: ${e}`;
|
|
1487
1507
|
}
|
|
1488
|
-
function
|
|
1489
|
-
console.warn(
|
|
1508
|
+
function Qt(t, e) {
|
|
1509
|
+
console.warn(me("tip", t));
|
|
1490
1510
|
}
|
|
1491
|
-
function
|
|
1492
|
-
console.error(
|
|
1511
|
+
function ye(t, e) {
|
|
1512
|
+
console.error(me("err", t));
|
|
1493
1513
|
}
|
|
1494
|
-
function
|
|
1495
|
-
|
|
1514
|
+
function Zt(t) {
|
|
1515
|
+
ye(t.toString()), console.error(t);
|
|
1496
1516
|
}
|
|
1497
|
-
const
|
|
1498
|
-
function
|
|
1499
|
-
return JSON.stringify(
|
|
1517
|
+
const ue = "[[FORM-CREATE-PREFIX-", he = "-FORM-CREATE-SUFFIX]]", Ie = "$FN:", je = "$FNX:", J = "function";
|
|
1518
|
+
function tt(t, e) {
|
|
1519
|
+
return JSON.stringify(W(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1500
1520
|
if (!(i && i._isVue === !0)) {
|
|
1501
|
-
if (typeof i !==
|
|
1521
|
+
if (typeof i !== J)
|
|
1502
1522
|
return i;
|
|
1503
1523
|
if (i.__json)
|
|
1504
1524
|
return i.__json;
|
|
1505
1525
|
if (i.__origin && (i = i.__origin), !i.__emit)
|
|
1506
|
-
return
|
|
1526
|
+
return ue + i + he;
|
|
1507
1527
|
}
|
|
1508
1528
|
}, e);
|
|
1509
1529
|
}
|
|
1510
|
-
function
|
|
1530
|
+
function Ae(t) {
|
|
1511
1531
|
return new Function("return " + t)();
|
|
1512
1532
|
}
|
|
1513
|
-
function
|
|
1514
|
-
if (t &&
|
|
1533
|
+
function M(t, e) {
|
|
1534
|
+
if (t && f.String(t) && t.length > 4) {
|
|
1515
1535
|
let r = t.trim(), i = !1;
|
|
1516
1536
|
try {
|
|
1517
|
-
if (r.indexOf(he) > 0 && r.indexOf(
|
|
1518
|
-
r = r.replace(he, "").replace(
|
|
1519
|
-
else if (r.indexOf(
|
|
1520
|
-
r = r.replace(
|
|
1537
|
+
if (r.indexOf(he) > 0 && r.indexOf(ue) === 0)
|
|
1538
|
+
r = r.replace(he, "").replace(ue, ""), i = !0;
|
|
1539
|
+
else if (r.indexOf(Ie) === 0)
|
|
1540
|
+
r = r.replace(Ie, ""), i = !0;
|
|
1521
1541
|
else {
|
|
1522
|
-
if (r.indexOf(
|
|
1523
|
-
return r =
|
|
1524
|
-
!e && r.indexOf(
|
|
1542
|
+
if (r.indexOf(je) === 0)
|
|
1543
|
+
return r = Ae("function($inject){" + r.replace(je, "") + "}"), r.__json = t, r.__inject = !0, r;
|
|
1544
|
+
!e && r.indexOf(J) === 0 && r !== J && (i = !0);
|
|
1525
1545
|
}
|
|
1526
1546
|
if (!i) return t;
|
|
1527
|
-
const s =
|
|
1547
|
+
const s = Ae(r.indexOf(J) === -1 && r.indexOf("(") !== 0 ? J + " " + r : r);
|
|
1528
1548
|
return s.__json = t, s;
|
|
1529
1549
|
} catch (s) {
|
|
1530
|
-
|
|
1550
|
+
ye(`解析失败:${r}
|
|
1531
1551
|
|
|
1532
1552
|
err: ${s}`);
|
|
1533
1553
|
return;
|
|
@@ -1535,12 +1555,12 @@ err: ${s}`);
|
|
|
1535
1555
|
}
|
|
1536
1556
|
return t;
|
|
1537
1557
|
}
|
|
1538
|
-
function
|
|
1558
|
+
function Yt(t, e) {
|
|
1539
1559
|
return JSON.parse(t, function(r, i) {
|
|
1540
|
-
return
|
|
1560
|
+
return f.Undef(i) || !i.indexOf ? i : M(i, e);
|
|
1541
1561
|
});
|
|
1542
1562
|
}
|
|
1543
|
-
function
|
|
1563
|
+
function rt(t, e) {
|
|
1544
1564
|
return {
|
|
1545
1565
|
value: t,
|
|
1546
1566
|
enumerable: !1,
|
|
@@ -1548,60 +1568,60 @@ function it(t, e) {
|
|
|
1548
1568
|
writable: !!e
|
|
1549
1569
|
};
|
|
1550
1570
|
}
|
|
1551
|
-
function
|
|
1552
|
-
return
|
|
1571
|
+
function ge(t) {
|
|
1572
|
+
return it([t])[0];
|
|
1553
1573
|
}
|
|
1554
|
-
function
|
|
1555
|
-
return
|
|
1574
|
+
function it(t, e) {
|
|
1575
|
+
return W([], [...t], e || !1);
|
|
1556
1576
|
}
|
|
1557
|
-
function
|
|
1558
|
-
return
|
|
1577
|
+
function U(t, e) {
|
|
1578
|
+
return D(Array.isArray(e) ? e : [e], t, { array: de, normal: pe }), t;
|
|
1559
1579
|
}
|
|
1560
|
-
function
|
|
1561
|
-
const e =
|
|
1580
|
+
function Ve(t) {
|
|
1581
|
+
const e = f.Function(t.getRule) ? t.getRule() : t;
|
|
1562
1582
|
return e.type || (e.type = "input"), e;
|
|
1563
1583
|
}
|
|
1564
|
-
function
|
|
1584
|
+
function er(t, e) {
|
|
1565
1585
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1566
|
-
e[r] && (t[r] =
|
|
1586
|
+
e[r] && (t[r] = U(t[r] || {}, e[r]));
|
|
1567
1587
|
}), t) : e;
|
|
1568
1588
|
}
|
|
1569
|
-
function
|
|
1589
|
+
function nt(t, e) {
|
|
1570
1590
|
Object.defineProperties(t, Object.keys(e).reduce((r, i) => (r[i] = {
|
|
1571
1591
|
get() {
|
|
1572
1592
|
return e[i]();
|
|
1573
1593
|
}
|
|
1574
1594
|
}, r), {}));
|
|
1575
1595
|
}
|
|
1576
|
-
function
|
|
1596
|
+
function X(t) {
|
|
1577
1597
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1578
1598
|
}
|
|
1579
1599
|
function E(t, e) {
|
|
1580
1600
|
try {
|
|
1581
1601
|
e = t();
|
|
1582
1602
|
} catch (r) {
|
|
1583
|
-
|
|
1603
|
+
Zt(r);
|
|
1584
1604
|
}
|
|
1585
1605
|
return e;
|
|
1586
1606
|
}
|
|
1587
|
-
const
|
|
1588
|
-
"==": (t, e) => JSON.stringify(t) === JSON.stringify(
|
|
1589
|
-
"!=": (t, e) => !
|
|
1607
|
+
const Pe = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, z = {
|
|
1608
|
+
"==": (t, e) => JSON.stringify(t) === JSON.stringify(Pe(t, e)),
|
|
1609
|
+
"!=": (t, e) => !z["=="](t, e),
|
|
1590
1610
|
">": (t, e) => t > e,
|
|
1591
1611
|
">=": (t, e) => t >= e,
|
|
1592
1612
|
"<": (t, e) => t < e,
|
|
1593
1613
|
"<=": (t, e) => t <= e,
|
|
1594
1614
|
on(t, e) {
|
|
1595
|
-
return t && t.indexOf && t.indexOf(
|
|
1615
|
+
return t && t.indexOf && t.indexOf(Pe(t[0], e)) > -1;
|
|
1596
1616
|
},
|
|
1597
1617
|
notOn(t, e) {
|
|
1598
|
-
return !
|
|
1618
|
+
return !z.on(t, e);
|
|
1599
1619
|
},
|
|
1600
1620
|
in(t, e) {
|
|
1601
1621
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1602
1622
|
},
|
|
1603
1623
|
notIn(t, e) {
|
|
1604
|
-
return !
|
|
1624
|
+
return !z.in(t, e);
|
|
1605
1625
|
},
|
|
1606
1626
|
between(t, e) {
|
|
1607
1627
|
return t > e[0] && t < e[1];
|
|
@@ -1610,16 +1630,16 @@ const De = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1610
1630
|
return t < e[0] || t > e[1];
|
|
1611
1631
|
},
|
|
1612
1632
|
empty(t) {
|
|
1613
|
-
return
|
|
1633
|
+
return f.empty(t);
|
|
1614
1634
|
},
|
|
1615
1635
|
notEmpty(t) {
|
|
1616
|
-
return !
|
|
1636
|
+
return !f.empty(t);
|
|
1617
1637
|
},
|
|
1618
1638
|
pattern(t, e) {
|
|
1619
1639
|
return new RegExp(e, "g").test(t);
|
|
1620
1640
|
}
|
|
1621
1641
|
};
|
|
1622
|
-
function
|
|
1642
|
+
function st() {
|
|
1623
1643
|
return {
|
|
1624
1644
|
props: {},
|
|
1625
1645
|
on: {},
|
|
@@ -1631,57 +1651,57 @@ function ot() {
|
|
|
1631
1651
|
value: void 0
|
|
1632
1652
|
};
|
|
1633
1653
|
}
|
|
1634
|
-
function
|
|
1654
|
+
function F(t, e) {
|
|
1635
1655
|
return (r, i, s, n = {}) => {
|
|
1636
|
-
const o = new
|
|
1637
|
-
return e && (
|
|
1656
|
+
const o = new $e(t, r, i, s, n);
|
|
1657
|
+
return e && (f.Function(e) ? e(o) : o.props(e)), o;
|
|
1638
1658
|
};
|
|
1639
1659
|
}
|
|
1640
|
-
function
|
|
1641
|
-
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;
|
|
1642
1662
|
}
|
|
1643
|
-
|
|
1663
|
+
p($e.prototype, {
|
|
1644
1664
|
getRule() {
|
|
1645
1665
|
return this._data;
|
|
1646
1666
|
},
|
|
1647
1667
|
setProp(t, e) {
|
|
1648
|
-
return
|
|
1668
|
+
return w(this._data, t, e), this;
|
|
1649
1669
|
},
|
|
1650
1670
|
_clone() {
|
|
1651
1671
|
const t = new this.constructor();
|
|
1652
|
-
return t._data =
|
|
1672
|
+
return t._data = ge(this._data), t;
|
|
1653
1673
|
}
|
|
1654
1674
|
});
|
|
1655
|
-
function
|
|
1675
|
+
function ot(t) {
|
|
1656
1676
|
t.forEach((e) => {
|
|
1657
|
-
|
|
1658
|
-
return
|
|
1677
|
+
$e.prototype[e] = function(r) {
|
|
1678
|
+
return U(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1659
1679
|
};
|
|
1660
1680
|
});
|
|
1661
1681
|
}
|
|
1662
|
-
|
|
1663
|
-
const
|
|
1664
|
-
function
|
|
1665
|
-
let i =
|
|
1682
|
+
ot(Xt());
|
|
1683
|
+
const at = F("");
|
|
1684
|
+
function tr(t, e, r) {
|
|
1685
|
+
let i = at("", e);
|
|
1666
1686
|
return i._data.type = t, i._data.title = r, i;
|
|
1667
1687
|
}
|
|
1668
|
-
function
|
|
1669
|
-
let s =
|
|
1688
|
+
function De(t, e, r, i) {
|
|
1689
|
+
let s = at("", r);
|
|
1670
1690
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1671
1691
|
}
|
|
1672
|
-
function
|
|
1692
|
+
function rr() {
|
|
1673
1693
|
return {
|
|
1674
|
-
create:
|
|
1675
|
-
createTmp:
|
|
1676
|
-
template:
|
|
1677
|
-
factory:
|
|
1694
|
+
create: tr,
|
|
1695
|
+
createTmp: De,
|
|
1696
|
+
template: De,
|
|
1697
|
+
factory: F
|
|
1678
1698
|
};
|
|
1679
1699
|
}
|
|
1680
|
-
function
|
|
1700
|
+
function ir(t, e, r) {
|
|
1681
1701
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1682
1702
|
return s.status = r.status, s.url = t, s;
|
|
1683
1703
|
}
|
|
1684
|
-
function
|
|
1704
|
+
function Te(t) {
|
|
1685
1705
|
const e = t.responseText || t.response;
|
|
1686
1706
|
if (!e)
|
|
1687
1707
|
return e;
|
|
@@ -1691,7 +1711,7 @@ function Be(t) {
|
|
|
1691
1711
|
return e;
|
|
1692
1712
|
}
|
|
1693
1713
|
}
|
|
1694
|
-
function
|
|
1714
|
+
function lt(t) {
|
|
1695
1715
|
if (typeof XMLHttpRequest == "undefined")
|
|
1696
1716
|
return;
|
|
1697
1717
|
const e = new XMLHttpRequest(), r = t.action;
|
|
@@ -1699,8 +1719,8 @@ function ut(t) {
|
|
|
1699
1719
|
t.onError(o);
|
|
1700
1720
|
}, e.onload = function() {
|
|
1701
1721
|
if (e.status < 200 || e.status >= 300)
|
|
1702
|
-
return t.onError(
|
|
1703
|
-
t.onSuccess(
|
|
1722
|
+
return t.onError(ir(r, t, e), Te(e));
|
|
1723
|
+
t.onSuccess(Te(e));
|
|
1704
1724
|
}, e.open(t.method || "get", r, !0);
|
|
1705
1725
|
let i;
|
|
1706
1726
|
t.data && ((t.dataType || "").toLowerCase() !== "json" ? (i = new FormData(), Object.keys(t.data).map((n) => {
|
|
@@ -1711,13 +1731,13 @@ function ut(t) {
|
|
|
1711
1731
|
s[n] !== null && e.setRequestHeader(n, s[n]);
|
|
1712
1732
|
}), e.send(i);
|
|
1713
1733
|
}
|
|
1714
|
-
function
|
|
1734
|
+
function nr(t) {
|
|
1715
1735
|
return new Promise((e, r) => {
|
|
1716
|
-
|
|
1736
|
+
lt(q(y({}, t), {
|
|
1717
1737
|
onSuccess(i) {
|
|
1718
1738
|
let s = (o) => o;
|
|
1719
|
-
const n =
|
|
1720
|
-
|
|
1739
|
+
const n = M(t.parse);
|
|
1740
|
+
f.Function(n) ? s = n : n && f.String(n) && (s = (o) => (n.split(".").forEach((a) => {
|
|
1721
1741
|
o && (o = o[a]);
|
|
1722
1742
|
}), o)), e(s(i));
|
|
1723
1743
|
},
|
|
@@ -1727,17 +1747,17 @@ function sr(t) {
|
|
|
1727
1747
|
}));
|
|
1728
1748
|
});
|
|
1729
1749
|
}
|
|
1730
|
-
function
|
|
1731
|
-
return
|
|
1750
|
+
function K(t) {
|
|
1751
|
+
return B(t);
|
|
1732
1752
|
}
|
|
1733
|
-
function
|
|
1753
|
+
function sr(t) {
|
|
1734
1754
|
function e(n) {
|
|
1735
|
-
return
|
|
1755
|
+
return f.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1736
1756
|
}
|
|
1737
1757
|
function r(n, o, a) {
|
|
1738
1758
|
e(n).forEach((u) => {
|
|
1739
1759
|
t.getCtxs(u).forEach((l) => {
|
|
1740
|
-
|
|
1760
|
+
w(l.rule, o, a), t.$render.clearCache(l);
|
|
1741
1761
|
});
|
|
1742
1762
|
});
|
|
1743
1763
|
}
|
|
@@ -1773,13 +1793,13 @@ function or(t) {
|
|
|
1773
1793
|
formData(n) {
|
|
1774
1794
|
return e(n).reduce((o, a) => {
|
|
1775
1795
|
const u = t.getFieldCtx(a);
|
|
1776
|
-
return u && (o[u.field] =
|
|
1777
|
-
}, t.options.appendValue !== !1 ?
|
|
1796
|
+
return u && (o[u.field] = K(u.rule.value)), o;
|
|
1797
|
+
}, t.options.appendValue !== !1 ? K(t.appendData) : {});
|
|
1778
1798
|
},
|
|
1779
1799
|
getValue(n) {
|
|
1780
1800
|
const o = t.getFieldCtx(n);
|
|
1781
1801
|
if (o)
|
|
1782
|
-
return
|
|
1802
|
+
return K(o.rule.value);
|
|
1783
1803
|
},
|
|
1784
1804
|
coverValue(n) {
|
|
1785
1805
|
const o = y({}, n || {});
|
|
@@ -1787,12 +1807,12 @@ function or(t) {
|
|
|
1787
1807
|
s.fields().forEach((a) => {
|
|
1788
1808
|
const u = t.fieldCtx[a];
|
|
1789
1809
|
if (u) {
|
|
1790
|
-
const l =
|
|
1810
|
+
const l = k(o, a);
|
|
1791
1811
|
u.forEach((c) => {
|
|
1792
1812
|
c.rule.value = l ? o[a] : void 0;
|
|
1793
1813
|
}), delete o[a];
|
|
1794
1814
|
}
|
|
1795
|
-
}),
|
|
1815
|
+
}), p(t.appendData, o);
|
|
1796
1816
|
});
|
|
1797
1817
|
},
|
|
1798
1818
|
setValue(n) {
|
|
@@ -1816,7 +1836,7 @@ function or(t) {
|
|
|
1816
1836
|
}, !0), o ? o.origin : void 0;
|
|
1817
1837
|
},
|
|
1818
1838
|
removeRule(n) {
|
|
1819
|
-
const o = n &&
|
|
1839
|
+
const o = n && X(n);
|
|
1820
1840
|
if (o)
|
|
1821
1841
|
return o.rm(), o.origin;
|
|
1822
1842
|
},
|
|
@@ -1853,7 +1873,7 @@ function or(t) {
|
|
|
1853
1873
|
disabled(n, o) {
|
|
1854
1874
|
e(o).forEach((a) => {
|
|
1855
1875
|
t.getCtxs(a).forEach((u) => {
|
|
1856
|
-
u.rule.props &&
|
|
1876
|
+
u.rule.props && w(u.rule.props, "disabled", !!n);
|
|
1857
1877
|
});
|
|
1858
1878
|
}), t.refresh();
|
|
1859
1879
|
},
|
|
@@ -1892,7 +1912,7 @@ function or(t) {
|
|
|
1892
1912
|
n.forEach((a) => s.sync(a));
|
|
1893
1913
|
return;
|
|
1894
1914
|
}
|
|
1895
|
-
let o =
|
|
1915
|
+
let o = f.Object(n) ? X(n) : t.getCtxs(n);
|
|
1896
1916
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
1897
1917
|
if (!a.deleted) {
|
|
1898
1918
|
const u = t.subForm[a.id];
|
|
@@ -1911,7 +1931,7 @@ function or(t) {
|
|
|
1911
1931
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
1912
1932
|
},
|
|
1913
1933
|
hideForm: (n) => {
|
|
1914
|
-
|
|
1934
|
+
w(t.vm, "isShow", !n);
|
|
1915
1935
|
},
|
|
1916
1936
|
changeStatus: () => t.changeStatus,
|
|
1917
1937
|
clearChangeStatus: () => {
|
|
@@ -1919,7 +1939,7 @@ function or(t) {
|
|
|
1919
1939
|
},
|
|
1920
1940
|
updateRule(n, o) {
|
|
1921
1941
|
t.getCtxs(n).forEach((a) => {
|
|
1922
|
-
|
|
1942
|
+
p(a.rule, o);
|
|
1923
1943
|
});
|
|
1924
1944
|
},
|
|
1925
1945
|
updateRules(n) {
|
|
@@ -1929,7 +1949,7 @@ function or(t) {
|
|
|
1929
1949
|
},
|
|
1930
1950
|
mergeRule: (n, o) => {
|
|
1931
1951
|
t.getCtxs(n).forEach((a) => {
|
|
1932
|
-
|
|
1952
|
+
U(a.rule, o);
|
|
1933
1953
|
});
|
|
1934
1954
|
},
|
|
1935
1955
|
mergeRules(n) {
|
|
@@ -1956,7 +1976,7 @@ function or(t) {
|
|
|
1956
1976
|
},
|
|
1957
1977
|
setEffect(n, o, a) {
|
|
1958
1978
|
const u = t.getCtx(n);
|
|
1959
|
-
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));
|
|
1960
1980
|
},
|
|
1961
1981
|
clearEffectData(n, o) {
|
|
1962
1982
|
const a = t.getCtx(n);
|
|
@@ -1976,23 +1996,23 @@ function or(t) {
|
|
|
1976
1996
|
resetFields(n) {
|
|
1977
1997
|
e(n).forEach((o) => {
|
|
1978
1998
|
t.getCtxs(o).forEach((a) => {
|
|
1979
|
-
t.$render.clearCache(a), a.rule.value =
|
|
1999
|
+
t.$render.clearCache(a), a.rule.value = K(a.defaultValue);
|
|
1980
2000
|
});
|
|
1981
2001
|
}), t.vm.$nextTick(() => {
|
|
1982
2002
|
s.clearValidateState();
|
|
1983
|
-
}), n == null && (
|
|
2003
|
+
}), n == null && (f.Function(t.options.onReset) && E(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
1984
2004
|
},
|
|
1985
2005
|
method(n, o) {
|
|
1986
2006
|
const a = s.el(n);
|
|
1987
2007
|
if (!a || !a[o])
|
|
1988
|
-
throw new Error(
|
|
2008
|
+
throw new Error(me("err", `${o}方法不存在`));
|
|
1989
2009
|
return (...u) => a[o](...u);
|
|
1990
2010
|
},
|
|
1991
2011
|
exec(n, o, ...a) {
|
|
1992
2012
|
return E(() => s.method(n, o)(...a));
|
|
1993
2013
|
},
|
|
1994
2014
|
toJson(n) {
|
|
1995
|
-
return
|
|
2015
|
+
return tt(s.rule, n);
|
|
1996
2016
|
},
|
|
1997
2017
|
trigger(n, o, ...a) {
|
|
1998
2018
|
const u = s.el(n);
|
|
@@ -2024,7 +2044,7 @@ function or(t) {
|
|
|
2024
2044
|
},
|
|
2025
2045
|
fetch(n) {
|
|
2026
2046
|
return new Promise((o, a) => {
|
|
2027
|
-
t.beforeFetch(n).then(() =>
|
|
2047
|
+
t.beforeFetch(n).then(() => nr(n).then(o).catch(a));
|
|
2028
2048
|
});
|
|
2029
2049
|
},
|
|
2030
2050
|
getData(n, o) {
|
|
@@ -2044,8 +2064,8 @@ function or(t) {
|
|
|
2044
2064
|
};
|
|
2045
2065
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2046
2066
|
}
|
|
2047
|
-
function
|
|
2048
|
-
|
|
2067
|
+
function or(t) {
|
|
2068
|
+
p(t.prototype, {
|
|
2049
2069
|
initCache() {
|
|
2050
2070
|
this.clearCacheAll();
|
|
2051
2071
|
},
|
|
@@ -2078,35 +2098,35 @@ function ar(t) {
|
|
|
2078
2098
|
}
|
|
2079
2099
|
});
|
|
2080
2100
|
}
|
|
2081
|
-
function
|
|
2101
|
+
function R(t) {
|
|
2082
2102
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2083
2103
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2084
2104
|
});
|
|
2085
|
-
return
|
|
2105
|
+
return ut(e);
|
|
2086
2106
|
}
|
|
2087
|
-
function
|
|
2107
|
+
function ut(t) {
|
|
2088
2108
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2089
2109
|
}
|
|
2090
|
-
function
|
|
2110
|
+
function ar(t) {
|
|
2091
2111
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
2092
2112
|
}
|
|
2093
|
-
function
|
|
2113
|
+
function Q(t) {
|
|
2094
2114
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
2095
2115
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
2096
2116
|
}
|
|
2097
|
-
let
|
|
2098
|
-
function
|
|
2099
|
-
const t = 370 + ++
|
|
2117
|
+
let lr = 0;
|
|
2118
|
+
function te() {
|
|
2119
|
+
const t = 370 + ++lr;
|
|
2100
2120
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
2101
2121
|
}
|
|
2102
|
-
function
|
|
2122
|
+
function Z(t, e, r) {
|
|
2103
2123
|
let i = t, s;
|
|
2104
2124
|
return (e || "").split(".").forEach((n) => {
|
|
2105
2125
|
s && ((!i[s] || typeof i[s] != "object") && (i[s] = {}), i = i[s]), s = n;
|
|
2106
2126
|
}), i[s] = r, i;
|
|
2107
2127
|
}
|
|
2108
|
-
function
|
|
2109
|
-
|
|
2128
|
+
function ur(t) {
|
|
2129
|
+
p(t.prototype, {
|
|
2110
2130
|
initRender() {
|
|
2111
2131
|
this.tempList = {}, this.clearOrgChildren();
|
|
2112
2132
|
},
|
|
@@ -2115,7 +2135,7 @@ function fr(t) {
|
|
|
2115
2135
|
this.orgChildren = Object.keys(e).reduce((r, i) => {
|
|
2116
2136
|
if (e[i].parser.loadChildren !== !1) {
|
|
2117
2137
|
const s = e[i].rule.children;
|
|
2118
|
-
r[i] =
|
|
2138
|
+
r[i] = f.trueArray(s) ? [...s] : [];
|
|
2119
2139
|
}
|
|
2120
2140
|
return r;
|
|
2121
2141
|
}, {});
|
|
@@ -2127,7 +2147,7 @@ function fr(t) {
|
|
|
2127
2147
|
const r = (i) => {
|
|
2128
2148
|
if (i) {
|
|
2129
2149
|
let s;
|
|
2130
|
-
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);
|
|
2131
2151
|
}
|
|
2132
2152
|
};
|
|
2133
2153
|
return r(this.vm);
|
|
@@ -2146,38 +2166,38 @@ function fr(t) {
|
|
|
2146
2166
|
makeVm(e) {
|
|
2147
2167
|
const r = e.vm;
|
|
2148
2168
|
if (r) {
|
|
2149
|
-
if (
|
|
2169
|
+
if (f.Function(r))
|
|
2150
2170
|
return E(() => e.vm(this.$handle.getInjectData(e)));
|
|
2151
2171
|
if (!r._isVue)
|
|
2152
|
-
return new
|
|
2153
|
-
} else return new
|
|
2172
|
+
return new P(r);
|
|
2173
|
+
} else return new P();
|
|
2154
2174
|
return r;
|
|
2155
2175
|
},
|
|
2156
2176
|
mergeGlobal(e) {
|
|
2157
2177
|
const r = this.$handle.options.global;
|
|
2158
|
-
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]));
|
|
2159
2179
|
},
|
|
2160
2180
|
setOptions(e) {
|
|
2161
|
-
e.prop.optionsTo && e.prop.options &&
|
|
2181
|
+
e.prop.optionsTo && e.prop.options && Z(e.prop, e.prop.optionsTo, e.prop.options);
|
|
2162
2182
|
},
|
|
2163
2183
|
deepSet(e) {
|
|
2164
2184
|
const r = e.rule.deep;
|
|
2165
2185
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2166
|
-
|
|
2186
|
+
Z(e.prop, i, r[i]);
|
|
2167
2187
|
});
|
|
2168
2188
|
},
|
|
2169
2189
|
setTempProps(e, r) {
|
|
2170
2190
|
if (!e.$props) return;
|
|
2171
2191
|
const { prop: i } = r, s = Object.keys(e.$props), n = this.injectProp(r), o = Object.keys(n);
|
|
2172
2192
|
s.forEach((u) => {
|
|
2173
|
-
|
|
2193
|
+
k(i.props, u) ? e.$props[u] = i.props[u] : o.indexOf(u) > -1 && (e.$props[u] = n[u]);
|
|
2174
2194
|
});
|
|
2175
2195
|
const a = e.$options.model && e.$options.model.prop || "value";
|
|
2176
2196
|
s.indexOf(a) > -1 && (e.$props[a] = i.value);
|
|
2177
2197
|
},
|
|
2178
2198
|
renderTemp(e) {
|
|
2179
|
-
if (!
|
|
2180
|
-
return
|
|
2199
|
+
if (!P.compile)
|
|
2200
|
+
return Qt("当前使用的Vue构建版本不支持compile,无法使用template功能"), [];
|
|
2181
2201
|
const r = e.prop, { id: i, key: s } = e;
|
|
2182
2202
|
if (!this.tempList[i]) {
|
|
2183
2203
|
e.el || (e.el = this.makeVm(r), this.vm.$nextTick(() => e.parser.mounted(e)));
|
|
@@ -2186,16 +2206,16 @@ function fr(t) {
|
|
|
2186
2206
|
this.onInput(e, l);
|
|
2187
2207
|
}), this.tempList[i] = {
|
|
2188
2208
|
vm: u,
|
|
2189
|
-
template:
|
|
2209
|
+
template: P.compile(r.template)
|
|
2190
2210
|
};
|
|
2191
2211
|
}
|
|
2192
2212
|
const { vm: n, template: o } = this.tempList[i];
|
|
2193
2213
|
this.setTempProps(n, e);
|
|
2194
2214
|
const a = o.render.call(n);
|
|
2195
|
-
return
|
|
2215
|
+
return f.Undef(a.data) && (a.data = {}), a.key = s, a.data.ref = e.ref, a.data.key = s, a;
|
|
2196
2216
|
},
|
|
2197
2217
|
parseSide(e, r) {
|
|
2198
|
-
return
|
|
2218
|
+
return f.Object(e) ? U({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2199
2219
|
},
|
|
2200
2220
|
renderSides(e, r, i) {
|
|
2201
2221
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2213,7 +2233,7 @@ function fr(t) {
|
|
|
2213
2233
|
const i = e.rule;
|
|
2214
2234
|
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2215
2235
|
let s, n = i.cache !== !1;
|
|
2216
|
-
const o = e.trueType, a = !(
|
|
2236
|
+
const o = e.trueType, a = !(f.Undef(i.display) || i.display);
|
|
2217
2237
|
if (o === "template" && !i.template)
|
|
2218
2238
|
s = this.renderSides(this.renderChildren(e), e, !0), a && this.display(s), s = this.item(e, s);
|
|
2219
2239
|
else if (o === "fcFragment")
|
|
@@ -2221,7 +2241,7 @@ function fr(t) {
|
|
|
2221
2241
|
else {
|
|
2222
2242
|
e.initProp(), this.mergeGlobal(e), this.$manager.tidyRule(e), this.deepSet(e), this.setOptions(e), this.ctxProp(e);
|
|
2223
2243
|
let u = e.prop;
|
|
2224
|
-
u.preview = !!(
|
|
2244
|
+
u.preview = !!(k(u, "preview") ? u.preview : this.options.preview), u.props.formCreateInject = this.injectProp(e);
|
|
2225
2245
|
const l = u.preview;
|
|
2226
2246
|
if (u.hidden) {
|
|
2227
2247
|
this.setCache(e, void 0, r);
|
|
@@ -2232,8 +2252,8 @@ function fr(t) {
|
|
|
2232
2252
|
else {
|
|
2233
2253
|
let c = [];
|
|
2234
2254
|
e.parser.renderChildren ? c = e.parser.renderChildren(e) : e.parser.loadChildren !== !1 && (c = this.renderChildren(e));
|
|
2235
|
-
const
|
|
2236
|
-
|
|
2255
|
+
const m = this.getTypeSlot(e);
|
|
2256
|
+
m ? s = m({
|
|
2237
2257
|
rule: i,
|
|
2238
2258
|
prop: u,
|
|
2239
2259
|
preview: l,
|
|
@@ -2242,7 +2262,7 @@ function fr(t) {
|
|
|
2242
2262
|
model: u.model || {}
|
|
2243
2263
|
}) : s = l ? e.parser.preview(c, e) : e.parser.render(c, e);
|
|
2244
2264
|
}
|
|
2245
|
-
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);
|
|
2246
2266
|
}
|
|
2247
2267
|
return n && this.setCache(e, s, r), s;
|
|
2248
2268
|
}
|
|
@@ -2260,7 +2280,7 @@ function fr(t) {
|
|
|
2260
2280
|
},
|
|
2261
2281
|
none(e) {
|
|
2262
2282
|
if (e && e.data)
|
|
2263
|
-
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;
|
|
2264
2284
|
},
|
|
2265
2285
|
item(e, r) {
|
|
2266
2286
|
return this.$h("fcFragment", {
|
|
@@ -2269,7 +2289,7 @@ function fr(t) {
|
|
|
2269
2289
|
}, [r]);
|
|
2270
2290
|
},
|
|
2271
2291
|
injectProp(e) {
|
|
2272
|
-
this.vm.ctxInject[e.id] ||
|
|
2292
|
+
this.vm.ctxInject[e.id] || w(this.vm.ctxInject, e.id, {
|
|
2273
2293
|
api: this.$handle.api,
|
|
2274
2294
|
form: this.fc.create,
|
|
2275
2295
|
subForm: (i) => {
|
|
@@ -2286,7 +2306,7 @@ function fr(t) {
|
|
|
2286
2306
|
input: e.input
|
|
2287
2307
|
});
|
|
2288
2308
|
const r = this.vm.ctxInject[e.id];
|
|
2289
|
-
return
|
|
2309
|
+
return p(r, {
|
|
2290
2310
|
preview: e.prop.preview,
|
|
2291
2311
|
options: e.prop.options,
|
|
2292
2312
|
children: e.rule.children,
|
|
@@ -2323,7 +2343,7 @@ function fr(t) {
|
|
|
2323
2343
|
this.onInput(e, o);
|
|
2324
2344
|
},
|
|
2325
2345
|
expression: `formData.${e.id}`
|
|
2326
|
-
}),
|
|
2346
|
+
}), D(n, e.prop), e.prop;
|
|
2327
2347
|
},
|
|
2328
2348
|
onMounted(e) {
|
|
2329
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");
|
|
@@ -2332,8 +2352,8 @@ function fr(t) {
|
|
|
2332
2352
|
this.$handle.onInput(e, r);
|
|
2333
2353
|
},
|
|
2334
2354
|
renderChildren(e) {
|
|
2335
|
-
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !
|
|
2336
|
-
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(() => {
|
|
2337
2357
|
i.forEach((n) => {
|
|
2338
2358
|
n && s(n) && this.$handle.rmCtx(n.__fc__);
|
|
2339
2359
|
});
|
|
@@ -2343,7 +2363,7 @@ function fr(t) {
|
|
|
2343
2363
|
});
|
|
2344
2364
|
}), r.map((n) => {
|
|
2345
2365
|
if (n) {
|
|
2346
|
-
if (
|
|
2366
|
+
if (f.String(n)) return n;
|
|
2347
2367
|
if (n.__fc__)
|
|
2348
2368
|
return this.renderCtx(n.__fc__, e);
|
|
2349
2369
|
n.type && this.vm.$nextTick(() => {
|
|
@@ -2354,33 +2374,33 @@ function fr(t) {
|
|
|
2354
2374
|
},
|
|
2355
2375
|
defaultRender(e, r) {
|
|
2356
2376
|
const i = e.prop;
|
|
2357
|
-
return i.component ? this.vNode.makeComponent(i.component, i, r) : this.vNode[e.type] ? this.vNode[e.type](i, r) : this.vNode[e.originType] ? this.vNode[e.originType](i, r) : this.vNode.make(
|
|
2377
|
+
return i.component ? this.vNode.makeComponent(i.component, i, r) : this.vNode[e.type] ? this.vNode[e.type](i, r) : this.vNode[e.originType] ? this.vNode[e.originType](i, r) : this.vNode.make(ut(e.originType), i, r);
|
|
2358
2378
|
},
|
|
2359
2379
|
renderRule(e, r, i) {
|
|
2360
2380
|
if (!e) return;
|
|
2361
|
-
if (
|
|
2381
|
+
if (f.String(e)) return e;
|
|
2362
2382
|
let s;
|
|
2363
2383
|
if (i)
|
|
2364
2384
|
s = e.type;
|
|
2365
2385
|
else if (s = e.is, e.type) {
|
|
2366
|
-
s =
|
|
2386
|
+
s = R(e.type);
|
|
2367
2387
|
const o = this.vNode.aliasMap[s];
|
|
2368
|
-
o && (s =
|
|
2388
|
+
o && (s = R(o));
|
|
2369
2389
|
}
|
|
2370
2390
|
if (!s) return;
|
|
2371
2391
|
let n = [[r]];
|
|
2372
|
-
return
|
|
2392
|
+
return f.trueArray(e.children) && n.push(e.children.map((o) => this.renderRule(o))), this.$h(s, y({}, e), n);
|
|
2373
2393
|
}
|
|
2374
2394
|
});
|
|
2375
2395
|
}
|
|
2376
|
-
function
|
|
2377
|
-
|
|
2396
|
+
function ve(t) {
|
|
2397
|
+
p(this, {
|
|
2378
2398
|
$handle: t,
|
|
2379
2399
|
fc: t.fc,
|
|
2380
2400
|
vm: t.vm,
|
|
2381
2401
|
$manager: t.$manager,
|
|
2382
2402
|
vNode: new t.fc.CreateNode(t.vm)
|
|
2383
|
-
}),
|
|
2403
|
+
}), nt(this, {
|
|
2384
2404
|
options() {
|
|
2385
2405
|
return t.options;
|
|
2386
2406
|
},
|
|
@@ -2389,10 +2409,10 @@ function be(t) {
|
|
|
2389
2409
|
}
|
|
2390
2410
|
}), this.initCache(), this.initRender();
|
|
2391
2411
|
}
|
|
2392
|
-
|
|
2393
|
-
|
|
2412
|
+
or(ve);
|
|
2413
|
+
ur(ve);
|
|
2394
2414
|
function hr(t) {
|
|
2395
|
-
|
|
2415
|
+
p(t.prototype, {
|
|
2396
2416
|
parseInjectEvent(e, r) {
|
|
2397
2417
|
const i = e.inject || this.options.injectEvent;
|
|
2398
2418
|
return this.parseEventLst(e, r, i);
|
|
@@ -2404,31 +2424,31 @@ function hr(t) {
|
|
|
2404
2424
|
}), r;
|
|
2405
2425
|
},
|
|
2406
2426
|
parseEvent(e, r, i, s) {
|
|
2407
|
-
if (
|
|
2427
|
+
if (f.Function(r) && (i !== !1 && !f.Undef(i) || r.__inject))
|
|
2408
2428
|
return this.inject(e, r, i);
|
|
2409
|
-
if (!s && Array.isArray(r) && r[0] && (
|
|
2429
|
+
if (!s && Array.isArray(r) && r[0] && (f.String(r[0]) || f.Function(r[0])))
|
|
2410
2430
|
return this.parseEventLst(e, r, i, !0);
|
|
2411
|
-
if (
|
|
2412
|
-
const n =
|
|
2431
|
+
if (f.String(r)) {
|
|
2432
|
+
const n = M(r);
|
|
2413
2433
|
if (n && r !== n)
|
|
2414
2434
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2415
2435
|
}
|
|
2416
2436
|
},
|
|
2417
2437
|
parseEmit(e, r) {
|
|
2418
2438
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: u } = s, l = s[r ? "emit" : "nativeEmit"] || [];
|
|
2419
|
-
return
|
|
2439
|
+
return f.trueArray(l) && l.forEach((c) => {
|
|
2420
2440
|
if (!c) return;
|
|
2421
|
-
let
|
|
2422
|
-
if (
|
|
2423
|
-
r || (
|
|
2424
|
-
const
|
|
2425
|
-
this.vm.$emit(
|
|
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);
|
|
2426
2446
|
};
|
|
2427
|
-
if (
|
|
2428
|
-
i[c] =
|
|
2447
|
+
if (g.__emit = !0, !m && u === !1)
|
|
2448
|
+
i[c] = g;
|
|
2429
2449
|
else {
|
|
2430
|
-
let
|
|
2431
|
-
i[c] =
|
|
2450
|
+
let O = m || u || this.options.injectEvent;
|
|
2451
|
+
i[c] = f.Undef(O) ? g : this.inject(s, g, O);
|
|
2432
2452
|
}
|
|
2433
2453
|
}
|
|
2434
2454
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2458,14 +2478,14 @@ function hr(t) {
|
|
|
2458
2478
|
}
|
|
2459
2479
|
});
|
|
2460
2480
|
}
|
|
2461
|
-
const
|
|
2462
|
-
function
|
|
2463
|
-
|
|
2481
|
+
const Be = ["hook:updated", "hook:mounted"];
|
|
2482
|
+
function fr(t) {
|
|
2483
|
+
p(t.prototype, {
|
|
2464
2484
|
usePage() {
|
|
2465
2485
|
const e = this.options.page;
|
|
2466
2486
|
if (!e) return;
|
|
2467
|
-
let r = 25, i =
|
|
2468
|
-
|
|
2487
|
+
let r = 25, i = cr(this.rules);
|
|
2488
|
+
f.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), p(this, {
|
|
2469
2489
|
first: r,
|
|
2470
2490
|
limit: i,
|
|
2471
2491
|
pageEnd: this.rules.length <= r
|
|
@@ -2473,17 +2493,17 @@ function cr(t) {
|
|
|
2473
2493
|
},
|
|
2474
2494
|
pageLoad() {
|
|
2475
2495
|
const e = () => {
|
|
2476
|
-
this.pageEnd ? (this.vm.$off(
|
|
2496
|
+
this.pageEnd ? (this.vm.$off(Be, e), this.bus.$emit("page-end")) : (this.first += this.limit, this.pageEnd = this.rules.length <= this.first, this.loadRule(), this.refresh());
|
|
2477
2497
|
};
|
|
2478
|
-
this.vm.$on(
|
|
2498
|
+
this.vm.$on(Be, e);
|
|
2479
2499
|
}
|
|
2480
2500
|
});
|
|
2481
2501
|
}
|
|
2482
|
-
function
|
|
2502
|
+
function cr(t) {
|
|
2483
2503
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2484
2504
|
}
|
|
2485
|
-
function
|
|
2486
|
-
|
|
2505
|
+
function dr(t) {
|
|
2506
|
+
p(t.prototype, {
|
|
2487
2507
|
clearNextTick() {
|
|
2488
2508
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
2489
2509
|
},
|
|
@@ -2497,14 +2517,14 @@ function pr(t) {
|
|
|
2497
2517
|
}
|
|
2498
2518
|
});
|
|
2499
2519
|
}
|
|
2500
|
-
function
|
|
2520
|
+
function pr(t) {
|
|
2501
2521
|
Object.defineProperties(t.origin, {
|
|
2502
|
-
__fc__:
|
|
2522
|
+
__fc__: rt(t, !0)
|
|
2503
2523
|
});
|
|
2504
2524
|
}
|
|
2505
2525
|
function ht(t, e, r) {
|
|
2506
|
-
const i =
|
|
2507
|
-
|
|
2526
|
+
const i = te();
|
|
2527
|
+
p(this, {
|
|
2508
2528
|
id: i,
|
|
2509
2529
|
ref: i,
|
|
2510
2530
|
wrapRef: i + "fi",
|
|
@@ -2523,11 +2543,11 @@ function ht(t, e, r) {
|
|
|
2523
2543
|
input: !!e.field,
|
|
2524
2544
|
el: void 0,
|
|
2525
2545
|
exportEl: void 0,
|
|
2526
|
-
defaultValue: e.field ?
|
|
2546
|
+
defaultValue: e.field ? B(r) : void 0,
|
|
2527
2547
|
field: e.field || void 0
|
|
2528
|
-
}), this.
|
|
2548
|
+
}), this.updateKey(), pr(this), this.update(t, !0);
|
|
2529
2549
|
}
|
|
2530
|
-
|
|
2550
|
+
p(ht.prototype, {
|
|
2531
2551
|
effectData(t) {
|
|
2532
2552
|
return this.payload[t] || (this.payload[t] = {}), this.payload[t];
|
|
2533
2553
|
},
|
|
@@ -2535,21 +2555,21 @@ m(ht.prototype, {
|
|
|
2535
2555
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2536
2556
|
},
|
|
2537
2557
|
updateKey(t) {
|
|
2538
|
-
this.key =
|
|
2558
|
+
this.key = te(), t && this.parent && this.parent.updateKey(t);
|
|
2539
2559
|
},
|
|
2540
2560
|
updateType() {
|
|
2541
|
-
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);
|
|
2542
2562
|
},
|
|
2543
2563
|
setParser(t) {
|
|
2544
2564
|
this.parser = t, t.init(this);
|
|
2545
2565
|
},
|
|
2546
2566
|
initProp() {
|
|
2547
2567
|
const t = y({}, this.rule);
|
|
2548
|
-
delete t.children, this.prop =
|
|
2568
|
+
delete t.children, this.prop = U({}, [t, ...Object.keys(this.payload).map((e) => this.payload[e]), this.computed]);
|
|
2549
2569
|
},
|
|
2550
2570
|
injectValidate() {
|
|
2551
|
-
return
|
|
2552
|
-
if (
|
|
2571
|
+
return I(this.prop.validate).map((t) => {
|
|
2572
|
+
if (f.Function(t.validator)) {
|
|
2553
2573
|
const e = y({}, t), r = this;
|
|
2554
2574
|
return e.validator = function(...i) {
|
|
2555
2575
|
return t.validator.call({
|
|
@@ -2580,7 +2600,7 @@ m(ht.prototype, {
|
|
|
2580
2600
|
this.$handle.watchCtx(this);
|
|
2581
2601
|
},
|
|
2582
2602
|
delete() {
|
|
2583
|
-
this.unwatch(), this.unlink(), this.rmCtrl(),
|
|
2603
|
+
this.unwatch(), this.unlink(), this.rmCtrl(), p(this, {
|
|
2584
2604
|
deleted: !0,
|
|
2585
2605
|
prop: y({}, this.rule),
|
|
2586
2606
|
computed: {},
|
|
@@ -2608,28 +2628,27 @@ m(ht.prototype, {
|
|
|
2608
2628
|
}
|
|
2609
2629
|
this.$handle.noWatch(() => {
|
|
2610
2630
|
this.$handle.deferSyncValue(() => {
|
|
2611
|
-
this.rmCtrl(), t(), this.$handle.rmCtx(this),
|
|
2631
|
+
this.rmCtrl(), t(), this.$handle.rmCtx(this), p(this, {
|
|
2612
2632
|
root: []
|
|
2613
2633
|
});
|
|
2614
2634
|
}, this.input);
|
|
2615
2635
|
});
|
|
2616
2636
|
},
|
|
2617
2637
|
update(t, e) {
|
|
2618
|
-
|
|
2638
|
+
p(this, {
|
|
2619
2639
|
deleted: !1,
|
|
2620
2640
|
$handle: t,
|
|
2621
2641
|
$render: t.$render,
|
|
2622
2642
|
$api: t.api,
|
|
2623
2643
|
vm: t.vm,
|
|
2624
|
-
trueType: t.getType(this.originType),
|
|
2625
2644
|
vNode: t.$render.vNode,
|
|
2626
2645
|
updated: !1,
|
|
2627
2646
|
cacheValue: this.rule.value
|
|
2628
|
-
}), !e && this.unwatch(), this.watchTo(), this.link();
|
|
2647
|
+
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2629
2648
|
}
|
|
2630
2649
|
});
|
|
2631
|
-
function
|
|
2632
|
-
|
|
2650
|
+
function mr(t) {
|
|
2651
|
+
p(t.prototype, {
|
|
2633
2652
|
nextRefresh(e) {
|
|
2634
2653
|
const r = this.loadedId;
|
|
2635
2654
|
this.vm.$nextTick(() => {
|
|
@@ -2637,12 +2656,12 @@ function yr(t) {
|
|
|
2637
2656
|
});
|
|
2638
2657
|
},
|
|
2639
2658
|
parseRule(e) {
|
|
2640
|
-
const r =
|
|
2659
|
+
const r = Ve(e);
|
|
2641
2660
|
return Object.defineProperties(r, {
|
|
2642
|
-
__origin__:
|
|
2643
|
-
}),
|
|
2661
|
+
__origin__: rt(e, !0)
|
|
2662
|
+
}), yr(r), this.appendValue(r), r.options = Array.isArray(r.options) ? r.options : [], [r, r.prefix, r.suffix].forEach((i) => {
|
|
2644
2663
|
i && this.loadFn(i, r);
|
|
2645
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
2664
|
+
}), this.loadCtrl(r), r.update && (r.update = M(r.update)), r;
|
|
2646
2665
|
},
|
|
2647
2666
|
loadFn(e, r) {
|
|
2648
2667
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -2651,12 +2670,12 @@ function yr(t) {
|
|
|
2651
2670
|
},
|
|
2652
2671
|
loadCtrl(e) {
|
|
2653
2672
|
e.control && e.control.forEach((r) => {
|
|
2654
|
-
r.handle && (r.handle =
|
|
2673
|
+
r.handle && (r.handle = M(r.handle));
|
|
2655
2674
|
});
|
|
2656
2675
|
},
|
|
2657
2676
|
syncProp(e) {
|
|
2658
2677
|
const r = e.rule;
|
|
2659
|
-
|
|
2678
|
+
f.trueArray(r.sync) && D([{
|
|
2660
2679
|
on: r.sync.reduce((i, s) => (i[`update:${s}`] = (n) => {
|
|
2661
2680
|
r.props[s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
2662
2681
|
}, i), {})
|
|
@@ -2682,62 +2701,62 @@ function yr(t) {
|
|
|
2682
2701
|
let a = this.sort.indexOf(o.__fc__.id);
|
|
2683
2702
|
return a > -1 ? a : i(n - 1);
|
|
2684
2703
|
}, s = (n, o) => {
|
|
2685
|
-
|
|
2704
|
+
f.trueArray(n) && this._loadRule(n, o);
|
|
2686
2705
|
};
|
|
2687
2706
|
e.map((n, o) => {
|
|
2688
|
-
if (r && !
|
|
2707
|
+
if (r && !f.Object(n) || !this.pageEnd && !r && o >= this.first) return;
|
|
2689
2708
|
if (n.__fc__ && n.__fc__.root === e && this.ctxs[n.__fc__.id])
|
|
2690
2709
|
return s(n.__fc__.rule.children, n.__fc__), n.__fc__;
|
|
2691
|
-
let a =
|
|
2710
|
+
let a = Ve(n);
|
|
2692
2711
|
const u = () => !!(a.field && this.fieldCtx[a.field] && this.fieldCtx[a.field][0] !== n.__fc__);
|
|
2693
2712
|
this.ruleEffect(a, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", n, this.api);
|
|
2694
|
-
let l, c = !1,
|
|
2695
|
-
if (
|
|
2696
|
-
l = n.__fc__,
|
|
2697
|
-
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);
|
|
2698
2717
|
if (l.deleted) {
|
|
2699
|
-
if (
|
|
2700
|
-
if (
|
|
2718
|
+
if (g) {
|
|
2719
|
+
if (Le(l))
|
|
2701
2720
|
return;
|
|
2702
2721
|
l.update(this);
|
|
2703
2722
|
}
|
|
2704
|
-
} else if (
|
|
2705
|
-
if (
|
|
2723
|
+
} else if (g) {
|
|
2724
|
+
if (Le(l))
|
|
2706
2725
|
return;
|
|
2707
|
-
e[o] = n = n._clone ? n._clone() :
|
|
2726
|
+
e[o] = n = n._clone ? n._clone() : ge(n), l = null, c = !0;
|
|
2708
2727
|
}
|
|
2709
2728
|
}
|
|
2710
2729
|
if (l)
|
|
2711
2730
|
l.originType !== l.rule.type && l.updateType(), this.bindParser(l), this.appendValue(l.rule);
|
|
2712
2731
|
else {
|
|
2713
|
-
const
|
|
2714
|
-
l = new ht(this,
|
|
2732
|
+
const g = this.parseRule(n);
|
|
2733
|
+
l = new ht(this, g, v), this.bindParser(l);
|
|
2715
2734
|
}
|
|
2716
|
-
if ([!1, !0].forEach((
|
|
2717
|
-
const
|
|
2718
|
-
|
|
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);
|
|
2719
2738
|
}
|
|
2720
|
-
const
|
|
2721
|
-
return l.updated || (l.updated = !0,
|
|
2722
|
-
this.refreshUpdate(l,
|
|
2723
|
-
}), 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;
|
|
2724
2743
|
});
|
|
2725
2744
|
},
|
|
2726
2745
|
refreshControl(e) {
|
|
2727
2746
|
return e.input && e.rule.control && this.useCtrl(e);
|
|
2728
2747
|
},
|
|
2729
2748
|
useCtrl(e) {
|
|
2730
|
-
const r =
|
|
2749
|
+
const r = gr(e), i = [], s = this.api;
|
|
2731
2750
|
if (!r.length) return !1;
|
|
2732
2751
|
for (let a = 0; a < r.length; a++) {
|
|
2733
|
-
const u = r[a], l = u.handle || function(
|
|
2734
|
-
return (
|
|
2752
|
+
const u = r[a], l = u.handle || function(m) {
|
|
2753
|
+
return (z[u.condition || "=="] || z["=="])(m, u.value);
|
|
2735
2754
|
};
|
|
2736
|
-
if (!
|
|
2737
|
-
const c =
|
|
2755
|
+
if (!f.trueArray(u.rule)) continue;
|
|
2756
|
+
const c = q(y({}, u), {
|
|
2738
2757
|
valid: E(() => l(e.rule.value, s)),
|
|
2739
|
-
ctrl:
|
|
2740
|
-
isHidden:
|
|
2758
|
+
ctrl: $r(e, u.rule),
|
|
2759
|
+
isHidden: f.String(u.rule[0])
|
|
2741
2760
|
});
|
|
2742
2761
|
c.valid && c.ctrl || !c.valid && !c.ctrl && !c.isHidden || i.push(c);
|
|
2743
2762
|
}
|
|
@@ -2745,34 +2764,34 @@ function yr(t) {
|
|
|
2745
2764
|
const n = [];
|
|
2746
2765
|
let o = !1;
|
|
2747
2766
|
return this.deferSyncValue(() => {
|
|
2748
|
-
i.reverse().forEach(({ isHidden: a, valid: u, rule: l, prepend: c, append:
|
|
2767
|
+
i.reverse().forEach(({ isHidden: a, valid: u, rule: l, prepend: c, append: m, child: v, ctrl: _, method: g }) => {
|
|
2749
2768
|
if (a) {
|
|
2750
2769
|
u ? e.ctrlRule.push({
|
|
2751
2770
|
__ctrl: !0,
|
|
2752
2771
|
children: l,
|
|
2753
2772
|
valid: u
|
|
2754
|
-
}) :
|
|
2755
|
-
|
|
2756
|
-
this.api.setEffect(
|
|
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) => {
|
|
2775
|
+
this.api.setEffect(O, "required", u);
|
|
2757
2776
|
}), u || this.api.clearValidateState(l)) : this.api.hidden(!u, l);
|
|
2758
2777
|
});
|
|
2759
2778
|
return;
|
|
2760
2779
|
}
|
|
2761
2780
|
if (u) {
|
|
2762
2781
|
o = !0;
|
|
2763
|
-
const
|
|
2782
|
+
const O = {
|
|
2764
2783
|
type: "fcFragment",
|
|
2765
2784
|
native: !0,
|
|
2766
2785
|
__ctrl: !0,
|
|
2767
2786
|
children: l
|
|
2768
2787
|
};
|
|
2769
|
-
e.ctrlRule.push(
|
|
2770
|
-
c ? s.prepend(
|
|
2788
|
+
e.ctrlRule.push(O), this.bus.$once("load-start", () => {
|
|
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);
|
|
2771
2790
|
});
|
|
2772
2791
|
} else {
|
|
2773
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
2774
|
-
const
|
|
2775
|
-
|
|
2792
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(_), 1);
|
|
2793
|
+
const O = X(_);
|
|
2794
|
+
O && O.rm();
|
|
2776
2795
|
}
|
|
2777
2796
|
});
|
|
2778
2797
|
}), n.length && this.vm.$nextTick(() => {
|
|
@@ -2797,30 +2816,30 @@ function yr(t) {
|
|
|
2797
2816
|
}
|
|
2798
2817
|
});
|
|
2799
2818
|
}
|
|
2800
|
-
function
|
|
2801
|
-
const e =
|
|
2819
|
+
function yr(t) {
|
|
2820
|
+
const e = st();
|
|
2802
2821
|
return Object.keys(e).forEach((r) => {
|
|
2803
|
-
|
|
2822
|
+
k(t, r) || w(t, r, e[r]);
|
|
2804
2823
|
}), t;
|
|
2805
2824
|
}
|
|
2806
|
-
function
|
|
2825
|
+
function gr(t) {
|
|
2807
2826
|
const e = t.rule.control || [];
|
|
2808
|
-
return
|
|
2827
|
+
return f.Object(e) ? [e] : e;
|
|
2809
2828
|
}
|
|
2810
|
-
function
|
|
2829
|
+
function $r(t, e) {
|
|
2811
2830
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
2812
2831
|
const i = t.ctrlRule[r];
|
|
2813
2832
|
if (i.children === e)
|
|
2814
2833
|
return i;
|
|
2815
2834
|
}
|
|
2816
2835
|
}
|
|
2817
|
-
function
|
|
2836
|
+
function Le(t) {
|
|
2818
2837
|
return !!t.rule.__ctrl;
|
|
2819
2838
|
}
|
|
2820
|
-
function
|
|
2821
|
-
|
|
2839
|
+
function vr(t) {
|
|
2840
|
+
p(t.prototype, {
|
|
2822
2841
|
getValue(e) {
|
|
2823
|
-
return
|
|
2842
|
+
return f.Undef(e.cacheValue) && (e.cacheValue = e.parser.toValue(this.getFormData(e), e)), e.cacheValue;
|
|
2824
2843
|
},
|
|
2825
2844
|
setValue(e, r, i, s) {
|
|
2826
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, {
|
|
@@ -2834,20 +2853,20 @@ function br(t) {
|
|
|
2834
2853
|
e.input && (this.isQuote(e, i = e.parser.toValue(r, e)) || this.isChange(e, i)) && this.setValue(e, i, r);
|
|
2835
2854
|
},
|
|
2836
2855
|
setFormData(e, r) {
|
|
2837
|
-
|
|
2856
|
+
w(this.formData, e.id, r === null ? void 0 : r);
|
|
2838
2857
|
},
|
|
2839
2858
|
getFormData(e) {
|
|
2840
2859
|
return this.formData[e.id];
|
|
2841
2860
|
},
|
|
2842
2861
|
validate() {
|
|
2843
|
-
return
|
|
2862
|
+
return Me(this.vm.validate), this.fields().forEach((e) => {
|
|
2844
2863
|
this.fieldCtx[e].forEach((r) => {
|
|
2845
|
-
this.vm.validate[r.id] =
|
|
2864
|
+
this.vm.validate[r.id] = I(r.rule.validate);
|
|
2846
2865
|
});
|
|
2847
2866
|
}), this.vm.validate;
|
|
2848
2867
|
},
|
|
2849
2868
|
syncForm() {
|
|
2850
|
-
|
|
2869
|
+
Me(this.form), Object.defineProperties(this.form, this.fields().reduce((e, r) => {
|
|
2851
2870
|
const i = this.getFieldCtx(r), s = this.valueHandle(i);
|
|
2852
2871
|
return s.configurable = !0, e[r] = s, e;
|
|
2853
2872
|
}, this.options.appendValue !== !1 ? Object.keys(this.appendData).reduce((e, r) => (e[r] = {
|
|
@@ -2869,7 +2888,7 @@ function br(t) {
|
|
|
2869
2888
|
};
|
|
2870
2889
|
},
|
|
2871
2890
|
appendValue(e) {
|
|
2872
|
-
!e.field || !
|
|
2891
|
+
!e.field || !k(this.appendData, e.field) || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
2873
2892
|
},
|
|
2874
2893
|
addSubForm(e, r) {
|
|
2875
2894
|
this.subForm[e.id] = r;
|
|
@@ -2883,13 +2902,13 @@ function br(t) {
|
|
|
2883
2902
|
this.vm._updateValue(y(y({}, this.options.appendValue !== !1 ? this.appendData : {}), this.form));
|
|
2884
2903
|
},
|
|
2885
2904
|
isChange(e, r) {
|
|
2886
|
-
return JSON.stringify(e.rule.value,
|
|
2905
|
+
return JSON.stringify(e.rule.value, Ne) !== JSON.stringify(r === null ? void 0 : r, Ne);
|
|
2887
2906
|
},
|
|
2888
2907
|
isQuote(e, r) {
|
|
2889
|
-
return (
|
|
2908
|
+
return (f.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
2890
2909
|
},
|
|
2891
2910
|
refreshUpdate(e, r, i, s) {
|
|
2892
|
-
if (
|
|
2911
|
+
if (f.Function(e.rule.update)) {
|
|
2893
2912
|
const n = E(() => e.rule.update(r, e.origin, this.api, {
|
|
2894
2913
|
origin: i || "change",
|
|
2895
2914
|
linkField: s
|
|
@@ -2906,7 +2925,7 @@ function br(t) {
|
|
|
2906
2925
|
},
|
|
2907
2926
|
appendLink(e) {
|
|
2908
2927
|
const r = e.rule.link;
|
|
2909
|
-
|
|
2928
|
+
f.trueArray(r) && r.forEach((i) => {
|
|
2910
2929
|
const s = () => this.refreshRule(e, e.rule.value, "link", i);
|
|
2911
2930
|
this.bus.$on("change-" + i, s), e.linkOn.push(() => this.bus.$off("change-" + i, s));
|
|
2912
2931
|
});
|
|
@@ -2916,13 +2935,13 @@ function br(t) {
|
|
|
2916
2935
|
}
|
|
2917
2936
|
});
|
|
2918
2937
|
}
|
|
2919
|
-
function
|
|
2938
|
+
function Ne(t, e) {
|
|
2920
2939
|
return typeof e == "function" ? "" + e : e;
|
|
2921
2940
|
}
|
|
2922
|
-
function
|
|
2941
|
+
function Me(t) {
|
|
2923
2942
|
Object.keys(t).forEach((e) => delete t[e]);
|
|
2924
2943
|
}
|
|
2925
|
-
const
|
|
2944
|
+
const fe = {
|
|
2926
2945
|
init(t) {
|
|
2927
2946
|
},
|
|
2928
2947
|
toFormValue(t, e) {
|
|
@@ -2941,9 +2960,9 @@ const ce = {
|
|
|
2941
2960
|
},
|
|
2942
2961
|
mergeProp(t) {
|
|
2943
2962
|
}
|
|
2944
|
-
},
|
|
2945
|
-
function
|
|
2946
|
-
|
|
2963
|
+
}, br = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "component", "cache"];
|
|
2964
|
+
function Cr(t) {
|
|
2965
|
+
p(t.prototype, {
|
|
2947
2966
|
getCtx(e) {
|
|
2948
2967
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
2949
2968
|
},
|
|
@@ -2972,21 +2991,21 @@ function _r(t) {
|
|
|
2972
2991
|
},
|
|
2973
2992
|
getParser(e) {
|
|
2974
2993
|
const r = this.fc.parsers;
|
|
2975
|
-
return r[e.originType] || r[
|
|
2994
|
+
return r[e.originType] || r[R(e.type)] || r[e.trueType] || fe;
|
|
2976
2995
|
},
|
|
2977
2996
|
bindParser(e) {
|
|
2978
2997
|
e.setParser(this.getParser(e));
|
|
2979
2998
|
},
|
|
2980
2999
|
getType(e) {
|
|
2981
|
-
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[
|
|
2982
|
-
return
|
|
3000
|
+
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[R(e)] || e;
|
|
3001
|
+
return R(i);
|
|
2983
3002
|
},
|
|
2984
3003
|
noWatch(e) {
|
|
2985
3004
|
this.noWatchFn || (this.noWatchFn = e), E(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
2986
3005
|
},
|
|
2987
3006
|
watchCtx(e) {
|
|
2988
3007
|
const r = this.vm;
|
|
2989
|
-
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" &&
|
|
3008
|
+
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" && br.indexOf(i) === -1).forEach((i) => {
|
|
2990
3009
|
const s = i === "children";
|
|
2991
3010
|
e.watch.push(r.$watch(() => e.rule[i], (n, o) => {
|
|
2992
3011
|
if (!(this.loading || this.noWatchFn || this.reloading)) {
|
|
@@ -3006,7 +3025,7 @@ function _r(t) {
|
|
|
3006
3025
|
else if (i === "type")
|
|
3007
3026
|
e.updateType(), this.bindParser(e);
|
|
3008
3027
|
else if (i === "children") {
|
|
3009
|
-
const a =
|
|
3028
|
+
const a = f.trueArray(n);
|
|
3010
3029
|
this.deferSyncValue(() => {
|
|
3011
3030
|
n !== o && (this.rmSub(o, e), this.$render.initOrgChildren()), a && this.loadChildren(n, e), this.vm.$emit("update", this.api);
|
|
3012
3031
|
});
|
|
@@ -3017,7 +3036,7 @@ function _r(t) {
|
|
|
3017
3036
|
}), this.watchEffect(e);
|
|
3018
3037
|
},
|
|
3019
3038
|
rmSub(e, r) {
|
|
3020
|
-
|
|
3039
|
+
f.trueArray(e) && e.forEach((i) => {
|
|
3021
3040
|
i && i.__fc__ && i.__fc__.parent === r && this.rmCtx(i.__fc__);
|
|
3022
3041
|
});
|
|
3023
3042
|
},
|
|
@@ -3027,16 +3046,16 @@ function _r(t) {
|
|
|
3027
3046
|
e.input && Object.defineProperty(e.rule, "value", {
|
|
3028
3047
|
value: e.rule.value,
|
|
3029
3048
|
writable: !0
|
|
3030
|
-
}),
|
|
3031
|
-
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());
|
|
3032
3051
|
}, s);
|
|
3033
3052
|
const o = this.sort.indexOf(r);
|
|
3034
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;
|
|
3035
3054
|
}
|
|
3036
3055
|
});
|
|
3037
3056
|
}
|
|
3038
|
-
function
|
|
3039
|
-
|
|
3057
|
+
function _r(t) {
|
|
3058
|
+
p(t.prototype, {
|
|
3040
3059
|
mounted() {
|
|
3041
3060
|
const e = () => {
|
|
3042
3061
|
this.isMounted = !0, this.lifecycle("mounted");
|
|
@@ -3047,22 +3066,22 @@ function Or(t) {
|
|
|
3047
3066
|
this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3048
3067
|
},
|
|
3049
3068
|
emitEvent(e, ...r) {
|
|
3050
|
-
const i = this.options[e] || this.options[
|
|
3069
|
+
const i = this.options[e] || this.options[R("on-" + e)];
|
|
3051
3070
|
if (i) {
|
|
3052
|
-
const s =
|
|
3053
|
-
|
|
3071
|
+
const s = M(i);
|
|
3072
|
+
f.Function(s) && E(() => s(...r));
|
|
3054
3073
|
}
|
|
3055
3074
|
this.bus.$emit(e, ...r);
|
|
3056
3075
|
}
|
|
3057
3076
|
});
|
|
3058
3077
|
}
|
|
3059
|
-
function
|
|
3060
|
-
|
|
3078
|
+
function Or(t) {
|
|
3079
|
+
p(t.prototype, {
|
|
3061
3080
|
useProvider() {
|
|
3062
3081
|
const e = this.fc.providers;
|
|
3063
3082
|
Object.keys(e).forEach((r) => {
|
|
3064
3083
|
let i = e[r];
|
|
3065
|
-
|
|
3084
|
+
f.Function(i) && (i = i(this.fc)), i._c = wr(i), this.onEffect(i), this.providers[r] = i;
|
|
3066
3085
|
});
|
|
3067
3086
|
},
|
|
3068
3087
|
onEffect(e) {
|
|
@@ -3079,7 +3098,7 @@ function kr(t) {
|
|
|
3079
3098
|
let i = {
|
|
3080
3099
|
required: () => {
|
|
3081
3100
|
var s, n;
|
|
3082
|
-
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;
|
|
3083
3102
|
}
|
|
3084
3103
|
};
|
|
3085
3104
|
Object.keys(e.rule.effect || {}).forEach((s) => {
|
|
@@ -3109,9 +3128,9 @@ function kr(t) {
|
|
|
3109
3128
|
}, r);
|
|
3110
3129
|
},
|
|
3111
3130
|
getEffect(e, r) {
|
|
3112
|
-
if (
|
|
3131
|
+
if (k(e, "$" + r))
|
|
3113
3132
|
return e["$" + r];
|
|
3114
|
-
if (
|
|
3133
|
+
if (k(e, "effect") && k(e.effect, r))
|
|
3115
3134
|
return e.effect[r];
|
|
3116
3135
|
},
|
|
3117
3136
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
@@ -3120,33 +3139,33 @@ function kr(t) {
|
|
|
3120
3139
|
Object.keys(u).forEach((l) => {
|
|
3121
3140
|
const c = this.providers[l];
|
|
3122
3141
|
if (!c || c.input && !i) return;
|
|
3123
|
-
let
|
|
3142
|
+
let m;
|
|
3124
3143
|
if (!c._c)
|
|
3125
|
-
|
|
3144
|
+
m = "*";
|
|
3126
3145
|
else if (c._used.indexOf(s) > -1)
|
|
3127
|
-
|
|
3146
|
+
m = s;
|
|
3128
3147
|
else
|
|
3129
3148
|
return;
|
|
3130
|
-
const
|
|
3131
|
-
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]);
|
|
3132
3151
|
});
|
|
3133
3152
|
}
|
|
3134
3153
|
});
|
|
3135
3154
|
}
|
|
3136
|
-
function
|
|
3155
|
+
function kr(t) {
|
|
3137
3156
|
return t.filter(function(e, r, i) {
|
|
3138
3157
|
return i.indexOf(e, 0) === r;
|
|
3139
3158
|
});
|
|
3140
3159
|
}
|
|
3141
|
-
function
|
|
3160
|
+
function wr(t) {
|
|
3142
3161
|
const e = t.components;
|
|
3143
3162
|
if (Array.isArray(e)) {
|
|
3144
|
-
const r =
|
|
3163
|
+
const r = kr(e.filter((i) => i !== "*"));
|
|
3145
3164
|
return r.length ? r : !1;
|
|
3146
|
-
} else return
|
|
3165
|
+
} else return f.String(e) ? [e] : !1;
|
|
3147
3166
|
}
|
|
3148
|
-
function
|
|
3149
|
-
|
|
3167
|
+
function A(t) {
|
|
3168
|
+
p(this, {
|
|
3150
3169
|
fc: t,
|
|
3151
3170
|
vm: t.vm,
|
|
3152
3171
|
watching: !1,
|
|
@@ -3168,18 +3187,18 @@ function V(t) {
|
|
|
3168
3187
|
nextReload: () => {
|
|
3169
3188
|
this.lifecycle("reload");
|
|
3170
3189
|
}
|
|
3171
|
-
}),
|
|
3190
|
+
}), nt(this, {
|
|
3172
3191
|
options() {
|
|
3173
3192
|
return t.options;
|
|
3174
3193
|
},
|
|
3175
3194
|
bus() {
|
|
3176
3195
|
return t.bus;
|
|
3177
3196
|
}
|
|
3178
|
-
}), 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);
|
|
3179
3198
|
}
|
|
3180
|
-
|
|
3199
|
+
p(A.prototype, {
|
|
3181
3200
|
initData(t) {
|
|
3182
|
-
|
|
3201
|
+
p(this, {
|
|
3183
3202
|
ctxs: {},
|
|
3184
3203
|
fieldCtx: {},
|
|
3185
3204
|
nameCtx: {},
|
|
@@ -3193,54 +3212,54 @@ m(V.prototype, {
|
|
|
3193
3212
|
beforeFetch(t) {
|
|
3194
3213
|
return new Promise((e) => {
|
|
3195
3214
|
const r = this.options.beforeFetch && E(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3196
|
-
r &&
|
|
3215
|
+
r && f.Function(r.then) ? r.then(e) : e();
|
|
3197
3216
|
});
|
|
3198
3217
|
}
|
|
3199
3218
|
});
|
|
3200
|
-
hr(
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
const
|
|
3209
|
-
name:
|
|
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 = {
|
|
3228
|
+
name: Fr,
|
|
3210
3229
|
functional: !0,
|
|
3211
3230
|
props: ["vnode"],
|
|
3212
3231
|
render(t, e) {
|
|
3213
3232
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3214
3233
|
}
|
|
3215
3234
|
};
|
|
3216
|
-
function
|
|
3217
|
-
return
|
|
3235
|
+
function Sr(t) {
|
|
3236
|
+
return f.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3218
3237
|
}
|
|
3219
3238
|
function Er() {
|
|
3220
3239
|
const t = {};
|
|
3221
3240
|
function e(r) {
|
|
3222
3241
|
r && this.setVm(r);
|
|
3223
3242
|
}
|
|
3224
|
-
return
|
|
3243
|
+
return p(e.prototype, {
|
|
3225
3244
|
setVm(r) {
|
|
3226
3245
|
this.vm = r, this.$h = r.$createElement;
|
|
3227
3246
|
},
|
|
3228
3247
|
make(r, i, s) {
|
|
3229
|
-
return
|
|
3248
|
+
return P.config.isReservedTag(r) && i.nativeOn && delete i.nativeOn, this.makeComponent(r, i, s);
|
|
3230
3249
|
},
|
|
3231
3250
|
makeComponent(r, i, s) {
|
|
3232
|
-
let n = this.$h(r,
|
|
3251
|
+
let n = this.$h(r, Sr(i), s || []);
|
|
3233
3252
|
return n.context = this.vm, n;
|
|
3234
3253
|
},
|
|
3235
3254
|
aliasMap: t
|
|
3236
|
-
}),
|
|
3255
|
+
}), p(e, {
|
|
3237
3256
|
aliasMap: t,
|
|
3238
3257
|
alias(r, i) {
|
|
3239
3258
|
t[r] = i;
|
|
3240
3259
|
},
|
|
3241
3260
|
use(r) {
|
|
3242
3261
|
Object.keys(r).forEach((i) => {
|
|
3243
|
-
const s =
|
|
3262
|
+
const s = Q(i), n = ar(i).toLocaleLowerCase(), o = r[i];
|
|
3244
3263
|
[i, s, n].forEach((a) => {
|
|
3245
3264
|
e.alias(i, o), e.prototype[a] = function(u, l) {
|
|
3246
3265
|
return this.make(o, u, l);
|
|
@@ -3250,13 +3269,13 @@ function Er() {
|
|
|
3250
3269
|
}
|
|
3251
3270
|
}), e;
|
|
3252
3271
|
}
|
|
3253
|
-
function
|
|
3254
|
-
class e extends
|
|
3272
|
+
function Rr(t) {
|
|
3273
|
+
class e extends ft {
|
|
3255
3274
|
}
|
|
3256
3275
|
return Object.assign(e.prototype, t), e;
|
|
3257
3276
|
}
|
|
3258
|
-
function
|
|
3259
|
-
|
|
3277
|
+
function ft(t) {
|
|
3278
|
+
p(this, {
|
|
3260
3279
|
$handle: t,
|
|
3261
3280
|
vm: t.vm,
|
|
3262
3281
|
options: {},
|
|
@@ -3266,12 +3285,12 @@ function ct(t) {
|
|
|
3266
3285
|
}
|
|
3267
3286
|
}), this.updateKey(), this.init();
|
|
3268
3287
|
}
|
|
3269
|
-
|
|
3288
|
+
p(ft.prototype, {
|
|
3270
3289
|
__init() {
|
|
3271
3290
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3272
3291
|
},
|
|
3273
3292
|
updateKey() {
|
|
3274
|
-
this.key =
|
|
3293
|
+
this.key = te();
|
|
3275
3294
|
},
|
|
3276
3295
|
//TODO interface
|
|
3277
3296
|
init() {
|
|
@@ -3293,7 +3312,7 @@ m(ct.prototype, {
|
|
|
3293
3312
|
return e(this.vm);
|
|
3294
3313
|
},
|
|
3295
3314
|
mergeOptions(t, e) {
|
|
3296
|
-
return
|
|
3315
|
+
return D(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3297
3316
|
},
|
|
3298
3317
|
updateOptions(t) {
|
|
3299
3318
|
this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3311,20 +3330,20 @@ m(ct.prototype, {
|
|
|
3311
3330
|
render(t) {
|
|
3312
3331
|
}
|
|
3313
3332
|
});
|
|
3314
|
-
const
|
|
3333
|
+
const Ir = function(t) {
|
|
3315
3334
|
const e = {
|
|
3316
3335
|
name: "loadData",
|
|
3317
3336
|
_fn: [],
|
|
3318
3337
|
created(r, i, s) {
|
|
3319
3338
|
this.deleted(r);
|
|
3320
|
-
let n =
|
|
3339
|
+
let n = I(r.getValue());
|
|
3321
3340
|
const o = [];
|
|
3322
3341
|
n.forEach((a) => {
|
|
3323
3342
|
if (a) {
|
|
3324
3343
|
const u = () => {
|
|
3325
3344
|
a.watch !== !1 && (t.bus.$off("p.loadData." + a.attr, u), t.bus.$once("p.loadData." + a.attr, u));
|
|
3326
3345
|
let l;
|
|
3327
|
-
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);
|
|
3328
3347
|
};
|
|
3329
3348
|
o.push(() => t.bus.$off("p.loadData." + a.attr, u)), u();
|
|
3330
3349
|
}
|
|
@@ -3337,13 +3356,13 @@ const jr = function(t) {
|
|
|
3337
3356
|
}
|
|
3338
3357
|
};
|
|
3339
3358
|
return e.watch = e.created, e;
|
|
3340
|
-
},
|
|
3359
|
+
}, ct = {
|
|
3341
3360
|
name: "componentValidate",
|
|
3342
3361
|
load(t, e, r) {
|
|
3343
3362
|
const i = t.getValue();
|
|
3344
3363
|
i ? t.getProp().validate = [{
|
|
3345
3364
|
validator(...s) {
|
|
3346
|
-
const n =
|
|
3365
|
+
const n = X(e);
|
|
3347
3366
|
if (n)
|
|
3348
3367
|
return r.exec(n.id, i === !0 ? "formCreateValidate" : i, ...s, {
|
|
3349
3368
|
attr: t,
|
|
@@ -3354,48 +3373,48 @@ const jr = function(t) {
|
|
|
3354
3373
|
}] : (t.clearProp(), r.clearValidateState([e.field]));
|
|
3355
3374
|
},
|
|
3356
3375
|
watch(...t) {
|
|
3357
|
-
|
|
3376
|
+
ct.load(...t);
|
|
3358
3377
|
}
|
|
3359
|
-
},
|
|
3378
|
+
}, jr = function(t) {
|
|
3360
3379
|
function e(i) {
|
|
3361
|
-
return
|
|
3380
|
+
return f.String(i) && (i = {
|
|
3362
3381
|
action: i,
|
|
3363
3382
|
to: "options"
|
|
3364
3383
|
}), i;
|
|
3365
3384
|
}
|
|
3366
3385
|
function r(i, s, n) {
|
|
3367
3386
|
let o = i.value;
|
|
3368
|
-
const a = (
|
|
3369
|
-
|
|
3387
|
+
const a = (m) => {
|
|
3388
|
+
m === void 0 ? (i.clearProp(), n.sync(s)) : Z(i.getProp(), o.to || "options", m);
|
|
3370
3389
|
};
|
|
3371
|
-
if (
|
|
3390
|
+
if (f.Function(o) && (o = o(s, n)), o = e(o), !o || !o.action) {
|
|
3372
3391
|
a(void 0);
|
|
3373
3392
|
return;
|
|
3374
3393
|
}
|
|
3375
|
-
o =
|
|
3394
|
+
o = B(o), o.to || (o.to = "options");
|
|
3376
3395
|
const u = o.onError, l = () => {
|
|
3377
3396
|
if (!i.getValue())
|
|
3378
3397
|
return i.clearProp(), n.sync(s), !0;
|
|
3379
|
-
}, c =
|
|
3398
|
+
}, c = q(y({
|
|
3380
3399
|
headers: {}
|
|
3381
3400
|
}, o), {
|
|
3382
|
-
onSuccess(
|
|
3401
|
+
onSuccess(m, v) {
|
|
3383
3402
|
if (l()) return;
|
|
3384
|
-
let
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
}),
|
|
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);
|
|
3388
3407
|
},
|
|
3389
|
-
onError(
|
|
3390
|
-
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);
|
|
3391
3410
|
}
|
|
3392
3411
|
});
|
|
3393
3412
|
t.$handle.beforeFetch(c, { rule: s, api: n }).then(() => {
|
|
3394
|
-
if (
|
|
3395
|
-
o.action(s, n).then((
|
|
3396
|
-
c.onSuccess(
|
|
3397
|
-
}).catch((
|
|
3398
|
-
c.onError(
|
|
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);
|
|
3399
3418
|
});
|
|
3400
3419
|
return;
|
|
3401
3420
|
}
|
|
@@ -3411,17 +3430,17 @@ const jr = function(t) {
|
|
|
3411
3430
|
r(...i);
|
|
3412
3431
|
}
|
|
3413
3432
|
};
|
|
3414
|
-
},
|
|
3433
|
+
}, dt = {
|
|
3415
3434
|
name: "required",
|
|
3416
3435
|
load(t, e, r) {
|
|
3417
|
-
const i =
|
|
3436
|
+
const i = Ar(t.getValue());
|
|
3418
3437
|
if (i.required === !1)
|
|
3419
3438
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
3420
3439
|
else {
|
|
3421
3440
|
const s = y({
|
|
3422
3441
|
required: !0,
|
|
3423
3442
|
validator(n, o, a) {
|
|
3424
|
-
|
|
3443
|
+
f.empty(o) ? a(s.message) : a();
|
|
3425
3444
|
}
|
|
3426
3445
|
}, i);
|
|
3427
3446
|
if (!s.message) {
|
|
@@ -3433,39 +3452,39 @@ const jr = function(t) {
|
|
|
3433
3452
|
r.sync(e);
|
|
3434
3453
|
},
|
|
3435
3454
|
watch(...t) {
|
|
3436
|
-
|
|
3455
|
+
dt.load(...t);
|
|
3437
3456
|
}
|
|
3438
3457
|
};
|
|
3439
|
-
function
|
|
3440
|
-
return
|
|
3458
|
+
function Ar(t) {
|
|
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 : {};
|
|
3441
3460
|
}
|
|
3442
|
-
const
|
|
3443
|
-
fetch:
|
|
3444
|
-
loadData:
|
|
3445
|
-
required:
|
|
3446
|
-
componentValidate:
|
|
3447
|
-
},
|
|
3448
|
-
name:
|
|
3461
|
+
const Vr = {
|
|
3462
|
+
fetch: jr,
|
|
3463
|
+
loadData: Ir,
|
|
3464
|
+
required: dt,
|
|
3465
|
+
componentValidate: ct
|
|
3466
|
+
}, Pr = "html", Dr = {
|
|
3467
|
+
name: Pr,
|
|
3449
3468
|
loadChildren: !1,
|
|
3450
3469
|
render(t, e) {
|
|
3451
3470
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
3452
3471
|
},
|
|
3453
3472
|
renderChildren(t) {
|
|
3454
|
-
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("") : "";
|
|
3455
3474
|
}
|
|
3456
3475
|
};
|
|
3457
|
-
function
|
|
3476
|
+
function Tr(t, e) {
|
|
3458
3477
|
let r;
|
|
3459
3478
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
3460
3479
|
}
|
|
3461
|
-
function
|
|
3462
|
-
return
|
|
3480
|
+
function ie() {
|
|
3481
|
+
return Tr("name", ...arguments);
|
|
3463
3482
|
}
|
|
3464
|
-
function
|
|
3465
|
-
return !t || !t.el ? window.document.body :
|
|
3483
|
+
function Ue(t) {
|
|
3484
|
+
return !t || !t.el ? window.document.body : f.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
3466
3485
|
}
|
|
3467
|
-
function
|
|
3468
|
-
const r = new
|
|
3486
|
+
function qe(t, e) {
|
|
3487
|
+
const r = new P({
|
|
3469
3488
|
data() {
|
|
3470
3489
|
return { rule: t, option: e || {} };
|
|
3471
3490
|
},
|
|
@@ -3475,141 +3494,141 @@ function He(t, e) {
|
|
|
3475
3494
|
});
|
|
3476
3495
|
return r.$mount(), r;
|
|
3477
3496
|
}
|
|
3478
|
-
function
|
|
3497
|
+
function Br(t) {
|
|
3479
3498
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
3480
|
-
|
|
3499
|
+
et.push(...e), de.push(...r), pe.push(...i), ot([...e, ...r, ...i]);
|
|
3481
3500
|
}
|
|
3482
|
-
let
|
|
3483
|
-
const
|
|
3484
|
-
function
|
|
3501
|
+
let Lr = 1;
|
|
3502
|
+
const S = {};
|
|
3503
|
+
function pt(t) {
|
|
3485
3504
|
const e = {
|
|
3486
|
-
[
|
|
3487
|
-
}, r = {}, i = {}, s = y({},
|
|
3505
|
+
[re.name]: re
|
|
3506
|
+
}, r = {}, i = {}, s = y({}, Vr), n = rr();
|
|
3488
3507
|
let o = { global: {} };
|
|
3489
3508
|
const a = {}, u = Er(), l = {};
|
|
3490
|
-
|
|
3491
|
-
function c(
|
|
3492
|
-
const d =
|
|
3509
|
+
Br(t.attrs || {});
|
|
3510
|
+
function c(h) {
|
|
3511
|
+
const d = S[h];
|
|
3493
3512
|
if (Array.isArray(d))
|
|
3494
|
-
return d.map((
|
|
3513
|
+
return d.map(($) => $.api());
|
|
3495
3514
|
if (d)
|
|
3496
3515
|
return d.api();
|
|
3497
3516
|
}
|
|
3498
|
-
function
|
|
3499
|
-
const
|
|
3500
|
-
|
|
3517
|
+
function m() {
|
|
3518
|
+
const h = ie(...arguments);
|
|
3519
|
+
h.id && h.prop && (i[h.id] = h.prop);
|
|
3501
3520
|
}
|
|
3502
|
-
function
|
|
3503
|
-
const
|
|
3504
|
-
|
|
3521
|
+
function v() {
|
|
3522
|
+
const h = ie(...arguments);
|
|
3523
|
+
h.id && h.prop && (s[h.id] = q(y({}, h.prop), { name: h.id }));
|
|
3505
3524
|
}
|
|
3506
|
-
function
|
|
3507
|
-
u.use(
|
|
3525
|
+
function _(h) {
|
|
3526
|
+
u.use(h);
|
|
3508
3527
|
}
|
|
3509
|
-
function
|
|
3510
|
-
const
|
|
3511
|
-
if (!
|
|
3512
|
-
const d =
|
|
3513
|
-
r[d] =
|
|
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);
|
|
3514
3533
|
}
|
|
3515
|
-
function
|
|
3516
|
-
let
|
|
3517
|
-
if (
|
|
3518
|
-
if (
|
|
3519
|
-
return
|
|
3534
|
+
function O(h, d) {
|
|
3535
|
+
let $;
|
|
3536
|
+
if (f.String(h)) {
|
|
3537
|
+
if ($ = R(h), ["form-create", "formcreate"].indexOf($) > -1)
|
|
3538
|
+
return x();
|
|
3520
3539
|
if (d === void 0)
|
|
3521
|
-
return e[
|
|
3540
|
+
return e[$];
|
|
3522
3541
|
} else
|
|
3523
|
-
|
|
3524
|
-
if (
|
|
3525
|
-
const
|
|
3526
|
-
e[
|
|
3542
|
+
$ = R(h.name), d = h;
|
|
3543
|
+
if (!$ || !d) return;
|
|
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);
|
|
3527
3546
|
}
|
|
3528
|
-
function
|
|
3529
|
-
Object.keys(
|
|
3530
|
-
(Array.isArray(
|
|
3531
|
-
|
|
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);
|
|
3532
3551
|
});
|
|
3533
3552
|
});
|
|
3534
3553
|
}
|
|
3535
|
-
function
|
|
3536
|
-
a[
|
|
3554
|
+
function Ce(h, d) {
|
|
3555
|
+
a[h] = d, be(h);
|
|
3537
3556
|
}
|
|
3538
|
-
function
|
|
3539
|
-
return
|
|
3557
|
+
function _e(h, d) {
|
|
3558
|
+
return k(a, h) ? a[h] : d;
|
|
3540
3559
|
}
|
|
3541
|
-
function
|
|
3542
|
-
delete a[
|
|
3560
|
+
function mt(h) {
|
|
3561
|
+
delete a[h], be(h);
|
|
3543
3562
|
}
|
|
3544
|
-
function
|
|
3545
|
-
return
|
|
3563
|
+
function x() {
|
|
3564
|
+
return Gt(ke, e, i);
|
|
3546
3565
|
}
|
|
3547
|
-
function
|
|
3548
|
-
return
|
|
3566
|
+
function Oe() {
|
|
3567
|
+
return re;
|
|
3549
3568
|
}
|
|
3550
|
-
function
|
|
3551
|
-
return
|
|
3569
|
+
function yt(h, d) {
|
|
3570
|
+
return f.Function(h.install) ? h.install(N, d) : f.Function(h) && h(N, d), this;
|
|
3552
3571
|
}
|
|
3553
|
-
function
|
|
3554
|
-
let
|
|
3555
|
-
const
|
|
3556
|
-
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();
|
|
3557
3576
|
}
|
|
3558
|
-
Object.setPrototypeOf(
|
|
3559
|
-
function
|
|
3577
|
+
Object.setPrototypeOf(N, l);
|
|
3578
|
+
function gt(h) {
|
|
3560
3579
|
let d = y({}, t);
|
|
3561
|
-
return
|
|
3580
|
+
return h ? d.inherit = {
|
|
3562
3581
|
components: e,
|
|
3563
3582
|
parsers: r,
|
|
3564
3583
|
directives: i,
|
|
3565
3584
|
providers: s,
|
|
3566
3585
|
maker: n,
|
|
3567
3586
|
loadData: a
|
|
3568
|
-
} : delete d.inherit,
|
|
3587
|
+
} : delete d.inherit, pt(d);
|
|
3569
3588
|
}
|
|
3570
|
-
function
|
|
3571
|
-
const d =
|
|
3572
|
-
|
|
3573
|
-
id:
|
|
3574
|
-
vm:
|
|
3575
|
-
create:
|
|
3576
|
-
manager:
|
|
3589
|
+
function ke(h) {
|
|
3590
|
+
const d = h.$options.propsData.rule;
|
|
3591
|
+
p(this, {
|
|
3592
|
+
id: Lr++,
|
|
3593
|
+
vm: h,
|
|
3594
|
+
create: N,
|
|
3595
|
+
manager: Rr(t.manager),
|
|
3577
3596
|
parsers: r,
|
|
3578
3597
|
providers: s,
|
|
3579
3598
|
rules: Array.isArray(d) ? d : [],
|
|
3580
|
-
name:
|
|
3581
|
-
inFor:
|
|
3599
|
+
name: h.$options.propsData.name || te(),
|
|
3600
|
+
inFor: h.$options.propsData.inFor,
|
|
3582
3601
|
prop: {
|
|
3583
3602
|
components: e,
|
|
3584
3603
|
directives: i
|
|
3585
3604
|
},
|
|
3586
|
-
setData:
|
|
3587
|
-
getData:
|
|
3605
|
+
setData: Ce,
|
|
3606
|
+
getData: _e,
|
|
3588
3607
|
loadData: a,
|
|
3589
3608
|
CreateNode: u,
|
|
3590
|
-
bus: new
|
|
3609
|
+
bus: new P(),
|
|
3591
3610
|
unwatch: null,
|
|
3592
3611
|
options: {},
|
|
3593
|
-
extendApi: t.extendApi || ((
|
|
3594
|
-
}), this.init(), this.initOptions(), this.name && (this.inFor ? (
|
|
3612
|
+
extendApi: t.extendApi || (($) => $)
|
|
3613
|
+
}), this.init(), this.initOptions(), this.name && (this.inFor ? (S[this.name] || (S[this.name] = []), S[this.name].push(this)) : S[this.name] = this);
|
|
3595
3614
|
}
|
|
3596
|
-
|
|
3615
|
+
p(ke.prototype, {
|
|
3597
3616
|
init() {
|
|
3598
|
-
const
|
|
3599
|
-
this.$handle = d,
|
|
3600
|
-
this.isSub() && (this.unwatch =
|
|
3601
|
-
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();
|
|
3602
3621
|
}, { deep: !0 }), this.initOptions()), this.created();
|
|
3603
|
-
}),
|
|
3622
|
+
}), h.$on("hook:mounted", () => {
|
|
3604
3623
|
this.mounted();
|
|
3605
|
-
}),
|
|
3606
|
-
if (
|
|
3624
|
+
}), h.$on("hook:beforeDestroy", () => {
|
|
3625
|
+
if (h.destroyed = !0, this.unwatch && this.unwatch(), d.reloadRule([]), this.name)
|
|
3607
3626
|
if (this.inFor) {
|
|
3608
|
-
const
|
|
3609
|
-
|
|
3627
|
+
const $ = S[this.name].indexOf(this);
|
|
3628
|
+
S[this.name].splice($, 1), S[this.name].length || delete S[this.name];
|
|
3610
3629
|
} else
|
|
3611
|
-
delete
|
|
3612
|
-
}),
|
|
3630
|
+
delete S[this.name];
|
|
3631
|
+
}), h.$on("hook:updated", () => {
|
|
3613
3632
|
d.bindNextTick(() => this.bus.$emit("next-tick", d.api));
|
|
3614
3633
|
});
|
|
3615
3634
|
},
|
|
@@ -3618,16 +3637,16 @@ function mt(t) {
|
|
|
3618
3637
|
},
|
|
3619
3638
|
initOptions() {
|
|
3620
3639
|
this.options = {};
|
|
3621
|
-
let
|
|
3622
|
-
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);
|
|
3623
3642
|
},
|
|
3624
|
-
mergeOptions(
|
|
3625
|
-
return d =
|
|
3626
|
-
delete d[
|
|
3627
|
-
}), 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;
|
|
3628
3647
|
},
|
|
3629
|
-
updateOptions(
|
|
3630
|
-
this.mergeOptions(this.options,
|
|
3648
|
+
updateOptions(h) {
|
|
3649
|
+
this.mergeOptions(this.options, h), this.$handle.$manager.updateOptions(this.options);
|
|
3631
3650
|
},
|
|
3632
3651
|
created() {
|
|
3633
3652
|
this.$handle.init(), this.vm.$emit("created", this.api());
|
|
@@ -3642,92 +3661,92 @@ function mt(t) {
|
|
|
3642
3661
|
this.$handle.mounted();
|
|
3643
3662
|
}
|
|
3644
3663
|
});
|
|
3645
|
-
function
|
|
3646
|
-
|
|
3664
|
+
function we(h) {
|
|
3665
|
+
p(h, {
|
|
3647
3666
|
version: t.version,
|
|
3648
3667
|
ui: t.ui,
|
|
3649
|
-
setData:
|
|
3650
|
-
getData:
|
|
3651
|
-
removeData:
|
|
3668
|
+
setData: Ce,
|
|
3669
|
+
getData: _e,
|
|
3670
|
+
removeData: mt,
|
|
3652
3671
|
maker: n,
|
|
3653
|
-
component:
|
|
3654
|
-
directive:
|
|
3655
|
-
register:
|
|
3656
|
-
$vnode:
|
|
3657
|
-
parser:
|
|
3658
|
-
use:
|
|
3659
|
-
factory:
|
|
3660
|
-
componentAlias:
|
|
3661
|
-
copyRule:
|
|
3662
|
-
copyRules:
|
|
3663
|
-
fetch:
|
|
3664
|
-
$form:
|
|
3665
|
-
parseFn:
|
|
3666
|
-
parseJson:
|
|
3667
|
-
toJson:
|
|
3672
|
+
component: O,
|
|
3673
|
+
directive: m,
|
|
3674
|
+
register: v,
|
|
3675
|
+
$vnode: Oe,
|
|
3676
|
+
parser: g,
|
|
3677
|
+
use: yt,
|
|
3678
|
+
factory: gt,
|
|
3679
|
+
componentAlias: _,
|
|
3680
|
+
copyRule: ge,
|
|
3681
|
+
copyRules: it,
|
|
3682
|
+
fetch: lt,
|
|
3683
|
+
$form: x,
|
|
3684
|
+
parseFn: M,
|
|
3685
|
+
parseJson: Yt,
|
|
3686
|
+
toJson: tt,
|
|
3668
3687
|
getApi: c,
|
|
3669
|
-
init(d,
|
|
3670
|
-
let
|
|
3688
|
+
init(d, $ = {}) {
|
|
3689
|
+
let b = qe(d, $), j = b.$refs.fc.formCreate;
|
|
3671
3690
|
return {
|
|
3672
|
-
mount(
|
|
3673
|
-
return
|
|
3691
|
+
mount(H) {
|
|
3692
|
+
return H && f.Element(H) && (j.options.el = H), Ue(j.options).appendChild(b.$el), j.api();
|
|
3674
3693
|
},
|
|
3675
3694
|
remove() {
|
|
3676
|
-
|
|
3695
|
+
b.$el.parentNode && b.$el.parentNode.removeChild(b.$el);
|
|
3677
3696
|
},
|
|
3678
3697
|
destroy() {
|
|
3679
|
-
this.remove(),
|
|
3698
|
+
this.remove(), b.$destroy();
|
|
3680
3699
|
},
|
|
3681
|
-
$f:
|
|
3700
|
+
$f: j.api()
|
|
3682
3701
|
};
|
|
3683
3702
|
}
|
|
3684
3703
|
});
|
|
3685
3704
|
}
|
|
3686
|
-
function
|
|
3687
|
-
|
|
3688
|
-
create:
|
|
3689
|
-
install(d,
|
|
3690
|
-
if (o = y(y({}, o),
|
|
3705
|
+
function $t(h) {
|
|
3706
|
+
p(h, {
|
|
3707
|
+
create: N,
|
|
3708
|
+
install(d, $) {
|
|
3709
|
+
if (o = y(y({}, o), $ || {}), d._installedFormCreate === !0) return;
|
|
3691
3710
|
d._installedFormCreate = !0;
|
|
3692
|
-
const
|
|
3693
|
-
return
|
|
3711
|
+
const b = function(j, H = {}) {
|
|
3712
|
+
return N(j, H, this);
|
|
3694
3713
|
};
|
|
3695
|
-
|
|
3714
|
+
we(b), d.prototype.$formCreate = b, d.component("FormCreate", x()), d.component("FcFragment", Oe());
|
|
3696
3715
|
}
|
|
3697
3716
|
});
|
|
3698
3717
|
}
|
|
3699
|
-
if (
|
|
3700
|
-
const
|
|
3701
|
-
|
|
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);
|
|
3702
3721
|
}
|
|
3703
|
-
const
|
|
3704
|
-
return Object.setPrototypeOf(
|
|
3722
|
+
const G = x();
|
|
3723
|
+
return Object.setPrototypeOf(G, l), Object.defineProperties(G, {
|
|
3705
3724
|
fetch: {
|
|
3706
3725
|
get() {
|
|
3707
3726
|
return l.fetch;
|
|
3708
3727
|
},
|
|
3709
|
-
set(
|
|
3710
|
-
l.fetch =
|
|
3728
|
+
set(h) {
|
|
3729
|
+
l.fetch = h;
|
|
3711
3730
|
}
|
|
3712
3731
|
}
|
|
3713
|
-
}),
|
|
3732
|
+
}), G.util = l, G;
|
|
3714
3733
|
}
|
|
3715
|
-
function
|
|
3716
|
-
if (
|
|
3734
|
+
function ne(t) {
|
|
3735
|
+
if (f.Date(t))
|
|
3717
3736
|
return t;
|
|
3718
3737
|
{
|
|
3719
3738
|
let e = new Date(t);
|
|
3720
3739
|
return e.toString() === "Invalid Date" ? t : e;
|
|
3721
3740
|
}
|
|
3722
3741
|
}
|
|
3723
|
-
const
|
|
3724
|
-
name:
|
|
3742
|
+
const He = "datePicker", Nr = {
|
|
3743
|
+
name: He,
|
|
3725
3744
|
maker: function() {
|
|
3726
|
-
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), {});
|
|
3727
3746
|
}(),
|
|
3728
3747
|
mergeProp(t) {
|
|
3729
3748
|
let e = t.prop.props;
|
|
3730
|
-
e.startDate && (e.startDate = e.startDate &&
|
|
3749
|
+
e.startDate && (e.startDate = e.startDate && ne(e.startDate));
|
|
3731
3750
|
},
|
|
3732
3751
|
isRange(t) {
|
|
3733
3752
|
return t.type.includes("range") || t.multiple;
|
|
@@ -3746,60 +3765,60 @@ const Je = "datePicker", Mr = {
|
|
|
3746
3765
|
return this.isRange(e.el) ? r : r[0];
|
|
3747
3766
|
} else {
|
|
3748
3767
|
let r = Array.isArray(t), i = e.prop.props, s, n = i.type || "date";
|
|
3749
|
-
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;
|
|
3750
3769
|
}
|
|
3751
3770
|
},
|
|
3752
3771
|
mounted(t) {
|
|
3753
3772
|
t.rule.value = this.toValue(t.$handle.getFormData(t), t);
|
|
3754
3773
|
}
|
|
3755
|
-
},
|
|
3756
|
-
name:
|
|
3774
|
+
}, se = "hidden", Mr = {
|
|
3775
|
+
name: se,
|
|
3757
3776
|
maker: {
|
|
3758
|
-
[
|
|
3777
|
+
[se]: (t, e) => F(se)("", t, e)
|
|
3759
3778
|
},
|
|
3760
3779
|
render() {
|
|
3761
3780
|
return [];
|
|
3762
3781
|
}
|
|
3763
|
-
},
|
|
3764
|
-
name:
|
|
3782
|
+
}, oe = "input", Ur = {
|
|
3783
|
+
name: oe,
|
|
3765
3784
|
maker: function() {
|
|
3766
|
-
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] =
|
|
3767
|
-
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;
|
|
3768
3787
|
}(),
|
|
3769
3788
|
mergeProp(t) {
|
|
3770
3789
|
let { props: e } = t.prop;
|
|
3771
3790
|
e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
3772
3791
|
}
|
|
3773
|
-
},
|
|
3774
|
-
name:
|
|
3792
|
+
}, Je = "slider", qr = {
|
|
3793
|
+
name: Je,
|
|
3775
3794
|
maker: {
|
|
3776
|
-
sliderRange:
|
|
3795
|
+
sliderRange: F(Je, { range: !0 })
|
|
3777
3796
|
},
|
|
3778
3797
|
toFormValue(t, e) {
|
|
3779
3798
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
3780
3799
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
3781
3800
|
}
|
|
3782
|
-
},
|
|
3801
|
+
}, Hr = {
|
|
3783
3802
|
name: "switch",
|
|
3784
3803
|
mergeProp(t) {
|
|
3785
3804
|
const e = t.prop.props.slot || {}, r = t.prop.scopedSlots || {};
|
|
3786
3805
|
e.open && (r.open = () => e.open), e.close && (r.close = () => e.close), t.prop.scopedSlots = r;
|
|
3787
3806
|
}
|
|
3788
|
-
},
|
|
3807
|
+
}, Jr = {
|
|
3789
3808
|
name: "FcRow",
|
|
3790
3809
|
render(t, e) {
|
|
3791
3810
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
3792
3811
|
e.vNode.row(e.prop, t)
|
|
3793
3812
|
]);
|
|
3794
3813
|
}
|
|
3795
|
-
},
|
|
3814
|
+
}, zr = [
|
|
3815
|
+
Nr,
|
|
3796
3816
|
Mr,
|
|
3797
3817
|
Ur,
|
|
3798
3818
|
qr,
|
|
3799
3819
|
Hr,
|
|
3800
|
-
Jr
|
|
3801
|
-
|
|
3802
|
-
], xr = {
|
|
3820
|
+
Jr
|
|
3821
|
+
], Wr = {
|
|
3803
3822
|
button: "iButton",
|
|
3804
3823
|
icon: "Icon",
|
|
3805
3824
|
slider: "Slider",
|
|
@@ -3825,21 +3844,21 @@ const Je = "datePicker", Mr = {
|
|
|
3825
3844
|
group: "fcGroup",
|
|
3826
3845
|
subForm: "fcSubForm",
|
|
3827
3846
|
object: "fcSubForm"
|
|
3828
|
-
},
|
|
3847
|
+
}, Y = {
|
|
3829
3848
|
resetBtnType: "default",
|
|
3830
3849
|
resetBtnIcon: "md-refresh",
|
|
3831
3850
|
infoIcon: "ios-information-circle-outline"
|
|
3832
3851
|
};
|
|
3833
|
-
function
|
|
3852
|
+
function xr() {
|
|
3834
3853
|
return {
|
|
3835
3854
|
type: "poptip",
|
|
3836
3855
|
trigger: "hover",
|
|
3837
3856
|
placement: "top-start",
|
|
3838
3857
|
wordWrap: !0,
|
|
3839
|
-
icon:
|
|
3858
|
+
icon: Y.infoIcon
|
|
3840
3859
|
};
|
|
3841
3860
|
}
|
|
3842
|
-
function
|
|
3861
|
+
function Gr() {
|
|
3843
3862
|
return {
|
|
3844
3863
|
form: {
|
|
3845
3864
|
inline: !1,
|
|
@@ -3861,9 +3880,9 @@ function Kr() {
|
|
|
3861
3880
|
click: void 0
|
|
3862
3881
|
},
|
|
3863
3882
|
resetBtn: {
|
|
3864
|
-
type:
|
|
3883
|
+
type: Y.resetBtnType,
|
|
3865
3884
|
disabled: !1,
|
|
3866
|
-
icon:
|
|
3885
|
+
icon: Y.resetBtnIcon,
|
|
3867
3886
|
innerText: "重置",
|
|
3868
3887
|
loading: !1,
|
|
3869
3888
|
show: !1,
|
|
@@ -3871,16 +3890,16 @@ function Kr() {
|
|
|
3871
3890
|
}
|
|
3872
3891
|
};
|
|
3873
3892
|
}
|
|
3874
|
-
function
|
|
3875
|
-
|
|
3893
|
+
function ze(t, e) {
|
|
3894
|
+
k(t, e) && f.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
3876
3895
|
}
|
|
3877
|
-
function
|
|
3896
|
+
function V(t) {
|
|
3878
3897
|
return t === !1;
|
|
3879
3898
|
}
|
|
3880
|
-
function
|
|
3881
|
-
|
|
3899
|
+
function Kr(t, e) {
|
|
3900
|
+
k(t, e) && !f.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
3882
3901
|
}
|
|
3883
|
-
const
|
|
3902
|
+
const Xr = {
|
|
3884
3903
|
validate() {
|
|
3885
3904
|
const t = this.form();
|
|
3886
3905
|
return t ? new Promise((e, r) => {
|
|
@@ -3903,20 +3922,20 @@ const Qr = {
|
|
|
3903
3922
|
},
|
|
3904
3923
|
tidyOptions(t) {
|
|
3905
3924
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
3906
|
-
|
|
3925
|
+
Kr(t, e);
|
|
3907
3926
|
}), t;
|
|
3908
3927
|
},
|
|
3909
3928
|
tidyRule({ prop: t }) {
|
|
3910
|
-
return
|
|
3929
|
+
return ze(t, "title"), ze(t, "info"), t;
|
|
3911
3930
|
},
|
|
3912
3931
|
mergeProp(t) {
|
|
3913
|
-
t.prop =
|
|
3932
|
+
t.prop = D([{
|
|
3914
3933
|
info: this.options.info || {},
|
|
3915
3934
|
wrap: this.options.wrap || {},
|
|
3916
3935
|
col: this.options.col || {},
|
|
3917
3936
|
title: this.options.title || {}
|
|
3918
3937
|
}, t.prop], {
|
|
3919
|
-
info:
|
|
3938
|
+
info: xr(),
|
|
3920
3939
|
title: {},
|
|
3921
3940
|
col: { span: 24 },
|
|
3922
3941
|
wrap: {}
|
|
@@ -3926,7 +3945,7 @@ const Qr = {
|
|
|
3926
3945
|
!t.size && this.options.form.size && (t.size = this.options.form.size);
|
|
3927
3946
|
},
|
|
3928
3947
|
getDefaultOptions() {
|
|
3929
|
-
return
|
|
3948
|
+
return Gr();
|
|
3930
3949
|
},
|
|
3931
3950
|
update() {
|
|
3932
3951
|
const t = this.options.form;
|
|
@@ -3944,17 +3963,17 @@ const Qr = {
|
|
|
3944
3963
|
},
|
|
3945
3964
|
beforeRender() {
|
|
3946
3965
|
const { key: t, ref: e, $handle: r } = this;
|
|
3947
|
-
|
|
3966
|
+
p(this.rule, { key: t, ref: e }), p(this.rule.props, {
|
|
3948
3967
|
model: r.formData
|
|
3949
3968
|
// rules: $handle.validate(),
|
|
3950
3969
|
});
|
|
3951
3970
|
},
|
|
3952
3971
|
render(t) {
|
|
3953
|
-
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)]);
|
|
3954
3973
|
},
|
|
3955
3974
|
makeWrap(t, e) {
|
|
3956
|
-
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 =
|
|
3957
|
-
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({
|
|
3958
3977
|
labelWidth: o
|
|
3959
3978
|
}, r.wrap || {}), {
|
|
3960
3979
|
prop: t.id,
|
|
@@ -3965,32 +3984,32 @@ const Qr = {
|
|
|
3965
3984
|
ref: t.wrapRef,
|
|
3966
3985
|
type: "formItem"
|
|
3967
3986
|
}]), [e, n ? this.makeInfo(r, i, t) : null]);
|
|
3968
|
-
return a === !0 ||
|
|
3987
|
+
return a === !0 || V(u) || V(s.show) ? l : this.makeCol(r, i, [l]);
|
|
3969
3988
|
},
|
|
3970
3989
|
isTitle(t) {
|
|
3971
3990
|
if (this.options.form.title === !1) return !1;
|
|
3972
3991
|
const e = t.title;
|
|
3973
|
-
return !(!e.title && !e.native ||
|
|
3992
|
+
return !(!e.title && !e.native || V(e.show));
|
|
3974
3993
|
},
|
|
3975
3994
|
makeInfo(t, e, r) {
|
|
3976
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];
|
|
3977
|
-
if (!
|
|
3996
|
+
if (!V(s.show) && (s.info || s.native) && !V(s.icon)) {
|
|
3978
3997
|
const a = {
|
|
3979
3998
|
type: s.type || "poptip",
|
|
3980
3999
|
props: y({}, s),
|
|
3981
4000
|
key: `${e}pop`,
|
|
3982
4001
|
slot: "label"
|
|
3983
4002
|
}, u = "content";
|
|
3984
|
-
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]), [
|
|
3985
4004
|
this.$r({
|
|
3986
4005
|
type: "icon",
|
|
3987
|
-
props: { type: s.icon === !0 ?
|
|
4006
|
+
props: { type: s.icon === !0 ? Y.infoIcon : s.icon, size: 16 },
|
|
3988
4007
|
style: "margin-top: -1px",
|
|
3989
4008
|
key: `${e}i`
|
|
3990
4009
|
})
|
|
3991
4010
|
]));
|
|
3992
4011
|
}
|
|
3993
|
-
return this.$r(
|
|
4012
|
+
return this.$r(D([i, {
|
|
3994
4013
|
props: i,
|
|
3995
4014
|
slot: i.slot || "label",
|
|
3996
4015
|
key: `${e}tit`,
|
|
@@ -4017,7 +4036,7 @@ const Qr = {
|
|
|
4017
4036
|
},
|
|
4018
4037
|
makeFormBtn() {
|
|
4019
4038
|
let t = [];
|
|
4020
|
-
if (
|
|
4039
|
+
if (V(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), V(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4021
4040
|
return;
|
|
4022
4041
|
const e = this.$r({
|
|
4023
4042
|
type: "formItem",
|
|
@@ -4059,34 +4078,34 @@ const Qr = {
|
|
|
4059
4078
|
key: `${this.key}b1`
|
|
4060
4079
|
}, [t.innerText]);
|
|
4061
4080
|
}
|
|
4062
|
-
},
|
|
4063
|
-
function
|
|
4064
|
-
|
|
4065
|
-
t[e] =
|
|
4081
|
+
}, L = {}, Qr = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
|
|
4082
|
+
function Zr(t) {
|
|
4083
|
+
Qr.forEach((e) => {
|
|
4084
|
+
t[e] = F(e);
|
|
4066
4085
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4067
4086
|
}
|
|
4068
|
-
function
|
|
4087
|
+
function Yr(t) {
|
|
4069
4088
|
const e = "upload", r = {
|
|
4070
4089
|
image: ["image", 0],
|
|
4071
4090
|
file: ["file", 0],
|
|
4072
4091
|
uploadFileOne: ["file", 1],
|
|
4073
4092
|
uploadImageOne: ["image", 1]
|
|
4074
4093
|
};
|
|
4075
|
-
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;
|
|
4076
4095
|
}
|
|
4077
|
-
function
|
|
4096
|
+
function ei(t) {
|
|
4078
4097
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4079
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4098
|
+
Object.keys(r).reduce((i, s) => (i[s] = F(e, { type: r[s] }), i), t);
|
|
4080
4099
|
}
|
|
4081
|
-
function
|
|
4100
|
+
function ti(t) {
|
|
4082
4101
|
const e = "timePicker";
|
|
4083
|
-
t.time =
|
|
4102
|
+
t.time = F(e, { type: "time" }), t.timeRange = F(e, { type: "timerange" });
|
|
4084
4103
|
}
|
|
4085
|
-
function
|
|
4104
|
+
function ri(t) {
|
|
4086
4105
|
const e = "select";
|
|
4087
|
-
t.selectMultiple =
|
|
4106
|
+
t.selectMultiple = F(e, { multiple: !0 }), t.selectOne = F(e, { multiple: !1 });
|
|
4088
4107
|
}
|
|
4089
|
-
function
|
|
4108
|
+
function ii(t) {
|
|
4090
4109
|
const e = "frame", r = {
|
|
4091
4110
|
frameInputs: ["input", 0],
|
|
4092
4111
|
frameFiles: ["file", 0],
|
|
@@ -4095,19 +4114,19 @@ function ni(t) {
|
|
|
4095
4114
|
frameFileOne: ["file", 1],
|
|
4096
4115
|
frameImageOne: ["image", 1]
|
|
4097
4116
|
};
|
|
4098
|
-
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;
|
|
4099
4118
|
}
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
function
|
|
4107
|
-
return
|
|
4119
|
+
Zr(L);
|
|
4120
|
+
Yr(L);
|
|
4121
|
+
ei(L);
|
|
4122
|
+
ri(L);
|
|
4123
|
+
ii(L);
|
|
4124
|
+
ti(L);
|
|
4125
|
+
function We(t, e) {
|
|
4126
|
+
return f.Boolean(t) ? t = { show: t } : !f.Undef(t) && !f.Object(t) && (t = { show: e }), t;
|
|
4108
4127
|
}
|
|
4109
|
-
function
|
|
4110
|
-
return
|
|
4128
|
+
function ni(t, e) {
|
|
4129
|
+
return p(t, {
|
|
4111
4130
|
formEl() {
|
|
4112
4131
|
return e.$manager.form();
|
|
4113
4132
|
},
|
|
@@ -4132,7 +4151,7 @@ function si(t, e) {
|
|
|
4132
4151
|
const o = e.getFieldCtx(r);
|
|
4133
4152
|
if (!o) return;
|
|
4134
4153
|
const a = e.subForm[o.id], u = [e.$manager.validateField(o.id)];
|
|
4135
|
-
|
|
4154
|
+
I(a).forEach((l) => {
|
|
4136
4155
|
u.push(l.validate().catch(() => Promise.reject("子表单验证未通过")));
|
|
4137
4156
|
}), Promise.all(u).then(() => {
|
|
4138
4157
|
s(null), i && i(null);
|
|
@@ -4180,41 +4199,41 @@ function si(t, e) {
|
|
|
4180
4199
|
}
|
|
4181
4200
|
},
|
|
4182
4201
|
submitBtnProps: (r = {}) => {
|
|
4183
|
-
let i =
|
|
4184
|
-
|
|
4202
|
+
let i = We(e.options.submitBtn, !0);
|
|
4203
|
+
p(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4185
4204
|
},
|
|
4186
4205
|
resetBtnProps: (r = {}) => {
|
|
4187
|
-
let i =
|
|
4188
|
-
|
|
4206
|
+
let i = We(e.options.resetBtn, !1);
|
|
4207
|
+
p(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4189
4208
|
},
|
|
4190
4209
|
submit(r, i) {
|
|
4191
4210
|
t.validate((s) => {
|
|
4192
4211
|
if (s) {
|
|
4193
4212
|
let n = t.formData();
|
|
4194
|
-
|
|
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));
|
|
4195
4214
|
} else
|
|
4196
|
-
|
|
4215
|
+
f.Function(i) && E(() => i(this, ...arguments));
|
|
4197
4216
|
}).catch((s) => {
|
|
4198
4217
|
});
|
|
4199
4218
|
}
|
|
4200
4219
|
}), t;
|
|
4201
4220
|
}
|
|
4202
|
-
function
|
|
4203
|
-
t.componentAlias(
|
|
4221
|
+
function si(t) {
|
|
4222
|
+
t.componentAlias(Wr), xt.forEach((e) => {
|
|
4204
4223
|
t.component(e.name, e);
|
|
4205
|
-
}),
|
|
4224
|
+
}), zr.forEach((e) => {
|
|
4206
4225
|
t.parser(e);
|
|
4207
|
-
}), Object.keys(
|
|
4208
|
-
t.maker[e] =
|
|
4226
|
+
}), Object.keys(L).forEach((e) => {
|
|
4227
|
+
t.maker[e] = L[e];
|
|
4209
4228
|
});
|
|
4210
4229
|
}
|
|
4211
|
-
function
|
|
4212
|
-
return
|
|
4230
|
+
function oi() {
|
|
4231
|
+
return pt({
|
|
4213
4232
|
ui: "view-design",
|
|
4214
|
-
version: "2.6.
|
|
4215
|
-
manager:
|
|
4216
|
-
install:
|
|
4217
|
-
extendApi:
|
|
4233
|
+
version: "2.6.1",
|
|
4234
|
+
manager: Xr,
|
|
4235
|
+
install: si,
|
|
4236
|
+
extendApi: ni,
|
|
4218
4237
|
attrs: {
|
|
4219
4238
|
normal: ["col", "wrap"],
|
|
4220
4239
|
array: ["className"],
|
|
@@ -4222,10 +4241,10 @@ function ai() {
|
|
|
4222
4241
|
}
|
|
4223
4242
|
});
|
|
4224
4243
|
}
|
|
4225
|
-
const
|
|
4226
|
-
typeof window != "undefined" && (window.formCreate =
|
|
4227
|
-
const
|
|
4244
|
+
const ce = oi();
|
|
4245
|
+
typeof window != "undefined" && (window.formCreate = ce, window.Vue && ce.install(window.Vue));
|
|
4246
|
+
const ui = ce.maker;
|
|
4228
4247
|
export {
|
|
4229
|
-
|
|
4230
|
-
|
|
4248
|
+
ce as default,
|
|
4249
|
+
ui as maker
|
|
4231
4250
|
};
|