@tmagic/form 1.7.0-beta.2 → 1.7.0-beta.4

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.
@@ -1,7 +1,7 @@
1
- import { toRaw, defineComponent, inject, ref, computed, watchEffect, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, createBlock, createCommentVNode, mergeProps, resolveDynamicComponent, Fragment, createVNode, unref, withCtx, createElementVNode, renderList, createTextVNode, toDisplayString, readonly, withDirectives, vShow, renderSlot, getCurrentInstance, createSlots, onUnmounted, reactive, onBeforeUnmount, vModelText, useTemplateRef, provide, shallowRef, onBeforeMount, nextTick, resolveDirective, withModifiers, Teleport, h } from 'vue';
2
- import { WarningFilled, CaretBottom, CaretRight, Delete, DocumentCopy, CaretTop, Position, Grid, ArrowUp, ArrowDown, FullScreen } from '@element-plus/icons-vue';
1
+ import { toRaw, defineComponent, createElementBlock, openBlock, createElementVNode, createBlock, createCommentVNode, unref, withCtx, createVNode, inject, ref, computed, watchEffect, watch, resolveComponent, normalizeStyle, normalizeClass, mergeProps, resolveDynamicComponent, Fragment, renderList, createTextVNode, toDisplayString, readonly, withDirectives, vShow, renderSlot, getCurrentInstance, createSlots, onUnmounted, reactive, onBeforeUnmount, vModelText, useTemplateRef, provide, shallowRef, onBeforeMount, nextTick, resolveDirective, withModifiers, Teleport, h } from 'vue';
2
+ import { WarningFilled, CaretBottom, CaretRight, Delete, DocumentCopy, CaretTop, Position, Grid, Plus, ArrowUp, ArrowDown, FullScreen } from '@element-plus/icons-vue';
3
3
  import { cloneDeep, isEqual, isEmpty, debounce } from 'lodash-es';
4
- import { TMagicFormItem, TMagicTooltip, TMagicIcon, TMagicButton, TMagicCheckbox, TMagicPopover, TMagicInputNumber, TMagicCard, TMagicCol, TMagicRow, TMagicSteps, TMagicStep, getDesignConfig, TMagicBadge, TMagicCascader, TMagicCheckboxGroup, TMagicColorPicker, TMagicDatePicker, TMagicForm, TMagicInput, tMagicMessage, tMagicMessageBox, TMagicDialog, TMagicRadioButton, TMagicRadio, TMagicRadioGroup, TMagicSelect, TMagicSwitch, TMagicTimePicker, useZIndex, TMagicTable, TMagicUpload, TMagicPagination, TMagicDrawer, TMagicScrollbar } from '@tmagic/design';
4
+ import { TMagicTooltip, TMagicIcon, TMagicFormItem, TMagicButton, TMagicCheckbox, TMagicCard, TMagicPopover, TMagicInputNumber, TMagicCol, TMagicRow, TMagicSteps, TMagicStep, getDesignConfig, TMagicBadge, TMagicCascader, TMagicCheckboxGroup, TMagicColorPicker, TMagicDatePicker, TMagicForm, TMagicInput, tMagicMessage, tMagicMessageBox, TMagicDialog, TMagicRadioButton, TMagicRadio, TMagicRadioGroup, TMagicSelect, TMagicSwitch, TMagicTimePicker, useZIndex, TMagicTable, TMagicUpload, TMagicPagination, TMagicDrawer, TMagicScrollbar } from '@tmagic/design';
5
5
  import { getValueByKeyPath, setValueByKeyPath, isNumber, asyncLoadJs } from '@tmagic/utils';
6
6
  import dayjs from 'dayjs';
7
7
  import utc from 'dayjs/plugin/utc';
@@ -215,7 +215,7 @@ const sortArray = (data, newIndex, oldIndex, sortKey) => {
215
215
  newData[v][sortKey] = i;
216
216
  }
217
217
  }
218
- return newData;
218
+ return cloneDeep(newData);
219
219
  };
220
220
  const sortChange = (data, { prop, order }) => {
221
221
  if (order === "ascending") {
@@ -225,17 +225,65 @@ const sortChange = (data, { prop, order }) => {
225
225
  }
226
226
  };
227
227
 
228
- const _hoisted_1$d = ["data-tmagic-id", "data-tmagic-form-item-prop"];
229
- const _hoisted_2$7 = ["innerHTML", "title"];
228
+ const _hoisted_1$e = {
229
+ key: 0,
230
+ style: { "display": "inline-flex", "align-items": "center" }
231
+ };
232
+ const _hoisted_2$8 = ["innerHTML", "title"];
230
233
  const _hoisted_3$6 = ["innerHTML"];
231
- const _hoisted_4$3 = ["innerHTML"];
232
- const _hoisted_5$3 = ["innerHTML", "title"];
234
+ const _hoisted_4$5 = ["innerHTML", "title"];
235
+ const _sfc_main$B = /* @__PURE__ */ defineComponent({
236
+ __name: "FormLabel",
237
+ props: {
238
+ tip: {},
239
+ type: {},
240
+ useLabel: { type: Boolean },
241
+ text: {},
242
+ labelTitle: {}
243
+ },
244
+ setup(__props) {
245
+ return (_ctx, _cache) => {
246
+ return __props.tip ? (openBlock(), createElementBlock("span", _hoisted_1$e, [
247
+ createElementVNode("span", {
248
+ innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
249
+ title: __props.labelTitle
250
+ }, null, 8, _hoisted_2$8),
251
+ __props.tip && (__props.type !== "checkbox" || __props.useLabel) ? (openBlock(), createBlock(unref(TMagicTooltip), {
252
+ key: 0,
253
+ placement: "top"
254
+ }, {
255
+ content: withCtx(() => [
256
+ createElementVNode("div", { innerHTML: __props.tip }, null, 8, _hoisted_3$6)
257
+ ]),
258
+ default: withCtx(() => [
259
+ createVNode(unref(TMagicIcon), { style: { "margin-left": "5px", "display": "flex" } }, {
260
+ default: withCtx(() => [
261
+ createVNode(unref(WarningFilled))
262
+ ]),
263
+ _: 1
264
+ /* STABLE */
265
+ })
266
+ ]),
267
+ _: 1
268
+ /* STABLE */
269
+ })) : createCommentVNode("v-if", true)
270
+ ])) : (openBlock(), createElementBlock("span", {
271
+ key: 1,
272
+ innerHTML: __props.type === "checkbox" && !__props.useLabel ? "" : __props.text,
273
+ title: __props.labelTitle
274
+ }, null, 8, _hoisted_4$5));
275
+ };
276
+ }
277
+ });
278
+
279
+ const _hoisted_1$d = ["data-tmagic-id", "data-tmagic-form-item-prop"];
280
+ const _hoisted_2$7 = ["innerHTML"];
281
+ const _hoisted_3$5 = ["innerHTML"];
282
+ const _hoisted_4$4 = ["innerHTML"];
283
+ const _hoisted_5$3 = ["innerHTML"];
233
284
  const _hoisted_6$1 = ["innerHTML"];
234
285
  const _hoisted_7$1 = ["innerHTML"];
235
- const _hoisted_8$1 = ["innerHTML", "title"];
236
- const _hoisted_9 = ["innerHTML"];
237
- const _hoisted_10 = ["innerHTML"];
238
- const _hoisted_11 = {
286
+ const _hoisted_8$1 = {
239
287
  key: 5,
240
288
  style: { "text-align": "center" }
241
289
  };
@@ -482,10 +530,13 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
482
530
  class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value }
483
531
  }), {
484
532
  label: withCtx(() => [
485
- createElementVNode("span", {
486
- innerHTML: type.value === "checkbox" && !__props.config.useLabel ? "" : text.value,
487
- title: __props.config.labelTitle
488
- }, null, 8, _hoisted_2$7)
533
+ createVNode(_sfc_main$B, {
534
+ tip: __props.config.tip,
535
+ type: type.value,
536
+ "use-label": __props.config.useLabel,
537
+ "label-title": __props.config.labelTitle,
538
+ text: text.value
539
+ }, null, 8, ["tip", "type", "use-label", "label-title", "text"])
489
540
  ]),
490
541
  default: withCtx(() => [
491
542
  tooltip.value.text ? (openBlock(), createBlock(unref(TMagicTooltip), {
@@ -495,36 +546,38 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
495
546
  content: withCtx(() => [
496
547
  createElementVNode("div", {
497
548
  innerHTML: tooltip.value.text
498
- }, null, 8, _hoisted_3$6)
549
+ }, null, 8, _hoisted_2$7)
499
550
  ]),
500
551
  default: withCtx(() => [
501
552
  (openBlock(), createBlock(resolveDynamicComponent(tagName.value), mergeProps(fieldsProps.value, {
502
553
  model: __props.model,
503
554
  "last-values": __props.lastValues,
555
+ "is-compare": __props.isCompare,
504
556
  onChange: onChangeHandler,
505
557
  onAddDiffCount
506
- }), null, 16, ["model", "last-values"]))
558
+ }), null, 16, ["model", "last-values", "is-compare"]))
507
559
  ]),
508
560
  _: 1
509
561
  /* STABLE */
510
562
  }, 8, ["placement"])) : (openBlock(), createBlock(resolveDynamicComponent(tagName.value), mergeProps({ key: 1 }, fieldsProps.value, {
511
563
  model: __props.model,
512
564
  "last-values": __props.lastValues,
565
+ "is-compare": __props.isCompare,
513
566
  onChange: onChangeHandler,
514
567
  onAddDiffCount
515
- }), null, 16, ["model", "last-values"]))
568
+ }), null, 16, ["model", "last-values", "is-compare"]))
516
569
  ]),
517
570
  _: 1
518
571
  /* STABLE */
519
572
  }, 16, ["class"]),
