@form-create/view-design 2.6.0 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/form-create.esm.js +879 -857
- 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.2
|
|
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 $t = Object.defineProperty, vt = Object.defineProperties;
|
|
11
|
+
var bt = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var we = Object.getOwnPropertySymbols;
|
|
13
|
+
var Ct = Object.prototype.hasOwnProperty, _t = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var Fe = (t, e, r) => e in t ? $t(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
|
+
Ct.call(e, r) && Fe(t, r, e[r]);
|
|
17
|
+
if (we)
|
|
18
|
+
for (var r of we(e))
|
|
19
|
+
_t.call(e, r) && Fe(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
},
|
|
22
|
-
import
|
|
23
|
-
function
|
|
21
|
+
}, q = (t, e) => vt(t, bt(e));
|
|
22
|
+
import P from "vue";
|
|
23
|
+
function Ot(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function oe() {
|
|
27
|
+
return oe = 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
|
+
}, oe.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var kt = ["attrs", "props", "domProps"], wt = ["class", "style", "directives"], Ft = ["on", "nativeOn"], St = 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 (kt.indexOf(i) !== -1) e[i] = oe({}, e[i], r[i]);
|
|
36
|
+
else if (wt.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 (Ft.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] ? Et(e[i][l], r[i][l]) : r[i][l];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, Et = 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
|
+
}, Rt = St;
|
|
53
|
+
const C = /* @__PURE__ */ Ot(Rt);
|
|
54
|
+
function Y(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 It = "fcCheckbox", jt = {
|
|
58
|
+
name: It,
|
|
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
|
+
}), Y(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 At = "fcFrame";
|
|
130
|
+
function We(t) {
|
|
130
131
|
return {
|
|
131
|
-
name:
|
|
132
|
+
name: At,
|
|
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 xe = We({
|
|
498
507
|
fileIcon: "md-document",
|
|
499
508
|
fileUpIcon: "ios-folder-open"
|
|
500
509
|
});
|
|
501
|
-
|
|
510
|
+
xe.v2 = We({
|
|
502
511
|
fileIcon: "document-text",
|
|
503
512
|
fileUpIcon: "folder"
|
|
504
513
|
});
|
|
505
|
-
const
|
|
506
|
-
name:
|
|
514
|
+
const Vt = "fcRadio", Pt = {
|
|
515
|
+
name: Vt,
|
|
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
|
+
}), Y(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 Dt = "fcSelect", Tt = {
|
|
611
|
+
name: Dt,
|
|
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
|
+
}, Bt = "fcTree", Lt = {
|
|
643
|
+
name: Bt,
|
|
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,30 +683,30 @@ 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
|
+
}]), [Y(this.$slots)]);
|
|
682
692
|
},
|
|
683
693
|
mounted() {
|
|
684
694
|
this.$emit("fc.el", this.$refs.tree);
|
|
685
695
|
}
|
|
686
696
|
};
|
|
687
|
-
function
|
|
697
|
+
function Se(t) {
|
|
688
698
|
return {
|
|
689
699
|
url: t,
|
|
690
|
-
name:
|
|
700
|
+
name: Nt(t)
|
|
691
701
|
};
|
|
692
702
|
}
|
|
693
|
-
function
|
|
703
|
+
function Nt(t) {
|
|
694
704
|
return ("" + t).split("/").pop();
|
|
695
705
|
}
|
|
696
|
-
const
|
|
697
|
-
function
|
|
706
|
+
const Mt = "fcUpload";
|
|
707
|
+
function Ge(t) {
|
|
698
708
|
return {
|
|
699
|
-
name:
|
|
709
|
+
name: Mt,
|
|
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(Se);
|
|
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(Se), 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, Y(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 Ke = Ge({
|
|
888
904
|
fileIcon: "md-document",
|
|
889
905
|
imgUpIcon: "md-images"
|
|
890
906
|
});
|
|
891
|
-
|
|
907
|
+
Ke.v2 = Ge({
|
|
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 z(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] = z(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 z({}, { value: t }).value;
|
|
927
943
|
}
|
|
928
|
-
const
|
|
944
|
+
const Ut = 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 Ut.apply(this, arguments);
|
|
936
952
|
}
|
|
937
|
-
const
|
|
938
|
-
name:
|
|
953
|
+
const qt = "fcGroup", Ht = {
|
|
954
|
+
name: qt,
|
|
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
|
+
z(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
|
+
}, Jt = "fcSubForm", zt = {
|
|
1254
|
+
name: Jt,
|
|
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
|
-
|
|
1337
|
+
}, Wt = [
|
|
1338
|
+
jt,
|
|
1339
|
+
Pt,
|
|
1319
1340
|
Tt,
|
|
1320
1341
|
Lt,
|
|
1321
|
-
|
|
1322
|
-
|
|
1342
|
+
zt,
|
|
1343
|
+
xe,
|
|
1323
1344
|
Ke,
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
], Ie = "FormCreate", ue = (t, e) => {
|
|
1345
|
+
Ht
|
|
1346
|
+
], Ee = "FormCreate", ae = (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 ae(t.$parent, e);
|
|
1332
1352
|
}
|
|
1333
1353
|
};
|
|
1334
|
-
function
|
|
1354
|
+
function xt(t, e, r) {
|
|
1335
1355
|
return {
|
|
1336
|
-
name:
|
|
1337
|
-
componentName:
|
|
1356
|
+
name: Ee,
|
|
1357
|
+
componentName: Ee,
|
|
1338
1358
|
model: {
|
|
1339
1359
|
prop: "api"
|
|
1340
1360
|
},
|
|
@@ -1410,8 +1430,8 @@ function Kt(t, e, r) {
|
|
|
1410
1430
|
},
|
|
1411
1431
|
deep: !0
|
|
1412
1432
|
},
|
|
1413
|
-
rule(i) {
|
|
1414
|
-
i.length === this.renderRule.length && i.every((
|
|
1433
|
+
rule(i, s) {
|
|
1434
|
+
i.length === this.renderRule.length && i.every((n) => this.renderRule.indexOf(n) > -1) || (this.formCreate.$handle.reloadRule(i), this._renderRule(), i !== s && this.formCreate.$handle.targetReload());
|
|
1415
1435
|
},
|
|
1416
1436
|
disabled() {
|
|
1417
1437
|
this.$f.refresh();
|
|
@@ -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 = ae(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 = ae(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 Xe = ["attrs", "props", "domProps", "scopedSlots"], Qe = ["class", "style", "directives"], Ze = ["on", "nativeOn"], D = (t, e = {}, r = {}) => {
|
|
1472
|
+
const i = [...Xe, ...r.normal || []], s = [...Qe, ...r.array || []], n = [...Ze, ...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] = Gt(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
|
+
}, Gt = (t, e) => function() {
|
|
1480
1500
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1481
|
-
},
|
|
1482
|
-
function
|
|
1483
|
-
return [...
|
|
1501
|
+
}, Ye = ["type", "slot", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "preview", "component", "cache"], ce = ["validate", "children", "control"], de = ["effect", "deep"];
|
|
1502
|
+
function Kt() {
|
|
1503
|
+
return [...Ye, ...Xe, ...Qe, ...Ze, ...ce, ...de];
|
|
1484
1504
|
}
|
|
1485
|
-
function
|
|
1505
|
+
function pe(t, e, r) {
|
|
1486
1506
|
return `[form-create ${t}]: ${e}`;
|
|
1487
1507
|
}
|
|
1488
|
-
function
|
|
1489
|
-
console.warn(
|
|
1508
|
+
function Xt(t, e) {
|
|
1509
|
+
console.warn(pe("tip", t));
|
|
1490
1510
|
}
|
|
1491
|
-
function
|
|
1492
|
-
console.error(
|
|
1511
|
+
function me(t, e) {
|
|
1512
|
+
console.error(pe("err", t));
|
|
1493
1513
|
}
|
|
1494
|
-
function
|
|
1495
|
-
|
|
1514
|
+
function Qt(t) {
|
|
1515
|
+
me(t.toString()), console.error(t);
|
|
1496
1516
|
}
|
|
1497
|
-
const
|
|
1498
|
-
function
|
|
1499
|
-
return JSON.stringify(
|
|
1517
|
+
const le = "[[FORM-CREATE-PREFIX-", ue = "-FORM-CREATE-SUFFIX]]", Re = "$FN:", Ie = "$FNX:";
|
|
1518
|
+
function et(t, e) {
|
|
1519
|
+
return JSON.stringify(z(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1500
1520
|
if (!(i && i._isVue === !0)) {
|
|
1501
|
-
if (typeof i
|
|
1521
|
+
if (typeof i != "function")
|
|
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 le + i + ue;
|
|
1507
1527
|
}
|
|
1508
1528
|
}, e);
|
|
1509
1529
|
}
|
|
1510
|
-
function
|
|
1530
|
+
function je(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(
|
|
1518
|
-
r = r.replace(
|
|
1519
|
-
else if (r.indexOf(
|
|
1520
|
-
r = r.replace(
|
|
1537
|
+
if (r.indexOf(ue) > 0 && r.indexOf(le) === 0)
|
|
1538
|
+
r = r.replace(ue, "").replace(le, ""), i = !0;
|
|
1539
|
+
else if (r.indexOf(Re) === 0)
|
|
1540
|
+
r = r.replace(Re, ""), i = !0;
|
|
1521
1541
|
else {
|
|
1522
|
-
if (r.indexOf(
|
|
1523
|
-
return r =
|
|
1524
|
-
!e && r.indexOf(
|
|
1542
|
+
if (r.indexOf(Ie) === 0)
|
|
1543
|
+
return r = je("function($inject){" + r.replace(Ie, "") + "}"), r.__json = t, r.__inject = !0, r;
|
|
1544
|
+
!e && r.indexOf("function ") === 0 && r !== "function " && (i = !0);
|
|
1525
1545
|
}
|
|
1526
1546
|
if (!i) return t;
|
|
1527
|
-
const s =
|
|
1547
|
+
const s = je(r.indexOf("function ") === -1 && r.indexOf("(") !== 0 ? "function " + r : r);
|
|
1528
1548
|
return s.__json = t, s;
|
|
1529
1549
|
} catch (s) {
|
|
1530
|
-
|
|
1550
|
+
me(`解析失败:${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 Zt(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 tt(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 ye(t) {
|
|
1572
|
+
return rt([t])[0];
|
|
1553
1573
|
}
|
|
1554
|
-
function
|
|
1555
|
-
return
|
|
1574
|
+
function rt(t, e) {
|
|
1575
|
+
return z([], [...t], e || !1);
|
|
1556
1576
|
}
|
|
1557
|
-
function
|
|
1558
|
-
return
|
|
1577
|
+
function U(t, e) {
|
|
1578
|
+
return D(Array.isArray(e) ? e : [e], t, { array: ce, normal: de }), t;
|
|
1559
1579
|
}
|
|
1560
|
-
function
|
|
1561
|
-
const e =
|
|
1580
|
+
function Ae(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 Yt(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 it(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 K(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
|
+
Qt(r);
|
|
1584
1604
|
}
|
|
1585
1605
|
return e;
|
|
1586
1606
|
}
|
|
1587
|
-
const
|
|
1588
|
-
"==": (t, e) => JSON.stringify(t) === JSON.stringify(
|
|
1589
|
-
"!=": (t, e) => !
|
|
1607
|
+
const Ve = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, J = {
|
|
1608
|
+
"==": (t, e) => JSON.stringify(t) === JSON.stringify(Ve(t, e)),
|
|
1609
|
+
"!=": (t, e) => !J["=="](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(Ve(t[0], e)) > -1;
|
|
1596
1616
|
},
|
|
1597
1617
|
notOn(t, e) {
|
|
1598
|
-
return !
|
|
1618
|
+
return !J.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 !J.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 nt() {
|
|
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 ge(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 ge(t, e, r, i, s) {
|
|
1661
|
+
this._data = p(nt(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1642
1662
|
}
|
|
1643
|
-
|
|
1663
|
+
p(ge.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 = ye(this._data), t;
|
|
1653
1673
|
}
|
|
1654
1674
|
});
|
|
1655
|
-
function
|
|
1675
|
+
function st(t) {
|
|
1656
1676
|
t.forEach((e) => {
|
|
1657
|
-
|
|
1658
|
-
return
|
|
1677
|
+
ge.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
|
+
st(Kt());
|
|
1683
|
+
const ot = F("");
|
|
1684
|
+
function er(t, e, r) {
|
|
1685
|
+
let i = ot("", e);
|
|
1666
1686
|
return i._data.type = t, i._data.title = r, i;
|
|
1667
1687
|
}
|
|
1668
|
-
function
|
|
1669
|
-
let s =
|
|
1688
|
+
function Pe(t, e, r, i) {
|
|
1689
|
+
let s = ot("", 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 tr() {
|
|
1673
1693
|
return {
|
|
1674
|
-
create:
|
|
1675
|
-
createTmp:
|
|
1676
|
-
template:
|
|
1677
|
-
factory:
|
|
1694
|
+
create: er,
|
|
1695
|
+
createTmp: Pe,
|
|
1696
|
+
template: Pe,
|
|
1697
|
+
factory: F
|
|
1678
1698
|
};
|
|
1679
1699
|
}
|
|
1680
|
-
function
|
|
1700
|
+
function rr(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 De(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 at(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(rr(r, t, e), De(e));
|
|
1723
|
+
t.onSuccess(De(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 ir(t) {
|
|
1715
1735
|
return new Promise((e, r) => {
|
|
1716
|
-
|
|
1736
|
+
at(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 G(t) {
|
|
1751
|
+
return B(t);
|
|
1732
1752
|
}
|
|
1733
|
-
function
|
|
1753
|
+
function nr(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] = G(u.rule.value)), o;
|
|
1797
|
+
}, t.options.appendValue !== !1 ? G(t.appendData) : {});
|
|
1778
1798
|
},
|
|
1779
1799
|
getValue(n) {
|
|
1780
1800
|
const o = t.getFieldCtx(n);
|
|
1781
1801
|
if (o)
|
|
1782
|
-
return
|
|
1802
|
+
return G(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 && K(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) ? K(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 = G(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(pe("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 et(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(() => ir(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 sr(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 lt(e);
|
|
2086
2106
|
}
|
|
2087
|
-
function
|
|
2107
|
+
function lt(t) {
|
|
2088
2108
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2089
2109
|
}
|
|
2090
|
-
function
|
|
2110
|
+
function or(t) {
|
|
2091
2111
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
2092
2112
|
}
|
|
2093
|
-
function
|
|
2113
|
+
function X(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 ar = 0;
|
|
2118
|
+
function ee() {
|
|
2119
|
+
const t = 370 + ++ar;
|
|
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 Q(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 lr(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-" + X(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + X(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 && Q(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
|
+
Q(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 Xt("当前使用的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(lt(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 $e(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
|
+
}), it(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
|
-
|
|
2394
|
-
function
|
|
2395
|
-
|
|
2412
|
+
sr($e);
|
|
2413
|
+
lr($e);
|
|
2414
|
+
function ur(t) {
|
|
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 _ = X(`${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 Te = ["hook:updated", "hook:mounted"];
|
|
2482
|
+
function hr(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 = fr(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(Te, 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(Te, e);
|
|
2479
2499
|
}
|
|
2480
2500
|
});
|
|
2481
2501
|
}
|
|
2482
|
-
function
|
|
2502
|
+
function fr(t) {
|
|
2483
2503
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2484
2504
|
}
|
|
2485
|
-
function
|
|
2486
|
-
|
|
2505
|
+
function cr(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 dr(t) {
|
|
2501
2521
|
Object.defineProperties(t.origin, {
|
|
2502
|
-
__fc__:
|
|
2522
|
+
__fc__: tt(t, !0)
|
|
2503
2523
|
});
|
|
2504
2524
|
}
|
|
2505
|
-
function
|
|
2506
|
-
const i =
|
|
2507
|
-
|
|
2525
|
+
function ut(t, e, r) {
|
|
2526
|
+
const i = ee();
|
|
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(), dr(this), this.update(t, !0);
|
|
2529
2549
|
}
|
|
2530
|
-
|
|
2550
|
+
p(ut.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 = ee(), 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 pr(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 = Ae(e);
|
|
2641
2660
|
return Object.defineProperties(r, {
|
|
2642
|
-
__origin__:
|
|
2643
|
-
}),
|
|
2661
|
+
__origin__: tt(e, !0)
|
|
2662
|
+
}), mr(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 = Ae(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 (Be(l))
|
|
2701
2720
|
return;
|
|
2702
2721
|
l.update(this);
|
|
2703
2722
|
}
|
|
2704
|
-
} else if (
|
|
2705
|
-
if (
|
|
2723
|
+
} else if (g) {
|
|
2724
|
+
if (Be(l))
|
|
2706
2725
|
return;
|
|
2707
|
-
e[o] = n = n._clone ? n._clone() :
|
|
2726
|
+
e[o] = n = n._clone ? n._clone() : ye(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
|
|
2732
|
+
const g = this.parseRule(n);
|
|
2733
|
+
l = new ut(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 = yr(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 (J[u.condition || "=="] || J["=="])(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: gr(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 = K(_);
|
|
2794
|
+
O && O.rm();
|
|
2776
2795
|
}
|
|
2777
2796
|
});
|
|
2778
2797
|
}), n.length && this.vm.$nextTick(() => {
|
|
@@ -2789,7 +2808,7 @@ function yr(t) {
|
|
|
2789
2808
|
this.bus.$once("load-end", () => {
|
|
2790
2809
|
Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
|
|
2791
2810
|
}), this.reloading = !0, this.loadRule(), this.reloading = !1, this.refresh(), this.vm.$emit("reloading", this.api);
|
|
2792
|
-
}), this.
|
|
2811
|
+
}), this.vm.$emit("update", this.api);
|
|
2793
2812
|
},
|
|
2794
2813
|
//todo 组件生成全部通过 alias
|
|
2795
2814
|
refresh() {
|
|
@@ -2797,30 +2816,30 @@ function yr(t) {
|
|
|
2797
2816
|
}
|
|
2798
2817
|
});
|
|
2799
2818
|
}
|
|
2800
|
-
function
|
|
2801
|
-
const e =
|
|
2819
|
+
function mr(t) {
|
|
2820
|
+
const e = nt();
|
|
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 yr(t) {
|
|
2807
2826
|
const e = t.rule.control || [];
|
|
2808
|
-
return
|
|
2827
|
+
return f.Object(e) ? [e] : e;
|
|
2809
2828
|
}
|
|
2810
|
-
function
|
|
2829
|
+
function gr(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 Be(t) {
|
|
2818
2837
|
return !!t.rule.__ctrl;
|
|
2819
2838
|
}
|
|
2820
|
-
function
|
|
2821
|
-
|
|
2839
|
+
function $r(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 Ne(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
|
+
Ne(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, Le) !== JSON.stringify(r === null ? void 0 : r, Le);
|
|
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 Le(t, e) {
|
|
2920
2939
|
return typeof e == "function" ? "" + e : e;
|
|
2921
2940
|
}
|
|
2922
|
-
function
|
|
2941
|
+
function Ne(t) {
|
|
2923
2942
|
Object.keys(t).forEach((e) => delete t[e]);
|
|
2924
2943
|
}
|
|
2925
|
-
const
|
|
2944
|
+
const he = {
|
|
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
|
+
}, vr = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "component", "cache"];
|
|
2964
|
+
function br(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] || he;
|
|
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] !== "$" && vr.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 Cr(t) {
|
|
3058
|
+
p(t.prototype, {
|
|
3040
3059
|
mounted() {
|
|
3041
3060
|
const e = () => {
|
|
3042
3061
|
this.isMounted = !0, this.lifecycle("mounted");
|
|
@@ -3046,23 +3065,26 @@ function Or(t) {
|
|
|
3046
3065
|
lifecycle(e) {
|
|
3047
3066
|
this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3048
3067
|
},
|
|
3068
|
+
targetReload() {
|
|
3069
|
+
this.bus.$off("next-tick", this.nextReload), this.bus.$once("next-tick", this.nextReload);
|
|
3070
|
+
},
|
|
3049
3071
|
emitEvent(e, ...r) {
|
|
3050
|
-
const i = this.options[e] || this.options[
|
|
3072
|
+
const i = this.options[e] || this.options[R("on-" + e)];
|
|
3051
3073
|
if (i) {
|
|
3052
|
-
const s =
|
|
3053
|
-
|
|
3074
|
+
const s = M(i);
|
|
3075
|
+
f.Function(s) && E(() => s(...r));
|
|
3054
3076
|
}
|
|
3055
3077
|
this.bus.$emit(e, ...r);
|
|
3056
3078
|
}
|
|
3057
3079
|
});
|
|
3058
3080
|
}
|
|
3059
|
-
function
|
|
3060
|
-
|
|
3081
|
+
function _r(t) {
|
|
3082
|
+
p(t.prototype, {
|
|
3061
3083
|
useProvider() {
|
|
3062
3084
|
const e = this.fc.providers;
|
|
3063
3085
|
Object.keys(e).forEach((r) => {
|
|
3064
3086
|
let i = e[r];
|
|
3065
|
-
|
|
3087
|
+
f.Function(i) && (i = i(this.fc)), i._c = kr(i), this.onEffect(i), this.providers[r] = i;
|
|
3066
3088
|
});
|
|
3067
3089
|
},
|
|
3068
3090
|
onEffect(e) {
|
|
@@ -3079,7 +3101,7 @@ function kr(t) {
|
|
|
3079
3101
|
let i = {
|
|
3080
3102
|
required: () => {
|
|
3081
3103
|
var s, n;
|
|
3082
|
-
return (
|
|
3104
|
+
return (k(e.rule, "$required") ? e.rule.$required : (n = (s = e.rule) == null ? void 0 : s.effect) == null ? void 0 : n.required) || !1;
|
|
3083
3105
|
}
|
|
3084
3106
|
};
|
|
3085
3107
|
Object.keys(e.rule.effect || {}).forEach((s) => {
|
|
@@ -3109,9 +3131,9 @@ function kr(t) {
|
|
|
3109
3131
|
}, r);
|
|
3110
3132
|
},
|
|
3111
3133
|
getEffect(e, r) {
|
|
3112
|
-
if (
|
|
3134
|
+
if (k(e, "$" + r))
|
|
3113
3135
|
return e["$" + r];
|
|
3114
|
-
if (
|
|
3136
|
+
if (k(e, "effect") && k(e.effect, r))
|
|
3115
3137
|
return e.effect[r];
|
|
3116
3138
|
},
|
|
3117
3139
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
@@ -3120,33 +3142,33 @@ function kr(t) {
|
|
|
3120
3142
|
Object.keys(u).forEach((l) => {
|
|
3121
3143
|
const c = this.providers[l];
|
|
3122
3144
|
if (!c || c.input && !i) return;
|
|
3123
|
-
let
|
|
3145
|
+
let m;
|
|
3124
3146
|
if (!c._c)
|
|
3125
|
-
|
|
3147
|
+
m = "*";
|
|
3126
3148
|
else if (c._used.indexOf(s) > -1)
|
|
3127
|
-
|
|
3149
|
+
m = s;
|
|
3128
3150
|
else
|
|
3129
3151
|
return;
|
|
3130
|
-
const
|
|
3131
|
-
e && (
|
|
3152
|
+
const v = y({ value: u[l], getValue: () => this.getEffect(r, l) }, a || {});
|
|
3153
|
+
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
3154
|
});
|
|
3133
3155
|
}
|
|
3134
3156
|
});
|
|
3135
3157
|
}
|
|
3136
|
-
function
|
|
3158
|
+
function Or(t) {
|
|
3137
3159
|
return t.filter(function(e, r, i) {
|
|
3138
3160
|
return i.indexOf(e, 0) === r;
|
|
3139
3161
|
});
|
|
3140
3162
|
}
|
|
3141
|
-
function
|
|
3163
|
+
function kr(t) {
|
|
3142
3164
|
const e = t.components;
|
|
3143
3165
|
if (Array.isArray(e)) {
|
|
3144
|
-
const r =
|
|
3166
|
+
const r = Or(e.filter((i) => i !== "*"));
|
|
3145
3167
|
return r.length ? r : !1;
|
|
3146
|
-
} else return
|
|
3168
|
+
} else return f.String(e) ? [e] : !1;
|
|
3147
3169
|
}
|
|
3148
|
-
function
|
|
3149
|
-
|
|
3170
|
+
function A(t) {
|
|
3171
|
+
p(this, {
|
|
3150
3172
|
fc: t,
|
|
3151
3173
|
vm: t.vm,
|
|
3152
3174
|
watching: !1,
|
|
@@ -3168,18 +3190,18 @@ function V(t) {
|
|
|
3168
3190
|
nextReload: () => {
|
|
3169
3191
|
this.lifecycle("reload");
|
|
3170
3192
|
}
|
|
3171
|
-
}),
|
|
3193
|
+
}), it(this, {
|
|
3172
3194
|
options() {
|
|
3173
3195
|
return t.options;
|
|
3174
3196
|
},
|
|
3175
3197
|
bus() {
|
|
3176
3198
|
return t.bus;
|
|
3177
3199
|
}
|
|
3178
|
-
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new
|
|
3200
|
+
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new $e(this), this.api = t.extendApi(nr(this), this);
|
|
3179
3201
|
}
|
|
3180
|
-
|
|
3202
|
+
p(A.prototype, {
|
|
3181
3203
|
initData(t) {
|
|
3182
|
-
|
|
3204
|
+
p(this, {
|
|
3183
3205
|
ctxs: {},
|
|
3184
3206
|
fieldCtx: {},
|
|
3185
3207
|
nameCtx: {},
|
|
@@ -3193,54 +3215,54 @@ m(V.prototype, {
|
|
|
3193
3215
|
beforeFetch(t) {
|
|
3194
3216
|
return new Promise((e) => {
|
|
3195
3217
|
const r = this.options.beforeFetch && E(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3196
|
-
r &&
|
|
3218
|
+
r && f.Function(r.then) ? r.then(e) : e();
|
|
3197
3219
|
});
|
|
3198
3220
|
}
|
|
3199
3221
|
});
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
const
|
|
3209
|
-
name:
|
|
3222
|
+
ur(A);
|
|
3223
|
+
hr(A);
|
|
3224
|
+
cr(A);
|
|
3225
|
+
pr(A);
|
|
3226
|
+
$r(A);
|
|
3227
|
+
br(A);
|
|
3228
|
+
Cr(A);
|
|
3229
|
+
_r(A);
|
|
3230
|
+
const wr = "fcFragment", te = {
|
|
3231
|
+
name: wr,
|
|
3210
3232
|
functional: !0,
|
|
3211
3233
|
props: ["vnode"],
|
|
3212
3234
|
render(t, e) {
|
|
3213
3235
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3214
3236
|
}
|
|
3215
3237
|
};
|
|
3216
|
-
function
|
|
3217
|
-
return
|
|
3238
|
+
function Fr(t) {
|
|
3239
|
+
return f.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3218
3240
|
}
|
|
3219
|
-
function
|
|
3241
|
+
function Sr() {
|
|
3220
3242
|
const t = {};
|
|
3221
3243
|
function e(r) {
|
|
3222
3244
|
r && this.setVm(r);
|
|
3223
3245
|
}
|
|
3224
|
-
return
|
|
3246
|
+
return p(e.prototype, {
|
|
3225
3247
|
setVm(r) {
|
|
3226
3248
|
this.vm = r, this.$h = r.$createElement;
|
|
3227
3249
|
},
|
|
3228
3250
|
make(r, i, s) {
|
|
3229
|
-
return
|
|
3251
|
+
return P.config.isReservedTag(r) && i.nativeOn && delete i.nativeOn, this.makeComponent(r, i, s);
|
|
3230
3252
|
},
|
|
3231
3253
|
makeComponent(r, i, s) {
|
|
3232
|
-
let n = this.$h(r,
|
|
3254
|
+
let n = this.$h(r, Fr(i), s || []);
|
|
3233
3255
|
return n.context = this.vm, n;
|
|
3234
3256
|
},
|
|
3235
3257
|
aliasMap: t
|
|
3236
|
-
}),
|
|
3258
|
+
}), p(e, {
|
|
3237
3259
|
aliasMap: t,
|
|
3238
3260
|
alias(r, i) {
|
|
3239
3261
|
t[r] = i;
|
|
3240
3262
|
},
|
|
3241
3263
|
use(r) {
|
|
3242
3264
|
Object.keys(r).forEach((i) => {
|
|
3243
|
-
const s =
|
|
3265
|
+
const s = X(i), n = or(i).toLocaleLowerCase(), o = r[i];
|
|
3244
3266
|
[i, s, n].forEach((a) => {
|
|
3245
3267
|
e.alias(i, o), e.prototype[a] = function(u, l) {
|
|
3246
3268
|
return this.make(o, u, l);
|
|
@@ -3250,13 +3272,13 @@ function Er() {
|
|
|
3250
3272
|
}
|
|
3251
3273
|
}), e;
|
|
3252
3274
|
}
|
|
3253
|
-
function
|
|
3254
|
-
class e extends
|
|
3275
|
+
function Er(t) {
|
|
3276
|
+
class e extends ht {
|
|
3255
3277
|
}
|
|
3256
3278
|
return Object.assign(e.prototype, t), e;
|
|
3257
3279
|
}
|
|
3258
|
-
function
|
|
3259
|
-
|
|
3280
|
+
function ht(t) {
|
|
3281
|
+
p(this, {
|
|
3260
3282
|
$handle: t,
|
|
3261
3283
|
vm: t.vm,
|
|
3262
3284
|
options: {},
|
|
@@ -3266,12 +3288,12 @@ function ct(t) {
|
|
|
3266
3288
|
}
|
|
3267
3289
|
}), this.updateKey(), this.init();
|
|
3268
3290
|
}
|
|
3269
|
-
|
|
3291
|
+
p(ht.prototype, {
|
|
3270
3292
|
__init() {
|
|
3271
3293
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3272
3294
|
},
|
|
3273
3295
|
updateKey() {
|
|
3274
|
-
this.key =
|
|
3296
|
+
this.key = ee();
|
|
3275
3297
|
},
|
|
3276
3298
|
//TODO interface
|
|
3277
3299
|
init() {
|
|
@@ -3293,7 +3315,7 @@ m(ct.prototype, {
|
|
|
3293
3315
|
return e(this.vm);
|
|
3294
3316
|
},
|
|
3295
3317
|
mergeOptions(t, e) {
|
|
3296
|
-
return
|
|
3318
|
+
return D(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3297
3319
|
},
|
|
3298
3320
|
updateOptions(t) {
|
|
3299
3321
|
this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3311,20 +3333,20 @@ m(ct.prototype, {
|
|
|
3311
3333
|
render(t) {
|
|
3312
3334
|
}
|
|
3313
3335
|
});
|
|
3314
|
-
const
|
|
3336
|
+
const Rr = function(t) {
|
|
3315
3337
|
const e = {
|
|
3316
3338
|
name: "loadData",
|
|
3317
3339
|
_fn: [],
|
|
3318
3340
|
created(r, i, s) {
|
|
3319
3341
|
this.deleted(r);
|
|
3320
|
-
let n =
|
|
3342
|
+
let n = I(r.getValue());
|
|
3321
3343
|
const o = [];
|
|
3322
3344
|
n.forEach((a) => {
|
|
3323
3345
|
if (a) {
|
|
3324
3346
|
const u = () => {
|
|
3325
3347
|
a.watch !== !1 && (t.bus.$off("p.loadData." + a.attr, u), t.bus.$once("p.loadData." + a.attr, u));
|
|
3326
3348
|
let l;
|
|
3327
|
-
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l =
|
|
3349
|
+
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l = B(l))), Q(r.getProp(), a.to || "options", l), s.sync(i);
|
|
3328
3350
|
};
|
|
3329
3351
|
o.push(() => t.bus.$off("p.loadData." + a.attr, u)), u();
|
|
3330
3352
|
}
|
|
@@ -3337,13 +3359,13 @@ const jr = function(t) {
|
|
|
3337
3359
|
}
|
|
3338
3360
|
};
|
|
3339
3361
|
return e.watch = e.created, e;
|
|
3340
|
-
},
|
|
3362
|
+
}, ft = {
|
|
3341
3363
|
name: "componentValidate",
|
|
3342
3364
|
load(t, e, r) {
|
|
3343
3365
|
const i = t.getValue();
|
|
3344
3366
|
i ? t.getProp().validate = [{
|
|
3345
3367
|
validator(...s) {
|
|
3346
|
-
const n =
|
|
3368
|
+
const n = K(e);
|
|
3347
3369
|
if (n)
|
|
3348
3370
|
return r.exec(n.id, i === !0 ? "formCreateValidate" : i, ...s, {
|
|
3349
3371
|
attr: t,
|
|
@@ -3354,48 +3376,48 @@ const jr = function(t) {
|
|
|
3354
3376
|
}] : (t.clearProp(), r.clearValidateState([e.field]));
|
|
3355
3377
|
},
|
|
3356
3378
|
watch(...t) {
|
|
3357
|
-
|
|
3379
|
+
ft.load(...t);
|
|
3358
3380
|
}
|
|
3359
|
-
},
|
|
3381
|
+
}, Ir = function(t) {
|
|
3360
3382
|
function e(i) {
|
|
3361
|
-
return
|
|
3383
|
+
return f.String(i) && (i = {
|
|
3362
3384
|
action: i,
|
|
3363
3385
|
to: "options"
|
|
3364
3386
|
}), i;
|
|
3365
3387
|
}
|
|
3366
3388
|
function r(i, s, n) {
|
|
3367
3389
|
let o = i.value;
|
|
3368
|
-
const a = (
|
|
3369
|
-
|
|
3390
|
+
const a = (m) => {
|
|
3391
|
+
m === void 0 ? (i.clearProp(), n.sync(s)) : Q(i.getProp(), o.to || "options", m);
|
|
3370
3392
|
};
|
|
3371
|
-
if (
|
|
3393
|
+
if (f.Function(o) && (o = o(s, n)), o = e(o), !o || !o.action) {
|
|
3372
3394
|
a(void 0);
|
|
3373
3395
|
return;
|
|
3374
3396
|
}
|
|
3375
|
-
o =
|
|
3397
|
+
o = B(o), o.to || (o.to = "options");
|
|
3376
3398
|
const u = o.onError, l = () => {
|
|
3377
3399
|
if (!i.getValue())
|
|
3378
3400
|
return i.clearProp(), n.sync(s), !0;
|
|
3379
|
-
}, c =
|
|
3401
|
+
}, c = q(y({
|
|
3380
3402
|
headers: {}
|
|
3381
3403
|
}, o), {
|
|
3382
|
-
onSuccess(
|
|
3404
|
+
onSuccess(m, v) {
|
|
3383
3405
|
if (l()) return;
|
|
3384
|
-
let
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
}),
|
|
3406
|
+
let _ = (g) => v ? g : k(g, "data") ? g.data : g;
|
|
3407
|
+
f.Function(o.parse) ? _ = o.parse : o.parse && f.String(o.parse) && (_ = (g) => (o.parse.split(".").forEach((O) => {
|
|
3408
|
+
g && (g = g[O]);
|
|
3409
|
+
}), g)), a(_(m, s, n)), n.sync(s);
|
|
3388
3410
|
},
|
|
3389
|
-
onError(
|
|
3390
|
-
a(void 0), !l() && (u || ((
|
|
3411
|
+
onError(m) {
|
|
3412
|
+
a(void 0), !l() && (u || ((v) => me(v.message || "fetch fail " + o.action)))(m, s, n);
|
|
3391
3413
|
}
|
|
3392
3414
|
});
|
|
3393
3415
|
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(
|
|
3416
|
+
if (f.Function(o.action)) {
|
|
3417
|
+
o.action(s, n).then((m) => {
|
|
3418
|
+
c.onSuccess(m, !0);
|
|
3419
|
+
}).catch((m) => {
|
|
3420
|
+
c.onError(m);
|
|
3399
3421
|
});
|
|
3400
3422
|
return;
|
|
3401
3423
|
}
|
|
@@ -3411,17 +3433,17 @@ const jr = function(t) {
|
|
|
3411
3433
|
r(...i);
|
|
3412
3434
|
}
|
|
3413
3435
|
};
|
|
3414
|
-
},
|
|
3436
|
+
}, ct = {
|
|
3415
3437
|
name: "required",
|
|
3416
3438
|
load(t, e, r) {
|
|
3417
|
-
const i =
|
|
3439
|
+
const i = jr(t.getValue());
|
|
3418
3440
|
if (i.required === !1)
|
|
3419
3441
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
3420
3442
|
else {
|
|
3421
3443
|
const s = y({
|
|
3422
3444
|
required: !0,
|
|
3423
3445
|
validator(n, o, a) {
|
|
3424
|
-
|
|
3446
|
+
f.empty(o) ? a(s.message) : a();
|
|
3425
3447
|
}
|
|
3426
3448
|
}, i);
|
|
3427
3449
|
if (!s.message) {
|
|
@@ -3433,39 +3455,39 @@ const jr = function(t) {
|
|
|
3433
3455
|
r.sync(e);
|
|
3434
3456
|
},
|
|
3435
3457
|
watch(...t) {
|
|
3436
|
-
|
|
3458
|
+
ct.load(...t);
|
|
3437
3459
|
}
|
|
3438
3460
|
};
|
|
3439
|
-
function
|
|
3440
|
-
return
|
|
3461
|
+
function jr(t) {
|
|
3462
|
+
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
3463
|
}
|
|
3442
|
-
const
|
|
3443
|
-
fetch:
|
|
3444
|
-
loadData:
|
|
3445
|
-
required:
|
|
3446
|
-
componentValidate:
|
|
3447
|
-
},
|
|
3448
|
-
name:
|
|
3464
|
+
const Ar = {
|
|
3465
|
+
fetch: Ir,
|
|
3466
|
+
loadData: Rr,
|
|
3467
|
+
required: ct,
|
|
3468
|
+
componentValidate: ft
|
|
3469
|
+
}, Vr = "html", Pr = {
|
|
3470
|
+
name: Vr,
|
|
3449
3471
|
loadChildren: !1,
|
|
3450
3472
|
render(t, e) {
|
|
3451
3473
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
3452
3474
|
},
|
|
3453
3475
|
renderChildren(t) {
|
|
3454
|
-
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) =>
|
|
3476
|
+
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) => f.String(e)).join("") : "";
|
|
3455
3477
|
}
|
|
3456
3478
|
};
|
|
3457
|
-
function
|
|
3479
|
+
function Dr(t, e) {
|
|
3458
3480
|
let r;
|
|
3459
3481
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
3460
3482
|
}
|
|
3461
|
-
function
|
|
3462
|
-
return
|
|
3483
|
+
function re() {
|
|
3484
|
+
return Dr("name", ...arguments);
|
|
3463
3485
|
}
|
|
3464
|
-
function
|
|
3465
|
-
return !t || !t.el ? window.document.body :
|
|
3486
|
+
function Me(t) {
|
|
3487
|
+
return !t || !t.el ? window.document.body : f.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
3466
3488
|
}
|
|
3467
|
-
function
|
|
3468
|
-
const r = new
|
|
3489
|
+
function Ue(t, e) {
|
|
3490
|
+
const r = new P({
|
|
3469
3491
|
data() {
|
|
3470
3492
|
return { rule: t, option: e || {} };
|
|
3471
3493
|
},
|
|
@@ -3475,141 +3497,141 @@ function He(t, e) {
|
|
|
3475
3497
|
});
|
|
3476
3498
|
return r.$mount(), r;
|
|
3477
3499
|
}
|
|
3478
|
-
function
|
|
3500
|
+
function Tr(t) {
|
|
3479
3501
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
3480
|
-
|
|
3502
|
+
Ye.push(...e), ce.push(...r), de.push(...i), st([...e, ...r, ...i]);
|
|
3481
3503
|
}
|
|
3482
|
-
let
|
|
3483
|
-
const
|
|
3484
|
-
function
|
|
3504
|
+
let Br = 1;
|
|
3505
|
+
const S = {};
|
|
3506
|
+
function dt(t) {
|
|
3485
3507
|
const e = {
|
|
3486
|
-
[
|
|
3487
|
-
}, r = {}, i = {}, s = y({},
|
|
3508
|
+
[te.name]: te
|
|
3509
|
+
}, r = {}, i = {}, s = y({}, Ar), n = tr();
|
|
3488
3510
|
let o = { global: {} };
|
|
3489
|
-
const a = {}, u =
|
|
3490
|
-
|
|
3491
|
-
function c(
|
|
3492
|
-
const d =
|
|
3511
|
+
const a = {}, u = Sr(), l = {};
|
|
3512
|
+
Tr(t.attrs || {});
|
|
3513
|
+
function c(h) {
|
|
3514
|
+
const d = S[h];
|
|
3493
3515
|
if (Array.isArray(d))
|
|
3494
|
-
return d.map((
|
|
3516
|
+
return d.map(($) => $.api());
|
|
3495
3517
|
if (d)
|
|
3496
3518
|
return d.api();
|
|
3497
3519
|
}
|
|
3498
|
-
function
|
|
3499
|
-
const
|
|
3500
|
-
|
|
3520
|
+
function m() {
|
|
3521
|
+
const h = re(...arguments);
|
|
3522
|
+
h.id && h.prop && (i[h.id] = h.prop);
|
|
3501
3523
|
}
|
|
3502
|
-
function
|
|
3503
|
-
const
|
|
3504
|
-
|
|
3524
|
+
function v() {
|
|
3525
|
+
const h = re(...arguments);
|
|
3526
|
+
h.id && h.prop && (s[h.id] = q(y({}, h.prop), { name: h.id }));
|
|
3505
3527
|
}
|
|
3506
|
-
function
|
|
3507
|
-
u.use(
|
|
3528
|
+
function _(h) {
|
|
3529
|
+
u.use(h);
|
|
3508
3530
|
}
|
|
3509
|
-
function
|
|
3510
|
-
const
|
|
3511
|
-
if (!
|
|
3512
|
-
const d =
|
|
3513
|
-
r[d] =
|
|
3531
|
+
function g() {
|
|
3532
|
+
const h = re(...arguments);
|
|
3533
|
+
if (!h.id || !h.prop) return he;
|
|
3534
|
+
const d = R(h.id), $ = h.prop, b = $.merge === !0 ? r[d] : void 0;
|
|
3535
|
+
r[d] = $, Object.setPrototypeOf($, b || he), n[d] = F(d), $.maker && p(n, $.maker);
|
|
3514
3536
|
}
|
|
3515
|
-
function
|
|
3516
|
-
let
|
|
3517
|
-
if (
|
|
3518
|
-
if (
|
|
3519
|
-
return
|
|
3537
|
+
function O(h, d) {
|
|
3538
|
+
let $;
|
|
3539
|
+
if (f.String(h)) {
|
|
3540
|
+
if ($ = R(h), ["form-create", "formcreate"].indexOf($) > -1)
|
|
3541
|
+
return W();
|
|
3520
3542
|
if (d === void 0)
|
|
3521
|
-
return e[
|
|
3543
|
+
return e[$];
|
|
3522
3544
|
} else
|
|
3523
|
-
|
|
3524
|
-
if (
|
|
3525
|
-
const
|
|
3526
|
-
e[
|
|
3545
|
+
$ = R(h.name), d = h;
|
|
3546
|
+
if (!$ || !d) return;
|
|
3547
|
+
const b = R($);
|
|
3548
|
+
e[$] = d, e[b] = d, delete u.aliasMap[$], delete u.aliasMap[b], delete r[$], delete r[b], d.formCreateParser && g($, d.formCreateParser);
|
|
3527
3549
|
}
|
|
3528
|
-
function
|
|
3529
|
-
Object.keys(
|
|
3530
|
-
(Array.isArray(
|
|
3531
|
-
|
|
3550
|
+
function ve(h) {
|
|
3551
|
+
Object.keys(S).forEach((d) => {
|
|
3552
|
+
(Array.isArray(S[d]) ? S[d] : [S[d]]).forEach((b) => {
|
|
3553
|
+
b.bus.$emit("p.loadData." + h);
|
|
3532
3554
|
});
|
|
3533
3555
|
});
|
|
3534
3556
|
}
|
|
3535
|
-
function
|
|
3536
|
-
a[
|
|
3557
|
+
function be(h, d) {
|
|
3558
|
+
a[h] = d, ve(h);
|
|
3537
3559
|
}
|
|
3538
|
-
function
|
|
3539
|
-
return
|
|
3560
|
+
function Ce(h, d) {
|
|
3561
|
+
return k(a, h) ? a[h] : d;
|
|
3540
3562
|
}
|
|
3541
|
-
function
|
|
3542
|
-
delete a[
|
|
3563
|
+
function pt(h) {
|
|
3564
|
+
delete a[h], ve(h);
|
|
3543
3565
|
}
|
|
3544
|
-
function
|
|
3545
|
-
return
|
|
3566
|
+
function W() {
|
|
3567
|
+
return xt(Oe, e, i);
|
|
3546
3568
|
}
|
|
3547
|
-
function
|
|
3548
|
-
return
|
|
3569
|
+
function _e() {
|
|
3570
|
+
return te;
|
|
3549
3571
|
}
|
|
3550
|
-
function
|
|
3551
|
-
return
|
|
3572
|
+
function mt(h, d) {
|
|
3573
|
+
return f.Function(h.install) ? h.install(N, d) : f.Function(h) && h(N, d), this;
|
|
3552
3574
|
}
|
|
3553
|
-
function
|
|
3554
|
-
let
|
|
3555
|
-
const
|
|
3556
|
-
return
|
|
3575
|
+
function N(h, d, $) {
|
|
3576
|
+
let b = Ue(h, d || {});
|
|
3577
|
+
const j = b.$refs.fc.formCreate;
|
|
3578
|
+
return j.$parent = $, Me(j.options).appendChild(b.$el), j.api();
|
|
3557
3579
|
}
|
|
3558
|
-
Object.setPrototypeOf(
|
|
3559
|
-
function
|
|
3580
|
+
Object.setPrototypeOf(N, l);
|
|
3581
|
+
function yt(h) {
|
|
3560
3582
|
let d = y({}, t);
|
|
3561
|
-
return
|
|
3583
|
+
return h ? d.inherit = {
|
|
3562
3584
|
components: e,
|
|
3563
3585
|
parsers: r,
|
|
3564
3586
|
directives: i,
|
|
3565
3587
|
providers: s,
|
|
3566
3588
|
maker: n,
|
|
3567
3589
|
loadData: a
|
|
3568
|
-
} : delete d.inherit,
|
|
3590
|
+
} : delete d.inherit, dt(d);
|
|
3569
3591
|
}
|
|
3570
|
-
function
|
|
3571
|
-
const d =
|
|
3572
|
-
|
|
3573
|
-
id:
|
|
3574
|
-
vm:
|
|
3575
|
-
create:
|
|
3576
|
-
manager:
|
|
3592
|
+
function Oe(h) {
|
|
3593
|
+
const d = h.$options.propsData.rule;
|
|
3594
|
+
p(this, {
|
|
3595
|
+
id: Br++,
|
|
3596
|
+
vm: h,
|
|
3597
|
+
create: N,
|
|
3598
|
+
manager: Er(t.manager),
|
|
3577
3599
|
parsers: r,
|
|
3578
3600
|
providers: s,
|
|
3579
3601
|
rules: Array.isArray(d) ? d : [],
|
|
3580
|
-
name:
|
|
3581
|
-
inFor:
|
|
3602
|
+
name: h.$options.propsData.name || ee(),
|
|
3603
|
+
inFor: h.$options.propsData.inFor,
|
|
3582
3604
|
prop: {
|
|
3583
3605
|
components: e,
|
|
3584
3606
|
directives: i
|
|
3585
3607
|
},
|
|
3586
|
-
setData:
|
|
3587
|
-
getData:
|
|
3608
|
+
setData: be,
|
|
3609
|
+
getData: Ce,
|
|
3588
3610
|
loadData: a,
|
|
3589
3611
|
CreateNode: u,
|
|
3590
|
-
bus: new
|
|
3612
|
+
bus: new P(),
|
|
3591
3613
|
unwatch: null,
|
|
3592
3614
|
options: {},
|
|
3593
|
-
extendApi: t.extendApi || ((
|
|
3594
|
-
}), this.init(), this.initOptions(), this.name && (this.inFor ? (
|
|
3615
|
+
extendApi: t.extendApi || (($) => $)
|
|
3616
|
+
}), this.init(), this.initOptions(), this.name && (this.inFor ? (S[this.name] || (S[this.name] = []), S[this.name].push(this)) : S[this.name] = this);
|
|
3595
3617
|
}
|
|
3596
|
-
|
|
3618
|
+
p(Oe.prototype, {
|
|
3597
3619
|
init() {
|
|
3598
|
-
const
|
|
3599
|
-
this.$handle = d,
|
|
3600
|
-
this.isSub() && (this.unwatch =
|
|
3601
|
-
this.initOptions(),
|
|
3620
|
+
const h = this.vm, d = new A(this);
|
|
3621
|
+
this.$handle = d, h.$f = d.api, h.$emit("input", d.api), h.$on("hook:created", () => {
|
|
3622
|
+
this.isSub() && (this.unwatch = h.$watch(() => h.$pfc.option, () => {
|
|
3623
|
+
this.initOptions(), h.$f.refresh();
|
|
3602
3624
|
}, { deep: !0 }), this.initOptions()), this.created();
|
|
3603
|
-
}),
|
|
3625
|
+
}), h.$on("hook:mounted", () => {
|
|
3604
3626
|
this.mounted();
|
|
3605
|
-
}),
|
|
3606
|
-
if (
|
|
3627
|
+
}), h.$on("hook:beforeDestroy", () => {
|
|
3628
|
+
if (h.destroyed = !0, this.unwatch && this.unwatch(), d.reloadRule([]), this.name)
|
|
3607
3629
|
if (this.inFor) {
|
|
3608
|
-
const
|
|
3609
|
-
|
|
3630
|
+
const $ = S[this.name].indexOf(this);
|
|
3631
|
+
S[this.name].splice($, 1), S[this.name].length || delete S[this.name];
|
|
3610
3632
|
} else
|
|
3611
|
-
delete
|
|
3612
|
-
}),
|
|
3633
|
+
delete S[this.name];
|
|
3634
|
+
}), h.$on("hook:updated", () => {
|
|
3613
3635
|
d.bindNextTick(() => this.bus.$emit("next-tick", d.api));
|
|
3614
3636
|
});
|
|
3615
3637
|
},
|
|
@@ -3618,16 +3640,16 @@ function mt(t) {
|
|
|
3618
3640
|
},
|
|
3619
3641
|
initOptions() {
|
|
3620
3642
|
this.options = {};
|
|
3621
|
-
let
|
|
3622
|
-
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0),
|
|
3643
|
+
let h = y({ formData: {}, submitBtn: {}, resetBtn: {} }, B(o));
|
|
3644
|
+
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
3645
|
},
|
|
3624
|
-
mergeOptions(
|
|
3625
|
-
return d =
|
|
3626
|
-
delete d[
|
|
3627
|
-
}), d.global && (
|
|
3646
|
+
mergeOptions(h, d, $) {
|
|
3647
|
+
return d = B(d), $ && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el"].forEach((b) => {
|
|
3648
|
+
delete d[b];
|
|
3649
|
+
}), d.global && (h.global = Yt(h.global, d.global), delete d.global), this.$handle.$manager.mergeOptions([d], h), h;
|
|
3628
3650
|
},
|
|
3629
|
-
updateOptions(
|
|
3630
|
-
this.mergeOptions(this.options,
|
|
3651
|
+
updateOptions(h) {
|
|
3652
|
+
this.mergeOptions(this.options, h), this.$handle.$manager.updateOptions(this.options);
|
|
3631
3653
|
},
|
|
3632
3654
|
created() {
|
|
3633
3655
|
this.$handle.init(), this.vm.$emit("created", this.api());
|
|
@@ -3642,92 +3664,92 @@ function mt(t) {
|
|
|
3642
3664
|
this.$handle.mounted();
|
|
3643
3665
|
}
|
|
3644
3666
|
});
|
|
3645
|
-
function
|
|
3646
|
-
|
|
3667
|
+
function ke(h) {
|
|
3668
|
+
p(h, {
|
|
3647
3669
|
version: t.version,
|
|
3648
3670
|
ui: t.ui,
|
|
3649
|
-
setData:
|
|
3650
|
-
getData:
|
|
3651
|
-
removeData:
|
|
3671
|
+
setData: be,
|
|
3672
|
+
getData: Ce,
|
|
3673
|
+
removeData: pt,
|
|
3652
3674
|
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:
|
|
3675
|
+
component: O,
|
|
3676
|
+
directive: m,
|
|
3677
|
+
register: v,
|
|
3678
|
+
$vnode: _e,
|
|
3679
|
+
parser: g,
|
|
3680
|
+
use: mt,
|
|
3681
|
+
factory: yt,
|
|
3682
|
+
componentAlias: _,
|
|
3683
|
+
copyRule: ye,
|
|
3684
|
+
copyRules: rt,
|
|
3685
|
+
fetch: at,
|
|
3686
|
+
$form: W,
|
|
3687
|
+
parseFn: M,
|
|
3688
|
+
parseJson: Zt,
|
|
3689
|
+
toJson: et,
|
|
3668
3690
|
getApi: c,
|
|
3669
|
-
init(d,
|
|
3670
|
-
let
|
|
3691
|
+
init(d, $ = {}) {
|
|
3692
|
+
let b = Ue(d, $), j = b.$refs.fc.formCreate;
|
|
3671
3693
|
return {
|
|
3672
|
-
mount(
|
|
3673
|
-
return
|
|
3694
|
+
mount(H) {
|
|
3695
|
+
return H && f.Element(H) && (j.options.el = H), Me(j.options).appendChild(b.$el), j.api();
|
|
3674
3696
|
},
|
|
3675
3697
|
remove() {
|
|
3676
|
-
|
|
3698
|
+
b.$el.parentNode && b.$el.parentNode.removeChild(b.$el);
|
|
3677
3699
|
},
|
|
3678
3700
|
destroy() {
|
|
3679
|
-
this.remove(),
|
|
3701
|
+
this.remove(), b.$destroy();
|
|
3680
3702
|
},
|
|
3681
|
-
$f:
|
|
3703
|
+
$f: j.api()
|
|
3682
3704
|
};
|
|
3683
3705
|
}
|
|
3684
3706
|
});
|
|
3685
3707
|
}
|
|
3686
|
-
function
|
|
3687
|
-
|
|
3688
|
-
create:
|
|
3689
|
-
install(d,
|
|
3690
|
-
if (o = y(y({}, o),
|
|
3708
|
+
function gt(h) {
|
|
3709
|
+
p(h, {
|
|
3710
|
+
create: N,
|
|
3711
|
+
install(d, $) {
|
|
3712
|
+
if (o = y(y({}, o), $ || {}), d._installedFormCreate === !0) return;
|
|
3691
3713
|
d._installedFormCreate = !0;
|
|
3692
|
-
const
|
|
3693
|
-
return
|
|
3714
|
+
const b = function(j, H = {}) {
|
|
3715
|
+
return N(j, H, this);
|
|
3694
3716
|
};
|
|
3695
|
-
|
|
3717
|
+
ke(b), d.prototype.$formCreate = b, d.component("FormCreate", W()), d.component("FcFragment", _e());
|
|
3696
3718
|
}
|
|
3697
3719
|
});
|
|
3698
3720
|
}
|
|
3699
|
-
if (
|
|
3700
|
-
const
|
|
3701
|
-
|
|
3721
|
+
if (ke(l), gt(l), u.use({ fragment: "fcFragment" }), g(Pr), t.install && N.use(t), t.inherit) {
|
|
3722
|
+
const h = t.inherit;
|
|
3723
|
+
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
3724
|
}
|
|
3703
|
-
const
|
|
3704
|
-
return Object.setPrototypeOf(
|
|
3725
|
+
const x = W();
|
|
3726
|
+
return Object.setPrototypeOf(x, l), Object.defineProperties(x, {
|
|
3705
3727
|
fetch: {
|
|
3706
3728
|
get() {
|
|
3707
3729
|
return l.fetch;
|
|
3708
3730
|
},
|
|
3709
|
-
set(
|
|
3710
|
-
l.fetch =
|
|
3731
|
+
set(h) {
|
|
3732
|
+
l.fetch = h;
|
|
3711
3733
|
}
|
|
3712
3734
|
}
|
|
3713
|
-
}),
|
|
3735
|
+
}), x.util = l, x;
|
|
3714
3736
|
}
|
|
3715
|
-
function
|
|
3716
|
-
if (
|
|
3737
|
+
function ie(t) {
|
|
3738
|
+
if (f.Date(t))
|
|
3717
3739
|
return t;
|
|
3718
3740
|
{
|
|
3719
3741
|
let e = new Date(t);
|
|
3720
3742
|
return e.toString() === "Invalid Date" ? t : e;
|
|
3721
3743
|
}
|
|
3722
3744
|
}
|
|
3723
|
-
const
|
|
3724
|
-
name:
|
|
3745
|
+
const qe = "datePicker", Lr = {
|
|
3746
|
+
name: qe,
|
|
3725
3747
|
maker: function() {
|
|
3726
|
-
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] =
|
|
3748
|
+
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = F(qe, { type: e.toLowerCase() }), t), {});
|
|
3727
3749
|
}(),
|
|
3728
3750
|
mergeProp(t) {
|
|
3729
3751
|
let e = t.prop.props;
|
|
3730
|
-
e.startDate && (e.startDate = e.startDate &&
|
|
3752
|
+
e.startDate && (e.startDate = e.startDate && ie(e.startDate));
|
|
3731
3753
|
},
|
|
3732
3754
|
isRange(t) {
|
|
3733
3755
|
return t.type.includes("range") || t.multiple;
|
|
@@ -3746,60 +3768,60 @@ const Je = "datePicker", Mr = {
|
|
|
3746
3768
|
return this.isRange(e.el) ? r : r[0];
|
|
3747
3769
|
} else {
|
|
3748
3770
|
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 ?
|
|
3771
|
+
return ["daterange", "datetimerange"].indexOf(n) !== -1 ? r ? s = t.map((o) => o ? ie(o) : "") : s = ["", ""] : n === "date" && i.multiple === !0 ? s = toString(t) : (s = r ? t[0] || "" : t, s = s ? ie(s) : ""), s;
|
|
3750
3772
|
}
|
|
3751
3773
|
},
|
|
3752
3774
|
mounted(t) {
|
|
3753
3775
|
t.rule.value = this.toValue(t.$handle.getFormData(t), t);
|
|
3754
3776
|
}
|
|
3755
|
-
},
|
|
3756
|
-
name:
|
|
3777
|
+
}, ne = "hidden", Nr = {
|
|
3778
|
+
name: ne,
|
|
3757
3779
|
maker: {
|
|
3758
|
-
[
|
|
3780
|
+
[ne]: (t, e) => F(ne)("", t, e)
|
|
3759
3781
|
},
|
|
3760
3782
|
render() {
|
|
3761
3783
|
return [];
|
|
3762
3784
|
}
|
|
3763
|
-
},
|
|
3764
|
-
name:
|
|
3785
|
+
}, se = "input", Mr = {
|
|
3786
|
+
name: se,
|
|
3765
3787
|
maker: function() {
|
|
3766
|
-
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] =
|
|
3767
|
-
return t.idate =
|
|
3788
|
+
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = F(se, { type: r }), e), {});
|
|
3789
|
+
return t.idate = F(se, { type: "date" }), t;
|
|
3768
3790
|
}(),
|
|
3769
3791
|
mergeProp(t) {
|
|
3770
3792
|
let { props: e } = t.prop;
|
|
3771
3793
|
e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
3772
3794
|
}
|
|
3773
|
-
},
|
|
3774
|
-
name:
|
|
3795
|
+
}, He = "slider", Ur = {
|
|
3796
|
+
name: He,
|
|
3775
3797
|
maker: {
|
|
3776
|
-
sliderRange:
|
|
3798
|
+
sliderRange: F(He, { range: !0 })
|
|
3777
3799
|
},
|
|
3778
3800
|
toFormValue(t, e) {
|
|
3779
3801
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
3780
3802
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
3781
3803
|
}
|
|
3782
|
-
},
|
|
3804
|
+
}, qr = {
|
|
3783
3805
|
name: "switch",
|
|
3784
3806
|
mergeProp(t) {
|
|
3785
3807
|
const e = t.prop.props.slot || {}, r = t.prop.scopedSlots || {};
|
|
3786
3808
|
e.open && (r.open = () => e.open), e.close && (r.close = () => e.close), t.prop.scopedSlots = r;
|
|
3787
3809
|
}
|
|
3788
|
-
},
|
|
3810
|
+
}, Hr = {
|
|
3789
3811
|
name: "FcRow",
|
|
3790
3812
|
render(t, e) {
|
|
3791
3813
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
3792
3814
|
e.vNode.row(e.prop, t)
|
|
3793
3815
|
]);
|
|
3794
3816
|
}
|
|
3795
|
-
},
|
|
3817
|
+
}, Jr = [
|
|
3818
|
+
Lr,
|
|
3819
|
+
Nr,
|
|
3796
3820
|
Mr,
|
|
3797
3821
|
Ur,
|
|
3798
3822
|
qr,
|
|
3799
|
-
Hr
|
|
3800
|
-
|
|
3801
|
-
zr
|
|
3802
|
-
], xr = {
|
|
3823
|
+
Hr
|
|
3824
|
+
], zr = {
|
|
3803
3825
|
button: "iButton",
|
|
3804
3826
|
icon: "Icon",
|
|
3805
3827
|
slider: "Slider",
|
|
@@ -3825,21 +3847,21 @@ const Je = "datePicker", Mr = {
|
|
|
3825
3847
|
group: "fcGroup",
|
|
3826
3848
|
subForm: "fcSubForm",
|
|
3827
3849
|
object: "fcSubForm"
|
|
3828
|
-
},
|
|
3850
|
+
}, Z = {
|
|
3829
3851
|
resetBtnType: "default",
|
|
3830
3852
|
resetBtnIcon: "md-refresh",
|
|
3831
3853
|
infoIcon: "ios-information-circle-outline"
|
|
3832
3854
|
};
|
|
3833
|
-
function
|
|
3855
|
+
function Wr() {
|
|
3834
3856
|
return {
|
|
3835
3857
|
type: "poptip",
|
|
3836
3858
|
trigger: "hover",
|
|
3837
3859
|
placement: "top-start",
|
|
3838
3860
|
wordWrap: !0,
|
|
3839
|
-
icon:
|
|
3861
|
+
icon: Z.infoIcon
|
|
3840
3862
|
};
|
|
3841
3863
|
}
|
|
3842
|
-
function
|
|
3864
|
+
function xr() {
|
|
3843
3865
|
return {
|
|
3844
3866
|
form: {
|
|
3845
3867
|
inline: !1,
|
|
@@ -3861,9 +3883,9 @@ function Kr() {
|
|
|
3861
3883
|
click: void 0
|
|
3862
3884
|
},
|
|
3863
3885
|
resetBtn: {
|
|
3864
|
-
type:
|
|
3886
|
+
type: Z.resetBtnType,
|
|
3865
3887
|
disabled: !1,
|
|
3866
|
-
icon:
|
|
3888
|
+
icon: Z.resetBtnIcon,
|
|
3867
3889
|
innerText: "重置",
|
|
3868
3890
|
loading: !1,
|
|
3869
3891
|
show: !1,
|
|
@@ -3871,16 +3893,16 @@ function Kr() {
|
|
|
3871
3893
|
}
|
|
3872
3894
|
};
|
|
3873
3895
|
}
|
|
3874
|
-
function
|
|
3875
|
-
|
|
3896
|
+
function Je(t, e) {
|
|
3897
|
+
k(t, e) && f.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
3876
3898
|
}
|
|
3877
|
-
function
|
|
3899
|
+
function V(t) {
|
|
3878
3900
|
return t === !1;
|
|
3879
3901
|
}
|
|
3880
|
-
function
|
|
3881
|
-
|
|
3902
|
+
function Gr(t, e) {
|
|
3903
|
+
k(t, e) && !f.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
3882
3904
|
}
|
|
3883
|
-
const
|
|
3905
|
+
const Kr = {
|
|
3884
3906
|
validate() {
|
|
3885
3907
|
const t = this.form();
|
|
3886
3908
|
return t ? new Promise((e, r) => {
|
|
@@ -3903,20 +3925,20 @@ const Qr = {
|
|
|
3903
3925
|
},
|
|
3904
3926
|
tidyOptions(t) {
|
|
3905
3927
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
3906
|
-
|
|
3928
|
+
Gr(t, e);
|
|
3907
3929
|
}), t;
|
|
3908
3930
|
},
|
|
3909
3931
|
tidyRule({ prop: t }) {
|
|
3910
|
-
return
|
|
3932
|
+
return Je(t, "title"), Je(t, "info"), t;
|
|
3911
3933
|
},
|
|
3912
3934
|
mergeProp(t) {
|
|
3913
|
-
t.prop =
|
|
3935
|
+
t.prop = D([{
|
|
3914
3936
|
info: this.options.info || {},
|
|
3915
3937
|
wrap: this.options.wrap || {},
|
|
3916
3938
|
col: this.options.col || {},
|
|
3917
3939
|
title: this.options.title || {}
|
|
3918
3940
|
}, t.prop], {
|
|
3919
|
-
info:
|
|
3941
|
+
info: Wr(),
|
|
3920
3942
|
title: {},
|
|
3921
3943
|
col: { span: 24 },
|
|
3922
3944
|
wrap: {}
|
|
@@ -3926,7 +3948,7 @@ const Qr = {
|
|
|
3926
3948
|
!t.size && this.options.form.size && (t.size = this.options.form.size);
|
|
3927
3949
|
},
|
|
3928
3950
|
getDefaultOptions() {
|
|
3929
|
-
return
|
|
3951
|
+
return xr();
|
|
3930
3952
|
},
|
|
3931
3953
|
update() {
|
|
3932
3954
|
const t = this.options.form;
|
|
@@ -3944,17 +3966,17 @@ const Qr = {
|
|
|
3944
3966
|
},
|
|
3945
3967
|
beforeRender() {
|
|
3946
3968
|
const { key: t, ref: e, $handle: r } = this;
|
|
3947
|
-
|
|
3969
|
+
p(this.rule, { key: t, ref: e }), p(this.rule.props, {
|
|
3948
3970
|
model: r.formData
|
|
3949
3971
|
// rules: $handle.validate(),
|
|
3950
3972
|
});
|
|
3951
3973
|
},
|
|
3952
3974
|
render(t) {
|
|
3953
|
-
return t.length && t.push(this.makeFormBtn()), this.$r(this.rule,
|
|
3975
|
+
return t.length && t.push(this.makeFormBtn()), this.$r(this.rule, V(this.options.row.show) ? t : [this.makeRow(t)]);
|
|
3954
3976
|
},
|
|
3955
3977
|
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:
|
|
3978
|
+
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, {
|
|
3979
|
+
props: q(y({
|
|
3958
3980
|
labelWidth: o
|
|
3959
3981
|
}, r.wrap || {}), {
|
|
3960
3982
|
prop: t.id,
|
|
@@ -3965,32 +3987,32 @@ const Qr = {
|
|
|
3965
3987
|
ref: t.wrapRef,
|
|
3966
3988
|
type: "formItem"
|
|
3967
3989
|
}]), [e, n ? this.makeInfo(r, i, t) : null]);
|
|
3968
|
-
return a === !0 ||
|
|
3990
|
+
return a === !0 || V(u) || V(s.show) ? l : this.makeCol(r, i, [l]);
|
|
3969
3991
|
},
|
|
3970
3992
|
isTitle(t) {
|
|
3971
3993
|
if (this.options.form.title === !1) return !1;
|
|
3972
3994
|
const e = t.title;
|
|
3973
|
-
return !(!e.title && !e.native ||
|
|
3995
|
+
return !(!e.title && !e.native || V(e.show));
|
|
3974
3996
|
},
|
|
3975
3997
|
makeInfo(t, e, r) {
|
|
3976
3998
|
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 (!
|
|
3999
|
+
if (!V(s.show) && (s.info || s.native) && !V(s.icon)) {
|
|
3978
4000
|
const a = {
|
|
3979
4001
|
type: s.type || "poptip",
|
|
3980
4002
|
props: y({}, s),
|
|
3981
4003
|
key: `${e}pop`,
|
|
3982
4004
|
slot: "label"
|
|
3983
4005
|
}, u = "content";
|
|
3984
|
-
s.info && !
|
|
4006
|
+
s.info && !k(a.props, u) && (a.props[u] = s.info), o[s.align !== "left" ? "unshift" : "push"](this.$r(D([s, a]), [
|
|
3985
4007
|
this.$r({
|
|
3986
4008
|
type: "icon",
|
|
3987
|
-
props: { type: s.icon === !0 ?
|
|
4009
|
+
props: { type: s.icon === !0 ? Z.infoIcon : s.icon, size: 16 },
|
|
3988
4010
|
style: "margin-top: -1px",
|
|
3989
4011
|
key: `${e}i`
|
|
3990
4012
|
})
|
|
3991
4013
|
]));
|
|
3992
4014
|
}
|
|
3993
|
-
return this.$r(
|
|
4015
|
+
return this.$r(D([i, {
|
|
3994
4016
|
props: i,
|
|
3995
4017
|
slot: i.slot || "label",
|
|
3996
4018
|
key: `${e}tit`,
|
|
@@ -4017,7 +4039,7 @@ const Qr = {
|
|
|
4017
4039
|
},
|
|
4018
4040
|
makeFormBtn() {
|
|
4019
4041
|
let t = [];
|
|
4020
|
-
if (
|
|
4042
|
+
if (V(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), V(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4021
4043
|
return;
|
|
4022
4044
|
const e = this.$r({
|
|
4023
4045
|
type: "formItem",
|
|
@@ -4059,34 +4081,34 @@ const Qr = {
|
|
|
4059
4081
|
key: `${this.key}b1`
|
|
4060
4082
|
}, [t.innerText]);
|
|
4061
4083
|
}
|
|
4062
|
-
},
|
|
4063
|
-
function
|
|
4064
|
-
|
|
4065
|
-
t[e] =
|
|
4084
|
+
}, L = {}, Xr = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
|
|
4085
|
+
function Qr(t) {
|
|
4086
|
+
Xr.forEach((e) => {
|
|
4087
|
+
t[e] = F(e);
|
|
4066
4088
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4067
4089
|
}
|
|
4068
|
-
function
|
|
4090
|
+
function Zr(t) {
|
|
4069
4091
|
const e = "upload", r = {
|
|
4070
4092
|
image: ["image", 0],
|
|
4071
4093
|
file: ["file", 0],
|
|
4072
4094
|
uploadFileOne: ["file", 1],
|
|
4073
4095
|
uploadImageOne: ["image", 1]
|
|
4074
4096
|
};
|
|
4075
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4097
|
+
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
4098
|
}
|
|
4077
|
-
function
|
|
4099
|
+
function Yr(t) {
|
|
4078
4100
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4079
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4101
|
+
Object.keys(r).reduce((i, s) => (i[s] = F(e, { type: r[s] }), i), t);
|
|
4080
4102
|
}
|
|
4081
|
-
function
|
|
4103
|
+
function ei(t) {
|
|
4082
4104
|
const e = "timePicker";
|
|
4083
|
-
t.time =
|
|
4105
|
+
t.time = F(e, { type: "time" }), t.timeRange = F(e, { type: "timerange" });
|
|
4084
4106
|
}
|
|
4085
|
-
function
|
|
4107
|
+
function ti(t) {
|
|
4086
4108
|
const e = "select";
|
|
4087
|
-
t.selectMultiple =
|
|
4109
|
+
t.selectMultiple = F(e, { multiple: !0 }), t.selectOne = F(e, { multiple: !1 });
|
|
4088
4110
|
}
|
|
4089
|
-
function
|
|
4111
|
+
function ri(t) {
|
|
4090
4112
|
const e = "frame", r = {
|
|
4091
4113
|
frameInputs: ["input", 0],
|
|
4092
4114
|
frameFiles: ["file", 0],
|
|
@@ -4095,19 +4117,19 @@ function ni(t) {
|
|
|
4095
4117
|
frameFileOne: ["file", 1],
|
|
4096
4118
|
frameImageOne: ["image", 1]
|
|
4097
4119
|
};
|
|
4098
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4120
|
+
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
4121
|
}
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
function
|
|
4107
|
-
return
|
|
4122
|
+
Qr(L);
|
|
4123
|
+
Zr(L);
|
|
4124
|
+
Yr(L);
|
|
4125
|
+
ti(L);
|
|
4126
|
+
ri(L);
|
|
4127
|
+
ei(L);
|
|
4128
|
+
function ze(t, e) {
|
|
4129
|
+
return f.Boolean(t) ? t = { show: t } : !f.Undef(t) && !f.Object(t) && (t = { show: e }), t;
|
|
4108
4130
|
}
|
|
4109
|
-
function
|
|
4110
|
-
return
|
|
4131
|
+
function ii(t, e) {
|
|
4132
|
+
return p(t, {
|
|
4111
4133
|
formEl() {
|
|
4112
4134
|
return e.$manager.form();
|
|
4113
4135
|
},
|
|
@@ -4132,7 +4154,7 @@ function si(t, e) {
|
|
|
4132
4154
|
const o = e.getFieldCtx(r);
|
|
4133
4155
|
if (!o) return;
|
|
4134
4156
|
const a = e.subForm[o.id], u = [e.$manager.validateField(o.id)];
|
|
4135
|
-
|
|
4157
|
+
I(a).forEach((l) => {
|
|
4136
4158
|
u.push(l.validate().catch(() => Promise.reject("子表单验证未通过")));
|
|
4137
4159
|
}), Promise.all(u).then(() => {
|
|
4138
4160
|
s(null), i && i(null);
|
|
@@ -4180,41 +4202,41 @@ function si(t, e) {
|
|
|
4180
4202
|
}
|
|
4181
4203
|
},
|
|
4182
4204
|
submitBtnProps: (r = {}) => {
|
|
4183
|
-
let i =
|
|
4184
|
-
|
|
4205
|
+
let i = ze(e.options.submitBtn, !0);
|
|
4206
|
+
p(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4185
4207
|
},
|
|
4186
4208
|
resetBtnProps: (r = {}) => {
|
|
4187
|
-
let i =
|
|
4188
|
-
|
|
4209
|
+
let i = ze(e.options.resetBtn, !1);
|
|
4210
|
+
p(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4189
4211
|
},
|
|
4190
4212
|
submit(r, i) {
|
|
4191
4213
|
t.validate((s) => {
|
|
4192
4214
|
if (s) {
|
|
4193
4215
|
let n = t.formData();
|
|
4194
|
-
|
|
4216
|
+
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
4217
|
} else
|
|
4196
|
-
|
|
4218
|
+
f.Function(i) && E(() => i(this, ...arguments));
|
|
4197
4219
|
}).catch((s) => {
|
|
4198
4220
|
});
|
|
4199
4221
|
}
|
|
4200
4222
|
}), t;
|
|
4201
4223
|
}
|
|
4202
|
-
function
|
|
4203
|
-
t.componentAlias(
|
|
4224
|
+
function ni(t) {
|
|
4225
|
+
t.componentAlias(zr), Wt.forEach((e) => {
|
|
4204
4226
|
t.component(e.name, e);
|
|
4205
|
-
}),
|
|
4227
|
+
}), Jr.forEach((e) => {
|
|
4206
4228
|
t.parser(e);
|
|
4207
|
-
}), Object.keys(
|
|
4208
|
-
t.maker[e] =
|
|
4229
|
+
}), Object.keys(L).forEach((e) => {
|
|
4230
|
+
t.maker[e] = L[e];
|
|
4209
4231
|
});
|
|
4210
4232
|
}
|
|
4211
|
-
function
|
|
4212
|
-
return
|
|
4233
|
+
function si() {
|
|
4234
|
+
return dt({
|
|
4213
4235
|
ui: "view-design",
|
|
4214
|
-
version: "2.6.
|
|
4215
|
-
manager:
|
|
4216
|
-
install:
|
|
4217
|
-
extendApi:
|
|
4236
|
+
version: "2.6.2",
|
|
4237
|
+
manager: Kr,
|
|
4238
|
+
install: ni,
|
|
4239
|
+
extendApi: ii,
|
|
4218
4240
|
attrs: {
|
|
4219
4241
|
normal: ["col", "wrap"],
|
|
4220
4242
|
array: ["className"],
|
|
@@ -4222,10 +4244,10 @@ function ai() {
|
|
|
4222
4244
|
}
|
|
4223
4245
|
});
|
|
4224
4246
|
}
|
|
4225
|
-
const
|
|
4226
|
-
typeof window != "undefined" && (window.formCreate =
|
|
4227
|
-
const
|
|
4247
|
+
const fe = si();
|
|
4248
|
+
typeof window != "undefined" && (window.formCreate = fe, window.Vue && fe.install(window.Vue));
|
|
4249
|
+
const li = fe.maker;
|
|
4228
4250
|
export {
|
|
4229
|
-
|
|
4230
|
-
|
|
4251
|
+
fe as default,
|
|
4252
|
+
li as maker
|
|
4231
4253
|
};
|