@tmagic/form 1.0.0-beta.13 → 1.0.0-beta.16
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/coverage/clover.xml +274 -261
- package/coverage/coverage-final.json +37 -36
- package/coverage/lcov-report/index.html +18 -18
- package/coverage/lcov-report/src/Form.vue.html +2 -2
- package/coverage/lcov-report/src/FormDialog.vue.html +1 -1
- package/coverage/lcov-report/src/containers/Col.vue.html +253 -0
- package/coverage/lcov-report/src/containers/Container.vue.html +28 -16
- package/coverage/lcov-report/src/containers/Fieldset.vue.html +1 -1
- package/coverage/lcov-report/src/containers/GroupList.vue.html +1 -1
- package/coverage/lcov-report/src/containers/GroupListItem.vue.html +5 -5
- package/coverage/lcov-report/src/containers/Panel.vue.html +1 -1
- package/coverage/lcov-report/src/containers/Row.vue.html +22 -34
- package/coverage/lcov-report/src/containers/Step.vue.html +1 -1
- package/coverage/lcov-report/src/containers/Table.vue.html +32 -8
- package/coverage/lcov-report/src/containers/Tabs.vue.html +1 -1
- package/coverage/lcov-report/src/containers/index.html +41 -26
- package/coverage/lcov-report/src/fields/Cascader.vue.html +1 -1
- package/coverage/lcov-report/src/fields/Checkbox.vue.html +3 -3
- package/coverage/lcov-report/src/fields/CheckboxGroup.vue.html +1 -1
- package/coverage/lcov-report/src/fields/ColorPicker.vue.html +1 -1
- package/coverage/lcov-report/src/fields/Date.vue.html +1 -1
- package/coverage/lcov-report/src/fields/DateTime.vue.html +1 -1
- package/coverage/lcov-report/src/fields/Daterange.vue.html +1 -1
- package/coverage/lcov-report/src/fields/Display.vue.html +1 -1
- package/coverage/lcov-report/src/fields/DynamicField.vue.html +1 -1
- package/coverage/lcov-report/src/fields/Hidden.vue.html +1 -1
- package/coverage/lcov-report/src/fields/Link.vue.html +2 -2
- package/coverage/lcov-report/src/fields/Number.vue.html +1 -1
- package/coverage/lcov-report/src/fields/RadioGroup.vue.html +1 -1
- package/coverage/lcov-report/src/fields/Select.vue.html +1 -1
- package/coverage/lcov-report/src/fields/Switch.vue.html +1 -1
- package/coverage/lcov-report/src/fields/Text.vue.html +1 -1
- package/coverage/lcov-report/src/fields/Textarea.vue.html +13 -19
- package/coverage/lcov-report/src/fields/Time.vue.html +1 -1
- package/coverage/lcov-report/src/fields/index.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov-report/src/theme/index.html +1 -1
- package/coverage/lcov-report/src/theme/index.scss.html +1 -1
- package/coverage/lcov-report/src/utils/config.ts.html +1 -1
- package/coverage/lcov-report/src/utils/createForm.ts.html +1 -1
- package/coverage/lcov-report/src/utils/fieldProps.ts.html +1 -1
- package/coverage/lcov-report/src/utils/form.ts.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +1 -1
- package/coverage/lcov-report/src/utils/useAddField.ts.html +1 -1
- package/coverage/lcov.info +528 -497
- package/dist/style.css +7 -9
- package/dist/tmagic-form.es.js +143 -99
- package/dist/tmagic-form.es.js.map +1 -1
- package/dist/tmagic-form.umd.js +143 -99
- package/dist/tmagic-form.umd.js.map +1 -1
- package/dist/types/src/Form.vue.d.ts +362 -0
- package/dist/types/src/FormDialog.vue.d.ts +757 -0
- package/dist/types/src/containers/Col.vue.d.ts +42 -0
- package/dist/types/src/containers/Container.vue.d.ts +1 -0
- package/dist/types/src/containers/Row.vue.d.ts +0 -1
- package/dist/types/src/containers/Table.vue.d.ts +2601 -0
- package/dist/types/src/fields/Checkbox.vue.d.ts +2 -2
- package/dist/types/src/fields/Link.vue.d.ts +1596 -0
- package/package.json +10 -6
- package/src/Form.vue +1 -1
- package/src/containers/Col.vue +56 -0
- package/src/containers/Container.vue +9 -5
- package/src/containers/GroupListItem.vue +4 -4
- package/src/containers/Row.vue +13 -17
- package/src/containers/Table.vue +14 -6
- package/src/fields/Checkbox.vue +2 -2
- package/src/fields/Link.vue +1 -1
- package/src/fields/Textarea.vue +11 -13
- package/src/theme/form.scss +24 -17
package/dist/tmagic-form.umd.js
CHANGED
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
return target;
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
-
const _sfc_main$
|
|
179
|
+
const _sfc_main$t = vue.defineComponent({
|
|
180
180
|
name: "m-form-container",
|
|
181
181
|
components: { WarningFilled: icons.WarningFilled },
|
|
182
182
|
props: {
|
|
@@ -236,6 +236,7 @@
|
|
|
236
236
|
}
|
|
237
237
|
return display(mForm, props.config.display, props);
|
|
238
238
|
});
|
|
239
|
+
const itemLabelWidth = vue.computed(() => props.config.labelWidth || props.labelWidth);
|
|
239
240
|
vue.watchEffect(() => {
|
|
240
241
|
expand.value = props.expandMore;
|
|
241
242
|
});
|
|
@@ -296,6 +297,7 @@
|
|
|
296
297
|
itemProp,
|
|
297
298
|
items,
|
|
298
299
|
display: display$1,
|
|
300
|
+
itemLabelWidth,
|
|
299
301
|
tagName,
|
|
300
302
|
rule,
|
|
301
303
|
tooltip,
|
|
@@ -306,7 +308,7 @@
|
|
|
306
308
|
};
|
|
307
309
|
}
|
|
308
310
|
});
|
|
309
|
-
const _hoisted_1$
|
|
311
|
+
const _hoisted_1$f = ["innerHTML"];
|
|
310
312
|
const _hoisted_2$7 = ["innerHTML"];
|
|
311
313
|
const _hoisted_3$7 = ["innerHTML"];
|
|
312
314
|
const _hoisted_4$6 = ["innerHTML"];
|
|
@@ -314,7 +316,7 @@
|
|
|
314
316
|
key: 4,
|
|
315
317
|
style: { "text-align": "center" }
|
|
316
318
|
};
|
|
317
|
-
function _sfc_render$
|
|
319
|
+
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
318
320
|
const _component_m_fields_hidden = vue.resolveComponent("m-fields-hidden");
|
|
319
321
|
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
320
322
|
const _component_el_form_item = vue.resolveComponent("el-form-item");
|
|
@@ -343,19 +345,20 @@
|
|
|
343
345
|
prop: _ctx.itemProp,
|
|
344
346
|
"step-active": _ctx.stepActive,
|
|
345
347
|
"expand-more": _ctx.expand,
|
|
346
|
-
"label-width": _ctx.
|
|
348
|
+
"label-width": _ctx.itemLabelWidth,
|
|
347
349
|
onChange: _ctx.onChangeHandler
|
|
348
350
|
}, null, 8, ["size", "model", "config", "name", "prop", "step-active", "expand-more", "label-width", "onChange"])) : _ctx.type && _ctx.display ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
349
351
|
vue.createVNode(_component_el_form_item, {
|
|
350
352
|
style: vue.normalizeStyle(_ctx.config.tip ? "flex: 1" : ""),
|
|
353
|
+
class: vue.normalizeClass({ hidden: _ctx.itemLabelWidth === 0 || !_ctx.config.text }),
|
|
351
354
|
prop: _ctx.itemProp,
|
|
352
|
-
"label-width": _ctx.
|
|
355
|
+
"label-width": _ctx.itemLabelWidth,
|
|
353
356
|
rules: _ctx.rule
|
|
354
357
|
}, {
|
|
355
358
|
label: vue.withCtx(() => [
|
|
356
359
|
vue.createElementVNode("span", {
|
|
357
360
|
innerHTML: _ctx.type === "checkbox" ? "" : _ctx.config.text
|
|
358
|
-
}, null, 8, _hoisted_1$
|
|
361
|
+
}, null, 8, _hoisted_1$f)
|
|
359
362
|
]),
|
|
360
363
|
default: vue.withCtx(() => [
|
|
361
364
|
_ctx.tooltip ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, { key: 0 }, {
|
|
@@ -392,10 +395,10 @@
|
|
|
392
395
|
}, null, 8, _hoisted_3$7)) : vue.createCommentVNode("", true)
|
|
393
396
|
]),
|
|
394
397
|
_: 1
|
|
395
|
-
}, 8, ["style", "prop", "label-width", "rules"]),
|
|
398
|
+
}, 8, ["style", "class", "prop", "label-width", "rules"]),
|
|
396
399
|
_ctx.config.tip ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
|
|
397
400
|
key: 0,
|
|
398
|
-
placement: "
|
|
401
|
+
placement: "left"
|
|
399
402
|
}, {
|
|
400
403
|
content: vue.withCtx(() => [
|
|
401
404
|
vue.createElementVNode("div", {
|
|
@@ -421,7 +424,7 @@
|
|
|
421
424
|
size: _ctx.size,
|
|
422
425
|
"step-active": _ctx.stepActive,
|
|
423
426
|
"expand-more": _ctx.expand,
|
|
424
|
-
"label-width": _ctx.
|
|
427
|
+
"label-width": _ctx.itemLabelWidth,
|
|
425
428
|
prop: _ctx.itemProp,
|
|
426
429
|
onChange: _ctx.onChangeHandler
|
|
427
430
|
}, null, 8, ["model", "config", "size", "step-active", "expand-more", "label-width", "prop", "onChange"]);
|
|
@@ -429,7 +432,7 @@
|
|
|
429
432
|
], 64)) : vue.createCommentVNode("", true),
|
|
430
433
|
_ctx.config.expand && _ctx.type !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$4, [
|
|
431
434
|
vue.createVNode(_component_el_button, {
|
|
432
|
-
|
|
435
|
+
text: "",
|
|
433
436
|
onClick: _ctx.expandHandler
|
|
434
437
|
}, {
|
|
435
438
|
default: vue.withCtx(() => [
|
|
@@ -440,9 +443,9 @@
|
|
|
440
443
|
])) : vue.createCommentVNode("", true)
|
|
441
444
|
], 6)) : vue.createCommentVNode("", true);
|
|
442
445
|
}
|
|
443
|
-
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
446
|
+
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$q]]);
|
|
444
447
|
|
|
445
|
-
const _sfc_main$
|
|
448
|
+
const _sfc_main$s = vue.defineComponent({
|
|
446
449
|
name: "m-form-fieldset",
|
|
447
450
|
props: {
|
|
448
451
|
labelWidth: String,
|
|
@@ -494,7 +497,7 @@
|
|
|
494
497
|
};
|
|
495
498
|
}
|
|
496
499
|
});
|
|
497
|
-
const _hoisted_1$
|
|
500
|
+
const _hoisted_1$e = ["innerHTML"];
|
|
498
501
|
const _hoisted_2$6 = ["innerHTML"];
|
|
499
502
|
const _hoisted_3$6 = { key: 1 };
|
|
500
503
|
const _hoisted_4$5 = ["innerHTML"];
|
|
@@ -508,7 +511,7 @@
|
|
|
508
511
|
};
|
|
509
512
|
const _hoisted_10$1 = { style: { "flex": "1" } };
|
|
510
513
|
const _hoisted_11 = ["src"];
|
|
511
|
-
function _sfc_render$
|
|
514
|
+
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
512
515
|
const _component_el_checkbox = vue.resolveComponent("el-checkbox");
|
|
513
516
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
514
517
|
return (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model) ? (vue.openBlock(), vue.createElementBlock("fieldset", {
|
|
@@ -528,7 +531,7 @@
|
|
|
528
531
|
default: vue.withCtx(() => [
|
|
529
532
|
vue.createElementVNode("span", {
|
|
530
533
|
innerHTML: _ctx.config.legend
|
|
531
|
-
}, null, 8, _hoisted_1$
|
|
534
|
+
}, null, 8, _hoisted_1$e),
|
|
532
535
|
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
533
536
|
key: 0,
|
|
534
537
|
innerHTML: _ctx.config.extra,
|
|
@@ -600,9 +603,9 @@
|
|
|
600
603
|
}), 128)) : vue.createCommentVNode("", true)
|
|
601
604
|
], 4)) : vue.createCommentVNode("", true);
|
|
602
605
|
}
|
|
603
|
-
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
606
|
+
var Fieldset = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$p]]);
|
|
604
607
|
|
|
605
|
-
const _sfc_main$
|
|
608
|
+
const _sfc_main$r = vue.defineComponent({
|
|
606
609
|
name: "m-form-group-list-item",
|
|
607
610
|
components: { CaretRight: icons.CaretRight, CaretBottom: icons.CaretBottom },
|
|
608
611
|
props: {
|
|
@@ -686,11 +689,11 @@
|
|
|
686
689
|
};
|
|
687
690
|
}
|
|
688
691
|
});
|
|
689
|
-
const _hoisted_1$
|
|
692
|
+
const _hoisted_1$d = { class: "m-fields-group-list-item" };
|
|
690
693
|
const _hoisted_2$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0A\u79FB");
|
|
691
694
|
const _hoisted_3$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0B\u79FB");
|
|
692
695
|
const _hoisted_4$4 = ["innerHTML"];
|
|
693
|
-
function _sfc_render$
|
|
696
|
+
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
694
697
|
const _component_caret_bottom = vue.resolveComponent("caret-bottom");
|
|
695
698
|
const _component_caret_right = vue.resolveComponent("caret-right");
|
|
696
699
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
@@ -698,7 +701,7 @@
|
|
|
698
701
|
const _component_CaretRight = vue.resolveComponent("CaretRight");
|
|
699
702
|
const _component_CaretBottom = vue.resolveComponent("CaretBottom");
|
|
700
703
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
701
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
704
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
|
|
702
705
|
vue.createElementVNode("div", null, [
|
|
703
706
|
vue.createVNode(_component_el_icon, {
|
|
704
707
|
style: { "margin-right": "7px" },
|
|
@@ -710,7 +713,7 @@
|
|
|
710
713
|
_: 1
|
|
711
714
|
}, 8, ["onClick"]),
|
|
712
715
|
vue.createVNode(_component_el_button, {
|
|
713
|
-
|
|
716
|
+
text: "",
|
|
714
717
|
onClick: _ctx.expandHandler
|
|
715
718
|
}, {
|
|
716
719
|
default: vue.withCtx(() => [
|
|
@@ -719,7 +722,7 @@
|
|
|
719
722
|
_: 1
|
|
720
723
|
}, 8, ["onClick"]),
|
|
721
724
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
722
|
-
|
|
725
|
+
text: "",
|
|
723
726
|
icon: _ctx.Delete,
|
|
724
727
|
style: { "color": "#f56c6c" },
|
|
725
728
|
onClick: _ctx.removeHandler
|
|
@@ -728,7 +731,7 @@
|
|
|
728
731
|
]),
|
|
729
732
|
_ctx.movable() ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
730
733
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
731
|
-
|
|
734
|
+
text: "",
|
|
732
735
|
size: "small",
|
|
733
736
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.changeOrder(-1))
|
|
734
737
|
}, {
|
|
@@ -746,7 +749,7 @@
|
|
|
746
749
|
[vue.vShow, _ctx.index !== 0]
|
|
747
750
|
]),
|
|
748
751
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
749
|
-
|
|
752
|
+
text: "",
|
|
750
753
|
size: "small",
|
|
751
754
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.changeOrder(1))
|
|
752
755
|
}, {
|
|
@@ -781,9 +784,9 @@
|
|
|
781
784
|
}, null, 8, ["config", "model", "labelWidth", "prop", "size", "onChange"])) : vue.createCommentVNode("", true)
|
|
782
785
|
]);
|
|
783
786
|
}
|
|
784
|
-
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
787
|
+
var MFieldsGroupListItem = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$o]]);
|
|
785
788
|
|
|
786
|
-
const _sfc_main$
|
|
789
|
+
const _sfc_main$q = vue.defineComponent({
|
|
787
790
|
name: "m-form-group-list",
|
|
788
791
|
components: { MFieldsGroupListItem },
|
|
789
792
|
props: {
|
|
@@ -875,7 +878,7 @@
|
|
|
875
878
|
};
|
|
876
879
|
}
|
|
877
880
|
});
|
|
878
|
-
const _hoisted_1$
|
|
881
|
+
const _hoisted_1$c = { class: "m-fields-group-list" };
|
|
879
882
|
const _hoisted_2$4 = ["innerHTML"];
|
|
880
883
|
const _hoisted_3$4 = {
|
|
881
884
|
key: 1,
|
|
@@ -887,10 +890,10 @@
|
|
|
887
890
|
];
|
|
888
891
|
const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0\u7EC4");
|
|
889
892
|
const _hoisted_7$1 = /* @__PURE__ */ vue.createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
|
|
890
|
-
function _sfc_render$
|
|
893
|
+
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
891
894
|
const _component_m_fields_group_list_item = vue.resolveComponent("m-fields-group-list-item");
|
|
892
895
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
893
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
896
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
894
897
|
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
895
898
|
key: 0,
|
|
896
899
|
innerHTML: _ctx.config.extra,
|
|
@@ -934,9 +937,9 @@
|
|
|
934
937
|
}, 8, ["onClick"])) : vue.createCommentVNode("", true)
|
|
935
938
|
]);
|
|
936
939
|
}
|
|
937
|
-
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
940
|
+
var GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$n]]);
|
|
938
941
|
|
|
939
|
-
const _sfc_main$
|
|
942
|
+
const _sfc_main$p = vue.defineComponent({
|
|
940
943
|
name: "m-form-panel",
|
|
941
944
|
components: { CaretBottom: icons.CaretBottom, CaretRight: icons.CaretRight },
|
|
942
945
|
props: {
|
|
@@ -969,7 +972,7 @@
|
|
|
969
972
|
};
|
|
970
973
|
}
|
|
971
974
|
});
|
|
972
|
-
const _hoisted_1$
|
|
975
|
+
const _hoisted_1$b = { class: "clearfix" };
|
|
973
976
|
const _hoisted_2$3 = ["innerHTML"];
|
|
974
977
|
const _hoisted_3$3 = {
|
|
975
978
|
key: 0,
|
|
@@ -977,7 +980,7 @@
|
|
|
977
980
|
};
|
|
978
981
|
const _hoisted_4$2 = { style: { "flex": "1" } };
|
|
979
982
|
const _hoisted_5$1 = ["src"];
|
|
980
|
-
function _sfc_render$
|
|
983
|
+
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
981
984
|
const _component_caret_bottom = vue.resolveComponent("caret-bottom");
|
|
982
985
|
const _component_caret_right = vue.resolveComponent("caret-right");
|
|
983
986
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
@@ -989,7 +992,7 @@
|
|
|
989
992
|
"body-style": { display: _ctx.expand ? "block" : "none" }
|
|
990
993
|
}, {
|
|
991
994
|
header: vue.withCtx(() => [
|
|
992
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
995
|
+
vue.createElementVNode("div", _hoisted_1$b, [
|
|
993
996
|
vue.createElementVNode("a", {
|
|
994
997
|
href: "javascript:",
|
|
995
998
|
style: { "width": "100%", "display": "block" },
|
|
@@ -1047,10 +1050,60 @@
|
|
|
1047
1050
|
_: 3
|
|
1048
1051
|
}, 8, ["body-style"])) : vue.createCommentVNode("", true);
|
|
1049
1052
|
}
|
|
1050
|
-
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1053
|
+
var Panel = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$m]]);
|
|
1054
|
+
|
|
1055
|
+
const _sfc_main$o = vue.defineComponent({
|
|
1056
|
+
props: {
|
|
1057
|
+
labelWidth: String,
|
|
1058
|
+
expandMore: Boolean,
|
|
1059
|
+
span: Number,
|
|
1060
|
+
model: {
|
|
1061
|
+
type: Object,
|
|
1062
|
+
default: () => ({})
|
|
1063
|
+
},
|
|
1064
|
+
config: {
|
|
1065
|
+
type: Object,
|
|
1066
|
+
default: () => ({})
|
|
1067
|
+
},
|
|
1068
|
+
prop: String,
|
|
1069
|
+
size: String
|
|
1070
|
+
},
|
|
1071
|
+
emits: ["change"],
|
|
1072
|
+
setup(props, { emit }) {
|
|
1073
|
+
const mForm = vue.inject("mForm");
|
|
1074
|
+
const changeHandler = () => emit("change", props.model);
|
|
1075
|
+
return {
|
|
1076
|
+
mForm,
|
|
1077
|
+
display: vue.computed(() => display(mForm, props.config.display, props)),
|
|
1078
|
+
changeHandler
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1083
|
+
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
1084
|
+
const _component_el_col = vue.resolveComponent("el-col");
|
|
1085
|
+
return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_el_col, { span: _ctx.span }, {
|
|
1086
|
+
default: vue.withCtx(() => [
|
|
1087
|
+
vue.createVNode(_component_m_form_container, {
|
|
1088
|
+
model: _ctx.model,
|
|
1089
|
+
config: _ctx.config,
|
|
1090
|
+
prop: _ctx.prop,
|
|
1091
|
+
"label-width": _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1092
|
+
"expand-more": _ctx.expandMore,
|
|
1093
|
+
size: _ctx.size,
|
|
1094
|
+
onChange: _ctx.changeHandler
|
|
1095
|
+
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1096
|
+
]),
|
|
1097
|
+
_: 1
|
|
1098
|
+
}, 8, ["span"])), [
|
|
1099
|
+
[vue.vShow, _ctx.display && _ctx.config.type !== "hidden"]
|
|
1100
|
+
]);
|
|
1101
|
+
}
|
|
1102
|
+
var Col = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$l]]);
|
|
1051
1103
|
|
|
1052
1104
|
const _sfc_main$n = vue.defineComponent({
|
|
1053
1105
|
name: "m-form-row",
|
|
1106
|
+
components: { Col },
|
|
1054
1107
|
props: {
|
|
1055
1108
|
labelWidth: String,
|
|
1056
1109
|
expandMore: Boolean,
|
|
@@ -1072,38 +1125,27 @@
|
|
|
1072
1125
|
const changeHandler = () => emit("change", props.name ? props.model[props.name] : props.model);
|
|
1073
1126
|
return {
|
|
1074
1127
|
mForm,
|
|
1075
|
-
display(config) {
|
|
1076
|
-
return display(mForm, config.display, props);
|
|
1077
|
-
},
|
|
1078
1128
|
changeHandler
|
|
1079
1129
|
};
|
|
1080
1130
|
}
|
|
1081
1131
|
});
|
|
1082
1132
|
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1083
|
-
const
|
|
1084
|
-
const _component_el_col = vue.resolveComponent("el-col");
|
|
1133
|
+
const _component_Col = vue.resolveComponent("Col");
|
|
1085
1134
|
const _component_el_row = vue.resolveComponent("el-row");
|
|
1086
1135
|
return vue.openBlock(), vue.createBlock(_component_el_row, { gutter: 10 }, {
|
|
1087
1136
|
default: vue.withCtx(() => [
|
|
1088
1137
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (col, index) => {
|
|
1089
|
-
return vue.openBlock(), vue.createBlock(
|
|
1090
|
-
style: vue.normalizeStyle(!_ctx.display(col) || col.type === "hidden" ? "display: none" : ""),
|
|
1138
|
+
return vue.openBlock(), vue.createBlock(_component_Col, {
|
|
1091
1139
|
key: col[_ctx.mForm?.keyProp || "__key"] ?? index,
|
|
1092
|
-
span: col.span || _ctx.config.span || 24 / _ctx.config.items.length
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
size: _ctx.size,
|
|
1102
|
-
onChange: _ctx.changeHandler
|
|
1103
|
-
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "onChange"])
|
|
1104
|
-
]),
|
|
1105
|
-
_: 2
|
|
1106
|
-
}, 1032, ["style", "span"]);
|
|
1140
|
+
span: col.span || _ctx.config.span || 24 / _ctx.config.items.length,
|
|
1141
|
+
config: col,
|
|
1142
|
+
labelWidth: _ctx.config.labelWidth || _ctx.labelWidth,
|
|
1143
|
+
expandMore: _ctx.expandMore,
|
|
1144
|
+
model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
|
|
1145
|
+
prop: _ctx.prop,
|
|
1146
|
+
size: _ctx.size,
|
|
1147
|
+
onChange: _ctx.changeHandler
|
|
1148
|
+
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size", "onChange"]);
|
|
1107
1149
|
}), 128))
|
|
1108
1150
|
]),
|
|
1109
1151
|
_: 1
|
|
@@ -1562,7 +1604,7 @@
|
|
|
1562
1604
|
};
|
|
1563
1605
|
}
|
|
1564
1606
|
});
|
|
1565
|
-
const _hoisted_1$
|
|
1607
|
+
const _hoisted_1$a = ["innerHTML"];
|
|
1566
1608
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1567
1609
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1568
1610
|
const _hoisted_4$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0");
|
|
@@ -1591,7 +1633,7 @@
|
|
|
1591
1633
|
key: 0,
|
|
1592
1634
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1593
1635
|
innerHTML: _ctx.config.extra
|
|
1594
|
-
}, null, 8, _hoisted_1$
|
|
1636
|
+
}, null, 8, _hoisted_1$a)) : vue.createCommentVNode("", true),
|
|
1595
1637
|
vue.createElementVNode("div", _hoisted_2$2, [
|
|
1596
1638
|
vue.createVNode(_component_el_tooltip, {
|
|
1597
1639
|
content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
|
|
@@ -1632,8 +1674,8 @@
|
|
|
1632
1674
|
}, {
|
|
1633
1675
|
default: vue.withCtx((scope) => [
|
|
1634
1676
|
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
1635
|
-
|
|
1636
|
-
|
|
1677
|
+
type: "danger",
|
|
1678
|
+
text: "",
|
|
1637
1679
|
icon: _ctx.Delete,
|
|
1638
1680
|
onClick: ($event) => _ctx.removeHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1639
1681
|
}, null, 8, ["icon", "onClick"]), [
|
|
@@ -1657,8 +1699,9 @@
|
|
|
1657
1699
|
vue.createVNode(_component_el_button, {
|
|
1658
1700
|
plain: "",
|
|
1659
1701
|
size: "small",
|
|
1702
|
+
type: "primary",
|
|
1660
1703
|
icon: _ctx.ArrowUp,
|
|
1661
|
-
|
|
1704
|
+
text: "",
|
|
1662
1705
|
onClick: ($event) => _ctx.upHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1663
1706
|
onDblclick: ($event) => _ctx.topHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1664
1707
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1674,8 +1717,9 @@
|
|
|
1674
1717
|
vue.createVNode(_component_el_button, {
|
|
1675
1718
|
plain: "",
|
|
1676
1719
|
size: "small",
|
|
1720
|
+
type: "primary",
|
|
1677
1721
|
icon: _ctx.ArrowDown,
|
|
1678
|
-
|
|
1722
|
+
text: "",
|
|
1679
1723
|
onClick: ($event) => _ctx.downHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1),
|
|
1680
1724
|
onDblclick: ($event) => _ctx.bottomHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1681
1725
|
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
@@ -1752,6 +1796,7 @@
|
|
|
1752
1796
|
key: 1,
|
|
1753
1797
|
icon: _ctx.Grid,
|
|
1754
1798
|
size: "small",
|
|
1799
|
+
type: "primary",
|
|
1755
1800
|
onClick: _ctx.toggleMode
|
|
1756
1801
|
}, {
|
|
1757
1802
|
default: vue.withCtx(() => [
|
|
@@ -1763,6 +1808,7 @@
|
|
|
1763
1808
|
key: 2,
|
|
1764
1809
|
icon: _ctx.FullScreen,
|
|
1765
1810
|
size: "small",
|
|
1811
|
+
type: "primary",
|
|
1766
1812
|
onClick: _ctx.toggleFullscreen
|
|
1767
1813
|
}, {
|
|
1768
1814
|
default: vue.withCtx(() => [
|
|
@@ -2113,13 +2159,13 @@
|
|
|
2113
2159
|
};
|
|
2114
2160
|
}
|
|
2115
2161
|
});
|
|
2116
|
-
const _hoisted_1$
|
|
2162
|
+
const _hoisted_1$9 = {
|
|
2117
2163
|
class: "m-cascader",
|
|
2118
2164
|
style: { "width": "100%" }
|
|
2119
2165
|
};
|
|
2120
2166
|
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2121
2167
|
const _component_el_cascader = vue.resolveComponent("el-cascader");
|
|
2122
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2168
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
2123
2169
|
vue.createVNode(_component_el_cascader, {
|
|
2124
2170
|
modelValue: _ctx.model[_ctx.name],
|
|
2125
2171
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2159,7 +2205,7 @@
|
|
|
2159
2205
|
} else {
|
|
2160
2206
|
return props.config.activeValue;
|
|
2161
2207
|
}
|
|
2162
|
-
return
|
|
2208
|
+
return void 0;
|
|
2163
2209
|
}),
|
|
2164
2210
|
inactiveValue: vue.computed(() => {
|
|
2165
2211
|
if (typeof props.config.inactiveValue === "undefined") {
|
|
@@ -2169,7 +2215,7 @@
|
|
|
2169
2215
|
} else {
|
|
2170
2216
|
return props.config.inactiveValue;
|
|
2171
2217
|
}
|
|
2172
|
-
return
|
|
2218
|
+
return void 0;
|
|
2173
2219
|
}),
|
|
2174
2220
|
changeHandler(value) {
|
|
2175
2221
|
emit("change", value);
|
|
@@ -2242,7 +2288,7 @@
|
|
|
2242
2288
|
}
|
|
2243
2289
|
var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$e]]);
|
|
2244
2290
|
|
|
2245
|
-
const _hoisted_1$
|
|
2291
|
+
const _hoisted_1$8 = { key: 0 };
|
|
2246
2292
|
const __default__$2 = vue.defineComponent({
|
|
2247
2293
|
name: "m-fields-color-picker"
|
|
2248
2294
|
});
|
|
@@ -2262,7 +2308,7 @@
|
|
|
2262
2308
|
const changeHandler = (value) => emit("change", value);
|
|
2263
2309
|
return (_ctx, _cache) => {
|
|
2264
2310
|
const _component_el_color_picker = vue.resolveComponent("el-color-picker");
|
|
2265
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2311
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
|
|
2266
2312
|
vue.createVNode(_component_el_color_picker, {
|
|
2267
2313
|
modelValue: _ctx.model[_ctx.name],
|
|
2268
2314
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2298,10 +2344,10 @@
|
|
|
2298
2344
|
};
|
|
2299
2345
|
}
|
|
2300
2346
|
});
|
|
2301
|
-
const _hoisted_1$
|
|
2347
|
+
const _hoisted_1$7 = { key: 0 };
|
|
2302
2348
|
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2303
2349
|
const _component_el_date_picker = vue.resolveComponent("el-date-picker");
|
|
2304
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2350
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
|
|
2305
2351
|
vue.createVNode(_component_el_date_picker, {
|
|
2306
2352
|
modelValue: _ctx.model[_ctx.modelName],
|
|
2307
2353
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.modelName] = $event),
|
|
@@ -2405,10 +2451,10 @@
|
|
|
2405
2451
|
};
|
|
2406
2452
|
}
|
|
2407
2453
|
});
|
|
2408
|
-
const _hoisted_1$
|
|
2454
|
+
const _hoisted_1$6 = { key: 0 };
|
|
2409
2455
|
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2410
2456
|
const _component_el_date_picker = vue.resolveComponent("el-date-picker");
|
|
2411
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2457
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
|
|
2412
2458
|
vue.createVNode(_component_el_date_picker, {
|
|
2413
2459
|
modelValue: _ctx.model[_ctx.name],
|
|
2414
2460
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
@@ -2425,7 +2471,7 @@
|
|
|
2425
2471
|
}
|
|
2426
2472
|
var DateTime = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
|
|
2427
2473
|
|
|
2428
|
-
const _hoisted_1$
|
|
2474
|
+
const _hoisted_1$5 = { key: 0 };
|
|
2429
2475
|
const __default__$1 = vue.defineComponent({
|
|
2430
2476
|
name: "m-fields-display"
|
|
2431
2477
|
});
|
|
@@ -2446,7 +2492,7 @@
|
|
|
2446
2492
|
}
|
|
2447
2493
|
useAddField(props.prop);
|
|
2448
2494
|
return (_ctx, _cache) => {
|
|
2449
|
-
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$
|
|
2495
|
+
return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$5, vue.toDisplayString(_ctx.model[vue.unref(n)]), 1)) : vue.createCommentVNode("", true);
|
|
2450
2496
|
};
|
|
2451
2497
|
}
|
|
2452
2498
|
});
|
|
@@ -2516,12 +2562,12 @@
|
|
|
2516
2562
|
}
|
|
2517
2563
|
}
|
|
2518
2564
|
});
|
|
2519
|
-
const _hoisted_1$
|
|
2565
|
+
const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
|
|
2520
2566
|
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2521
2567
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
2522
2568
|
const _component_el_form_item = vue.resolveComponent("el-form-item");
|
|
2523
2569
|
const _component_el_form = vue.resolveComponent("el-form");
|
|
2524
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2570
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
2525
2571
|
vue.createVNode(_component_el_form, { size: "small" }, {
|
|
2526
2572
|
default: vue.withCtx(() => [
|
|
2527
2573
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Object.keys(_ctx.fieldMap.value), (key) => {
|
|
@@ -2643,7 +2689,7 @@
|
|
|
2643
2689
|
};
|
|
2644
2690
|
}
|
|
2645
2691
|
});
|
|
2646
|
-
const _hoisted_1$
|
|
2692
|
+
const _hoisted_1$3 = ["href"];
|
|
2647
2693
|
const _hoisted_2$1 = {
|
|
2648
2694
|
key: 2,
|
|
2649
2695
|
class: "m-fields-link"
|
|
@@ -2657,12 +2703,13 @@
|
|
|
2657
2703
|
target: "_blank",
|
|
2658
2704
|
href: _ctx.href,
|
|
2659
2705
|
style: vue.normalizeStyle(_ctx.config.css || {})
|
|
2660
|
-
}, vue.toDisplayString(_ctx.displayText), 13, _hoisted_1$
|
|
2706
|
+
}, vue.toDisplayString(_ctx.displayText), 13, _hoisted_1$3)) : _ctx.config.href && _ctx.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
2661
2707
|
key: 1,
|
|
2662
2708
|
style: vue.normalizeStyle(_ctx.config.disabledCss || {})
|
|
2663
2709
|
}, vue.toDisplayString(_ctx.displayText), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
|
|
2664
2710
|
vue.createVNode(_component_el_button, {
|
|
2665
|
-
|
|
2711
|
+
text: "",
|
|
2712
|
+
type: "primary",
|
|
2666
2713
|
onClick: _ctx.editHandler
|
|
2667
2714
|
}, {
|
|
2668
2715
|
default: vue.withCtx(() => [
|
|
@@ -3043,7 +3090,7 @@
|
|
|
3043
3090
|
};
|
|
3044
3091
|
}
|
|
3045
3092
|
});
|
|
3046
|
-
const _hoisted_1$
|
|
3093
|
+
const _hoisted_1$2 = { key: 2 };
|
|
3047
3094
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3048
3095
|
const _component_el_option = vue.resolveComponent("el-option");
|
|
3049
3096
|
const _component_el_option_group = vue.resolveComponent("el-option-group");
|
|
@@ -3096,7 +3143,7 @@
|
|
|
3096
3143
|
disabled: option.disabled
|
|
3097
3144
|
}, null, 8, ["label", "value", "disabled"]);
|
|
3098
3145
|
}), 128)),
|
|
3099
|
-
_ctx.moreLoadingVisible ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3146
|
+
_ctx.moreLoadingVisible ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, null, 512)), [
|
|
3100
3147
|
[_directive_loading, true]
|
|
3101
3148
|
]) : vue.createCommentVNode("", true)
|
|
3102
3149
|
]),
|
|
@@ -3249,7 +3296,7 @@
|
|
|
3249
3296
|
};
|
|
3250
3297
|
}
|
|
3251
3298
|
});
|
|
3252
|
-
const _hoisted_1$
|
|
3299
|
+
const _hoisted_1$1 = { key: 0 };
|
|
3253
3300
|
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3254
3301
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
3255
3302
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
@@ -3267,7 +3314,7 @@
|
|
|
3267
3314
|
_ctx.config.append ? {
|
|
3268
3315
|
name: "append",
|
|
3269
3316
|
fn: vue.withCtx(() => [
|
|
3270
|
-
typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$
|
|
3317
|
+
typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$1, vue.toDisplayString(_ctx.config.append), 1)) : vue.createCommentVNode("", true),
|
|
3271
3318
|
typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (vue.openBlock(), vue.createBlock(_component_el_button, {
|
|
3272
3319
|
key: 1,
|
|
3273
3320
|
style: { "color": "#409eff" },
|
|
@@ -3317,22 +3364,19 @@
|
|
|
3317
3364
|
};
|
|
3318
3365
|
}
|
|
3319
3366
|
});
|
|
3320
|
-
const _hoisted_1$1 = { key: 0 };
|
|
3321
3367
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3322
3368
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
3323
|
-
return
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"])
|
|
3335
|
-
])) : vue.createCommentVNode("", true);
|
|
3369
|
+
return vue.openBlock(), vue.createBlock(_component_el_input, {
|
|
3370
|
+
modelValue: _ctx.model[_ctx.name],
|
|
3371
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
3372
|
+
type: "textarea",
|
|
3373
|
+
size: _ctx.size,
|
|
3374
|
+
clearable: "",
|
|
3375
|
+
placeholder: _ctx.config.placeholder,
|
|
3376
|
+
disabled: _ctx.disabled,
|
|
3377
|
+
onChange: _ctx.changeHandler,
|
|
3378
|
+
onInput: _ctx.inputHandler
|
|
3379
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "onChange", "onInput"]);
|
|
3336
3380
|
}
|
|
3337
3381
|
var Textarea = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
3338
3382
|
|
|
@@ -3480,7 +3524,7 @@
|
|
|
3480
3524
|
submitForm: async (native) => {
|
|
3481
3525
|
try {
|
|
3482
3526
|
await elForm.value?.validate();
|
|
3483
|
-
return native ? values.value : lodashEs.cloneDeep(values.value);
|
|
3527
|
+
return native ? values.value : lodashEs.cloneDeep(vue.toRaw(values.value));
|
|
3484
3528
|
} catch (invalidFields) {
|
|
3485
3529
|
const error = [];
|
|
3486
3530
|
Object.entries(invalidFields).forEach(([, ValidateError]) => {
|