@form-create/element-ui 3.1.23 → 3.1.24
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/dist/form-create.esm.js +341 -239
- package/dist/form-create.esm.min.js +2 -2
- package/dist/form-create.js +340 -238
- package/dist/form-create.min.js +2 -2
- package/package.json +9 -9
- package/src/core/api.js +8 -0
- package/types/config.d.ts +5 -0
package/dist/form-create.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @form-create/element-ui v3.1.
|
|
2
|
+
* @form-create/element-ui v3.1.24
|
|
3
3
|
* (c) 2018-2023 xaboy
|
|
4
4
|
* Github https://github.com/xaboy/form-create
|
|
5
5
|
* Released under the MIT License.
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
},
|
|
224
224
|
type: String
|
|
225
225
|
},
|
|
226
|
-
emits: ['update:modelValue'],
|
|
226
|
+
emits: ['update:modelValue', 'fc.el'],
|
|
227
227
|
setup: function setup(props, _) {
|
|
228
228
|
var options = vue.toRef(props.formCreateInject, 'options', []);
|
|
229
229
|
var value = vue.toRef(props, 'modelValue');
|
|
@@ -249,7 +249,8 @@
|
|
|
249
249
|
var Type = vue.resolveComponent(name);
|
|
250
250
|
return vue.createVNode(vue.resolveComponent("ElCheckboxGroup"), vue.mergeProps(this.$attrs, {
|
|
251
251
|
"modelValue": this.value,
|
|
252
|
-
"onUpdate:modelValue": this.onInput
|
|
252
|
+
"onUpdate:modelValue": this.onInput,
|
|
253
|
+
"ref": "el"
|
|
253
254
|
}), _objectSpread2({
|
|
254
255
|
"default": function _default() {
|
|
255
256
|
return [_this.options().map(function (opt, index) {
|
|
@@ -268,6 +269,9 @@
|
|
|
268
269
|
}), (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)];
|
|
269
270
|
}
|
|
270
271
|
}, getSlot(this.$slots, ['default'])));
|
|
272
|
+
},
|
|
273
|
+
mounted: function mounted() {
|
|
274
|
+
this.$emit('fc.el', this.$refs.el);
|
|
271
275
|
}
|
|
272
276
|
});
|
|
273
277
|
|
|
@@ -346,125 +350,125 @@
|
|
|
346
350
|
}
|
|
347
351
|
}
|
|
348
352
|
|
|
349
|
-
var css_248z$
|
|
350
|
-
styleInject(css_248z$
|
|
353
|
+
var css_248z$3 = "._fc-frame ._fc-files img{display:inline-block;height:100%;vertical-align:top;width:100%}._fc-frame ._fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame ._fc-upload-cover{background:rgba(0,0,0,.6);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame ._fc-upload-cover i{color:#fff;cursor:pointer;font-size:20px;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame ._fc-upload-icon{cursor:pointer}._fc-files,._fc-frame ._fc-upload-btn{background:#fff;border:1px solid #c0ccda;border-radius:4px;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;height:58px;line-height:58px;margin-right:4px;overflow:hidden;position:relative;text-align:center;width:58px}";
|
|
354
|
+
styleInject(css_248z$3);
|
|
351
355
|
|
|
352
|
-
var script$
|
|
356
|
+
var script$6 = {
|
|
353
357
|
name: 'IconCircleClose'
|
|
354
358
|
};
|
|
355
359
|
|
|
356
|
-
var _hoisted_1$
|
|
360
|
+
var _hoisted_1$6 = {
|
|
357
361
|
"class": "icon",
|
|
358
362
|
viewBox: "0 0 1024 1024",
|
|
359
363
|
xmlns: "http://www.w3.org/2000/svg"
|
|
360
364
|
};
|
|
361
365
|
|
|
362
|
-
var _hoisted_2$
|
|
366
|
+
var _hoisted_2$6 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
363
367
|
fill: "currentColor",
|
|
364
368
|
d: "M466.752 512l-90.496-90.496a32 32 0 0145.248-45.248L512 466.752l90.496-90.496a32 32 0 1145.248 45.248L557.248 512l90.496 90.496a32 32 0 11-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 01-45.248-45.248L466.752 512z"
|
|
365
369
|
}, null, -1);
|
|
366
370
|
|
|
367
|
-
var _hoisted_3$
|
|
371
|
+
var _hoisted_3$6 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
368
372
|
fill: "currentColor",
|
|
369
373
|
d: "M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"
|
|
370
374
|
}, null, -1);
|
|
371
375
|
|
|
372
|
-
var _hoisted_4
|
|
373
|
-
function render$
|
|
374
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
376
|
+
var _hoisted_4 = [_hoisted_2$6, _hoisted_3$6];
|
|
377
|
+
function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
378
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$6, _hoisted_4);
|
|
375
379
|
}
|
|
376
380
|
|
|
377
|
-
script$
|
|
381
|
+
script$6.render = render$6;
|
|
378
382
|
|
|
379
|
-
var script$
|
|
383
|
+
var script$5 = {
|
|
380
384
|
name: 'IconDocument'
|
|
381
385
|
};
|
|
382
386
|
|
|
383
|
-
var _hoisted_1$
|
|
387
|
+
var _hoisted_1$5 = {
|
|
384
388
|
"class": "icon",
|
|
385
389
|
viewBox: "0 0 1024 1024",
|
|
386
390
|
xmlns: "http://www.w3.org/2000/svg"
|
|
387
391
|
};
|
|
388
392
|
|
|
389
|
-
var _hoisted_2$
|
|
393
|
+
var _hoisted_2$5 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
390
394
|
fill: "currentColor",
|
|
391
395
|
d: "M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 01-32 32H160a32 32 0 01-32-32V96a32 32 0 0132-32zm160 448h384v64H320v-64zm0-192h160v64H320v-64zm0 384h384v64H320v-64z"
|
|
392
396
|
}, null, -1);
|
|
393
397
|
|
|
394
|
-
var _hoisted_3$
|
|
395
|
-
function render$
|
|
396
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
398
|
+
var _hoisted_3$5 = [_hoisted_2$5];
|
|
399
|
+
function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
400
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$5, _hoisted_3$5);
|
|
397
401
|
}
|
|
398
402
|
|
|
399
|
-
script$
|
|
403
|
+
script$5.render = render$5;
|
|
400
404
|
|
|
401
|
-
var script$
|
|
405
|
+
var script$4 = {
|
|
402
406
|
name: 'IconDelete'
|
|
403
407
|
};
|
|
404
408
|
|
|
405
|
-
var _hoisted_1$
|
|
409
|
+
var _hoisted_1$4 = {
|
|
406
410
|
"class": "icon",
|
|
407
411
|
viewBox: "0 0 1024 1024",
|
|
408
412
|
xmlns: "http://www.w3.org/2000/svg"
|
|
409
413
|
};
|
|
410
414
|
|
|
411
|
-
var _hoisted_2$
|
|
415
|
+
var _hoisted_2$4 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
412
416
|
fill: "currentColor",
|
|
413
417
|
d: "M160 256H96a32 32 0 010-64h256V95.936a32 32 0 0132-32h256a32 32 0 0132 32V192h256a32 32 0 110 64h-64v672a32 32 0 01-32 32H192a32 32 0 01-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32zm192 0a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32z"
|
|
414
418
|
}, null, -1);
|
|
415
419
|
|
|
416
|
-
var _hoisted_3$
|
|
417
|
-
function render$
|
|
418
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
420
|
+
var _hoisted_3$4 = [_hoisted_2$4];
|
|
421
|
+
function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
422
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$4, _hoisted_3$4);
|
|
419
423
|
}
|
|
420
424
|
|
|
421
|
-
script$
|
|
425
|
+
script$4.render = render$4;
|
|
422
426
|
|
|
423
|
-
var script$
|
|
427
|
+
var script$3 = {
|
|
424
428
|
name: 'IconView'
|
|
425
429
|
};
|
|
426
430
|
|
|
427
|
-
var _hoisted_1$
|
|
431
|
+
var _hoisted_1$3 = {
|
|
428
432
|
"class": "icon",
|
|
429
433
|
viewBox: "0 0 1024 1024",
|
|
430
434
|
xmlns: "http://www.w3.org/2000/svg"
|
|
431
435
|
};
|
|
432
436
|
|
|
433
|
-
var _hoisted_2$
|
|
437
|
+
var _hoisted_2$3 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
434
438
|
fill: "currentColor",
|
|
435
439
|
d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 110 448 224 224 0 010-448zm0 64a160.192 160.192 0 00-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"
|
|
436
440
|
}, null, -1);
|
|
437
441
|
|
|
438
|
-
var _hoisted_3$
|
|
439
|
-
function render$
|
|
440
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
442
|
+
var _hoisted_3$3 = [_hoisted_2$3];
|
|
443
|
+
function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
444
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$3, _hoisted_3$3);
|
|
441
445
|
}
|
|
442
446
|
|
|
443
|
-
script$
|
|
447
|
+
script$3.render = render$3;
|
|
444
448
|
|
|
445
|
-
var script$
|
|
449
|
+
var script$2 = {
|
|
446
450
|
name: 'IconFolderOpened'
|
|
447
451
|
};
|
|
448
452
|
|
|
449
|
-
var _hoisted_1$
|
|
453
|
+
var _hoisted_1$2 = {
|
|
450
454
|
"class": "icon",
|
|
451
455
|
viewBox: "0 0 1024 1024",
|
|
452
456
|
xmlns: "http://www.w3.org/2000/svg"
|
|
453
457
|
};
|
|
454
458
|
|
|
455
|
-
var _hoisted_2$
|
|
459
|
+
var _hoisted_2$2 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
456
460
|
fill: "currentColor",
|
|
457
461
|
d: "M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 01216.96 384H832zm-24.96 512H96a32 32 0 01-32-32V160a32 32 0 0132-32h287.872l128.384 128H864a32 32 0 0132 32v96h23.04a32 32 0 0131.04 39.744l-112 448A32 32 0 01807.04 896z"
|
|
458
462
|
}, null, -1);
|
|
459
463
|
|
|
460
|
-
var _hoisted_3$
|
|
461
|
-
function render$
|
|
462
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
464
|
+
var _hoisted_3$2 = [_hoisted_2$2];
|
|
465
|
+
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
466
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$2, _hoisted_3$2);
|
|
463
467
|
}
|
|
464
468
|
|
|
465
|
-
script$
|
|
469
|
+
script$2.render = render$2;
|
|
466
470
|
|
|
467
|
-
function _isSlot
|
|
471
|
+
function _isSlot(s) {
|
|
468
472
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
469
473
|
}
|
|
470
474
|
|
|
@@ -577,8 +581,8 @@
|
|
|
577
581
|
},
|
|
578
582
|
emits: ['update:modelValue', 'change'],
|
|
579
583
|
components: {
|
|
580
|
-
IconFolderOpened: script$
|
|
581
|
-
IconView: script$
|
|
584
|
+
IconFolderOpened: script$2,
|
|
585
|
+
IconView: script$3
|
|
582
586
|
},
|
|
583
587
|
data: function data() {
|
|
584
588
|
return {
|
|
@@ -654,7 +658,7 @@
|
|
|
654
658
|
}
|
|
655
659
|
}, {
|
|
656
660
|
"default": function _default() {
|
|
657
|
-
return [vue.createVNode(script$
|
|
661
|
+
return [vue.createVNode(script$6, null, null)];
|
|
658
662
|
}
|
|
659
663
|
}) : null;
|
|
660
664
|
}
|
|
@@ -725,7 +729,7 @@
|
|
|
725
729
|
"key": '6' + index
|
|
726
730
|
}, {
|
|
727
731
|
"default": function _default() {
|
|
728
|
-
return [vue.createVNode(script$
|
|
732
|
+
return [vue.createVNode(script$4, null, null)];
|
|
729
733
|
}
|
|
730
734
|
});
|
|
731
735
|
},
|
|
@@ -739,7 +743,7 @@
|
|
|
739
743
|
}
|
|
740
744
|
}, {
|
|
741
745
|
"default": function _default() {
|
|
742
|
-
return [vue.createVNode(script$
|
|
746
|
+
return [vue.createVNode(script$5, null, null)];
|
|
743
747
|
}
|
|
744
748
|
}), _this4.makeIcons(src, index)]);
|
|
745
749
|
}));
|
|
@@ -845,7 +849,7 @@
|
|
|
845
849
|
"onClick": function onClick() {
|
|
846
850
|
return _this8.onCancel() !== false && (_this8.frameVisible = false);
|
|
847
851
|
}
|
|
848
|
-
}, _isSlot
|
|
852
|
+
}, _isSlot(closeBtnText) ? closeBtnText : {
|
|
849
853
|
"default": function _default() {
|
|
850
854
|
return [closeBtnText];
|
|
851
855
|
}
|
|
@@ -854,7 +858,7 @@
|
|
|
854
858
|
"onClick": function onClick() {
|
|
855
859
|
return _this8.onOk() !== false && _this8.closeModel();
|
|
856
860
|
}
|
|
857
|
-
}, _isSlot
|
|
861
|
+
}, _isSlot(okBtnText) ? okBtnText : {
|
|
858
862
|
"default": function _default() {
|
|
859
863
|
return [okBtnText];
|
|
860
864
|
}
|
|
@@ -960,7 +964,7 @@
|
|
|
960
964
|
},
|
|
961
965
|
type: String
|
|
962
966
|
},
|
|
963
|
-
emits: ['update:modelValue'],
|
|
967
|
+
emits: ['update:modelValue', 'fc.el'],
|
|
964
968
|
setup: function setup(props, _) {
|
|
965
969
|
var options = vue.toRef(props.formCreateInject, 'options', []);
|
|
966
970
|
var value = vue.toRef(props, 'modelValue');
|
|
@@ -986,7 +990,8 @@
|
|
|
986
990
|
var Type = vue.resolveComponent(name);
|
|
987
991
|
return vue.createVNode(vue.resolveComponent("ElRadioGroup"), vue.mergeProps(this.$attrs, {
|
|
988
992
|
"modelValue": this.value,
|
|
989
|
-
"onUpdate:modelValue": this.onInput
|
|
993
|
+
"onUpdate:modelValue": this.onInput,
|
|
994
|
+
"ref": "el"
|
|
990
995
|
}), _objectSpread2({
|
|
991
996
|
"default": function _default() {
|
|
992
997
|
return [_this.options().map(function (opt, index) {
|
|
@@ -1005,6 +1010,9 @@
|
|
|
1005
1010
|
}), (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)];
|
|
1006
1011
|
}
|
|
1007
1012
|
}, getSlot(this.$slots, ['default'])));
|
|
1013
|
+
},
|
|
1014
|
+
mounted: function mounted() {
|
|
1015
|
+
this.$emit('fc.el', this.$refs.el);
|
|
1008
1016
|
}
|
|
1009
1017
|
});
|
|
1010
1018
|
|
|
@@ -1020,7 +1028,7 @@
|
|
|
1020
1028
|
},
|
|
1021
1029
|
type: String
|
|
1022
1030
|
},
|
|
1023
|
-
emits: ['update:modelValue'],
|
|
1031
|
+
emits: ['update:modelValue', 'fc.el'],
|
|
1024
1032
|
setup: function setup(props) {
|
|
1025
1033
|
var options = vue.toRef(props.formCreateInject, 'options', []);
|
|
1026
1034
|
var value = vue.toRef(props, 'modelValue');
|
|
@@ -1043,7 +1051,8 @@
|
|
|
1043
1051
|
"modelValue": this.value,
|
|
1044
1052
|
"onUpdate:modelValue": function onUpdateModelValue(v) {
|
|
1045
1053
|
return _this.$emit('update:modelValue', v);
|
|
1046
|
-
}
|
|
1054
|
+
},
|
|
1055
|
+
"ref": "el"
|
|
1047
1056
|
}), _objectSpread2({
|
|
1048
1057
|
"default": function _default() {
|
|
1049
1058
|
return [_this.options().map(function (props, index) {
|
|
@@ -1053,6 +1062,9 @@
|
|
|
1053
1062
|
}), (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)];
|
|
1054
1063
|
}
|
|
1055
1064
|
}, getSlot(this.$slots, ['default'])));
|
|
1065
|
+
},
|
|
1066
|
+
mounted: function mounted() {
|
|
1067
|
+
this.$emit('fc.el', this.$refs.el);
|
|
1056
1068
|
}
|
|
1057
1069
|
});
|
|
1058
1070
|
|
|
@@ -1078,7 +1090,7 @@
|
|
|
1078
1090
|
}
|
|
1079
1091
|
}
|
|
1080
1092
|
},
|
|
1081
|
-
emits: ['update:modelValue'],
|
|
1093
|
+
emits: ['update:modelValue', 'fc.el'],
|
|
1082
1094
|
watch: {
|
|
1083
1095
|
modelValue: function modelValue() {
|
|
1084
1096
|
this.setValue();
|
|
@@ -1117,33 +1129,34 @@
|
|
|
1117
1129
|
},
|
|
1118
1130
|
mounted: function mounted() {
|
|
1119
1131
|
this.setValue();
|
|
1132
|
+
this.$emit('fc.el', this.$refs.tree);
|
|
1120
1133
|
}
|
|
1121
1134
|
});
|
|
1122
1135
|
|
|
1123
|
-
var css_248z$
|
|
1124
|
-
styleInject(css_248z$
|
|
1136
|
+
var css_248z$2 = "._fc-exceed .el-upload{display:none}";
|
|
1137
|
+
styleInject(css_248z$2);
|
|
1125
1138
|
|
|
1126
|
-
var script$
|
|
1139
|
+
var script$1 = {
|
|
1127
1140
|
name: 'IconUpload'
|
|
1128
1141
|
};
|
|
1129
1142
|
|
|
1130
|
-
var _hoisted_1$
|
|
1143
|
+
var _hoisted_1$1 = {
|
|
1131
1144
|
"class": "icon",
|
|
1132
1145
|
viewBox: "0 0 1024 1024",
|
|
1133
1146
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1134
1147
|
};
|
|
1135
1148
|
|
|
1136
|
-
var _hoisted_2$
|
|
1149
|
+
var _hoisted_2$1 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
1137
1150
|
fill: "currentColor",
|
|
1138
1151
|
d: "M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"
|
|
1139
1152
|
}, null, -1);
|
|
1140
1153
|
|
|
1141
|
-
var _hoisted_3$
|
|
1142
|
-
function render$
|
|
1143
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
1154
|
+
var _hoisted_3$1 = [_hoisted_2$1];
|
|
1155
|
+
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1156
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$1, _hoisted_3$1);
|
|
1144
1157
|
}
|
|
1145
1158
|
|
|
1146
|
-
script$
|
|
1159
|
+
script$1.render = render$1;
|
|
1147
1160
|
|
|
1148
1161
|
function parseFile(file, i) {
|
|
1149
1162
|
return {
|
|
@@ -1175,7 +1188,7 @@
|
|
|
1175
1188
|
modalTitle: String,
|
|
1176
1189
|
modelValue: [Array, String]
|
|
1177
1190
|
},
|
|
1178
|
-
emits: ['update:modelValue', 'change', 'remove'],
|
|
1191
|
+
emits: ['update:modelValue', 'change', 'remove', 'fc.el'],
|
|
1179
1192
|
data: function data() {
|
|
1180
1193
|
return {
|
|
1181
1194
|
previewVisible: false,
|
|
@@ -1239,12 +1252,13 @@
|
|
|
1239
1252
|
"onPreview": this.handlePreview,
|
|
1240
1253
|
"onChange": this.handleChange,
|
|
1241
1254
|
"onRemove": this.handleRemove,
|
|
1242
|
-
"fileList": this.fileList
|
|
1255
|
+
"fileList": this.fileList,
|
|
1256
|
+
"ref": "upload"
|
|
1243
1257
|
}), _objectSpread2({
|
|
1244
1258
|
"default": function _default() {
|
|
1245
1259
|
return [((_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)) || vue.createVNode(vue.resolveComponent("ElIcon"), null, {
|
|
1246
1260
|
"default": function _default() {
|
|
1247
|
-
return [vue.createVNode(script$
|
|
1261
|
+
return [vue.createVNode(script$1, null, null)];
|
|
1248
1262
|
}
|
|
1249
1263
|
})];
|
|
1250
1264
|
}
|
|
@@ -1262,6 +1276,9 @@
|
|
|
1262
1276
|
}, null)];
|
|
1263
1277
|
}
|
|
1264
1278
|
})]);
|
|
1279
|
+
},
|
|
1280
|
+
mounted: function mounted() {
|
|
1281
|
+
this.$emit('fc.el', this.$refs.upload);
|
|
1265
1282
|
}
|
|
1266
1283
|
});
|
|
1267
1284
|
|
|
@@ -1307,65 +1324,6 @@
|
|
|
1307
1324
|
return {}.hasOwnProperty.call(rule, k);
|
|
1308
1325
|
}
|
|
1309
1326
|
|
|
1310
|
-
var script$2 = {
|
|
1311
|
-
name: 'IconCirclePlus'
|
|
1312
|
-
};
|
|
1313
|
-
|
|
1314
|
-
var _hoisted_1$2 = {
|
|
1315
|
-
"class": "icon",
|
|
1316
|
-
viewBox: "0 0 1024 1024",
|
|
1317
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1318
|
-
};
|
|
1319
|
-
|
|
1320
|
-
var _hoisted_2$2 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
1321
|
-
fill: "currentColor",
|
|
1322
|
-
d: "M352 480h320a32 32 0 110 64H352a32 32 0 010-64z"
|
|
1323
|
-
}, null, -1);
|
|
1324
|
-
|
|
1325
|
-
var _hoisted_3$2 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
1326
|
-
fill: "currentColor",
|
|
1327
|
-
d: "M480 672V352a32 32 0 1164 0v320a32 32 0 01-64 0z"
|
|
1328
|
-
}, null, -1);
|
|
1329
|
-
|
|
1330
|
-
var _hoisted_4$1 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
1331
|
-
fill: "currentColor",
|
|
1332
|
-
d: "M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"
|
|
1333
|
-
}, null, -1);
|
|
1334
|
-
|
|
1335
|
-
var _hoisted_5 = [_hoisted_2$2, _hoisted_3$2, _hoisted_4$1];
|
|
1336
|
-
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1337
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$2, _hoisted_5);
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
script$2.render = render$2;
|
|
1341
|
-
|
|
1342
|
-
var script$1 = {
|
|
1343
|
-
name: 'IconRemove'
|
|
1344
|
-
};
|
|
1345
|
-
|
|
1346
|
-
var _hoisted_1$1 = {
|
|
1347
|
-
"class": "icon",
|
|
1348
|
-
viewBox: "0 0 1024 1024",
|
|
1349
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1350
|
-
};
|
|
1351
|
-
|
|
1352
|
-
var _hoisted_2$1 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
1353
|
-
fill: "currentColor",
|
|
1354
|
-
d: "M352 480h320a32 32 0 110 64H352a32 32 0 010-64z"
|
|
1355
|
-
}, null, -1);
|
|
1356
|
-
|
|
1357
|
-
var _hoisted_3$1 = /*#__PURE__*/vue.createElementVNode("path", {
|
|
1358
|
-
fill: "currentColor",
|
|
1359
|
-
d: "M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"
|
|
1360
|
-
}, null, -1);
|
|
1361
|
-
|
|
1362
|
-
var _hoisted_4 = [_hoisted_2$1, _hoisted_3$1];
|
|
1363
|
-
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1364
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$1, _hoisted_4);
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
script$1.render = render$1;
|
|
1368
|
-
|
|
1369
1327
|
function $set(target, field, value) {
|
|
1370
1328
|
target[field] = value;
|
|
1371
1329
|
}
|
|
@@ -1441,9 +1399,8 @@
|
|
|
1441
1399
|
return _extends.apply(this, arguments);
|
|
1442
1400
|
}
|
|
1443
1401
|
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
}
|
|
1402
|
+
var css_248z$1 = "._fc-group{display:flex;flex-direction:column;justify-content:center;min-height:38px;width:100%}._fc-group-disabled ._fc-group-add,._fc-group-disabled ._fc-group-btn{cursor:not-allowed}._fc-group-handle{background-color:#fff;border:1px dashed #d9d9d9;border-radius:15px;bottom:-15px;display:flex;flex-direction:row;padding:3px 8px;position:absolute;right:30px}._fc-group-btn{cursor:pointer}._fc-group-idx{align-items:center;background:#eee;border-radius:15px;bottom:-15px;display:flex;font-weight:700;height:30px;justify-content:center;left:10px;position:absolute;width:30px}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{border:1px dashed #d9d9d9;border-radius:5px;display:flex;flex-direction:column;margin:5px 5px 25px;padding:20px 20px 25px;position:relative}._fc-group-arrow{height:20px;position:relative;width:20px}._fc-group-arrow:before{border-left:2px solid #999;border-top:2px solid #999;content:\"\";height:9px;left:5px;position:absolute;top:8px;transform:rotate(45deg);width:9px}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{cursor:pointer;height:20px;position:relative;width:20px}._fc-group-plus-minus:after,._fc-group-plus-minus:before{background-color:#409eff;content:\"\";height:2px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60%}._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{border:1px solid rgba(64,158,255,.5);border-radius:15px;cursor:pointer;height:25px;width:25px}._fc-group-add._fc-group-plus-minus:after,._fc-group-add._fc-group-plus-minus:before{width:50%}";
|
|
1403
|
+
styleInject(css_248z$1);
|
|
1447
1404
|
|
|
1448
1405
|
var NAME$3 = 'fcGroup';
|
|
1449
1406
|
var Group = vue.defineComponent({
|
|
@@ -1472,6 +1429,10 @@
|
|
|
1472
1429
|
}
|
|
1473
1430
|
},
|
|
1474
1431
|
defaultValue: Object,
|
|
1432
|
+
sortBtn: {
|
|
1433
|
+
type: Boolean,
|
|
1434
|
+
"default": true
|
|
1435
|
+
},
|
|
1475
1436
|
disabled: {
|
|
1476
1437
|
type: Boolean,
|
|
1477
1438
|
"default": false
|
|
@@ -1480,10 +1441,6 @@
|
|
|
1480
1441
|
type: Boolean,
|
|
1481
1442
|
"default": true
|
|
1482
1443
|
},
|
|
1483
|
-
fontSize: {
|
|
1484
|
-
type: Number,
|
|
1485
|
-
"default": 28
|
|
1486
|
-
},
|
|
1487
1444
|
onBeforeRemove: {
|
|
1488
1445
|
type: Function,
|
|
1489
1446
|
"default": function _default() {}
|
|
@@ -1492,13 +1449,15 @@
|
|
|
1492
1449
|
type: Function,
|
|
1493
1450
|
"default": function _default() {}
|
|
1494
1451
|
},
|
|
1495
|
-
formCreateInject: Object
|
|
1452
|
+
formCreateInject: Object,
|
|
1453
|
+
parse: Function
|
|
1496
1454
|
},
|
|
1497
1455
|
data: function data() {
|
|
1498
1456
|
return {
|
|
1499
1457
|
len: 0,
|
|
1500
1458
|
cacheRule: {},
|
|
1501
1459
|
cacheValue: {},
|
|
1460
|
+
sort: [],
|
|
1502
1461
|
form: vue.markRaw(this.formCreateInject.form.$form())
|
|
1503
1462
|
};
|
|
1504
1463
|
},
|
|
@@ -1552,7 +1511,7 @@
|
|
|
1552
1511
|
var _this2 = this;
|
|
1553
1512
|
|
|
1554
1513
|
n = n || [];
|
|
1555
|
-
var keys = Object.keys(this.
|
|
1514
|
+
var keys = Object.keys(this.sort),
|
|
1556
1515
|
total = keys.length,
|
|
1557
1516
|
len = total - n.length;
|
|
1558
1517
|
|
|
@@ -1594,7 +1553,7 @@
|
|
|
1594
1553
|
var _this3 = this;
|
|
1595
1554
|
|
|
1596
1555
|
var cacheRule = this.cacheRule;
|
|
1597
|
-
var keys =
|
|
1556
|
+
var keys = this.sort;
|
|
1598
1557
|
|
|
1599
1558
|
if (keys.filter(function (k) {
|
|
1600
1559
|
return cacheRule[k].$f;
|
|
@@ -1640,6 +1599,11 @@
|
|
|
1640
1599
|
extend(options.formData, this.field ? _defineProperty({}, this.field, defVal) : defVal);
|
|
1641
1600
|
}
|
|
1642
1601
|
|
|
1602
|
+
this.parse && this.parse({
|
|
1603
|
+
rule: rule,
|
|
1604
|
+
options: options,
|
|
1605
|
+
index: this.sort.length
|
|
1606
|
+
});
|
|
1643
1607
|
this.cacheRule[++this.len] = {
|
|
1644
1608
|
rule: rule,
|
|
1645
1609
|
options: options
|
|
@@ -1655,7 +1619,6 @@
|
|
|
1655
1619
|
var _this5 = this;
|
|
1656
1620
|
|
|
1657
1621
|
this.cacheRule[key].$f = $f;
|
|
1658
|
-
this.formData(key, $f.formData());
|
|
1659
1622
|
vue.nextTick(function () {
|
|
1660
1623
|
if (_this5.syncDisabled) {
|
|
1661
1624
|
$f.disabled(_this5.disabled);
|
|
@@ -1677,13 +1640,15 @@
|
|
|
1677
1640
|
});
|
|
1678
1641
|
}
|
|
1679
1642
|
},
|
|
1680
|
-
add: function add() {
|
|
1643
|
+
add: function add(i) {
|
|
1681
1644
|
if (this.disabled || false === this.onBeforeAdd(this.modelValue)) {
|
|
1682
1645
|
return;
|
|
1683
1646
|
}
|
|
1684
1647
|
|
|
1685
|
-
this.modelValue
|
|
1686
|
-
|
|
1648
|
+
var value = _toConsumableArray(this.modelValue);
|
|
1649
|
+
|
|
1650
|
+
value.push(this.defaultValue ? deepCopy(this.defaultValue) : this.field ? null : {});
|
|
1651
|
+
this.input(value);
|
|
1687
1652
|
},
|
|
1688
1653
|
del: function del(index, key) {
|
|
1689
1654
|
if (this.disabled || false === this.onBeforeRemove(this.modelValue, index)) {
|
|
@@ -1691,38 +1656,56 @@
|
|
|
1691
1656
|
}
|
|
1692
1657
|
|
|
1693
1658
|
this.removeRule(key, true);
|
|
1694
|
-
|
|
1695
|
-
|
|
1659
|
+
|
|
1660
|
+
var value = _toConsumableArray(this.modelValue);
|
|
1661
|
+
|
|
1662
|
+
value.splice(index, 1);
|
|
1663
|
+
this.input(value);
|
|
1696
1664
|
},
|
|
1697
1665
|
addIcon: function addIcon(key) {
|
|
1698
|
-
return vue.createVNode(
|
|
1699
|
-
"
|
|
1700
|
-
"style": "font-size:".concat(this.fontSize, "px;cursor:").concat(this.disabled ? 'not-allowed;color:#c9cdd4' : 'pointer', ";"),
|
|
1666
|
+
return vue.createVNode("div", {
|
|
1667
|
+
"class": "_fc-group-btn _fc-group-plus-minus",
|
|
1701
1668
|
"onClick": this.add
|
|
1702
|
-
},
|
|
1703
|
-
"default": function _default() {
|
|
1704
|
-
return [vue.createVNode(script$2, null, null)];
|
|
1705
|
-
}
|
|
1706
|
-
});
|
|
1669
|
+
}, null);
|
|
1707
1670
|
},
|
|
1708
1671
|
delIcon: function delIcon(index, key) {
|
|
1709
1672
|
var _this7 = this;
|
|
1710
1673
|
|
|
1711
|
-
return vue.createVNode(
|
|
1712
|
-
"
|
|
1713
|
-
"class": "el-icon-remove-outline",
|
|
1714
|
-
"style": "font-size:".concat(this.fontSize, "px;cursor:").concat(this.disabled ? 'not-allowed;color:#c9cdd4' : 'pointer;color:#606266', ";"),
|
|
1674
|
+
return vue.createVNode("div", {
|
|
1675
|
+
"class": "_fc-group-btn _fc-group-plus-minus _fc-group-minus",
|
|
1715
1676
|
"onClick": function onClick() {
|
|
1716
1677
|
return _this7.del(index, key);
|
|
1717
1678
|
}
|
|
1718
|
-
},
|
|
1719
|
-
|
|
1720
|
-
|
|
1679
|
+
}, null);
|
|
1680
|
+
},
|
|
1681
|
+
sortUpIcon: function sortUpIcon(index) {
|
|
1682
|
+
var _this8 = this;
|
|
1683
|
+
|
|
1684
|
+
return vue.createVNode("div", {
|
|
1685
|
+
"class": "_fc-group-btn _fc-group-arrow _fc-group-up",
|
|
1686
|
+
"onClick": function onClick() {
|
|
1687
|
+
return _this8.changeSort(index, -1);
|
|
1721
1688
|
}
|
|
1722
|
-
});
|
|
1689
|
+
}, null);
|
|
1690
|
+
},
|
|
1691
|
+
sortDownIcon: function sortDownIcon(index) {
|
|
1692
|
+
var _this9 = this;
|
|
1693
|
+
|
|
1694
|
+
return vue.createVNode("div", {
|
|
1695
|
+
"class": "_fc-group-btn _fc-group-arrow _fc-group-down",
|
|
1696
|
+
"onClick": function onClick() {
|
|
1697
|
+
return _this9.changeSort(index, 1);
|
|
1698
|
+
}
|
|
1699
|
+
}, null);
|
|
1700
|
+
},
|
|
1701
|
+
changeSort: function changeSort(index, sort) {
|
|
1702
|
+
var a = this.sort[index];
|
|
1703
|
+
this.sort[index] = this.sort[index + sort];
|
|
1704
|
+
this.sort[index + sort] = a;
|
|
1705
|
+
this.formData(0);
|
|
1723
1706
|
},
|
|
1724
1707
|
makeIcon: function makeIcon(total, index, key) {
|
|
1725
|
-
var
|
|
1708
|
+
var _this10 = this;
|
|
1726
1709
|
|
|
1727
1710
|
if (this.$slots.button) {
|
|
1728
1711
|
return this.$slots.button({
|
|
@@ -1731,19 +1714,31 @@
|
|
|
1731
1714
|
vm: this,
|
|
1732
1715
|
key: key,
|
|
1733
1716
|
del: function del() {
|
|
1734
|
-
return
|
|
1717
|
+
return _this10.del(index, key);
|
|
1735
1718
|
},
|
|
1736
1719
|
add: this.add
|
|
1737
1720
|
});
|
|
1738
1721
|
}
|
|
1739
1722
|
|
|
1740
|
-
|
|
1741
|
-
|
|
1723
|
+
var btn = [];
|
|
1724
|
+
|
|
1725
|
+
if ((!this.max || total < this.max) && total === index + 1) {
|
|
1726
|
+
btn.push(this.addIcon(key));
|
|
1742
1727
|
}
|
|
1743
1728
|
|
|
1744
1729
|
if (total > this.min) {
|
|
1745
|
-
|
|
1730
|
+
btn.push(this.delIcon(index, key));
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
if (this.sortBtn && index) {
|
|
1734
|
+
btn.push(this.sortUpIcon(index));
|
|
1746
1735
|
}
|
|
1736
|
+
|
|
1737
|
+
if (this.sortBtn && index !== total - 1) {
|
|
1738
|
+
btn.push(this.sortDownIcon(index));
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
return btn;
|
|
1747
1742
|
},
|
|
1748
1743
|
emitEvent: function emitEvent(name, args, index, key) {
|
|
1749
1744
|
this.$emit.apply(this, [name].concat(_toConsumableArray(args), [this.cacheRule[key].$f, index]));
|
|
@@ -1755,6 +1750,15 @@
|
|
|
1755
1750
|
}
|
|
1756
1751
|
},
|
|
1757
1752
|
created: function created() {
|
|
1753
|
+
var _this11 = this;
|
|
1754
|
+
|
|
1755
|
+
vue.watch(function () {
|
|
1756
|
+
return _objectSpread2({}, _this11.cacheRule);
|
|
1757
|
+
}, function (n) {
|
|
1758
|
+
_this11.sort = Object.keys(n);
|
|
1759
|
+
}, {
|
|
1760
|
+
immediate: true
|
|
1761
|
+
});
|
|
1758
1762
|
var d = (this.expand || 0) - this.modelValue.length;
|
|
1759
1763
|
|
|
1760
1764
|
for (var i = 0; i < this.modelValue.length; i++) {
|
|
@@ -1766,75 +1770,58 @@
|
|
|
1766
1770
|
}
|
|
1767
1771
|
},
|
|
1768
1772
|
render: function render() {
|
|
1769
|
-
var
|
|
1773
|
+
var _this12 = this;
|
|
1770
1774
|
|
|
1771
|
-
var keys =
|
|
1775
|
+
var keys = this.sort;
|
|
1772
1776
|
var button = this.button;
|
|
1773
1777
|
var Type = this.form;
|
|
1774
|
-
|
|
1778
|
+
var disabled = this.disabled;
|
|
1779
|
+
var children = keys.length === 0 ? this.$slots["default"] ? this.$slots["default"]({
|
|
1775
1780
|
vm: this,
|
|
1776
1781
|
add: this.add
|
|
1777
|
-
}) : vue.createVNode(vue.resolveComponent("ElIcon"), {
|
|
1778
|
-
"key": 1,
|
|
1779
|
-
"style": "font-size:".concat(this.fontSize, "px;vertical-align:middle;color:").concat(this.disabled ? '#c9cdd4;cursor: not-allowed' : '#606266;cursor:pointer', ";"),
|
|
1780
|
-
"onClick": this.add
|
|
1781
|
-
}, {
|
|
1782
|
-
"default": function _default() {
|
|
1783
|
-
return [vue.createVNode(script$2, null, null)];
|
|
1784
|
-
}
|
|
1785
1782
|
}) : vue.createVNode("div", {
|
|
1786
|
-
"
|
|
1787
|
-
"
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
return vue.createVNode(
|
|
1795
|
-
"
|
|
1796
|
-
"key": key
|
|
1797
|
-
|
|
1783
|
+
"key": 'a_def',
|
|
1784
|
+
"class": "_fc-group-plus-minus _fc-group-add",
|
|
1785
|
+
"onClick": this.add
|
|
1786
|
+
}, null) : keys.map(function (key, index) {
|
|
1787
|
+
var _this12$cacheRule$key = _this12.cacheRule[key],
|
|
1788
|
+
rule = _this12$cacheRule$key.rule,
|
|
1789
|
+
options = _this12$cacheRule$key.options;
|
|
1790
|
+
var btn = button && !disabled ? _this12.makeIcon(keys.length, index, key) : [];
|
|
1791
|
+
return vue.createVNode("div", {
|
|
1792
|
+
"class": "_fc-group-container",
|
|
1793
|
+
"key": key
|
|
1794
|
+
}, [vue.createVNode(Type, vue.mergeProps({
|
|
1795
|
+
"key": key
|
|
1798
1796
|
}, {
|
|
1799
|
-
|
|
1800
|
-
return
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
"span": 2,
|
|
1828
|
-
"pull": 1,
|
|
1829
|
-
"push": 1
|
|
1830
|
-
}, _isSlot(_slot = _this9.makeIcon(keys.length, index, key)) ? _slot : {
|
|
1831
|
-
"default": function _default() {
|
|
1832
|
-
return [_slot];
|
|
1833
|
-
}
|
|
1834
|
-
}) : null];
|
|
1835
|
-
}
|
|
1836
|
-
});
|
|
1837
|
-
})]);
|
|
1797
|
+
'onUpdate:modelValue': function onUpdateModelValue(formData) {
|
|
1798
|
+
return _this12.formData(key, formData);
|
|
1799
|
+
},
|
|
1800
|
+
'onEmit-event': function onEmitEvent(name) {
|
|
1801
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1802
|
+
args[_key - 1] = arguments[_key];
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
return _this12.emitEvent(name, args, index, key);
|
|
1806
|
+
},
|
|
1807
|
+
'onUpdate:api': function onUpdateApi($f) {
|
|
1808
|
+
return _this12.add$f(index, key, $f);
|
|
1809
|
+
},
|
|
1810
|
+
inFor: true,
|
|
1811
|
+
modelValue: _this12.field ? _defineProperty({}, _this12.field, _this12._value(_this12.modelValue[index])) : _this12.modelValue[index],
|
|
1812
|
+
rule: rule,
|
|
1813
|
+
option: options,
|
|
1814
|
+
extendOption: true
|
|
1815
|
+
}), null), vue.createVNode("div", {
|
|
1816
|
+
"class": "_fc-group-idx"
|
|
1817
|
+
}, [index + 1]), btn.length ? vue.createVNode("div", {
|
|
1818
|
+
"class": "_fc-group-handle"
|
|
1819
|
+
}, [btn]) : null]);
|
|
1820
|
+
});
|
|
1821
|
+
return vue.createVNode("div", {
|
|
1822
|
+
"key": 'con',
|
|
1823
|
+
"class": '_fc-group ' + (disabled ? '_fc-group-disabled' : '')
|
|
1824
|
+
}, [children]);
|
|
1838
1825
|
}
|
|
1839
1826
|
});
|
|
1840
1827
|
|
|
@@ -3337,6 +3324,13 @@
|
|
|
3337
3324
|
vn.el.__rule__ = ctx.rule;
|
|
3338
3325
|
|
|
3339
3326
|
_this7.onMounted(ctx, vn.el);
|
|
3327
|
+
},
|
|
3328
|
+
'fc.el': function fcEl(el) {
|
|
3329
|
+
ctx.exportEl = el;
|
|
3330
|
+
|
|
3331
|
+
if (el) {
|
|
3332
|
+
(el.$el || el).__rule__ = ctx.rule;
|
|
3333
|
+
}
|
|
3340
3334
|
}
|
|
3341
3335
|
}
|
|
3342
3336
|
}];
|
|
@@ -3706,6 +3700,7 @@
|
|
|
3706
3700
|
refRule: {},
|
|
3707
3701
|
input: isInput,
|
|
3708
3702
|
el: undefined,
|
|
3703
|
+
exportEl: undefined,
|
|
3709
3704
|
defaultValue: isInput ? deepCopy(defaultValue) : undefined,
|
|
3710
3705
|
field: rule.field || undefined
|
|
3711
3706
|
});
|
|
@@ -4229,6 +4224,8 @@
|
|
|
4229
4224
|
|
|
4230
4225
|
!isCopy && !isInit && _this6.effect(ctx, 'load');
|
|
4231
4226
|
|
|
4227
|
+
_this6.effect(ctx, 'created');
|
|
4228
|
+
|
|
4232
4229
|
var _load = ctx.loadChildrenPending();
|
|
4233
4230
|
|
|
4234
4231
|
ctx.parser.loadChildren === false || loadChildren(_load, ctx);
|
|
@@ -5048,6 +5045,8 @@
|
|
|
5048
5045
|
data.mergeProp = function (prop) {
|
|
5049
5046
|
return mergeRule(data.getProp(), [prop]);
|
|
5050
5047
|
};
|
|
5048
|
+
|
|
5049
|
+
data.id = ctx.id;
|
|
5051
5050
|
}
|
|
5052
5051
|
|
|
5053
5052
|
_this4.bus.$emit("p:".concat(attr, ":").concat(_type, ":").concat(p.input ? 1 : 0), event, [data, rule, _this4.api]);
|
|
@@ -5064,9 +5063,13 @@
|
|
|
5064
5063
|
|
|
5065
5064
|
function getComponent(p) {
|
|
5066
5065
|
var c = p.components;
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5066
|
+
|
|
5067
|
+
if (Array.isArray(c)) {
|
|
5068
|
+
var arr = unique(c.filter(function (v) {
|
|
5069
|
+
return v !== '*';
|
|
5070
|
+
}));
|
|
5071
|
+
return arr.length ? arr : false;
|
|
5072
|
+
} else if (is.String(c)) return [c];else return false;
|
|
5070
5073
|
}
|
|
5071
5074
|
|
|
5072
5075
|
function Handler(fc) {
|
|
@@ -5375,6 +5378,58 @@
|
|
|
5375
5378
|
render: function render(children) {}
|
|
5376
5379
|
});
|
|
5377
5380
|
|
|
5381
|
+
var loadData = function loadData(fc) {
|
|
5382
|
+
var loadData = {
|
|
5383
|
+
name: 'loadData',
|
|
5384
|
+
_fn: [],
|
|
5385
|
+
created: function created(inject, rule, api) {
|
|
5386
|
+
this.deleted(inject);
|
|
5387
|
+
var attrs = toArray(inject.getValue());
|
|
5388
|
+
var events = [];
|
|
5389
|
+
attrs.forEach(function (attr) {
|
|
5390
|
+
if (attr) {
|
|
5391
|
+
var on = function on() {
|
|
5392
|
+
if (attr.watch !== false) {
|
|
5393
|
+
fc.bus.$off('p.loadData.' + attr.attr, on);
|
|
5394
|
+
fc.bus.$once('p.loadData.' + attr.attr, on);
|
|
5395
|
+
}
|
|
5396
|
+
|
|
5397
|
+
var value = undefined;
|
|
5398
|
+
|
|
5399
|
+
if (attr.attr) {
|
|
5400
|
+
value = fc.loadData[attr.attr] || attr["default"];
|
|
5401
|
+
|
|
5402
|
+
if (attr.copy) {
|
|
5403
|
+
value = deepCopy(value);
|
|
5404
|
+
}
|
|
5405
|
+
}
|
|
5406
|
+
|
|
5407
|
+
deepSet(inject.getProp(), attr.to || 'options', value);
|
|
5408
|
+
api.sync(rule);
|
|
5409
|
+
};
|
|
5410
|
+
|
|
5411
|
+
events.push(function () {
|
|
5412
|
+
return fc.bus.$off('p.loadData.' + attr.attr, on);
|
|
5413
|
+
});
|
|
5414
|
+
on();
|
|
5415
|
+
}
|
|
5416
|
+
});
|
|
5417
|
+
this._fn[inject.id] = events;
|
|
5418
|
+
},
|
|
5419
|
+
deleted: function deleted(inject) {
|
|
5420
|
+
if (this._fn[inject.id]) {
|
|
5421
|
+
this._fn[inject.id].forEach(function (un) {
|
|
5422
|
+
un();
|
|
5423
|
+
});
|
|
5424
|
+
}
|
|
5425
|
+
|
|
5426
|
+
inject.clearProp();
|
|
5427
|
+
}
|
|
5428
|
+
};
|
|
5429
|
+
loadData.watch = loadData.created;
|
|
5430
|
+
return loadData;
|
|
5431
|
+
};
|
|
5432
|
+
|
|
5378
5433
|
var componentValidate = {
|
|
5379
5434
|
name: 'componentValidate',
|
|
5380
5435
|
load: function load(attr, rule, api) {
|
|
@@ -5467,6 +5522,15 @@
|
|
|
5467
5522
|
|
|
5468
5523
|
if (is.Function(option.parse)) {
|
|
5469
5524
|
fn = option.parse;
|
|
5525
|
+
} else if (option.parse && is.String(option.parse)) {
|
|
5526
|
+
fn = function fn(v) {
|
|
5527
|
+
option.parse.split('.').forEach(function (k) {
|
|
5528
|
+
if (v) {
|
|
5529
|
+
v = v[k];
|
|
5530
|
+
}
|
|
5531
|
+
});
|
|
5532
|
+
return v;
|
|
5533
|
+
};
|
|
5470
5534
|
}
|
|
5471
5535
|
|
|
5472
5536
|
set(fn(body, rule, api));
|
|
@@ -5505,6 +5569,7 @@
|
|
|
5505
5569
|
|
|
5506
5570
|
var $provider = {
|
|
5507
5571
|
fetch: fetch,
|
|
5572
|
+
loadData: loadData,
|
|
5508
5573
|
componentValidate: componentValidate
|
|
5509
5574
|
};
|
|
5510
5575
|
|
|
@@ -5574,14 +5639,20 @@
|
|
|
5574
5639
|
var globalConfig = {
|
|
5575
5640
|
global: {}
|
|
5576
5641
|
};
|
|
5577
|
-
var
|
|
5642
|
+
var loadData = {};
|
|
5578
5643
|
var CreateNode = CreateNodeFactory();
|
|
5579
5644
|
exportAttrs(config.attrs || {});
|
|
5580
5645
|
|
|
5581
5646
|
function getApi(name) {
|
|
5582
5647
|
var val = instance[name];
|
|
5583
|
-
|
|
5584
|
-
|
|
5648
|
+
|
|
5649
|
+
if (Array.isArray(val)) {
|
|
5650
|
+
return val.map(function (v) {
|
|
5651
|
+
return v.api();
|
|
5652
|
+
});
|
|
5653
|
+
} else if (val) {
|
|
5654
|
+
return val.api();
|
|
5655
|
+
}
|
|
5585
5656
|
}
|
|
5586
5657
|
|
|
5587
5658
|
function useApp(fn) {
|
|
@@ -5691,7 +5762,7 @@
|
|
|
5691
5762
|
providers: providers,
|
|
5692
5763
|
useApps: useApps,
|
|
5693
5764
|
maker: maker,
|
|
5694
|
-
|
|
5765
|
+
loadData: loadData
|
|
5695
5766
|
};
|
|
5696
5767
|
} else {
|
|
5697
5768
|
delete _config.inherit;
|
|
@@ -5704,6 +5775,27 @@
|
|
|
5704
5775
|
modelFields[name] = field;
|
|
5705
5776
|
}
|
|
5706
5777
|
|
|
5778
|
+
function _emitData(id) {
|
|
5779
|
+
Object.keys(instance).forEach(function (v) {
|
|
5780
|
+
var apis = Array.isArray(instance[v]) ? instance[v] : [instance[v]];
|
|
5781
|
+
apis.forEach(function (that) {
|
|
5782
|
+
that.bus.$emit('p.loadData.' + id);
|
|
5783
|
+
});
|
|
5784
|
+
});
|
|
5785
|
+
}
|
|
5786
|
+
|
|
5787
|
+
function setData(id, data) {
|
|
5788
|
+
loadData[id] = data;
|
|
5789
|
+
|
|
5790
|
+
_emitData(id);
|
|
5791
|
+
}
|
|
5792
|
+
|
|
5793
|
+
function removeData(id) {
|
|
5794
|
+
delete loadData[id];
|
|
5795
|
+
|
|
5796
|
+
_emitData(id);
|
|
5797
|
+
}
|
|
5798
|
+
|
|
5707
5799
|
function FormCreate(vm) {
|
|
5708
5800
|
var _this = this;
|
|
5709
5801
|
|
|
@@ -5716,12 +5808,13 @@
|
|
|
5716
5808
|
providers: providers,
|
|
5717
5809
|
modelFields: modelFields,
|
|
5718
5810
|
rules: vm.props.rule,
|
|
5719
|
-
name: vm.props.name,
|
|
5811
|
+
name: vm.props.name || uniqueId(),
|
|
5720
5812
|
inFor: vm.props.inFor,
|
|
5721
5813
|
prop: {
|
|
5722
5814
|
components: components,
|
|
5723
5815
|
directives: directives
|
|
5724
5816
|
},
|
|
5817
|
+
loadData: loadData,
|
|
5725
5818
|
CreateNode: CreateNode,
|
|
5726
5819
|
bus: new Mitt(),
|
|
5727
5820
|
unwatch: null,
|
|
@@ -5746,9 +5839,9 @@
|
|
|
5746
5839
|
if (this.name) {
|
|
5747
5840
|
if (this.inFor) {
|
|
5748
5841
|
if (!instance[this.name]) instance[this.name] = [];
|
|
5749
|
-
instance[this.name].push(this
|
|
5842
|
+
instance[this.name].push(this);
|
|
5750
5843
|
} else {
|
|
5751
|
-
instance[this.name] = this
|
|
5844
|
+
instance[this.name] = this;
|
|
5752
5845
|
}
|
|
5753
5846
|
}
|
|
5754
5847
|
}
|
|
@@ -5818,7 +5911,7 @@
|
|
|
5818
5911
|
unmount: function unmount() {
|
|
5819
5912
|
if (this.name) {
|
|
5820
5913
|
if (this.inFor) {
|
|
5821
|
-
var idx = instance[this.name].indexOf(this
|
|
5914
|
+
var idx = instance[this.name].indexOf(this);
|
|
5822
5915
|
instance[this.name].splice(idx, 1);
|
|
5823
5916
|
} else {
|
|
5824
5917
|
delete instance[this.name];
|
|
@@ -5841,7 +5934,8 @@
|
|
|
5841
5934
|
extend(formCreate, {
|
|
5842
5935
|
version: config.version,
|
|
5843
5936
|
ui: config.ui,
|
|
5844
|
-
|
|
5937
|
+
setData: setData,
|
|
5938
|
+
removeData: removeData,
|
|
5845
5939
|
maker: maker,
|
|
5846
5940
|
component: component,
|
|
5847
5941
|
directive: directive,
|
|
@@ -5911,7 +6005,7 @@
|
|
|
5911
6005
|
inherit.providers && extend(providers, inherit.providers);
|
|
5912
6006
|
inherit.useApps && extend(useApps, inherit.useApps);
|
|
5913
6007
|
inherit.maker && extend(maker, inherit.maker);
|
|
5914
|
-
inherit.
|
|
6008
|
+
inherit.loadData && extend(loadData, inherit.loadData);
|
|
5915
6009
|
}
|
|
5916
6010
|
|
|
5917
6011
|
return create;
|
|
@@ -6550,6 +6644,14 @@
|
|
|
6550
6644
|
|
|
6551
6645
|
function extendApi(api, h) {
|
|
6552
6646
|
extend(api, {
|
|
6647
|
+
formEl: function formEl() {
|
|
6648
|
+
return h.$manager.form();
|
|
6649
|
+
},
|
|
6650
|
+
wrapEl: function wrapEl(id) {
|
|
6651
|
+
var ctx = h.getFieldCtx(id);
|
|
6652
|
+
if (!ctx) return;
|
|
6653
|
+
return h.vm.refs[ctx.wrapRef];
|
|
6654
|
+
},
|
|
6553
6655
|
validate: function validate(callback) {
|
|
6554
6656
|
return new Promise(function (resolve, reject) {
|
|
6555
6657
|
var forms = api.children;
|
|
@@ -6781,7 +6883,7 @@
|
|
|
6781
6883
|
function elmFormCreate() {
|
|
6782
6884
|
return FormCreateFactory({
|
|
6783
6885
|
ui: 'element-ui',
|
|
6784
|
-
version: '3.1.
|
|
6886
|
+
version: '3.1.24',
|
|
6785
6887
|
manager: manager,
|
|
6786
6888
|
extendApi: extendApi,
|
|
6787
6889
|
install: install,
|