@tmagic/form 1.3.0-alpha.9 → 1.3.0-beta.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.
Files changed (67) hide show
  1. package/dist/style.css +21 -0
  2. package/dist/tmagic-form.js +716 -388
  3. package/dist/tmagic-form.js.map +1 -1
  4. package/dist/tmagic-form.umd.cjs +744 -413
  5. package/dist/tmagic-form.umd.cjs.map +1 -1
  6. package/package.json +4 -4
  7. package/src/Form.vue +12 -4
  8. package/src/FormDialog.vue +19 -5
  9. package/src/FormDrawer.vue +159 -0
  10. package/src/containers/Container.vue +11 -10
  11. package/src/containers/GroupList.vue +1 -0
  12. package/src/containers/GroupListItem.vue +8 -2
  13. package/src/containers/Table.vue +148 -150
  14. package/src/fields/Cascader.vue +2 -12
  15. package/src/fields/Checkbox.vue +2 -12
  16. package/src/fields/CheckboxGroup.vue +2 -12
  17. package/src/fields/ColorPicker.vue +5 -13
  18. package/src/fields/Date.vue +6 -14
  19. package/src/fields/DateTime.vue +7 -15
  20. package/src/fields/Daterange.vue +2 -12
  21. package/src/fields/Display.vue +2 -10
  22. package/src/fields/DynamicField.vue +3 -13
  23. package/src/fields/Hidden.vue +2 -10
  24. package/src/fields/Link.vue +2 -12
  25. package/src/fields/Number.vue +7 -14
  26. package/src/fields/NumberRange.vue +50 -0
  27. package/src/fields/RadioGroup.vue +2 -12
  28. package/src/fields/Select.vue +2 -12
  29. package/src/fields/Switch.vue +6 -14
  30. package/src/fields/Text.vue +7 -14
  31. package/src/fields/Textarea.vue +7 -14
  32. package/src/fields/Time.vue +5 -13
  33. package/src/fields/Timerange.vue +76 -0
  34. package/src/index.ts +7 -0
  35. package/src/schema.ts +23 -2
  36. package/src/theme/form-drawer.scss +11 -0
  37. package/src/theme/index.scss +2 -0
  38. package/src/theme/number-range.scss +8 -0
  39. package/src/theme/panel.scss +6 -0
  40. package/src/utils/config.ts +1 -1
  41. package/src/utils/form.ts +2 -1
  42. package/types/Form.vue.d.ts +13 -11
  43. package/types/FormDialog.vue.d.ts +30 -17
  44. package/types/FormDrawer.vue.d.ts +348 -0
  45. package/types/fields/Cascader.vue.d.ts +2 -22
  46. package/types/fields/Checkbox.vue.d.ts +2 -22
  47. package/types/fields/CheckboxGroup.vue.d.ts +2 -22
  48. package/types/fields/ColorPicker.vue.d.ts +2 -24
  49. package/types/fields/Date.vue.d.ts +2 -24
  50. package/types/fields/DateTime.vue.d.ts +2 -24
  51. package/types/fields/Daterange.vue.d.ts +2 -22
  52. package/types/fields/Display.vue.d.ts +2 -18
  53. package/types/fields/DynamicField.vue.d.ts +2 -22
  54. package/types/fields/Hidden.vue.d.ts +2 -18
  55. package/types/fields/Link.vue.d.ts +2 -22
  56. package/types/fields/Number.vue.d.ts +2 -25
  57. package/types/fields/NumberRange.vue.d.ts +12 -0
  58. package/types/fields/RadioGroup.vue.d.ts +2 -22
  59. package/types/fields/Select.vue.d.ts +2 -22
  60. package/types/fields/Switch.vue.d.ts +2 -24
  61. package/types/fields/Text.vue.d.ts +2 -25
  62. package/types/fields/Textarea.vue.d.ts +2 -25
  63. package/types/fields/Time.vue.d.ts +2 -24
  64. package/types/fields/Timerange.vue.d.ts +14 -0
  65. package/types/index.d.ts +3 -0
  66. package/types/schema.d.ts +21 -2
  67. package/types/utils/config.d.ts +1 -1
@@ -90,7 +90,7 @@
90
90
  if (["switch", "checkbox"].includes(type)) {
91
91
  return false;
92
92
  }
93
- if (multiple) {
93
+ if (multiple || type === "number-range") {
94
94
  return [];
95
95
  }
96
96
  return "";
@@ -105,7 +105,8 @@
105
105
  parent: mForm?.parentValues || {},
106
106
  formValue: mForm?.values || props.model,
107
107
  prop: props.prop,
108
- config: props.config
108
+ config: props.config,
109
+ index: props.index
109
110
  });
110
111
  };
111
112
  const display = function(mForm, config, props) {
@@ -164,10 +165,10 @@
164
165
  return valuesTmp || {};
165
166
  };
166
167
 
167
- const _hoisted_1$b = ["innerHTML"];
168
- const _hoisted_2$6 = ["innerHTML"];
168
+ const _hoisted_1$d = ["innerHTML"];
169
+ const _hoisted_2$7 = ["innerHTML"];
169
170
  const _hoisted_3$4 = ["innerHTML"];
170
- const _hoisted_4$4 = ["innerHTML"];
171
+ const _hoisted_4$3 = ["innerHTML"];
171
172
  const _hoisted_5$3 = ["innerHTML"];
172
173
  const _hoisted_6$1 = ["innerHTML"];
173
174
  const _hoisted_7$1 = ["innerHTML"];
@@ -180,7 +181,7 @@
180
181
  key: 5,
181
182
  style: { "text-align": "center" }
182
183
  };
183
- const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
184
+ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
184
185
  ...{
185
186
  name: "MFormContainer"
186
187
  },
@@ -230,6 +231,7 @@
230
231
  return "m-fields-text";
231
232
  });
232
233
  const disabled = vue.computed(() => props.disabled || filterFunction(mForm, props.config.disabled, props));
234
+ const text = vue.computed(() => filterFunction(mForm, props.config.text, props));
233
235
  const tooltip = vue.computed(() => filterFunction(mForm, props.config.tooltip, props));
234
236
  const extra = vue.computed(() => filterFunction(mForm, props.config.extra, props));
235
237
  const rule = vue.computed(() => getRules(mForm, props.config.rules, props));
@@ -260,7 +262,7 @@
260
262
  (showDiff2) => {
261
263
  if (type.value === "hidden")
262
264
  return;
263
- if (items.value && !props.config.text && type.value && display$1.value)
265
+ if (items.value && !text.value && type.value && display$1.value)
264
266
  return;
265
267
  if (display$1.value && showDiff2 && type.value) {
266
268
  emit("addDiffCount");
@@ -328,7 +330,7 @@
328
330
  return _ctx.config ? (vue.openBlock(), vue.createElementBlock("div", {
329
331
  key: 0,
330
332
  style: vue.normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
331
- class: vue.normalizeClass([_ctx.config.className, "m-form-container"])
333
+ class: vue.normalizeClass(`m-form-container m-container-${type.value || ""} ${_ctx.config.className || ""}`)
332
334
  }, [
333
335
  type.value === "hidden" ? (vue.openBlock(), vue.createBlock(_component_m_fields_hidden, {
334
336
  key: 0,
@@ -337,7 +339,7 @@
337
339
  name: _ctx.config.name,
338
340
  disabled: disabled.value,
339
341
  prop: itemProp.value
340
- }, null, 8, ["model", "config", "name", "disabled", "prop"])) : items.value && !_ctx.config.text && type.value && display$1.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
342
+ }, null, 8, ["model", "config", "name", "disabled", "prop"])) : items.value && !text.value && type.value && display$1.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
341
343
  key: key(_ctx.config),
342
344
  size: _ctx.size,
343
345
  model: _ctx.model,
@@ -355,20 +357,20 @@
355
357
  }, null, 40, ["size", "model", "last-values", "is-compare", "config", "disabled", "name", "prop", "step-active", "expand-more", "label-width"])) : type.value && display$1.value && !showDiff.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
356
358
  vue.createVNode(vue.unref(design.TMagicFormItem), {
357
359
  style: vue.normalizeStyle(_ctx.config.tip ? "flex: 1" : ""),
358
- class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !_ctx.config.text }),
360
+ class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !text.value }),
359
361
  prop: itemProp.value,
360
362
  "label-width": itemLabelWidth.value,
361
363
  rules: rule.value
362
364
  }, {
363
365
  label: vue.withCtx(() => [
364
366
  vue.createElementVNode("span", {
365
- innerHTML: type.value === "checkbox" ? "" : _ctx.config.text
366
- }, null, 8, _hoisted_1$b)
367
+ innerHTML: type.value === "checkbox" ? "" : text.value
368
+ }, null, 8, _hoisted_1$d)
367
369
  ]),
368
370
  default: vue.withCtx(() => [
369
371
  tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
370
372
  content: vue.withCtx(() => [
371
- vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_2$6)
373
+ vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_2$7)
372
374
  ]),
373
375
  default: vue.withCtx(() => [
374
376
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
@@ -412,7 +414,7 @@
412
414
  content: vue.withCtx(() => [
413
415
  vue.createElementVNode("div", {
414
416
  innerHTML: _ctx.config.tip
415
- }, null, 8, _hoisted_4$4)
417
+ }, null, 8, _hoisted_4$3)
416
418
  ]),
417
419
  default: vue.withCtx(() => [
418
420
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -427,14 +429,14 @@
427
429
  ], 64)) : type.value && display$1.value && showDiff.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
428
430
  vue.createVNode(vue.unref(design.TMagicFormItem), {
429
431
  style: vue.normalizeStyle([_ctx.config.tip ? "flex: 1" : "", { "background": "#f7dadd" }]),
430
- class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !_ctx.config.text }),
432
+ class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !text.value }),
431
433
  prop: itemProp.value,
432
434
  "label-width": itemLabelWidth.value,
433
435
  rules: rule.value