520
- __props.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
573
+ __props.config.tip && type.value === "checkbox" && !__props.config.useLabel ? (openBlock(), createBlock(unref(TMagicTooltip), {
521
574
  key: 0,
522
- placement: "left"
575
+ placement: "top"
523
576
  }, {
524
577
  content: withCtx(() => [
525
578
  createElementVNode("div", {
526
579
  innerHTML: __props.config.tip
527
- }, null, 8, _hoisted_4$3)
580
+ }, null, 8, _hoisted_3$5)
528
581
  ]),
529
582
  default: withCtx(() => [
530
583
  createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -551,10 +604,13 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
551
604
  class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value, "show-diff": true }
552
605
  }), {
553
606
  label: withCtx(() => [
554
- createElementVNode("span", {
555
- innerHTML: type.value === "checkbox" ? "" : text.value,
556
- title: __props.config.labelTitle
557
- }, null, 8, _hoisted_5$3)
607
+ createVNode(_sfc_main$B, {
608
+ tip: __props.config.tip,
609
+ type: type.value,
610
+ "use-label": __props.config.useLabel,
611
+ "label-title": __props.config.labelTitle,
612
+ text: text.value
613
+ }, null, 8, ["tip", "type", "use-label", "label-title", "text"])
558
614
  ]),
559
615
  default: withCtx(() => [
560
616
  tooltip.value.text ? (openBlock(), createBlock(unref(TMagicTooltip), {
@@ -564,7 +620,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
564
620
  content: withCtx(() => [
565
621
  createElementVNode("div", {
566
622
  innerHTML: tooltip.value.text
567
- }, null, 8, _hoisted_6$1)
623
+ }, null, 8, _hoisted_4$4)
568
624
  ]),
569
625
  default: withCtx(() => [
570
626
  (openBlock(), createBlock(resolveDynamicComponent(tagName.value), mergeProps(fieldsProps.value, {
@@ -582,14 +638,14 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
582
638
  _: 1
583
639
  /* STABLE */
584
640
  }, 16, ["class"]),
585
- __props.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
641
+ __props.config.tip && type.value === "checkbox" && !__props.config.useLabel ? (openBlock(), createBlock(unref(TMagicTooltip), {
586
642
  key: 0,
587
- placement: "left"
643
+ placement: "top"
588
644
  }, {
589
645
  content: withCtx(() => [
590
646
  createElementVNode("div", {
591
647
  innerHTML: __props.config.tip
592
- }, null, 8, _hoisted_7$1)
648
+ }, null, 8, _hoisted_5$3)
593
649
  ]),
594
650
  default: withCtx(() => [
595
651
  createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -609,10 +665,13 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
609
665
  class: { "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value, "show-diff": true }
610
666
  }), {
611
667
  label: withCtx(() => [
612
- createElementVNode("span", {
613
- innerHTML: type.value === "checkbox" ? "" : text.value,
614
- title: __props.config.labelTitle
615
- }, null, 8, _hoisted_8$1)
668
+ createVNode(_sfc_main$B, {
669
+ tip: __props.config.tip,
670
+ type: type.value,
671
+ "use-label": __props.config.useLabel,
672
+ "label-title": __props.config.labelTitle,
673
+ text: text.value
674
+ }, null, 8, ["tip", "type", "use-label", "label-title", "text"])
616
675
  ]),
617
676
  default: withCtx(() => [
618
677
  tooltip.value.text ? (openBlock(), createBlock(unref(TMagicTooltip), {
@@ -622,7 +681,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
622
681
  content: withCtx(() => [
623
682
  createElementVNode("div", {
624
683
  innerHTML: tooltip.value.text
625
- }, null, 8, _hoisted_9)
684
+ }, null, 8, _hoisted_6$1)
626
685
  ]),
627
686
  default: withCtx(() => [
628
687
  (openBlock(), createBlock(resolveDynamicComponent(tagName.value), mergeProps(fieldsProps.value, {
@@ -640,14 +699,14 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
640
699
  _: 1
641
700
  /* STABLE */
642
701
  }, 16, ["style", "class"]),
643
- __props.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
702
+ __props.config.tip && type.value === "checkbox" && !__props.config.useLabel ? (openBlock(), createBlock(unref(TMagicTooltip), {
644
703
  key: 1,
645
- placement: "left"
704
+ placement: "top"
646
705
  }, {
647
706
  content: withCtx(() => [
648
707
  createElementVNode("div", {
649
708
  innerHTML: __props.config.tip
650
- }, null, 8, _hoisted_10)
709
+ }, null, 8, _hoisted_7$1)
651
710
  ]),
652
711
  default: withCtx(() => [
653
712
  createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -695,7 +754,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
695
754
  64
696
755
  /* STABLE_FRAGMENT */
697
756
  )) : createCommentVNode("v-if", true),
698
- __props.config.expand && type.value !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_11, [
757
+ __props.config.expand && type.value !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_8$1, [
699
758
  createVNode(unref(TMagicButton), {
700
759
  type: "primary",
701
760
  size: "small",
@@ -721,8 +780,8 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
721
780
 
722
781
  const _hoisted_1$c = ["innerHTML"];
723
782
  const _hoisted_2$6 = ["innerHTML"];
724
- const _hoisted_3$5 = { key: 1 };
725
- const _hoisted_4$2 = ["innerHTML"];
783
+ const _hoisted_3$4 = { key: 1 };
784
+ const _hoisted_4$3 = ["innerHTML"];
726
785
  const _hoisted_5$2 = ["innerHTML"];
727
786
  const _hoisted_6 = {
728
787
  key: 2,
@@ -822,10 +881,10 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
822
881
  ]),
823
882
  _: 1
824
883
  /* STABLE */
825
- })) : (openBlock(), createElementBlock("legend", _hoisted_3$5, [
884
+ })) : (openBlock(), createElementBlock("legend", _hoisted_3$4, [
826
885
  createElementVNode("span", {
827
886
  innerHTML: __props.config.legend
828
- }, null, 8, _hoisted_4$2),
887
+ }, null, 8, _hoisted_4$3),
829
888
  __props.config.extra ? (openBlock(), createElementBlock("span", {
830
889
  key: 0,
831
890
  innerHTML: __props.config.extra,
@@ -954,9 +1013,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
954
1013
  }
955
1014
  });
956
1015
 
957
- const _hoisted_1$b = { class: "m-fields-group-list-item" };
958
- const _hoisted_2$5 = { style: { "text-align": "right", "margin-top": "20px" } };
959
- const _hoisted_3$4 = ["innerHTML"];
1016
+ const _hoisted_1$b = { style: { "text-align": "right", "margin-top": "20px" } };
1017
+ const _hoisted_2$5 = ["innerHTML"];
960
1018
  const _sfc_main$x = /* @__PURE__ */ defineComponent({
961
1019
  ...{
962
1020
  name: "MFormGroupListItem"
@@ -1035,211 +1093,220 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
1035
1093
  emit("swap-item", props.index, moveSpecifyLocationIndex.value - 1);
1036
1094
  };
1037
1095
  return (_ctx, _cache) => {
1038
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
1039
- createElementVNode("div", null, [
1040
- createVNode(unref(TMagicButton), {
1041
- link: "",
1042
- disabled: __props.disabled,
1043
- onClick: expandHandler
1044
- }, {
1045
- default: withCtx(() => [
1046
- createVNode(unref(TMagicIcon), null, {
1047
- default: withCtx(() => [
1048
- expand.value ? (openBlock(), createBlock(unref(CaretBottom), { key: 0 })) : (openBlock(), createBlock(unref(CaretRight), { key: 1 }))
1049
- ]),
1050
- _: 1
1051
- /* STABLE */
1052
- }),
1053
- createTextVNode(
1054
- toDisplayString(title.value),
1055
- 1
1056
- /* TEXT */
1057
- )
1058
- ]),
1059
- _: 1
1060
- /* STABLE */
1061
- }, 8, ["disabled"]),
1062
- withDirectives(createVNode(unref(TMagicButton), {
1063
- type: "danger",
1064
- size: "small",
1065
- link: "",
1066
- icon: unref(Delete),
1067
- disabled: __props.disabled,
1068
- onClick: removeHandler
1069
- }, null, 8, ["icon", "disabled"]), [
1070
- [vShow, showDelete.value]
1071
- ]),
1072
- copyable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1073
- key: 0,
1074
- link: "",
1075
- size: "small",
1076
- type: "primary",
1077
- icon: unref(DocumentCopy),
1078
- disabled: __props.disabled,
1079
- onClick: copyHandler
1080
- }, {
1081
- default: withCtx(() => [..._cache[6] || (_cache[6] = [
1082
- createTextVNode(
1083
- "复制",
1084
- -1
1085
- /* CACHED */
1086
- )
1087
- ])]),
1088
- _: 1
1089
- /* STABLE */
1090
- }, 8, ["icon", "disabled"])) : createCommentVNode("v-if", true),
1091
- movable.value ? (openBlock(), createElementBlock(
1092
- Fragment,
1093
- { key: 1 },
1094
- [
1095
- withDirectives(createVNode(unref(TMagicButton), {
1096
- link: "",
1097
- size: "small",
1098
- disabled: __props.disabled,
1099
- icon: unref(CaretTop),
1100
- onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
1101
- }, {
1102
- default: withCtx(() => [..._cache[7] || (_cache[7] = [
1103
- createTextVNode(
1104
- "上移",
1105
- -1
1106
- /* CACHED */
1107
- )
1108
- ])]),
1109
- _: 1
1110
- /* STABLE */
1111
- }, 8, ["disabled", "icon"]), [
1112
- [vShow, __props.index !== 0]
1096
+ return openBlock(), createBlock(unref(TMagicCard), {
1097
+ class: "m-fields-group-list-item",
1098
+ "body-style": { display: expand.value ? "block" : "none" }
1099
+ }, {
1100
+ header: withCtx(() => [
1101
+ createElementVNode("div", null, [
1102
+ createVNode(unref(TMagicButton), {
1103
+ link: "",
1104
+ disabled: __props.disabled,
1105
+ onClick: expandHandler
1106
+ }, {
1107
+ default: withCtx(() => [
1108
+ createVNode(unref(TMagicIcon), null, {
1109
+ default: withCtx(() => [
1110
+ expand.value ? (openBlock(), createBlock(unref(CaretBottom), { key: 0 })) : (openBlock(), createBlock(unref(CaretRight), { key: 1 }))
1111
+ ]),
1112
+ _: 1
1113
+ /* STABLE */
1114
+ }),
1115
+ createTextVNode(
1116
+ toDisplayString(title.value),
1117
+ 1
1118
+ /* TEXT */
1119
+ )
1113
1120
  ]),
1114
- withDirectives(createVNode(unref(TMagicButton), {
1115
- link: "",
1116
- size: "small",
1117
- disabled: __props.disabled,
1118
- icon: unref(CaretBottom),
1119
- onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
1120
- }, {
1121
- default: withCtx(() => [..._cache[8] || (_cache[8] = [
1122
- createTextVNode(
1123
- "下移",
1124
- -1
1125
- /* CACHED */
1126
- )
1127
- ])]),
1128
- _: 1
1129
- /* STABLE */
1130
- }, 8, ["disabled", "icon"]), [
1131
- [vShow, __props.index !== length.value - 1]
1132
- ])
1133
- ],
1134
- 64
1135
- /* STABLE_FRAGMENT */
1136
- )) : createCommentVNode("v-if", true),
1137
- __props.config.moveSpecifyLocation ? (openBlock(), createBlock(unref(TMagicPopover), {
1138
- key: 2,
1139
- trigger: "click",
1140
- placement: "top",
1141
- width: "200",
1142
- visible: moveSpecifyLocationVisible.value
1143
- }, {
1144
- reference: withCtx(() => [
1145
- createVNode(unref(TMagicButton), {
1146
- link: "",
1147
- size: "small",
1148
- type: "primary",
1149
- icon: unref(Position),
1150
- disabled: __props.disabled,
1151
- onClick: _cache[2] || (_cache[2] = ($event) => moveSpecifyLocationVisible.value = true)
1152
- }, {
1153
- default: withCtx(() => [..._cache[9] || (_cache[9] = [
1154
- createTextVNode(
1155
- "移动至",
1156
- -1
1157
- /* CACHED */
1158
- )
1159
- ])]),
1160
- _: 1
1161
- /* STABLE */
1162
- }, 8, ["icon", "disabled"])
1121
+ _: 1
1122
+ /* STABLE */
1123
+ }, 8, ["disabled"]),
1124
+ withDirectives(createVNode(unref(TMagicButton), {
1125
+ type: "danger",
1126
+ size: "small",
1127
+ link: "",
1128
+ icon: unref(Delete),
1129
+ disabled: __props.disabled,
1130
+ onClick: removeHandler
1131
+ }, null, 8, ["icon", "disabled"]), [
1132
+ [vShow, showDelete.value]
1163
1133
  ]),
1164
- default: withCtx(() => [
1165
- createElementVNode("div", null, [
1166
- createElementVNode("div", null, [
1167
- _cache[10] || (_cache[10] = createTextVNode(
1168
- " ",
1169
- -1
1170
- /* CACHED */
1171
- )),
1172
- createVNode(unref(TMagicInputNumber), {
1173
- style: { "margin": "0 5px" },
1174
- modelValue: moveSpecifyLocationIndex.value,
1175
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => moveSpecifyLocationIndex.value = $event),
1176
- size: "small",
1177
- min: 1,
1178
- disabled: __props.disabled
1179
- }, null, 8, ["modelValue", "disabled"]),
1180
- _cache[11] || (_cache[11] = createTextVNode(
1181
- "行 ",
1182
- -1
1183
- /* CACHED */
1184
- ))
1134
+ copyable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1135
+ key: 0,
1136
+ link: "",
1137
+ size: "small",
1138
+ type: "primary",
1139
+ icon: unref(DocumentCopy),
1140
+ disabled: __props.disabled,
1141
+ onClick: copyHandler
1142
+ }, {
1143
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [
1144
+ createTextVNode(
1145
+ "复制",
1146
+ -1
1147
+ /* CACHED */
1148
+ )
1149
+ ])]),
1150
+ _: 1
1151
+ /* STABLE */
1152
+ }, 8, ["icon", "disabled"])) : createCommentVNode("v-if", true),
1153
+ movable.value ? (openBlock(), createElementBlock(
1154
+ Fragment,
1155
+ { key: 1 },
1156
+ [
1157
+ withDirectives(createVNode(unref(TMagicButton), {
1158
+ link: "",
1159
+ size: "small",
1160
+ disabled: __props.disabled,
1161
+ icon: unref(CaretTop),
1162
+ onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
1163
+ }, {
1164
+ default: withCtx(() => [..._cache[7] || (_cache[7] = [
1165
+ createTextVNode(
1166
+ "上移",
1167
+ -1
1168
+ /* CACHED */
1169
+ )
1170
+ ])]),
1171
+ _: 1
1172
+ /* STABLE */
1173
+ }, 8, ["disabled", "icon"]), [
1174
+ [vShow, __props.index !== 0]
1185
1175
  ]),
1186
- createElementVNode("div", _hoisted_2$5, [
1187
- createVNode(unref(TMagicButton), {
1188
- size: "small",
1189
- text: "",
1190
- onClick: _cache[4] || (_cache[4] = ($event) => moveSpecifyLocationVisible.value = false)
1191
- }, {
1192
- default: withCtx(() => [..._cache[12] || (_cache[12] = [
1193
- createTextVNode(
1194
- "取消",
1195
- -1
1196
- /* CACHED */
1197
- )
1198
- ])]),
1199
- _: 1
1200
- /* STABLE */
1201
- }),
1202
- createVNode(unref(TMagicButton), {
1203
- size: "small",
1204
- type: "primary",
1205
- onClick: moveSpecifyLocationHandler
1206
- }, {
1207
- default: withCtx(() => [..._cache[13] || (_cache[13] = [
1208
- createTextVNode(
1209
- "确认",
1210
- -1
1211
- /* CACHED */
1212
- )
1213
- ])]),
1214
- _: 1
1215
- /* STABLE */
1216
- })
1176
+ withDirectives(createVNode(unref(TMagicButton), {
1177
+ link: "",
1178
+ size: "small",
1179
+ disabled: __props.disabled,
1180
+ icon: unref(CaretBottom),
1181
+ onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
1182
+ }, {
1183
+ default: withCtx(() => [..._cache[8] || (_cache[8] = [
1184
+ createTextVNode(
1185
+ "下移",
1186
+ -1
1187
+ /* CACHED */
1188
+ )
1189
+ ])]),
1190
+ _: 1
1191
+ /* STABLE */
1192
+ }, 8, ["disabled", "icon"]), [
1193
+ [vShow, __props.index !== length.value - 1]
1217
1194
  ])
1218
- ])
1219
- ]),
1220
- _: 1
1221
- /* STABLE */
1222
- }, 8, ["visible"])) : createCommentVNode("v-if", true),
1223
- itemExtra.value ? (openBlock(), createElementBlock("span", {
1224
- key: 3,
1225
- innerHTML: itemExtra.value,
1226
- class: "m-form-tip"
1227
- }, null, 8, _hoisted_3$4)) : createCommentVNode("v-if", true)
1195
+ ],
1196
+ 64
1197
+ /* STABLE_FRAGMENT */
1198
+ )) : createCommentVNode("v-if", true),
1199
+ __props.config.moveSpecifyLocation ? (openBlock(), createBlock(unref(TMagicPopover), {
1200
+ key: 2,
1201
+ trigger: "click",
1202
+ placement: "top",
1203
+ width: "200",
1204
+ visible: moveSpecifyLocationVisible.value
1205
+ }, {
1206
+ reference: withCtx(() => [
1207
+ createVNode(unref(TMagicButton), {
1208
+ link: "",
1209
+ size: "small",
1210
+ type: "primary",
1211
+ icon: unref(Position),
1212
+ disabled: __props.disabled,
1213
+ onClick: _cache[2] || (_cache[2] = ($event) => moveSpecifyLocationVisible.value = true)
1214
+ }, {
1215
+ default: withCtx(() => [..._cache[9] || (_cache[9] = [
1216
+ createTextVNode(
1217
+ "移动至",
1218
+ -1
1219
+ /* CACHED */
1220
+ )
1221
+ ])]),
1222
+ _: 1
1223
+ /* STABLE */
1224
+ }, 8, ["icon", "disabled"])
1225
+ ]),
1226
+ default: withCtx(() => [
1227
+ createElementVNode("div", null, [
1228
+ createElementVNode("div", null, [
1229
+ _cache[10] || (_cache[10] = createTextVNode(
1230
+ " 第",
1231
+ -1
1232
+ /* CACHED */
1233
+ )),
1234
+ createVNode(unref(TMagicInputNumber), {
1235
+ style: { "margin": "0 5px" },
1236
+ modelValue: moveSpecifyLocationIndex.value,
1237
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => moveSpecifyLocationIndex.value = $event),
1238
+ size: "small",
1239
+ min: 1,
1240
+ disabled: __props.disabled
1241
+ }, null, 8, ["modelValue", "disabled"]),
1242
+ _cache[11] || (_cache[11] = createTextVNode(
1243
+ "行 ",
1244
+ -1
1245
+ /* CACHED */
1246
+ ))
1247
+ ]),
1248
+ createElementVNode("div", _hoisted_1$b, [
1249
+ createVNode(unref(TMagicButton), {
1250
+ size: "small",
1251
+ text: "",
1252
+ onClick: _cache[4] || (_cache[4] = ($event) => moveSpecifyLocationVisible.value = false)
1253
+ }, {
1254
+ default: withCtx(() => [..._cache[12] || (_cache[12] = [
1255
+ createTextVNode(
1256
+ "取消",
1257
+ -1
1258
+ /* CACHED */
1259
+ )
1260
+ ])]),
1261
+ _: 1
1262
+ /* STABLE */
1263
+ }),
1264
+ createVNode(unref(TMagicButton), {
1265
+ size: "small",
1266
+ type: "primary",
1267
+ onClick: moveSpecifyLocationHandler
1268
+ }, {
1269
+ default: withCtx(() => [..._cache[13] || (_cache[13] = [
1270
+ createTextVNode(
1271
+ "确认",
1272
+ -1
1273
+ /* CACHED */
1274
+ )
1275
+ ])]),
1276
+ _: 1
1277
+ /* STABLE */
1278
+ })
1279
+ ])
1280
+ ])
1281
+ ]),
1282
+ _: 1
1283
+ /* STABLE */
1284
+ }, 8, ["visible"])) : createCommentVNode("v-if", true),
1285
+ itemExtra.value ? (openBlock(), createElementBlock("span", {
1286
+ key: 3,
1287
+ innerHTML: itemExtra.value,
1288
+ class: "m-form-tip"
1289
+ }, null, 8, _hoisted_2$5)) : createCommentVNode("v-if", true)
1290
+ ])
1228
1291
  ]),
1229
- expand.value ? (openBlock(), createBlock(_sfc_main$A, {
1230
- key: 0,
1231
- config: rowConfig.value,
1232
- model: __props.model,
1233
- lastValues: __props.lastValues,
1234
- "is-compare": __props.isCompare,
1235
- labelWidth: __props.labelWidth,
1236
- prop: `${__props.prop}${__props.prop ? "." : ""}${String(__props.index)}`,
1237
- size: __props.size,
1238
- disabled: __props.disabled,
1239
- onChange: changeHandler,
1240
- onAddDiffCount: _cache[5] || (_cache[5] = ($event) => onAddDiffCount())
1241
- }, null, 8, ["config", "model", "lastValues", "is-compare", "labelWidth", "prop", "size", "disabled"])) : createCommentVNode("v-if", true)
1242
- ]);
1292
+ default: withCtx(() => [
1293
+ expand.value ? (openBlock(), createBlock(_sfc_main$A, {
1294
+ key: 0,
1295
+ config: rowConfig.value,
1296
+ model: __props.model,
1297
+ lastValues: __props.lastValues,
1298
+ "is-compare": __props.isCompare,
1299
+ labelWidth: __props.labelWidth,
1300
+ prop: `${__props.prop}${__props.prop ? "." : ""}${String(__props.index)}`,
1301
+ size: __props.size,
1302
+ disabled: __props.disabled,
1303
+ onChange: changeHandler,
1304
+ onAddDiffCount: _cache[5] || (_cache[5] = ($event) => onAddDiffCount())
1305
+ }, null, 8, ["config", "model", "lastValues", "is-compare", "labelWidth", "prop", "size", "disabled"])) : createCommentVNode("v-if", true)
1306
+ ]),
1307
+ _: 1
1308
+ /* STABLE */
1309
+ }, 8, ["body-style"]);
1243
1310
  };
1244
1311
  }
1245
1312
  });
@@ -1250,6 +1317,8 @@ const _hoisted_3$3 = {
1250
1317
  key: 1,
1251
1318
  class: "el-table__empty-block"
1252
1319
  };
1320
+ const _hoisted_4$2 = { class: "m-fields-group-list-footer" };
1321
+ const _hoisted_5$1 = { style: { "display": "flex", "justify-content": "flex-end", "flex": "1" } };
1253
1322
  const _sfc_main$w = /* @__PURE__ */ defineComponent({
1254
1323
  ...{
1255
1324
  name: "MFormGroupList"
@@ -1349,7 +1418,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
1349
1418
  !__props.model[__props.name] || !__props.model[__props.name].length ? (openBlock(), createElementBlock("div", _hoisted_3$3, [..._cache[1] || (_cache[1] = [
1350
1419
  createElementVNode(
1351
1420
  "span",
1352
- { class: "el-table__empty-text" },
1421
+ { class: "el-table__empty-text t-table__empty" },
1353
1422
  "暂无数据",
1354
1423
  -1
1355
1424
  /* CACHED */
@@ -1376,43 +1445,48 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
1376
1445
  onChange: changeHandler,
1377
1446
  onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
1378
1447
  }, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "index", "label-width", "size", "disabled", "group-model"]);
1379
- }),
1380
- 128
1381
- /* KEYED_FRAGMENT */
1382
- )),
1383
- addable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1384
- key: 3,
1385
- type: "primary",
1386
- size: __props.config.enableToggleMode ? "small" : "default",
1387
- disabled: __props.disabled,
1388
- onClick: addHandler
1389
- }, {
1390
- default: withCtx(() => [..._cache[2] || (_cache[2] = [
1391
- createTextVNode(
1392
- "新增",
1393
- -1
1394
- /* CACHED */
1395
- )
1396
- ])]),
1397
- _: 1
1398
- /* STABLE */
1399
- }, 8, ["size", "disabled"])) : createCommentVNode("v-if", true),
1400
- __props.config.enableToggleMode ? (openBlock(), createBlock(unref(TMagicButton), {
1401
- key: 4,
1402
- icon: unref(Grid),
1403
- size: "small",
1404
- onClick: toggleMode
1405
- }, {
1406
- default: withCtx(() => [..._cache[3] || (_cache[3] = [
1407
- createTextVNode(
1408
- "切换为表格",
1409
- -1
1410
- /* CACHED */
1411
- )
1412
- ])]),
1413
- _: 1
1414
- /* STABLE */
1415
- }, 8, ["icon"])) : createCommentVNode("v-if", true)
1448
+ }),
1449
+ 128
1450
+ /* KEYED_FRAGMENT */
1451
+ )),
1452
+ createElementVNode("div", _hoisted_4$2, [
1453
+ __props.config.enableToggleMode ? (openBlock(), createBlock(unref(TMagicButton), {
1454
+ key: 0,
1455
+ icon: unref(Grid),
1456
+ size: "small",
1457
+ onClick: toggleMode
1458
+ }, {
1459
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
1460
+ createTextVNode(
1461
+ "切换为表格",
1462
+ -1
1463
+ /* CACHED */
1464
+ )
1465
+ ])]),
1466
+ _: 1
1467
+ /* STABLE */
1468
+ }, 8, ["icon"])) : createCommentVNode("v-if", true),
1469
+ createElementVNode("div", _hoisted_5$1, [
1470
+ addable.value ? (openBlock(), createBlock(unref(TMagicButton), mergeProps({
1471
+ key: 0,
1472
+ size: __props.config.enableToggleMode ? "small" : "default",
1473
+ icon: unref(Plus)
1474
+ }, __props.config.addButtonConfig?.props || { type: "primary" }, {
1475
+ disabled: __props.disabled,
1476
+ onClick: addHandler
1477
+ }), {
1478
+ default: withCtx(() => [
1479
+ createTextVNode(
1480
+ toDisplayString(__props.config.addButtonConfig?.text || "新增"),
1481
+ 1
1482
+ /* TEXT */
1483
+ )
1484
+ ]),
1485
+ _: 1
1486
+ /* STABLE */
1487
+ }, 16, ["size", "icon", "disabled"])) : createCommentVNode("v-if", true)
1488
+ ])
1489
+ ])
1416
1490
  ]);
1417
1491
  };
1418
1492
  }
@@ -1425,7 +1499,7 @@ const _hoisted_3$2 = {
1425
1499
  style: { "display": "flex" }
1426
1500
  };
1427
1501
  const _hoisted_4$1 = { style: { "flex": "1" } };
1428
- const _hoisted_5$1 = ["src"];
1502
+ const _hoisted_5 = ["src"];
1429
1503
  const _sfc_main$v = /* @__PURE__ */ defineComponent({
1430
1504
  ...{
1431
1505
  name: "MFormPanel"
@@ -1443,7 +1517,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1443
1517
  disabled: { type: Boolean }
1444
1518
  },
1445
1519
  emits: ["change", "addDiffCount"],
1446
- setup(__props, { emit: __emit }) {
1520
+ setup(__props, { expose: __expose, emit: __emit }) {
1447
1521
  const props = __props;
1448
1522
  const emit = __emit;
1449
1523
  const mForm = inject("mForm");
@@ -1454,6 +1528,12 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1454
1528
  emit("change", props.model, eventData);
1455
1529
  };
1456
1530
  const onAddDiffCount = () => emit("addDiffCount");
1531
+ __expose({
1532
+ getExpand: () => expand.value,
1533
+ setExpand: (v) => {
1534
+ expand.value = v;
1535
+ }
1536
+ });
1457
1537
  return (_ctx, _cache) => {
1458
1538
  return items.value && items.value.length ? (openBlock(), createBlock(unref(TMagicCard), {
1459
1539
  key: 0,
@@ -1468,18 +1548,23 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1468
1548
  icon: expand.value ? unref(CaretBottom) : unref(CaretRight),
1469
1549
  onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
1470
1550
  }, null, 8, ["icon"]),
1471
- __props.config && __props.config.extra ? (openBlock(), createElementBlock("span", {
1472
- key: 0,
1473
- innerHTML: __props.config.extra,
1474
- class: "m-form-tip"
1475
- }, null, 8, _hoisted_2$3)) : createCommentVNode("v-if", true),
1476
1551
  renderSlot(_ctx.$slots, "header", {}, () => [
1477
- createTextVNode(
1552
+ createElementVNode(
1553
+ "span",
1554
+ {
1555
+ style: { "cursor": "pointer" },
1556
+ onClick: _cache[1] || (_cache[1] = ($event) => expand.value = !expand.value)
1557
+ },
1478
1558
  toDisplayString(filter(__props.config.title)),
1479
1559
  1
1480
1560
  /* TEXT */
1481
1561
  )
1482
- ])
1562
+ ]),
1563
+ __props.config && __props.config.extra ? (openBlock(), createElementBlock("span", {
1564
+ key: 0,
1565
+ innerHTML: __props.config.extra,
1566
+ class: "m-form-tip"
1567
+ }, null, 8, _hoisted_2$3)) : createCommentVNode("v-if", true)
1483
1568
  ])
1484
1569
  ]),
1485
1570
  default: withCtx(() => [
@@ -1502,7 +1587,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1502
1587
  disabled: __props.disabled,
1503
1588
  "label-width": __props.config.labelWidth || __props.labelWidth,
1504
1589
  onChange: changeHandler,
1505
- onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1590
+ onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
1506
1591
  }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
1507
1592
  }),
1508
1593
  128
@@ -1512,7 +1597,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1512
1597
  createElementVNode("img", {
1513
1598
  class: "m-form-schematic",
1514
1599
  src: __props.config.schematic
1515
- }, null, 8, _hoisted_5$1)
1600
+ }, null, 8, _hoisted_5)
1516
1601
  ])) : (openBlock(true), createElementBlock(
1517
1602
  Fragment,
1518
1603
  { key: 1 },
@@ -1528,7 +1613,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1528
1613
  disabled: __props.disabled,
1529
1614
  "label-width": __props.config.labelWidth || __props.labelWidth,
1530
1615
  onChange: changeHandler,
1531
- onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
1616
+ onAddDiffCount: _cache[3] || (_cache[3] = ($event) => onAddDiffCount())
1532
1617
  }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
1533
1618
  }),
