@form-create/element-ui 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 +918 -895
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +15 -14
- 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/element-ui v2.6.
|
|
3
|
+
* @form-create/element-ui 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-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;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 .el-upload{display:block}._fc-frame .fc-upload-btn,.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;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;box-sizing:border-box}._fc-upload .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-upload .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-upload .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;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 .el-upload{display:block}._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;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;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 .el-form-item{margin-bottom:22px}.form-create .form-create .el-form-item .el-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 yt = Object.defineProperty, gt = Object.defineProperties;
|
|
11
|
+
var $t = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var we = Object.getOwnPropertySymbols;
|
|
13
|
+
var vt = Object.prototype.hasOwnProperty, bt = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var Fe = (t, e, r) => e in t ? yt(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
|
+
vt.call(e, r) && Fe(t, r, e[r]);
|
|
17
|
+
if (we)
|
|
18
|
+
for (var r of we(e))
|
|
19
|
+
bt.call(e, r) && Fe(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
},
|
|
22
|
-
import
|
|
23
|
-
function
|
|
21
|
+
}, N = (t, e) => gt(t, $t(e));
|
|
22
|
+
import T from "vue";
|
|
23
|
+
function Ct(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 _t = ["attrs", "props", "domProps"], kt = ["class", "style", "directives"], Ot = ["on", "nativeOn"], wt = 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 (_t.indexOf(i) !== -1) e[i] = oe({}, e[i], r[i]);
|
|
36
|
+
else if (kt.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 (Ot.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] ? Ft(e[i][l], r[i][l]) : r[i][l];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, Ft = function(t, e) {
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
}, Et =
|
|
53
|
-
const
|
|
54
|
-
function
|
|
52
|
+
}, Et = wt;
|
|
53
|
+
const F = /* @__PURE__ */ Ct(Et);
|
|
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 St = "fcCheckbox", Rt = {
|
|
58
|
+
name: St,
|
|
59
59
|
props: {
|
|
60
60
|
formCreateInject: {
|
|
61
61
|
type: Object,
|
|
@@ -100,7 +100,8 @@ const jt = "fcCheckbox", It = {
|
|
|
100
100
|
this.update();
|
|
101
101
|
},
|
|
102
102
|
render() {
|
|
103
|
-
|
|
103
|
+
const t = arguments[0];
|
|
104
|
+
return t("ElCheckboxGroup", F([{}, this.formCreateInject.prop, {}, {
|
|
104
105
|
props: {
|
|
105
106
|
value: this.trueValue
|
|
106
107
|
}
|
|
@@ -109,24 +110,24 @@ const jt = "fcCheckbox", It = {
|
|
|
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), s = this.type === "button" ? "ElCheckboxButton" : "ElCheckbox";
|
|
115
|
+
return delete i.value, t(s, F([{}, {
|
|
116
|
+
props: i
|
|
116
117
|
}, {
|
|
117
|
-
key:
|
|
118
|
+
key: s + 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 j(t) {
|
|
126
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
127
128
|
}
|
|
128
|
-
const
|
|
129
|
-
name:
|
|
129
|
+
const jt = "fcFrame", It = {
|
|
130
|
+
name: jt,
|
|
130
131
|
props: {
|
|
131
132
|
formCreateInject: {
|
|
132
133
|
type: Object,
|
|
@@ -247,7 +248,7 @@ const At = "fcFrame", Vt = {
|
|
|
247
248
|
},
|
|
248
249
|
data() {
|
|
249
250
|
return {
|
|
250
|
-
fileList:
|
|
251
|
+
fileList: j(this.value),
|
|
251
252
|
previewVisible: !1,
|
|
252
253
|
frameVisible: !1,
|
|
253
254
|
previewImage: ""
|
|
@@ -255,7 +256,7 @@ const At = "fcFrame", Vt = {
|
|
|
255
256
|
},
|
|
256
257
|
watch: {
|
|
257
258
|
value(t) {
|
|
258
|
-
this.fileList =
|
|
259
|
+
this.fileList = j(t);
|
|
259
260
|
},
|
|
260
261
|
fileList(t) {
|
|
261
262
|
const e = this.maxLength === 1 ? t[0] || "" : t;
|
|
@@ -279,22 +280,22 @@ const At = "fcFrame", Vt = {
|
|
|
279
280
|
this.disabled || this.onOpen() === !1 || (this.frameVisible = !0);
|
|
280
281
|
},
|
|
281
282
|
makeInput() {
|
|
282
|
-
const t = {
|
|
283
|
+
const t = this.$createElement, e = {
|
|
283
284
|
type: "text",
|
|
284
|
-
value: this.fileList.map((
|
|
285
|
+
value: this.fileList.map((r) => this.getSrc(r)).toString(),
|
|
285
286
|
readonly: !0
|
|
286
287
|
};
|
|
287
|
-
return
|
|
288
|
-
props:
|
|
288
|
+
return t("ElInput", F([{}, {
|
|
289
|
+
props: e
|
|
289
290
|
}, {
|
|
290
291
|
key: this.key("input")
|
|
291
|
-
}]), [this.fileList.length ?
|
|
292
|
+
}]), [this.fileList.length ? t("i", {
|
|
292
293
|
slot: "suffix",
|
|
293
294
|
class: "el-input__icon el-icon-circle-close",
|
|
294
295
|
on: {
|
|
295
296
|
click: () => this.fileList = []
|
|
296
297
|
}
|
|
297
|
-
}) : null,
|
|
298
|
+
}) : null, t("ElButton", F([{
|
|
298
299
|
attrs: {
|
|
299
300
|
icon: this.icon
|
|
300
301
|
}
|
|
@@ -307,12 +308,14 @@ const At = "fcFrame", Vt = {
|
|
|
307
308
|
}]))]);
|
|
308
309
|
},
|
|
309
310
|
makeGroup(t) {
|
|
310
|
-
|
|
311
|
+
const e = this.$createElement;
|
|
312
|
+
return (!this.maxLength || this.fileList.length < this.maxLength) && t.push(this.makeBtn()), e("div", {
|
|
311
313
|
key: this.key("group")
|
|
312
314
|
}, [...t]);
|
|
313
315
|
},
|
|
314
316
|
makeItem(t, e) {
|
|
315
|
-
|
|
317
|
+
const r = this.$createElement;
|
|
318
|
+
return r("div", {
|
|
316
319
|
class: "fc-files",
|
|
317
320
|
key: this.key("file" + t)
|
|
318
321
|
}, [...e]);
|
|
@@ -323,16 +326,18 @@ const At = "fcFrame", Vt = {
|
|
|
323
326
|
throw new Error("[frame]无效的字段值");
|
|
324
327
|
},
|
|
325
328
|
makeIcons(t, e) {
|
|
329
|
+
const r = this.$createElement;
|
|
326
330
|
if (this.handleIcon !== !1 || this.allowRemove === !0) {
|
|
327
|
-
const
|
|
328
|
-
return (this.type !== "file" && this.handleIcon !== !1 || this.type === "file" && this.handleIcon) &&
|
|
331
|
+
const i = [];
|
|
332
|
+
return (this.type !== "file" && this.handleIcon !== !1 || this.type === "file" && this.handleIcon) && i.push(this.makeHandleIcon(t, e)), this.allowRemove && i.push(this.makeRemoveIcon(t, e)), r("div", {
|
|
329
333
|
class: "fc-upload-cover",
|
|
330
334
|
key: this.key("uc")
|
|
331
|
-
}, [
|
|
335
|
+
}, [i]);
|
|
332
336
|
}
|
|
333
337
|
},
|
|
334
338
|
makeHandleIcon(t, e) {
|
|
335
|
-
|
|
339
|
+
const r = this.$createElement;
|
|
340
|
+
return r("i", {
|
|
336
341
|
class: this.handleIcon === !0 || this.handleIcon === void 0 ? "el-icon-view" : this.handleIcon,
|
|
337
342
|
on: {
|
|
338
343
|
click: () => this.handleClick(t)
|
|
@@ -341,7 +346,8 @@ const At = "fcFrame", Vt = {
|
|
|
341
346
|
});
|
|
342
347
|
},
|
|
343
348
|
makeRemoveIcon(t, e) {
|
|
344
|
-
|
|
349
|
+
const r = this.$createElement;
|
|
350
|
+
return r("i", {
|
|
345
351
|
class: "el-icon-delete",
|
|
346
352
|
on: {
|
|
347
353
|
click: () => this.handleRemove(t)
|
|
@@ -350,28 +356,31 @@ const At = "fcFrame", Vt = {
|
|
|
350
356
|
});
|
|
351
357
|
},
|
|
352
358
|
makeFiles() {
|
|
353
|
-
|
|
359
|
+
const t = this.$createElement;
|
|
360
|
+
return this.makeGroup(this.fileList.map((e, r) => this.makeItem(r, [t("i", {
|
|
354
361
|
class: "el-icon-tickets",
|
|
355
362
|
on: {
|
|
356
|
-
click: () => this.handleClick(
|
|
363
|
+
click: () => this.handleClick(e)
|
|
357
364
|
}
|
|
358
|
-
}), this.makeIcons(
|
|
365
|
+
}), this.makeIcons(e, r)])));
|
|
359
366
|
},
|
|
360
367
|
makeImages() {
|
|
361
|
-
|
|
368
|
+
const t = this.$createElement;
|
|
369
|
+
return this.makeGroup(this.fileList.map((e, r) => this.makeItem(r, [t("img", {
|
|
362
370
|
attrs: {
|
|
363
|
-
src: this.getSrc(
|
|
371
|
+
src: this.getSrc(e)
|
|
364
372
|
}
|
|
365
|
-
}), this.makeIcons(
|
|
373
|
+
}), this.makeIcons(e, r)])));
|
|
366
374
|
},
|
|
367
375
|
makeBtn() {
|
|
368
|
-
|
|
376
|
+
const t = this.$createElement;
|
|
377
|
+
return t("div", {
|
|
369
378
|
class: "fc-upload-btn",
|
|
370
379
|
on: {
|
|
371
380
|
click: () => this.showModel()
|
|
372
381
|
},
|
|
373
382
|
key: this.key("btn")
|
|
374
|
-
}, [
|
|
383
|
+
}, [t("i", {
|
|
375
384
|
class: this.icon
|
|
376
385
|
})]);
|
|
377
386
|
},
|
|
@@ -404,65 +413,65 @@ const At = "fcFrame", Vt = {
|
|
|
404
413
|
}
|
|
405
414
|
},
|
|
406
415
|
makeFooter() {
|
|
407
|
-
const {
|
|
408
|
-
okBtnText:
|
|
409
|
-
closeBtnText:
|
|
410
|
-
closeBtn:
|
|
411
|
-
okBtn:
|
|
412
|
-
footer:
|
|
416
|
+
const t = this.$createElement, {
|
|
417
|
+
okBtnText: e,
|
|
418
|
+
closeBtnText: r,
|
|
419
|
+
closeBtn: i,
|
|
420
|
+
okBtn: s,
|
|
421
|
+
footer: n
|
|
413
422
|
} = this.$props;
|
|
414
|
-
if (
|
|
415
|
-
return
|
|
423
|
+
if (n)
|
|
424
|
+
return t("div", {
|
|
416
425
|
slot: "footer"
|
|
417
|
-
}, [
|
|
426
|
+
}, [i ? t("ElButton", {
|
|
418
427
|
on: {
|
|
419
428
|
click: () => this.onCancel() !== !1 && (this.frameVisible = !1)
|
|
420
429
|
}
|
|
421
|
-
}, [
|
|
430
|
+
}, [r]) : null, s ? t("ElButton", {
|
|
422
431
|
attrs: {
|
|
423
432
|
type: "primary"
|
|
424
433
|
},
|
|
425
434
|
on: {
|
|
426
435
|
click: () => this.onOk() !== !1 && this.closeModel()
|
|
427
436
|
}
|
|
428
|
-
}, [
|
|
437
|
+
}, [e]) : null]);
|
|
429
438
|
}
|
|
430
439
|
},
|
|
431
440
|
render() {
|
|
432
|
-
const t = this.type;
|
|
433
|
-
let
|
|
434
|
-
|
|
441
|
+
const t = arguments[0], e = this.type;
|
|
442
|
+
let r;
|
|
443
|
+
e === "input" ? r = this.makeInput() : e === "image" ? r = this.makeImages() : r = this.makeFiles();
|
|
435
444
|
const {
|
|
436
|
-
width:
|
|
437
|
-
height:
|
|
438
|
-
src:
|
|
439
|
-
title:
|
|
440
|
-
modalTitle:
|
|
445
|
+
width: i = "30%",
|
|
446
|
+
height: s,
|
|
447
|
+
src: n,
|
|
448
|
+
title: o,
|
|
449
|
+
modalTitle: a
|
|
441
450
|
} = this.$props;
|
|
442
451
|
return this.$nextTick(() => {
|
|
443
452
|
this.$refs.frame && this.frameLoad(this.$refs.frame.contentWindow || {});
|
|
444
|
-
}),
|
|
453
|
+
}), t("div", {
|
|
445
454
|
class: "_fc-frame"
|
|
446
|
-
}, [
|
|
455
|
+
}, [r, t("el-dialog", F([{}, {
|
|
447
456
|
props: {
|
|
448
457
|
appendToBody: !0,
|
|
449
458
|
modal: this.previewMask,
|
|
450
|
-
title:
|
|
459
|
+
title: a,
|
|
451
460
|
visible: this.previewVisible
|
|
452
461
|
}
|
|
453
462
|
}, {
|
|
454
463
|
on: {
|
|
455
464
|
close: this.handleCancel
|
|
456
465
|
}
|
|
457
|
-
}]), [
|
|
466
|
+
}]), [t("img", {
|
|
458
467
|
style: "width: 100%",
|
|
459
468
|
attrs: {
|
|
460
469
|
src: this.previewImage
|
|
461
470
|
}
|
|
462
|
-
})]),
|
|
463
|
-
props:
|
|
464
|
-
width:
|
|
465
|
-
title:
|
|
471
|
+
})]), t("el-dialog", F([{}, {
|
|
472
|
+
props: N(y({
|
|
473
|
+
width: i,
|
|
474
|
+
title: o,
|
|
466
475
|
appendToBody: !0
|
|
467
476
|
}, this.modal), {
|
|
468
477
|
visible: this.frameVisible
|
|
@@ -471,14 +480,14 @@ const At = "fcFrame", Vt = {
|
|
|
471
480
|
on: {
|
|
472
481
|
close: () => this.closeModel(!0)
|
|
473
482
|
}
|
|
474
|
-
}]), [this.frameVisible || !this.reload ?
|
|
483
|
+
}]), [this.frameVisible || !this.reload ? t("iframe", {
|
|
475
484
|
ref: "frame",
|
|
476
485
|
attrs: {
|
|
477
|
-
src:
|
|
486
|
+
src: n,
|
|
478
487
|
frameBorder: "0"
|
|
479
488
|
},
|
|
480
489
|
style: {
|
|
481
|
-
height:
|
|
490
|
+
height: s,
|
|
482
491
|
border: "0 none",
|
|
483
492
|
width: "100%"
|
|
484
493
|
}
|
|
@@ -487,8 +496,8 @@ const At = "fcFrame", Vt = {
|
|
|
487
496
|
mounted() {
|
|
488
497
|
this.$on("fc.closeModal", this.closeModal);
|
|
489
498
|
}
|
|
490
|
-
},
|
|
491
|
-
name:
|
|
499
|
+
}, At = "fcRadio", Vt = {
|
|
500
|
+
name: At,
|
|
492
501
|
props: {
|
|
493
502
|
formCreateInject: {
|
|
494
503
|
type: Object,
|
|
@@ -529,7 +538,8 @@ const At = "fcFrame", Vt = {
|
|
|
529
538
|
this.update();
|
|
530
539
|
},
|
|
531
540
|
render() {
|
|
532
|
-
|
|
541
|
+
const t = arguments[0];
|
|
542
|
+
return t("ElRadioGroup", F([{}, this.formCreateInject.prop, {
|
|
533
543
|
ref: "el"
|
|
534
544
|
}, {
|
|
535
545
|
props: {
|
|
@@ -539,19 +549,19 @@ const At = "fcFrame", Vt = {
|
|
|
539
549
|
on: {
|
|
540
550
|
input: this.onInput
|
|
541
551
|
}
|
|
542
|
-
}]), [this.options().map((
|
|
543
|
-
const
|
|
544
|
-
return delete
|
|
545
|
-
props:
|
|
552
|
+
}]), [this.options().map((e, r) => {
|
|
553
|
+
const i = y({}, e), s = this.type === "button" ? "ElRadioButton" : "ElRadio";
|
|
554
|
+
return delete i.value, t(s, F([{}, {
|
|
555
|
+
props: i
|
|
546
556
|
}, {
|
|
547
|
-
key:
|
|
557
|
+
key: s + r + "-" + e.value
|
|
548
558
|
}]));
|
|
549
|
-
}),
|
|
559
|
+
}), Y(this.$slots)]);
|
|
550
560
|
},
|
|
551
561
|
mounted() {
|
|
552
562
|
this.$emit("fc.el", this.$refs.el);
|
|
553
563
|
}
|
|
554
|
-
},
|
|
564
|
+
}, f = {
|
|
555
565
|
type(t, e) {
|
|
556
566
|
return Object.prototype.toString.call(t) === "[object " + e + "]";
|
|
557
567
|
},
|
|
@@ -559,7 +569,7 @@ const At = "fcFrame", Vt = {
|
|
|
559
569
|
return t == null;
|
|
560
570
|
},
|
|
561
571
|
Element(t) {
|
|
562
|
-
return typeof t == "object" && t !== null && t.nodeType === 1 && !
|
|
572
|
+
return typeof t == "object" && t !== null && t.nodeType === 1 && !f.Object(t);
|
|
563
573
|
},
|
|
564
574
|
trueArray(t) {
|
|
565
575
|
return Array.isArray(t) && t.length > 0;
|
|
@@ -577,15 +587,15 @@ const At = "fcFrame", Vt = {
|
|
|
577
587
|
}
|
|
578
588
|
};
|
|
579
589
|
["Date", "Object", "String", "Boolean", "Array", "Number"].forEach((t) => {
|
|
580
|
-
|
|
581
|
-
return
|
|
590
|
+
f[t] = function(e) {
|
|
591
|
+
return f.type(e, t);
|
|
582
592
|
};
|
|
583
593
|
});
|
|
584
|
-
function
|
|
594
|
+
function O(t, e) {
|
|
585
595
|
return {}.hasOwnProperty.call(t, e);
|
|
586
596
|
}
|
|
587
|
-
const
|
|
588
|
-
name:
|
|
597
|
+
const Pt = "fcSelect", Tt = {
|
|
598
|
+
name: Pt,
|
|
589
599
|
functional: !0,
|
|
590
600
|
props: {
|
|
591
601
|
formCreateInject: {
|
|
@@ -596,28 +606,28 @@ const Dt = "fcSelect", Bt = {
|
|
|
596
606
|
render(t, e) {
|
|
597
607
|
const r = (n, o) => {
|
|
598
608
|
const a = n.slot;
|
|
599
|
-
return t("ElOption",
|
|
609
|
+
return t("ElOption", F([{}, {
|
|
600
610
|
props: n
|
|
601
611
|
}, {
|
|
602
612
|
key: "" + o + "-" + n.value
|
|
603
613
|
}]), [a ? t("template", {
|
|
604
614
|
slot: n.slotName || "default"
|
|
605
|
-
}, [
|
|
615
|
+
}, [f.Function(a) ? n.slot(t) : a]) : null]);
|
|
606
616
|
}, i = (n, o) => t("ElOptionGroup", {
|
|
607
617
|
attrs: {
|
|
608
618
|
label: n.label
|
|
609
619
|
},
|
|
610
620
|
key: "" + o + "-" + n.label
|
|
611
|
-
}, [
|
|
612
|
-
return t("ElSelect",
|
|
621
|
+
}, [f.trueArray(n.options) && n.options.map((a, u) => r(a, u))]), s = e.props.formCreateInject.options;
|
|
622
|
+
return t("ElSelect", F([{}, e.data, {
|
|
613
623
|
ref: "el"
|
|
614
|
-
}]), [(Array.isArray(s) ? s : []).map((n, o) =>
|
|
624
|
+
}]), [(Array.isArray(s) ? s : []).map((n, o) => O(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
615
625
|
},
|
|
616
626
|
mounted() {
|
|
617
627
|
this.$emit("fc.el", this.$refs.el);
|
|
618
628
|
}
|
|
619
|
-
},
|
|
620
|
-
name:
|
|
629
|
+
}, Dt = "fcTree", Bt = {
|
|
630
|
+
name: Dt,
|
|
621
631
|
formCreateParser: {
|
|
622
632
|
mergeProp(t) {
|
|
623
633
|
const e = t.prop.props;
|
|
@@ -656,17 +666,18 @@ const Dt = "fcSelect", Bt = {
|
|
|
656
666
|
t === "selected" ? e = this.$refs.tree.getCurrentKey() : e = this.$refs.tree.getCheckedKeys(), this.$emit("input", e);
|
|
657
667
|
},
|
|
658
668
|
setValue() {
|
|
659
|
-
this.type.toLocaleLowerCase() === "selected" ? this.$refs.tree.setCurrentKey(this.value) : this.$refs.tree.setCheckedKeys(
|
|
669
|
+
this.type.toLocaleLowerCase() === "selected" ? this.$refs.tree.setCurrentKey(this.value) : this.$refs.tree.setCheckedKeys(j(this.value));
|
|
660
670
|
}
|
|
661
671
|
},
|
|
662
672
|
render() {
|
|
663
|
-
|
|
673
|
+
const t = arguments[0];
|
|
674
|
+
return t("ElTree", F([{}, this.formCreateInject.prop, {
|
|
664
675
|
ref: "tree",
|
|
665
676
|
on: {
|
|
666
677
|
check: () => this.updateValue(),
|
|
667
678
|
"node-click": () => this.updateValue()
|
|
668
679
|
}
|
|
669
|
-
}]), [
|
|
680
|
+
}]), [Y(this.$slots)]);
|
|
670
681
|
},
|
|
671
682
|
mounted() {
|
|
672
683
|
this.setValue(), this.$emit("fc.el", this.$refs.tree);
|
|
@@ -675,15 +686,15 @@ const Dt = "fcSelect", Bt = {
|
|
|
675
686
|
function Ee(t, e) {
|
|
676
687
|
return {
|
|
677
688
|
url: t,
|
|
678
|
-
name:
|
|
689
|
+
name: Lt(t),
|
|
679
690
|
uid: e
|
|
680
691
|
};
|
|
681
692
|
}
|
|
682
|
-
function
|
|
693
|
+
function Lt(t) {
|
|
683
694
|
return ("" + t).split("/").pop();
|
|
684
695
|
}
|
|
685
|
-
const
|
|
686
|
-
name:
|
|
696
|
+
const Mt = "fcUpload", Nt = {
|
|
697
|
+
name: Mt,
|
|
687
698
|
props: {
|
|
688
699
|
formCreateInject: {
|
|
689
700
|
type: Object,
|
|
@@ -725,11 +736,11 @@ const qt = "fcUpload", Ut = {
|
|
|
725
736
|
};
|
|
726
737
|
},
|
|
727
738
|
created() {
|
|
728
|
-
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList =
|
|
739
|
+
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = j(this.value).map(Ee);
|
|
729
740
|
},
|
|
730
741
|
watch: {
|
|
731
742
|
value(t) {
|
|
732
|
-
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles =
|
|
743
|
+
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = j(t).map(Ee), this.uploadList = this.$refs.upload.uploadFiles);
|
|
733
744
|
},
|
|
734
745
|
limit(t, e) {
|
|
735
746
|
(e === 1 || t === 1) && this.update();
|
|
@@ -749,18 +760,20 @@ const qt = "fcUpload", Ut = {
|
|
|
749
760
|
this.onHandle(t);
|
|
750
761
|
},
|
|
751
762
|
makeItem(t, e) {
|
|
752
|
-
|
|
763
|
+
const r = this.$createElement;
|
|
764
|
+
return this.uploadType === "image" ? r("img", {
|
|
753
765
|
attrs: {
|
|
754
766
|
src: t.url
|
|
755
767
|
},
|
|
756
768
|
key: this.key("img" + e)
|
|
757
|
-
}) :
|
|
769
|
+
}) : r("i", {
|
|
758
770
|
class: "el-icon-tickets",
|
|
759
771
|
key: this.key("i" + e)
|
|
760
772
|
});
|
|
761
773
|
},
|
|
762
774
|
makeRemoveIcon(t, e) {
|
|
763
|
-
|
|
775
|
+
const r = this.$createElement;
|
|
776
|
+
return r("i", {
|
|
764
777
|
class: "el-icon-delete",
|
|
765
778
|
on: {
|
|
766
779
|
click: () => this.onRemove(t)
|
|
@@ -769,7 +782,8 @@ const qt = "fcUpload", Ut = {
|
|
|
769
782
|
});
|
|
770
783
|
},
|
|
771
784
|
makeHandleIcon(t, e) {
|
|
772
|
-
|
|
785
|
+
const r = this.$createElement;
|
|
786
|
+
return r("i", {
|
|
773
787
|
class: this.handleIcon === !0 || this.handleIcon === void 0 ? "el-icon-view" : this.handleIcon,
|
|
774
788
|
on: {
|
|
775
789
|
click: () => this.handleClick(t)
|
|
@@ -778,7 +792,8 @@ const qt = "fcUpload", Ut = {
|
|
|
778
792
|
});
|
|
779
793
|
},
|
|
780
794
|
makeProgress(t, e) {
|
|
781
|
-
|
|
795
|
+
const r = this.$createElement;
|
|
796
|
+
return r("ElProgress", F([{}, {
|
|
782
797
|
props: {
|
|
783
798
|
percentage: t.percentage,
|
|
784
799
|
type: "circle",
|
|
@@ -790,50 +805,52 @@ const qt = "fcUpload", Ut = {
|
|
|
790
805
|
}]));
|
|
791
806
|
},
|
|
792
807
|
makeIcons(t, e) {
|
|
793
|
-
const r = [];
|
|
808
|
+
const r = this.$createElement, i = [];
|
|
794
809
|
if (this.allowRemove || this.handleIcon !== !1)
|
|
795
|
-
return (this.uploadType !== "file" && this.handleIcon !== !1 || this.uploadType === "file" && this.handleIcon) &&
|
|
810
|
+
return (this.uploadType !== "file" && this.handleIcon !== !1 || this.uploadType === "file" && this.handleIcon) && i.push(this.makeHandleIcon(t, e)), this.allowRemove && i.push(this.makeRemoveIcon(t, e)), r("div", {
|
|
796
811
|
class: "fc-upload-cover"
|
|
797
|
-
}, [
|
|
812
|
+
}, [i]);
|
|
798
813
|
},
|
|
799
814
|
makeFiles() {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
815
|
+
const t = this.$createElement;
|
|
816
|
+
return this.uploadList.map((e, r) => this.$scopedSlots.fileList ? this.$scopedSlots.fileList({
|
|
817
|
+
file: e,
|
|
818
|
+
index: r,
|
|
803
819
|
vm: this
|
|
804
|
-
}) :
|
|
805
|
-
key: this.key(
|
|
820
|
+
}) : t("div", {
|
|
821
|
+
key: this.key(r),
|
|
806
822
|
class: "fc-files"
|
|
807
|
-
}, [
|
|
823
|
+
}, [e.percentage !== void 0 && e.status !== "success" ? this.makeProgress(e, r) : [this.makeItem(e, r), this.makeIcons(e, r)]]));
|
|
808
824
|
},
|
|
809
825
|
makeUpload() {
|
|
810
|
-
const t = !this.limit || this.limit > this.uploadList.length;
|
|
811
|
-
return
|
|
826
|
+
const t = this.$createElement, e = !this.limit || this.limit > this.uploadList.length;
|
|
827
|
+
return t("ElUpload", F([{}, this.formCreateInject.prop, {}, {
|
|
812
828
|
style: {
|
|
813
829
|
display: "inline-block"
|
|
814
830
|
},
|
|
815
831
|
key: this.key("upload"),
|
|
816
832
|
ref: "upload"
|
|
817
|
-
}]), [
|
|
833
|
+
}]), [e ? t("template", {
|
|
818
834
|
slot: "default"
|
|
819
|
-
}, [this.$slots.default ||
|
|
835
|
+
}, [this.$slots.default || t("div", {
|
|
820
836
|
class: "fc-upload-btn"
|
|
821
|
-
}, [
|
|
837
|
+
}, [t("i", {
|
|
822
838
|
class: "el-icon-upload2"
|
|
823
|
-
})])]) : null,
|
|
839
|
+
})])]) : null, Y(this.$slots, ["default"])]);
|
|
824
840
|
},
|
|
825
841
|
update() {
|
|
826
|
-
let t = this.$refs.upload.uploadFiles.map((e) => e.url).filter((e) => e !== void 0);
|
|
827
|
-
(
|
|
842
|
+
let t = this.$refs.upload.uploadFiles.map((e) => e.url).filter((e) => e !== void 0 && e.indexOf("blob:") !== 0);
|
|
843
|
+
JSON.stringify(t) !== JSON.stringify(this.cacheFiles) && (this.cacheFiles = [...t], this.$emit("input", this.limit === 1 ? t[0] || "" : t));
|
|
828
844
|
},
|
|
829
845
|
handleCancel() {
|
|
830
846
|
this.previewVisible = !1;
|
|
831
847
|
}
|
|
832
848
|
},
|
|
833
849
|
render() {
|
|
834
|
-
|
|
850
|
+
const t = arguments[0];
|
|
851
|
+
return this.$refs.upload && (this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = this.$refs.upload.showFileList), this.formCreateInject.prop.props.fileList = this.$refs.upload.fileList), t("div", {
|
|
835
852
|
class: "_fc-upload"
|
|
836
|
-
}, [[this.formCreateInject.prop.props.showFileList ? [] : this.makeFiles(), this.makeUpload()],
|
|
853
|
+
}, [[this.formCreateInject.prop.props.showFileList ? [] : this.makeFiles(), this.makeUpload()], t("el-dialog", F([{}, {
|
|
837
854
|
props: {
|
|
838
855
|
appendToBody: !0,
|
|
839
856
|
modal: this.previewMask,
|
|
@@ -844,7 +861,7 @@ const qt = "fcUpload", Ut = {
|
|
|
844
861
|
on: {
|
|
845
862
|
close: this.handleCancel
|
|
846
863
|
}
|
|
847
|
-
}]), [
|
|
864
|
+
}]), [t("img", {
|
|
848
865
|
attrs: {
|
|
849
866
|
alt: "example",
|
|
850
867
|
src: this.previewImage
|
|
@@ -860,50 +877,50 @@ const qt = "fcUpload", Ut = {
|
|
|
860
877
|
}), this.$emit("fc.el", this.$refs.upload);
|
|
861
878
|
}
|
|
862
879
|
};
|
|
863
|
-
function
|
|
864
|
-
|
|
880
|
+
function w(t, e, r) {
|
|
881
|
+
T.set(t, e, r);
|
|
865
882
|
}
|
|
866
|
-
function
|
|
867
|
-
|
|
883
|
+
function B(t, e) {
|
|
884
|
+
T.delete(t, e);
|
|
868
885
|
}
|
|
869
|
-
function
|
|
886
|
+
function K(t, e = {}, r) {
|
|
870
887
|
let i = !1;
|
|
871
888
|
for (let s in e)
|
|
872
889
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
873
890
|
let n = e[s];
|
|
874
|
-
if ((i = Array.isArray(n)) ||
|
|
891
|
+
if ((i = Array.isArray(n)) || f.Object(n)) {
|
|
875
892
|
let o = t[s] === void 0;
|
|
876
893
|
if (i)
|
|
877
|
-
i = !1, o &&
|
|
894
|
+
i = !1, o && w(t, s, []);
|
|
878
895
|
else if (n._clone && r !== void 0)
|
|
879
896
|
if (r)
|
|
880
|
-
n = n.getRule(), o &&
|
|
897
|
+
n = n.getRule(), o && w(t, s, {});
|
|
881
898
|
else {
|
|
882
|
-
|
|
899
|
+
w(t, s, n._clone());
|
|
883
900
|
continue;
|
|
884
901
|
}
|
|
885
902
|
else
|
|
886
|
-
o &&
|
|
887
|
-
t[s] =
|
|
903
|
+
o && w(t, s, {});
|
|
904
|
+
t[s] = K(t[s], n, r);
|
|
888
905
|
} else
|
|
889
|
-
|
|
906
|
+
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));
|
|
890
907
|
}
|
|
891
908
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
892
909
|
}
|
|
893
|
-
function
|
|
894
|
-
return
|
|
910
|
+
function L(t) {
|
|
911
|
+
return K({}, { value: t }).value;
|
|
895
912
|
}
|
|
896
|
-
const
|
|
913
|
+
const qt = Object.assign || function(t) {
|
|
897
914
|
for (let e, r = 1; r < arguments.length; r++)
|
|
898
915
|
for (let i in e = arguments[r], e)
|
|
899
|
-
Object.prototype.hasOwnProperty.call(e, i) &&
|
|
916
|
+
Object.prototype.hasOwnProperty.call(e, i) && w(t, i, e[i]);
|
|
900
917
|
return t;
|
|
901
918
|
};
|
|
902
|
-
function
|
|
903
|
-
return
|
|
919
|
+
function p() {
|
|
920
|
+
return qt.apply(this, arguments);
|
|
904
921
|
}
|
|
905
|
-
const
|
|
906
|
-
name:
|
|
922
|
+
const Ut = "fcGroup", Ht = {
|
|
923
|
+
name: Ut,
|
|
907
924
|
props: {
|
|
908
925
|
field: String,
|
|
909
926
|
rule: [Array, Object],
|
|
@@ -984,13 +1001,13 @@ const xt = "fcGroup", Jt = {
|
|
|
984
1001
|
const s = i.$f.formData();
|
|
985
1002
|
if (t === e)
|
|
986
1003
|
i.$f.deferSyncValue(() => {
|
|
987
|
-
|
|
1004
|
+
K(i.rule, t), i.$f.setValue(s);
|
|
988
1005
|
}, !0);
|
|
989
1006
|
else {
|
|
990
1007
|
const n = i.$f.formData();
|
|
991
1008
|
i.$f.once("reloading", () => {
|
|
992
1009
|
i.$f.setValue(n);
|
|
993
|
-
}), i.rule =
|
|
1010
|
+
}), i.rule = L(t);
|
|
994
1011
|
}
|
|
995
1012
|
}
|
|
996
1013
|
});
|
|
@@ -1024,7 +1041,7 @@ const xt = "fcGroup", Jt = {
|
|
|
1024
1041
|
},
|
|
1025
1042
|
methods: {
|
|
1026
1043
|
_value(t) {
|
|
1027
|
-
return t &&
|
|
1044
|
+
return t && O(t, this.field) ? t[this.field] : t;
|
|
1028
1045
|
},
|
|
1029
1046
|
cache(t, e) {
|
|
1030
1047
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1055,8 +1072,8 @@ const xt = "fcGroup", Jt = {
|
|
|
1055
1072
|
};
|
|
1056
1073
|
if (this.defaultValue) {
|
|
1057
1074
|
i.formData || (i.formData = {});
|
|
1058
|
-
const s =
|
|
1059
|
-
|
|
1075
|
+
const s = L(this.defaultValue);
|
|
1076
|
+
p(i.formData, this.field ? {
|
|
1060
1077
|
[this.field]: s
|
|
1061
1078
|
} : s);
|
|
1062
1079
|
}
|
|
@@ -1089,7 +1106,8 @@ const xt = "fcGroup", Jt = {
|
|
|
1089
1106
|
r.splice(t, 1), this.input(r);
|
|
1090
1107
|
},
|
|
1091
1108
|
addIcon(t) {
|
|
1092
|
-
|
|
1109
|
+
const e = this.$createElement;
|
|
1110
|
+
return e("div", {
|
|
1093
1111
|
class: "_fc-group-btn _fc-group-plus-minus",
|
|
1094
1112
|
on: {
|
|
1095
1113
|
click: this.add
|
|
@@ -1097,7 +1115,8 @@ const xt = "fcGroup", Jt = {
|
|
|
1097
1115
|
});
|
|
1098
1116
|
},
|
|
1099
1117
|
delIcon(t, e) {
|
|
1100
|
-
|
|
1118
|
+
const r = this.$createElement;
|
|
1119
|
+
return r("div", {
|
|
1101
1120
|
class: "_fc-group-btn _fc-group-plus-minus _fc-group-minus",
|
|
1102
1121
|
on: {
|
|
1103
1122
|
click: () => this.del(t, e)
|
|
@@ -1105,7 +1124,8 @@ const xt = "fcGroup", Jt = {
|
|
|
1105
1124
|
});
|
|
1106
1125
|
},
|
|
1107
1126
|
sortUpIcon(t) {
|
|
1108
|
-
|
|
1127
|
+
const e = this.$createElement;
|
|
1128
|
+
return e("div", {
|
|
1109
1129
|
class: "_fc-group-btn _fc-group-arrow _fc-group-up",
|
|
1110
1130
|
on: {
|
|
1111
1131
|
click: () => this.changeSort(t, -1)
|
|
@@ -1113,7 +1133,8 @@ const xt = "fcGroup", Jt = {
|
|
|
1113
1133
|
});
|
|
1114
1134
|
},
|
|
1115
1135
|
sortDownIcon(t) {
|
|
1116
|
-
|
|
1136
|
+
const e = this.$createElement;
|
|
1137
|
+
return e("div", {
|
|
1117
1138
|
class: "_fc-group-btn _fc-group-arrow _fc-group-down",
|
|
1118
1139
|
on: {
|
|
1119
1140
|
click: () => this.changeSort(t, 1)
|
|
@@ -1153,55 +1174,55 @@ const xt = "fcGroup", Jt = {
|
|
|
1153
1174
|
this.addRule(e);
|
|
1154
1175
|
},
|
|
1155
1176
|
render() {
|
|
1156
|
-
const t = this.sort,
|
|
1177
|
+
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({
|
|
1157
1178
|
vm: this,
|
|
1158
1179
|
add: this.add
|
|
1159
|
-
}) :
|
|
1180
|
+
}) : t("div", {
|
|
1160
1181
|
key: "a_def",
|
|
1161
1182
|
class: "_fc-group-plus-minus _fc-group-add",
|
|
1162
1183
|
on: {
|
|
1163
1184
|
click: this.add
|
|
1164
1185
|
}
|
|
1165
|
-
}) :
|
|
1186
|
+
}) : e.map((o, a) => {
|
|
1166
1187
|
const {
|
|
1167
|
-
rule:
|
|
1168
|
-
options:
|
|
1169
|
-
} = this.cacheRule[
|
|
1170
|
-
return
|
|
1188
|
+
rule: u,
|
|
1189
|
+
options: l
|
|
1190
|
+
} = this.cacheRule[o], c = r && !s ? this.makeIcon(e.length, a, o) : [];
|
|
1191
|
+
return t("div", {
|
|
1171
1192
|
class: "_fc-group-container",
|
|
1172
|
-
key:
|
|
1173
|
-
}, [
|
|
1174
|
-
key:
|
|
1193
|
+
key: o
|
|
1194
|
+
}, [t(i, F([{
|
|
1195
|
+
key: o
|
|
1175
1196
|
}, {
|
|
1176
1197
|
on: {
|
|
1177
|
-
"update:value": (
|
|
1178
|
-
"emit-event": (
|
|
1179
|
-
input: (
|
|
1198
|
+
"update:value": (m) => this.formData(o, m),
|
|
1199
|
+
"emit-event": (m, ...v) => this.emitEvent(m, v, a, o),
|
|
1200
|
+
input: (m) => this.add$f(a, o, m)
|
|
1180
1201
|
}
|
|
1181
1202
|
}, {}, {
|
|
1182
1203
|
props: {
|
|
1183
|
-
disabled:
|
|
1204
|
+
disabled: s,
|
|
1184
1205
|
inFor: !0,
|
|
1185
1206
|
value: this.field ? {
|
|
1186
|
-
[this.field]: this._value(this.value[
|
|
1187
|
-
} : this.value[
|
|
1188
|
-
rule:
|
|
1189
|
-
option:
|
|
1207
|
+
[this.field]: this._value(this.value[a])
|
|
1208
|
+
} : this.value[a],
|
|
1209
|
+
rule: u,
|
|
1210
|
+
option: l,
|
|
1190
1211
|
extendOption: !0
|
|
1191
1212
|
}
|
|
1192
|
-
}])),
|
|
1213
|
+
}])), t("div", {
|
|
1193
1214
|
class: "_fc-group-idx"
|
|
1194
|
-
}, [
|
|
1215
|
+
}, [a + 1]), c.length ? t("div", {
|
|
1195
1216
|
class: "_fc-group-handle"
|
|
1196
|
-
}, [
|
|
1217
|
+
}, [c]) : null]);
|
|
1197
1218
|
});
|
|
1198
|
-
return
|
|
1219
|
+
return t("div", {
|
|
1199
1220
|
key: "con",
|
|
1200
|
-
class: "_fc-group " + (
|
|
1201
|
-
}, [
|
|
1221
|
+
class: "_fc-group " + (s ? "_fc-group-disabled" : "")
|
|
1222
|
+
}, [n]);
|
|
1202
1223
|
}
|
|
1203
|
-
},
|
|
1204
|
-
name:
|
|
1224
|
+
}, xt = "fcSubForm", Jt = {
|
|
1225
|
+
name: xt,
|
|
1205
1226
|
props: {
|
|
1206
1227
|
rule: Array,
|
|
1207
1228
|
options: Object,
|
|
@@ -1265,11 +1286,11 @@ const xt = "fcGroup", Jt = {
|
|
|
1265
1286
|
this.addRule(), this.type = this.formCreateInject.form.$form();
|
|
1266
1287
|
},
|
|
1267
1288
|
render() {
|
|
1268
|
-
const {
|
|
1269
|
-
rule:
|
|
1270
|
-
options:
|
|
1271
|
-
} = this.cacheRule,
|
|
1272
|
-
return
|
|
1289
|
+
const t = arguments[0], {
|
|
1290
|
+
rule: e,
|
|
1291
|
+
options: r
|
|
1292
|
+
} = this.cacheRule, i = this.type;
|
|
1293
|
+
return t(i, F([{}, {
|
|
1273
1294
|
on: {
|
|
1274
1295
|
"update:value": this.formData,
|
|
1275
1296
|
"emit-event": this.emitEvent,
|
|
@@ -1277,34 +1298,34 @@ const xt = "fcGroup", Jt = {
|
|
|
1277
1298
|
}
|
|
1278
1299
|
}, {}, {
|
|
1279
1300
|
props: {
|
|
1280
|
-
rule:
|
|
1281
|
-
option:
|
|
1301
|
+
rule: e,
|
|
1302
|
+
option: r,
|
|
1282
1303
|
disabled: this.disabled,
|
|
1283
1304
|
extendOption: !0
|
|
1284
1305
|
}
|
|
1285
1306
|
}]));
|
|
1286
1307
|
}
|
|
1287
|
-
},
|
|
1308
|
+
}, Kt = [
|
|
1309
|
+
Rt,
|
|
1288
1310
|
It,
|
|
1289
1311
|
Vt,
|
|
1290
1312
|
Tt,
|
|
1291
1313
|
Bt,
|
|
1292
1314
|
Nt,
|
|
1293
|
-
|
|
1294
|
-
Jt
|
|
1295
|
-
|
|
1296
|
-
], je = "FormCreate", ue = (t, e) => {
|
|
1315
|
+
Ht,
|
|
1316
|
+
Jt
|
|
1317
|
+
], Se = "FormCreate", ae = (t, e) => {
|
|
1297
1318
|
if (!(!t || t === e)) {
|
|
1298
1319
|
if (t.formCreateInject)
|
|
1299
1320
|
return t.formCreateInject;
|
|
1300
1321
|
if (t.$parent)
|
|
1301
|
-
return
|
|
1322
|
+
return ae(t.$parent, e);
|
|
1302
1323
|
}
|
|
1303
1324
|
};
|
|
1304
|
-
function
|
|
1325
|
+
function Wt(t, e, r) {
|
|
1305
1326
|
return {
|
|
1306
|
-
name:
|
|
1307
|
-
componentName:
|
|
1327
|
+
name: Se,
|
|
1328
|
+
componentName: Se,
|
|
1308
1329
|
model: {
|
|
1309
1330
|
prop: "api"
|
|
1310
1331
|
},
|
|
@@ -1380,8 +1401,8 @@ function Xt(t, e, r) {
|
|
|
1380
1401
|
},
|
|
1381
1402
|
deep: !0
|
|
1382
1403
|
},
|
|
1383
|
-
rule(i) {
|
|
1384
|
-
i.length === this.renderRule.length && i.every((
|
|
1404
|
+
rule(i, s) {
|
|
1405
|
+
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());
|
|
1385
1406
|
},
|
|
1386
1407
|
disabled() {
|
|
1387
1408
|
this.$f.refresh();
|
|
@@ -1389,23 +1410,23 @@ function Xt(t, e, r) {
|
|
|
1389
1410
|
},
|
|
1390
1411
|
beforeCreate() {
|
|
1391
1412
|
this.formCreate = new t(this), Object.keys(this.formCreate.prop).forEach((i) => {
|
|
1392
|
-
|
|
1413
|
+
p(this.$options[i], this.formCreate.prop[i]);
|
|
1393
1414
|
}), this.$emit("beforeCreate", this.formCreate.api());
|
|
1394
1415
|
},
|
|
1395
1416
|
created() {
|
|
1396
1417
|
const i = this, s = this.formCreate.api(), n = () => {
|
|
1397
1418
|
if (i.$pfc) {
|
|
1398
|
-
const a =
|
|
1419
|
+
const a = ae(i, i.$pfc);
|
|
1399
1420
|
if (a) {
|
|
1400
1421
|
let u;
|
|
1401
|
-
i.isMore ? (u =
|
|
1422
|
+
i.isMore ? (u = j(a.getSubForm()), u.push(s)) : u = s, a.subForm(u);
|
|
1402
1423
|
}
|
|
1403
1424
|
}
|
|
1404
1425
|
}, o = () => {
|
|
1405
|
-
const a =
|
|
1426
|
+
const a = ae(i, i.$pfc);
|
|
1406
1427
|
if (a)
|
|
1407
1428
|
if (i.isMore) {
|
|
1408
|
-
const u =
|
|
1429
|
+
const u = j(a.getSubForm()), l = u.indexOf(s);
|
|
1409
1430
|
l > -1 && u.splice(l, 1);
|
|
1410
1431
|
} else
|
|
1411
1432
|
a.subForm();
|
|
@@ -1418,86 +1439,86 @@ function Xt(t, e, r) {
|
|
|
1418
1439
|
}
|
|
1419
1440
|
};
|
|
1420
1441
|
}
|
|
1421
|
-
const
|
|
1422
|
-
const i = [...
|
|
1442
|
+
const We = ["attrs", "props", "domProps", "scopedSlots"], Ge = ["class", "style", "directives"], Xe = ["on", "nativeOn"], D = (t, e = {}, r = {}) => {
|
|
1443
|
+
const i = [...We, ...r.normal || []], s = [...Ge, ...r.array || []], n = [...Xe, ...r.functional || []], o = r.props || [];
|
|
1423
1444
|
return t.reduce((a, u) => {
|
|
1424
1445
|
for (const l in u)
|
|
1425
1446
|
if (a[l])
|
|
1426
1447
|
if (o.indexOf(l) > -1)
|
|
1427
|
-
a[l] =
|
|
1448
|
+
a[l] = D([u[l]], a[l]);
|
|
1428
1449
|
else if (i.indexOf(l) > -1)
|
|
1429
1450
|
a[l] = y(y({}, a[l]), u[l]);
|
|
1430
1451
|
else if (s.indexOf(l) > -1) {
|
|
1431
|
-
const
|
|
1432
|
-
a[l] = [...
|
|
1452
|
+
const c = a[l] instanceof Array ? a[l] : [a[l]], m = u[l] instanceof Array ? u[l] : [u[l]];
|
|
1453
|
+
a[l] = [...c, ...m];
|
|
1433
1454
|
} else if (n.indexOf(l) > -1)
|
|
1434
|
-
for (const
|
|
1435
|
-
if (a[l][
|
|
1436
|
-
const
|
|
1437
|
-
a[l][
|
|
1455
|
+
for (const c in u[l])
|
|
1456
|
+
if (a[l][c]) {
|
|
1457
|
+
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]];
|
|
1458
|
+
a[l][c] = [...m, ...v];
|
|
1438
1459
|
} else
|
|
1439
|
-
a[l][
|
|
1460
|
+
a[l][c] = u[l][c];
|
|
1440
1461
|
else if (l === "hook")
|
|
1441
|
-
for (let
|
|
1442
|
-
a[l][
|
|
1462
|
+
for (let c in u[l])
|
|
1463
|
+
a[l][c] ? a[l][c] = Gt(a[l][c], u[l][c]) : a[l][c] = u[l][c];
|
|
1443
1464
|
else
|
|
1444
1465
|
a[l] = u[l];
|
|
1445
1466
|
else
|
|
1446
1467
|
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];
|
|
1447
1468
|
return a;
|
|
1448
1469
|
}, e);
|
|
1449
|
-
},
|
|
1470
|
+
}, Gt = (t, e) => function() {
|
|
1450
1471
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1451
|
-
},
|
|
1452
|
-
function
|
|
1453
|
-
return [...
|
|
1472
|
+
}, ze = ["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"];
|
|
1473
|
+
function Xt() {
|
|
1474
|
+
return [...ze, ...We, ...Ge, ...Xe, ...ce, ...de];
|
|
1454
1475
|
}
|
|
1455
|
-
function
|
|
1476
|
+
function pe(t, e, r) {
|
|
1456
1477
|
return `[form-create ${t}]: ${e}`;
|
|
1457
1478
|
}
|
|
1458
|
-
function
|
|
1459
|
-
console.warn(
|
|
1479
|
+
function zt(t, e) {
|
|
1480
|
+
console.warn(pe("tip", t));
|
|
1460
1481
|
}
|
|
1461
|
-
function
|
|
1462
|
-
console.error(
|
|
1482
|
+
function me(t, e) {
|
|
1483
|
+
console.error(pe("err", t));
|
|
1463
1484
|
}
|
|
1464
|
-
function
|
|
1465
|
-
|
|
1485
|
+
function Qt(t) {
|
|
1486
|
+
me(t.toString()), console.error(t);
|
|
1466
1487
|
}
|
|
1467
|
-
const
|
|
1468
|
-
function
|
|
1469
|
-
return JSON.stringify(
|
|
1488
|
+
const le = "[[FORM-CREATE-PREFIX-", ue = "-FORM-CREATE-SUFFIX]]", Re = "$FN:", je = "$FNX:";
|
|
1489
|
+
function Qe(t, e) {
|
|
1490
|
+
return JSON.stringify(K(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1470
1491
|
if (!(i && i._isVue === !0)) {
|
|
1471
|
-
if (typeof i
|
|
1492
|
+
if (typeof i != "function")
|
|
1472
1493
|
return i;
|
|
1473
1494
|
if (i.__json)
|
|
1474
1495
|
return i.__json;
|
|
1475
1496
|
if (i.__origin && (i = i.__origin), !i.__emit)
|
|
1476
|
-
return
|
|
1497
|
+
return le + i + ue;
|
|
1477
1498
|
}
|
|
1478
1499
|
}, e);
|
|
1479
1500
|
}
|
|
1480
|
-
function
|
|
1501
|
+
function Ie(t) {
|
|
1481
1502
|
return new Function("return " + t)();
|
|
1482
1503
|
}
|
|
1483
|
-
function
|
|
1484
|
-
if (t &&
|
|
1504
|
+
function q(t, e) {
|
|
1505
|
+
if (t && f.String(t) && t.length > 4) {
|
|
1485
1506
|
let r = t.trim(), i = !1;
|
|
1486
1507
|
try {
|
|
1487
|
-
if (r.indexOf(
|
|
1488
|
-
r = r.replace(
|
|
1489
|
-
else if (r.indexOf(
|
|
1490
|
-
r = r.replace(
|
|
1508
|
+
if (r.indexOf(ue) > 0 && r.indexOf(le) === 0)
|
|
1509
|
+
r = r.replace(ue, "").replace(le, ""), i = !0;
|
|
1510
|
+
else if (r.indexOf(Re) === 0)
|
|
1511
|
+
r = r.replace(Re, ""), i = !0;
|
|
1491
1512
|
else {
|
|
1492
|
-
if (r.indexOf(
|
|
1493
|
-
return r =
|
|
1494
|
-
!e && r.indexOf(
|
|
1513
|
+
if (r.indexOf(je) === 0)
|
|
1514
|
+
return r = Ie("function($inject){" + r.replace(je, "") + "}"), r.__json = t, r.__inject = !0, r;
|
|
1515
|
+
!e && r.indexOf("function ") === 0 && r !== "function " && (i = !0);
|
|
1495
1516
|
}
|
|
1496
1517
|
if (!i) return t;
|
|
1497
|
-
const s =
|
|
1518
|
+
const s = Ie(r.indexOf("function ") === -1 && r.indexOf("(") !== 0 ? "function " + r : r);
|
|
1498
1519
|
return s.__json = t, s;
|
|
1499
1520
|
} catch (s) {
|
|
1500
|
-
|
|
1521
|
+
me(`解析失败:${r}
|
|
1501
1522
|
|
|
1502
1523
|
err: ${s}`);
|
|
1503
1524
|
return;
|
|
@@ -1505,12 +1526,12 @@ err: ${s}`);
|
|
|
1505
1526
|
}
|
|
1506
1527
|
return t;
|
|
1507
1528
|
}
|
|
1508
|
-
function
|
|
1529
|
+
function Zt(t, e) {
|
|
1509
1530
|
return JSON.parse(t, function(r, i) {
|
|
1510
|
-
return
|
|
1531
|
+
return f.Undef(i) || !i.indexOf ? i : q(i, e);
|
|
1511
1532
|
});
|
|
1512
1533
|
}
|
|
1513
|
-
function
|
|
1534
|
+
function Ze(t, e) {
|
|
1514
1535
|
return {
|
|
1515
1536
|
value: t,
|
|
1516
1537
|
enumerable: !1,
|
|
@@ -1518,60 +1539,60 @@ function et(t, e) {
|
|
|
1518
1539
|
writable: !!e
|
|
1519
1540
|
};
|
|
1520
1541
|
}
|
|
1521
|
-
function
|
|
1522
|
-
return
|
|
1542
|
+
function ye(t) {
|
|
1543
|
+
return Ye([t])[0];
|
|
1523
1544
|
}
|
|
1524
|
-
function
|
|
1525
|
-
return
|
|
1545
|
+
function Ye(t, e) {
|
|
1546
|
+
return K([], [...t], e || !1);
|
|
1526
1547
|
}
|
|
1527
|
-
function
|
|
1528
|
-
return
|
|
1548
|
+
function U(t, e) {
|
|
1549
|
+
return D(Array.isArray(e) ? e : [e], t, { array: ce, normal: de }), t;
|
|
1529
1550
|
}
|
|
1530
|
-
function
|
|
1531
|
-
const e =
|
|
1551
|
+
function Ae(t) {
|
|
1552
|
+
const e = f.Function(t.getRule) ? t.getRule() : t;
|
|
1532
1553
|
return e.type || (e.type = "input"), e;
|
|
1533
1554
|
}
|
|
1534
|
-
function
|
|
1555
|
+
function Yt(t, e) {
|
|
1535
1556
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1536
|
-
e[r] && (t[r] =
|
|
1557
|
+
e[r] && (t[r] = U(t[r] || {}, e[r]));
|
|
1537
1558
|
}), t) : e;
|
|
1538
1559
|
}
|
|
1539
|
-
function
|
|
1560
|
+
function et(t, e) {
|
|
1540
1561
|
Object.defineProperties(t, Object.keys(e).reduce((r, i) => (r[i] = {
|
|
1541
1562
|
get() {
|
|
1542
1563
|
return e[i]();
|
|
1543
1564
|
}
|
|
1544
1565
|
}, r), {}));
|
|
1545
1566
|
}
|
|
1546
|
-
function
|
|
1567
|
+
function z(t) {
|
|
1547
1568
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1548
1569
|
}
|
|
1549
|
-
function
|
|
1570
|
+
function R(t, e) {
|
|
1550
1571
|
try {
|
|
1551
1572
|
e = t();
|
|
1552
1573
|
} catch (r) {
|
|
1553
|
-
|
|
1574
|
+
Qt(r);
|
|
1554
1575
|
}
|
|
1555
1576
|
return e;
|
|
1556
1577
|
}
|
|
1557
|
-
const
|
|
1558
|
-
"==": (t, e) => JSON.stringify(t) === JSON.stringify(
|
|
1559
|
-
"!=": (t, e) => !
|
|
1578
|
+
const Ve = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, J = {
|
|
1579
|
+
"==": (t, e) => JSON.stringify(t) === JSON.stringify(Ve(t, e)),
|
|
1580
|
+
"!=": (t, e) => !J["=="](t, e),
|
|
1560
1581
|
">": (t, e) => t > e,
|
|
1561
1582
|
">=": (t, e) => t >= e,
|
|
1562
1583
|
"<": (t, e) => t < e,
|
|
1563
1584
|
"<=": (t, e) => t <= e,
|
|
1564
1585
|
on(t, e) {
|
|
1565
|
-
return t && t.indexOf && t.indexOf(
|
|
1586
|
+
return t && t.indexOf && t.indexOf(Ve(t[0], e)) > -1;
|
|
1566
1587
|
},
|
|
1567
1588
|
notOn(t, e) {
|
|
1568
|
-
return !
|
|
1589
|
+
return !J.on(t, e);
|
|
1569
1590
|
},
|
|
1570
1591
|
in(t, e) {
|
|
1571
1592
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1572
1593
|
},
|
|
1573
1594
|
notIn(t, e) {
|
|
1574
|
-
return !
|
|
1595
|
+
return !J.in(t, e);
|
|
1575
1596
|
},
|
|
1576
1597
|
between(t, e) {
|
|
1577
1598
|
return t > e[0] && t < e[1];
|
|
@@ -1580,16 +1601,16 @@ const Te = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1580
1601
|
return t < e[0] || t > e[1];
|
|
1581
1602
|
},
|
|
1582
1603
|
empty(t) {
|
|
1583
|
-
return
|
|
1604
|
+
return f.empty(t);
|
|
1584
1605
|
},
|
|
1585
1606
|
notEmpty(t) {
|
|
1586
|
-
return !
|
|
1607
|
+
return !f.empty(t);
|
|
1587
1608
|
},
|
|
1588
1609
|
pattern(t, e) {
|
|
1589
1610
|
return new RegExp(e, "g").test(t);
|
|
1590
1611
|
}
|
|
1591
1612
|
};
|
|
1592
|
-
function
|
|
1613
|
+
function tt() {
|
|
1593
1614
|
return {
|
|
1594
1615
|
props: {},
|
|
1595
1616
|
on: {},
|
|
@@ -1601,57 +1622,57 @@ function it() {
|
|
|
1601
1622
|
value: void 0
|
|
1602
1623
|
};
|
|
1603
1624
|
}
|
|
1604
|
-
function
|
|
1625
|
+
function E(t, e) {
|
|
1605
1626
|
return (r, i, s, n = {}) => {
|
|
1606
|
-
const o = new
|
|
1607
|
-
return e && (
|
|
1627
|
+
const o = new ge(t, r, i, s, n);
|
|
1628
|
+
return e && (f.Function(e) ? e(o) : o.props(e)), o;
|
|
1608
1629
|
};
|
|
1609
1630
|
}
|
|
1610
|
-
function
|
|
1611
|
-
this._data =
|
|
1631
|
+
function ge(t, e, r, i, s) {
|
|
1632
|
+
this._data = p(tt(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1612
1633
|
}
|
|
1613
|
-
|
|
1634
|
+
p(ge.prototype, {
|
|
1614
1635
|
getRule() {
|
|
1615
1636
|
return this._data;
|
|
1616
1637
|
},
|
|
1617
1638
|
setProp(t, e) {
|
|
1618
|
-
return
|
|
1639
|
+
return w(this._data, t, e), this;
|
|
1619
1640
|
},
|
|
1620
1641
|
_clone() {
|
|
1621
1642
|
const t = new this.constructor();
|
|
1622
|
-
return t._data =
|
|
1643
|
+
return t._data = ye(this._data), t;
|
|
1623
1644
|
}
|
|
1624
1645
|
});
|
|
1625
|
-
function
|
|
1646
|
+
function rt(t) {
|
|
1626
1647
|
t.forEach((e) => {
|
|
1627
|
-
|
|
1628
|
-
return
|
|
1648
|
+
ge.prototype[e] = function(r) {
|
|
1649
|
+
return U(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1629
1650
|
};
|
|
1630
1651
|
});
|
|
1631
1652
|
}
|
|
1632
|
-
|
|
1633
|
-
const
|
|
1634
|
-
function
|
|
1635
|
-
let i =
|
|
1653
|
+
rt(Xt());
|
|
1654
|
+
const it = E("");
|
|
1655
|
+
function er(t, e, r) {
|
|
1656
|
+
let i = it("", e);
|
|
1636
1657
|
return i._data.type = t, i._data.title = r, i;
|
|
1637
1658
|
}
|
|
1638
|
-
function
|
|
1639
|
-
let s =
|
|
1659
|
+
function Pe(t, e, r, i) {
|
|
1660
|
+
let s = it("", r);
|
|
1640
1661
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1641
1662
|
}
|
|
1642
|
-
function
|
|
1663
|
+
function tr() {
|
|
1643
1664
|
return {
|
|
1644
|
-
create:
|
|
1645
|
-
createTmp:
|
|
1646
|
-
template:
|
|
1647
|
-
factory:
|
|
1665
|
+
create: er,
|
|
1666
|
+
createTmp: Pe,
|
|
1667
|
+
template: Pe,
|
|
1668
|
+
factory: E
|
|
1648
1669
|
};
|
|
1649
1670
|
}
|
|
1650
|
-
function
|
|
1671
|
+
function rr(t, e, r) {
|
|
1651
1672
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1652
1673
|
return s.status = r.status, s.url = t, s;
|
|
1653
1674
|
}
|
|
1654
|
-
function
|
|
1675
|
+
function Te(t) {
|
|
1655
1676
|
const e = t.responseText || t.response;
|
|
1656
1677
|
if (!e)
|
|
1657
1678
|
return e;
|
|
@@ -1661,7 +1682,7 @@ function Be(t) {
|
|
|
1661
1682
|
return e;
|
|
1662
1683
|
}
|
|
1663
1684
|
}
|
|
1664
|
-
function
|
|
1685
|
+
function nt(t) {
|
|
1665
1686
|
if (typeof XMLHttpRequest == "undefined")
|
|
1666
1687
|
return;
|
|
1667
1688
|
const e = new XMLHttpRequest(), r = t.action;
|
|
@@ -1669,8 +1690,8 @@ function ot(t) {
|
|
|
1669
1690
|
t.onError(o);
|
|
1670
1691
|
}, e.onload = function() {
|
|
1671
1692
|
if (e.status < 200 || e.status >= 300)
|
|
1672
|
-
return t.onError(
|
|
1673
|
-
t.onSuccess(
|
|
1693
|
+
return t.onError(rr(r, t, e), Te(e));
|
|
1694
|
+
t.onSuccess(Te(e));
|
|
1674
1695
|
}, e.open(t.method || "get", r, !0);
|
|
1675
1696
|
let i;
|
|
1676
1697
|
t.data && ((t.dataType || "").toLowerCase() !== "json" ? (i = new FormData(), Object.keys(t.data).map((n) => {
|
|
@@ -1681,13 +1702,13 @@ function ot(t) {
|
|
|
1681
1702
|
s[n] !== null && e.setRequestHeader(n, s[n]);
|
|
1682
1703
|
}), e.send(i);
|
|
1683
1704
|
}
|
|
1684
|
-
function
|
|
1705
|
+
function ir(t) {
|
|
1685
1706
|
return new Promise((e, r) => {
|
|
1686
|
-
|
|
1707
|
+
nt(N(y({}, t), {
|
|
1687
1708
|
onSuccess(i) {
|
|
1688
1709
|
let s = (o) => o;
|
|
1689
|
-
const n =
|
|
1690
|
-
|
|
1710
|
+
const n = q(t.parse);
|
|
1711
|
+
f.Function(n) ? s = n : n && f.String(n) && (s = (o) => (n.split(".").forEach((a) => {
|
|
1691
1712
|
o && (o = o[a]);
|
|
1692
1713
|
}), o)), e(s(i));
|
|
1693
1714
|
},
|
|
@@ -1697,17 +1718,17 @@ function sr(t) {
|
|
|
1697
1718
|
}));
|
|
1698
1719
|
});
|
|
1699
1720
|
}
|
|
1700
|
-
function
|
|
1701
|
-
return
|
|
1721
|
+
function X(t) {
|
|
1722
|
+
return L(t);
|
|
1702
1723
|
}
|
|
1703
|
-
function
|
|
1724
|
+
function nr(t) {
|
|
1704
1725
|
function e(n) {
|
|
1705
|
-
return
|
|
1726
|
+
return f.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1706
1727
|
}
|
|
1707
1728
|
function r(n, o, a) {
|
|
1708
1729
|
e(n).forEach((u) => {
|
|
1709
1730
|
t.getCtxs(u).forEach((l) => {
|
|
1710
|
-
|
|
1731
|
+
w(l.rule, o, a), t.$render.clearCache(l);
|
|
1711
1732
|
});
|
|
1712
1733
|
});
|
|
1713
1734
|
}
|
|
@@ -1743,13 +1764,13 @@ function or(t) {
|
|
|
1743
1764
|
formData(n) {
|
|
1744
1765
|
return e(n).reduce((o, a) => {
|
|
1745
1766
|
const u = t.getFieldCtx(a);
|
|
1746
|
-
return u && (o[u.field] =
|
|
1747
|
-
}, t.options.appendValue !== !1 ?
|
|
1767
|
+
return u && (o[u.field] = X(u.rule.value)), o;
|
|
1768
|
+
}, t.options.appendValue !== !1 ? X(t.appendData) : {});
|
|
1748
1769
|
},
|
|
1749
1770
|
getValue(n) {
|
|
1750
1771
|
const o = t.getFieldCtx(n);
|
|
1751
1772
|
if (o)
|
|
1752
|
-
return
|
|
1773
|
+
return X(o.rule.value);
|
|
1753
1774
|
},
|
|
1754
1775
|
coverValue(n) {
|
|
1755
1776
|
const o = y({}, n || {});
|
|
@@ -1757,12 +1778,12 @@ function or(t) {
|
|
|
1757
1778
|
s.fields().forEach((a) => {
|
|
1758
1779
|
const u = t.fieldCtx[a];
|
|
1759
1780
|
if (u) {
|
|
1760
|
-
const l =
|
|
1761
|
-
u.forEach((
|
|
1762
|
-
|
|
1781
|
+
const l = O(o, a);
|
|
1782
|
+
u.forEach((c) => {
|
|
1783
|
+
c.rule.value = l ? o[a] : void 0;
|
|
1763
1784
|
}), delete o[a];
|
|
1764
1785
|
}
|
|
1765
|
-
}),
|
|
1786
|
+
}), p(t.appendData, o);
|
|
1766
1787
|
});
|
|
1767
1788
|
},
|
|
1768
1789
|
setValue(n) {
|
|
@@ -1786,7 +1807,7 @@ function or(t) {
|
|
|
1786
1807
|
}, !0), o ? o.origin : void 0;
|
|
1787
1808
|
},
|
|
1788
1809
|
removeRule(n) {
|
|
1789
|
-
const o = n &&
|
|
1810
|
+
const o = n && z(n);
|
|
1790
1811
|
if (o)
|
|
1791
1812
|
return o.rm(), o.origin;
|
|
1792
1813
|
},
|
|
@@ -1796,13 +1817,13 @@ function or(t) {
|
|
|
1796
1817
|
fields: () => t.fields(),
|
|
1797
1818
|
append: (n, o, a) => {
|
|
1798
1819
|
let u = t.sort.length - 1, l;
|
|
1799
|
-
const
|
|
1800
|
-
|
|
1820
|
+
const c = t.getCtx(o);
|
|
1821
|
+
c ? a ? (l = c.rule.children, u = c.rule.children.length - 1) : (u = c.root.indexOf(c.origin), l = c.root) : l = t.rules, l.splice(u + 1, 0, n);
|
|
1801
1822
|
},
|
|
1802
1823
|
prepend: (n, o, a) => {
|
|
1803
1824
|
let u = 0, l;
|
|
1804
|
-
const
|
|
1805
|
-
|
|
1825
|
+
const c = t.getCtx(o);
|
|
1826
|
+
c ? a ? l = c.rule.children : (u = c.root.indexOf(c.origin), l = c.root) : l = t.rules, l.splice(u, 0, n);
|
|
1806
1827
|
},
|
|
1807
1828
|
hidden(n, o) {
|
|
1808
1829
|
r(o, "hidden", !!n), t.refresh();
|
|
@@ -1823,7 +1844,7 @@ function or(t) {
|
|
|
1823
1844
|
disabled(n, o) {
|
|
1824
1845
|
e(o).forEach((a) => {
|
|
1825
1846
|
t.getCtxs(a).forEach((u) => {
|
|
1826
|
-
u.rule.props &&
|
|
1847
|
+
u.rule.props && w(u.rule.props, "disabled", !!n);
|
|
1827
1848
|
});
|
|
1828
1849
|
}), t.refresh();
|
|
1829
1850
|
},
|
|
@@ -1862,7 +1883,7 @@ function or(t) {
|
|
|
1862
1883
|
n.forEach((a) => s.sync(a));
|
|
1863
1884
|
return;
|
|
1864
1885
|
}
|
|
1865
|
-
let o =
|
|
1886
|
+
let o = f.Object(n) ? z(n) : t.getCtxs(n);
|
|
1866
1887
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
1867
1888
|
if (!a.deleted) {
|
|
1868
1889
|
const u = t.subForm[a.id];
|
|
@@ -1881,7 +1902,7 @@ function or(t) {
|
|
|
1881
1902
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
1882
1903
|
},
|
|
1883
1904
|
hideForm: (n) => {
|
|
1884
|
-
|
|
1905
|
+
w(t.vm, "isShow", !n);
|
|
1885
1906
|
},
|
|
1886
1907
|
changeStatus: () => t.changeStatus,
|
|
1887
1908
|
clearChangeStatus: () => {
|
|
@@ -1889,7 +1910,7 @@ function or(t) {
|
|
|
1889
1910
|
},
|
|
1890
1911
|
updateRule(n, o) {
|
|
1891
1912
|
t.getCtxs(n).forEach((a) => {
|
|
1892
|
-
|
|
1913
|
+
p(a.rule, o);
|
|
1893
1914
|
});
|
|
1894
1915
|
},
|
|
1895
1916
|
updateRules(n) {
|
|
@@ -1899,7 +1920,7 @@ function or(t) {
|
|
|
1899
1920
|
},
|
|
1900
1921
|
mergeRule: (n, o) => {
|
|
1901
1922
|
t.getCtxs(n).forEach((a) => {
|
|
1902
|
-
|
|
1923
|
+
U(a.rule, o);
|
|
1903
1924
|
});
|
|
1904
1925
|
},
|
|
1905
1926
|
mergeRules(n) {
|
|
@@ -1926,7 +1947,7 @@ function or(t) {
|
|
|
1926
1947
|
},
|
|
1927
1948
|
setEffect(n, o, a) {
|
|
1928
1949
|
const u = t.getCtx(n);
|
|
1929
|
-
u && o && (o[0] === "$" && (o = o.substr(1)),
|
|
1950
|
+
u && o && (o[0] === "$" && (o = o.substr(1)), O(u.rule, "$" + o) && w(u.rule, "$" + o, a), O(u.rule, "effect") || w(u.rule, "effect", {}), w(u.rule.effect, o, a));
|
|
1930
1951
|
},
|
|
1931
1952
|
clearEffectData(n, o) {
|
|
1932
1953
|
const a = t.getCtx(n);
|
|
@@ -1946,23 +1967,23 @@ function or(t) {
|
|
|
1946
1967
|
resetFields(n) {
|
|
1947
1968
|
e(n).forEach((o) => {
|
|
1948
1969
|
t.getCtxs(o).forEach((a) => {
|
|
1949
|
-
t.$render.clearCache(a), a.rule.value =
|
|
1970
|
+
t.$render.clearCache(a), a.rule.value = X(a.defaultValue);
|
|
1950
1971
|
});
|
|
1951
1972
|
}), t.vm.$nextTick(() => {
|
|
1952
1973
|
s.clearValidateState();
|
|
1953
|
-
}), n == null && (
|
|
1974
|
+
}), n == null && (f.Function(t.options.onReset) && R(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
1954
1975
|
},
|
|
1955
1976
|
method(n, o) {
|
|
1956
1977
|
const a = s.el(n);
|
|
1957
1978
|
if (!a || !a[o])
|
|
1958
|
-
throw new Error(
|
|
1979
|
+
throw new Error(pe("err", `${o}方法不存在`));
|
|
1959
1980
|
return (...u) => a[o](...u);
|
|
1960
1981
|
},
|
|
1961
1982
|
exec(n, o, ...a) {
|
|
1962
|
-
return
|
|
1983
|
+
return R(() => s.method(n, o)(...a));
|
|
1963
1984
|
},
|
|
1964
1985
|
toJson(n) {
|
|
1965
|
-
return
|
|
1986
|
+
return Qe(s.rule, n);
|
|
1966
1987
|
},
|
|
1967
1988
|
trigger(n, o, ...a) {
|
|
1968
1989
|
const u = s.el(n);
|
|
@@ -1984,7 +2005,7 @@ function or(t) {
|
|
|
1984
2005
|
t.bus.$once("next-tick", n), t.refresh();
|
|
1985
2006
|
},
|
|
1986
2007
|
nextRefresh(n) {
|
|
1987
|
-
t.nextRefresh(), n &&
|
|
2008
|
+
t.nextRefresh(), n && R(n);
|
|
1988
2009
|
},
|
|
1989
2010
|
emit(n, ...o) {
|
|
1990
2011
|
t.vm.$emit(n, ...o);
|
|
@@ -1994,7 +2015,7 @@ function or(t) {
|
|
|
1994
2015
|
},
|
|
1995
2016
|
fetch(n) {
|
|
1996
2017
|
return new Promise((o, a) => {
|
|
1997
|
-
t.beforeFetch(n).then(() =>
|
|
2018
|
+
t.beforeFetch(n).then(() => ir(n).then(o).catch(a));
|
|
1998
2019
|
});
|
|
1999
2020
|
},
|
|
2000
2021
|
getData(n, o) {
|
|
@@ -2014,8 +2035,8 @@ function or(t) {
|
|
|
2014
2035
|
};
|
|
2015
2036
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2016
2037
|
}
|
|
2017
|
-
function
|
|
2018
|
-
|
|
2038
|
+
function sr(t) {
|
|
2039
|
+
p(t.prototype, {
|
|
2019
2040
|
initCache() {
|
|
2020
2041
|
this.clearCacheAll();
|
|
2021
2042
|
},
|
|
@@ -2048,35 +2069,35 @@ function ar(t) {
|
|
|
2048
2069
|
}
|
|
2049
2070
|
});
|
|
2050
2071
|
}
|
|
2051
|
-
function
|
|
2072
|
+
function I(t) {
|
|
2052
2073
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2053
2074
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2054
2075
|
});
|
|
2055
|
-
return
|
|
2076
|
+
return st(e);
|
|
2056
2077
|
}
|
|
2057
|
-
function
|
|
2078
|
+
function st(t) {
|
|
2058
2079
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2059
2080
|
}
|
|
2060
|
-
function
|
|
2081
|
+
function ot(t) {
|
|
2061
2082
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
2062
2083
|
}
|
|
2063
|
-
function
|
|
2084
|
+
function Q(t) {
|
|
2064
2085
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
2065
2086
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
2066
2087
|
}
|
|
2067
|
-
let
|
|
2068
|
-
function
|
|
2069
|
-
const t = 370 + ++
|
|
2088
|
+
let or = 0;
|
|
2089
|
+
function ee() {
|
|
2090
|
+
const t = 370 + ++or;
|
|
2070
2091
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
2071
2092
|
}
|
|
2072
|
-
function
|
|
2093
|
+
function Z(t, e, r) {
|
|
2073
2094
|
let i = t, s;
|
|
2074
2095
|
return (e || "").split(".").forEach((n) => {
|
|
2075
2096
|
s && ((!i[s] || typeof i[s] != "object") && (i[s] = {}), i = i[s]), s = n;
|
|
2076
2097
|
}), i[s] = r, i;
|
|
2077
2098
|
}
|
|
2078
|
-
function
|
|
2079
|
-
|
|
2099
|
+
function ar(t) {
|
|
2100
|
+
p(t.prototype, {
|
|
2080
2101
|
initRender() {
|
|
2081
2102
|
this.tempList = {}, this.clearOrgChildren();
|
|
2082
2103
|
},
|
|
@@ -2085,7 +2106,7 @@ function ur(t) {
|
|
|
2085
2106
|
this.orgChildren = Object.keys(e).reduce((r, i) => {
|
|
2086
2107
|
if (e[i].parser.loadChildren !== !1) {
|
|
2087
2108
|
const s = e[i].rule.children;
|
|
2088
|
-
r[i] =
|
|
2109
|
+
r[i] = f.trueArray(s) ? [...s] : [];
|
|
2089
2110
|
}
|
|
2090
2111
|
return r;
|
|
2091
2112
|
}, {});
|
|
@@ -2097,7 +2118,7 @@ function ur(t) {
|
|
|
2097
2118
|
const r = (i) => {
|
|
2098
2119
|
if (i) {
|
|
2099
2120
|
let s;
|
|
2100
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2121
|
+
return e.rule.field && (s = i.$scopedSlots["field-" + Q(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + Q(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2101
2122
|
}
|
|
2102
2123
|
};
|
|
2103
2124
|
return r(this.vm);
|
|
@@ -2116,38 +2137,38 @@ function ur(t) {
|
|
|
2116
2137
|
makeVm(e) {
|
|
2117
2138
|
const r = e.vm;
|
|
2118
2139
|
if (r) {
|
|
2119
|
-
if (
|
|
2120
|
-
return
|
|
2140
|
+
if (f.Function(r))
|
|
2141
|
+
return R(() => e.vm(this.$handle.getInjectData(e)));
|
|
2121
2142
|
if (!r._isVue)
|
|
2122
|
-
return new
|
|
2123
|
-
} else return new
|
|
2143
|
+
return new T(r);
|
|
2144
|
+
} else return new T();
|
|
2124
2145
|
return r;
|
|
2125
2146
|
},
|
|
2126
2147
|
mergeGlobal(e) {
|
|
2127
2148
|
const r = this.$handle.options.global;
|
|
2128
|
-
r && (e.cacheConfig || (e.cacheConfig = r[e.originType] || r[e.type] || r[e.trueType] || {}), e.prop =
|
|
2149
|
+
r && (e.cacheConfig || (e.cacheConfig = r[e.originType] || r[e.type] || r[e.trueType] || {}), e.prop = U({}, [r["*"], e.cacheConfig, e.prop]));
|
|
2129
2150
|
},
|
|
2130
2151
|
setOptions(e) {
|
|
2131
|
-
e.prop.optionsTo && e.prop.options &&
|
|
2152
|
+
e.prop.optionsTo && e.prop.options && Z(e.prop, e.prop.optionsTo, e.prop.options);
|
|
2132
2153
|
},
|
|
2133
2154
|
deepSet(e) {
|
|
2134
2155
|
const r = e.rule.deep;
|
|
2135
2156
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2136
|
-
|
|
2157
|
+
Z(e.prop, i, r[i]);
|
|
2137
2158
|
});
|
|
2138
2159
|
},
|
|
2139
2160
|
setTempProps(e, r) {
|
|
2140
2161
|
if (!e.$props) return;
|
|
2141
2162
|
const { prop: i } = r, s = Object.keys(e.$props), n = this.injectProp(r), o = Object.keys(n);
|
|
2142
2163
|
s.forEach((u) => {
|
|
2143
|
-
|
|
2164
|
+
O(i.props, u) ? e.$props[u] = i.props[u] : o.indexOf(u) > -1 && (e.$props[u] = n[u]);
|
|
2144
2165
|
});
|
|
2145
2166
|
const a = e.$options.model && e.$options.model.prop || "value";
|
|
2146
2167
|
s.indexOf(a) > -1 && (e.$props[a] = i.value);
|
|
2147
2168
|
},
|
|
2148
2169
|
renderTemp(e) {
|
|
2149
|
-
if (!
|
|
2150
|
-
return
|
|
2170
|
+
if (!T.compile)
|
|
2171
|
+
return zt("当前使用的Vue构建版本不支持compile,无法使用template功能"), [];
|
|
2151
2172
|
const r = e.prop, { id: i, key: s } = e;
|
|
2152
2173
|
if (!this.tempList[i]) {
|
|
2153
2174
|
e.el || (e.el = this.makeVm(r), this.vm.$nextTick(() => e.parser.mounted(e)));
|
|
@@ -2156,16 +2177,16 @@ function ur(t) {
|
|
|
2156
2177
|
this.onInput(e, l);
|
|
2157
2178
|
}), this.tempList[i] = {
|
|
2158
2179
|
vm: u,
|
|
2159
|
-
template:
|
|
2180
|
+
template: T.compile(r.template)
|
|
2160
2181
|
};
|
|
2161
2182
|
}
|
|
2162
2183
|
const { vm: n, template: o } = this.tempList[i];
|
|
2163
2184
|
this.setTempProps(n, e);
|
|
2164
2185
|
const a = o.render.call(n);
|
|
2165
|
-
return
|
|
2186
|
+
return f.Undef(a.data) && (a.data = {}), a.key = s, a.data.ref = e.ref, a.data.key = s, a;
|
|
2166
2187
|
},
|
|
2167
2188
|
parseSide(e, r) {
|
|
2168
|
-
return
|
|
2189
|
+
return f.Object(e) ? U({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2169
2190
|
},
|
|
2170
2191
|
renderSides(e, r, i) {
|
|
2171
2192
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2183,7 +2204,7 @@ function ur(t) {
|
|
|
2183
2204
|
const i = e.rule;
|
|
2184
2205
|
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2185
2206
|
let s, n = i.cache !== !1;
|
|
2186
|
-
const o = e.trueType, a = !(
|
|
2207
|
+
const o = e.trueType, a = !(f.Undef(i.display) || i.display);
|
|
2187
2208
|
if (o === "template" && !i.template)
|
|
2188
2209
|
s = this.renderSides(this.renderChildren(e), e, !0), a && this.display(s), s = this.item(e, s);
|
|
2189
2210
|
else if (o === "fcFragment")
|
|
@@ -2191,7 +2212,7 @@ function ur(t) {
|
|
|
2191
2212
|
else {
|
|
2192
2213
|
e.initProp(), this.mergeGlobal(e), this.$manager.tidyRule(e), this.deepSet(e), this.setOptions(e), this.ctxProp(e);
|
|
2193
2214
|
let u = e.prop;
|
|
2194
|
-
u.preview = !!(
|
|
2215
|
+
u.preview = !!(O(u, "preview") ? u.preview : this.options.preview), u.props.formCreateInject = this.injectProp(e);
|
|
2195
2216
|
const l = u.preview;
|
|
2196
2217
|
if (u.hidden) {
|
|
2197
2218
|
this.setCache(e, void 0, r);
|
|
@@ -2200,19 +2221,19 @@ function ur(t) {
|
|
|
2200
2221
|
if (o === "template" && u.template)
|
|
2201
2222
|
s = this.renderTemp(e), n = !1;
|
|
2202
2223
|
else {
|
|
2203
|
-
let
|
|
2204
|
-
e.parser.renderChildren ?
|
|
2205
|
-
const
|
|
2206
|
-
|
|
2224
|
+
let c = [];
|
|
2225
|
+
e.parser.renderChildren ? c = e.parser.renderChildren(e) : e.parser.loadChildren !== !1 && (c = this.renderChildren(e));
|
|
2226
|
+
const m = this.getTypeSlot(e);
|
|
2227
|
+
m ? s = m({
|
|
2207
2228
|
rule: i,
|
|
2208
2229
|
prop: u,
|
|
2209
2230
|
preview: l,
|
|
2210
|
-
children:
|
|
2231
|
+
children: c,
|
|
2211
2232
|
api: this.$handle.api,
|
|
2212
2233
|
model: u.model || {}
|
|
2213
|
-
}) : s = l ? e.parser.preview(
|
|
2234
|
+
}) : s = l ? e.parser.preview(c, e) : e.parser.render(c, e);
|
|
2214
2235
|
}
|
|
2215
|
-
s = this.renderSides(s, e), !(!e.input &&
|
|
2236
|
+
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);
|
|
2216
2237
|
}
|
|
2217
2238
|
return n && this.setCache(e, s, r), s;
|
|
2218
2239
|
}
|
|
@@ -2230,7 +2251,7 @@ function ur(t) {
|
|
|
2230
2251
|
},
|
|
2231
2252
|
none(e) {
|
|
2232
2253
|
if (e && e.data)
|
|
2233
|
-
return Array.isArray(e.data.style) ? e.data.style.push({ display: "none" }) :
|
|
2254
|
+
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;
|
|
2234
2255
|
},
|
|
2235
2256
|
item(e, r) {
|
|
2236
2257
|
return this.$h("fcFragment", {
|
|
@@ -2239,7 +2260,7 @@ function ur(t) {
|
|
|
2239
2260
|
}, [r]);
|
|
2240
2261
|
},
|
|
2241
2262
|
injectProp(e) {
|
|
2242
|
-
this.vm.ctxInject[e.id] ||
|
|
2263
|
+
this.vm.ctxInject[e.id] || w(this.vm.ctxInject, e.id, {
|
|
2243
2264
|
api: this.$handle.api,
|
|
2244
2265
|
form: this.fc.create,
|
|
2245
2266
|
subForm: (i) => {
|
|
@@ -2256,7 +2277,7 @@ function ur(t) {
|
|
|
2256
2277
|
input: e.input
|
|
2257
2278
|
});
|
|
2258
2279
|
const r = this.vm.ctxInject[e.id];
|
|
2259
|
-
return
|
|
2280
|
+
return p(r, {
|
|
2260
2281
|
preview: e.prop.preview,
|
|
2261
2282
|
options: e.prop.options,
|
|
2262
2283
|
children: e.rule.children,
|
|
@@ -2293,7 +2314,7 @@ function ur(t) {
|
|
|
2293
2314
|
this.onInput(e, o);
|
|
2294
2315
|
},
|
|
2295
2316
|
expression: `formData.${e.id}`
|
|
2296
|
-
}),
|
|
2317
|
+
}), D(n, e.prop), e.prop;
|
|
2297
2318
|
},
|
|
2298
2319
|
onMounted(e) {
|
|
2299
2320
|
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");
|
|
@@ -2302,8 +2323,8 @@ function ur(t) {
|
|
|
2302
2323
|
this.$handle.onInput(e, r);
|
|
2303
2324
|
},
|
|
2304
2325
|
renderChildren(e) {
|
|
2305
|
-
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !
|
|
2306
|
-
return !
|
|
2326
|
+
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !f.String(n) && n.__fc__ && !this.$handle.ctxs[n.__fc__.id];
|
|
2327
|
+
return !f.trueArray(r) && i ? (this.$handle.deferSyncValue(() => {
|
|
2307
2328
|
i.forEach((n) => {
|
|
2308
2329
|
n && s(n) && this.$handle.rmCtx(n.__fc__);
|
|
2309
2330
|
});
|
|
@@ -2313,7 +2334,7 @@ function ur(t) {
|
|
|
2313
2334
|
});
|
|
2314
2335
|
}), r.map((n) => {
|
|
2315
2336
|
if (n) {
|
|
2316
|
-
if (
|
|
2337
|
+
if (f.String(n)) return n;
|
|
2317
2338
|
if (n.__fc__)
|
|
2318
2339
|
return this.renderCtx(n.__fc__, e);
|
|
2319
2340
|
n.type && this.vm.$nextTick(() => {
|
|
@@ -2324,33 +2345,33 @@ function ur(t) {
|
|
|
2324
2345
|
},
|
|
2325
2346
|
defaultRender(e, r) {
|
|
2326
2347
|
const i = e.prop;
|
|
2327
|
-
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(
|
|
2348
|
+
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(st(e.originType), i, r);
|
|
2328
2349
|
},
|
|
2329
2350
|
renderRule(e, r, i) {
|
|
2330
2351
|
if (!e) return;
|
|
2331
|
-
if (
|
|
2352
|
+
if (f.String(e)) return e;
|
|
2332
2353
|
let s;
|
|
2333
2354
|
if (i)
|
|
2334
2355
|
s = e.type;
|
|
2335
2356
|
else if (s = e.is, e.type) {
|
|
2336
|
-
s =
|
|
2357
|
+
s = I(e.type);
|
|
2337
2358
|
const o = this.vNode.aliasMap[s];
|
|
2338
|
-
o && (s =
|
|
2359
|
+
o && (s = I(o));
|
|
2339
2360
|
}
|
|
2340
2361
|
if (!s) return;
|
|
2341
2362
|
let n = [[r]];
|
|
2342
|
-
return
|
|
2363
|
+
return f.trueArray(e.children) && n.push(e.children.map((o) => this.renderRule(o))), this.$h(s, y({}, e), n);
|
|
2343
2364
|
}
|
|
2344
2365
|
});
|
|
2345
2366
|
}
|
|
2346
|
-
function
|
|
2347
|
-
|
|
2367
|
+
function $e(t) {
|
|
2368
|
+
p(this, {
|
|
2348
2369
|
$handle: t,
|
|
2349
2370
|
fc: t.fc,
|
|
2350
2371
|
vm: t.vm,
|
|
2351
2372
|
$manager: t.$manager,
|
|
2352
2373
|
vNode: new t.fc.CreateNode(t.vm)
|
|
2353
|
-
}),
|
|
2374
|
+
}), et(this, {
|
|
2354
2375
|
options() {
|
|
2355
2376
|
return t.options;
|
|
2356
2377
|
},
|
|
@@ -2359,10 +2380,10 @@ function be(t) {
|
|
|
2359
2380
|
}
|
|
2360
2381
|
}), this.initCache(), this.initRender();
|
|
2361
2382
|
}
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
function
|
|
2365
|
-
|
|
2383
|
+
sr($e);
|
|
2384
|
+
ar($e);
|
|
2385
|
+
function lr(t) {
|
|
2386
|
+
p(t.prototype, {
|
|
2366
2387
|
parseInjectEvent(e, r) {
|
|
2367
2388
|
const i = e.inject || this.options.injectEvent;
|
|
2368
2389
|
return this.parseEventLst(e, r, i);
|
|
@@ -2374,31 +2395,31 @@ function fr(t) {
|
|
|
2374
2395
|
}), r;
|
|
2375
2396
|
},
|
|
2376
2397
|
parseEvent(e, r, i, s) {
|
|
2377
|
-
if (
|
|
2398
|
+
if (f.Function(r) && (i !== !1 && !f.Undef(i) || r.__inject))
|
|
2378
2399
|
return this.inject(e, r, i);
|
|
2379
|
-
if (!s && Array.isArray(r) && r[0] && (
|
|
2400
|
+
if (!s && Array.isArray(r) && r[0] && (f.String(r[0]) || f.Function(r[0])))
|
|
2380
2401
|
return this.parseEventLst(e, r, i, !0);
|
|
2381
|
-
if (
|
|
2382
|
-
const n =
|
|
2402
|
+
if (f.String(r)) {
|
|
2403
|
+
const n = q(r);
|
|
2383
2404
|
if (n && r !== n)
|
|
2384
2405
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2385
2406
|
}
|
|
2386
2407
|
},
|
|
2387
2408
|
parseEmit(e, r) {
|
|
2388
2409
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: u } = s, l = s[r ? "emit" : "nativeEmit"] || [];
|
|
2389
|
-
return
|
|
2390
|
-
if (!
|
|
2391
|
-
let
|
|
2392
|
-
if (
|
|
2393
|
-
r || (
|
|
2394
|
-
const
|
|
2395
|
-
this.vm.$emit(
|
|
2410
|
+
return f.trueArray(l) && l.forEach((c) => {
|
|
2411
|
+
if (!c) return;
|
|
2412
|
+
let m, v = n || o || a;
|
|
2413
|
+
if (f.Object(c) && (m = c.inject, c = c.name, v = c.prefix || v), v) {
|
|
2414
|
+
r || (v = `native-${v}`);
|
|
2415
|
+
const _ = Q(`${v}-${c}`), g = (...k) => {
|
|
2416
|
+
this.vm.$emit(_, ...k), this.vm.$emit("emit-event", _, ...k);
|
|
2396
2417
|
};
|
|
2397
|
-
if (
|
|
2398
|
-
i[
|
|
2418
|
+
if (g.__emit = !0, !m && u === !1)
|
|
2419
|
+
i[c] = g;
|
|
2399
2420
|
else {
|
|
2400
|
-
let
|
|
2401
|
-
i[
|
|
2421
|
+
let k = m || u || this.options.injectEvent;
|
|
2422
|
+
i[c] = f.Undef(k) ? g : this.inject(s, g, k);
|
|
2402
2423
|
}
|
|
2403
2424
|
}
|
|
2404
2425
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2428,14 +2449,14 @@ function fr(t) {
|
|
|
2428
2449
|
}
|
|
2429
2450
|
});
|
|
2430
2451
|
}
|
|
2431
|
-
const
|
|
2432
|
-
function
|
|
2433
|
-
|
|
2452
|
+
const De = ["hook:updated", "hook:mounted"];
|
|
2453
|
+
function ur(t) {
|
|
2454
|
+
p(t.prototype, {
|
|
2434
2455
|
usePage() {
|
|
2435
2456
|
const e = this.options.page;
|
|
2436
2457
|
if (!e) return;
|
|
2437
|
-
let r = 25, i =
|
|
2438
|
-
|
|
2458
|
+
let r = 25, i = hr(this.rules);
|
|
2459
|
+
f.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), p(this, {
|
|
2439
2460
|
first: r,
|
|
2440
2461
|
limit: i,
|
|
2441
2462
|
pageEnd: this.rules.length <= r
|
|
@@ -2443,17 +2464,17 @@ function hr(t) {
|
|
|
2443
2464
|
},
|
|
2444
2465
|
pageLoad() {
|
|
2445
2466
|
const e = () => {
|
|
2446
|
-
this.pageEnd ? (this.vm.$off(
|
|
2467
|
+
this.pageEnd ? (this.vm.$off(De, e), this.bus.$emit("page-end")) : (this.first += this.limit, this.pageEnd = this.rules.length <= this.first, this.loadRule(), this.refresh());
|
|
2447
2468
|
};
|
|
2448
|
-
this.vm.$on(
|
|
2469
|
+
this.vm.$on(De, e);
|
|
2449
2470
|
}
|
|
2450
2471
|
});
|
|
2451
2472
|
}
|
|
2452
|
-
function
|
|
2473
|
+
function hr(t) {
|
|
2453
2474
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2454
2475
|
}
|
|
2455
|
-
function
|
|
2456
|
-
|
|
2476
|
+
function fr(t) {
|
|
2477
|
+
p(t.prototype, {
|
|
2457
2478
|
clearNextTick() {
|
|
2458
2479
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
2459
2480
|
},
|
|
@@ -2467,14 +2488,14 @@ function dr(t) {
|
|
|
2467
2488
|
}
|
|
2468
2489
|
});
|
|
2469
2490
|
}
|
|
2470
|
-
function
|
|
2491
|
+
function cr(t) {
|
|
2471
2492
|
Object.defineProperties(t.origin, {
|
|
2472
|
-
__fc__:
|
|
2493
|
+
__fc__: Ze(t, !0)
|
|
2473
2494
|
});
|
|
2474
2495
|
}
|
|
2475
|
-
function
|
|
2476
|
-
const i =
|
|
2477
|
-
|
|
2496
|
+
function at(t, e, r) {
|
|
2497
|
+
const i = ee();
|
|
2498
|
+
p(this, {
|
|
2478
2499
|
id: i,
|
|
2479
2500
|
ref: i,
|
|
2480
2501
|
wrapRef: i + "fi",
|
|
@@ -2493,11 +2514,11 @@ function ut(t, e, r) {
|
|
|
2493
2514
|
input: !!e.field,
|
|
2494
2515
|
el: void 0,
|
|
2495
2516
|
exportEl: void 0,
|
|
2496
|
-
defaultValue: e.field ?
|
|
2517
|
+
defaultValue: e.field ? L(r) : void 0,
|
|
2497
2518
|
field: e.field || void 0
|
|
2498
|
-
}), this.
|
|
2519
|
+
}), this.updateKey(), cr(this), this.update(t, !0);
|
|
2499
2520
|
}
|
|
2500
|
-
|
|
2521
|
+
p(at.prototype, {
|
|
2501
2522
|
effectData(t) {
|
|
2502
2523
|
return this.payload[t] || (this.payload[t] = {}), this.payload[t];
|
|
2503
2524
|
},
|
|
@@ -2505,21 +2526,21 @@ m(ut.prototype, {
|
|
|
2505
2526
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2506
2527
|
},
|
|
2507
2528
|
updateKey(t) {
|
|
2508
|
-
this.key =
|
|
2529
|
+
this.key = ee(), t && this.parent && this.parent.updateKey(t);
|
|
2509
2530
|
},
|
|
2510
2531
|
updateType() {
|
|
2511
|
-
this.originType = this.rule.type, this.type =
|
|
2532
|
+
this.originType = this.rule.type, this.type = I(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
2512
2533
|
},
|
|
2513
2534
|
setParser(t) {
|
|
2514
2535
|
this.parser = t, t.init(this);
|
|
2515
2536
|
},
|
|
2516
2537
|
initProp() {
|
|
2517
2538
|
const t = y({}, this.rule);
|
|
2518
|
-
delete t.children, this.prop =
|
|
2539
|
+
delete t.children, this.prop = U({}, [t, ...Object.keys(this.payload).map((e) => this.payload[e]), this.computed]);
|
|
2519
2540
|
},
|
|
2520
2541
|
injectValidate() {
|
|
2521
|
-
return
|
|
2522
|
-
if (
|
|
2542
|
+
return j(this.prop.validate).map((t) => {
|
|
2543
|
+
if (f.Function(t.validator)) {
|
|
2523
2544
|
const e = y({}, t), r = this;
|
|
2524
2545
|
return e.validator = function(...i) {
|
|
2525
2546
|
return t.validator.call({
|
|
@@ -2550,7 +2571,7 @@ m(ut.prototype, {
|
|
|
2550
2571
|
this.$handle.watchCtx(this);
|
|
2551
2572
|
},
|
|
2552
2573
|
delete() {
|
|
2553
|
-
this.unwatch(), this.unlink(), this.rmCtrl(),
|
|
2574
|
+
this.unwatch(), this.unlink(), this.rmCtrl(), p(this, {
|
|
2554
2575
|
deleted: !0,
|
|
2555
2576
|
prop: y({}, this.rule),
|
|
2556
2577
|
computed: {},
|
|
@@ -2578,28 +2599,27 @@ m(ut.prototype, {
|
|
|
2578
2599
|
}
|
|
2579
2600
|
this.$handle.noWatch(() => {
|
|
2580
2601
|
this.$handle.deferSyncValue(() => {
|
|
2581
|
-
this.rmCtrl(), t(), this.$handle.rmCtx(this),
|
|
2602
|
+
this.rmCtrl(), t(), this.$handle.rmCtx(this), p(this, {
|
|
2582
2603
|
root: []
|
|
2583
2604
|
});
|
|
2584
2605
|
}, this.input);
|
|
2585
2606
|
});
|
|
2586
2607
|
},
|
|
2587
2608
|
update(t, e) {
|
|
2588
|
-
|
|
2609
|
+
p(this, {
|
|
2589
2610
|
deleted: !1,
|
|
2590
2611
|
$handle: t,
|
|
2591
2612
|
$render: t.$render,
|
|
2592
2613
|
$api: t.api,
|
|
2593
2614
|
vm: t.vm,
|
|
2594
|
-
trueType: t.getType(this.originType),
|
|
2595
2615
|
vNode: t.$render.vNode,
|
|
2596
2616
|
updated: !1,
|
|
2597
2617
|
cacheValue: this.rule.value
|
|
2598
|
-
}), !e && this.unwatch(), this.watchTo(), this.link();
|
|
2618
|
+
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2599
2619
|
}
|
|
2600
2620
|
});
|
|
2601
|
-
function
|
|
2602
|
-
|
|
2621
|
+
function dr(t) {
|
|
2622
|
+
p(t.prototype, {
|
|
2603
2623
|
nextRefresh(e) {
|
|
2604
2624
|
const r = this.loadedId;
|
|
2605
2625
|
this.vm.$nextTick(() => {
|
|
@@ -2607,12 +2627,12 @@ function mr(t) {
|
|
|
2607
2627
|
});
|
|
2608
2628
|
},
|
|
2609
2629
|
parseRule(e) {
|
|
2610
|
-
const r =
|
|
2630
|
+
const r = Ae(e);
|
|
2611
2631
|
return Object.defineProperties(r, {
|
|
2612
|
-
__origin__:
|
|
2613
|
-
}),
|
|
2632
|
+
__origin__: Ze(e, !0)
|
|
2633
|
+
}), pr(r), this.appendValue(r), r.options = Array.isArray(r.options) ? r.options : [], [r, r.prefix, r.suffix].forEach((i) => {
|
|
2614
2634
|
i && this.loadFn(i, r);
|
|
2615
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
2635
|
+
}), this.loadCtrl(r), r.update && (r.update = q(r.update)), r;
|
|
2616
2636
|
},
|
|
2617
2637
|
loadFn(e, r) {
|
|
2618
2638
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -2621,12 +2641,12 @@ function mr(t) {
|
|
|
2621
2641
|
},
|
|
2622
2642
|
loadCtrl(e) {
|
|
2623
2643
|
e.control && e.control.forEach((r) => {
|
|
2624
|
-
r.handle && (r.handle =
|
|
2644
|
+
r.handle && (r.handle = q(r.handle));
|
|
2625
2645
|
});
|
|
2626
2646
|
},
|
|
2627
2647
|
syncProp(e) {
|
|
2628
2648
|
const r = e.rule;
|
|
2629
|
-
|
|
2649
|
+
f.trueArray(r.sync) && D([{
|
|
2630
2650
|
on: r.sync.reduce((i, s) => (i[`update:${s}`] = (n) => {
|
|
2631
2651
|
r.props[s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
2632
2652
|
}, i), {})
|
|
@@ -2652,97 +2672,97 @@ function mr(t) {
|
|
|
2652
2672
|
let a = this.sort.indexOf(o.__fc__.id);
|
|
2653
2673
|
return a > -1 ? a : i(n - 1);
|
|
2654
2674
|
}, s = (n, o) => {
|
|
2655
|
-
|
|
2675
|
+
f.trueArray(n) && this._loadRule(n, o);
|
|
2656
2676
|
};
|
|
2657
2677
|
e.map((n, o) => {
|
|
2658
|
-
if (r && !
|
|
2678
|
+
if (r && !f.Object(n) || !this.pageEnd && !r && o >= this.first) return;
|
|
2659
2679
|
if (n.__fc__ && n.__fc__.root === e && this.ctxs[n.__fc__.id])
|
|
2660
2680
|
return s(n.__fc__.rule.children, n.__fc__), n.__fc__;
|
|
2661
|
-
let a =
|
|
2681
|
+
let a = Ae(n);
|
|
2662
2682
|
const u = () => !!(a.field && this.fieldCtx[a.field] && this.fieldCtx[a.field][0] !== n.__fc__);
|
|
2663
2683
|
this.ruleEffect(a, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", n, this.api);
|
|
2664
|
-
let l,
|
|
2665
|
-
if (
|
|
2666
|
-
l = n.__fc__,
|
|
2667
|
-
const
|
|
2684
|
+
let l, c = !1, m = !!n.__fc__, v = a.value;
|
|
2685
|
+
if (m) {
|
|
2686
|
+
l = n.__fc__, v = l.defaultValue;
|
|
2687
|
+
const g = !l.check(this);
|
|
2668
2688
|
if (l.deleted) {
|
|
2669
|
-
if (
|
|
2670
|
-
if (
|
|
2689
|
+
if (g) {
|
|
2690
|
+
if (Be(l))
|
|
2671
2691
|
return;
|
|
2672
2692
|
l.update(this);
|
|
2673
2693
|
}
|
|
2674
|
-
} else if (
|
|
2675
|
-
if (
|
|
2694
|
+
} else if (g) {
|
|
2695
|
+
if (Be(l))
|
|
2676
2696
|
return;
|
|
2677
|
-
e[o] = n = n._clone ? n._clone() :
|
|
2697
|
+
e[o] = n = n._clone ? n._clone() : ye(n), l = null, c = !0;
|
|
2678
2698
|
}
|
|
2679
2699
|
}
|
|
2680
2700
|
if (l)
|
|
2681
2701
|
l.originType !== l.rule.type && l.updateType(), this.bindParser(l), this.appendValue(l.rule);
|
|
2682
2702
|
else {
|
|
2683
|
-
const
|
|
2684
|
-
l = new
|
|
2703
|
+
const g = this.parseRule(n);
|
|
2704
|
+
l = new at(this, g, v), this.bindParser(l);
|
|
2685
2705
|
}
|
|
2686
|
-
if ([!1, !0].forEach((
|
|
2687
|
-
const
|
|
2688
|
-
|
|
2706
|
+
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) {
|
|
2707
|
+
const g = i(o);
|
|
2708
|
+
g > -1 || !o ? this.sort.splice(g + 1, 0, l.id) : this.sort.push(l.id);
|
|
2689
2709
|
}
|
|
2690
|
-
const
|
|
2691
|
-
return l.updated || (l.updated = !0,
|
|
2692
|
-
this.refreshUpdate(l,
|
|
2693
|
-
}), this.effect(l, "loaded")), l.input && Object.defineProperty(
|
|
2710
|
+
const _ = l.rule;
|
|
2711
|
+
return l.updated || (l.updated = !0, f.Function(_.update) && this.bus.$once("load-end", () => {
|
|
2712
|
+
this.refreshUpdate(l, _.value, "init");
|
|
2713
|
+
}), this.effect(l, "loaded")), l.input && Object.defineProperty(_, "value", this.valueHandle(l)), this.refreshControl(l) && (this.cycleLoad = !0), l;
|
|
2694
2714
|
});
|
|
2695
2715
|
},
|
|
2696
2716
|
refreshControl(e) {
|
|
2697
2717
|
return e.input && e.rule.control && this.useCtrl(e);
|
|
2698
2718
|
},
|
|
2699
2719
|
useCtrl(e) {
|
|
2700
|
-
const r =
|
|
2720
|
+
const r = mr(e), i = [], s = this.api;
|
|
2701
2721
|
if (!r.length) return !1;
|
|
2702
2722
|
for (let a = 0; a < r.length; a++) {
|
|
2703
|
-
const u = r[a], l = u.handle || function(
|
|
2704
|
-
return (
|
|
2723
|
+
const u = r[a], l = u.handle || function(m) {
|
|
2724
|
+
return (J[u.condition || "=="] || J["=="])(m, u.value);
|
|
2705
2725
|
};
|
|
2706
|
-
if (!
|
|
2707
|
-
const
|
|
2708
|
-
valid:
|
|
2709
|
-
ctrl:
|
|
2710
|
-
isHidden:
|
|
2726
|
+
if (!f.trueArray(u.rule)) continue;
|
|
2727
|
+
const c = N(y({}, u), {
|
|
2728
|
+
valid: R(() => l(e.rule.value, s)),
|
|
2729
|
+
ctrl: yr(e, u.rule),
|
|
2730
|
+
isHidden: f.String(u.rule[0])
|
|
2711
2731
|
});
|
|
2712
|
-
|
|
2732
|
+
c.valid && c.ctrl || !c.valid && !c.ctrl && !c.isHidden || i.push(c);
|
|
2713
2733
|
}
|
|
2714
2734
|
if (!i.length) return !1;
|
|
2715
2735
|
const n = [];
|
|
2716
2736
|
let o = !1;
|
|
2717
2737
|
return this.deferSyncValue(() => {
|
|
2718
|
-
i.reverse().forEach(({ isHidden: a, valid: u, rule: l, prepend:
|
|
2738
|
+
i.reverse().forEach(({ isHidden: a, valid: u, rule: l, prepend: c, append: m, child: v, ctrl: _, method: g }) => {
|
|
2719
2739
|
if (a) {
|
|
2720
2740
|
u ? e.ctrlRule.push({
|
|
2721
2741
|
__ctrl: !0,
|
|
2722
2742
|
children: l,
|
|
2723
2743
|
valid: u
|
|
2724
|
-
}) :
|
|
2725
|
-
|
|
2726
|
-
this.api.setEffect(
|
|
2744
|
+
}) : _ && e.ctrlRule.splice(e.ctrlRule.indexOf(_) >>> 0, 1), n[u ? "push" : "unshift"](() => {
|
|
2745
|
+
g === "disabled" || g === "enabled" ? this.api.disabled(!u, l) : g === "display" ? this.api.display(u, l) : g === "required" ? (l.forEach((k) => {
|
|
2746
|
+
this.api.setEffect(k, "required", u);
|
|
2727
2747
|
}), u || this.api.clearValidateState(l)) : this.api.hidden(!u, l);
|
|
2728
2748
|
});
|
|
2729
2749
|
return;
|
|
2730
2750
|
}
|
|
2731
2751
|
if (u) {
|
|
2732
2752
|
o = !0;
|
|
2733
|
-
const
|
|
2753
|
+
const k = {
|
|
2734
2754
|
type: "fcFragment",
|
|
2735
2755
|
native: !0,
|
|
2736
2756
|
__ctrl: !0,
|
|
2737
2757
|
children: l
|
|
2738
2758
|
};
|
|
2739
|
-
e.ctrlRule.push(
|
|
2740
|
-
|
|
2759
|
+
e.ctrlRule.push(k), this.bus.$once("load-start", () => {
|
|
2760
|
+
c ? s.prepend(k, c, v) : m || v ? s.append(k, m || e.id, v) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, k);
|
|
2741
2761
|
});
|
|
2742
2762
|
} else {
|
|
2743
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
2744
|
-
const
|
|
2745
|
-
|
|
2763
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(_), 1);
|
|
2764
|
+
const k = z(_);
|
|
2765
|
+
k && k.rm();
|
|
2746
2766
|
}
|
|
2747
2767
|
});
|
|
2748
2768
|
}), n.length && this.vm.$nextTick(() => {
|
|
@@ -2759,7 +2779,7 @@ function mr(t) {
|
|
|
2759
2779
|
this.bus.$once("load-end", () => {
|
|
2760
2780
|
Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
|
|
2761
2781
|
}), this.reloading = !0, this.loadRule(), this.reloading = !1, this.refresh(), this.vm.$emit("reloading", this.api);
|
|
2762
|
-
}), this.
|
|
2782
|
+
}), this.vm.$emit("update", this.api);
|
|
2763
2783
|
},
|
|
2764
2784
|
//todo 组件生成全部通过 alias
|
|
2765
2785
|
refresh() {
|
|
@@ -2767,30 +2787,30 @@ function mr(t) {
|
|
|
2767
2787
|
}
|
|
2768
2788
|
});
|
|
2769
2789
|
}
|
|
2770
|
-
function
|
|
2771
|
-
const e =
|
|
2790
|
+
function pr(t) {
|
|
2791
|
+
const e = tt();
|
|
2772
2792
|
return Object.keys(e).forEach((r) => {
|
|
2773
|
-
|
|
2793
|
+
O(t, r) || w(t, r, e[r]);
|
|
2774
2794
|
}), t;
|
|
2775
2795
|
}
|
|
2776
|
-
function
|
|
2796
|
+
function mr(t) {
|
|
2777
2797
|
const e = t.rule.control || [];
|
|
2778
|
-
return
|
|
2798
|
+
return f.Object(e) ? [e] : e;
|
|
2779
2799
|
}
|
|
2780
|
-
function
|
|
2800
|
+
function yr(t, e) {
|
|
2781
2801
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
2782
2802
|
const i = t.ctrlRule[r];
|
|
2783
2803
|
if (i.children === e)
|
|
2784
2804
|
return i;
|
|
2785
2805
|
}
|
|
2786
2806
|
}
|
|
2787
|
-
function
|
|
2807
|
+
function Be(t) {
|
|
2788
2808
|
return !!t.rule.__ctrl;
|
|
2789
2809
|
}
|
|
2790
|
-
function
|
|
2791
|
-
|
|
2810
|
+
function gr(t) {
|
|
2811
|
+
p(t.prototype, {
|
|
2792
2812
|
getValue(e) {
|
|
2793
|
-
return
|
|
2813
|
+
return f.Undef(e.cacheValue) && (e.cacheValue = e.parser.toValue(this.getFormData(e), e)), e.cacheValue;
|
|
2794
2814
|
},
|
|
2795
2815
|
setValue(e, r, i, s) {
|
|
2796
2816
|
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, {
|
|
@@ -2804,20 +2824,20 @@ function vr(t) {
|
|
|
2804
2824
|
e.input && (this.isQuote(e, i = e.parser.toValue(r, e)) || this.isChange(e, i)) && this.setValue(e, i, r);
|
|
2805
2825
|
},
|
|
2806
2826
|
setFormData(e, r) {
|
|
2807
|
-
|
|
2827
|
+
w(this.formData, e.id, r === null ? void 0 : r);
|
|
2808
2828
|
},
|
|
2809
2829
|
getFormData(e) {
|
|
2810
2830
|
return this.formData[e.id];
|
|
2811
2831
|
},
|
|
2812
2832
|
validate() {
|
|
2813
|
-
return
|
|
2833
|
+
return Me(this.vm.validate), this.fields().forEach((e) => {
|
|
2814
2834
|
this.fieldCtx[e].forEach((r) => {
|
|
2815
|
-
this.vm.validate[r.id] =
|
|
2835
|
+
this.vm.validate[r.id] = j(r.rule.validate);
|
|
2816
2836
|
});
|
|
2817
2837
|
}), this.vm.validate;
|
|
2818
2838
|
},
|
|
2819
2839
|
syncForm() {
|
|
2820
|
-
|
|
2840
|
+
Me(this.form), Object.defineProperties(this.form, this.fields().reduce((e, r) => {
|
|
2821
2841
|
const i = this.getFieldCtx(r), s = this.valueHandle(i);
|
|
2822
2842
|
return s.configurable = !0, e[r] = s, e;
|
|
2823
2843
|
}, this.options.appendValue !== !1 ? Object.keys(this.appendData).reduce((e, r) => (e[r] = {
|
|
@@ -2839,13 +2859,13 @@ function vr(t) {
|
|
|
2839
2859
|
};
|
|
2840
2860
|
},
|
|
2841
2861
|
appendValue(e) {
|
|
2842
|
-
!e.field || !
|
|
2862
|
+
!e.field || !O(this.appendData, e.field) || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
2843
2863
|
},
|
|
2844
2864
|
addSubForm(e, r) {
|
|
2845
2865
|
this.subForm[e.id] = r;
|
|
2846
2866
|
},
|
|
2847
2867
|
deferSyncValue(e, r) {
|
|
2848
|
-
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r),
|
|
2868
|
+
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r), R(e), this.deferSyncFn === e && (this.deferSyncFn = null, e.sync && this.syncValue());
|
|
2849
2869
|
},
|
|
2850
2870
|
syncValue() {
|
|
2851
2871
|
if (this.deferSyncFn)
|
|
@@ -2853,14 +2873,14 @@ function vr(t) {
|
|
|
2853
2873
|
this.vm._updateValue(y(y({}, this.options.appendValue !== !1 ? this.appendData : {}), this.form));
|
|
2854
2874
|
},
|
|
2855
2875
|
isChange(e, r) {
|
|
2856
|
-
return JSON.stringify(e.rule.value,
|
|
2876
|
+
return JSON.stringify(e.rule.value, Le) !== JSON.stringify(r === null ? void 0 : r, Le);
|
|
2857
2877
|
},
|
|
2858
2878
|
isQuote(e, r) {
|
|
2859
|
-
return (
|
|
2879
|
+
return (f.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
2860
2880
|
},
|
|
2861
2881
|
refreshUpdate(e, r, i, s) {
|
|
2862
|
-
if (
|
|
2863
|
-
const n =
|
|
2882
|
+
if (f.Function(e.rule.update)) {
|
|
2883
|
+
const n = R(() => e.rule.update(r, e.origin, this.api, {
|
|
2864
2884
|
origin: i || "change",
|
|
2865
2885
|
linkField: s
|
|
2866
2886
|
}));
|
|
@@ -2876,7 +2896,7 @@ function vr(t) {
|
|
|
2876
2896
|
},
|
|
2877
2897
|
appendLink(e) {
|
|
2878
2898
|
const r = e.rule.link;
|
|
2879
|
-
|
|
2899
|
+
f.trueArray(r) && r.forEach((i) => {
|
|
2880
2900
|
const s = () => this.refreshRule(e, e.rule.value, "link", i);
|
|
2881
2901
|
this.bus.$on("change-" + i, s), e.linkOn.push(() => this.bus.$off("change-" + i, s));
|
|
2882
2902
|
});
|
|
@@ -2886,13 +2906,13 @@ function vr(t) {
|
|
|
2886
2906
|
}
|
|
2887
2907
|
});
|
|
2888
2908
|
}
|
|
2889
|
-
function
|
|
2909
|
+
function Le(t, e) {
|
|
2890
2910
|
return typeof e == "function" ? "" + e : e;
|
|
2891
2911
|
}
|
|
2892
|
-
function
|
|
2912
|
+
function Me(t) {
|
|
2893
2913
|
Object.keys(t).forEach((e) => delete t[e]);
|
|
2894
2914
|
}
|
|
2895
|
-
const
|
|
2915
|
+
const he = {
|
|
2896
2916
|
init(t) {
|
|
2897
2917
|
},
|
|
2898
2918
|
toFormValue(t, e) {
|
|
@@ -2911,9 +2931,9 @@ const ce = {
|
|
|
2911
2931
|
},
|
|
2912
2932
|
mergeProp(t) {
|
|
2913
2933
|
}
|
|
2914
|
-
},
|
|
2915
|
-
function
|
|
2916
|
-
|
|
2934
|
+
}, $r = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "component", "cache"];
|
|
2935
|
+
function vr(t) {
|
|
2936
|
+
p(t.prototype, {
|
|
2917
2937
|
getCtx(e) {
|
|
2918
2938
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
2919
2939
|
},
|
|
@@ -2942,21 +2962,21 @@ function Cr(t) {
|
|
|
2942
2962
|
},
|
|
2943
2963
|
getParser(e) {
|
|
2944
2964
|
const r = this.fc.parsers;
|
|
2945
|
-
return r[e.originType] || r[
|
|
2965
|
+
return r[e.originType] || r[I(e.type)] || r[e.trueType] || he;
|
|
2946
2966
|
},
|
|
2947
2967
|
bindParser(e) {
|
|
2948
2968
|
e.setParser(this.getParser(e));
|
|
2949
2969
|
},
|
|
2950
2970
|
getType(e) {
|
|
2951
|
-
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[
|
|
2952
|
-
return
|
|
2971
|
+
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[I(e)] || e;
|
|
2972
|
+
return I(i);
|
|
2953
2973
|
},
|
|
2954
2974
|
noWatch(e) {
|
|
2955
|
-
this.noWatchFn || (this.noWatchFn = e),
|
|
2975
|
+
this.noWatchFn || (this.noWatchFn = e), R(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
2956
2976
|
},
|
|
2957
2977
|
watchCtx(e) {
|
|
2958
2978
|
const r = this.vm;
|
|
2959
|
-
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" &&
|
|
2979
|
+
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" && $r.indexOf(i) === -1).forEach((i) => {
|
|
2960
2980
|
const s = i === "children";
|
|
2961
2981
|
e.watch.push(r.$watch(() => e.rule[i], (n, o) => {
|
|
2962
2982
|
if (!(this.loading || this.noWatchFn || this.reloading)) {
|
|
@@ -2976,7 +2996,7 @@ function Cr(t) {
|
|
|
2976
2996
|
else if (i === "type")
|
|
2977
2997
|
e.updateType(), this.bindParser(e);
|
|
2978
2998
|
else if (i === "children") {
|
|
2979
|
-
const a =
|
|
2999
|
+
const a = f.trueArray(n);
|
|
2980
3000
|
this.deferSyncValue(() => {
|
|
2981
3001
|
n !== o && (this.rmSub(o, e), this.$render.initOrgChildren()), a && this.loadChildren(n, e), this.vm.$emit("update", this.api);
|
|
2982
3002
|
});
|
|
@@ -2987,7 +3007,7 @@ function Cr(t) {
|
|
|
2987
3007
|
}), this.watchEffect(e);
|
|
2988
3008
|
},
|
|
2989
3009
|
rmSub(e, r) {
|
|
2990
|
-
|
|
3010
|
+
f.trueArray(e) && e.forEach((i) => {
|
|
2991
3011
|
i && i.__fc__ && i.__fc__.parent === r && this.rmCtx(i.__fc__);
|
|
2992
3012
|
});
|
|
2993
3013
|
},
|
|
@@ -2997,16 +3017,16 @@ function Cr(t) {
|
|
|
2997
3017
|
e.input && Object.defineProperty(e.rule, "value", {
|
|
2998
3018
|
value: e.rule.value,
|
|
2999
3019
|
writable: !0
|
|
3000
|
-
}),
|
|
3001
|
-
this.reloading || (e.parser.loadChildren !== !1 &&
|
|
3020
|
+
}), B(this.ctxs, r), B(this.$render.tempList, r), B(this.$render.orgChildren, r), B(this.vm.ctxInject, r), B(this.formData, r), B(this.subForm, r), B(e, "cacheValue"), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !O(this.fieldCtx, i) && B(this.form, i), this.deferSyncValue(() => {
|
|
3021
|
+
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());
|
|
3002
3022
|
}, s);
|
|
3003
3023
|
const o = this.sort.indexOf(r);
|
|
3004
3024
|
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;
|
|
3005
3025
|
}
|
|
3006
3026
|
});
|
|
3007
3027
|
}
|
|
3008
|
-
function
|
|
3009
|
-
|
|
3028
|
+
function br(t) {
|
|
3029
|
+
p(t.prototype, {
|
|
3010
3030
|
mounted() {
|
|
3011
3031
|
const e = () => {
|
|
3012
3032
|
this.isMounted = !0, this.lifecycle("mounted");
|
|
@@ -3016,23 +3036,26 @@ function _r(t) {
|
|
|
3016
3036
|
lifecycle(e) {
|
|
3017
3037
|
this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3018
3038
|
},
|
|
3039
|
+
targetReload() {
|
|
3040
|
+
this.bus.$off("next-tick", this.nextReload), this.bus.$once("next-tick", this.nextReload);
|
|
3041
|
+
},
|
|
3019
3042
|
emitEvent(e, ...r) {
|
|
3020
|
-
const i = this.options[e] || this.options[
|
|
3043
|
+
const i = this.options[e] || this.options[I("on-" + e)];
|
|
3021
3044
|
if (i) {
|
|
3022
|
-
const s =
|
|
3023
|
-
|
|
3045
|
+
const s = q(i);
|
|
3046
|
+
f.Function(s) && R(() => s(...r));
|
|
3024
3047
|
}
|
|
3025
3048
|
this.bus.$emit(e, ...r);
|
|
3026
3049
|
}
|
|
3027
3050
|
});
|
|
3028
3051
|
}
|
|
3029
|
-
function
|
|
3030
|
-
|
|
3052
|
+
function Cr(t) {
|
|
3053
|
+
p(t.prototype, {
|
|
3031
3054
|
useProvider() {
|
|
3032
3055
|
const e = this.fc.providers;
|
|
3033
3056
|
Object.keys(e).forEach((r) => {
|
|
3034
3057
|
let i = e[r];
|
|
3035
|
-
|
|
3058
|
+
f.Function(i) && (i = i(this.fc)), i._c = kr(i), this.onEffect(i), this.providers[r] = i;
|
|
3036
3059
|
});
|
|
3037
3060
|
},
|
|
3038
3061
|
onEffect(e) {
|
|
@@ -3049,7 +3072,7 @@ function kr(t) {
|
|
|
3049
3072
|
let i = {
|
|
3050
3073
|
required: () => {
|
|
3051
3074
|
var s, n;
|
|
3052
|
-
return (
|
|
3075
|
+
return (O(e.rule, "$required") ? e.rule.$required : (n = (s = e.rule) == null ? void 0 : s.effect) == null ? void 0 : n.required) || !1;
|
|
3053
3076
|
}
|
|
3054
3077
|
};
|
|
3055
3078
|
Object.keys(e.rule.effect || {}).forEach((s) => {
|
|
@@ -3079,44 +3102,44 @@ function kr(t) {
|
|
|
3079
3102
|
}, r);
|
|
3080
3103
|
},
|
|
3081
3104
|
getEffect(e, r) {
|
|
3082
|
-
if (
|
|
3105
|
+
if (O(e, "$" + r))
|
|
3083
3106
|
return e["$" + r];
|
|
3084
|
-
if (
|
|
3107
|
+
if (O(e, "effect") && O(e.effect, r))
|
|
3085
3108
|
return e.effect[r];
|
|
3086
3109
|
},
|
|
3087
3110
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3088
3111
|
if (!s || s === "fcFragment") return;
|
|
3089
|
-
const u = n || Object.keys(r).reduce((l,
|
|
3112
|
+
const u = n || Object.keys(r).reduce((l, c) => (c[0] === "$" && (l[c.substr(1)] = r[c]), l), y({}, r.effect || {}));
|
|
3090
3113
|
Object.keys(u).forEach((l) => {
|
|
3091
|
-
const
|
|
3092
|
-
if (!
|
|
3093
|
-
let
|
|
3094
|
-
if (!
|
|
3095
|
-
|
|
3096
|
-
else if (
|
|
3097
|
-
|
|
3114
|
+
const c = this.providers[l];
|
|
3115
|
+
if (!c || c.input && !i) return;
|
|
3116
|
+
let m;
|
|
3117
|
+
if (!c._c)
|
|
3118
|
+
m = "*";
|
|
3119
|
+
else if (c._used.indexOf(s) > -1)
|
|
3120
|
+
m = s;
|
|
3098
3121
|
else
|
|
3099
3122
|
return;
|
|
3100
|
-
const
|
|
3101
|
-
e && (
|
|
3123
|
+
const v = y({ value: u[l], getValue: () => this.getEffect(r, l) }, a || {});
|
|
3124
|
+
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]);
|
|
3102
3125
|
});
|
|
3103
3126
|
}
|
|
3104
3127
|
});
|
|
3105
3128
|
}
|
|
3106
|
-
function
|
|
3129
|
+
function _r(t) {
|
|
3107
3130
|
return t.filter(function(e, r, i) {
|
|
3108
3131
|
return i.indexOf(e, 0) === r;
|
|
3109
3132
|
});
|
|
3110
3133
|
}
|
|
3111
|
-
function
|
|
3134
|
+
function kr(t) {
|
|
3112
3135
|
const e = t.components;
|
|
3113
3136
|
if (Array.isArray(e)) {
|
|
3114
|
-
const r =
|
|
3137
|
+
const r = _r(e.filter((i) => i !== "*"));
|
|
3115
3138
|
return r.length ? r : !1;
|
|
3116
|
-
} else return
|
|
3139
|
+
} else return f.String(e) ? [e] : !1;
|
|
3117
3140
|
}
|
|
3118
|
-
function
|
|
3119
|
-
|
|
3141
|
+
function V(t) {
|
|
3142
|
+
p(this, {
|
|
3120
3143
|
fc: t,
|
|
3121
3144
|
vm: t.vm,
|
|
3122
3145
|
watching: !1,
|
|
@@ -3138,18 +3161,18 @@ function P(t) {
|
|
|
3138
3161
|
nextReload: () => {
|
|
3139
3162
|
this.lifecycle("reload");
|
|
3140
3163
|
}
|
|
3141
|
-
}),
|
|
3164
|
+
}), et(this, {
|
|
3142
3165
|
options() {
|
|
3143
3166
|
return t.options;
|
|
3144
3167
|
},
|
|
3145
3168
|
bus() {
|
|
3146
3169
|
return t.bus;
|
|
3147
3170
|
}
|
|
3148
|
-
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new
|
|
3171
|
+
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new $e(this), this.api = t.extendApi(nr(this), this);
|
|
3149
3172
|
}
|
|
3150
|
-
|
|
3173
|
+
p(V.prototype, {
|
|
3151
3174
|
initData(t) {
|
|
3152
|
-
|
|
3175
|
+
p(this, {
|
|
3153
3176
|
ctxs: {},
|
|
3154
3177
|
fieldCtx: {},
|
|
3155
3178
|
nameCtx: {},
|
|
@@ -3162,55 +3185,55 @@ m(P.prototype, {
|
|
|
3162
3185
|
},
|
|
3163
3186
|
beforeFetch(t) {
|
|
3164
3187
|
return new Promise((e) => {
|
|
3165
|
-
const r = this.options.beforeFetch &&
|
|
3166
|
-
r &&
|
|
3188
|
+
const r = this.options.beforeFetch && R(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3189
|
+
r && f.Function(r.then) ? r.then(e) : e();
|
|
3167
3190
|
});
|
|
3168
3191
|
}
|
|
3169
3192
|
});
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
const
|
|
3179
|
-
name:
|
|
3193
|
+
lr(V);
|
|
3194
|
+
ur(V);
|
|
3195
|
+
fr(V);
|
|
3196
|
+
dr(V);
|
|
3197
|
+
gr(V);
|
|
3198
|
+
vr(V);
|
|
3199
|
+
br(V);
|
|
3200
|
+
Cr(V);
|
|
3201
|
+
const Or = "fcFragment", te = {
|
|
3202
|
+
name: Or,
|
|
3180
3203
|
functional: !0,
|
|
3181
3204
|
props: ["vnode"],
|
|
3182
3205
|
render(t, e) {
|
|
3183
3206
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3184
3207
|
}
|
|
3185
3208
|
};
|
|
3186
|
-
function
|
|
3187
|
-
return
|
|
3209
|
+
function wr(t) {
|
|
3210
|
+
return f.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3188
3211
|
}
|
|
3189
|
-
function
|
|
3212
|
+
function Fr() {
|
|
3190
3213
|
const t = {};
|
|
3191
3214
|
function e(r) {
|
|
3192
3215
|
r && this.setVm(r);
|
|
3193
3216
|
}
|
|
3194
|
-
return
|
|
3217
|
+
return p(e.prototype, {
|
|
3195
3218
|
setVm(r) {
|
|
3196
3219
|
this.vm = r, this.$h = r.$createElement;
|
|
3197
3220
|
},
|
|
3198
3221
|
make(r, i, s) {
|
|
3199
|
-
return
|
|
3222
|
+
return T.config.isReservedTag(r) && i.nativeOn && delete i.nativeOn, this.makeComponent(r, i, s);
|
|
3200
3223
|
},
|
|
3201
3224
|
makeComponent(r, i, s) {
|
|
3202
|
-
let n = this.$h(r,
|
|
3225
|
+
let n = this.$h(r, wr(i), s || []);
|
|
3203
3226
|
return n.context = this.vm, n;
|
|
3204
3227
|
},
|
|
3205
3228
|
aliasMap: t
|
|
3206
|
-
}),
|
|
3229
|
+
}), p(e, {
|
|
3207
3230
|
aliasMap: t,
|
|
3208
3231
|
alias(r, i) {
|
|
3209
3232
|
t[r] = i;
|
|
3210
3233
|
},
|
|
3211
3234
|
use(r) {
|
|
3212
3235
|
Object.keys(r).forEach((i) => {
|
|
3213
|
-
const s =
|
|
3236
|
+
const s = Q(i), n = ot(i).toLocaleLowerCase(), o = r[i];
|
|
3214
3237
|
[i, s, n].forEach((a) => {
|
|
3215
3238
|
e.alias(i, o), e.prototype[a] = function(u, l) {
|
|
3216
3239
|
return this.make(o, u, l);
|
|
@@ -3221,12 +3244,12 @@ function Rr() {
|
|
|
3221
3244
|
}), e;
|
|
3222
3245
|
}
|
|
3223
3246
|
function Er(t) {
|
|
3224
|
-
class e extends
|
|
3247
|
+
class e extends lt {
|
|
3225
3248
|
}
|
|
3226
3249
|
return Object.assign(e.prototype, t), e;
|
|
3227
3250
|
}
|
|
3228
|
-
function
|
|
3229
|
-
|
|
3251
|
+
function lt(t) {
|
|
3252
|
+
p(this, {
|
|
3230
3253
|
$handle: t,
|
|
3231
3254
|
vm: t.vm,
|
|
3232
3255
|
options: {},
|
|
@@ -3236,12 +3259,12 @@ function ft(t) {
|
|
|
3236
3259
|
}
|
|
3237
3260
|
}), this.updateKey(), this.init();
|
|
3238
3261
|
}
|
|
3239
|
-
|
|
3262
|
+
p(lt.prototype, {
|
|
3240
3263
|
__init() {
|
|
3241
3264
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3242
3265
|
},
|
|
3243
3266
|
updateKey() {
|
|
3244
|
-
this.key =
|
|
3267
|
+
this.key = ee();
|
|
3245
3268
|
},
|
|
3246
3269
|
//TODO interface
|
|
3247
3270
|
init() {
|
|
@@ -3263,7 +3286,7 @@ m(ft.prototype, {
|
|
|
3263
3286
|
return e(this.vm);
|
|
3264
3287
|
},
|
|
3265
3288
|
mergeOptions(t, e) {
|
|
3266
|
-
return
|
|
3289
|
+
return D(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3267
3290
|
},
|
|
3268
3291
|
updateOptions(t) {
|
|
3269
3292
|
this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3281,20 +3304,20 @@ m(ft.prototype, {
|
|
|
3281
3304
|
render(t) {
|
|
3282
3305
|
}
|
|
3283
3306
|
});
|
|
3284
|
-
const
|
|
3307
|
+
const Sr = function(t) {
|
|
3285
3308
|
const e = {
|
|
3286
3309
|
name: "loadData",
|
|
3287
3310
|
_fn: [],
|
|
3288
3311
|
created(r, i, s) {
|
|
3289
3312
|
this.deleted(r);
|
|
3290
|
-
let n =
|
|
3313
|
+
let n = j(r.getValue());
|
|
3291
3314
|
const o = [];
|
|
3292
3315
|
n.forEach((a) => {
|
|
3293
3316
|
if (a) {
|
|
3294
3317
|
const u = () => {
|
|
3295
3318
|
a.watch !== !1 && (t.bus.$off("p.loadData." + a.attr, u), t.bus.$once("p.loadData." + a.attr, u));
|
|
3296
3319
|
let l;
|
|
3297
|
-
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l =
|
|
3320
|
+
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l = L(l))), Z(r.getProp(), a.to || "options", l), s.sync(i);
|
|
3298
3321
|
};
|
|
3299
3322
|
o.push(() => t.bus.$off("p.loadData." + a.attr, u)), u();
|
|
3300
3323
|
}
|
|
@@ -3307,13 +3330,13 @@ const jr = function(t) {
|
|
|
3307
3330
|
}
|
|
3308
3331
|
};
|
|
3309
3332
|
return e.watch = e.created, e;
|
|
3310
|
-
},
|
|
3333
|
+
}, ut = {
|
|
3311
3334
|
name: "componentValidate",
|
|
3312
3335
|
load(t, e, r) {
|
|
3313
3336
|
const i = t.getValue();
|
|
3314
3337
|
i ? t.getProp().validate = [{
|
|
3315
3338
|
validator(...s) {
|
|
3316
|
-
const n =
|
|
3339
|
+
const n = z(e);
|
|
3317
3340
|
if (n)
|
|
3318
3341
|
return r.exec(n.id, i === !0 ? "formCreateValidate" : i, ...s, {
|
|
3319
3342
|
attr: t,
|
|
@@ -3324,52 +3347,52 @@ const jr = function(t) {
|
|
|
3324
3347
|
}] : (t.clearProp(), r.clearValidateState([e.field]));
|
|
3325
3348
|
},
|
|
3326
3349
|
watch(...t) {
|
|
3327
|
-
|
|
3350
|
+
ut.load(...t);
|
|
3328
3351
|
}
|
|
3329
|
-
},
|
|
3352
|
+
}, Rr = function(t) {
|
|
3330
3353
|
function e(i) {
|
|
3331
|
-
return
|
|
3354
|
+
return f.String(i) && (i = {
|
|
3332
3355
|
action: i,
|
|
3333
3356
|
to: "options"
|
|
3334
3357
|
}), i;
|
|
3335
3358
|
}
|
|
3336
3359
|
function r(i, s, n) {
|
|
3337
3360
|
let o = i.value;
|
|
3338
|
-
const a = (
|
|
3339
|
-
|
|
3361
|
+
const a = (m) => {
|
|
3362
|
+
m === void 0 ? (i.clearProp(), n.sync(s)) : Z(i.getProp(), o.to || "options", m);
|
|
3340
3363
|
};
|
|
3341
|
-
if (
|
|
3364
|
+
if (f.Function(o) && (o = o(s, n)), o = e(o), !o || !o.action) {
|
|
3342
3365
|
a(void 0);
|
|
3343
3366
|
return;
|
|
3344
3367
|
}
|
|
3345
|
-
o =
|
|
3368
|
+
o = L(o), o.to || (o.to = "options");
|
|
3346
3369
|
const u = o.onError, l = () => {
|
|
3347
3370
|
if (!i.getValue())
|
|
3348
3371
|
return i.clearProp(), n.sync(s), !0;
|
|
3349
|
-
},
|
|
3372
|
+
}, c = N(y({
|
|
3350
3373
|
headers: {}
|
|
3351
3374
|
}, o), {
|
|
3352
|
-
onSuccess(
|
|
3375
|
+
onSuccess(m, v) {
|
|
3353
3376
|
if (l()) return;
|
|
3354
|
-
let
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
}),
|
|
3377
|
+
let _ = (g) => v ? g : O(g, "data") ? g.data : g;
|
|
3378
|
+
f.Function(o.parse) ? _ = o.parse : o.parse && f.String(o.parse) && (_ = (g) => (o.parse.split(".").forEach((k) => {
|
|
3379
|
+
g && (g = g[k]);
|
|
3380
|
+
}), g)), a(_(m, s, n)), n.sync(s);
|
|
3358
3381
|
},
|
|
3359
|
-
onError(
|
|
3360
|
-
a(void 0), !l() && (u || ((
|
|
3382
|
+
onError(m) {
|
|
3383
|
+
a(void 0), !l() && (u || ((v) => me(v.message || "fetch fail " + o.action)))(m, s, n);
|
|
3361
3384
|
}
|
|
3362
3385
|
});
|
|
3363
|
-
t.$handle.beforeFetch(
|
|
3364
|
-
if (
|
|
3365
|
-
o.action(s, n).then((
|
|
3366
|
-
|
|
3367
|
-
}).catch((
|
|
3368
|
-
|
|
3386
|
+
t.$handle.beforeFetch(c, { rule: s, api: n }).then(() => {
|
|
3387
|
+
if (f.Function(o.action)) {
|
|
3388
|
+
o.action(s, n).then((m) => {
|
|
3389
|
+
c.onSuccess(m, !0);
|
|
3390
|
+
}).catch((m) => {
|
|
3391
|
+
c.onError(m);
|
|
3369
3392
|
});
|
|
3370
3393
|
return;
|
|
3371
3394
|
}
|
|
3372
|
-
|
|
3395
|
+
R(() => t.create.fetch(c, { inject: i, rule: s, api: n }));
|
|
3373
3396
|
});
|
|
3374
3397
|
}
|
|
3375
3398
|
return {
|
|
@@ -3381,17 +3404,17 @@ const jr = function(t) {
|
|
|
3381
3404
|
r(...i);
|
|
3382
3405
|
}
|
|
3383
3406
|
};
|
|
3384
|
-
},
|
|
3407
|
+
}, ht = {
|
|
3385
3408
|
name: "required",
|
|
3386
3409
|
load(t, e, r) {
|
|
3387
|
-
const i =
|
|
3410
|
+
const i = jr(t.getValue());
|
|
3388
3411
|
if (i.required === !1)
|
|
3389
3412
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
3390
3413
|
else {
|
|
3391
3414
|
const s = y({
|
|
3392
3415
|
required: !0,
|
|
3393
3416
|
validator(n, o, a) {
|
|
3394
|
-
|
|
3417
|
+
f.empty(o) ? a(s.message) : a();
|
|
3395
3418
|
}
|
|
3396
3419
|
}, i);
|
|
3397
3420
|
if (!s.message) {
|
|
@@ -3403,39 +3426,39 @@ const jr = function(t) {
|
|
|
3403
3426
|
r.sync(e);
|
|
3404
3427
|
},
|
|
3405
3428
|
watch(...t) {
|
|
3406
|
-
|
|
3429
|
+
ht.load(...t);
|
|
3407
3430
|
}
|
|
3408
3431
|
};
|
|
3409
|
-
function
|
|
3410
|
-
return
|
|
3432
|
+
function jr(t) {
|
|
3433
|
+
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 : {};
|
|
3411
3434
|
}
|
|
3412
|
-
const
|
|
3413
|
-
fetch:
|
|
3414
|
-
loadData:
|
|
3415
|
-
required:
|
|
3416
|
-
componentValidate:
|
|
3417
|
-
},
|
|
3418
|
-
name:
|
|
3435
|
+
const Ir = {
|
|
3436
|
+
fetch: Rr,
|
|
3437
|
+
loadData: Sr,
|
|
3438
|
+
required: ht,
|
|
3439
|
+
componentValidate: ut
|
|
3440
|
+
}, Ar = "html", Vr = {
|
|
3441
|
+
name: Ar,
|
|
3419
3442
|
loadChildren: !1,
|
|
3420
3443
|
render(t, e) {
|
|
3421
3444
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
3422
3445
|
},
|
|
3423
3446
|
renderChildren(t) {
|
|
3424
|
-
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) =>
|
|
3447
|
+
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) => f.String(e)).join("") : "";
|
|
3425
3448
|
}
|
|
3426
3449
|
};
|
|
3427
|
-
function
|
|
3450
|
+
function Pr(t, e) {
|
|
3428
3451
|
let r;
|
|
3429
3452
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
3430
3453
|
}
|
|
3431
|
-
function
|
|
3432
|
-
return
|
|
3454
|
+
function re() {
|
|
3455
|
+
return Pr("name", ...arguments);
|
|
3433
3456
|
}
|
|
3434
|
-
function
|
|
3435
|
-
return !t || !t.el ? window.document.body :
|
|
3457
|
+
function Ne(t) {
|
|
3458
|
+
return !t || !t.el ? window.document.body : f.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
3436
3459
|
}
|
|
3437
|
-
function
|
|
3438
|
-
const r = new
|
|
3460
|
+
function qe(t, e) {
|
|
3461
|
+
const r = new T({
|
|
3439
3462
|
data() {
|
|
3440
3463
|
return { rule: t, option: e || {} };
|
|
3441
3464
|
},
|
|
@@ -3445,141 +3468,141 @@ function He(t, e) {
|
|
|
3445
3468
|
});
|
|
3446
3469
|
return r.$mount(), r;
|
|
3447
3470
|
}
|
|
3448
|
-
function
|
|
3471
|
+
function Tr(t) {
|
|
3449
3472
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
3450
|
-
|
|
3473
|
+
ze.push(...e), ce.push(...r), de.push(...i), rt([...e, ...r, ...i]);
|
|
3451
3474
|
}
|
|
3452
|
-
let
|
|
3453
|
-
const
|
|
3454
|
-
function
|
|
3475
|
+
let Dr = 1;
|
|
3476
|
+
const S = {};
|
|
3477
|
+
function ft(t) {
|
|
3455
3478
|
const e = {
|
|
3456
|
-
[
|
|
3457
|
-
}, r = {}, i = {}, s = y({},
|
|
3479
|
+
[te.name]: te
|
|
3480
|
+
}, r = {}, i = {}, s = y({}, Ir), n = tr();
|
|
3458
3481
|
let o = { global: {} };
|
|
3459
|
-
const a = {}, u =
|
|
3460
|
-
|
|
3461
|
-
function h
|
|
3462
|
-
const d =
|
|
3482
|
+
const a = {}, u = Fr(), l = {};
|
|
3483
|
+
Tr(t.attrs || {});
|
|
3484
|
+
function c(h) {
|
|
3485
|
+
const d = S[h];
|
|
3463
3486
|
if (Array.isArray(d))
|
|
3464
|
-
return d.map((
|
|
3487
|
+
return d.map(($) => $.api());
|
|
3465
3488
|
if (d)
|
|
3466
3489
|
return d.api();
|
|
3467
3490
|
}
|
|
3468
|
-
function
|
|
3469
|
-
const
|
|
3470
|
-
|
|
3491
|
+
function m() {
|
|
3492
|
+
const h = re(...arguments);
|
|
3493
|
+
h.id && h.prop && (i[h.id] = h.prop);
|
|
3471
3494
|
}
|
|
3472
|
-
function
|
|
3473
|
-
const
|
|
3474
|
-
|
|
3495
|
+
function v() {
|
|
3496
|
+
const h = re(...arguments);
|
|
3497
|
+
h.id && h.prop && (s[h.id] = N(y({}, h.prop), { name: h.id }));
|
|
3475
3498
|
}
|
|
3476
|
-
function
|
|
3477
|
-
u.use(
|
|
3499
|
+
function _(h) {
|
|
3500
|
+
u.use(h);
|
|
3478
3501
|
}
|
|
3479
|
-
function
|
|
3480
|
-
const
|
|
3481
|
-
if (!
|
|
3482
|
-
const d =
|
|
3483
|
-
r[d] =
|
|
3502
|
+
function g() {
|
|
3503
|
+
const h = re(...arguments);
|
|
3504
|
+
if (!h.id || !h.prop) return he;
|
|
3505
|
+
const d = I(h.id), $ = h.prop, b = $.merge === !0 ? r[d] : void 0;
|
|
3506
|
+
r[d] = $, Object.setPrototypeOf($, b || he), n[d] = E(d), $.maker && p(n, $.maker);
|
|
3484
3507
|
}
|
|
3485
|
-
function
|
|
3486
|
-
let
|
|
3487
|
-
if (
|
|
3488
|
-
if (
|
|
3489
|
-
return
|
|
3508
|
+
function k(h, d) {
|
|
3509
|
+
let $;
|
|
3510
|
+
if (f.String(h)) {
|
|
3511
|
+
if ($ = I(h), ["form-create", "formcreate"].indexOf($) > -1)
|
|
3512
|
+
return W();
|
|
3490
3513
|
if (d === void 0)
|
|
3491
|
-
return e[
|
|
3514
|
+
return e[$];
|
|
3492
3515
|
} else
|
|
3493
|
-
|
|
3494
|
-
if (
|
|
3495
|
-
const
|
|
3496
|
-
e[
|
|
3516
|
+
$ = I(h.name), d = h;
|
|
3517
|
+
if (!$ || !d) return;
|
|
3518
|
+
const b = I($);
|
|
3519
|
+
e[$] = d, e[b] = d, delete u.aliasMap[$], delete u.aliasMap[b], delete r[$], delete r[b], d.formCreateParser && g($, d.formCreateParser);
|
|
3497
3520
|
}
|
|
3498
|
-
function
|
|
3499
|
-
Object.keys(
|
|
3500
|
-
(Array.isArray(
|
|
3501
|
-
|
|
3521
|
+
function ve(h) {
|
|
3522
|
+
Object.keys(S).forEach((d) => {
|
|
3523
|
+
(Array.isArray(S[d]) ? S[d] : [S[d]]).forEach((b) => {
|
|
3524
|
+
b.bus.$emit("p.loadData." + h);
|
|
3502
3525
|
});
|
|
3503
3526
|
});
|
|
3504
3527
|
}
|
|
3505
|
-
function
|
|
3506
|
-
a[
|
|
3528
|
+
function be(h, d) {
|
|
3529
|
+
a[h] = d, ve(h);
|
|
3507
3530
|
}
|
|
3508
|
-
function
|
|
3509
|
-
return
|
|
3531
|
+
function Ce(h, d) {
|
|
3532
|
+
return O(a, h) ? a[h] : d;
|
|
3510
3533
|
}
|
|
3511
|
-
function
|
|
3512
|
-
delete a[
|
|
3534
|
+
function ct(h) {
|
|
3535
|
+
delete a[h], ve(h);
|
|
3513
3536
|
}
|
|
3514
|
-
function
|
|
3515
|
-
return
|
|
3537
|
+
function W() {
|
|
3538
|
+
return Wt(ke, e, i);
|
|
3516
3539
|
}
|
|
3517
|
-
function
|
|
3518
|
-
return
|
|
3540
|
+
function _e() {
|
|
3541
|
+
return te;
|
|
3519
3542
|
}
|
|
3520
|
-
function
|
|
3521
|
-
return
|
|
3543
|
+
function dt(h, d) {
|
|
3544
|
+
return f.Function(h.install) ? h.install(M, d) : f.Function(h) && h(M, d), this;
|
|
3522
3545
|
}
|
|
3523
|
-
function M(
|
|
3524
|
-
let
|
|
3525
|
-
const
|
|
3526
|
-
return
|
|
3546
|
+
function M(h, d, $) {
|
|
3547
|
+
let b = qe(h, d || {});
|
|
3548
|
+
const A = b.$refs.fc.formCreate;
|
|
3549
|
+
return A.$parent = $, Ne(A.options).appendChild(b.$el), A.api();
|
|
3527
3550
|
}
|
|
3528
3551
|
Object.setPrototypeOf(M, l);
|
|
3529
|
-
function
|
|
3552
|
+
function pt(h) {
|
|
3530
3553
|
let d = y({}, t);
|
|
3531
|
-
return
|
|
3554
|
+
return h ? d.inherit = {
|
|
3532
3555
|
components: e,
|
|
3533
3556
|
parsers: r,
|
|
3534
3557
|
directives: i,
|
|
3535
3558
|
providers: s,
|
|
3536
3559
|
maker: n,
|
|
3537
3560
|
loadData: a
|
|
3538
|
-
} : delete d.inherit,
|
|
3561
|
+
} : delete d.inherit, ft(d);
|
|
3539
3562
|
}
|
|
3540
|
-
function
|
|
3541
|
-
const d =
|
|
3542
|
-
|
|
3543
|
-
id:
|
|
3544
|
-
vm:
|
|
3563
|
+
function ke(h) {
|
|
3564
|
+
const d = h.$options.propsData.rule;
|
|
3565
|
+
p(this, {
|
|
3566
|
+
id: Dr++,
|
|
3567
|
+
vm: h,
|
|
3545
3568
|
create: M,
|
|
3546
3569
|
manager: Er(t.manager),
|
|
3547
3570
|
parsers: r,
|
|
3548
3571
|
providers: s,
|
|
3549
3572
|
rules: Array.isArray(d) ? d : [],
|
|
3550
|
-
name:
|
|
3551
|
-
inFor:
|
|
3573
|
+
name: h.$options.propsData.name || ee(),
|
|
3574
|
+
inFor: h.$options.propsData.inFor,
|
|
3552
3575
|
prop: {
|
|
3553
3576
|
components: e,
|
|
3554
3577
|
directives: i
|
|
3555
3578
|
},
|
|
3556
|
-
setData:
|
|
3557
|
-
getData:
|
|
3579
|
+
setData: be,
|
|
3580
|
+
getData: Ce,
|
|
3558
3581
|
loadData: a,
|
|
3559
3582
|
CreateNode: u,
|
|
3560
|
-
bus: new
|
|
3583
|
+
bus: new T(),
|
|
3561
3584
|
unwatch: null,
|
|
3562
3585
|
options: {},
|
|
3563
|
-
extendApi: t.extendApi || ((
|
|
3564
|
-
}), this.init(), this.initOptions(), this.name && (this.inFor ? (
|
|
3586
|
+
extendApi: t.extendApi || (($) => $)
|
|
3587
|
+
}), this.init(), this.initOptions(), this.name && (this.inFor ? (S[this.name] || (S[this.name] = []), S[this.name].push(this)) : S[this.name] = this);
|
|
3565
3588
|
}
|
|
3566
|
-
|
|
3589
|
+
p(ke.prototype, {
|
|
3567
3590
|
init() {
|
|
3568
|
-
const
|
|
3569
|
-
this.$handle = d,
|
|
3570
|
-
this.isSub() && (this.unwatch =
|
|
3571
|
-
this.initOptions(),
|
|
3591
|
+
const h = this.vm, d = new V(this);
|
|
3592
|
+
this.$handle = d, h.$f = d.api, h.$emit("input", d.api), h.$on("hook:created", () => {
|
|
3593
|
+
this.isSub() && (this.unwatch = h.$watch(() => h.$pfc.option, () => {
|
|
3594
|
+
this.initOptions(), h.$f.refresh();
|
|
3572
3595
|
}, { deep: !0 }), this.initOptions()), this.created();
|
|
3573
|
-
}),
|
|
3596
|
+
}), h.$on("hook:mounted", () => {
|
|
3574
3597
|
this.mounted();
|
|
3575
|
-
}),
|
|
3576
|
-
if (
|
|
3598
|
+
}), h.$on("hook:beforeDestroy", () => {
|
|
3599
|
+
if (h.destroyed = !0, this.unwatch && this.unwatch(), d.reloadRule([]), this.name)
|
|
3577
3600
|
if (this.inFor) {
|
|
3578
|
-
const
|
|
3579
|
-
|
|
3601
|
+
const $ = S[this.name].indexOf(this);
|
|
3602
|
+
S[this.name].splice($, 1), S[this.name].length || delete S[this.name];
|
|
3580
3603
|
} else
|
|
3581
|
-
delete
|
|
3582
|
-
}),
|
|
3604
|
+
delete S[this.name];
|
|
3605
|
+
}), h.$on("hook:updated", () => {
|
|
3583
3606
|
d.bindNextTick(() => this.bus.$emit("next-tick", d.api));
|
|
3584
3607
|
});
|
|
3585
3608
|
},
|
|
@@ -3588,16 +3611,16 @@ function dt(t) {
|
|
|
3588
3611
|
},
|
|
3589
3612
|
initOptions() {
|
|
3590
3613
|
this.options = {};
|
|
3591
|
-
let
|
|
3592
|
-
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0),
|
|
3614
|
+
let h = y({ formData: {}, submitBtn: {}, resetBtn: {} }, L(o));
|
|
3615
|
+
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0), h = this.mergeOptions(h, this.vm.$options.propsData.option), this.updateOptions(h);
|
|
3593
3616
|
},
|
|
3594
|
-
mergeOptions(
|
|
3595
|
-
return d =
|
|
3596
|
-
delete d[
|
|
3597
|
-
}), d.global && (
|
|
3617
|
+
mergeOptions(h, d, $) {
|
|
3618
|
+
return d = L(d), $ && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el"].forEach((b) => {
|
|
3619
|
+
delete d[b];
|
|
3620
|
+
}), d.global && (h.global = Yt(h.global, d.global), delete d.global), this.$handle.$manager.mergeOptions([d], h), h;
|
|
3598
3621
|
},
|
|
3599
|
-
updateOptions(
|
|
3600
|
-
this.mergeOptions(this.options,
|
|
3622
|
+
updateOptions(h) {
|
|
3623
|
+
this.mergeOptions(this.options, h), this.$handle.$manager.updateOptions(this.options);
|
|
3601
3624
|
},
|
|
3602
3625
|
created() {
|
|
3603
3626
|
this.$handle.init(), this.vm.$emit("created", this.api());
|
|
@@ -3612,77 +3635,77 @@ function dt(t) {
|
|
|
3612
3635
|
this.$handle.mounted();
|
|
3613
3636
|
}
|
|
3614
3637
|
});
|
|
3615
|
-
function
|
|
3616
|
-
|
|
3638
|
+
function Oe(h) {
|
|
3639
|
+
p(h, {
|
|
3617
3640
|
version: t.version,
|
|
3618
3641
|
ui: t.ui,
|
|
3619
|
-
setData:
|
|
3620
|
-
getData:
|
|
3621
|
-
removeData:
|
|
3642
|
+
setData: be,
|
|
3643
|
+
getData: Ce,
|
|
3644
|
+
removeData: ct,
|
|
3622
3645
|
maker: n,
|
|
3623
|
-
component:
|
|
3624
|
-
directive:
|
|
3625
|
-
register:
|
|
3626
|
-
$vnode:
|
|
3627
|
-
parser:
|
|
3628
|
-
use:
|
|
3629
|
-
factory:
|
|
3630
|
-
componentAlias:
|
|
3631
|
-
copyRule:
|
|
3632
|
-
copyRules:
|
|
3633
|
-
fetch:
|
|
3634
|
-
$form:
|
|
3635
|
-
parseFn:
|
|
3636
|
-
parseJson:
|
|
3637
|
-
toJson:
|
|
3638
|
-
getApi:
|
|
3639
|
-
init(d,
|
|
3640
|
-
let
|
|
3646
|
+
component: k,
|
|
3647
|
+
directive: m,
|
|
3648
|
+
register: v,
|
|
3649
|
+
$vnode: _e,
|
|
3650
|
+
parser: g,
|
|
3651
|
+
use: dt,
|
|
3652
|
+
factory: pt,
|
|
3653
|
+
componentAlias: _,
|
|
3654
|
+
copyRule: ye,
|
|
3655
|
+
copyRules: Ye,
|
|
3656
|
+
fetch: nt,
|
|
3657
|
+
$form: W,
|
|
3658
|
+
parseFn: q,
|
|
3659
|
+
parseJson: Zt,
|
|
3660
|
+
toJson: Qe,
|
|
3661
|
+
getApi: c,
|
|
3662
|
+
init(d, $ = {}) {
|
|
3663
|
+
let b = qe(d, $), A = b.$refs.fc.formCreate;
|
|
3641
3664
|
return {
|
|
3642
|
-
mount(
|
|
3643
|
-
return
|
|
3665
|
+
mount(x) {
|
|
3666
|
+
return x && f.Element(x) && (A.options.el = x), Ne(A.options).appendChild(b.$el), A.api();
|
|
3644
3667
|
},
|
|
3645
3668
|
remove() {
|
|
3646
|
-
|
|
3669
|
+
b.$el.parentNode && b.$el.parentNode.removeChild(b.$el);
|
|
3647
3670
|
},
|
|
3648
3671
|
destroy() {
|
|
3649
|
-
this.remove(),
|
|
3672
|
+
this.remove(), b.$destroy();
|
|
3650
3673
|
},
|
|
3651
|
-
$f:
|
|
3674
|
+
$f: A.api()
|
|
3652
3675
|
};
|
|
3653
3676
|
}
|
|
3654
3677
|
});
|
|
3655
3678
|
}
|
|
3656
|
-
function
|
|
3657
|
-
|
|
3679
|
+
function mt(h) {
|
|
3680
|
+
p(h, {
|
|
3658
3681
|
create: M,
|
|
3659
|
-
install(d,
|
|
3660
|
-
if (o = y(y({}, o),
|
|
3682
|
+
install(d, $) {
|
|
3683
|
+
if (o = y(y({}, o), $ || {}), d._installedFormCreate === !0) return;
|
|
3661
3684
|
d._installedFormCreate = !0;
|
|
3662
|
-
const
|
|
3663
|
-
return M(
|
|
3685
|
+
const b = function(A, x = {}) {
|
|
3686
|
+
return M(A, x, this);
|
|
3664
3687
|
};
|
|
3665
|
-
|
|
3688
|
+
Oe(b), d.prototype.$formCreate = b, d.component("FormCreate", W()), d.component("FcFragment", _e());
|
|
3666
3689
|
}
|
|
3667
3690
|
});
|
|
3668
3691
|
}
|
|
3669
|
-
if (
|
|
3670
|
-
const
|
|
3671
|
-
|
|
3692
|
+
if (Oe(l), mt(l), u.use({ fragment: "fcFragment" }), g(Vr), t.install && M.use(t), t.inherit) {
|
|
3693
|
+
const h = t.inherit;
|
|
3694
|
+
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);
|
|
3672
3695
|
}
|
|
3673
|
-
const
|
|
3674
|
-
return Object.setPrototypeOf(
|
|
3696
|
+
const G = W();
|
|
3697
|
+
return Object.setPrototypeOf(G, l), Object.defineProperties(G, {
|
|
3675
3698
|
fetch: {
|
|
3676
3699
|
get() {
|
|
3677
3700
|
return l.fetch;
|
|
3678
3701
|
},
|
|
3679
|
-
set(
|
|
3680
|
-
l.fetch =
|
|
3702
|
+
set(h) {
|
|
3703
|
+
l.fetch = h;
|
|
3681
3704
|
}
|
|
3682
3705
|
}
|
|
3683
|
-
}),
|
|
3706
|
+
}), G.util = l, G;
|
|
3684
3707
|
}
|
|
3685
|
-
const
|
|
3708
|
+
const Ue = {
|
|
3686
3709
|
date: "yyyy-MM-dd",
|
|
3687
3710
|
month: "yyyy-MM",
|
|
3688
3711
|
datetime: "yyyy-MM-dd HH:mm:ss",
|
|
@@ -3691,105 +3714,105 @@ const xe = {
|
|
|
3691
3714
|
monthrange: "yyyy-MM",
|
|
3692
3715
|
datetimerange: "yyyy-MM-dd HH:mm:ss",
|
|
3693
3716
|
year: "yyyy"
|
|
3694
|
-
},
|
|
3695
|
-
name:
|
|
3717
|
+
}, He = "datePicker", Br = {
|
|
3718
|
+
name: He,
|
|
3696
3719
|
maker: function() {
|
|
3697
|
-
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] =
|
|
3720
|
+
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = E(He, { type: e.toLowerCase() }), t), {});
|
|
3698
3721
|
}(),
|
|
3699
3722
|
mergeProp(t) {
|
|
3700
3723
|
const e = t.prop.props;
|
|
3701
|
-
e.valueFormat || (e.valueFormat =
|
|
3724
|
+
e.valueFormat || (e.valueFormat = Ue[e.type] || Ue.date);
|
|
3702
3725
|
}
|
|
3703
|
-
},
|
|
3704
|
-
name:
|
|
3726
|
+
}, ie = "hidden", Lr = {
|
|
3727
|
+
name: ie,
|
|
3705
3728
|
maker: {
|
|
3706
|
-
[
|
|
3729
|
+
[ie]: (t, e) => E(ie)("", t, e)
|
|
3707
3730
|
},
|
|
3708
3731
|
render() {
|
|
3709
3732
|
return [];
|
|
3710
3733
|
}
|
|
3711
|
-
},
|
|
3712
|
-
name:
|
|
3734
|
+
}, ne = "input", Mr = {
|
|
3735
|
+
name: ne,
|
|
3713
3736
|
maker: function() {
|
|
3714
|
-
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] =
|
|
3715
|
-
return t.idate =
|
|
3737
|
+
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = E(ne, { type: r }), e), {});
|
|
3738
|
+
return t.idate = E(ne, { type: "date" }), t;
|
|
3716
3739
|
}(),
|
|
3717
3740
|
mergeProp(t) {
|
|
3718
3741
|
let { props: e } = t.prop;
|
|
3719
3742
|
e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
3720
3743
|
}
|
|
3721
|
-
},
|
|
3722
|
-
name:
|
|
3744
|
+
}, xe = "slider", Nr = {
|
|
3745
|
+
name: xe,
|
|
3723
3746
|
maker: {
|
|
3724
|
-
sliderRange:
|
|
3747
|
+
sliderRange: E(xe, { range: !0 })
|
|
3725
3748
|
},
|
|
3726
3749
|
toFormValue(t, e) {
|
|
3727
3750
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
3728
3751
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
3729
3752
|
}
|
|
3730
|
-
},
|
|
3731
|
-
name:
|
|
3753
|
+
}, se = "timePicker", qr = {
|
|
3754
|
+
name: se,
|
|
3732
3755
|
maker: {
|
|
3733
|
-
time:
|
|
3734
|
-
timeRange:
|
|
3756
|
+
time: E(se, (t) => t.props.isRange = !1),
|
|
3757
|
+
timeRange: E(se, (t) => t.props.isRange = !0)
|
|
3735
3758
|
},
|
|
3736
3759
|
mergeProp(t) {
|
|
3737
3760
|
const e = t.prop.props;
|
|
3738
3761
|
e.valueFormat || (e.valueFormat = "HH:mm:ss");
|
|
3739
3762
|
}
|
|
3740
|
-
},
|
|
3763
|
+
}, Ur = {
|
|
3741
3764
|
name: "FcRow",
|
|
3742
3765
|
render(t, e) {
|
|
3743
3766
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
3744
3767
|
e.vNode.row(e.prop, t)
|
|
3745
3768
|
]);
|
|
3746
3769
|
}
|
|
3747
|
-
},
|
|
3748
|
-
name:
|
|
3770
|
+
}, Hr = "select", xr = {
|
|
3771
|
+
name: Hr,
|
|
3749
3772
|
toFormValue(t, e) {
|
|
3750
|
-
return e.prop.props.multiple && !Array.isArray(t) ?
|
|
3773
|
+
return e.prop.props.multiple && !Array.isArray(t) ? j(t) : t;
|
|
3751
3774
|
}
|
|
3752
|
-
},
|
|
3753
|
-
|
|
3775
|
+
}, Jr = [
|
|
3776
|
+
Br,
|
|
3777
|
+
Lr,
|
|
3754
3778
|
Mr,
|
|
3779
|
+
Nr,
|
|
3755
3780
|
qr,
|
|
3756
3781
|
Ur,
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
], _ = "el", Gr = {
|
|
3761
|
-
button: _ + "Button",
|
|
3782
|
+
xr
|
|
3783
|
+
], C = "el", Kr = {
|
|
3784
|
+
button: C + "Button",
|
|
3762
3785
|
icon: "i",
|
|
3763
|
-
slider:
|
|
3764
|
-
rate:
|
|
3786
|
+
slider: C + "Slider",
|
|
3787
|
+
rate: C + "Rate",
|
|
3765
3788
|
upload: "fcUpload",
|
|
3766
|
-
cascader:
|
|
3767
|
-
popover:
|
|
3768
|
-
tooltip:
|
|
3769
|
-
colorPicker:
|
|
3770
|
-
timePicker:
|
|
3771
|
-
timeSelect:
|
|
3772
|
-
datePicker:
|
|
3773
|
-
switch:
|
|
3789
|
+
cascader: C + "Cascader",
|
|
3790
|
+
popover: C + "Popover",
|
|
3791
|
+
tooltip: C + "Tooltip",
|
|
3792
|
+
colorPicker: C + "ColorPicker",
|
|
3793
|
+
timePicker: C + "TimePicker",
|
|
3794
|
+
timeSelect: C + "TimeSelect",
|
|
3795
|
+
datePicker: C + "DatePicker",
|
|
3796
|
+
switch: C + "Switch",
|
|
3774
3797
|
select: "fcSelect",
|
|
3775
3798
|
checkbox: "fcCheckbox",
|
|
3776
3799
|
radio: "fcRadio",
|
|
3777
|
-
inputNumber:
|
|
3778
|
-
number:
|
|
3779
|
-
input:
|
|
3780
|
-
formItem:
|
|
3781
|
-
form:
|
|
3800
|
+
inputNumber: C + "InputNumber",
|
|
3801
|
+
number: C + "InputNumber",
|
|
3802
|
+
input: C + "Input",
|
|
3803
|
+
formItem: C + "FormItem",
|
|
3804
|
+
form: C + "Form",
|
|
3782
3805
|
frame: "fcFrame",
|
|
3783
|
-
col:
|
|
3784
|
-
row:
|
|
3806
|
+
col: C + "Col",
|
|
3807
|
+
row: C + "Row",
|
|
3785
3808
|
tree: "fcTree",
|
|
3786
|
-
autoComplete:
|
|
3787
|
-
auto:
|
|
3809
|
+
autoComplete: C + "Autocomplete",
|
|
3810
|
+
auto: C + "Autocomplete",
|
|
3788
3811
|
group: "fcGroup",
|
|
3789
3812
|
object: "fcSubForm",
|
|
3790
3813
|
subForm: "fcSubForm"
|
|
3791
3814
|
};
|
|
3792
|
-
function
|
|
3815
|
+
function Wr() {
|
|
3793
3816
|
return {
|
|
3794
3817
|
form: {
|
|
3795
3818
|
inline: !1,
|
|
@@ -3823,23 +3846,23 @@ function Xr() {
|
|
|
3823
3846
|
}
|
|
3824
3847
|
};
|
|
3825
3848
|
}
|
|
3826
|
-
function
|
|
3849
|
+
function Gr(t) {
|
|
3827
3850
|
return t.type === "tooltip";
|
|
3828
3851
|
}
|
|
3829
|
-
const
|
|
3830
|
-
function
|
|
3831
|
-
return !
|
|
3852
|
+
const Xr = /[A-Z]/;
|
|
3853
|
+
function zr(t, e) {
|
|
3854
|
+
return !Xr.test(t) && (f.String(e) || f.Number(e));
|
|
3832
3855
|
}
|
|
3833
|
-
function
|
|
3834
|
-
|
|
3856
|
+
function Je(t, e) {
|
|
3857
|
+
O(t, e) && f.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
3835
3858
|
}
|
|
3836
|
-
function
|
|
3859
|
+
function P(t) {
|
|
3837
3860
|
return t === !1;
|
|
3838
3861
|
}
|
|
3839
|
-
function
|
|
3840
|
-
|
|
3862
|
+
function Qr(t, e) {
|
|
3863
|
+
O(t, e) && !f.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
3841
3864
|
}
|
|
3842
|
-
const
|
|
3865
|
+
const Zr = {
|
|
3843
3866
|
validate() {
|
|
3844
3867
|
const t = this.form();
|
|
3845
3868
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -3858,16 +3881,16 @@ const ei = {
|
|
|
3858
3881
|
},
|
|
3859
3882
|
tidyOptions(t) {
|
|
3860
3883
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
3861
|
-
|
|
3884
|
+
Qr(t, e);
|
|
3862
3885
|
}), t;
|
|
3863
3886
|
},
|
|
3864
3887
|
tidyRule({ prop: t }) {
|
|
3865
|
-
return
|
|
3888
|
+
return Je(t, "title"), Je(t, "info"), t;
|
|
3866
3889
|
},
|
|
3867
3890
|
mergeProp(t) {
|
|
3868
3891
|
let e = t.prop.props;
|
|
3869
|
-
t.prop =
|
|
3870
|
-
attrs: Object.keys(e).reduce((r, i) => (
|
|
3892
|
+
t.prop = D([{
|
|
3893
|
+
attrs: Object.keys(e).reduce((r, i) => (zr(i, e[i]) && (r[i] = e[i]), r), {}),
|
|
3871
3894
|
info: this.options.info || {},
|
|
3872
3895
|
wrap: this.options.wrap || {},
|
|
3873
3896
|
col: this.options.col || {},
|
|
@@ -3884,7 +3907,7 @@ const ei = {
|
|
|
3884
3907
|
}, { normal: ["title", "info", "col", "wrap"] });
|
|
3885
3908
|
},
|
|
3886
3909
|
getDefaultOptions() {
|
|
3887
|
-
return
|
|
3910
|
+
return Wr();
|
|
3888
3911
|
},
|
|
3889
3912
|
update() {
|
|
3890
3913
|
const t = this.options.form;
|
|
@@ -3902,18 +3925,18 @@ const ei = {
|
|
|
3902
3925
|
},
|
|
3903
3926
|
beforeRender() {
|
|
3904
3927
|
const { key: t, ref: e, $handle: r } = this;
|
|
3905
|
-
|
|
3928
|
+
p(this.rule, { key: t, ref: e }), p(this.rule.props, {
|
|
3906
3929
|
model: r.formData
|
|
3907
3930
|
// rules: $handle.validate(),
|
|
3908
3931
|
});
|
|
3909
3932
|
},
|
|
3910
3933
|
render(t) {
|
|
3911
|
-
return t.length && t.push(this.makeFormBtn()), this.$r(this.rule,
|
|
3934
|
+
return t.length && t.push(this.makeFormBtn()), this.$r(this.rule, P(this.options.row.show) ? t : [this.makeRow(t)]);
|
|
3912
3935
|
},
|
|
3913
3936
|
makeWrap(t, e) {
|
|
3914
|
-
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 =
|
|
3915
|
-
props:
|
|
3916
|
-
labelWidth: o === void 0 ? o :
|
|
3937
|
+
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 = P(r.wrap.show) ? e : this.$r(D([r.wrap, {
|
|
3938
|
+
props: N(y({
|
|
3939
|
+
labelWidth: o === void 0 ? o : ot(o),
|
|
3917
3940
|
label: n ? r.title.title : void 0
|
|
3918
3941
|
}, r.wrap || {}), {
|
|
3919
3942
|
prop: t.id,
|
|
@@ -3924,23 +3947,23 @@ const ei = {
|
|
|
3924
3947
|
ref: t.wrapRef,
|
|
3925
3948
|
type: "formItem"
|
|
3926
3949
|
}]), [e, n ? this.makeInfo(r, i, t) : null]);
|
|
3927
|
-
return a === !0 ||
|
|
3950
|
+
return a === !0 || P(u) || P(s.show) ? l : this.makeCol(r, i, [l]);
|
|
3928
3951
|
},
|
|
3929
3952
|
isTitle(t) {
|
|
3930
3953
|
if (this.options.form.title === !1) return !1;
|
|
3931
3954
|
const e = t.title;
|
|
3932
|
-
return !(!e.title && !e.native ||
|
|
3955
|
+
return !(!e.title && !e.native || P(e.show));
|
|
3933
3956
|
},
|
|
3934
3957
|
makeInfo(t, e, r) {
|
|
3935
|
-
const i = t.title, s = t.info, n =
|
|
3936
|
-
if (!
|
|
3958
|
+
const i = t.title, s = t.info, n = Gr(s), o = this.options.form, a = this.getSlot("title"), u = [a ? a({ title: i.title || "", rule: r.rule, options: this.options }) : (i.title || "") + (o.labelSuffix || o["label-suffix"] || "")];
|
|
3959
|
+
if (!P(s.show) && (s.info || s.native) && !P(s.icon)) {
|
|
3937
3960
|
const l = {
|
|
3938
3961
|
type: s.type || "popover",
|
|
3939
3962
|
props: y({}, s),
|
|
3940
3963
|
key: `${e}pop`,
|
|
3941
3964
|
slot: "label"
|
|
3942
|
-
},
|
|
3943
|
-
s.info && !
|
|
3965
|
+
}, c = "content";
|
|
3966
|
+
s.info && !O(l.props, c) && (l.props[c] = s.info), u[s.align !== "left" ? "unshift" : "push"](this.$r(D([s, l]), [
|
|
3944
3967
|
this.$r({
|
|
3945
3968
|
type: "i",
|
|
3946
3969
|
slot: n ? "default" : "reference",
|
|
@@ -3949,7 +3972,7 @@ const ei = {
|
|
|
3949
3972
|
})
|
|
3950
3973
|
]));
|
|
3951
3974
|
}
|
|
3952
|
-
return this.$r(
|
|
3975
|
+
return this.$r(D([i, {
|
|
3953
3976
|
props: i,
|
|
3954
3977
|
slot: i.slot || "label",
|
|
3955
3978
|
key: `${e}tit`,
|
|
@@ -3976,7 +3999,7 @@ const ei = {
|
|
|
3976
3999
|
},
|
|
3977
4000
|
makeFormBtn() {
|
|
3978
4001
|
let t = [];
|
|
3979
|
-
if (
|
|
4002
|
+
if (P(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), P(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
3980
4003
|
return;
|
|
3981
4004
|
const e = this.$r({
|
|
3982
4005
|
type: "formItem",
|
|
@@ -4018,35 +4041,35 @@ const ei = {
|
|
|
4018
4041
|
key: `${this.key}b1`
|
|
4019
4042
|
}, [t.innerText]);
|
|
4020
4043
|
}
|
|
4021
|
-
},
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
function
|
|
4044
|
+
}, H = {};
|
|
4045
|
+
Yr(H);
|
|
4046
|
+
ei(H);
|
|
4047
|
+
ti(H);
|
|
4048
|
+
ri(H);
|
|
4049
|
+
ii(H);
|
|
4050
|
+
function Yr(t) {
|
|
4028
4051
|
["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
|
|
4029
|
-
t[e] =
|
|
4052
|
+
t[e] = E(e);
|
|
4030
4053
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4031
4054
|
}
|
|
4032
|
-
function
|
|
4055
|
+
function ei(t) {
|
|
4033
4056
|
const e = "select", r = "multiple";
|
|
4034
|
-
t.selectMultiple =
|
|
4057
|
+
t.selectMultiple = E(e, { [r]: !0 }), t.selectOne = E(e, { [r]: !1 });
|
|
4035
4058
|
}
|
|
4036
|
-
function
|
|
4059
|
+
function ti(t) {
|
|
4037
4060
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4038
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4061
|
+
Object.keys(r).reduce((i, s) => (i[s] = E(e, { type: r[s] }), i), t);
|
|
4039
4062
|
}
|
|
4040
|
-
function
|
|
4063
|
+
function ri(t) {
|
|
4041
4064
|
const e = "upload", r = {
|
|
4042
4065
|
image: ["image", 0],
|
|
4043
4066
|
file: ["file", 0],
|
|
4044
4067
|
uploadFileOne: ["file", 1],
|
|
4045
4068
|
uploadImageOne: ["image", 1]
|
|
4046
4069
|
};
|
|
4047
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4070
|
+
Object.keys(r).reduce((i, s) => (i[s] = E(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4048
4071
|
}
|
|
4049
|
-
function
|
|
4072
|
+
function ii(t) {
|
|
4050
4073
|
const e = {
|
|
4051
4074
|
frameInputs: ["input", 0],
|
|
4052
4075
|
frameFiles: ["file", 0],
|
|
@@ -4055,13 +4078,13 @@ function si(t) {
|
|
|
4055
4078
|
frameFileOne: ["file", 1],
|
|
4056
4079
|
frameImageOne: ["image", 1]
|
|
4057
4080
|
};
|
|
4058
|
-
return Object.keys(e).reduce((r, i) => (r[i] =
|
|
4081
|
+
return Object.keys(e).reduce((r, i) => (r[i] = E("frame", (s) => s.props({ type: e[i][0], maxLength: e[i][1] })), r), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages, t;
|
|
4059
4082
|
}
|
|
4060
|
-
function
|
|
4061
|
-
return
|
|
4083
|
+
function Ke(t, e) {
|
|
4084
|
+
return f.Boolean(t) ? t = { show: t } : !f.Undef(t) && !f.Object(t) && (t = { show: e }), t;
|
|
4062
4085
|
}
|
|
4063
|
-
function
|
|
4064
|
-
return
|
|
4086
|
+
function ni(t, e) {
|
|
4087
|
+
return p(t, {
|
|
4065
4088
|
formEl() {
|
|
4066
4089
|
return e.$manager.form();
|
|
4067
4090
|
},
|
|
@@ -4086,7 +4109,7 @@ function oi(t, e) {
|
|
|
4086
4109
|
const o = e.getFieldCtx(r);
|
|
4087
4110
|
if (!o) return;
|
|
4088
4111
|
const a = e.subForm[o.id], u = [e.$manager.validateField(o.id)];
|
|
4089
|
-
|
|
4112
|
+
j(a).forEach((l) => {
|
|
4090
4113
|
u.push(l.validate().catch(() => Promise.reject("子表单验证未通过")));
|
|
4091
4114
|
}), Promise.all(u).then(() => {
|
|
4092
4115
|
s(null), i && i(null);
|
|
@@ -4134,41 +4157,41 @@ function oi(t, e) {
|
|
|
4134
4157
|
}
|
|
4135
4158
|
},
|
|
4136
4159
|
submitBtnProps: (r = {}) => {
|
|
4137
|
-
let i =
|
|
4138
|
-
|
|
4160
|
+
let i = Ke(e.options.submitBtn, !0);
|
|
4161
|
+
p(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4139
4162
|
},
|
|
4140
4163
|
resetBtnProps: (r = {}) => {
|
|
4141
|
-
let i =
|
|
4142
|
-
|
|
4164
|
+
let i = Ke(e.options.resetBtn, !1);
|
|
4165
|
+
p(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4143
4166
|
},
|
|
4144
4167
|
submit(r, i) {
|
|
4145
4168
|
t.validate((s) => {
|
|
4146
4169
|
if (s) {
|
|
4147
4170
|
let n = t.formData();
|
|
4148
|
-
|
|
4171
|
+
f.Function(r) ? R(() => r(n, this)) : (f.Function(e.options.onSubmit) && R(() => e.options.onSubmit(n, this)), e.vm.$emit("submit", n, this));
|
|
4149
4172
|
} else
|
|
4150
|
-
|
|
4173
|
+
f.Function(i) && R(() => i(this, ...arguments));
|
|
4151
4174
|
}).catch((s) => {
|
|
4152
4175
|
});
|
|
4153
4176
|
}
|
|
4154
4177
|
}), t;
|
|
4155
4178
|
}
|
|
4156
|
-
function
|
|
4157
|
-
t.componentAlias(
|
|
4179
|
+
function si(t) {
|
|
4180
|
+
t.componentAlias(Kr), Kt.forEach((e) => {
|
|
4158
4181
|
t.component(e.name, e);
|
|
4159
|
-
}),
|
|
4182
|
+
}), Jr.forEach((e) => {
|
|
4160
4183
|
t.parser(e);
|
|
4161
|
-
}), Object.keys(
|
|
4162
|
-
t.maker[e] =
|
|
4184
|
+
}), Object.keys(H).forEach((e) => {
|
|
4185
|
+
t.maker[e] = H[e];
|
|
4163
4186
|
});
|
|
4164
4187
|
}
|
|
4165
|
-
function
|
|
4166
|
-
return
|
|
4188
|
+
function oi() {
|
|
4189
|
+
return ft({
|
|
4167
4190
|
ui: "element-ui",
|
|
4168
|
-
version: "2.6.
|
|
4169
|
-
manager:
|
|
4170
|
-
extendApi:
|
|
4171
|
-
install:
|
|
4191
|
+
version: "2.6.2",
|
|
4192
|
+
manager: Zr,
|
|
4193
|
+
extendApi: ni,
|
|
4194
|
+
install: si,
|
|
4172
4195
|
attrs: {
|
|
4173
4196
|
normal: ["col", "wrap"],
|
|
4174
4197
|
array: ["className"],
|
|
@@ -4176,10 +4199,10 @@ function li() {
|
|
|
4176
4199
|
}
|
|
4177
4200
|
});
|
|
4178
4201
|
}
|
|
4179
|
-
const
|
|
4180
|
-
typeof window != "undefined" && (window.formCreate =
|
|
4181
|
-
const
|
|
4202
|
+
const fe = oi();
|
|
4203
|
+
typeof window != "undefined" && (window.formCreate = fe, window.Vue && fe.install(window.Vue));
|
|
4204
|
+
const ui = fe.maker;
|
|
4182
4205
|
export {
|
|
4183
|
-
|
|
4184
|
-
|
|
4206
|
+
fe as default,
|
|
4207
|
+
ui as maker
|
|
4185
4208
|
};
|