434
436
  }, {
435
437
  label: vue.withCtx(() => [
436
438
  vue.createElementVNode("span", {
437
- innerHTML: type.value === "checkbox" ? "" : _ctx.config.text
439
+ innerHTML: type.value === "checkbox" ? "" : text.value
438
440
  }, null, 8, _hoisted_5$3)
439
441
  ]),
440
442
  default: vue.withCtx(() => [
@@ -494,14 +496,14 @@
494
496
  })) : vue.createCommentVNode("", true),
495
497
  vue.createVNode(vue.unref(design.TMagicFormItem), {
496
498
  style: vue.normalizeStyle([_ctx.config.tip ? "flex: 1" : "", { "background": "#def7da" }]),
497
- class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !_ctx.config.text }),
499
+ class: vue.normalizeClass({ hidden: `${itemLabelWidth.value}` === "0" || !text.value }),
498
500
  prop: itemProp.value,
499
501
  "label-width": itemLabelWidth.value,
500
502
  rules: rule.value
501
503
  }, {
502
504
  label: vue.withCtx(() => [
503
505
  vue.createElementVNode("span", {
504
- innerHTML: type.value === "checkbox" ? "" : _ctx.config.text
506
+ innerHTML: type.value === "checkbox" ? "" : text.value
505
507
  }, null, 8, _hoisted_9)
506
508
  ]),
507
509
  default: vue.withCtx(() => [
@@ -597,10 +599,10 @@
597
599
  }
598
600
  });
599
601
 
600
- const _hoisted_1$a = ["innerHTML"];
601
- const _hoisted_2$5 = ["innerHTML"];
602
+ const _hoisted_1$c = ["innerHTML"];
603
+ const _hoisted_2$6 = ["innerHTML"];
602
604
  const _hoisted_3$3 = { key: 1 };
603
- const _hoisted_4$3 = ["innerHTML"];
605
+ const _hoisted_4$2 = ["innerHTML"];
604
606
  const _hoisted_5$2 = ["innerHTML"];
605
607
  const _hoisted_6 = {
606
608
  key: 2,
@@ -608,7 +610,7 @@
608
610
  };
609
611
  const _hoisted_7 = { style: { "flex": "1" } };
610
612
  const _hoisted_8 = ["src"];
611
- const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
613
+ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
612
614
  ...{
613
615
  name: "MFormFieldset"
614
616
  },
@@ -667,12 +669,12 @@
667
669
  default: vue.withCtx(() => [
668
670
  vue.createElementVNode("span", {
669
671
  innerHTML: _ctx.config.legend
670
- }, null, 8, _hoisted_1$a),
672
+ }, null, 8, _hoisted_1$c),
671
673
  _ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
672
674
  key: 0,
673
675
  innerHTML: _ctx.config.extra,
674
676
  class: "m-form-tip"
675
- }, null, 8, _hoisted_2$5)) : vue.createCommentVNode("", true)
677
+ }, null, 8, _hoisted_2$6)) : vue.createCommentVNode("", true)
676
678
  ]),
677
679
  _: 1
678
680
  }, 8, ["modelValue", "prop"])
@@ -681,7 +683,7 @@
681
683
  })) : (vue.openBlock(), vue.createElementBlock("legend", _hoisted_3$3, [
682
684
  vue.createElementVNode("span", {
683
685
  innerHTML: _ctx.config.legend
684
- }, null, 8, _hoisted_4$3),
686
+ }, null, 8, _hoisted_4$2),
685
687
  _ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
686
688
  key: 0,
687
689
  innerHTML: _ctx.config.extra,
@@ -691,7 +693,7 @@
691
693
  _ctx.config.schematic && show.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
692
694
  vue.createElementVNode("div", _hoisted_7, [
693
695
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (item, index) => {
694
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
696
+ return vue.openBlock(), vue.createBlock(_sfc_main$y, {
695
697
  key: key(item, index),
696
698
  model: name.value ? _ctx.model[name.value] : _ctx.model,
697
699
  lastValues: name.value ? _ctx.lastValues[name.value] : _ctx.lastValues,
@@ -712,7 +714,7 @@
712
714
  src: _ctx.config.schematic
713
715
  }, null, 8, _hoisted_8)
714
716
  ])) : show.value ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList(_ctx.config.items, (item, index) => {
715
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
717
+ return vue.openBlock(), vue.createBlock(_sfc_main$y, {
716
718
  key: key(item, index),
717
719
  model: name.value ? _ctx.model[name.value] : _ctx.model,
718
720
  lastValues: name.value ? _ctx.lastValues[name.value] : _ctx.lastValues,
@@ -732,9 +734,9 @@
732
734
  }
733
735
  });
734
736
 
735
- const _hoisted_1$9 = { class: "m-fields-group-list-item" };
736
- const _hoisted_2$4 = ["innerHTML"];
737
- const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
737
+ const _hoisted_1$b = { class: "m-fields-group-list-item" };
738
+ const _hoisted_2$5 = ["innerHTML"];
739
+ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
738
740
  ...{
739
741
  name: "MFormGroupListItem"
740
742
  },
@@ -767,7 +769,11 @@
767
769
  if (props.config.titleKey && props.model[props.config.titleKey]) {
768
770
  return props.model[props.config.titleKey];
769
771
  }
770
- return `组 ${String(props.index)}`;
772
+ if (props.config.title) {
773
+ return filterFunction(mForm, props.config.title, props);
774
+ }
775
+ const titlePrefix = props.config.titlePrefix || "组";
776
+ return `${titlePrefix} ${String(props.index + 1)}`;
771
777
  });
772
778
  const length = vue.computed(() => props.groupModel?.length || 0);
773
779
  const itemExtra = vue.computed(() => filterFunction(mForm, props.config.itemExtra, props));
@@ -783,7 +789,7 @@
783
789
  }
784
790
  return true;
785
791
  };
786
- const changeOrder = (offset = 0) => emit("swap-item", props.index, `${String(props.index)}${offset}`);
792
+ const changeOrder = (offset = 0) => emit("swap-item", props.index, props.index + offset);
787
793
  const movable = () => {
788
794
  const { movable: movable2 } = props.config;
789
795
  if (movable2 === void 0)
@@ -795,7 +801,7 @@
795
801
  };
796
802
  const onAddDiffCount = () => emit("addDiffCount");
797
803
  return (_ctx, _cache) => {
798
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
804
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
799
805
  vue.createElementVNode("div", null, [
800
806
  vue.createVNode(vue.unref(design.TMagicButton), {
801
807
  text: "",
@@ -861,9 +867,9 @@
861
867
  key: 1,
862
868
  innerHTML: itemExtra.value,
863
869
  class: "m-form-tip"
864
- }, null, 8, _hoisted_2$4)) : vue.createCommentVNode("", true)
870
+ }, null, 8, _hoisted_2$5)) : vue.createCommentVNode("", true)
865
871
  ]),
866
- expand.value ? (vue.openBlock(), vue.createBlock(_sfc_main$v, {
872
+ expand.value ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
867
873
  key: 0,
868
874
  config: rowConfig.value,
869
875
  model: _ctx.model,
@@ -881,17 +887,17 @@
881
887
  }
882
888
  });
883
889
 
884
- const _hoisted_1$8 = { class: "m-fields-group-list" };
885
- const _hoisted_2$3 = ["innerHTML"];
890
+ const _hoisted_1$a = { class: "m-fields-group-list" };
891
+ const _hoisted_2$4 = ["innerHTML"];
886
892
  const _hoisted_3$2 = {
887
893
  key: 1,
888
894
  class: "el-table__empty-block"
889
895
  };
890
- const _hoisted_4$2 = /* @__PURE__ */ vue.createElementVNode("span", { class: "el-table__empty-text" }, "暂无数据", -1);
896
+ const _hoisted_4$1 = /* @__PURE__ */ vue.createElementVNode("span", { class: "el-table__empty-text" }, "暂无数据", -1);
891
897
  const _hoisted_5$1 = [
892
- _hoisted_4$2
898
+ _hoisted_4$1
893
899
  ];
894
- const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
900
+ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
895
901
  ...{
896
902
  name: "MFormGroupList"
897
903
  },
@@ -974,14 +980,14 @@
974
980
  const onAddDiffCount = () => emit("addDiffCount");
975
981
  const getLastValues = (item, index) => item?.[index] || {};