1534
1619
  128
@@ -2022,7 +2107,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
2022
2107
  prop: {},
2023
2108
  disabled: { type: Boolean },
2024
2109
  size: {},
2025
- lastValues: {}
2110
+ lastValues: {},
2111
+ isCompare: { type: Boolean }
2026
2112
  },
2027
2113
  emits: ["change"],
2028
2114
  setup(__props, { emit: __emit }) {
@@ -2149,7 +2235,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
2149
2235
  prop: {},
2150
2236
  disabled: { type: Boolean },
2151
2237
  size: {},
2152
- lastValues: {}
2238
+ lastValues: {},
2239
+ isCompare: { type: Boolean }
2153
2240
  },
2154
2241
  emits: ["change"],
2155
2242
  setup(__props, { emit: __emit }) {
@@ -2221,7 +2308,8 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
2221
2308
  prop: {},
2222
2309
  disabled: { type: Boolean },
2223
2310
  size: {},
2224
- lastValues: {}
2311
+ lastValues: {},
2312
+ isCompare: { type: Boolean }
2225
2313
  },
2226
2314
  emits: ["change"],
2227
2315
  setup(__props, { emit: __emit }) {
@@ -2294,7 +2382,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
2294
2382
  prop: {},
2295
2383
  disabled: { type: Boolean },
2296
2384
  size: {},
2297
- lastValues: {}
2385
+ lastValues: {},
2386
+ isCompare: { type: Boolean }
2298
2387
  },
