@form-create/element-ui 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/form-create.esm.js +856 -836
- 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.1
|
|
4
4
|
* (c) 2018-2024 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
7
7
|
* Released under the MIT License.
|
|
8
8
|
*/
|
|
9
9
|
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode('._fc-frame .fc-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 gt = Object.defineProperty, $t = Object.defineProperties;
|
|
11
|
+
var vt = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var Fe = Object.getOwnPropertySymbols;
|
|
13
|
+
var bt = Object.prototype.hasOwnProperty, Ct = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var Ee = (t, e, r) => e in t ? gt(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
|
+
bt.call(e, r) && Ee(t, r, e[r]);
|
|
17
|
+
if (Fe)
|
|
18
|
+
for (var r of Fe(e))
|
|
19
|
+
Ct.call(e, r) && Ee(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
},
|
|
22
|
-
import
|
|
23
|
-
function
|
|
21
|
+
}, M = (t, e) => $t(t, vt(e));
|
|
22
|
+
import T from "vue";
|
|
23
|
+
function _t(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function ae() {
|
|
27
|
+
return ae = Object.assign ? Object.assign.bind() : function(t) {
|
|
28
28
|
for (var e, r = 1; r < arguments.length; r++) for (var i in e = arguments[r], e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
|
|
29
29
|
return t;
|
|
30
|
-
},
|
|
30
|
+
}, ae.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var kt = ["attrs", "props", "domProps"], Ot = ["class", "style", "directives"], wt = ["on", "nativeOn"], Ft = function(t) {
|
|
33
33
|
return t.reduce(function(e, r) {
|
|
34
34
|
for (var i in r) if (!e[i]) e[i] = r[i];
|
|
35
|
-
else if (
|
|
36
|
-
else if (
|
|
35
|
+
else if (kt.indexOf(i) !== -1) e[i] = ae({}, e[i], r[i]);
|
|
36
|
+
else if (Ot.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 (wt.indexOf(i) !== -1)
|
|
40
40
|
for (var o in r[i]) if (e[i][o]) {
|
|
41
41
|
var a = e[i][o] instanceof Array ? e[i][o] : [e[i][o]], u = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
|
|
42
42
|
e[i][o] = [].concat(a, u);
|
|
43
43
|
} else e[i][o] = r[i][o];
|
|
44
|
-
else if (i === "hook") for (var l in r[i]) e[i][l] = e[i][l] ?
|
|
44
|
+
else if (i === "hook") for (var l in r[i]) e[i][l] = e[i][l] ? Et(e[i][l], r[i][l]) : r[i][l];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, Et = function(t, e) {
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
},
|
|
53
|
-
const
|
|
54
|
-
function
|
|
52
|
+
}, St = Ft;
|
|
53
|
+
const F = /* @__PURE__ */ _t(St);
|
|
54
|
+
function ee(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => ((!e || e.indexOf(i) === -1) && r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
name:
|
|
57
|
+
const Rt = "fcCheckbox", jt = {
|
|
58
|
+
name: Rt,
|
|
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
|
+
}), ee(this.$slots)]);
|
|
120
121
|
},
|
|
121
122
|
mounted() {
|
|
122
123
|
this.$emit("fc.el", this.$refs.el);
|
|
123
124
|
}
|
|
124
125
|
};
|
|
125
|
-
function
|
|
126
|
+
function j(t) {
|
|
126
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
127
128
|
}
|
|
128
|
-
const
|
|
129
|
-
name:
|
|
129
|
+
const It = "fcFrame", At = {
|
|
130
|
+
name: It,
|
|
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: M(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
|
+
}, Vt = "fcRadio", Pt = {
|
|
500
|
+
name: Vt,
|
|
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,14 +549,14 @@ 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
|
+
}), ee(this.$slots)]);
|
|
550
560
|
},
|
|
551
561
|
mounted() {
|
|
552
562
|
this.$emit("fc.el", this.$refs.el);
|
|
@@ -581,11 +591,11 @@ const At = "fcFrame", Vt = {
|
|
|
581
591
|
return c.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 Tt = "fcSelect", Dt = {
|
|
598
|
+
name: Tt,
|
|
589
599
|
functional: !0,
|
|
590
600
|
props: {
|
|
591
601
|
formCreateInject: {
|
|
@@ -596,7 +606,7 @@ 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
|
|
@@ -609,15 +619,15 @@ const Dt = "fcSelect", Bt = {
|
|
|
609
619
|
},
|
|
610
620
|
key: "" + o + "-" + n.label
|
|
611
621
|
}, [c.trueArray(n.options) && n.options.map((a, u) => r(a, u))]), s = e.props.formCreateInject.options;
|
|
612
|
-
return t("ElSelect",
|
|
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
|
+
}, Bt = "fcTree", Lt = {
|
|
630
|
+
name: Bt,
|
|
621
631
|
formCreateParser: {
|
|
622
632
|
mergeProp(t) {
|
|
623
633
|
const e = t.prop.props;
|
|
@@ -656,34 +666,35 @@ 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
|
+
}]), [ee(this.$slots)]);
|
|
670
681
|
},
|
|
671
682
|
mounted() {
|
|
672
683
|
this.setValue(), this.$emit("fc.el", this.$refs.tree);
|
|
673
684
|
}
|
|
674
685
|
};
|
|
675
|
-
function
|
|
686
|
+
function Se(t, e) {
|
|
676
687
|
return {
|
|
677
688
|
url: t,
|
|
678
|
-
name:
|
|
689
|
+
name: Nt(t),
|
|
679
690
|
uid: e
|
|
680
691
|
};
|
|
681
692
|
}
|
|
682
|
-
function
|
|
693
|
+
function Nt(t) {
|
|
683
694
|
return ("" + t).split("/").pop();
|
|
684
695
|
}
|
|
685
|
-
const
|
|
686
|
-
name:
|
|
696
|
+
const Mt = "fcUpload", qt = {
|
|
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(Se);
|
|
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(Se), 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,37 +805,38 @@ 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, ee(this.$slots, ["default"])]);
|
|
824
840
|
},
|
|
825
841
|
update() {
|
|
826
842
|
let t = this.$refs.upload.uploadFiles.map((e) => e.url).filter((e) => e !== void 0);
|
|
@@ -831,9 +847,10 @@ const qt = "fcUpload", Ut = {
|
|
|
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,13 +877,13 @@ 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 W(t, e = {}, r) {
|
|
870
887
|
let i = !1;
|
|
871
888
|
for (let s in e)
|
|
872
889
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
@@ -874,36 +891,36 @@ function G(t, e = {}, r) {
|
|
|
874
891
|
if ((i = Array.isArray(n)) || c.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] = W(t[s], n, r);
|
|
888
905
|
} else
|
|
889
|
-
|
|
906
|
+
w(t, s, n), c.Undef(n) || (c.Undef(n.__json) || (t[s].__json = n.__json), c.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 W({}, { value: t }).value;
|
|
895
912
|
}
|
|
896
|
-
const
|
|
913
|
+
const Ut = 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 Ut.apply(this, arguments);
|
|
904
921
|
}
|
|
905
|
-
const
|
|
906
|
-
name:
|
|
922
|
+
const Ht = "fcGroup", xt = {
|
|
923
|
+
name: Ht,
|
|
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
|
+
W(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], f = 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]), f.length ? t("div", {
|
|
1195
1216
|
class: "_fc-group-handle"
|
|
1196
|
-
}, [
|
|
1217
|
+
}, [f]) : 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
|
+
}, Jt = "fcSubForm", Kt = {
|
|
1225
|
+
name: Jt,
|
|
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
|
-
},
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
],
|
|
1308
|
+
}, Wt = [
|
|
1309
|
+
jt,
|
|
1310
|
+
At,
|
|
1311
|
+
Pt,
|
|
1312
|
+
Dt,
|
|
1313
|
+
Lt,
|
|
1314
|
+
qt,
|
|
1315
|
+
xt,
|
|
1316
|
+
Kt
|
|
1317
|
+
], Re = "FormCreate", le = (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 le(t.$parent, e);
|
|
1302
1323
|
}
|
|
1303
1324
|
};
|
|
1304
|
-
function
|
|
1325
|
+
function Gt(t, e, r) {
|
|
1305
1326
|
return {
|
|
1306
|
-
name:
|
|
1307
|
-
componentName:
|
|
1327
|
+
name: Re,
|
|
1328
|
+
componentName: Re,
|
|
1308
1329
|
model: {
|
|
1309
1330
|
prop: "api"
|
|
1310
1331
|
},
|
|
@@ -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 = le(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 = le(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 Ge = ["attrs", "props", "domProps", "scopedSlots"], Xe = ["class", "style", "directives"], ze = ["on", "nativeOn"], D = (t, e = {}, r = {}) => {
|
|
1443
|
+
const i = [...Ge, ...r.normal || []], s = [...Xe, ...r.array || []], n = [...ze, ...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 f = a[l] instanceof Array ? a[l] : [a[l]], m = u[l] instanceof Array ? u[l] : [u[l]];
|
|
1453
|
+
a[l] = [...f, ...m];
|
|
1433
1454
|
} else if (n.indexOf(l) > -1)
|
|
1434
|
-
for (const
|
|
1435
|
-
if (a[l][
|
|
1436
|
-
const
|
|
1437
|
-
a[l][
|
|
1455
|
+
for (const f in u[l])
|
|
1456
|
+
if (a[l][f]) {
|
|
1457
|
+
const m = a[l][f] instanceof Array ? a[l][f] : [a[l][f]], v = u[l][f] instanceof Array ? u[l][f] : [u[l][f]];
|
|
1458
|
+
a[l][f] = [...m, ...v];
|
|
1438
1459
|
} else
|
|
1439
|
-
a[l][
|
|
1460
|
+
a[l][f] = u[l][f];
|
|
1440
1461
|
else if (l === "hook")
|
|
1441
|
-
for (let
|
|
1442
|
-
a[l][
|
|
1462
|
+
for (let f in u[l])
|
|
1463
|
+
a[l][f] ? a[l][f] = Xt(a[l][f], u[l][f]) : a[l][f] = u[l][f];
|
|
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
|
+
}, Xt = (t, e) => function() {
|
|
1450
1471
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1451
|
-
},
|
|
1452
|
-
function
|
|
1453
|
-
return [...
|
|
1472
|
+
}, Qe = ["type", "slot", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "preview", "component", "cache"], de = ["validate", "children", "control"], pe = ["effect", "deep"];
|
|
1473
|
+
function zt() {
|
|
1474
|
+
return [...Qe, ...Ge, ...Xe, ...ze, ...de, ...pe];
|
|
1454
1475
|
}
|
|
1455
|
-
function
|
|
1476
|
+
function me(t, e, r) {
|
|
1456
1477
|
return `[form-create ${t}]: ${e}`;
|
|
1457
1478
|
}
|
|
1458
|
-
function
|
|
1459
|
-
console.warn(
|
|
1479
|
+
function Qt(t, e) {
|
|
1480
|
+
console.warn(me("tip", t));
|
|
1460
1481
|
}
|
|
1461
|
-
function
|
|
1462
|
-
console.error(
|
|
1482
|
+
function ye(t, e) {
|
|
1483
|
+
console.error(me("err", t));
|
|
1463
1484
|
}
|
|
1464
|
-
function
|
|
1465
|
-
|
|
1485
|
+
function Zt(t) {
|
|
1486
|
+
ye(t.toString()), console.error(t);
|
|
1466
1487
|
}
|
|
1467
|
-
const
|
|
1468
|
-
function
|
|
1469
|
-
return JSON.stringify(
|
|
1488
|
+
const ue = "[[FORM-CREATE-PREFIX-", he = "-FORM-CREATE-SUFFIX]]", je = "$FN:", Ie = "$FNX:", J = "function";
|
|
1489
|
+
function Ze(t, e) {
|
|
1490
|
+
return JSON.stringify(W(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1470
1491
|
if (!(i && i._isVue === !0)) {
|
|
1471
|
-
if (typeof i !==
|
|
1492
|
+
if (typeof i !== J)
|
|
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 ue + i + he;
|
|
1477
1498
|
}
|
|
1478
1499
|
}, e);
|
|
1479
1500
|
}
|
|
1480
|
-
function
|
|
1501
|
+
function Ae(t) {
|
|
1481
1502
|
return new Function("return " + t)();
|
|
1482
1503
|
}
|
|
1483
|
-
function
|
|
1504
|
+
function q(t, e) {
|
|
1484
1505
|
if (t && c.String(t) && t.length > 4) {
|
|
1485
1506
|
let r = t.trim(), i = !1;
|
|
1486
1507
|
try {
|
|
1487
|
-
if (r.indexOf(he) > 0 && r.indexOf(
|
|
1488
|
-
r = r.replace(he, "").replace(
|
|
1489
|
-
else if (r.indexOf(
|
|
1490
|
-
r = r.replace(
|
|
1508
|
+
if (r.indexOf(he) > 0 && r.indexOf(ue) === 0)
|
|
1509
|
+
r = r.replace(he, "").replace(ue, ""), i = !0;
|
|
1510
|
+
else if (r.indexOf(je) === 0)
|
|
1511
|
+
r = r.replace(je, ""), i = !0;
|
|
1491
1512
|
else {
|
|
1492
|
-
if (r.indexOf(
|
|
1493
|
-
return r =
|
|
1494
|
-
!e && r.indexOf(
|
|
1513
|
+
if (r.indexOf(Ie) === 0)
|
|
1514
|
+
return r = Ae("function($inject){" + r.replace(Ie, "") + "}"), r.__json = t, r.__inject = !0, r;
|
|
1515
|
+
!e && r.indexOf(J) === 0 && r !== J && (i = !0);
|
|
1495
1516
|
}
|
|
1496
1517
|
if (!i) return t;
|
|
1497
|
-
const s =
|
|
1518
|
+
const s = Ae(r.indexOf(J) === -1 && r.indexOf("(") !== 0 ? J + " " + r : r);
|
|
1498
1519
|
return s.__json = t, s;
|
|
1499
1520
|
} catch (s) {
|
|
1500
|
-
|
|
1521
|
+
ye(`解析失败:${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 Yt(t, e) {
|
|
1509
1530
|
return JSON.parse(t, function(r, i) {
|
|
1510
|
-
return c.Undef(i) || !i.indexOf ? i :
|
|
1531
|
+
return c.Undef(i) || !i.indexOf ? i : q(i, e);
|
|
1511
1532
|
});
|
|
1512
1533
|
}
|
|
1513
|
-
function
|
|
1534
|
+
function Ye(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 ge(t) {
|
|
1543
|
+
return et([t])[0];
|
|
1523
1544
|
}
|
|
1524
|
-
function
|
|
1525
|
-
return
|
|
1545
|
+
function et(t, e) {
|
|
1546
|
+
return W([], [...t], e || !1);
|
|
1526
1547
|
}
|
|
1527
|
-
function
|
|
1528
|
-
return
|
|
1548
|
+
function U(t, e) {
|
|
1549
|
+
return D(Array.isArray(e) ? e : [e], t, { array: de, normal: pe }), t;
|
|
1529
1550
|
}
|
|
1530
|
-
function
|
|
1551
|
+
function Ve(t) {
|
|
1531
1552
|
const e = c.Function(t.getRule) ? t.getRule() : t;
|
|
1532
1553
|
return e.type || (e.type = "input"), e;
|
|
1533
1554
|
}
|
|
1534
|
-
function
|
|
1555
|
+
function er(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 tt(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 Q(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
|
+
Zt(r);
|
|
1554
1575
|
}
|
|
1555
1576
|
return e;
|
|
1556
1577
|
}
|
|
1557
|
-
const
|
|
1558
|
-
"==": (t, e) => JSON.stringify(t) === JSON.stringify(
|
|
1559
|
-
"!=": (t, e) => !
|
|
1578
|
+
const Pe = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, K = {
|
|
1579
|
+
"==": (t, e) => JSON.stringify(t) === JSON.stringify(Pe(t, e)),
|
|
1580
|
+
"!=": (t, e) => !K["=="](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(Pe(t[0], e)) > -1;
|
|
1566
1587
|
},
|
|
1567
1588
|
notOn(t, e) {
|
|
1568
|
-
return !
|
|
1589
|
+
return !K.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 !K.in(t, e);
|
|
1575
1596
|
},
|
|
1576
1597
|
between(t, e) {
|
|
1577
1598
|
return t > e[0] && t < e[1];
|
|
@@ -1589,7 +1610,7 @@ const Te = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1589
1610
|
return new RegExp(e, "g").test(t);
|
|
1590
1611
|
}
|
|
1591
1612
|
};
|
|
1592
|
-
function
|
|
1613
|
+
function rt() {
|
|
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
|
|
1627
|
+
const o = new $e(t, r, i, s, n);
|
|
1607
1628
|
return e && (c.Function(e) ? e(o) : o.props(e)), o;
|
|
1608
1629
|
};
|
|
1609
1630
|
}
|
|
1610
|
-
function
|
|
1611
|
-
this._data =
|
|
1631
|
+
function $e(t, e, r, i, s) {
|
|
1632
|
+
this._data = p(rt(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1612
1633
|
}
|
|
1613
|
-
|
|
1634
|
+
p($e.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 = ge(this._data), t;
|
|
1623
1644
|
}
|
|
1624
1645
|
});
|
|
1625
|
-
function
|
|
1646
|
+
function it(t) {
|
|
1626
1647
|
t.forEach((e) => {
|
|
1627
|
-
|
|
1628
|
-
return
|
|
1648
|
+
$e.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
|
+
it(zt());
|
|
1654
|
+
const nt = E("");
|
|
1655
|
+
function tr(t, e, r) {
|
|
1656
|
+
let i = nt("", e);
|
|
1636
1657
|
return i._data.type = t, i._data.title = r, i;
|
|
1637
1658
|
}
|
|
1638
|
-
function
|
|
1639
|
-
let s =
|
|
1659
|
+
function Te(t, e, r, i) {
|
|
1660
|
+
let s = nt("", 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 rr() {
|
|
1643
1664
|
return {
|
|
1644
|
-
create:
|
|
1645
|
-
createTmp:
|
|
1646
|
-
template:
|
|
1647
|
-
factory:
|
|
1665
|
+
create: tr,
|
|
1666
|
+
createTmp: Te,
|
|
1667
|
+
template: Te,
|
|
1668
|
+
factory: E
|
|
1648
1669
|
};
|
|
1649
1670
|
}
|
|
1650
|
-
function
|
|
1671
|
+
function ir(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 De(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 st(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(ir(r, t, e), De(e));
|
|
1694
|
+
t.onSuccess(De(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,12 +1702,12 @@ function ot(t) {
|
|
|
1681
1702
|
s[n] !== null && e.setRequestHeader(n, s[n]);
|
|
1682
1703
|
}), e.send(i);
|
|
1683
1704
|
}
|
|
1684
|
-
function
|
|
1705
|
+
function nr(t) {
|
|
1685
1706
|
return new Promise((e, r) => {
|
|
1686
|
-
|
|
1707
|
+
st(M(y({}, t), {
|
|
1687
1708
|
onSuccess(i) {
|
|
1688
1709
|
let s = (o) => o;
|
|
1689
|
-
const n =
|
|
1710
|
+
const n = q(t.parse);
|
|
1690
1711
|
c.Function(n) ? s = n : n && c.String(n) && (s = (o) => (n.split(".").forEach((a) => {
|
|
1691
1712
|
o && (o = o[a]);
|
|
1692
1713
|
}), o)), e(s(i));
|
|
@@ -1697,17 +1718,17 @@ function sr(t) {
|
|
|
1697
1718
|
}));
|
|
1698
1719
|
});
|
|
1699
1720
|
}
|
|
1700
|
-
function
|
|
1701
|
-
return
|
|
1721
|
+
function z(t) {
|
|
1722
|
+
return L(t);
|
|
1702
1723
|
}
|
|
1703
|
-
function
|
|
1724
|
+
function sr(t) {
|
|
1704
1725
|
function e(n) {
|
|
1705
1726
|
return c.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] = z(u.rule.value)), o;
|
|
1768
|
+
}, t.options.appendValue !== !1 ? z(t.appendData) : {});
|
|
1748
1769
|
},
|
|
1749
1770
|
getValue(n) {
|
|
1750
1771
|
const o = t.getFieldCtx(n);
|
|
1751
1772
|
if (o)
|
|
1752
|
-
return
|
|
1773
|
+
return z(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((f) => {
|
|
1783
|
+
f.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 && Q(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 f = t.getCtx(o);
|
|
1821
|
+
f ? a ? (l = f.rule.children, u = f.rule.children.length - 1) : (u = f.root.indexOf(f.origin), l = f.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 f = t.getCtx(o);
|
|
1826
|
+
f ? a ? l = f.rule.children : (u = f.root.indexOf(f.origin), l = f.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 = c.Object(n) ?
|
|
1886
|
+
let o = c.Object(n) ? Q(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 = z(a.defaultValue);
|
|
1950
1971
|
});
|
|
1951
1972
|
}), t.vm.$nextTick(() => {
|
|
1952
1973
|
s.clearValidateState();
|
|
1953
|
-
}), n == null && (c.Function(t.options.onReset) &&
|
|
1974
|
+
}), n == null && (c.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(me("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 Ze(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(() => nr(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 or(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 ot(e);
|
|
2056
2077
|
}
|
|
2057
|
-
function
|
|
2078
|
+
function ot(t) {
|
|
2058
2079
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2059
2080
|
}
|
|
2060
|
-
function
|
|
2081
|
+
function at(t) {
|
|
2061
2082
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
2062
2083
|
}
|
|
2063
|
-
function
|
|
2084
|
+
function Z(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 ar = 0;
|
|
2089
|
+
function te() {
|
|
2090
|
+
const t = 370 + ++ar;
|
|
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 Y(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 lr(t) {
|
|
2100
|
+
p(t.prototype, {
|
|
2080
2101
|
initRender() {
|
|
2081
2102
|
this.tempList = {}, this.clearOrgChildren();
|
|
2082
2103
|
},
|
|
@@ -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-" + Z(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + Z(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2101
2122
|
}
|
|
2102
2123
|
};
|
|
2103
2124
|
return r(this.vm);
|
|
@@ -2117,37 +2138,37 @@ function ur(t) {
|
|
|
2117
2138
|
const r = e.vm;
|
|
2118
2139
|
if (r) {
|
|
2119
2140
|
if (c.Function(r))
|
|
2120
|
-
return
|
|
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 && Y(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
|
+
Y(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 Qt("当前使用的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,7 +2177,7 @@ 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];
|
|
@@ -2165,7 +2186,7 @@ function ur(t) {
|
|
|
2165
2186
|
return c.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 c.Object(e) ?
|
|
2189
|
+
return c.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"];
|
|
@@ -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,17 +2221,17 @@ 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 f = [];
|
|
2225
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(e) : e.parser.loadChildren !== !1 && (f = 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: f,
|
|
2211
2232
|
api: this.$handle.api,
|
|
2212
2233
|
model: u.model || {}
|
|
2213
|
-
}) : s = l ? e.parser.preview(
|
|
2234
|
+
}) : s = l ? e.parser.preview(f, e) : e.parser.render(f, e);
|
|
2214
2235
|
}
|
|
2215
2236
|
s = this.renderSides(s, e), !(!e.input && c.Undef(u.native)) && u.native !== !0 && (s = this.$manager.makeWrap(e, s)), a && (s = this.display(s)), s = this.item(e, s);
|
|
2216
2237
|
}
|
|
@@ -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");
|
|
@@ -2324,7 +2345,7 @@ 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(ot(e.originType), i, r);
|
|
2328
2349
|
},
|
|
2329
2350
|
renderRule(e, r, i) {
|
|
2330
2351
|
if (!e) return;
|
|
@@ -2333,9 +2354,9 @@ function ur(t) {
|
|
|
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]];
|
|
@@ -2343,14 +2364,14 @@ function ur(t) {
|
|
|
2343
2364
|
}
|
|
2344
2365
|
});
|
|
2345
2366
|
}
|
|
2346
|
-
function
|
|
2347
|
-
|
|
2367
|
+
function ve(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
|
+
}), tt(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
|
+
or(ve);
|
|
2384
|
+
lr(ve);
|
|
2385
|
+
function ur(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);
|
|
@@ -2379,26 +2400,26 @@ function fr(t) {
|
|
|
2379
2400
|
if (!s && Array.isArray(r) && r[0] && (c.String(r[0]) || c.Function(r[0])))
|
|
2380
2401
|
return this.parseEventLst(e, r, i, !0);
|
|
2381
2402
|
if (c.String(r)) {
|
|
2382
|
-
const n =
|
|
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 c.trueArray(l) && l.forEach((
|
|
2390
|
-
if (!
|
|
2391
|
-
let
|
|
2392
|
-
if (c.Object(
|
|
2393
|
-
r || (
|
|
2394
|
-
const
|
|
2395
|
-
this.vm.$emit(
|
|
2410
|
+
return c.trueArray(l) && l.forEach((f) => {
|
|
2411
|
+
if (!f) return;
|
|
2412
|
+
let m, v = n || o || a;
|
|
2413
|
+
if (c.Object(f) && (m = f.inject, f = f.name, v = f.prefix || v), v) {
|
|
2414
|
+
r || (v = `native-${v}`);
|
|
2415
|
+
const _ = Z(`${v}-${f}`), 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[f] = g;
|
|
2399
2420
|
else {
|
|
2400
|
-
let
|
|
2401
|
-
i[
|
|
2421
|
+
let k = m || u || this.options.injectEvent;
|
|
2422
|
+
i[f] = c.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
|
|
2452
|
+
const Be = ["hook:updated", "hook:mounted"];
|
|
2432
2453
|
function hr(t) {
|
|
2433
|
-
|
|
2454
|
+
p(t.prototype, {
|
|
2434
2455
|
usePage() {
|
|
2435
2456
|
const e = this.options.page;
|
|
2436
2457
|
if (!e) return;
|
|
2437
2458
|
let r = 25, i = cr(this.rules);
|
|
2438
|
-
c.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)),
|
|
2459
|
+
c.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(Be, 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(Be, e);
|
|
2449
2470
|
}
|
|
2450
2471
|
});
|
|
2451
2472
|
}
|
|
2452
2473
|
function cr(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 dr(t) {
|
|
2471
2492
|
Object.defineProperties(t.origin, {
|
|
2472
|
-
__fc__:
|
|
2493
|
+
__fc__: Ye(t, !0)
|
|
2473
2494
|
});
|
|
2474
2495
|
}
|
|
2475
|
-
function
|
|
2476
|
-
const i =
|
|
2477
|
-
|
|
2496
|
+
function lt(t, e, r) {
|
|
2497
|
+
const i = te();
|
|
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(), dr(this), this.update(t, !0);
|
|
2499
2520
|
}
|
|
2500
|
-
|
|
2521
|
+
p(lt.prototype, {
|
|
2501
2522
|
effectData(t) {
|
|
2502
2523
|
return this.payload[t] || (this.payload[t] = {}), this.payload[t];
|
|
2503
2524
|
},
|
|
@@ -2505,20 +2526,20 @@ 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 = te(), 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
|
|
2542
|
+
return j(this.prop.validate).map((t) => {
|
|
2522
2543
|
if (c.Function(t.validator)) {
|
|
2523
2544
|
const e = y({}, t), r = this;
|
|
2524
2545
|
return e.validator = function(...i) {
|
|
@@ -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 pr(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 = Ve(e);
|
|
2611
2631
|
return Object.defineProperties(r, {
|
|
2612
|
-
__origin__:
|
|
2613
|
-
}),
|
|
2632
|
+
__origin__: Ye(e, !0)
|
|
2633
|
+
}), mr(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
|
-
c.trueArray(r.sync) &&
|
|
2649
|
+
c.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), {})
|
|
@@ -2658,91 +2678,91 @@ function mr(t) {
|
|
|
2658
2678
|
if (r && !c.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 = Ve(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, f = !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 (Le(l))
|
|
2671
2691
|
return;
|
|
2672
2692
|
l.update(this);
|
|
2673
2693
|
}
|
|
2674
|
-
} else if (
|
|
2675
|
-
if (
|
|
2694
|
+
} else if (g) {
|
|
2695
|
+
if (Le(l))
|
|
2676
2696
|
return;
|
|
2677
|
-
e[o] = n = n._clone ? n._clone() :
|
|
2697
|
+
e[o] = n = n._clone ? n._clone() : ge(n), l = null, f = !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 lt(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), !f && !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, c.Function(
|
|
2692
|
-
this.refreshUpdate(l,
|
|
2693
|
-
}), this.effect(l, "loaded")), l.input && Object.defineProperty(
|
|
2710
|
+
const _ = l.rule;
|
|
2711
|
+
return l.updated || (l.updated = !0, c.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 = yr(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 (K[u.condition || "=="] || K["=="])(m, u.value);
|
|
2705
2725
|
};
|
|
2706
2726
|
if (!c.trueArray(u.rule)) continue;
|
|
2707
|
-
const
|
|
2708
|
-
valid:
|
|
2709
|
-
ctrl:
|
|
2727
|
+
const f = M(y({}, u), {
|
|
2728
|
+
valid: R(() => l(e.rule.value, s)),
|
|
2729
|
+
ctrl: gr(e, u.rule),
|
|
2710
2730
|
isHidden: c.String(u.rule[0])
|
|
2711
2731
|
});
|
|
2712
|
-
|
|
2732
|
+
f.valid && f.ctrl || !f.valid && !f.ctrl && !f.isHidden || i.push(f);
|
|
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: f, 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
|
+
f ? s.prepend(k, f, 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 = Q(_);
|
|
2765
|
+
k && k.rm();
|
|
2746
2766
|
}
|
|
2747
2767
|
});
|
|
2748
2768
|
}), n.length && this.vm.$nextTick(() => {
|
|
@@ -2767,28 +2787,28 @@ function mr(t) {
|
|
|
2767
2787
|
}
|
|
2768
2788
|
});
|
|
2769
2789
|
}
|
|
2770
|
-
function
|
|
2771
|
-
const e =
|
|
2790
|
+
function mr(t) {
|
|
2791
|
+
const e = rt();
|
|
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 yr(t) {
|
|
2777
2797
|
const e = t.rule.control || [];
|
|
2778
2798
|
return c.Object(e) ? [e] : e;
|
|
2779
2799
|
}
|
|
2780
|
-
function
|
|
2800
|
+
function gr(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 Le(t) {
|
|
2788
2808
|
return !!t.rule.__ctrl;
|
|
2789
2809
|
}
|
|
2790
|
-
function
|
|
2791
|
-
|
|
2810
|
+
function $r(t) {
|
|
2811
|
+
p(t.prototype, {
|
|
2792
2812
|
getValue(e) {
|
|
2793
2813
|
return c.Undef(e.cacheValue) && (e.cacheValue = e.parser.toValue(this.getFormData(e), e)), e.cacheValue;
|
|
2794
2814
|
},
|
|
@@ -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, Ne) !== JSON.stringify(r === null ? void 0 : r, Ne);
|
|
2857
2877
|
},
|
|
2858
2878
|
isQuote(e, r) {
|
|
2859
2879
|
return (c.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
2860
2880
|
},
|
|
2861
2881
|
refreshUpdate(e, r, i, s) {
|
|
2862
2882
|
if (c.Function(e.rule.update)) {
|
|
2863
|
-
const n =
|
|
2883
|
+
const n = R(() => e.rule.update(r, e.origin, this.api, {
|
|
2864
2884
|
origin: i || "change",
|
|
2865
2885
|
linkField: s
|
|
2866
2886
|
}));
|
|
@@ -2886,10 +2906,10 @@ function vr(t) {
|
|
|
2886
2906
|
}
|
|
2887
2907
|
});
|
|
2888
2908
|
}
|
|
2889
|
-
function
|
|
2909
|
+
function Ne(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
2915
|
const ce = {
|
|
@@ -2911,9 +2931,9 @@ const ce = {
|
|
|
2911
2931
|
},
|
|
2912
2932
|
mergeProp(t) {
|
|
2913
2933
|
}
|
|
2914
|
-
},
|
|
2915
|
-
function
|
|
2916
|
-
|
|
2934
|
+
}, vr = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "component", "cache"];
|
|
2935
|
+
function br(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] || ce;
|
|
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] !== "$" && vr.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)) {
|
|
@@ -2997,7 +3017,7 @@ function Cr(t) {
|
|
|
2997
3017
|
e.input && Object.defineProperty(e.rule, "value", {
|
|
2998
3018
|
value: e.rule.value,
|
|
2999
3019
|
writable: !0
|
|
3000
|
-
}),
|
|
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(() => {
|
|
3001
3021
|
this.reloading || (e.parser.loadChildren !== !1 && c.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);
|
|
@@ -3005,8 +3025,8 @@ function Cr(t) {
|
|
|
3005
3025
|
}
|
|
3006
3026
|
});
|
|
3007
3027
|
}
|
|
3008
|
-
function
|
|
3009
|
-
|
|
3028
|
+
function Cr(t) {
|
|
3029
|
+
p(t.prototype, {
|
|
3010
3030
|
mounted() {
|
|
3011
3031
|
const e = () => {
|
|
3012
3032
|
this.isMounted = !0, this.lifecycle("mounted");
|
|
@@ -3017,22 +3037,22 @@ function _r(t) {
|
|
|
3017
3037
|
this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3018
3038
|
},
|
|
3019
3039
|
emitEvent(e, ...r) {
|
|
3020
|
-
const i = this.options[e] || this.options[
|
|
3040
|
+
const i = this.options[e] || this.options[I("on-" + e)];
|
|
3021
3041
|
if (i) {
|
|
3022
|
-
const s =
|
|
3023
|
-
c.Function(s) &&
|
|
3042
|
+
const s = q(i);
|
|
3043
|
+
c.Function(s) && R(() => s(...r));
|
|
3024
3044
|
}
|
|
3025
3045
|
this.bus.$emit(e, ...r);
|
|
3026
3046
|
}
|
|
3027
3047
|
});
|
|
3028
3048
|
}
|
|
3029
|
-
function
|
|
3030
|
-
|
|
3049
|
+
function _r(t) {
|
|
3050
|
+
p(t.prototype, {
|
|
3031
3051
|
useProvider() {
|
|
3032
3052
|
const e = this.fc.providers;
|
|
3033
3053
|
Object.keys(e).forEach((r) => {
|
|
3034
3054
|
let i = e[r];
|
|
3035
|
-
c.Function(i) && (i = i(this.fc)), i._c =
|
|
3055
|
+
c.Function(i) && (i = i(this.fc)), i._c = Or(i), this.onEffect(i), this.providers[r] = i;
|
|
3036
3056
|
});
|
|
3037
3057
|
},
|
|
3038
3058
|
onEffect(e) {
|
|
@@ -3049,7 +3069,7 @@ function kr(t) {
|
|
|
3049
3069
|
let i = {
|
|
3050
3070
|
required: () => {
|
|
3051
3071
|
var s, n;
|
|
3052
|
-
return (
|
|
3072
|
+
return (O(e.rule, "$required") ? e.rule.$required : (n = (s = e.rule) == null ? void 0 : s.effect) == null ? void 0 : n.required) || !1;
|
|
3053
3073
|
}
|
|
3054
3074
|
};
|
|
3055
3075
|
Object.keys(e.rule.effect || {}).forEach((s) => {
|
|
@@ -3079,44 +3099,44 @@ function kr(t) {
|
|
|
3079
3099
|
}, r);
|
|
3080
3100
|
},
|
|
3081
3101
|
getEffect(e, r) {
|
|
3082
|
-
if (
|
|
3102
|
+
if (O(e, "$" + r))
|
|
3083
3103
|
return e["$" + r];
|
|
3084
|
-
if (
|
|
3104
|
+
if (O(e, "effect") && O(e.effect, r))
|
|
3085
3105
|
return e.effect[r];
|
|
3086
3106
|
},
|
|
3087
3107
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3088
3108
|
if (!s || s === "fcFragment") return;
|
|
3089
|
-
const u = n || Object.keys(r).reduce((l,
|
|
3109
|
+
const u = n || Object.keys(r).reduce((l, f) => (f[0] === "$" && (l[f.substr(1)] = r[f]), l), y({}, r.effect || {}));
|
|
3090
3110
|
Object.keys(u).forEach((l) => {
|
|
3091
|
-
const
|
|
3092
|
-
if (!
|
|
3093
|
-
let
|
|
3094
|
-
if (!
|
|
3095
|
-
|
|
3096
|
-
else if (
|
|
3097
|
-
|
|
3111
|
+
const f = this.providers[l];
|
|
3112
|
+
if (!f || f.input && !i) return;
|
|
3113
|
+
let m;
|
|
3114
|
+
if (!f._c)
|
|
3115
|
+
m = "*";
|
|
3116
|
+
else if (f._used.indexOf(s) > -1)
|
|
3117
|
+
m = s;
|
|
3098
3118
|
else
|
|
3099
3119
|
return;
|
|
3100
|
-
const
|
|
3101
|
-
e && (
|
|
3120
|
+
const v = y({ value: u[l], getValue: () => this.getEffect(r, l) }, a || {});
|
|
3121
|
+
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}:${f.input ? 1 : 0}`, o, [v, r, this.api]);
|
|
3102
3122
|
});
|
|
3103
3123
|
}
|
|
3104
3124
|
});
|
|
3105
3125
|
}
|
|
3106
|
-
function
|
|
3126
|
+
function kr(t) {
|
|
3107
3127
|
return t.filter(function(e, r, i) {
|
|
3108
3128
|
return i.indexOf(e, 0) === r;
|
|
3109
3129
|
});
|
|
3110
3130
|
}
|
|
3111
|
-
function
|
|
3131
|
+
function Or(t) {
|
|
3112
3132
|
const e = t.components;
|
|
3113
3133
|
if (Array.isArray(e)) {
|
|
3114
|
-
const r =
|
|
3134
|
+
const r = kr(e.filter((i) => i !== "*"));
|
|
3115
3135
|
return r.length ? r : !1;
|
|
3116
3136
|
} else return c.String(e) ? [e] : !1;
|
|
3117
3137
|
}
|
|
3118
|
-
function
|
|
3119
|
-
|
|
3138
|
+
function V(t) {
|
|
3139
|
+
p(this, {
|
|
3120
3140
|
fc: t,
|
|
3121
3141
|
vm: t.vm,
|
|
3122
3142
|
watching: !1,
|
|
@@ -3138,18 +3158,18 @@ function P(t) {
|
|
|
3138
3158
|
nextReload: () => {
|
|
3139
3159
|
this.lifecycle("reload");
|
|
3140
3160
|
}
|
|
3141
|
-
}),
|
|
3161
|
+
}), tt(this, {
|
|
3142
3162
|
options() {
|
|
3143
3163
|
return t.options;
|
|
3144
3164
|
},
|
|
3145
3165
|
bus() {
|
|
3146
3166
|
return t.bus;
|
|
3147
3167
|
}
|
|
3148
|
-
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new
|
|
3168
|
+
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new ve(this), this.api = t.extendApi(sr(this), this);
|
|
3149
3169
|
}
|
|
3150
|
-
|
|
3170
|
+
p(V.prototype, {
|
|
3151
3171
|
initData(t) {
|
|
3152
|
-
|
|
3172
|
+
p(this, {
|
|
3153
3173
|
ctxs: {},
|
|
3154
3174
|
fieldCtx: {},
|
|
3155
3175
|
nameCtx: {},
|
|
@@ -3162,55 +3182,55 @@ m(P.prototype, {
|
|
|
3162
3182
|
},
|
|
3163
3183
|
beforeFetch(t) {
|
|
3164
3184
|
return new Promise((e) => {
|
|
3165
|
-
const r = this.options.beforeFetch &&
|
|
3185
|
+
const r = this.options.beforeFetch && R(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3166
3186
|
r && c.Function(r.then) ? r.then(e) : e();
|
|
3167
3187
|
});
|
|
3168
3188
|
}
|
|
3169
3189
|
});
|
|
3170
|
-
|
|
3171
|
-
hr(
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
const
|
|
3179
|
-
name:
|
|
3190
|
+
ur(V);
|
|
3191
|
+
hr(V);
|
|
3192
|
+
fr(V);
|
|
3193
|
+
pr(V);
|
|
3194
|
+
$r(V);
|
|
3195
|
+
br(V);
|
|
3196
|
+
Cr(V);
|
|
3197
|
+
_r(V);
|
|
3198
|
+
const wr = "fcFragment", re = {
|
|
3199
|
+
name: wr,
|
|
3180
3200
|
functional: !0,
|
|
3181
3201
|
props: ["vnode"],
|
|
3182
3202
|
render(t, e) {
|
|
3183
3203
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3184
3204
|
}
|
|
3185
3205
|
};
|
|
3186
|
-
function
|
|
3206
|
+
function Fr(t) {
|
|
3187
3207
|
return c.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3188
3208
|
}
|
|
3189
|
-
function
|
|
3209
|
+
function Er() {
|
|
3190
3210
|
const t = {};
|
|
3191
3211
|
function e(r) {
|
|
3192
3212
|
r && this.setVm(r);
|
|
3193
3213
|
}
|
|
3194
|
-
return
|
|
3214
|
+
return p(e.prototype, {
|
|
3195
3215
|
setVm(r) {
|
|
3196
3216
|
this.vm = r, this.$h = r.$createElement;
|
|
3197
3217
|
},
|
|
3198
3218
|
make(r, i, s) {
|
|
3199
|
-
return
|
|
3219
|
+
return T.config.isReservedTag(r) && i.nativeOn && delete i.nativeOn, this.makeComponent(r, i, s);
|
|
3200
3220
|
},
|
|
3201
3221
|
makeComponent(r, i, s) {
|
|
3202
|
-
let n = this.$h(r,
|
|
3222
|
+
let n = this.$h(r, Fr(i), s || []);
|
|
3203
3223
|
return n.context = this.vm, n;
|
|
3204
3224
|
},
|
|
3205
3225
|
aliasMap: t
|
|
3206
|
-
}),
|
|
3226
|
+
}), p(e, {
|
|
3207
3227
|
aliasMap: t,
|
|
3208
3228
|
alias(r, i) {
|
|
3209
3229
|
t[r] = i;
|
|
3210
3230
|
},
|
|
3211
3231
|
use(r) {
|
|
3212
3232
|
Object.keys(r).forEach((i) => {
|
|
3213
|
-
const s =
|
|
3233
|
+
const s = Z(i), n = at(i).toLocaleLowerCase(), o = r[i];
|
|
3214
3234
|
[i, s, n].forEach((a) => {
|
|
3215
3235
|
e.alias(i, o), e.prototype[a] = function(u, l) {
|
|
3216
3236
|
return this.make(o, u, l);
|
|
@@ -3220,13 +3240,13 @@ function Rr() {
|
|
|
3220
3240
|
}
|
|
3221
3241
|
}), e;
|
|
3222
3242
|
}
|
|
3223
|
-
function
|
|
3224
|
-
class e extends
|
|
3243
|
+
function Sr(t) {
|
|
3244
|
+
class e extends ut {
|
|
3225
3245
|
}
|
|
3226
3246
|
return Object.assign(e.prototype, t), e;
|
|
3227
3247
|
}
|
|
3228
|
-
function
|
|
3229
|
-
|
|
3248
|
+
function ut(t) {
|
|
3249
|
+
p(this, {
|
|
3230
3250
|
$handle: t,
|
|
3231
3251
|
vm: t.vm,
|
|
3232
3252
|
options: {},
|
|
@@ -3236,12 +3256,12 @@ function ft(t) {
|
|
|
3236
3256
|
}
|
|
3237
3257
|
}), this.updateKey(), this.init();
|
|
3238
3258
|
}
|
|
3239
|
-
|
|
3259
|
+
p(ut.prototype, {
|
|
3240
3260
|
__init() {
|
|
3241
3261
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3242
3262
|
},
|
|
3243
3263
|
updateKey() {
|
|
3244
|
-
this.key =
|
|
3264
|
+
this.key = te();
|
|
3245
3265
|
},
|
|
3246
3266
|
//TODO interface
|
|
3247
3267
|
init() {
|
|
@@ -3263,7 +3283,7 @@ m(ft.prototype, {
|
|
|
3263
3283
|
return e(this.vm);
|
|
3264
3284
|
},
|
|
3265
3285
|
mergeOptions(t, e) {
|
|
3266
|
-
return
|
|
3286
|
+
return D(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3267
3287
|
},
|
|
3268
3288
|
updateOptions(t) {
|
|
3269
3289
|
this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3281,20 +3301,20 @@ m(ft.prototype, {
|
|
|
3281
3301
|
render(t) {
|
|
3282
3302
|
}
|
|
3283
3303
|
});
|
|
3284
|
-
const
|
|
3304
|
+
const Rr = function(t) {
|
|
3285
3305
|
const e = {
|
|
3286
3306
|
name: "loadData",
|
|
3287
3307
|
_fn: [],
|
|
3288
3308
|
created(r, i, s) {
|
|
3289
3309
|
this.deleted(r);
|
|
3290
|
-
let n =
|
|
3310
|
+
let n = j(r.getValue());
|
|
3291
3311
|
const o = [];
|
|
3292
3312
|
n.forEach((a) => {
|
|
3293
3313
|
if (a) {
|
|
3294
3314
|
const u = () => {
|
|
3295
3315
|
a.watch !== !1 && (t.bus.$off("p.loadData." + a.attr, u), t.bus.$once("p.loadData." + a.attr, u));
|
|
3296
3316
|
let l;
|
|
3297
|
-
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l =
|
|
3317
|
+
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l = L(l))), Y(r.getProp(), a.to || "options", l), s.sync(i);
|
|
3298
3318
|
};
|
|
3299
3319
|
o.push(() => t.bus.$off("p.loadData." + a.attr, u)), u();
|
|
3300
3320
|
}
|
|
@@ -3313,7 +3333,7 @@ const jr = function(t) {
|
|
|
3313
3333
|
const i = t.getValue();
|
|
3314
3334
|
i ? t.getProp().validate = [{
|
|
3315
3335
|
validator(...s) {
|
|
3316
|
-
const n =
|
|
3336
|
+
const n = Q(e);
|
|
3317
3337
|
if (n)
|
|
3318
3338
|
return r.exec(n.id, i === !0 ? "formCreateValidate" : i, ...s, {
|
|
3319
3339
|
attr: t,
|
|
@@ -3326,7 +3346,7 @@ const jr = function(t) {
|
|
|
3326
3346
|
watch(...t) {
|
|
3327
3347
|
ht.load(...t);
|
|
3328
3348
|
}
|
|
3329
|
-
},
|
|
3349
|
+
}, jr = function(t) {
|
|
3330
3350
|
function e(i) {
|
|
3331
3351
|
return c.String(i) && (i = {
|
|
3332
3352
|
action: i,
|
|
@@ -3335,41 +3355,41 @@ const jr = function(t) {
|
|
|
3335
3355
|
}
|
|
3336
3356
|
function r(i, s, n) {
|
|
3337
3357
|
let o = i.value;
|
|
3338
|
-
const a = (
|
|
3339
|
-
|
|
3358
|
+
const a = (m) => {
|
|
3359
|
+
m === void 0 ? (i.clearProp(), n.sync(s)) : Y(i.getProp(), o.to || "options", m);
|
|
3340
3360
|
};
|
|
3341
3361
|
if (c.Function(o) && (o = o(s, n)), o = e(o), !o || !o.action) {
|
|
3342
3362
|
a(void 0);
|
|
3343
3363
|
return;
|
|
3344
3364
|
}
|
|
3345
|
-
o =
|
|
3365
|
+
o = L(o), o.to || (o.to = "options");
|
|
3346
3366
|
const u = o.onError, l = () => {
|
|
3347
3367
|
if (!i.getValue())
|
|
3348
3368
|
return i.clearProp(), n.sync(s), !0;
|
|
3349
|
-
},
|
|
3369
|
+
}, f = M(y({
|
|
3350
3370
|
headers: {}
|
|
3351
3371
|
}, o), {
|
|
3352
|
-
onSuccess(
|
|
3372
|
+
onSuccess(m, v) {
|
|
3353
3373
|
if (l()) return;
|
|
3354
|
-
let
|
|
3355
|
-
c.Function(o.parse) ?
|
|
3356
|
-
|
|
3357
|
-
}),
|
|
3374
|
+
let _ = (g) => v ? g : O(g, "data") ? g.data : g;
|
|
3375
|
+
c.Function(o.parse) ? _ = o.parse : o.parse && c.String(o.parse) && (_ = (g) => (o.parse.split(".").forEach((k) => {
|
|
3376
|
+
g && (g = g[k]);
|
|
3377
|
+
}), g)), a(_(m, s, n)), n.sync(s);
|
|
3358
3378
|
},
|
|
3359
|
-
onError(
|
|
3360
|
-
a(void 0), !l() && (u || ((
|
|
3379
|
+
onError(m) {
|
|
3380
|
+
a(void 0), !l() && (u || ((v) => ye(v.message || "fetch fail " + o.action)))(m, s, n);
|
|
3361
3381
|
}
|
|
3362
3382
|
});
|
|
3363
|
-
t.$handle.beforeFetch(
|
|
3383
|
+
t.$handle.beforeFetch(f, { rule: s, api: n }).then(() => {
|
|
3364
3384
|
if (c.Function(o.action)) {
|
|
3365
|
-
o.action(s, n).then((
|
|
3366
|
-
|
|
3367
|
-
}).catch((
|
|
3368
|
-
|
|
3385
|
+
o.action(s, n).then((m) => {
|
|
3386
|
+
f.onSuccess(m, !0);
|
|
3387
|
+
}).catch((m) => {
|
|
3388
|
+
f.onError(m);
|
|
3369
3389
|
});
|
|
3370
3390
|
return;
|
|
3371
3391
|
}
|
|
3372
|
-
|
|
3392
|
+
R(() => t.create.fetch(f, { inject: i, rule: s, api: n }));
|
|
3373
3393
|
});
|
|
3374
3394
|
}
|
|
3375
3395
|
return {
|
|
@@ -3384,7 +3404,7 @@ const jr = function(t) {
|
|
|
3384
3404
|
}, ct = {
|
|
3385
3405
|
name: "required",
|
|
3386
3406
|
load(t, e, r) {
|
|
3387
|
-
const i =
|
|
3407
|
+
const i = Ir(t.getValue());
|
|
3388
3408
|
if (i.required === !1)
|
|
3389
3409
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
3390
3410
|
else {
|
|
@@ -3406,16 +3426,16 @@ const jr = function(t) {
|
|
|
3406
3426
|
ct.load(...t);
|
|
3407
3427
|
}
|
|
3408
3428
|
};
|
|
3409
|
-
function
|
|
3429
|
+
function Ir(t) {
|
|
3410
3430
|
return c.Boolean(t) ? { required: t } : c.String(t) ? { message: t } : c.Undef(t) ? { required: !1 } : c.Function(t) ? { validator: t } : c.Object(t) ? t : {};
|
|
3411
3431
|
}
|
|
3412
|
-
const
|
|
3413
|
-
fetch:
|
|
3414
|
-
loadData:
|
|
3432
|
+
const Ar = {
|
|
3433
|
+
fetch: jr,
|
|
3434
|
+
loadData: Rr,
|
|
3415
3435
|
required: ct,
|
|
3416
3436
|
componentValidate: ht
|
|
3417
|
-
},
|
|
3418
|
-
name:
|
|
3437
|
+
}, Vr = "html", Pr = {
|
|
3438
|
+
name: Vr,
|
|
3419
3439
|
loadChildren: !1,
|
|
3420
3440
|
render(t, e) {
|
|
3421
3441
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
@@ -3424,18 +3444,18 @@ const Vr = {
|
|
|
3424
3444
|
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) => c.String(e)).join("") : "";
|
|
3425
3445
|
}
|
|
3426
3446
|
};
|
|
3427
|
-
function
|
|
3447
|
+
function Tr(t, e) {
|
|
3428
3448
|
let r;
|
|
3429
3449
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
3430
3450
|
}
|
|
3431
|
-
function
|
|
3432
|
-
return
|
|
3451
|
+
function ie() {
|
|
3452
|
+
return Tr("name", ...arguments);
|
|
3433
3453
|
}
|
|
3434
|
-
function
|
|
3454
|
+
function qe(t) {
|
|
3435
3455
|
return !t || !t.el ? window.document.body : c.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
3436
3456
|
}
|
|
3437
|
-
function
|
|
3438
|
-
const r = new
|
|
3457
|
+
function Ue(t, e) {
|
|
3458
|
+
const r = new T({
|
|
3439
3459
|
data() {
|
|
3440
3460
|
return { rule: t, option: e || {} };
|
|
3441
3461
|
},
|
|
@@ -3445,141 +3465,141 @@ function He(t, e) {
|
|
|
3445
3465
|
});
|
|
3446
3466
|
return r.$mount(), r;
|
|
3447
3467
|
}
|
|
3448
|
-
function
|
|
3468
|
+
function Dr(t) {
|
|
3449
3469
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
3450
|
-
|
|
3470
|
+
Qe.push(...e), de.push(...r), pe.push(...i), it([...e, ...r, ...i]);
|
|
3451
3471
|
}
|
|
3452
|
-
let
|
|
3453
|
-
const
|
|
3454
|
-
function
|
|
3472
|
+
let Br = 1;
|
|
3473
|
+
const S = {};
|
|
3474
|
+
function ft(t) {
|
|
3455
3475
|
const e = {
|
|
3456
|
-
[
|
|
3457
|
-
}, r = {}, i = {}, s = y({},
|
|
3476
|
+
[re.name]: re
|
|
3477
|
+
}, r = {}, i = {}, s = y({}, Ar), n = rr();
|
|
3458
3478
|
let o = { global: {} };
|
|
3459
|
-
const a = {}, u =
|
|
3460
|
-
|
|
3461
|
-
function h
|
|
3462
|
-
const d =
|
|
3479
|
+
const a = {}, u = Er(), l = {};
|
|
3480
|
+
Dr(t.attrs || {});
|
|
3481
|
+
function f(h) {
|
|
3482
|
+
const d = S[h];
|
|
3463
3483
|
if (Array.isArray(d))
|
|
3464
|
-
return d.map((
|
|
3484
|
+
return d.map(($) => $.api());
|
|
3465
3485
|
if (d)
|
|
3466
3486
|
return d.api();
|
|
3467
3487
|
}
|
|
3468
|
-
function
|
|
3469
|
-
const
|
|
3470
|
-
|
|
3488
|
+
function m() {
|
|
3489
|
+
const h = ie(...arguments);
|
|
3490
|
+
h.id && h.prop && (i[h.id] = h.prop);
|
|
3471
3491
|
}
|
|
3472
|
-
function
|
|
3473
|
-
const
|
|
3474
|
-
|
|
3492
|
+
function v() {
|
|
3493
|
+
const h = ie(...arguments);
|
|
3494
|
+
h.id && h.prop && (s[h.id] = M(y({}, h.prop), { name: h.id }));
|
|
3475
3495
|
}
|
|
3476
|
-
function
|
|
3477
|
-
u.use(
|
|
3496
|
+
function _(h) {
|
|
3497
|
+
u.use(h);
|
|
3478
3498
|
}
|
|
3479
|
-
function
|
|
3480
|
-
const
|
|
3481
|
-
if (!
|
|
3482
|
-
const d =
|
|
3483
|
-
r[d] =
|
|
3499
|
+
function g() {
|
|
3500
|
+
const h = ie(...arguments);
|
|
3501
|
+
if (!h.id || !h.prop) return ce;
|
|
3502
|
+
const d = I(h.id), $ = h.prop, b = $.merge === !0 ? r[d] : void 0;
|
|
3503
|
+
r[d] = $, Object.setPrototypeOf($, b || ce), n[d] = E(d), $.maker && p(n, $.maker);
|
|
3484
3504
|
}
|
|
3485
|
-
function
|
|
3486
|
-
let
|
|
3487
|
-
if (c.String(
|
|
3488
|
-
if (
|
|
3489
|
-
return
|
|
3505
|
+
function k(h, d) {
|
|
3506
|
+
let $;
|
|
3507
|
+
if (c.String(h)) {
|
|
3508
|
+
if ($ = I(h), ["form-create", "formcreate"].indexOf($) > -1)
|
|
3509
|
+
return G();
|
|
3490
3510
|
if (d === void 0)
|
|
3491
|
-
return e[
|
|
3511
|
+
return e[$];
|
|
3492
3512
|
} else
|
|
3493
|
-
|
|
3494
|
-
if (
|
|
3495
|
-
const
|
|
3496
|
-
e[
|
|
3513
|
+
$ = I(h.name), d = h;
|
|
3514
|
+
if (!$ || !d) return;
|
|
3515
|
+
const b = I($);
|
|
3516
|
+
e[$] = d, e[b] = d, delete u.aliasMap[$], delete u.aliasMap[b], delete r[$], delete r[b], d.formCreateParser && g($, d.formCreateParser);
|
|
3497
3517
|
}
|
|
3498
|
-
function
|
|
3499
|
-
Object.keys(
|
|
3500
|
-
(Array.isArray(
|
|
3501
|
-
|
|
3518
|
+
function be(h) {
|
|
3519
|
+
Object.keys(S).forEach((d) => {
|
|
3520
|
+
(Array.isArray(S[d]) ? S[d] : [S[d]]).forEach((b) => {
|
|
3521
|
+
b.bus.$emit("p.loadData." + h);
|
|
3502
3522
|
});
|
|
3503
3523
|
});
|
|
3504
3524
|
}
|
|
3505
|
-
function
|
|
3506
|
-
a[
|
|
3525
|
+
function Ce(h, d) {
|
|
3526
|
+
a[h] = d, be(h);
|
|
3507
3527
|
}
|
|
3508
|
-
function
|
|
3509
|
-
return
|
|
3528
|
+
function _e(h, d) {
|
|
3529
|
+
return O(a, h) ? a[h] : d;
|
|
3510
3530
|
}
|
|
3511
|
-
function
|
|
3512
|
-
delete a[
|
|
3531
|
+
function dt(h) {
|
|
3532
|
+
delete a[h], be(h);
|
|
3513
3533
|
}
|
|
3514
|
-
function
|
|
3515
|
-
return
|
|
3534
|
+
function G() {
|
|
3535
|
+
return Gt(Oe, e, i);
|
|
3516
3536
|
}
|
|
3517
|
-
function
|
|
3518
|
-
return
|
|
3537
|
+
function ke() {
|
|
3538
|
+
return re;
|
|
3519
3539
|
}
|
|
3520
|
-
function
|
|
3521
|
-
return c.Function(
|
|
3540
|
+
function pt(h, d) {
|
|
3541
|
+
return c.Function(h.install) ? h.install(N, d) : c.Function(h) && h(N, d), this;
|
|
3522
3542
|
}
|
|
3523
|
-
function
|
|
3524
|
-
let
|
|
3525
|
-
const
|
|
3526
|
-
return
|
|
3543
|
+
function N(h, d, $) {
|
|
3544
|
+
let b = Ue(h, d || {});
|
|
3545
|
+
const A = b.$refs.fc.formCreate;
|
|
3546
|
+
return A.$parent = $, qe(A.options).appendChild(b.$el), A.api();
|
|
3527
3547
|
}
|
|
3528
|
-
Object.setPrototypeOf(
|
|
3529
|
-
function
|
|
3548
|
+
Object.setPrototypeOf(N, l);
|
|
3549
|
+
function mt(h) {
|
|
3530
3550
|
let d = y({}, t);
|
|
3531
|
-
return
|
|
3551
|
+
return h ? d.inherit = {
|
|
3532
3552
|
components: e,
|
|
3533
3553
|
parsers: r,
|
|
3534
3554
|
directives: i,
|
|
3535
3555
|
providers: s,
|
|
3536
3556
|
maker: n,
|
|
3537
3557
|
loadData: a
|
|
3538
|
-
} : delete d.inherit,
|
|
3558
|
+
} : delete d.inherit, ft(d);
|
|
3539
3559
|
}
|
|
3540
|
-
function
|
|
3541
|
-
const d =
|
|
3542
|
-
|
|
3543
|
-
id:
|
|
3544
|
-
vm:
|
|
3545
|
-
create:
|
|
3546
|
-
manager:
|
|
3560
|
+
function Oe(h) {
|
|
3561
|
+
const d = h.$options.propsData.rule;
|
|
3562
|
+
p(this, {
|
|
3563
|
+
id: Br++,
|
|
3564
|
+
vm: h,
|
|
3565
|
+
create: N,
|
|
3566
|
+
manager: Sr(t.manager),
|
|
3547
3567
|
parsers: r,
|
|
3548
3568
|
providers: s,
|
|
3549
3569
|
rules: Array.isArray(d) ? d : [],
|
|
3550
|
-
name:
|
|
3551
|
-
inFor:
|
|
3570
|
+
name: h.$options.propsData.name || te(),
|
|
3571
|
+
inFor: h.$options.propsData.inFor,
|
|
3552
3572
|
prop: {
|
|
3553
3573
|
components: e,
|
|
3554
3574
|
directives: i
|
|
3555
3575
|
},
|
|
3556
|
-
setData:
|
|
3557
|
-
getData:
|
|
3576
|
+
setData: Ce,
|
|
3577
|
+
getData: _e,
|
|
3558
3578
|
loadData: a,
|
|
3559
3579
|
CreateNode: u,
|
|
3560
|
-
bus: new
|
|
3580
|
+
bus: new T(),
|
|
3561
3581
|
unwatch: null,
|
|
3562
3582
|
options: {},
|
|
3563
|
-
extendApi: t.extendApi || ((
|
|
3564
|
-
}), this.init(), this.initOptions(), this.name && (this.inFor ? (
|
|
3583
|
+
extendApi: t.extendApi || (($) => $)
|
|
3584
|
+
}), this.init(), this.initOptions(), this.name && (this.inFor ? (S[this.name] || (S[this.name] = []), S[this.name].push(this)) : S[this.name] = this);
|
|
3565
3585
|
}
|
|
3566
|
-
|
|
3586
|
+
p(Oe.prototype, {
|
|
3567
3587
|
init() {
|
|
3568
|
-
const
|
|
3569
|
-
this.$handle = d,
|
|
3570
|
-
this.isSub() && (this.unwatch =
|
|
3571
|
-
this.initOptions(),
|
|
3588
|
+
const h = this.vm, d = new V(this);
|
|
3589
|
+
this.$handle = d, h.$f = d.api, h.$emit("input", d.api), h.$on("hook:created", () => {
|
|
3590
|
+
this.isSub() && (this.unwatch = h.$watch(() => h.$pfc.option, () => {
|
|
3591
|
+
this.initOptions(), h.$f.refresh();
|
|
3572
3592
|
}, { deep: !0 }), this.initOptions()), this.created();
|
|
3573
|
-
}),
|
|
3593
|
+
}), h.$on("hook:mounted", () => {
|
|
3574
3594
|
this.mounted();
|
|
3575
|
-
}),
|
|
3576
|
-
if (
|
|
3595
|
+
}), h.$on("hook:beforeDestroy", () => {
|
|
3596
|
+
if (h.destroyed = !0, this.unwatch && this.unwatch(), d.reloadRule([]), this.name)
|
|
3577
3597
|
if (this.inFor) {
|
|
3578
|
-
const
|
|
3579
|
-
|
|
3598
|
+
const $ = S[this.name].indexOf(this);
|
|
3599
|
+
S[this.name].splice($, 1), S[this.name].length || delete S[this.name];
|
|
3580
3600
|
} else
|
|
3581
|
-
delete
|
|
3582
|
-
}),
|
|
3601
|
+
delete S[this.name];
|
|
3602
|
+
}), h.$on("hook:updated", () => {
|
|
3583
3603
|
d.bindNextTick(() => this.bus.$emit("next-tick", d.api));
|
|
3584
3604
|
});
|
|
3585
3605
|
},
|
|
@@ -3588,16 +3608,16 @@ function dt(t) {
|
|
|
3588
3608
|
},
|
|
3589
3609
|
initOptions() {
|
|
3590
3610
|
this.options = {};
|
|
3591
|
-
let
|
|
3592
|
-
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0),
|
|
3611
|
+
let h = y({ formData: {}, submitBtn: {}, resetBtn: {} }, L(o));
|
|
3612
|
+
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
3613
|
},
|
|
3594
|
-
mergeOptions(
|
|
3595
|
-
return d =
|
|
3596
|
-
delete d[
|
|
3597
|
-
}), d.global && (
|
|
3614
|
+
mergeOptions(h, d, $) {
|
|
3615
|
+
return d = L(d), $ && ["page", "onSubmit", "mounted", "reload", "formData", "el"].forEach((b) => {
|
|
3616
|
+
delete d[b];
|
|
3617
|
+
}), d.global && (h.global = er(h.global, d.global), delete d.global), this.$handle.$manager.mergeOptions([d], h), h;
|
|
3598
3618
|
},
|
|
3599
|
-
updateOptions(
|
|
3600
|
-
this.mergeOptions(this.options,
|
|
3619
|
+
updateOptions(h) {
|
|
3620
|
+
this.mergeOptions(this.options, h), this.$handle.$manager.updateOptions(this.options);
|
|
3601
3621
|
},
|
|
3602
3622
|
created() {
|
|
3603
3623
|
this.$handle.init(), this.vm.$emit("created", this.api());
|
|
@@ -3612,77 +3632,77 @@ function dt(t) {
|
|
|
3612
3632
|
this.$handle.mounted();
|
|
3613
3633
|
}
|
|
3614
3634
|
});
|
|
3615
|
-
function
|
|
3616
|
-
|
|
3635
|
+
function we(h) {
|
|
3636
|
+
p(h, {
|
|
3617
3637
|
version: t.version,
|
|
3618
3638
|
ui: t.ui,
|
|
3619
|
-
setData:
|
|
3620
|
-
getData:
|
|
3621
|
-
removeData:
|
|
3639
|
+
setData: Ce,
|
|
3640
|
+
getData: _e,
|
|
3641
|
+
removeData: dt,
|
|
3622
3642
|
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
|
|
3643
|
+
component: k,
|
|
3644
|
+
directive: m,
|
|
3645
|
+
register: v,
|
|
3646
|
+
$vnode: ke,
|
|
3647
|
+
parser: g,
|
|
3648
|
+
use: pt,
|
|
3649
|
+
factory: mt,
|
|
3650
|
+
componentAlias: _,
|
|
3651
|
+
copyRule: ge,
|
|
3652
|
+
copyRules: et,
|
|
3653
|
+
fetch: st,
|
|
3654
|
+
$form: G,
|
|
3655
|
+
parseFn: q,
|
|
3656
|
+
parseJson: Yt,
|
|
3657
|
+
toJson: Ze,
|
|
3658
|
+
getApi: f,
|
|
3659
|
+
init(d, $ = {}) {
|
|
3660
|
+
let b = Ue(d, $), A = b.$refs.fc.formCreate;
|
|
3641
3661
|
return {
|
|
3642
|
-
mount(
|
|
3643
|
-
return
|
|
3662
|
+
mount(x) {
|
|
3663
|
+
return x && c.Element(x) && (A.options.el = x), qe(A.options).appendChild(b.$el), A.api();
|
|
3644
3664
|
},
|
|
3645
3665
|
remove() {
|
|
3646
|
-
|
|
3666
|
+
b.$el.parentNode && b.$el.parentNode.removeChild(b.$el);
|
|
3647
3667
|
},
|
|
3648
3668
|
destroy() {
|
|
3649
|
-
this.remove(),
|
|
3669
|
+
this.remove(), b.$destroy();
|
|
3650
3670
|
},
|
|
3651
|
-
$f:
|
|
3671
|
+
$f: A.api()
|
|
3652
3672
|
};
|
|
3653
3673
|
}
|
|
3654
3674
|
});
|
|
3655
3675
|
}
|
|
3656
|
-
function
|
|
3657
|
-
|
|
3658
|
-
create:
|
|
3659
|
-
install(d,
|
|
3660
|
-
if (o = y(y({}, o),
|
|
3676
|
+
function yt(h) {
|
|
3677
|
+
p(h, {
|
|
3678
|
+
create: N,
|
|
3679
|
+
install(d, $) {
|
|
3680
|
+
if (o = y(y({}, o), $ || {}), d._installedFormCreate === !0) return;
|
|
3661
3681
|
d._installedFormCreate = !0;
|
|
3662
|
-
const
|
|
3663
|
-
return
|
|
3682
|
+
const b = function(A, x = {}) {
|
|
3683
|
+
return N(A, x, this);
|
|
3664
3684
|
};
|
|
3665
|
-
|
|
3685
|
+
we(b), d.prototype.$formCreate = b, d.component("FormCreate", G()), d.component("FcFragment", ke());
|
|
3666
3686
|
}
|
|
3667
3687
|
});
|
|
3668
3688
|
}
|
|
3669
|
-
if (
|
|
3670
|
-
const
|
|
3671
|
-
|
|
3689
|
+
if (we(l), yt(l), u.use({ fragment: "fcFragment" }), g(Pr), t.install && N.use(t), t.inherit) {
|
|
3690
|
+
const h = t.inherit;
|
|
3691
|
+
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
3692
|
}
|
|
3673
|
-
const
|
|
3674
|
-
return Object.setPrototypeOf(
|
|
3693
|
+
const X = G();
|
|
3694
|
+
return Object.setPrototypeOf(X, l), Object.defineProperties(X, {
|
|
3675
3695
|
fetch: {
|
|
3676
3696
|
get() {
|
|
3677
3697
|
return l.fetch;
|
|
3678
3698
|
},
|
|
3679
|
-
set(
|
|
3680
|
-
l.fetch =
|
|
3699
|
+
set(h) {
|
|
3700
|
+
l.fetch = h;
|
|
3681
3701
|
}
|
|
3682
3702
|
}
|
|
3683
|
-
}),
|
|
3703
|
+
}), X.util = l, X;
|
|
3684
3704
|
}
|
|
3685
|
-
const
|
|
3705
|
+
const He = {
|
|
3686
3706
|
date: "yyyy-MM-dd",
|
|
3687
3707
|
month: "yyyy-MM",
|
|
3688
3708
|
datetime: "yyyy-MM-dd HH:mm:ss",
|
|
@@ -3691,105 +3711,105 @@ const xe = {
|
|
|
3691
3711
|
monthrange: "yyyy-MM",
|
|
3692
3712
|
datetimerange: "yyyy-MM-dd HH:mm:ss",
|
|
3693
3713
|
year: "yyyy"
|
|
3694
|
-
},
|
|
3695
|
-
name:
|
|
3714
|
+
}, xe = "datePicker", Lr = {
|
|
3715
|
+
name: xe,
|
|
3696
3716
|
maker: function() {
|
|
3697
|
-
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] =
|
|
3717
|
+
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = E(xe, { type: e.toLowerCase() }), t), {});
|
|
3698
3718
|
}(),
|
|
3699
3719
|
mergeProp(t) {
|
|
3700
3720
|
const e = t.prop.props;
|
|
3701
|
-
e.valueFormat || (e.valueFormat =
|
|
3721
|
+
e.valueFormat || (e.valueFormat = He[e.type] || He.date);
|
|
3702
3722
|
}
|
|
3703
|
-
},
|
|
3704
|
-
name:
|
|
3723
|
+
}, ne = "hidden", Nr = {
|
|
3724
|
+
name: ne,
|
|
3705
3725
|
maker: {
|
|
3706
|
-
[
|
|
3726
|
+
[ne]: (t, e) => E(ne)("", t, e)
|
|
3707
3727
|
},
|
|
3708
3728
|
render() {
|
|
3709
3729
|
return [];
|
|
3710
3730
|
}
|
|
3711
|
-
},
|
|
3712
|
-
name:
|
|
3731
|
+
}, se = "input", Mr = {
|
|
3732
|
+
name: se,
|
|
3713
3733
|
maker: function() {
|
|
3714
|
-
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] =
|
|
3715
|
-
return t.idate =
|
|
3734
|
+
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = E(se, { type: r }), e), {});
|
|
3735
|
+
return t.idate = E(se, { type: "date" }), t;
|
|
3716
3736
|
}(),
|
|
3717
3737
|
mergeProp(t) {
|
|
3718
3738
|
let { props: e } = t.prop;
|
|
3719
3739
|
e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
3720
3740
|
}
|
|
3721
|
-
},
|
|
3722
|
-
name:
|
|
3741
|
+
}, Je = "slider", qr = {
|
|
3742
|
+
name: Je,
|
|
3723
3743
|
maker: {
|
|
3724
|
-
sliderRange:
|
|
3744
|
+
sliderRange: E(Je, { range: !0 })
|
|
3725
3745
|
},
|
|
3726
3746
|
toFormValue(t, e) {
|
|
3727
3747
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
3728
3748
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
3729
3749
|
}
|
|
3730
|
-
},
|
|
3731
|
-
name:
|
|
3750
|
+
}, oe = "timePicker", Ur = {
|
|
3751
|
+
name: oe,
|
|
3732
3752
|
maker: {
|
|
3733
|
-
time:
|
|
3734
|
-
timeRange:
|
|
3753
|
+
time: E(oe, (t) => t.props.isRange = !1),
|
|
3754
|
+
timeRange: E(oe, (t) => t.props.isRange = !0)
|
|
3735
3755
|
},
|
|
3736
3756
|
mergeProp(t) {
|
|
3737
3757
|
const e = t.prop.props;
|
|
3738
3758
|
e.valueFormat || (e.valueFormat = "HH:mm:ss");
|
|
3739
3759
|
}
|
|
3740
|
-
},
|
|
3760
|
+
}, Hr = {
|
|
3741
3761
|
name: "FcRow",
|
|
3742
3762
|
render(t, e) {
|
|
3743
3763
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
3744
3764
|
e.vNode.row(e.prop, t)
|
|
3745
3765
|
]);
|
|
3746
3766
|
}
|
|
3747
|
-
},
|
|
3748
|
-
name:
|
|
3767
|
+
}, xr = "select", Jr = {
|
|
3768
|
+
name: xr,
|
|
3749
3769
|
toFormValue(t, e) {
|
|
3750
|
-
return e.prop.props.multiple && !Array.isArray(t) ?
|
|
3770
|
+
return e.prop.props.multiple && !Array.isArray(t) ? j(t) : t;
|
|
3751
3771
|
}
|
|
3752
|
-
},
|
|
3772
|
+
}, Kr = [
|
|
3773
|
+
Lr,
|
|
3753
3774
|
Nr,
|
|
3754
3775
|
Mr,
|
|
3755
3776
|
qr,
|
|
3756
3777
|
Ur,
|
|
3757
3778
|
Hr,
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
button: _ + "Button",
|
|
3779
|
+
Jr
|
|
3780
|
+
], C = "el", Wr = {
|
|
3781
|
+
button: C + "Button",
|
|
3762
3782
|
icon: "i",
|
|
3763
|
-
slider:
|
|
3764
|
-
rate:
|
|
3783
|
+
slider: C + "Slider",
|
|
3784
|
+
rate: C + "Rate",
|
|
3765
3785
|
upload: "fcUpload",
|
|
3766
|
-
cascader:
|
|
3767
|
-
popover:
|
|
3768
|
-
tooltip:
|
|
3769
|
-
colorPicker:
|
|
3770
|
-
timePicker:
|
|
3771
|
-
timeSelect:
|
|
3772
|
-
datePicker:
|
|
3773
|
-
switch:
|
|
3786
|
+
cascader: C + "Cascader",
|
|
3787
|
+
popover: C + "Popover",
|
|
3788
|
+
tooltip: C + "Tooltip",
|
|
3789
|
+
colorPicker: C + "ColorPicker",
|
|
3790
|
+
timePicker: C + "TimePicker",
|
|
3791
|
+
timeSelect: C + "TimeSelect",
|
|
3792
|
+
datePicker: C + "DatePicker",
|
|
3793
|
+
switch: C + "Switch",
|
|
3774
3794
|
select: "fcSelect",
|
|
3775
3795
|
checkbox: "fcCheckbox",
|
|
3776
3796
|
radio: "fcRadio",
|
|
3777
|
-
inputNumber:
|
|
3778
|
-
number:
|
|
3779
|
-
input:
|
|
3780
|
-
formItem:
|
|
3781
|
-
form:
|
|
3797
|
+
inputNumber: C + "InputNumber",
|
|
3798
|
+
number: C + "InputNumber",
|
|
3799
|
+
input: C + "Input",
|
|
3800
|
+
formItem: C + "FormItem",
|
|
3801
|
+
form: C + "Form",
|
|
3782
3802
|
frame: "fcFrame",
|
|
3783
|
-
col:
|
|
3784
|
-
row:
|
|
3803
|
+
col: C + "Col",
|
|
3804
|
+
row: C + "Row",
|
|
3785
3805
|
tree: "fcTree",
|
|
3786
|
-
autoComplete:
|
|
3787
|
-
auto:
|
|
3806
|
+
autoComplete: C + "Autocomplete",
|
|
3807
|
+
auto: C + "Autocomplete",
|
|
3788
3808
|
group: "fcGroup",
|
|
3789
3809
|
object: "fcSubForm",
|
|
3790
3810
|
subForm: "fcSubForm"
|
|
3791
3811
|
};
|
|
3792
|
-
function
|
|
3812
|
+
function Gr() {
|
|
3793
3813
|
return {
|
|
3794
3814
|
form: {
|
|
3795
3815
|
inline: !1,
|
|
@@ -3823,23 +3843,23 @@ function Xr() {
|
|
|
3823
3843
|
}
|
|
3824
3844
|
};
|
|
3825
3845
|
}
|
|
3826
|
-
function
|
|
3846
|
+
function Xr(t) {
|
|
3827
3847
|
return t.type === "tooltip";
|
|
3828
3848
|
}
|
|
3829
|
-
const
|
|
3830
|
-
function
|
|
3831
|
-
return !
|
|
3849
|
+
const zr = /[A-Z]/;
|
|
3850
|
+
function Qr(t, e) {
|
|
3851
|
+
return !zr.test(t) && (c.String(e) || c.Number(e));
|
|
3832
3852
|
}
|
|
3833
|
-
function
|
|
3834
|
-
|
|
3853
|
+
function Ke(t, e) {
|
|
3854
|
+
O(t, e) && c.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
3835
3855
|
}
|
|
3836
|
-
function
|
|
3856
|
+
function P(t) {
|
|
3837
3857
|
return t === !1;
|
|
3838
3858
|
}
|
|
3839
|
-
function
|
|
3840
|
-
|
|
3859
|
+
function Zr(t, e) {
|
|
3860
|
+
O(t, e) && !c.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
3841
3861
|
}
|
|
3842
|
-
const
|
|
3862
|
+
const Yr = {
|
|
3843
3863
|
validate() {
|
|
3844
3864
|
const t = this.form();
|
|
3845
3865
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -3858,16 +3878,16 @@ const ei = {
|
|
|
3858
3878
|
},
|
|
3859
3879
|
tidyOptions(t) {
|
|
3860
3880
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
3861
|
-
|
|
3881
|
+
Zr(t, e);
|
|
3862
3882
|
}), t;
|
|
3863
3883
|
},
|
|
3864
3884
|
tidyRule({ prop: t }) {
|
|
3865
|
-
return
|
|
3885
|
+
return Ke(t, "title"), Ke(t, "info"), t;
|
|
3866
3886
|
},
|
|
3867
3887
|
mergeProp(t) {
|
|
3868
3888
|
let e = t.prop.props;
|
|
3869
|
-
t.prop =
|
|
3870
|
-
attrs: Object.keys(e).reduce((r, i) => (
|
|
3889
|
+
t.prop = D([{
|
|
3890
|
+
attrs: Object.keys(e).reduce((r, i) => (Qr(i, e[i]) && (r[i] = e[i]), r), {}),
|
|
3871
3891
|
info: this.options.info || {},
|
|
3872
3892
|
wrap: this.options.wrap || {},
|
|
3873
3893
|
col: this.options.col || {},
|
|
@@ -3884,7 +3904,7 @@ const ei = {
|
|
|
3884
3904
|
}, { normal: ["title", "info", "col", "wrap"] });
|
|
3885
3905
|
},
|
|
3886
3906
|
getDefaultOptions() {
|
|
3887
|
-
return
|
|
3907
|
+
return Gr();
|
|
3888
3908
|
},
|
|
3889
3909
|
update() {
|
|
3890
3910
|
const t = this.options.form;
|
|
@@ -3902,18 +3922,18 @@ const ei = {
|
|
|
3902
3922
|
},
|
|
3903
3923
|
beforeRender() {
|
|
3904
3924
|
const { key: t, ref: e, $handle: r } = this;
|
|
3905
|
-
|
|
3925
|
+
p(this.rule, { key: t, ref: e }), p(this.rule.props, {
|
|
3906
3926
|
model: r.formData
|
|
3907
3927
|
// rules: $handle.validate(),
|
|
3908
3928
|
});
|
|
3909
3929
|
},
|
|
3910
3930
|
render(t) {
|
|
3911
|
-
return t.length && t.push(this.makeFormBtn()), this.$r(this.rule,
|
|
3931
|
+
return t.length && t.push(this.makeFormBtn()), this.$r(this.rule, P(this.options.row.show) ? t : [this.makeRow(t)]);
|
|
3912
3932
|
},
|
|
3913
3933
|
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 :
|
|
3934
|
+
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, {
|
|
3935
|
+
props: M(y({
|
|
3936
|
+
labelWidth: o === void 0 ? o : at(o),
|
|
3917
3937
|
label: n ? r.title.title : void 0
|
|
3918
3938
|
}, r.wrap || {}), {
|
|
3919
3939
|
prop: t.id,
|
|
@@ -3924,23 +3944,23 @@ const ei = {
|
|
|
3924
3944
|
ref: t.wrapRef,
|
|
3925
3945
|
type: "formItem"
|
|
3926
3946
|
}]), [e, n ? this.makeInfo(r, i, t) : null]);
|
|
3927
|
-
return a === !0 ||
|
|
3947
|
+
return a === !0 || P(u) || P(s.show) ? l : this.makeCol(r, i, [l]);
|
|
3928
3948
|
},
|
|
3929
3949
|
isTitle(t) {
|
|
3930
3950
|
if (this.options.form.title === !1) return !1;
|
|
3931
3951
|
const e = t.title;
|
|
3932
|
-
return !(!e.title && !e.native ||
|
|
3952
|
+
return !(!e.title && !e.native || P(e.show));
|
|
3933
3953
|
},
|
|
3934
3954
|
makeInfo(t, e, r) {
|
|
3935
|
-
const i = t.title, s = t.info, n =
|
|
3936
|
-
if (!
|
|
3955
|
+
const i = t.title, s = t.info, n = Xr(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"] || "")];
|
|
3956
|
+
if (!P(s.show) && (s.info || s.native) && !P(s.icon)) {
|
|
3937
3957
|
const l = {
|
|
3938
3958
|
type: s.type || "popover",
|
|
3939
3959
|
props: y({}, s),
|
|
3940
3960
|
key: `${e}pop`,
|
|
3941
3961
|
slot: "label"
|
|
3942
|
-
},
|
|
3943
|
-
s.info && !
|
|
3962
|
+
}, f = "content";
|
|
3963
|
+
s.info && !O(l.props, f) && (l.props[f] = s.info), u[s.align !== "left" ? "unshift" : "push"](this.$r(D([s, l]), [
|
|
3944
3964
|
this.$r({
|
|
3945
3965
|
type: "i",
|
|
3946
3966
|
slot: n ? "default" : "reference",
|
|
@@ -3949,7 +3969,7 @@ const ei = {
|
|
|
3949
3969
|
})
|
|
3950
3970
|
]));
|
|
3951
3971
|
}
|
|
3952
|
-
return this.$r(
|
|
3972
|
+
return this.$r(D([i, {
|
|
3953
3973
|
props: i,
|
|
3954
3974
|
slot: i.slot || "label",
|
|
3955
3975
|
key: `${e}tit`,
|
|
@@ -3976,7 +3996,7 @@ const ei = {
|
|
|
3976
3996
|
},
|
|
3977
3997
|
makeFormBtn() {
|
|
3978
3998
|
let t = [];
|
|
3979
|
-
if (
|
|
3999
|
+
if (P(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), P(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
3980
4000
|
return;
|
|
3981
4001
|
const e = this.$r({
|
|
3982
4002
|
type: "formItem",
|
|
@@ -4018,35 +4038,35 @@ const ei = {
|
|
|
4018
4038
|
key: `${this.key}b1`
|
|
4019
4039
|
}, [t.innerText]);
|
|
4020
4040
|
}
|
|
4021
|
-
},
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
function
|
|
4041
|
+
}, H = {};
|
|
4042
|
+
ei(H);
|
|
4043
|
+
ti(H);
|
|
4044
|
+
ri(H);
|
|
4045
|
+
ii(H);
|
|
4046
|
+
ni(H);
|
|
4047
|
+
function ei(t) {
|
|
4028
4048
|
["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
|
|
4029
|
-
t[e] =
|
|
4049
|
+
t[e] = E(e);
|
|
4030
4050
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4031
4051
|
}
|
|
4032
|
-
function
|
|
4052
|
+
function ti(t) {
|
|
4033
4053
|
const e = "select", r = "multiple";
|
|
4034
|
-
t.selectMultiple =
|
|
4054
|
+
t.selectMultiple = E(e, { [r]: !0 }), t.selectOne = E(e, { [r]: !1 });
|
|
4035
4055
|
}
|
|
4036
|
-
function
|
|
4056
|
+
function ri(t) {
|
|
4037
4057
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4038
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4058
|
+
Object.keys(r).reduce((i, s) => (i[s] = E(e, { type: r[s] }), i), t);
|
|
4039
4059
|
}
|
|
4040
|
-
function
|
|
4060
|
+
function ii(t) {
|
|
4041
4061
|
const e = "upload", r = {
|
|
4042
4062
|
image: ["image", 0],
|
|
4043
4063
|
file: ["file", 0],
|
|
4044
4064
|
uploadFileOne: ["file", 1],
|
|
4045
4065
|
uploadImageOne: ["image", 1]
|
|
4046
4066
|
};
|
|
4047
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4067
|
+
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
4068
|
}
|
|
4049
|
-
function
|
|
4069
|
+
function ni(t) {
|
|
4050
4070
|
const e = {
|
|
4051
4071
|
frameInputs: ["input", 0],
|
|
4052
4072
|
frameFiles: ["file", 0],
|
|
@@ -4055,13 +4075,13 @@ function si(t) {
|
|
|
4055
4075
|
frameFileOne: ["file", 1],
|
|
4056
4076
|
frameImageOne: ["image", 1]
|
|
4057
4077
|
};
|
|
4058
|
-
return Object.keys(e).reduce((r, i) => (r[i] =
|
|
4078
|
+
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
4079
|
}
|
|
4060
|
-
function
|
|
4080
|
+
function We(t, e) {
|
|
4061
4081
|
return c.Boolean(t) ? t = { show: t } : !c.Undef(t) && !c.Object(t) && (t = { show: e }), t;
|
|
4062
4082
|
}
|
|
4063
|
-
function
|
|
4064
|
-
return
|
|
4083
|
+
function si(t, e) {
|
|
4084
|
+
return p(t, {
|
|
4065
4085
|
formEl() {
|
|
4066
4086
|
return e.$manager.form();
|
|
4067
4087
|
},
|
|
@@ -4086,7 +4106,7 @@ function oi(t, e) {
|
|
|
4086
4106
|
const o = e.getFieldCtx(r);
|
|
4087
4107
|
if (!o) return;
|
|
4088
4108
|
const a = e.subForm[o.id], u = [e.$manager.validateField(o.id)];
|
|
4089
|
-
|
|
4109
|
+
j(a).forEach((l) => {
|
|
4090
4110
|
u.push(l.validate().catch(() => Promise.reject("子表单验证未通过")));
|
|
4091
4111
|
}), Promise.all(u).then(() => {
|
|
4092
4112
|
s(null), i && i(null);
|
|
@@ -4134,41 +4154,41 @@ function oi(t, e) {
|
|
|
4134
4154
|
}
|
|
4135
4155
|
},
|
|
4136
4156
|
submitBtnProps: (r = {}) => {
|
|
4137
|
-
let i =
|
|
4138
|
-
|
|
4157
|
+
let i = We(e.options.submitBtn, !0);
|
|
4158
|
+
p(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4139
4159
|
},
|
|
4140
4160
|
resetBtnProps: (r = {}) => {
|
|
4141
|
-
let i =
|
|
4142
|
-
|
|
4161
|
+
let i = We(e.options.resetBtn, !1);
|
|
4162
|
+
p(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4143
4163
|
},
|
|
4144
4164
|
submit(r, i) {
|
|
4145
4165
|
t.validate((s) => {
|
|
4146
4166
|
if (s) {
|
|
4147
4167
|
let n = t.formData();
|
|
4148
|
-
c.Function(r) ?
|
|
4168
|
+
c.Function(r) ? R(() => r(n, this)) : (c.Function(e.options.onSubmit) && R(() => e.options.onSubmit(n, this)), e.vm.$emit("submit", n, this));
|
|
4149
4169
|
} else
|
|
4150
|
-
c.Function(i) &&
|
|
4170
|
+
c.Function(i) && R(() => i(this, ...arguments));
|
|
4151
4171
|
}).catch((s) => {
|
|
4152
4172
|
});
|
|
4153
4173
|
}
|
|
4154
4174
|
}), t;
|
|
4155
4175
|
}
|
|
4156
|
-
function
|
|
4157
|
-
t.componentAlias(
|
|
4176
|
+
function oi(t) {
|
|
4177
|
+
t.componentAlias(Wr), Wt.forEach((e) => {
|
|
4158
4178
|
t.component(e.name, e);
|
|
4159
|
-
}),
|
|
4179
|
+
}), Kr.forEach((e) => {
|
|
4160
4180
|
t.parser(e);
|
|
4161
|
-
}), Object.keys(
|
|
4162
|
-
t.maker[e] =
|
|
4181
|
+
}), Object.keys(H).forEach((e) => {
|
|
4182
|
+
t.maker[e] = H[e];
|
|
4163
4183
|
});
|
|
4164
4184
|
}
|
|
4165
|
-
function
|
|
4166
|
-
return
|
|
4185
|
+
function ai() {
|
|
4186
|
+
return ft({
|
|
4167
4187
|
ui: "element-ui",
|
|
4168
|
-
version: "2.6.
|
|
4169
|
-
manager:
|
|
4170
|
-
extendApi:
|
|
4171
|
-
install:
|
|
4188
|
+
version: "2.6.1",
|
|
4189
|
+
manager: Yr,
|
|
4190
|
+
extendApi: si,
|
|
4191
|
+
install: oi,
|
|
4172
4192
|
attrs: {
|
|
4173
4193
|
normal: ["col", "wrap"],
|
|
4174
4194
|
array: ["className"],
|
|
@@ -4176,10 +4196,10 @@ function li() {
|
|
|
4176
4196
|
}
|
|
4177
4197
|
});
|
|
4178
4198
|
}
|
|
4179
|
-
const
|
|
4180
|
-
typeof window != "undefined" && (window.formCreate =
|
|
4181
|
-
const hi =
|
|
4199
|
+
const fe = ai();
|
|
4200
|
+
typeof window != "undefined" && (window.formCreate = fe, window.Vue && fe.install(window.Vue));
|
|
4201
|
+
const hi = fe.maker;
|
|
4182
4202
|
export {
|
|
4183
|
-
|
|
4203
|
+
fe as default,
|
|
4184
4204
|
hi as maker
|
|
4185
4205
|
};
|