976
982
  return (_ctx, _cache) => {
977
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
983
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
978
984
  _ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("div", {
979
985
  key: 0,
980
986
  innerHTML: _ctx.config.extra,
981
987
  style: { "color": "rgba(0, 0, 0, 0.45)" }
982
- }, null, 8, _hoisted_2$3)) : vue.createCommentVNode("", true),
988
+ }, null, 8, _hoisted_2$4)) : vue.createCommentVNode("", true),
983
989
  !_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, _hoisted_5$1)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(_ctx.model[_ctx.name], (item, index) => {
984
- return vue.openBlock(), vue.createBlock(_sfc_main$t, {
990
+ return vue.openBlock(), vue.createBlock(_sfc_main$w, {
985
991
  key: index,
986
992
  model: item,
987
993
  lastValues: getLastValues(_ctx.lastValues[_ctx.name], index),
@@ -1026,15 +1032,15 @@
1026
1032
  }
1027
1033
  });
1028
1034
 
1029
- const _hoisted_1$7 = { style: { "width": "100%", "display": "flex", "align-items": "center" } };
1030
- const _hoisted_2$2 = ["innerHTML"];
1035
+ const _hoisted_1$9 = { style: { "width": "100%", "display": "flex", "align-items": "center" } };
1036
+ const _hoisted_2$3 = ["innerHTML"];
1031
1037
  const _hoisted_3$1 = {
1032
1038
  key: 0,
1033
1039
  style: { "display": "flex" }
1034
1040
  };
1035
- const _hoisted_4$1 = { style: { "flex": "1" } };
1041
+ const _hoisted_4 = { style: { "flex": "1" } };
1036
1042
  const _hoisted_5 = ["src"];
1037
- const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
1043
+ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
1038
1044
  ...{
1039
1045
  name: "MFormPanel"
1040
1046
  },
@@ -1066,7 +1072,7 @@
1066
1072
  "body-style": { display: expand.value ? "block" : "none" }
1067
1073
  }, {
1068
1074
  header: vue.withCtx(() => [
1069
- vue.createElementVNode("div", _hoisted_1$7, [
1075
+ vue.createElementVNode("div", _hoisted_1$9, [
1070
1076
  vue.createVNode(vue.unref(design.TMagicButton), {
1071
1077
  style: { "padding": "0" },
1072
1078
  text: "",
@@ -1077,7 +1083,7 @@
1077
1083
  key: 0,
1078
1084
  innerHTML: _ctx.config.extra,
1079
1085
  class: "m-form-tip"
1080
- }, null, 8, _hoisted_2$2)) : vue.createCommentVNode("", true),
1086
+ }, null, 8, _hoisted_2$3)) : vue.createCommentVNode("", true),
1081
1087
  vue.renderSlot(_ctx.$slots, "header", {}, () => [
1082
1088
  vue.createTextVNode(vue.toDisplayString(filter(_ctx.config.title)), 1)
1083
1089
  ])
@@ -1087,9 +1093,9 @@
1087
1093
  vue.createElementVNode("div", null, [
1088
1094
  vue.renderSlot(_ctx.$slots, "default"),
1089
1095
  _ctx.config.schematic ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
1090
- vue.createElementVNode("div", _hoisted_4$1, [
1096
+ vue.createElementVNode("div", _hoisted_4, [
1091
1097
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items.value, (item, index) => {
1092
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
1098
+ return vue.openBlock(), vue.createBlock(_sfc_main$y, {
1093
1099
  key: item[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1094
1100
  config: item,
1095
1101
  model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
@@ -1109,7 +1115,7 @@
1109
1115
  src: _ctx.config.schematic
1110
1116
  }, null, 8, _hoisted_5)
1111
1117
  ])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(items.value, (item, index) => {
1112
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
1118
+ return vue.openBlock(), vue.createBlock(_sfc_main$y, {
1113
1119
  key: item[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1114
1120
  config: item,
1115
1121
  model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
@@ -1131,7 +1137,7 @@
1131
1137
  }
1132
1138
  });
1133
1139
 
1134
- const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
1140
+ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
1135
1141
  ...{
1136
1142
  name: "MFormCol"
1137
1143
  },
@@ -1158,7 +1164,7 @@
1158
1164
  return (_ctx, _cache) => {
1159
1165
  return vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCol), { span: _ctx.span }, {
1160
1166
  default: vue.withCtx(() => [
1161
- vue.createVNode(_sfc_main$v, {
1167
+ vue.createVNode(_sfc_main$y, {
1162
1168
  model: _ctx.model,
1163
1169
  lastValues: _ctx.lastValues,
1164
1170
  "is-compare": _ctx.isCompare,
@@ -1180,7 +1186,7 @@
1180
1186
  }
1181
1187
  });
1182
1188
 
1183
- const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
1189
+ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
1184
1190
  ...{
1185
1191
  name: "MFormRow"
1186
1192
  },
@@ -1207,7 +1213,7 @@
1207
1213
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRow), { gutter: 10 }, {
1208
1214
  default: vue.withCtx(() => [
1209
1215
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (col, index) => {
1210
- return vue.openBlock(), vue.createBlock(_sfc_main$q, {
1216
+ return vue.openBlock(), vue.createBlock(_sfc_main$t, {
1211
1217
  key: col[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1212
1218
  span: col.span || _ctx.config.span || 24 / _ctx.config.items.length,
1213
1219
  config: col,
@@ -1230,7 +1236,7 @@
1230
1236
  }
1231
1237
  });
1232
1238
 
1233
- const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
1239
+ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
1234
1240
  ...{
1235
1241
  name: "MFormStep"
1236
1242
  },
@@ -1284,7 +1290,7 @@
1284
1290
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1285
1291
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(step.items, (item) => {
1286
1292
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1287
- item ? vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$v, {
1293
+ item ? vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$y, {
1288
1294
  key: item[vue.unref(mForm)?.keyProp || "__key"],
1289
1295
  config: item,
1290
1296
  model: step.name ? _ctx.model[step.name] : _ctx.model,
@@ -1308,15 +1314,14 @@
1308
1314
  }
1309
1315
  });
1310
1316
 
1311
- const _hoisted_1$6 = ["innerHTML"];
1312
- const _hoisted_2$1 = { class: "el-form-item__content" };
1313
- const _hoisted_3 = ["innerHTML"];
1314
- const _hoisted_4 = {
1315
- key: 1,
1317
+ const _hoisted_1$8 = ["innerHTML"];
1318
+ const _hoisted_2$2 = ["innerHTML"];
1319
+ const _hoisted_3 = {
1320
+ key: 6,
1316
1321
  class: "bottom",
1317
1322
  style: { "text-align": "right" }
1318
1323
  };
1319
- const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
1324
+ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
1320
1325
  ...{
1321
1326
  name: "MFormTable"
1322
1327
  },
@@ -1671,246 +1676,244 @@
1671
1676
  key: 0,
1672
1677
  style: { "color": "rgba(0, 0, 0, 0.45)" },
1673
1678
  innerHTML: _ctx.config.extra
1674
- }, null, 8, _hoisted_1$6)) : vue.createCommentVNode("", true),
1675
- vue.createElementVNode("div", _hoisted_2$1, [
1676
- vue.createVNode(vue.unref(design.TMagicTooltip), {
1677
- content: "拖拽可排序",
1678
- placement: "left-start",
1679
- disabled: _ctx.config.dropSort !== true
1680
- }, {
1681
- default: vue.withCtx(() => [
1682
- _ctx.model[modelName.value] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTable), {
1683
- ref_key: "tMagicTable",
1684
- ref: tMagicTable,
1685
- style: { "width": "100%" },
1686
- "row-key": _ctx.config.rowKey || "id",
1687
- data: data.value,
1688
- lastData: lastData.value,
1689
- border: _ctx.config.border,
1690
- "max-height": _ctx.config.maxHeight,
1691
- "default-expand-all": true,
1692
- key: updateKey.value,
1693
- onSelect: selectHandle,
1694
- onSortChange: sortChange
1695
- }, {
1696
- default: vue.withCtx(() => [
1697
- _ctx.config.itemExtra ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1698
- key: 0,
1699
- fixed: "left",
1700
- width: "30",
1701
- type: "expand"
1702
- }, {
1703
- default: vue.withCtx((scope) => [
1704
- vue.createElementVNode("span", {
1705
- innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
1706
- class: "m-form-tip"
1707
- }, null, 8, _hoisted_3)
1708
- ]),
1709
- _: 1
1710
- })) : vue.createCommentVNode("", true),
1711
- vue.createVNode(vue.unref(design.TMagicTableColumn), {
1712
- label: "操作",
1713
- width: _ctx.config.operateColWidth || 55,
1714
- align: "center",
1715
- fixed: _ctx.config.fixed === false ? void 0 : "left"
1716
- }, {
1717
- default: vue.withCtx((scope) => [
1718
- vue.renderSlot(_ctx.$slots, "operateCol", { scope }),
1719
- vue.withDirectives(vue.createVNode(vue.unref(design.TMagicIcon), {
1720
- class: "m-table-delete-icon",
1721
- onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1722
- }, {
1723
- default: vue.withCtx(() => [
1724
- vue.createVNode(vue.unref(iconsVue.Delete))
1725
- ]),
1726
- _: 2
1727
- }, 1032, ["onClick"]), [
1728
- [vue.vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
1729
- ])
1730
- ]),
1731
- _: 3
1732
- }, 8, ["width", "fixed"]),
1733
- _ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1734
- key: 1,
1735
- label: "排序",
1736
- width: "60"
1737
- }, {
1738
- default: vue.withCtx((scope) => [
1739
- scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1740
- key: 0,
1741
- content: "点击上移,双击置顶",
1742
- placement: "top"
1743
- }, {
1744
- default: vue.withCtx(() => [
1745
- vue.createVNode(vue.unref(design.TMagicButton), {
1746
- plain: "",
1747
- size: "small",
1748
- type: "primary",
1749
- icon: vue.unref(iconsVue.ArrowUp),
1750
- disabled: _ctx.disabled,
1751
- text: "",
1752
- onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1753
- onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1754
- }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1755
- ]),
1756
- _: 2
1757
- }, 1024)) : vue.createCommentVNode("", true),
1758
- scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1759
- key: 1,
1760
- content: "点击下移,双击置底",
1761
- placement: "top"
1762
- }, {
1763
- default: vue.withCtx(() => [
1764
- vue.createVNode(vue.unref(design.TMagicButton), {
1765
- plain: "",
1766
- size: "small",
1767
- type: "primary",
1768
- icon: vue.unref(iconsVue.ArrowDown),
1769
- disabled: _ctx.disabled,
1770
- text: "",
1771
- onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1772
- onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1773
- }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1774
- ]),
1775
- _: 2
1776
- }, 1024)) : vue.createCommentVNode("", true)
1777
- ]),
1778
- _: 1
1779
- })) : vue.createCommentVNode("", true),
1780
- selection.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1781
- key: 2,
1782
- align: "center",
1783
- "header-align": "center",
1784
- type: "selection",
1785
- width: "45"
1786
- })) : vue.createCommentVNode("", true),
1787
- _ctx.showIndex && _ctx.config.showIndex ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1788
- key: 3,
1789
- width: "60",
1790
- label: "序号"
1791
- }, {
1792
- default: vue.withCtx((scope) => [
1793
- vue.createTextVNode(vue.toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
1794
- ]),
1795
- _: 1
1796
- })) : vue.createCommentVNode("", true),
1797
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (column, index) => {
1798
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1799
- column.type !== "hidden" && display$1(column.display) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1800
- prop: column.name,
1801
- width: column.width,
1802
- label: column.label,
1803
- sortable: column.sortable,
1804
- "sort-orders": ["ascending", "descending"],
1805
- key: column[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1806
- "class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
1807
- }, {
1808
- default: vue.withCtx((scope) => [
1809
- scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$v, {
1810
- key: 0,
1811
- labelWidth: "0",
1812
- disabled: _ctx.disabled,
1813
- prop: getProp(scope.$index),
1814
- rules: column.rules,
1815
- config: makeConfig(column, scope.row),
1816
- model: scope.row,
1817
- lastValues: lastData.value[scope.$index],
1818
- "is-compare": _ctx.isCompare,
1819
- size: _ctx.size,
1820
- onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", _ctx.model[modelName.value])),
1821
- onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1822
- }, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : vue.createCommentVNode("", true)
1823
- ]),
1824
- _: 2
1825
- }, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
1826
- ], 64);
1827
- }), 256))
1828
- ]),
1829
- _: 3
1830
- }, 8, ["row-key", "data", "lastData", "border", "max-height"])) : vue.createCommentVNode("", true)
1831
- ]),
1832
- _: 3
1833
- }, 8, ["disabled"]),
1834
- vue.renderSlot(_ctx.$slots, "default"),
1835
- addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1836
- key: 0,
1837
- size: "small",
1838
- type: "primary",
1839
- disabled: _ctx.disabled,
1840
- plain: "",
1841
- onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
1842
- }, {
1843
- default: vue.withCtx(() => [
1844
- vue.createTextVNode("新增一行")
1845
- ]),
1846
- _: 1
1847
- }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1848
- vue.createTextVNode("   "),
1849
- _ctx.enableToggleMode && !isFullscreen.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1850
- key: 1,
1851
- icon: vue.unref(iconsVue.Grid),
1852
- size: "small",
1853
- type: "primary",
1854
- onClick: toggleMode
1855
- }, {
1856
- default: vue.withCtx(() => [
1857
- vue.createTextVNode("展开配置")
1858
- ]),
1859
- _: 1
1860
- }, 8, ["icon"])) : vue.createCommentVNode("", true),
1861
- _ctx.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1862
- key: 2,
1863
- icon: vue.unref(iconsVue.FullScreen),
1864
- size: "small",
1865
- type: "primary",
1866
- onClick: toggleFullscreen
1867
- }, {
1868
- default: vue.withCtx(() => [
1869
- vue.createTextVNode(vue.toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
1870
- ]),
1871
- _: 1
1872
- }, 8, ["icon"])) : vue.createCommentVNode("", true),
1873
- importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
1874
- key: 3,
1875
- style: { "display": "inline-block" },
1876
- ref_key: "excelBtn",
1877
- ref: excelBtn,
1878
- action: "/noop",
1879
- disabled: _ctx.disabled,
1880
- "on-change": excelHandler,
1881
- "auto-upload": false
1882
- }, {
1883
- default: vue.withCtx(() => [
1884
- vue.createVNode(vue.unref(design.TMagicButton), {
1885
- size: "small",
1886
- type: "success",
1887
- disabled: _ctx.disabled,
1888
- plain: ""
1889
- }, {
1890
- default: vue.withCtx(() => [
1891
- vue.createTextVNode("导入EXCEL")
1892
- ]),
1893
- _: 1
1894
- }, 8, ["disabled"])
1895
- ]),
1896
- _: 1
1897
- }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1898
- vue.createTextVNode("  "),
1899
- importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1900
- key: 4,
1901
- size: "small",
1902
- type: "warning",
1903
- disabled: _ctx.disabled,
1904
- plain: "",
1905
- onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
1906
- }, {
1907
- default: vue.withCtx(() => [
1908
- vue.createTextVNode("清空")
1909
- ]),
1910
- _: 1
1911
- }, 8, ["disabled"])) : vue.createCommentVNode("", true)
1912
- ]),
1913
- _ctx.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
1679
+ }, null, 8, _hoisted_1$8)) : vue.createCommentVNode("", true),
1680
+ vue.createVNode(vue.unref(design.TMagicTooltip), {
1681
+ content: "拖拽可排序",
1682
+ placement: "left-start",
1683
+ disabled: _ctx.config.dropSort !== true
1684
+ }, {
1685
+ default: vue.withCtx(() => [
1686
+ _ctx.model[modelName.value] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTable), {
1687
+ ref_key: "tMagicTable",
1688
+ ref: tMagicTable,
1689
+ style: { "width": "100%" },
1690
+ "row-key": _ctx.config.rowKey || "id",
1691
+ data: data.value,
1692
+ lastData: lastData.value,
1693
+ border: _ctx.config.border,
1694
+ "max-height": _ctx.config.maxHeight,
1695
+ "default-expand-all": true,
1696
+ key: updateKey.value,
1697
+ onSelect: selectHandle,
1698
+ onSortChange: sortChange
1699
+ }, {
1700
+ default: vue.withCtx(() => [
1701
+ _ctx.config.itemExtra ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1702
+ key: 0,
1703
+ fixed: "left",
1704
+ width: "30",
1705
+ type: "expand"
1706
+ }, {
1707
+ default: vue.withCtx((scope) => [
1708
+ vue.createElementVNode("span", {
1709
+ innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
1710
+ class: "m-form-tip"
1711
+ }, null, 8, _hoisted_2$2)
1712
+ ]),
1713
+ _: 1
1714
+ })) : vue.createCommentVNode("", true),
1715
+ vue.createVNode(vue.unref(design.TMagicTableColumn), {
1716
+ label: "操作",
1717
+ width: _ctx.config.operateColWidth || 55,
1718
+ align: "center",
1719
+ fixed: _ctx.config.fixed === false ? void 0 : "left"
1720
+ }, {
1721
+ default: vue.withCtx((scope) => [
1722
+ vue.renderSlot(_ctx.$slots, "operateCol", { scope }),
1723
+ vue.withDirectives(vue.createVNode(vue.unref(design.TMagicIcon), {
1724
+ class: "m-table-delete-icon",
1725
+ onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1726
+ }, {
1727
+ default: vue.withCtx(() => [
1728
+ vue.createVNode(vue.unref(iconsVue.Delete))
1729
+ ]),
1730
+ _: 2
1731
+ }, 1032, ["onClick"]), [
1732
+ [vue.vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
1733
+ ])
1734
+ ]),
1735
+ _: 3
1736
+ }, 8, ["width", "fixed"]),
1737
+ _ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1738
+ key: 1,
1739
+ label: "排序",
1740
+ width: "60"
1741
+ }, {
1742
+ default: vue.withCtx((scope) => [
1743
+ scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1744
+ key: 0,
1745
+ content: "点击上移,双击置顶",
1746
+ placement: "top"
1747
+ }, {
1748
+ default: vue.withCtx(() => [
1749
+ vue.createVNode(vue.unref(design.TMagicButton), {
1750
+ plain: "",
1751
+ size: "small",
1752
+ type: "primary",
1753
+ icon: vue.unref(iconsVue.ArrowUp),
1754
+ disabled: _ctx.disabled,
1755
+ text: "",
1756
+ onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1757
+ onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1758
+ }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1759
+ ]),
1760
+ _: 2
1761
+ }, 1024)) : vue.createCommentVNode("", true),
1762
+ scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1763
+ key: 1,
1764
+ content: "点击下移,双击置底",
1765
+ placement: "top"
1766
+ }, {
1767
+ default: vue.withCtx(() => [
1768
+ vue.createVNode(vue.unref(design.TMagicButton), {
1769
+ plain: "",
1770
+ size: "small",
1771
+ type: "primary",
1772
+ icon: vue.unref(iconsVue.ArrowDown),
1773
+ disabled: _ctx.disabled,
1774
+ text: "",
1775
+ onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1776
+ onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1777
+ }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1778
+ ]),
1779
+ _: 2
1780
+ }, 1024)) : vue.createCommentVNode("", true)
1781
+ ]),
1782
+ _: 1
1783
+ })) : vue.createCommentVNode("", true),
1784
+ selection.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1785
+ key: 2,
1786
+ align: "center",
1787
+ "header-align": "center",
1788
+ type: "selection",
1789
+ width: "45"
1790
+ })) : vue.createCommentVNode("", true),
1791
+ _ctx.showIndex && _ctx.config.showIndex ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1792
+ key: 3,
1793
+ width: "60",
1794
+ label: "序号"
1795
+ }, {
1796
+ default: vue.withCtx((scope) => [
1797
+ vue.createTextVNode(vue.toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
1798
+ ]),
1799
+ _: 1
1800
+ })) : vue.createCommentVNode("", true),
1801
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (column, index) => {
1802
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1803
+ column.type !== "hidden" && display$1(column.display) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1804
+ prop: column.name,
1805
+ width: column.width,
1806
+ label: column.label,
1807
+ sortable: column.sortable,
1808
+ "sort-orders": ["ascending", "descending"],
1809
+ key: column[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1810
+ "class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
1811
+ }, {
1812
+ default: vue.withCtx((scope) => [
1813
+ scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
1814
+ key: 0,
1815
+ labelWidth: "0",
1816
+ disabled: _ctx.disabled,
1817
+ prop: getProp(scope.$index),
1818
+ rules: column.rules,
1819
+ config: makeConfig(column, scope.row),
1820
+ model: scope.row,
1821
+ lastValues: lastData.value[scope.$index],
1822
+ "is-compare": _ctx.isCompare,
1823
+ size: _ctx.size,
1824
+ onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", _ctx.model[modelName.value])),
1825
+ onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1826
+ }, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : vue.createCommentVNode("", true)
1827
+ ]),
1828
+ _: 2
1829
+ }, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
1830
+ ], 64);
1831
+ }), 256))
1832
+ ]),
1833
+ _: 3
1834
+ }, 8, ["row-key", "data", "lastData", "border", "max-height"])) : vue.createCommentVNode("", true)
1835
+ ]),
1836
+ _: 3
1837
+ }, 8, ["disabled"]),
1838
+ vue.renderSlot(_ctx.$slots, "default"),
1839
+ addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1840
+ key: 1,
1841
+ size: "small",
1842
+ type: "primary",
1843
+ disabled: _ctx.disabled,
1844
+ plain: "",
1845
+ onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
1846
+ }, {
1847
+ default: vue.withCtx(() => [
1848
+ vue.createTextVNode("新增一行")
1849
+ ]),
1850
+ _: 1
1851
+ }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1852
+ vue.createTextVNode("   "),
1853
+ _ctx.enableToggleMode && _ctx.config.enableToggleMode !== false && !isFullscreen.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1854
+ key: 2,
1855
+ icon: vue.unref(iconsVue.Grid),
1856
+ size: "small",
1857
+ type: "primary",
1858
+ onClick: toggleMode
1859
+ }, {
1860
+ default: vue.withCtx(() => [
1861
+ vue.createTextVNode("展开配置")
1862
+ ]),
1863
+ _: 1
1864
+ }, 8, ["icon"])) : vue.createCommentVNode("", true),
1865
+ _ctx.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1866
+ key: 3,
1867
+ icon: vue.unref(iconsVue.FullScreen),
1868
+ size: "small",
1869
+ type: "primary",
1870
+ onClick: toggleFullscreen
1871
+ }, {
1872
+ default: vue.withCtx(() => [
1873
+ vue.createTextVNode(vue.toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
1874
+ ]),
1875
+ _: 1
1876
+ }, 8, ["icon"])) : vue.createCommentVNode("", true),
1877
+ importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
1878
+ key: 4,
1879
+ style: { "display": "inline-block" },
1880
+ ref_key: "excelBtn",
1881
+ ref: excelBtn,
1882
+ action: "/noop",
1883
+ disabled: _ctx.disabled,
1884
+ "on-change": excelHandler,
1885
+ "auto-upload": false
1886
+ }, {
1887
+ default: vue.withCtx(() => [
1888
+ vue.createVNode(vue.unref(design.TMagicButton), {
1889
+ size: "small",
1890
+ type: "success",
1891
+ disabled: _ctx.disabled,
1892
+ plain: ""
1893
+ }, {
1894
+ default: vue.withCtx(() => [
1895
+ vue.createTextVNode("导入EXCEL")
1896
+ ]),
1897
+ _: 1
1898
+ }, 8, ["disabled"])
1899
+ ]),
1900
+ _: 1
1901
+ }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1902
+ vue.createTextVNode("  "),
1903
+ importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1904
+ key: 5,
1905
+ size: "small",
1906
+ type: "warning",
1907
+ disabled: _ctx.disabled,
1908
+ plain: "",
1909
+ onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
1910
+ }, {
1911
+ default: vue.withCtx(() => [
1912
+ vue.createTextVNode("清空")
1913
+ ]),
1914
+ _: 1
1915
+ }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1916
+ _ctx.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
1914
1917
  vue.createVNode(vue.unref(design.TMagicPagination), {
1915
1918
  layout: "total, sizes, prev, pager, next, jumper",
1916
1919
  "hide-on-single-page": _ctx.model[modelName.value].length < pagesize.value,
@@ -1927,7 +1930,7 @@
1927
1930
  }
1928
1931
  });