2299
2388
  emits: ["change"],
2300
2389
  setup(__props, { emit: __emit }) {
@@ -2328,7 +2417,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
2328
2417
  prop: {},
2329
2418
  disabled: { type: Boolean },
2330
2419
  size: {},
2331
- lastValues: {}
2420
+ lastValues: {},
2421
+ isCompare: { type: Boolean }
2332
2422
  },
2333
2423
  emits: ["change"],
2334
2424
  setup(__props, { emit: __emit }) {
@@ -2368,7 +2458,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
2368
2458
  prop: {},
2369
2459
  disabled: { type: Boolean },
2370
2460
  size: {},
2371
- lastValues: {}
2461
+ lastValues: {},
2462
+ isCompare: { type: Boolean }
2372
2463
  },
2373
2464
  emits: ["change"],
2374
2465
  setup(__props, { emit: __emit }) {
@@ -2480,7 +2571,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
2480
2571
  prop: {},
2481
2572
  disabled: { type: Boolean },
2482
2573
  size: {},
2483
- lastValues: {}
2574
+ lastValues: {},
2575
+ isCompare: { type: Boolean }
2484
2576
  },
2485
2577
  emits: ["change"],
2486
2578
  setup(__props, { emit: __emit }) {
@@ -2534,7 +2626,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
2534
2626
  prop: {},
2535
2627
  disabled: { type: Boolean },
2536
2628
  size: {},
2537
- lastValues: {}
2629
+ lastValues: {},
2630
+ isCompare: { type: Boolean }
2538
2631
  },