1929
1932
 
1930
- const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
1933
+ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
1931
1934
  ...{
1932
1935
  name: "MFormTabs"
1933
1936
  },
@@ -2081,7 +2084,7 @@
2081
2084
  ]),
2082
2085
  default: vue.withCtx(() => [
2083
2086
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tabItems(tab), (item) => {
2084
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
2087
+ return vue.openBlock(), vue.createBlock(_sfc_main$y, {
2085
2088
  key: item[vue.unref(mForm)?.keyProp || "__key"],
2086
2089
  config: item,
2087
2090
  disabled: _ctx.disabled,
@@ -2133,7 +2136,7 @@
2133
2136
  );
2134
2137
  };
2135
2138
 
2136
- const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
2139
+ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
2137
2140
  ...{
2138
2141
  name: "MFormCascader"
2139
2142
  },
@@ -2221,7 +2224,7 @@
2221
2224
  }
2222
2225
  });
2223
2226
 
2224
- const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
2227
+ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
2225
2228
  ...{
2226
2229
  name: "MFormCheckbox"
2227
2230
  },
@@ -2283,7 +2286,7 @@
2283
2286
  }
2284
2287
  });
2285
2288
 
2286
- const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
2289
+ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
2287
2290
  ...{
2288
2291
  name: "MFormCheckGroup"
2289
2292
  },
@@ -2346,7 +2349,7 @@
2346
2349
  }
2347
2350
  });
2348
2351
 
2349
- const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
2352
+ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
2350
2353
  ...{
2351
2354
  name: "MFormColorPicker"
2352
2355
  },
@@ -2380,7 +2383,7 @@
2380
2383
  }
2381
2384
  });
2382
2385
 
2383
- const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
2386
+ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
2384
2387
  ...{
2385
2388
  name: "MFormDate"
2386
2389
  },
@@ -2413,14 +2416,14 @@
2413
2416
  placeholder: _ctx.config.placeholder,
2414
2417
  disabled: _ctx.disabled,
2415
2418
  format: _ctx.config.format,
2416
- "value-format": _ctx.config.valueFormat || "YYYY-MM-DD HH:mm:ss",
2419
+ "value-format": _ctx.config.valueFormat || "YYYY/MM/DD HH:mm:ss",
2417
2420
  onChange: changeHandler
2418
2421
  }, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format"]);
2419
2422
  };
2420
2423
  }
2421
2424
  });
2422
2425
 
2423
- const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
2426
+ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
2424
2427
  ...{
2425
2428
  name: "MFormDateRange"
2426
2429
  },
@@ -2522,7 +2525,7 @@
2522
2525
  }
2523
2526
  });
2524
2527
 
2525
- const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
2528
+ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
2526
2529
  ...{
2527
2530
  name: "MFormDateTime"
2528
2531
  },
@@ -2562,8 +2565,8 @@
2562
2565
  size: _ctx.size,
2563
2566
  placeholder: _ctx.config.placeholder,
2564
2567
  disabled: _ctx.disabled,
2565
- format: _ctx.config.format || "YYYY-MM-DD HH:mm:ss",
2566
- "value-format": _ctx.config.valueFormat || "YYYY-MM-DD HH:mm:ss",
2568
+ format: _ctx.config.format || "YYYY/MM/DD HH:mm:ss",
2569
+ "value-format": _ctx.config.valueFormat || "YYYY/MM/DD HH:mm:ss",
2567
2570
  "default-time": _ctx.config.defaultTime,
2568
2571
  onChange: changeHandler
2569
2572
  }, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format", "default-time"]);
@@ -2571,8 +2574,8 @@
2571
2574
  }
2572
2575
  });
2573
2576
 
2574
- const _hoisted_1$5 = { key: 0 };
2575
- const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
2577
+ const _hoisted_1$7 = { key: 0 };
2578
+ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
2576
2579
  ...{
2577
2580
  name: "MFormDisplay"
2578
2581
  },
@@ -2584,6 +2587,8 @@
2584
2587
  values: {},
2585
2588
  name: {},
2586
2589
  prop: {},
2590
+ disabled: { type: Boolean },
2591
+ size: {},
2587
2592
  lastValues: {}
2588
2593
  },
2589
2594
  setup(__props) {
@@ -2593,13 +2598,13 @@
2593
2598
  }
2594
2599
  useAddField(props.prop);
2595
2600
  return (_ctx, _cache) => {
2596
- return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$5, vue.toDisplayString(_ctx.model[_ctx.name]), 1)) : vue.createCommentVNode("", true);
2601
+ return _ctx.model ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$7, vue.toDisplayString(_ctx.model[_ctx.name]), 1)) : vue.createCommentVNode("", true);
2597
2602
  };
2598
2603
  }
2599
2604
  });
2600
2605
 
2601
- const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
2602
- const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
2606
+ const _hoisted_1$6 = { class: "m-fields-dynamic-field" };
2607
+ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
2603
2608
  ...{
2604
2609
  name: "MFormDynamicField"
2605
2610
  },
@@ -2664,7 +2669,7 @@
2664
2669
  emit("change", fieldMap.value[key], key);
2665
2670
  };
2666
2671
  return (_ctx, _cache) => {
2667
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
2672
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
2668
2673
  vue.createVNode(vue.unref(design.TMagicForm), { size: "small" }, {
2669
2674
  default: vue.withCtx(() => [
2670
2675
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Object.keys(fieldMap.value), (key) => {
@@ -2691,7 +2696,7 @@
2691
2696
  }
2692
2697
  });
2693
2698
 
2694
- const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
2699
+ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
2695
2700
  ...{
2696
2701
  name: "MFormHidden"
2697
2702
  },
@@ -2703,6 +2708,8 @@
2703
2708
  values: {},
2704
2709
  name: {},
2705
2710
  prop: {},
2711
+ disabled: { type: Boolean },
2712
+ size: {},
2706
2713
  lastValues: {}
2707
2714
  },
2708
2715
  setup(__props) {
@@ -2720,7 +2727,7 @@
2720
2727
  }
2721
2728
  });
2722
2729
 
2723
- const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
2730
+ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
2724
2731
  ...{
2725
2732
  name: "MForm"
2726
2733
  },
@@ -2739,7 +2746,8 @@
2739
2746
  inline: { type: Boolean, default: false },
2740
2747
  labelPosition: { default: "right" },
2741
2748
  keyProp: { default: "__key" },
2742
- popperClass: {}
2749
+ popperClass: {},
2750
+ extendState: {}
2743
2751
  },
2744
2752
  emits: ["change", "field-input", "field-change"],
2745
2753
  setup(__props, { expose: __expose, emit }) {
@@ -2774,7 +2782,7 @@
2774
2782
  }
2775
2783
  }
2776
2784
  });