2539
2632
  setup(__props) {
2540
2633
  const props = __props;
@@ -2569,7 +2662,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2569
2662
  prop: {},
2570
2663
  disabled: { type: Boolean },
2571
2664
  size: {},
2572
- lastValues: {}
2665
+ lastValues: {},
2666
+ isCompare: { type: Boolean }
2573
2667
  },
2574
2668
  emits: ["change"],
2575
2669
  setup(__props, { emit: __emit }) {
@@ -2670,7 +2764,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2670
2764
  prop: {},
2671
2765
  disabled: { type: Boolean },
2672
2766
  size: {},
2673
- lastValues: {}
2767
+ lastValues: {},
2768
+ isCompare: { type: Boolean }
2674
2769
  },
2675
2770
  setup(__props) {
2676
2771
  const props = __props;
@@ -2935,7 +3030,12 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2935
3030
  zIndex: {},
2936
3031
  size: {},
2937
3032
  confirmText: { default: "确定" },
2938
- preventSubmitDefault: { type: Boolean }
3033
+ preventSubmitDefault: { type: Boolean },
3034
+ closeOnClickModal: { type: Boolean, default: false },
3035
+ closeOnPressEscape: { type: Boolean, default: false },
3036
+ destroyOnClose: { type: Boolean, default: false },
3037
+ showClose: { type: Boolean, default: true },
3038
+ showCancel: { type: Boolean, default: true }
2939
3039
  },
2940
3040
  emits: ["close", "submit", "error", "change"],
2941
3041
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -3015,7 +3115,10 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
3015
3115
  width: __props.width,
3016
3116
  zIndex: __props.zIndex,
3017
3117
  fullscreen: __props.fullscreen,
3018
- "close-on-click-modal": false,
3118
+ "close-on-click-modal": __props.closeOnClickModal,
3119
+ "close-on-press-escape": __props.closeOnPressEscape,
3120
+ "destroy-on-close": __props.destroyOnClose,
3121
+ "show-close": __props.showClose,
3019
3122
  onClose: closeHandler
3020
3123
  }, {
3021
3124
  footer: withCtx(() => [
@@ -3036,8 +3139,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
3036
3139
  createVNode(unref(TMagicCol), { span: 12 }, {
3037
3140
  default: withCtx(() => [
3038
3141
  renderSlot(_ctx.$slots, "footer", {}, () => [
3039
- createVNode(unref(TMagicButton), {
3040
- type: "default",
3142
+ __props.showCancel ? (openBlock(), createBlock(unref(TMagicButton), {
3143
+ key: 0,
3041
3144
  onClick: cancel,
3042
3145
  size: "small"
3043
3146
  }, {
@@ -3050,9 +3153,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
3050
3153
  ])]),
3051
3154
  _: 1
3052
3155
  /* STABLE */
3053
- }),
3156
+ })) : createCommentVNode("v-if", true),
3054
3157
  hasStep.value && stepActive.value > 1 ? (openBlock(), createBlock(unref(TMagicButton), {
3055
- key: 0,
3158
+ key: 1,
3056
3159
  type: "info",
3057
3160
  size: "small",
3058
3161
  onClick: preStep
@@ -3068,7 +3171,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
3068
3171
  /* STABLE */
3069
3172
  })) : createCommentVNode("v-if", true),
3070
3173
  hasStep.value && stepCount.value > stepActive.value ? (openBlock(), createBlock(unref(TMagicButton), {
3071
- key: 1,
3174
+ key: 2,
3072
3175
  type: "info",
3073
3176
  size: "small",
3074
3177
  onClick: nextStep
@@ -3083,7 +3186,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
3083
3186
  _: 1
3084
3187
  /* STABLE */
3085
3188
  })) : (openBlock(), createBlock(unref(TMagicButton), {
3086
- key: 2,
3189
+ key: 3,
3087
3190
  type: "primary",
3088
3191
  size: "small",
3089
3192
  disabled: __props.disabled,
@@ -3143,7 +3246,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
3143
3246
  ]),
3144
3247
  _: 3
3145
3248
  /* FORWARDED */
3146
- }, 8, ["modelValue", "title", "width", "zIndex", "fullscreen"]);
3249
+ }, 8, ["modelValue", "title", "width", "zIndex", "fullscreen", "close-on-click-modal", "close-on-press-escape", "destroy-on-close", "show-close"]);
3147
3250
  };
3148
3251
  }
3149
3252
  });
@@ -3167,7 +3270,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3167
3270
  prop: {},
3168
3271
  disabled: { type: Boolean },
3169
3272
  size: {},
3170
- lastValues: {}
3273
+ lastValues: {},
3274
+ isCompare: { type: Boolean }
3171
3275
  },
3172
3276
  emits: ["change"],
3173
3277
  setup(__props, { emit: __emit }) {
@@ -3190,7 +3294,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3190
3294
  if (typeof props.config.form === "function") {
3191
3295
  return props.config.form(mForm, {
3192
3296
  model: props.model || {},
3193
- values: props.values || {}
3297
+ values: mForm ? readonly(mForm.initValues) : null,
3298
+ formValue: props.values || {}
3194
3299
  });
3195
3300
  }
3196
3301
  return props.config.form;
@@ -3277,16 +3382,27 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3277
3382
  prop: {},
3278
3383
  disabled: { type: Boolean },
3279
3384
  size: {},
3280
- lastValues: {}
3385
+ lastValues: {},
3386
+ isCompare: { type: Boolean }
3281
3387
  },
3282
3388
  emits: ["change", "input"],
3283
3389
  setup(__props, { emit: __emit }) {
3284
3390
  const props = __props;
3285
3391
  const emit = __emit;
3392
+ const value = ref();
3393
+ watch(
3394
+ () => props.model[props.name],
3395
+ (v) => {
3396
+ value.value = v;
3397
+ },
3398
+ {
3399
+ immediate: true
3400
+ }
3401
+ );
3286
3402
  useAddField(props.prop);
3287
3403
  const mForm = inject("mForm");
3288
- const changeHandler = (value) => {
3289
- emit("change", value);
3404
+ const changeHandler = (value2) => {
3405
+ emit("change", value2);
3290
3406
  };
3291
3407
  const inputHandler = (v) => {
3292
3408
  emit("input", v);
@@ -3295,7 +3411,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3295
3411
  return (_ctx, _cache) => {
3296
3412
  return __props.model ? (openBlock(), createBlock(unref(TMagicInputNumber), {
3297
3413
  key: 0,
3298
- "model-value": __props.model[__props.name],
3414
+ modelValue: value.value,
3415
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
3299
3416
  clearable: "",
3300
3417
  "controls-position": "right",
3301
3418
  size: __props.size,
@@ -3304,9 +3421,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3304
3421
  step: __props.config.step,
3305
3422
  placeholder: __props.config.placeholder,
3306
3423
  disabled: __props.disabled,
3307
- "onUpdate:modelValue": changeHandler,
3424
+ onChange: changeHandler,
3308
3425
  onInput: inputHandler
3309
- }, null, 8, ["model-value", "size", "max", "min", "step", "placeholder", "disabled"])) : createCommentVNode("v-if", true);
3426
+ }, null, 8, ["modelValue", "size", "max", "min", "step", "placeholder", "disabled"])) : createCommentVNode("v-if", true);
3310
3427
  };
3311
3428
  }
3312
3429
  });
@@ -3326,12 +3443,26 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3326
3443
  prop: {},
3327
3444
  disabled: { type: Boolean },
3328
3445
  size: {},
3329
- lastValues: {}
3446
+ lastValues: {},
3447
+ isCompare: { type: Boolean }
3330
3448
  },
3331
3449
  emits: ["change"],
3332
3450
  setup(__props, { emit: __emit }) {
3333
3451
  const props = __props;
3334
3452
  const emit = __emit;
3453
+ const firstValue = ref();
3454
+ const secondValue = ref();
3455
+ watch(
3456
+ () => props.model[props.name],
3457
+ ([first, second]) => {
3458
+ firstValue.value = first;
3459
+ secondValue.value = second;
3460
+ },
3461
+ {
3462
+ immediate: true,
3463
+ deep: true
3464
+ }
3465
+ );
3335
3466
  useAddField(props.prop);
3336
3467
  if (!Array.isArray(props.model[props.name])) {
3337
3468
  props.model[props.name] = [];
@@ -3345,13 +3476,14 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3345
3476
  return (_ctx, _cache) => {
3346
3477
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
3347
3478
  createVNode(unref(TMagicInput), {
3348
- "model-value": __props.model[__props.name][0],
3479
+ modelValue: firstValue.value,
3480
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => firstValue.value = $event),
3349
3481
  clearable: __props.config.clearable ?? true,
3350
3482
  size: __props.size,
3351
3483
  disabled: __props.disabled,
3352
- "onUpdate:modelValue": minChangeHandler
3353
- }, null, 8, ["model-value", "clearable", "size", "disabled"]),
3354
- _cache[0] || (_cache[0] = createElementVNode(
3484
+ onChange: minChangeHandler
3485
+ }, null, 8, ["modelValue", "clearable", "size", "disabled"]),
3486
+ _cache[2] || (_cache[2] = createElementVNode(
3355
3487
  "span",
3356
3488
  { class: "split-tag" },
3357
3489
  "-",
@@ -3359,12 +3491,13 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3359
3491
  /* CACHED */
3360
3492
  )),
3361
3493
  createVNode(unref(TMagicInput), {
3362
- "model-value": __props.model[__props.name][1],
3494
+ modelValue: secondValue.value,
3495
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => secondValue.value = $event),
3363
3496
  clearable: __props.config.clearable ?? true,
3364
3497
  size: __props.size,
3365
3498
  disabled: __props.disabled,
3366
- "onUpdate:modelValue": maxChangeHandler
3367
- }, null, 8, ["model-value", "clearable", "size", "disabled"])
3499
+ onChange: maxChangeHandler
3500
+ }, null, 8, ["modelValue", "clearable", "size", "disabled"])
3368
3501
  ]);