2777
- vue.watchEffect(() => {
2785
+ vue.watchEffect(async () => {
2778
2786
  formState.initValues = props.initValues;
2779
2787
  formState.lastValues = props.lastValues;
2780
2788
  formState.isCompare = props.isCompare;
@@ -2782,6 +2790,12 @@
2782
2790
  formState.keyProp = props.keyProp;
2783
2791
  formState.popperClass = props.popperClass;
2784
2792
  formState.parentValues = props.parentValues;
2793
+ if (typeof props.extendState === "function") {
2794
+ const state = await props.extendState(formState) || {};
2795
+ Object.entries(state).forEach(([key, value]) => {
2796
+ formState[key] = value;
2797
+ });
2798
+ }
2785
2799
  });
2786
2800
  vue.provide("mForm", formState);
2787
2801
  vue.watch(
@@ -2852,7 +2866,7 @@
2852
2866
  }, {
2853
2867
  default: vue.withCtx(() => [
2854
2868
  initialized.value && Array.isArray(_ctx.config) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.config, (item, index) => {
2855
- return vue.openBlock(), vue.createBlock(_sfc_main$v, {
2869
+ return vue.openBlock(), vue.createBlock(_sfc_main$y, {
2856
2870
  disabled: _ctx.disabled,
2857
2871
  key: item[_ctx.keyProp] ?? index,
2858
2872
  config: item,
@@ -2872,8 +2886,8 @@
2872
2886
  }
2873
2887
  });
2874
2888
 
2875
- const _hoisted_1$3 = { style: { "min-height": "1px" } };
2876
- const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
2889
+ const _hoisted_1$5 = { style: { "min-height": "1px" } };
2890
+ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
2877
2891
  ...{
2878
2892
  name: "MFormDialog"
2879
2893
  },
@@ -2887,6 +2901,8 @@
2887
2901
  fullscreen: { type: Boolean },
2888
2902
  disabled: { type: Boolean },
2889
2903
  title: {},
2904
+ inline: { type: Boolean },
2905
+ labelPosition: {},
2890
2906
  zIndex: {},
2891
2907
  size: {},
2892
2908
  confirmText: { default: "确定" }
@@ -2917,9 +2933,6 @@
2917
2933
  }
2918
2934
  return false;
2919
2935
  });
2920
- const cancel = () => {
2921
- dialogVisible.value = false;
2922
- };
2923
2936
  const closeHandler = () => {
2924
2937
  stepActive.value = 1;
2925
2938
  emit("close");
@@ -2941,12 +2954,23 @@
2941
2954
  const changeHandler = (value) => {
2942
2955
  emit("change", value);
2943
2956
  };
2957
+ const show = () => {
2958
+ dialogVisible.value = true;
2959
+ };
2960
+ const hide = () => {
2961
+ dialogVisible.value = false;
2962
+ };
2963
+ const cancel = () => {
2964
+ hide();
2965
+ };
2944
2966
  __expose({
2945
2967
  form,
2946
2968
  saveFetch,
2947
2969
  dialogVisible,
2948
2970
  cancel,
2949
- save
2971
+ save,
2972
+ show,
2973
+ hide
2950
2974
  });
2951
2975
  return (_ctx, _cache) => {
2952
2976
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDialog), {
@@ -2970,7 +2994,7 @@
2970
2994
  style: { "text-align": "left" }
2971
2995
  }, {
2972
2996
  default: vue.withCtx(() => [
2973
- vue.createElementVNode("div", _hoisted_1$3, [
2997
+ vue.createElementVNode("div", _hoisted_1$5, [
2974
2998
  vue.renderSlot(_ctx.$slots, "left")
2975
2999
  ])
2976
3000
  ]),
@@ -3013,6 +3037,7 @@
3013
3037
  key: 2,
3014
3038
  type: "primary",
3015
3039
  size: "small",
3040
+ disabled: _ctx.disabled,
3016
3041
  loading: saveFetch.value,
3017
3042
  onClick: save
3018
3043
  }, {
@@ -3020,7 +3045,7 @@
3020
3045
  vue.createTextVNode(vue.toDisplayString(_ctx.confirmText), 1)
3021
3046
  ]),
3022
3047
  _: 1
3023
- }, 8, ["loading"]))
3048
+ }, 8, ["disabled", "loading"]))
3024
3049
  ])
3025
3050
  ]),
3026
3051
  _: 3
@@ -3035,7 +3060,7 @@
3035
3060
  class: "m-dialog-body",
3036
3061
  style: vue.normalizeStyle(`max-height: ${bodyHeight.value}; overflow-y: auto; overflow-x: hidden;`)
3037
3062
  }, [
3038
- vue.createVNode(_sfc_main$b, {
3063
+ vue.createVNode(_sfc_main$e, {
3039
3064
  modelValue: stepActive.value,
3040
3065
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => stepActive.value = $event),
3041
3066
  ref_key: "form",
@@ -3046,8 +3071,10 @@
3046
3071
  "init-values": _ctx.values,
3047
3072
  "parent-values": _ctx.parentValues,
3048
3073
  "label-width": _ctx.labelWidth,
3074
+ "label-position": _ctx.labelPosition,
3075
+ inline: _ctx.inline,
3049
3076
  onChange: changeHandler
3050
- }, null, 8, ["modelValue", "size", "disabled", "config", "init-values", "parent-values", "label-width"]),
3077
+ }, null, 8, ["modelValue", "size", "disabled", "config", "init-values", "parent-values", "label-width", "label-position", "inline"]),
3051
3078
  vue.renderSlot(_ctx.$slots, "default")
3052
3079
  ], 4)) : vue.createCommentVNode("", true)
3053
3080
  ]),
@@ -3057,12 +3084,12 @@
3057
3084
  }
3058
3085
  });
3059
3086
 
3060
- const _hoisted_1$2 = ["href"];
3061
- const _hoisted_2 = {
3087
+ const _hoisted_1$4 = ["href"];
3088
+ const _hoisted_2$1 = {
3062
3089
  key: 2,
3063
3090
  class: "m-fields-link"
3064
3091
  };
3065
- const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
3092
+ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
3066
3093
  ...{
3067
3094
  name: "MFormLink"
3068
3095
  },
@@ -3130,10 +3157,10 @@
3130
3157
  target: "_blank",
3131
3158
  href: href.value,
3132
3159
  style: vue.normalizeStyle(_ctx.config.css || {})
3133
- }, vue.toDisplayString(displayText.value), 13, _hoisted_1$2)) : _ctx.config.href && _ctx.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
3160
+ }, vue.toDisplayString(displayText.value), 13, _hoisted_1$4)) : _ctx.config.href && _ctx.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
3134
3161
  key: 1,
3135
3162
  style: vue.normalizeStyle(_ctx.config.disabledCss || {})
3136
- }, vue.toDisplayString(displayText.value), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
3163
+ }, vue.toDisplayString(displayText.value), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
3137
3164
  vue.createVNode(vue.unref(design.TMagicButton), {
3138
3165
  text: true,
3139
3166
  type: "primary",
@@ -3144,7 +3171,7 @@
3144
3171
  ]),
3145
3172
  _: 1
3146
3173
  }),
3147
- vue.createVNode(_sfc_main$a, {
3174
+ vue.createVNode(_sfc_main$d, {
3148
3175
  ref_key: "editor",
3149
3176
  ref: editor,
3150
3177
  title: _ctx.config.formTitle || "编辑扩展配置",
@@ -3160,7 +3187,7 @@
3160
3187
  }
3161
3188
  });
3162
3189
 
3163
- const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
3190
+ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
3164
3191
  ...{
3165
3192
  name: "MFormNumber"
3166
3193
  },
@@ -3208,7 +3235,62 @@
3208
3235
  }
3209
3236
  });
3210
3237
 
3211
- const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
3238
+ const _hoisted_1$3 = { class: "m-fields-number-range" };
3239
+ const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("span", { class: "split-tag" }, "-", -1);
3240
+ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
3241
+ ...{
3242
+ name: "MFormNumberRange"
3243
+ },
3244
+ __name: "NumberRange",
3245
+ props: {
3246
+ config: {},
3247
+ model: {},
3248
+ initValues: {},
3249
+ values: {},
3250
+ name: {},
3251
+ prop: {},
3252
+ disabled: { type: Boolean },
3253
+ size: {},
3254
+ lastValues: {}
3255
+ },
3256
+ emits: ["change"],
3257
+ setup(__props, { emit }) {
3258
+ const props = __props;
3259
+ useAddField(props.prop);
3260
+ if (!Array.isArray(props.model[props.name])) {
3261
+ props.model[props.name] = [];
3262
+ }
3263
+ const minChangeHandler = (v) => {
3264
+ emit("change", [Number(v), props.model[props.name][1]]);
3265
+ };
3266
+ const maxChangeHandler = (v) => {
3267
+ emit("change", [props.model[props.name][0], Number(v)]);
3268
+ };
3269
+ return (_ctx, _cache) => {
3270
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
3271
+ vue.createVNode(vue.unref(design.TMagicInput), {
3272
+ modelValue: _ctx.model[_ctx.name][0],
3273
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name][0] = $event),
3274
+ clearable: "",
3275
+ size: _ctx.size,
3276
+ disabled: _ctx.disabled,
3277
+ onChange: minChangeHandler
3278
+ }, null, 8, ["modelValue", "size", "disabled"]),
3279
+ _hoisted_2,
3280
+ vue.createVNode(vue.unref(design.TMagicInput), {
3281
+ modelValue: _ctx.model[_ctx.name][1],
3282
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.model[_ctx.name][1] = $event),
3283
+ clearable: "",
3284
+ size: _ctx.size,
3285
+ disabled: _ctx.disabled,
3286
+ onChange: maxChangeHandler
3287
+ }, null, 8, ["modelValue", "size", "disabled"])
3288
+ ]);
3289
+ };
3290
+ }
3291
+ });
3292
+
3293
+ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
3212
3294
  ...{
3213
3295
  name: "MFormRadioGroup"
3214
3296
  },
@@ -3260,7 +3342,7 @@
3260
3342
  }
3261
3343
  });
3262
3344
 
3263
- const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
3345
+ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
3264
3346
  ...{
3265
3347
  name: "MFormSelectOptionGroups"
3266
3348
  },
@@ -3294,7 +3376,7 @@
3294
3376
  }
3295
3377
  });
3296
3378
 
3297
- const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
3379
+ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
3298
3380
  ...{
3299
3381
  name: "MFormSelectOptions"
3300
3382
  },
@@ -3317,8 +3399,8 @@
3317
3399
  }
3318
3400
  });
3319
3401
 
3320
- const _hoisted_1$1 = { key: 2 };
3321
- const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
3402
+ const _hoisted_1$2 = { key: 2 };
3403
+ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
3322
3404
  ...{
3323
3405
  name: "MFormSelect"
3324
3406
  },
@@ -3658,14 +3740,14 @@
3658
3740
  onVisibleChange: visibleHandler
3659
3741
  }, {
3660
3742
  default: vue.withCtx(() => [
3661
- _ctx.config.group ? (vue.openBlock(), vue.createBlock(_sfc_main$6, {
3743
+ _ctx.config.group ? (vue.openBlock(), vue.createBlock(_sfc_main$8, {
3662
3744
  key: 0,
3663
3745
  options: vue.unref(groupOptions)
3664
- }, null, 8, ["options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$5, {
3746
+ }, null, 8, ["options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$7, {
3665
3747
  key: 1,
3666
3748
  options: vue.unref(itemOptions)
3667
3749
  }, null, 8, ["options"])),
3668
- moreLoadingVisible.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, null, 512)), [
3750
+ moreLoadingVisible.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, null, 512)), [
3669
3751
  [_directive_loading, true]
3670
3752
  ]) : vue.createCommentVNode("", true)
3671
3753
  ]),
@@ -3677,7 +3759,7 @@
3677
3759
  }
3678
3760
  });
3679
3761
 
3680
- const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
3762
+ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
3681
3763
  ...{
3682
3764
  name: "MFormSwitch"
3683
3765
  },
@@ -3734,8 +3816,8 @@
3734
3816
  }
3735
3817
  });
3736
3818
 
3737
- const _hoisted_1 = { key: 0 };
3738
- const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
3819
+ const _hoisted_1$1 = { key: 0 };
3820
+ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
3739
3821
  ...{
3740
3822
  name: "MFormText"
3741
3823
  },
@@ -3839,7 +3921,7 @@
3839
3921
  _ctx.config.append ? {
3840
3922
  name: "append",
3841
3923
  fn: vue.withCtx(() => [
3842
- typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(_ctx.config.append), 1)) : vue.createCommentVNode("", true),
3924
+ typeof _ctx.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$1, vue.toDisplayString(_ctx.config.append), 1)) : vue.createCommentVNode("", true),
3843
3925
  typeof _ctx.config.append === "object" && _ctx.config.append.type === "button" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
3844
3926
  key: 1,
3845
3927
  style: { "color": "#409eff" },
@@ -3859,7 +3941,7 @@
3859
3941
  }
3860
3942
  });
3861
3943
 
3862
- const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
3944
+ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
3863
3945
  ...{
3864
3946
  name: "MFormTextarea"
3865
3947
  },
@@ -3903,7 +3985,7 @@
3903
3985
  }
3904
3986
  });
3905
3987
 
3906
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
3988
+ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
3907
3989
  ...{
3908
3990
  name: "MFormTime"
3909
3991
  },
@@ -3941,72 +4023,321 @@
3941
4023
  }
3942
4024
  });
3943
4025
 
4026
+ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
4027
+ ...{
4028
+ name: "MFormTimeRange"
4029
+ },
4030
+ __name: "Timerange",
4031
+ props: {
4032
+ config: {},
4033
+ model: {},
4034
+ initValues: {},
4035
+ values: {},
4036
+ name: {},
4037
+ prop: {},
4038
+ disabled: { type: Boolean },
4039
+ size: {},
4040
+ lastValues: {}
4041
+ },
4042
+ emits: ["change"],
4043
+ setup(__props, { emit }) {
4044
+ const props = __props;
4045
+ useAddField(props.prop);
4046
+ const { names } = props.config;
4047
+ const value = vue.ref([]);
4048
+ if (props.model !== void 0 && names?.length) {
4049
+ vue.watch(
4050
+ [() => props.model[names[0]], () => props.model[names[1]]],
4051
+ ([start, end], [preStart, preEnd]) => {
4052
+ if (!value.value) {
4053
+ value.value = [];
4054
+ }
4055
+ if (!start || !end)
4056
+ value.value = [];
4057
+ if (start !== preStart)
4058
+ value.value[0] = start;
4059
+ if (end !== preEnd)
4060
+ value.value[1] = end;
4061
+ },
4062
+ {
4063
+ immediate: true
4064
+ }
4065
+ );
4066
+ }
4067
+ const setValue = (v) => {
4068
+ names?.forEach((item, index) => {
4069
+ if (!props.model) {
4070
+ return;
4071
+ }
4072
+ if (Array.isArray(v)) {
4073
+ props.model[item] = utils.datetimeFormatter(v[index]?.toString(), "");
4074
+ } else {
4075
+ props.model[item] = void 0;
4076
+ }
4077
+ });
4078
+ };
4079
+ const changeHandler = (v) => {
4080
+ const value2 = v || [];
4081
+ if (names?.length) {
4082
+ setValue(value2);
4083
+ }
4084
+ emit("change", value2);
4085
+ };
4086
+ return (_ctx, _cache) => {
4087
+ return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTimePicker), {
4088
+ modelValue: value.value,
4089
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
4090
+ "is-range": "",
4091
+ "range-separator": "-",
4092
+ "start-placeholder": "开始时间",
4093
+ "end-placeholder": "结束时间",
4094
+ size: _ctx.size,
4095
+ "unlink-panels": true,
4096
+ disabled: _ctx.disabled,
4097
+ "default-time": _ctx.config.defaultTime,
4098
+ onChange: changeHandler
4099
+ }, null, 8, ["modelValue", "size", "disabled", "default-time"]);
4100
+ };
4101
+ }
4102
+ });
4103
+
3944
4104
  const index$1 = '';
3945
4105
 
4106
+ const _hoisted_1 = { style: { "min-height": "1px" } };
4107
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4108
+ ...{
4109
+ name: "MFormDialog"
4110
+ },
4111
+ __name: "FormDrawer",
4112
+ props: {
4113
+ config: { default: () => [] },
4114
+ values: { default: () => ({}) },
4115
+ parentValues: {},
4116
+ width: {},
4117
+ labelWidth: {},
4118
+ disabled: { type: Boolean },
4119
+ closeOnPressEscape: { type: Boolean, default: true },
4120
+ title: {},
4121
+ zIndex: {},
4122
+ size: {},
4123
+ confirmText: { default: "确定" },
4124
+ inline: { type: Boolean },
4125
+ labelPosition: {},
4126
+ beforeClose: {}
4127
+ },
4128
+ emits: ["close", "closed", "submit", "error", "change", "open", "opened"],
4129
+ setup(__props, { expose: __expose, emit }) {
4130
+ const drawer = vue.ref();
4131
+ const form = vue.ref();
4132
+ const drawerBody = vue.ref();
4133
+ const visible = vue.ref(false);
4134
+ const saveFetch = vue.ref(false);
4135
+ const bodyHeight = vue.ref(0);
4136
+ vue.watchEffect(() => {
4137
+ if (drawerBody.value) {
4138
+ bodyHeight.value = drawerBody.value.clientHeight;
4139
+ }
4140
+ });
4141
+ const submitHandler = async () => {
4142
+ try {
4143
+ const values = await form.value?.submitForm();
4144
+ emit("submit", values);
4145
+ } catch (e) {
4146
+ emit("error", e);
4147
+ }
4148
+ };
4149
+ const changeHandler = (value) => {
4150
+ emit("change", value);
4151
+ };
4152
+ const openHandler = () => {
4153
+ emit("open");
4154
+ };
4155
+ const openedHandler = () => {
4156
+ emit("opened");
4157
+ };
4158
+ const closeHandler = () => {
4159
+ emit("close");
4160
+ };
4161
+ const closedHandler = () => {
4162
+ emit("closed");
4163
+ };
4164
+ const show = () => {
4165
+ visible.value = true;
4166
+ };
4167
+ const hide = () => {
4168
+ visible.value = false;
4169
+ };
4170
+ const handleClose = () => {
4171
+ drawer.value?.handleClose();
4172
+ };
4173
+ __expose({
4174
+ form,
4175
+ saveFetch,
4176
+ bodyHeight,
4177
+ show,
4178
+ hide,
4179
+ handleClose
4180
+ });
4181
+ return (_ctx, _cache) => {
4182
+ return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDrawer), {
4183
+ class: "m-form-drawer",
4184
+ ref_key: "drawer",
4185
+ ref: drawer,
4186
+ modelValue: visible.value,
4187
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
4188
+ title: _ctx.title,
4189
+ "close-on-press-escape": _ctx.closeOnPressEscape,
4190
+ "append-to-body": true,
4191
+ "show-close": true,
4192
+ "close-on-click-modal": true,
4193
+ size: _ctx.width,
4194
+ zIndex: _ctx.zIndex,
4195
+ "before-close": _ctx.beforeClose,
4196
+ onOpen: openHandler,
4197
+ onOpened: openedHandler,
4198
+ onClose: closeHandler,
4199
+ onClosed: closedHandler
4200
+ }, {
4201
+ footer: vue.withCtx(() => [
4202
+ vue.createVNode(vue.unref(design.TMagicRow), { class: "dialog-footer" }, {
4203
+ default: vue.withCtx(() => [
4204
+ vue.createVNode(vue.unref(design.TMagicCol), {
4205
+ span: 12,
4206
+ style: { "text-align": "left" }
4207
+ }, {
4208
+ default: vue.withCtx(() => [
4209
+ vue.createElementVNode("div", _hoisted_1, [
4210
+ vue.renderSlot(_ctx.$slots, "left")
4211
+ ])
4212
+ ]),
4213
+ _: 3
4214
+ }),
4215
+ vue.createVNode(vue.unref(design.TMagicCol), { span: 12 }, {
4216
+ default: vue.withCtx(() => [
4217
+ vue.renderSlot(_ctx.$slots, "footer", {}, () => [
4218
+ vue.createVNode(vue.unref(design.TMagicButton), { onClick: handleClose }, {
4219
+ default: vue.withCtx(() => [
4220
+ vue.createTextVNode("关闭")
4221
+ ]),
4222
+ _: 1
4223
+ }),
4224
+ vue.createVNode(vue.unref(design.TMagicButton), {
4225
+ type: "primary",
4226
+ disabled: _ctx.disabled,
4227
+ loading: saveFetch.value,
4228
+ onClick: submitHandler
4229
+ }, {
4230
+ default: vue.withCtx(() => [
4231
+ vue.createTextVNode(vue.toDisplayString(_ctx.confirmText), 1)
4232
+ ]),
4233
+ _: 1
4234
+ }, 8, ["disabled", "loading"])
4235
+ ])
4236
+ ]),
4237
+ _: 3
4238
+ })
4239
+ ]),
4240
+ _: 3
4241
+ })
4242
+ ]),
4243
+ default: vue.withCtx(() => [
4244
+ visible.value ? (vue.openBlock(), vue.createElementBlock("div", {
4245
+ key: 0,
4246
+ ref_key: "drawerBody",
4247
+ ref: drawerBody,
4248
+ class: "m-drawer-body"
4249
+ }, [
4250
+ vue.createVNode(_sfc_main$e, {
4251
+ ref_key: "form",
4252
+ ref: form,
4253
+ size: _ctx.size,
4254
+ disabled: _ctx.disabled,
4255
+ config: _ctx.config,
4256
+ "init-values": _ctx.values,
4257
+ "parent-values": _ctx.parentValues,
4258
+ "label-width": _ctx.labelWidth,
4259
+ "label-position": _ctx.labelPosition,
4260
+ inline: _ctx.inline,
4261
+ onChange: changeHandler
4262
+ }, null, 8, ["size", "disabled", "config", "init-values", "parent-values", "label-width", "label-position", "inline"]),
4263
+ vue.renderSlot(_ctx.$slots, "default")
4264
+ ], 512)) : vue.createCommentVNode("", true)
4265
+ ]),
4266
+ _: 3
4267
+ }, 8, ["modelValue", "title", "close-on-press-escape", "size", "zIndex", "before-close"]);
4268
+ };
4269
+ }
4270
+ });
4271
+
3946
4272
  const defaultInstallOpt = {};