3369
3502
  };
3370
3503
  }
@@ -3384,7 +3517,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3384
3517
  prop: {},
3385
3518
  disabled: { type: Boolean },
3386
3519
  size: {},
3387
- lastValues: {}
3520
+ lastValues: {},
3521
+ isCompare: { type: Boolean }
3388
3522
  },
3389
3523
  emits: ["change"],
3390
3524
  setup(__props, { emit: __emit }) {
@@ -3482,7 +3616,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3482
3616
  prop: {},
3483
3617
  disabled: { type: Boolean },
3484
3618
  size: {},
3485
- lastValues: {}
3619
+ lastValues: {},
3620
+ isCompare: { type: Boolean }
3486
3621
  },
3487
3622
  emits: ["change"],
3488
3623
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -3933,7 +4068,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3933
4068
  prop: {},
3934
4069
  disabled: { type: Boolean },
3935
4070
  size: {},
3936
- lastValues: {}
4071
+ lastValues: {},
4072
+ isCompare: { type: Boolean }
3937
4073
  },
3938
4074
  emits: ["change"],
3939
4075
  setup(__props, { emit: __emit }) {
@@ -3993,7 +4129,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
3993
4129
  prop: {},
3994
4130
  disabled: { type: Boolean },
3995
4131
  size: {},
3996
- lastValues: {}
4132
+ lastValues: {},
4133
+ isCompare: { type: Boolean }
3997
4134
  },
3998
4135
  emits: ["change", "input"],