3947
4273
  const index = {
3948
4274
  install(app, opt = {}) {
3949
4275
  const option = Object.assign(defaultInstallOpt, opt);
3950
4276
  app.config.globalProperties.$MAGIC_FORM = option;
3951
4277
  setConfig(option);
3952
- app.component("m-form", _sfc_main$b);
3953
- app.component("m-form-dialog", _sfc_main$a);
3954
- app.component("m-form-container", _sfc_main$v);
3955
- app.component("m-form-fieldset", _sfc_main$u);
3956
- app.component("m-form-group-list", _sfc_main$s);
3957
- app.component("m-form-panel", _sfc_main$r);
3958
- app.component("m-form-row", _sfc_main$p);
3959
- app.component("m-form-step", _sfc_main$o);
3960
- app.component("m-form-table", _sfc_main$n);
3961
- app.component("m-form-tab", _sfc_main$m);
3962
- app.component("m-fields-text", _sfc_main$2);
3963
- app.component("m-fields-number", _sfc_main$8);
3964
- app.component("m-fields-textarea", _sfc_main$1);
3965
- app.component("m-fields-hidden", _sfc_main$c);
3966
- app.component("m-fields-date", _sfc_main$h);
3967
- app.component("m-fields-datetime", _sfc_main$f);
3968
- app.component("m-fields-daterange", _sfc_main$g);
3969
- app.component("m-fields-time", _sfc_main);
3970
- app.component("m-fields-checkbox", _sfc_main$k);
3971
- app.component("m-fields-switch", _sfc_main$3);
3972
- app.component("m-fields-color-picker", _sfc_main$i);
3973
- app.component("m-fields-checkbox-group", _sfc_main$j);
3974
- app.component("m-fields-radio-group", _sfc_main$7);
3975
- app.component("m-fields-display", _sfc_main$e);
3976
- app.component("m-fields-link", _sfc_main$9);
3977
- app.component("m-fields-select", _sfc_main$4);
3978
- app.component("m-fields-cascader", _sfc_main$l);
3979
- app.component("m-fields-dynamic-field", _sfc_main$d);
4278
+ app.component("m-form", _sfc_main$e);
4279
+ app.component("m-form-dialog", _sfc_main$d);
4280
+ app.component("m-form-container", _sfc_main$y);
4281
+ app.component("m-form-fieldset", _sfc_main$x);
4282
+ app.component("m-form-group-list", _sfc_main$v);
4283
+ app.component("m-form-panel", _sfc_main$u);
4284
+ app.component("m-form-row", _sfc_main$s);
4285
+ app.component("m-form-step", _sfc_main$r);
4286
+ app.component("m-form-table", _sfc_main$q);
4287
+ app.component("m-form-tab", _sfc_main$p);
4288
+ app.component("m-fields-text", _sfc_main$4);
4289
+ app.component("m-fields-number", _sfc_main$b);
4290
+ app.component("m-fields-number-range", _sfc_main$a);
4291
+ app.component("m-fields-textarea", _sfc_main$3);
4292
+ app.component("m-fields-hidden", _sfc_main$f);
4293
+ app.component("m-fields-date", _sfc_main$k);
4294
+ app.component("m-fields-datetime", _sfc_main$i);
4295
+ app.component("m-fields-daterange", _sfc_main$j);
4296
+ app.component("m-fields-timerange", _sfc_main$1);
4297
+ app.component("m-fields-time", _sfc_main$2);
4298
+ app.component("m-fields-checkbox", _sfc_main$n);
4299
+ app.component("m-fields-switch", _sfc_main$5);
4300
+ app.component("m-fields-color-picker", _sfc_main$l);
4301
+ app.component("m-fields-checkbox-group", _sfc_main$m);
4302
+ app.component("m-fields-radio-group", _sfc_main$9);
4303
+ app.component("m-fields-display", _sfc_main$h);
4304
+ app.component("m-fields-link", _sfc_main$c);
4305
+ app.component("m-fields-select", _sfc_main$6);
4306
+ app.component("m-fields-cascader", _sfc_main$o);
4307
+ app.component("m-fields-dynamic-field", _sfc_main$g);
3980
4308
  }
3981
4309
  };
3982
4310
 
3983
- exports.MCascader = _sfc_main$l;
3984
- exports.MCheckbox = _sfc_main$k;
3985
- exports.MCheckboxGroup = _sfc_main$j;
3986
- exports.MColorPicker = _sfc_main$i;
3987
- exports.MContainer = _sfc_main$v;
3988
- exports.MDate = _sfc_main$h;
3989
- exports.MDateTime = _sfc_main$f;
3990
- exports.MDaterange = _sfc_main$g;
3991
- exports.MDisplay = _sfc_main$e;
3992
- exports.MDynamicField = _sfc_main$d;
3993
- exports.MFieldset = _sfc_main$u;
3994
- exports.MForm = _sfc_main$b;
3995
- exports.MFormDialog = _sfc_main$a;
3996
- exports.MGroupList = _sfc_main$s;
3997
- exports.MHidden = _sfc_main$c;
3998
- exports.MLink = _sfc_main$9;
3999
- exports.MNumber = _sfc_main$8;
4000
- exports.MPanel = _sfc_main$r;
4001
- exports.MRadioGroup = _sfc_main$7;
4002
- exports.MRow = _sfc_main$p;
4003
- exports.MSelect = _sfc_main$4;
4004
- exports.MSwitch = _sfc_main$3;
4005
- exports.MTable = _sfc_main$n;
4006
- exports.MTabs = _sfc_main$m;
4007
- exports.MText = _sfc_main$2;
4008
- exports.MTextarea = _sfc_main$1;
4009
- exports.MTime = _sfc_main;
4311
+ exports.MCascader = _sfc_main$o;
4312
+ exports.MCheckbox = _sfc_main$n;
4313
+ exports.MCheckboxGroup = _sfc_main$m;
4314
+ exports.MColorPicker = _sfc_main$l;
4315
+ exports.MContainer = _sfc_main$y;
4316
+ exports.MDate = _sfc_main$k;
4317
+ exports.MDateTime = _sfc_main$i;
4318
+ exports.MDaterange = _sfc_main$j;
4319
+ exports.MDisplay = _sfc_main$h;
4320
+ exports.MDynamicField = _sfc_main$g;
4321
+ exports.MFieldset = _sfc_main$x;
4322
+ exports.MForm = _sfc_main$e;
4323
+ exports.MFormDialog = _sfc_main$d;
4324
+ exports.MFormDrawer = _sfc_main;
4325
+ exports.MGroupList = _sfc_main$v;
4326
+ exports.MHidden = _sfc_main$f;
4327
+ exports.MLink = _sfc_main$c;
4328
+ exports.MNumber = _sfc_main$b;
4329
+ exports.MNumberRange = _sfc_main$a;
4330
+ exports.MPanel = _sfc_main$u;
4331
+ exports.MRadioGroup = _sfc_main$9;
4332
+ exports.MRow = _sfc_main$s;
4333
+ exports.MSelect = _sfc_main$6;
4334
+ exports.MSwitch = _sfc_main$5;
4335
+ exports.MTable = _sfc_main$q;
4336
+ exports.MTabs = _sfc_main$p;
4337
+ exports.MText = _sfc_main$4;
4338
+ exports.MTextarea = _sfc_main$3;
4339
+ exports.MTime = _sfc_main$2;
4340
+ exports.MTimerange = _sfc_main$1;
4010
4341
  exports.createValues = createValues;
4011
4342
  exports.default = index;
4012
4343
  exports.display = display;