3999
4136
  setup(__props, { emit: __emit }) {
@@ -4001,6 +4138,16 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4001
4138
  const emit = __emit;
4002
4139
  useAddField(props.prop);
4003
4140
  const mForm = inject("mForm");
4141
+ const value = ref("");
4142
+ watch(
4143
+ () => props.model[props.name],
4144
+ (v) => {
4145
+ value.value = v;
4146
+ },
4147
+ {
4148
+ immediate: true
4149
+ }
4150
+ );
4004
4151
  const appendConfig = computed(() => {
4005
4152
  if (typeof props.config.append === "string") {
4006
4153
  return {
@@ -4031,13 +4178,13 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4031
4178
  emit("change", props.model[props.name].trim() || "");
4032
4179
  popoverVisible.value = false;
4033
4180
  };
4034
- const checkWhiteSpace = debounce((value) => {
4035
- if (typeof value === "string" && !props.config.trim) {
4036
- popoverVisible.value = value.trim() !== value;
4181
+ const checkWhiteSpace = debounce((value2) => {
4182
+ if (typeof value2 === "string" && !props.config.trim) {
4183
+ popoverVisible.value = value2.trim() !== value2;
4037
4184
  }
4038
4185
  }, 300);
4039
- const changeHandler = (value) => {
4040
- emit("change", value);
4186
+ const changeHandler = (value2) => {
4187
+ emit("change", value2);
4041
4188
  };
4042
4189
  const inputHandler = (v) => {
4043
4190
  checkWhiteSpace(v);
@@ -4047,10 +4194,25 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4047
4194
  const buttonClickHandler = () => {
4048
4195
  if (!appendConfig.value) return;
4049
4196
  if (typeof appendConfig.value.handler === "function") {
4197
+ const newChangeRecords = [];
4198
+ const setModel = (key, value2) => {
4199
+ newChangeRecords.push({ propPath: props.prop.replace(`${props.name}`, key), value: value2 });
4200
+ };
4201
+ const setFormValue = (key, value2) => {
4202
+ newChangeRecords.push({ propPath: key, value: value2 });
4203
+ };
4050
4204
  appendConfig.value.handler(mForm, {
4051
4205
  model: props.model,
4052
- values: mForm?.values
4206
+ values: mForm ? readonly(mForm.initValues) : null,
4207
+ formValue: props.values || {},
4208
+ setModel,
4209
+ setFormValue
4053
4210
  });
4211
+ if (newChangeRecords.length > 0) {
4212
+ emit("change", props.model[props.name], {
4213
+ changeRecords: newChangeRecords
4214
+ });
4215
+ }
4054
4216
  }
4055
4217
  };
4056
4218
  const keyUpHandler = ($event) => {
@@ -4061,13 +4223,13 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4061
4223
  if (!arrowUp && !arrowDown) {
4062
4224
  return;
4063
4225
  }
4064
- const value = props.model[props.name];
4226
+ const value2 = props.model[props.name];
4065
4227
  let num;
4066
4228
  let unit;
4067
- if (isNumber(value)) {
4068
- num = +value;
4229
+ if (isNumber(value2)) {
4230
+ num = +value2;
4069
4231
  } else {
4070
- value.replace(/^([0-9.]+)([a-z%]+)$/, ($0, $1, $2) => {
4232
+ value2.replace(/^([0-9.]+)([a-z%]+)$/, ($0, $1, $2) => {
4071
4233
  num = +$1;
4072
4234
  unit = $2;
4073
4235
  });
@@ -4129,16 +4291,17 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4129
4291
  return (_ctx, _cache) => {
4130
4292
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
4131
4293
  createVNode(unref(TMagicInput), {
4132
- "model-value": __props.model[__props.name],
4294
+ modelValue: value.value,
4295
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
4133
4296
  ref_key: "input",
4134
4297
  ref: input,
4135
4298
  clearable: "",
4136
4299
  size: __props.size,
4137
4300
  placeholder: __props.config.placeholder,
4138
4301
  disabled: __props.disabled,
4139
- "onUpdate:modelValue": changeHandler,
4302
+ onChange: changeHandler,
4140
4303
  onInput: inputHandler,
4141
- onKeyup: _cache[0] || (_cache[0] = ($event) => keyUpHandler($event))
4304
+ onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
4142
4305
  }, createSlots({
4143
4306
  _: 2
4144
4307
  /* DYNAMIC */
@@ -4184,7 +4347,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4184
4347
  ]),
4185
4348
  key: "1"
4186
4349
  } : void 0
4187
- ]), 1032, ["model-value", "size", "placeholder", "disabled"]),
4350
+ ]), 1032, ["modelValue", "size", "placeholder", "disabled"]),
4188
4351
  (openBlock(), createBlock(Teleport, { to: "body" }, [
4189
4352
  popoverVisible.value ? (openBlock(), createElementBlock(
4190
4353
  "div",
@@ -4195,7 +4358,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4195
4358
  ref: popoverEl
4196
4359
  },
4197
4360
  [
4198
- _cache[4] || (_cache[4] = createElementVNode(
4361
+ _cache[5] || (_cache[5] = createElementVNode(
4199
4362
  "div",
4200
4363
  { class: "m-form-validate__warning" },
4201
4364
  "输入内容前后有空格,是否移除空格?",
@@ -4206,9 +4369,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4206
4369
  createVNode(unref(TMagicButton), {
4207
4370
  link: "",
4208
4371
  size: "small",
4209
- onClick: _cache[1] || (_cache[1] = ($event) => popoverVisible.value = false)
4372
+ onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
4210
4373
  }, {
4211
- default: withCtx(() => [..._cache[2] || (_cache[2] = [
4374
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
4212
4375
  createTextVNode(
4213
4376
  "保持原样",
4214
4377
  -1
@@ -4223,7 +4386,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4223
4386
  size: "small",
4224
4387
  onClick: confirmTrimHandler
4225
4388
  }, {
4226
- default: withCtx(() => [..._cache[3] || (_cache[3] = [
4389
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
4227
4390
  createTextVNode(
4228
4391
  "移除空格",
4229
4392
  -1
@@ -4234,7 +4397,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4234
4397
  /* STABLE */
4235
4398
  })
4236
4399
  ]),
4237
- _cache[5] || (_cache[5] = createElementVNode(
4400
+ _cache[6] || (_cache[6] = createElementVNode(
4238
4401
  "span",
4239
4402
  {
4240
4403
  class: "tmagic-form-text-popper-arrow",
@@ -4268,16 +4431,27 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4268
4431
  prop: {},
4269
4432
  disabled: { type: Boolean },
4270
4433
  size: {},
4271
- lastValues: {}
4434
+ lastValues: {},
4435
+ isCompare: { type: Boolean }
4272
4436
  },
4273
4437
  emits: ["change", "input"],
4274
4438
  setup(__props, { emit: __emit }) {
4275
4439
  const props = __props;
4276
4440
  const emit = __emit;
4441
+ const value = ref("");
4442
+ watch(
4443
+ () => props.model[props.name],
4444
+ (v) => {
4445
+ value.value = v;
4446
+ },
4447
+ {
4448
+ immediate: true
4449
+ }
4450
+ );
4277
4451
  useAddField(props.prop);
4278
4452
  const mForm = inject("mForm");
4279
- const changeHandler = (value) => {
4280
- emit("change", value);
4453
+ const changeHandler = (value2) => {
4454
+ emit("change", value2);
4281
4455
  };
4282
4456
  const inputHandler = (v) => {
4283
4457
  emit("input", v);
@@ -4285,16 +4459,17 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4285
4459
  };
4286
4460
  return (_ctx, _cache) => {
4287
4461
  return openBlock(), createBlock(unref(TMagicInput), {
4288
- "model-value": __props.model[__props.name],
4462
+ modelValue: value.value,
4463
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
4289
4464
  type: "textarea",
4290
4465
  size: __props.size,
4291
4466
  clearable: "",
4292
4467
  placeholder: __props.config.placeholder,
4293
4468
  disabled: __props.disabled,
4294
4469
  rows: __props.config.rows,
4295
- "onUpdate:modelValue": changeHandler,
4470
+ onChange: changeHandler,
4296
4471
  onInput: inputHandler
4297
- }, null, 8, ["model-value", "size", "placeholder", "disabled", "rows"]);
4472
+ }, null, 8, ["modelValue", "size", "placeholder", "disabled", "rows"]);
4298
4473
  };
4299
4474
  }
4300
4475
  });
@@ -4313,7 +4488,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
4313
4488
  prop: {},
4314
4489
  disabled: { type: Boolean },
4315
4490
  size: {},
4316
- lastValues: {}
4491
+ lastValues: {},
4492
+ isCompare: { type: Boolean }
4317
4493
  },
4318
4494
  emits: ["change"],
4319
4495
  setup(__props, { emit: __emit }) {
@@ -4351,7 +4527,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4351
4527
  prop: {},
4352
4528
  disabled: { type: Boolean },
4353
4529
  size: {},
4354
- lastValues: {}
4530
+ lastValues: {},
4531
+ isCompare: { type: Boolean }
4355
4532
  },
4356
4533
  emits: ["change"],
4357
4534
  setup(__props, { emit: __emit }) {
@@ -4472,6 +4649,7 @@ const useAdd = (props, emit) => {
4472
4649
  if (typeof props.config.defaultAdd === "function") {
4473
4650
  inputs = await props.config.defaultAdd(mForm, {
4474
4651
  model: props.model[modelName],
4652
+ prop: props.prop,
4475
4653
  formValue: mForm?.values
4476
4654
  });
4477
4655
  } else if (props.config.defaultAdd) {
@@ -4502,16 +4680,10 @@ const useAdd = (props, emit) => {
4502
4680
 
4503
4681
  const useFullscreen = () => {
4504
4682
  const isFullscreen = ref(false);
4505
- const mTableEl = useTemplateRef("mTable");
4506
- const { nextZIndex } = useZIndex();
4507
4683
  const toggleFullscreen = () => {
4508
- if (!mTableEl.value) return;
4509
4684
  if (isFullscreen.value) {
4510
- mTableEl.value.classList.remove("fixed");
4511
4685
  isFullscreen.value = false;
4512
4686
  } else {
4513
- mTableEl.value.classList.add("fixed");
4514
- mTableEl.value.style.zIndex = `${nextZIndex()}`;
4515
4687
  isFullscreen.value = true;
4516
4688
  }
4517
4689
  };
@@ -4617,7 +4789,7 @@ const useSortable = (props, emit, tMagicTableRef, modelName) => {
4617
4789
  const rowDrop = () => {
4618
4790
  sortable?.destroy();
4619
4791
  const tableEl = tMagicTableRef.value?.getEl();
4620
- const tBodyEl = tableEl?.querySelector(".el-table__body > tbody");
4792
+ const tBodyEl = tableEl?.querySelector(".el-table__body > tbody") || tableEl?.querySelector(".t-table__body");
4621
4793
  if (!tBodyEl) {
4622
4794
  return;
4623
4795
  }
@@ -4864,6 +5036,17 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
4864
5036
  }
4865
5037
  return fuc;
4866
5038
  };
5039
+ const titleTip = (fuc) => {
5040
+ if (typeof fuc === "function") {
5041
+ return fuc(mForm, {
5042
+ values: mForm?.initValues,
5043
+ model: props.model,
5044
+ formValue: mForm ? mForm.values : props.model,
5045
+ prop: props.prop
5046
+ });
5047
+ }
5048
+ return fuc;
5049
+ };
4867
5050
  const selection = computed(() => {
4868
5051
  if (typeof props.config.selection === "function") {
4869
5052
  return props.config.selection(mForm, { model: props.model[modelName.value] });
@@ -4900,10 +5083,14 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
4900
5083
  })
4901
5084
  });
4902
5085
  }
4903
- columns2.push({
5086
+ let actionFixed = props.config.fixed === false ? void 0 : "left";
5087
+ if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) {
5088
+ actionFixed = props.config.fixed;
5089
+ }
5090
+ const actionClumn = {
4904
5091
  props: {
4905
5092
  label: "操作",
4906
- fixed: props.config.fixed === false ? void 0 : "left",
5093
+ fixed: actionFixed,
4907
5094
  width: props.config.operateColWidth || 112,
4908
5095
  align: "center"
4909
5096
  },
@@ -4922,7 +5109,10 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
4922
5109
  emit("change", v);
4923
5110
  }
4924
5111
  })
4925
- });
5112
+ };
5113
+ if (actionFixed !== "right") {
5114
+ columns2.push(actionClumn);
5115
+ }
4926
5116
  if (props.sort && props.model[modelName.value] && props.model[modelName.value].length > 1) {
4927
5117
  columns2.push({
4928
5118
  props: {
@@ -4965,6 +5155,7 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
4965
5155
  }
4966
5156
  for (const column of props.config.items) {
4967
5157
  if (column.type !== "hidden" && display$1(column.display)) {
5158
+ const titleTipValue = titleTip(column.titleTip);
4968
5159
  columns2.push({
4969
5160
  props: {
4970
5161
  prop: column.name,
@@ -4986,10 +5177,33 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
4986
5177
  size: props.size,
4987
5178
  onChange: changeHandler,
4988
5179
  onAddDiffCount
4989
- })
5180
+ }),
5181
+ title: titleTipValue ? () => h(
5182
+ TMagicTooltip,
5183
+ { placement: "top" },
5184
+ {
5185
+ default: () => h(
5186
+ "span",
5187
+ {
5188
+ style: {
5189
+ display: "inline-flex",
5190
+ alignItems: "center",
5191
+ gap: "5px"
5192
+ }
5193
+ },
5194
+ [h("span", column.label), h(TMagicIcon, {}, { default: () => h(WarningFilled) })]
5195
+ ),
5196
+ content: () => h("div", {
5197
+ innerHTML: titleTipValue
5198
+ })
5199
+ }
5200
+ ) : void 0
4990
5201
  });
4991
5202
  }
4992
5203
  }
5204
+ if (actionFixed === "right") {
5205
+ columns2.push(actionClumn);
5206
+ }
4993
5207
  return columns2;
4994
5208
  });
4995
5209
  return {
@@ -4997,11 +5211,10 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
4997
5211
  };
4998
5212
  };
4999
5213
 
5000
- const _hoisted_1$1 = { class: "m-fields-table-wrap" };
5001
- const _hoisted_2 = ["innerHTML"];
5002
- const _hoisted_3 = { style: { "display": "flex", "justify-content": "space-between", "margin": "10px 0" } };
5003
- const _hoisted_4 = { style: { "display": "flex" } };
5004
- const _hoisted_5 = {
5214
+ const _hoisted_1$1 = ["innerHTML"];
5215
+ const _hoisted_2 = { style: { "display": "flex", "justify-content": "space-between", "margin": "10px 0" } };
5216
+ const _hoisted_3 = { style: { "display": "flex" } };
5217
+ const _hoisted_4 = {
5005
5218
  key: 1,
5006
5219
  class: "bottom",
5007
5220
  style: { "text-align": "right" }
@@ -5037,6 +5250,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
5037
5250
  props,
5038
5251
  modelName
5039
5252
  );
5253
+ const { nextZIndex } = useZIndex();
5040
5254
  const { addable, newHandler } = useAdd(props, emit);
5041
5255
  const { columns } = useTableColumns(props, emit, currentPage, pageSize, modelName);
5042
5256
  useSortable(props, emit, tMagicTableRef, modelName);
@@ -5074,170 +5288,178 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
5074
5288
  toggleRowSelection
5075
5289
  });
5076
5290
  return (_ctx, _cache) => {
5077
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
5078
- (openBlock(), createBlock(Teleport, {
5079
- to: "body",
5080
- disabled: !unref(isFullscreen)
5081
- }, [
5082
- createElementVNode(
5083
- "div",
5084
- {
5085
- ref: "mTable",
5086
- class: normalizeClass(["m-fields-table", { "m-fields-table-item-extra": __props.config.itemExtra }])
5087
- },
5088
- [
5089
- __props.config.extra ? (openBlock(), createElementBlock("span", {
5090
- key: 0,
5091
- style: { "color": "rgba(0, 0, 0, 0.45)" },
5092
- innerHTML: __props.config.extra
5093
- }, null, 8, _hoisted_2)) : createCommentVNode("v-if", true),
5094
- createVNode(unref(TMagicTooltip), {
5095
- content: "拖拽可排序",
5096
- placement: "left-start",
5097
- disabled: __props.config.dropSort !== true
5098
- }, {
5099
- default: withCtx(() => [
5100
- __props.model[modelName.value] ? (openBlock(), createBlock(unref(TMagicTable), {
5101
- ref: "tMagicTable",
5102
- style: { "width": "100%" },
5103
- "show-header": "",
5104
- "row-key": __props.config.rowKey || "id",
5105
- columns: unref(columns),
5106
- data: data.value,
5107
- border: __props.config.border,
5108
- "max-height": __props.config.maxHeight,
5109
- "default-expand-all": true,
5110
- key: updateKey.value,
5111
- onSelect: unref(selectHandle),
5112
- onSortChange: sortChangeHandler
5113
- }, null, 8, ["row-key", "columns", "data", "border", "max-height", "onSelect"])) : createCommentVNode("v-if", true)
5114
- ]),
5115
- _: 1
5116
- /* STABLE */
5117
- }, 8, ["disabled"]),
5118
- renderSlot(_ctx.$slots, "default"),
5119
- createElementVNode("div", _hoisted_3, [
5120
- createElementVNode("div", _hoisted_4, [
5121
- __props.enableToggleMode && __props.config.enableToggleMode !== false && !unref(isFullscreen) ? (openBlock(), createBlock(unref(TMagicButton), {
5291
+ return openBlock(), createBlock(Teleport, {
5292
+ to: "body",
5293
+ disabled: !unref(isFullscreen)
5294
+ }, [
5295
+ createElementVNode(
5296
+ "div",
5297
+ mergeProps(_ctx.$attrs, {
5298
+ class: ["m-fields-table-wrap", { fixed: unref(isFullscreen) }],
5299
+ style: unref(isFullscreen) ? `z-index: ${unref(nextZIndex)()}` : ""
5300
+ }),
5301
+ [
5302
+ createElementVNode(
5303
+ "div",
5304
+ {
5305
+ class: normalizeClass(["m-fields-table", { "m-fields-table-item-extra": __props.config.itemExtra }])
5306
+ },
5307
+ [
5308
+ __props.config.extra ? (openBlock(), createElementBlock("span", {
5309
+ key: 0,
5310
+ style: { "color": "rgba(0, 0, 0, 0.45)" },
5311
+ innerHTML: __props.config.extra
5312
+ }, null, 8, _hoisted_1$1)) : createCommentVNode("v-if", true),
5313
+ createVNode(unref(TMagicTooltip), {
5314
+ content: "拖拽可排序",
5315
+ placement: "left-start",
5316
+ disabled: __props.config.dropSort !== true
5317
+ }, {
5318
+ default: withCtx(() => [
5319
+ __props.model[modelName.value] ? (openBlock(), createBlock(unref(TMagicTable), {
5320
+ ref: "tMagicTable",
5321
+ style: { "width": "100%" },
5322
+ "show-header": "",
5323
+ "row-key": __props.config.rowKey || "id",
5324
+ columns: unref(columns),
5325
+ data: data.value,
5326
+ border: __props.config.border,
5327
+ "max-height": __props.config.maxHeight,
5328
+ "default-expand-all": true,
5329
+ key: updateKey.value,
5330
+ onSelect: unref(selectHandle),
5331
+ onSortChange: sortChangeHandler
5332
+ }, null, 8, ["row-key", "columns", "data", "border", "max-height", "onSelect"])) : createCommentVNode("v-if", true)
5333
+ ]),
5334
+ _: 1
5335
+ /* STABLE */
5336
+ }, 8, ["disabled"]),
5337
+ renderSlot(_ctx.$slots, "default"),
5338
+ createElementVNode("div", _hoisted_2, [
5339
+ createElementVNode("div", _hoisted_3, [
5340
+ __props.enableToggleMode && __props.config.enableToggleMode !== false && !unref(isFullscreen) ? (openBlock(), createBlock(unref(TMagicButton), {
5341
+ key: 0,
5342
+ icon: unref(Grid),
5343
+ size: "small",
5344
+ onClick: toggleMode
5345
+ }, {
5346
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [
5347
+ createTextVNode(
5348
+ "展开配置",
5349
+ -1
5350
+ /* CACHED */
5351
+ )
5352
+ ])]),
5353
+ _: 1
5354
+ /* STABLE */
5355
+ }, 8, ["icon"])) : createCommentVNode("v-if", true),
5356
+ __props.config.enableFullscreen !== false ? (openBlock(), createBlock(unref(TMagicButton), {
5357
+ key: 1,
5358
+ icon: unref(FullScreen),
5359
+ size: "small",
5360
+ onClick: unref(toggleFullscreen)
5361
+ }, {
5362
+ default: withCtx(() => [
5363
+ createTextVNode(
5364
+ toDisplayString(unref(isFullscreen) ? "退出全屏" : "全屏编辑"),
5365
+ 1
5366
+ /* TEXT */
5367
+ )
5368
+ ]),
5369
+ _: 1
5370
+ /* STABLE */
5371
+ }, 8, ["icon", "onClick"])) : createCommentVNode("v-if", true),
5372
+ unref(importable) ? (openBlock(), createBlock(unref(TMagicUpload), {
5373
+ key: 2,
5374
+ style: { "display": "inline-block" },
5375
+ ref: "excelBtn",
5376
+ action: "/noop",
5377
+ disabled: __props.disabled,
5378
+ "on-change": unref(excelHandler),
5379
+ "auto-upload": false
5380
+ }, {
5381
+ default: withCtx(() => [
5382
+ createVNode(unref(TMagicButton), {
5383
+ size: "small",
5384
+ type: "success",
5385
+ disabled: __props.disabled,
5386
+ plain: ""
5387
+ }, {
5388
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
5389
+ createTextVNode(
5390
+ "导入EXCEL",
5391
+ -1
5392
+ /* CACHED */
5393
+ )
5394
+ ])]),
5395
+ _: 1
5396
+ /* STABLE */
5397
+ }, 8, ["disabled"])
5398
+ ]),
5399
+ _: 1
5400
+ /* STABLE */
5401
+ }, 8, ["disabled", "on-change"])) : createCommentVNode("v-if", true),
5402
+ unref(importable) ? (openBlock(), createBlock(unref(TMagicButton), {
5403
+ key: 3,
5404
+ size: "small",
5405
+ type: "warning",
5406
+ disabled: __props.disabled,
5407
+ plain: "",
5408
+ onClick: unref(clearHandler)
5409
+ }, {
5410
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
5411
+ createTextVNode(
5412
+ "清空",
5413
+ -1
5414
+ /* CACHED */
5415
+ )
5416
+ ])]),
5417
+ _: 1
5418
+ /* STABLE */
5419
+ }, 8, ["disabled", "onClick"])) : createCommentVNode("v-if", true)
5420
+ ]),
5421
+ unref(addable) ? (openBlock(), createBlock(unref(TMagicButton), mergeProps({
5122
5422
  key: 0,
5123
- icon: unref(Grid),
5124
- size: "small",
5125
- type: "defalut",
5126
- onClick: toggleMode
5127
- }, {
5128
- default: withCtx(() => [..._cache[1] || (_cache[1] = [
5129
- createTextVNode(
5130
- "展开配置",
5131
- -1
5132
- /* CACHED */
5133
- )
5134
- ])]),
5135
- _: 1
5136
- /* STABLE */
5137
- }, 8, ["icon"])) : createCommentVNode("v-if", true),
5138
- __props.config.enableFullscreen !== false ? (openBlock(), createBlock(unref(TMagicButton), {
5139
- key: 1,
5140
- icon: unref(FullScreen),
5423
+ class: "m-form-table-add-button",
5141
5424
  size: "small",
5142
- type: "defalut",
5143
- onClick: unref(toggleFullscreen)
5144
- }, {
5425
+ plain: "",
5426
+ icon: unref(Plus)
5427
+ }, __props.config.addButtonConfig?.props || { type: "primary" }, {
5428
+ disabled: __props.disabled,
5429
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(newHandler)())
5430
+ }), {
5145
5431
  default: withCtx(() => [
5146
5432
  createTextVNode(
5147
- toDisplayString(unref(isFullscreen) ? "退出全屏" : "全屏编辑"),
5433
+ toDisplayString(__props.config.addButtonConfig?.text || "新增一行"),
5148
5434
  1
5149
5435
  /* TEXT */
5150
5436
  )
5151
5437
  ]),
5152
5438
  _: 1
5153
5439
  /* STABLE */
5154
- }, 8, ["icon", "onClick"])) : createCommentVNode("v-if", true),
5155
- unref(importable) ? (openBlock(), createBlock(unref(TMagicUpload), {
5156
- key: 2,
5157
- style: { "display": "inline-block" },
5158
- ref: "excelBtn",
5159
- action: "/noop",
5160
- disabled: __props.disabled,
5161
- "on-change": unref(excelHandler),
5162
- "auto-upload": false
5163
- }, {
5164
- default: withCtx(() => [
5165
- createVNode(unref(TMagicButton), {
5166
- size: "small",
5167
- type: "success",
5168
- disabled: __props.disabled,
5169
- plain: ""
5170
- }, {
5171
- default: withCtx(() => [..._cache[2] || (_cache[2] = [
5172
- createTextVNode(
5173
- "导入EXCEL",
5174
- -1
5175
- /* CACHED */
5176
- )
5177
- ])]),
5178
- _: 1
5179
- /* STABLE */
5180
- }, 8, ["disabled"])
5181
- ]),
5182
- _: 1
5183
- /* STABLE */
5184
- }, 8, ["disabled", "on-change"])) : createCommentVNode("v-if", true),
5185
- unref(importable) ? (openBlock(), createBlock(unref(TMagicButton), {
5186
- key: 3,
5187
- size: "small",
5188
- type: "warning",
5189
- disabled: __props.disabled,
5190
- plain: "",
5191
- onClick: unref(clearHandler)
5192
- }, {
5193
- default: withCtx(() => [..._cache[3] || (_cache[3] = [
5194
- createTextVNode(
5195
- "清空",
5196
- -1
5197
- /* CACHED */
5198
- )
5199
- ])]),
5200
- _: 1
5201
- /* STABLE */
5202
- }, 8, ["disabled", "onClick"])) : createCommentVNode("v-if", true)
5440
+ }, 16, ["icon", "disabled"])) : createCommentVNode("v-if", true)
5203
5441
  ]),
5204
- unref(addable) ? (openBlock(), createBlock(unref(TMagicButton), {
5205
- key: 0,
5206
- size: "small",
5207
- type: "primary",
5208
- disabled: __props.disabled,
5209
- plain: "",
5210
- onClick: _cache[0] || (_cache[0] = ($event) => unref(newHandler)())
5211
- }, {
5212
- default: withCtx(() => [..._cache[4] || (_cache[4] = [
5213
- createTextVNode(
5214
- "新增一行",
5215
- -1
5216
- /* CACHED */
5217
- )
5218
- ])]),
5219
- _: 1
5220
- /* STABLE */
5221
- }, 8, ["disabled"])) : createCommentVNode("v-if", true)
5222
- ]),
5223
- __props.config.pagination ? (openBlock(), createElementBlock("div", _hoisted_5, [
5224
- createVNode(unref(TMagicPagination), {
5225
- layout: "total, sizes, prev, pager, next, jumper",
5226
- "hide-on-single-page": __props.model[modelName.value].length < unref(pageSize),
5227
- "current-page": unref(currentPage) + 1,
5228
- "page-sizes": [unref(pageSize), 60, 120, 300],
5229
- "page-size": unref(pageSize),
5230
- total: __props.model[modelName.value].length,
5231
- onSizeChange: unref(handleSizeChange),
5232
- onCurrentChange: unref(handleCurrentChange)
5233
- }, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total", "onSizeChange", "onCurrentChange"])
5234
- ])) : createCommentVNode("v-if", true)
5235
- ],
5236
- 2
5237
- /* CLASS */
5238
- )
5239
- ], 8, ["disabled"]))
5240
- ]);
5442
+ __props.config.pagination ? (openBlock(), createElementBlock("div", _hoisted_4, [
5443
+ createVNode(unref(TMagicPagination), {
5444
+ layout: "total, sizes, prev, pager, next, jumper",
5445
+ "hide-on-single-page": __props.model[modelName.value].length < unref(pageSize),
5446
+ "current-page": unref(currentPage) + 1,
5447
+ "page-sizes": [unref(pageSize), 60, 120, 300],
5448
+ "page-size": unref(pageSize),
5449
+ total: __props.model[modelName.value].length,
5450
+ onSizeChange: unref(handleSizeChange),
5451
+ onCurrentChange: unref(handleCurrentChange)
5452
+ }, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total", "onSizeChange", "onCurrentChange"])
5453
+ ])) : createCommentVNode("v-if", true)
5454
+ ],
5455
+ 2
5456
+ /* CLASS */
5457
+ )
5458
+ ],
5459
+ 16
5460
+ /* FULL_PROPS */
5461
+ )
5462
+ ], 8, ["disabled"]);
5241
5463
  };
5242
5464
  }
5243
5465
  });
@@ -5358,10 +5580,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5358
5580
  createVNode(unref(TMagicCol), { span: 12 }, {
5359
5581
  default: withCtx(() => [
5360
5582
  renderSlot(_ctx.$slots, "footer", {}, () => [
5361
- createVNode(unref(TMagicButton), {
5362
- type: "default",
5363
- onClick: handleClose
5364
- }, {
5583
+ createVNode(unref(TMagicButton), { onClick: handleClose }, {
5365
5584
  default: withCtx(() => [..._cache[1] || (_cache[1] = [
5366
5585
  createTextVNode(
5367
5586
  "关闭",