@tmagic/form 1.7.0-beta.1 → 1.7.0-beta.3

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, reactive, onBeforeUnmount, vModelText, useTemplateRef, provide, shallowRef, onBeforeMount, nextTick, resolveDirective, withModifiers, Teleport, h } from 'vue';
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
2
  import { WarningFilled, CaretBottom, CaretRight, Delete, DocumentCopy, CaretTop, Position, Grid, 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 { TMagicFormItem, TMagicTooltip, TMagicIcon, 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';
@@ -227,8 +227,8 @@ const sortChange = (data, { prop, order }) => {
227
227
 
228
228
  const _hoisted_1$d = ["data-tmagic-id", "data-tmagic-form-item-prop"];
229
229
  const _hoisted_2$7 = ["innerHTML", "title"];
230
- const _hoisted_3$6 = ["innerHTML"];
231
- const _hoisted_4$3 = ["innerHTML"];
230
+ const _hoisted_3$5 = ["innerHTML"];
231
+ const _hoisted_4$4 = ["innerHTML"];
232
232
  const _hoisted_5$3 = ["innerHTML", "title"];
233
233
  const _hoisted_6$1 = ["innerHTML"];
234
234
  const _hoisted_7$1 = ["innerHTML"];
@@ -272,10 +272,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
272
272
  const items = computed(() => props.config.items);
273
273
  const itemProp = computed(() => {
274
274
  let n = "";
275
- const { names } = props.config;
276
- if (names?.[0]) {
277
- [n] = names;
278
- } else if (name.value) {
275
+ if (name.value) {
279
276
  n = name.value;
280
277
  } else {
281
278
  return props.prop;
@@ -498,7 +495,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
498
495
  content: withCtx(() => [
499
496
  createElementVNode("div", {
500
497
  innerHTML: tooltip.value.text
501
- }, null, 8, _hoisted_3$6)
498
+ }, null, 8, _hoisted_3$5)
502
499
  ]),
503
500
  default: withCtx(() => [
504
501
  (openBlock(), createBlock(resolveDynamicComponent(tagName.value), mergeProps(fieldsProps.value, {
@@ -527,7 +524,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
527
524
  content: withCtx(() => [
528
525
  createElementVNode("div", {
529
526
  innerHTML: __props.config.tip
530
- }, null, 8, _hoisted_4$3)
527
+ }, null, 8, _hoisted_4$4)
531
528
  ]),
532
529
  default: withCtx(() => [
533
530
  createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -724,8 +721,8 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
724
721
 
725
722
  const _hoisted_1$c = ["innerHTML"];
726
723
  const _hoisted_2$6 = ["innerHTML"];
727
- const _hoisted_3$5 = { key: 1 };
728
- const _hoisted_4$2 = ["innerHTML"];
724
+ const _hoisted_3$4 = { key: 1 };
725
+ const _hoisted_4$3 = ["innerHTML"];
729
726
  const _hoisted_5$2 = ["innerHTML"];
730
727
  const _hoisted_6 = {
731
728
  key: 2,
@@ -825,10 +822,10 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
825
822
  ]),
826
823
  _: 1
827
824
  /* STABLE */
828
- })) : (openBlock(), createElementBlock("legend", _hoisted_3$5, [
825
+ })) : (openBlock(), createElementBlock("legend", _hoisted_3$4, [
829
826
  createElementVNode("span", {
830
827
  innerHTML: __props.config.legend
831
- }, null, 8, _hoisted_4$2),
828
+ }, null, 8, _hoisted_4$3),
832
829
  __props.config.extra ? (openBlock(), createElementBlock("span", {
833
830
  key: 0,
834
831
  innerHTML: __props.config.extra,
@@ -957,9 +954,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
957
954
  }
958
955
  });
959
956
 
960
- const _hoisted_1$b = { class: "m-fields-group-list-item" };
961
- const _hoisted_2$5 = { style: { "text-align": "right", "margin-top": "20px" } };
962
- const _hoisted_3$4 = ["innerHTML"];
957
+ const _hoisted_1$b = { style: { "text-align": "right", "margin-top": "20px" } };
958
+ const _hoisted_2$5 = ["innerHTML"];
963
959
  const _sfc_main$x = /* @__PURE__ */ defineComponent({
964
960
  ...{
965
961
  name: "MFormGroupListItem"
@@ -1038,211 +1034,220 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
1038
1034
  emit("swap-item", props.index, moveSpecifyLocationIndex.value - 1);
1039
1035
  };
1040
1036
  return (_ctx, _cache) => {
1041
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
1042
- createElementVNode("div", null, [
1043
- createVNode(unref(TMagicButton), {
1044
- link: "",
1045
- disabled: __props.disabled,
1046
- onClick: expandHandler
1047
- }, {
1048
- default: withCtx(() => [
1049
- createVNode(unref(TMagicIcon), null, {
1050
- default: withCtx(() => [
1051
- expand.value ? (openBlock(), createBlock(unref(CaretBottom), { key: 0 })) : (openBlock(), createBlock(unref(CaretRight), { key: 1 }))
1052
- ]),
1053
- _: 1
1054
- /* STABLE */
1055
- }),
1056
- createTextVNode(
1057
- toDisplayString(title.value),
1058
- 1
1059
- /* TEXT */
1060
- )
1061
- ]),
1062
- _: 1
1063
- /* STABLE */
1064
- }, 8, ["disabled"]),
1065
- withDirectives(createVNode(unref(TMagicButton), {
1066
- type: "danger",
1067
- size: "small",
1068
- link: "",
1069
- icon: unref(Delete),
1070
- disabled: __props.disabled,
1071
- onClick: removeHandler
1072
- }, null, 8, ["icon", "disabled"]), [
1073
- [vShow, showDelete.value]
1074
- ]),
1075
- copyable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1076
- key: 0,
1077
- link: "",
1078
- size: "small",
1079
- type: "primary",
1080
- icon: unref(DocumentCopy),
1081
- disabled: __props.disabled,
1082
- onClick: copyHandler
1083
- }, {
1084
- default: withCtx(() => [..._cache[6] || (_cache[6] = [
1085
- createTextVNode(
1086
- "复制",
1087
- -1
1088
- /* CACHED */
1089
- )
1090
- ])]),
1091
- _: 1
1092
- /* STABLE */
1093
- }, 8, ["icon", "disabled"])) : createCommentVNode("v-if", true),
1094
- movable.value ? (openBlock(), createElementBlock(
1095
- Fragment,
1096
- { key: 1 },
1097
- [
1098
- withDirectives(createVNode(unref(TMagicButton), {
1099
- link: "",
1100
- size: "small",
1101
- disabled: __props.disabled,
1102
- icon: unref(CaretTop),
1103
- onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
1104
- }, {
1105
- default: withCtx(() => [..._cache[7] || (_cache[7] = [
1106
- createTextVNode(
1107
- "上移",
1108
- -1
1109
- /* CACHED */
1110
- )
1111
- ])]),
1112
- _: 1
1113
- /* STABLE */
1114
- }, 8, ["disabled", "icon"]), [
1115
- [vShow, __props.index !== 0]
1037
+ return openBlock(), createBlock(unref(TMagicCard), {
1038
+ class: "m-fields-group-list-item",
1039
+ "body-style": { display: expand.value ? "block" : "none" }
1040
+ }, {
1041
+ header: withCtx(() => [
1042
+ createElementVNode("div", null, [
1043
+ createVNode(unref(TMagicButton), {
1044
+ link: "",
1045
+ disabled: __props.disabled,
1046
+ onClick: expandHandler
1047
+ }, {
1048
+ default: withCtx(() => [
1049
+ createVNode(unref(TMagicIcon), null, {
1050
+ default: withCtx(() => [
1051
+ expand.value ? (openBlock(), createBlock(unref(CaretBottom), { key: 0 })) : (openBlock(), createBlock(unref(CaretRight), { key: 1 }))
1052
+ ]),
1053
+ _: 1
1054
+ /* STABLE */
1055
+ }),
1056
+ createTextVNode(
1057
+ toDisplayString(title.value),
1058
+ 1
1059
+ /* TEXT */
1060
+ )
1116
1061
  ]),
1117
- withDirectives(createVNode(unref(TMagicButton), {
1118
- link: "",
1119
- size: "small",
1120
- disabled: __props.disabled,
1121
- icon: unref(CaretBottom),
1122
- onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
1123
- }, {
1124
- default: withCtx(() => [..._cache[8] || (_cache[8] = [
1125
- createTextVNode(
1126
- "下移",
1127
- -1
1128
- /* CACHED */
1129
- )
1130
- ])]),
1131
- _: 1
1132
- /* STABLE */
1133
- }, 8, ["disabled", "icon"]), [
1134
- [vShow, __props.index !== length.value - 1]
1135
- ])
1136
- ],
1137
- 64
1138
- /* STABLE_FRAGMENT */
1139
- )) : createCommentVNode("v-if", true),
1140
- __props.config.moveSpecifyLocation ? (openBlock(), createBlock(unref(TMagicPopover), {
1141
- key: 2,
1142
- trigger: "click",
1143
- placement: "top",
1144
- width: "200",
1145
- visible: moveSpecifyLocationVisible.value
1146
- }, {
1147
- reference: withCtx(() => [
1148
- createVNode(unref(TMagicButton), {
1149
- link: "",
1150
- size: "small",
1151
- type: "primary",
1152
- icon: unref(Position),
1153
- disabled: __props.disabled,
1154
- onClick: _cache[2] || (_cache[2] = ($event) => moveSpecifyLocationVisible.value = true)
1155
- }, {
1156
- default: withCtx(() => [..._cache[9] || (_cache[9] = [
1157
- createTextVNode(
1158
- "移动至",
1159
- -1
1160
- /* CACHED */
1161
- )
1162
- ])]),
1163
- _: 1
1164
- /* STABLE */
1165
- }, 8, ["icon", "disabled"])
1062
+ _: 1
1063
+ /* STABLE */
1064
+ }, 8, ["disabled"]),
1065
+ withDirectives(createVNode(unref(TMagicButton), {
1066
+ type: "danger",
1067
+ size: "small",
1068
+ link: "",
1069
+ icon: unref(Delete),
1070
+ disabled: __props.disabled,
1071
+ onClick: removeHandler
1072
+ }, null, 8, ["icon", "disabled"]), [
1073
+ [vShow, showDelete.value]
1166
1074
  ]),
1167
- default: withCtx(() => [
1168
- createElementVNode("div", null, [
1169
- createElementVNode("div", null, [
1170
- _cache[10] || (_cache[10] = createTextVNode(
1171
- " ",
1172
- -1
1173
- /* CACHED */
1174
- )),
1175
- createVNode(unref(TMagicInputNumber), {
1176
- style: { "margin": "0 5px" },
1177
- modelValue: moveSpecifyLocationIndex.value,
1178
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => moveSpecifyLocationIndex.value = $event),
1179
- size: "small",
1180
- min: 1,
1181
- disabled: __props.disabled
1182
- }, null, 8, ["modelValue", "disabled"]),
1183
- _cache[11] || (_cache[11] = createTextVNode(
1184
- "行 ",
1185
- -1
1186
- /* CACHED */
1187
- ))
1075
+ copyable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1076
+ key: 0,
1077
+ link: "",
1078
+ size: "small",
1079
+ type: "primary",
1080
+ icon: unref(DocumentCopy),
1081
+ disabled: __props.disabled,
1082
+ onClick: copyHandler
1083
+ }, {
1084
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [
1085
+ createTextVNode(
1086
+ "复制",
1087
+ -1
1088
+ /* CACHED */
1089
+ )
1090
+ ])]),
1091
+ _: 1
1092
+ /* STABLE */
1093
+ }, 8, ["icon", "disabled"])) : createCommentVNode("v-if", true),
1094
+ movable.value ? (openBlock(), createElementBlock(
1095
+ Fragment,
1096
+ { key: 1 },
1097
+ [
1098
+ withDirectives(createVNode(unref(TMagicButton), {
1099
+ link: "",
1100
+ size: "small",
1101
+ disabled: __props.disabled,
1102
+ icon: unref(CaretTop),
1103
+ onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
1104
+ }, {
1105
+ default: withCtx(() => [..._cache[7] || (_cache[7] = [
1106
+ createTextVNode(
1107
+ "上移",
1108
+ -1
1109
+ /* CACHED */
1110
+ )
1111
+ ])]),
1112
+ _: 1
1113
+ /* STABLE */
1114
+ }, 8, ["disabled", "icon"]), [
1115
+ [vShow, __props.index !== 0]
1188
1116
  ]),
1189
- createElementVNode("div", _hoisted_2$5, [
1190
- createVNode(unref(TMagicButton), {
1191
- size: "small",
1192
- text: "",
1193
- onClick: _cache[4] || (_cache[4] = ($event) => moveSpecifyLocationVisible.value = false)
1194
- }, {
1195
- default: withCtx(() => [..._cache[12] || (_cache[12] = [
1196
- createTextVNode(
1197
- "取消",
1198
- -1
1199
- /* CACHED */
1200
- )
1201
- ])]),
1202
- _: 1
1203
- /* STABLE */
1204
- }),
1205
- createVNode(unref(TMagicButton), {
1206
- size: "small",
1207
- type: "primary",
1208
- onClick: moveSpecifyLocationHandler
1209
- }, {
1210
- default: withCtx(() => [..._cache[13] || (_cache[13] = [
1211
- createTextVNode(
1212
- "确认",
1213
- -1
1214
- /* CACHED */
1215
- )
1216
- ])]),
1217
- _: 1
1218
- /* STABLE */
1219
- })
1117
+ withDirectives(createVNode(unref(TMagicButton), {
1118
+ link: "",
1119
+ size: "small",
1120
+ disabled: __props.disabled,
1121
+ icon: unref(CaretBottom),
1122
+ onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
1123
+ }, {
1124
+ default: withCtx(() => [..._cache[8] || (_cache[8] = [
1125
+ createTextVNode(
1126
+ "下移",
1127
+ -1
1128
+ /* CACHED */
1129
+ )
1130
+ ])]),
1131
+ _: 1
1132
+ /* STABLE */
1133
+ }, 8, ["disabled", "icon"]), [
1134
+ [vShow, __props.index !== length.value - 1]
1220
1135
  ])
1221
- ])
1222
- ]),
1223
- _: 1
1224
- /* STABLE */
1225
- }, 8, ["visible"])) : createCommentVNode("v-if", true),
1226
- itemExtra.value ? (openBlock(), createElementBlock("span", {
1227
- key: 3,
1228
- innerHTML: itemExtra.value,
1229
- class: "m-form-tip"
1230
- }, null, 8, _hoisted_3$4)) : createCommentVNode("v-if", true)
1136
+ ],
1137
+ 64
1138
+ /* STABLE_FRAGMENT */
1139
+ )) : createCommentVNode("v-if", true),
1140
+ __props.config.moveSpecifyLocation ? (openBlock(), createBlock(unref(TMagicPopover), {
1141
+ key: 2,
1142
+ trigger: "click",
1143
+ placement: "top",
1144
+ width: "200",
1145
+ visible: moveSpecifyLocationVisible.value
1146
+ }, {
1147
+ reference: withCtx(() => [
1148
+ createVNode(unref(TMagicButton), {
1149
+ link: "",
1150
+ size: "small",
1151
+ type: "primary",
1152
+ icon: unref(Position),
1153
+ disabled: __props.disabled,
1154
+ onClick: _cache[2] || (_cache[2] = ($event) => moveSpecifyLocationVisible.value = true)
1155
+ }, {
1156
+ default: withCtx(() => [..._cache[9] || (_cache[9] = [
1157
+ createTextVNode(
1158
+ "移动至",
1159
+ -1
1160
+ /* CACHED */
1161
+ )
1162
+ ])]),
1163
+ _: 1
1164
+ /* STABLE */
1165
+ }, 8, ["icon", "disabled"])
1166
+ ]),
1167
+ default: withCtx(() => [
1168
+ createElementVNode("div", null, [
1169
+ createElementVNode("div", null, [
1170
+ _cache[10] || (_cache[10] = createTextVNode(
1171
+ " 第",
1172
+ -1
1173
+ /* CACHED */
1174
+ )),
1175
+ createVNode(unref(TMagicInputNumber), {
1176
+ style: { "margin": "0 5px" },
1177
+ modelValue: moveSpecifyLocationIndex.value,
1178
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => moveSpecifyLocationIndex.value = $event),
1179
+ size: "small",
1180
+ min: 1,
1181
+ disabled: __props.disabled
1182
+ }, null, 8, ["modelValue", "disabled"]),
1183
+ _cache[11] || (_cache[11] = createTextVNode(
1184
+ "行 ",
1185
+ -1
1186
+ /* CACHED */
1187
+ ))
1188
+ ]),
1189
+ createElementVNode("div", _hoisted_1$b, [
1190
+ createVNode(unref(TMagicButton), {
1191
+ size: "small",
1192
+ text: "",
1193
+ onClick: _cache[4] || (_cache[4] = ($event) => moveSpecifyLocationVisible.value = false)
1194
+ }, {
1195
+ default: withCtx(() => [..._cache[12] || (_cache[12] = [
1196
+ createTextVNode(
1197
+ "取消",
1198
+ -1
1199
+ /* CACHED */
1200
+ )
1201
+ ])]),
1202
+ _: 1
1203
+ /* STABLE */
1204
+ }),
1205
+ createVNode(unref(TMagicButton), {
1206
+ size: "small",
1207
+ type: "primary",
1208
+ onClick: moveSpecifyLocationHandler
1209
+ }, {
1210
+ default: withCtx(() => [..._cache[13] || (_cache[13] = [
1211
+ createTextVNode(
1212
+ "确认",
1213
+ -1
1214
+ /* CACHED */
1215
+ )
1216
+ ])]),
1217
+ _: 1
1218
+ /* STABLE */
1219
+ })
1220
+ ])
1221
+ ])
1222
+ ]),
1223
+ _: 1
1224
+ /* STABLE */
1225
+ }, 8, ["visible"])) : createCommentVNode("v-if", true),
1226
+ itemExtra.value ? (openBlock(), createElementBlock("span", {
1227
+ key: 3,
1228
+ innerHTML: itemExtra.value,
1229
+ class: "m-form-tip"
1230
+ }, null, 8, _hoisted_2$5)) : createCommentVNode("v-if", true)
1231
+ ])
1231
1232
  ]),
1232
- expand.value ? (openBlock(), createBlock(_sfc_main$A, {
1233
- key: 0,
1234
- config: rowConfig.value,
1235
- model: __props.model,
1236
- lastValues: __props.lastValues,
1237
- "is-compare": __props.isCompare,
1238
- labelWidth: __props.labelWidth,
1239
- prop: `${__props.prop}${__props.prop ? "." : ""}${String(__props.index)}`,
1240
- size: __props.size,
1241
- disabled: __props.disabled,
1242
- onChange: changeHandler,
1243
- onAddDiffCount: _cache[5] || (_cache[5] = ($event) => onAddDiffCount())
1244
- }, null, 8, ["config", "model", "lastValues", "is-compare", "labelWidth", "prop", "size", "disabled"])) : createCommentVNode("v-if", true)
1245
- ]);
1233
+ default: withCtx(() => [
1234
+ expand.value ? (openBlock(), createBlock(_sfc_main$A, {
1235
+ key: 0,
1236
+ config: rowConfig.value,
1237
+ model: __props.model,
1238
+ lastValues: __props.lastValues,
1239
+ "is-compare": __props.isCompare,
1240
+ labelWidth: __props.labelWidth,
1241
+ prop: `${__props.prop}${__props.prop ? "." : ""}${String(__props.index)}`,
1242
+ size: __props.size,
1243
+ disabled: __props.disabled,
1244
+ onChange: changeHandler,
1245
+ onAddDiffCount: _cache[5] || (_cache[5] = ($event) => onAddDiffCount())
1246
+ }, null, 8, ["config", "model", "lastValues", "is-compare", "labelWidth", "prop", "size", "disabled"])) : createCommentVNode("v-if", true)
1247
+ ]),
1248
+ _: 1
1249
+ /* STABLE */
1250
+ }, 8, ["body-style"]);
1246
1251
  };
1247
1252
  }
1248
1253
  });
@@ -1253,6 +1258,8 @@ const _hoisted_3$3 = {
1253
1258
  key: 1,
1254
1259
  class: "el-table__empty-block"
1255
1260
  };
1261
+ const _hoisted_4$2 = { class: "m-fields-group-list-footer" };
1262
+ const _hoisted_5$1 = { style: { "display": "flex", "justify-content": "flex-end", "flex": "1" } };
1256
1263
  const _sfc_main$w = /* @__PURE__ */ defineComponent({
1257
1264
  ...{
1258
1265
  name: "MFormGroupList"
@@ -1352,7 +1359,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
1352
1359
  !__props.model[__props.name] || !__props.model[__props.name].length ? (openBlock(), createElementBlock("div", _hoisted_3$3, [..._cache[1] || (_cache[1] = [
1353
1360
  createElementVNode(
1354
1361
  "span",
1355
- { class: "el-table__empty-text" },
1362
+ { class: "el-table__empty-text t-table__empty" },
1356
1363
  "暂无数据",
1357
1364
  -1
1358
1365
  /* CACHED */
@@ -1383,39 +1390,43 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
1383
1390
  128
1384
1391
  /* KEYED_FRAGMENT */
1385
1392
  )),
1386
- addable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1387
- key: 3,
1388
- type: "primary",
1389
- size: __props.config.enableToggleMode ? "small" : "default",
1390
- disabled: __props.disabled,
1391
- onClick: addHandler
1392
- }, {
1393
- default: withCtx(() => [..._cache[2] || (_cache[2] = [
1394
- createTextVNode(
1395
- "新增",
1396
- -1
1397
- /* CACHED */
1398
- )
1399
- ])]),
1400
- _: 1
1401
- /* STABLE */
1402
- }, 8, ["size", "disabled"])) : createCommentVNode("v-if", true),
1403
- __props.config.enableToggleMode ? (openBlock(), createBlock(unref(TMagicButton), {
1404
- key: 4,
1405
- icon: unref(Grid),
1406
- size: "small",
1407
- onClick: toggleMode
1408
- }, {
1409
- default: withCtx(() => [..._cache[3] || (_cache[3] = [
1410
- createTextVNode(
1411
- "切换为表格",
1412
- -1
1413
- /* CACHED */
1414
- )
1415
- ])]),
1416
- _: 1
1417
- /* STABLE */
1418
- }, 8, ["icon"])) : createCommentVNode("v-if", true)
1393
+ createElementVNode("div", _hoisted_4$2, [
1394
+ __props.config.enableToggleMode ? (openBlock(), createBlock(unref(TMagicButton), {
1395
+ key: 0,
1396
+ icon: unref(Grid),
1397
+ size: "small",
1398
+ onClick: toggleMode
1399
+ }, {
1400
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
1401
+ createTextVNode(
1402
+ "切换为表格",
1403
+ -1
1404
+ /* CACHED */
1405
+ )
1406
+ ])]),
1407
+ _: 1
1408
+ /* STABLE */
1409
+ }, 8, ["icon"])) : createCommentVNode("v-if", true),
1410
+ createElementVNode("div", _hoisted_5$1, [
1411
+ addable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1412
+ key: 0,
1413
+ type: "primary",
1414
+ size: __props.config.enableToggleMode ? "small" : "default",
1415
+ disabled: __props.disabled,
1416
+ onClick: addHandler
1417
+ }, {
1418
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
1419
+ createTextVNode(
1420
+ "新增",
1421
+ -1
1422
+ /* CACHED */
1423
+ )
1424
+ ])]),
1425
+ _: 1
1426
+ /* STABLE */
1427
+ }, 8, ["size", "disabled"])) : createCommentVNode("v-if", true)
1428
+ ])
1429
+ ])
1419
1430
  ]);
1420
1431
  };
1421
1432
  }
@@ -1428,7 +1439,7 @@ const _hoisted_3$2 = {
1428
1439
  style: { "display": "flex" }
1429
1440
  };
1430
1441
  const _hoisted_4$1 = { style: { "flex": "1" } };
1431
- const _hoisted_5$1 = ["src"];
1442
+ const _hoisted_5 = ["src"];
1432
1443
  const _sfc_main$v = /* @__PURE__ */ defineComponent({
1433
1444
  ...{
1434
1445
  name: "MFormPanel"
@@ -1515,7 +1526,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1515
1526
  createElementVNode("img", {
1516
1527
  class: "m-form-schematic",
1517
1528
  src: __props.config.schematic
1518
- }, null, 8, _hoisted_5$1)
1529
+ }, null, 8, _hoisted_5)
1519
1530
  ])) : (openBlock(true), createElementBlock(
1520
1531
  Fragment,
1521
1532
  { key: 1 },
@@ -2382,7 +2393,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
2382
2393
  const value = ref([]);
2383
2394
  if (props.model !== void 0) {
2384
2395
  if (names?.length) {
2385
- watch(
2396
+ const unWatch = watch(
2386
2397
  [() => props.model[names[0]], () => props.model[names[1]]],
2387
2398
  ([start, end], [preStart, preEnd]) => {
2388
2399
  if (!value.value) {
@@ -2397,8 +2408,11 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
2397
2408
  immediate: true
2398
2409
  }
2399
2410
  );
2411
+ onUnmounted(() => {
2412
+ unWatch();
2413
+ });
2400
2414
  } else if (props.name && props.model[props.name]) {
2401
- watch(
2415
+ const unWatch = watch(
2402
2416
  () => props.model[props.name],
2403
2417
  (start, preStart) => {
2404
2418
  const format = `${props.config.dateFormat || "YYYY/MM/DD"} ${props.config.timeFormat || "HH:mm:ss"}`;
@@ -2411,29 +2425,38 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
2411
2425
  immediate: true
2412
2426
  }
2413
2427
  );
2428
+ onUnmounted(() => {
2429
+ unWatch();
2430
+ });
2414
2431
  }
2415
2432
  }
2416
- const setValue = (v) => {
2417
- names?.forEach((item, index) => {
2418
- if (!props.model) {
2419
- return;
2420
- }
2421
- if (Array.isArray(v)) {
2422
- props.model[item] = v[index];
2423
- } else {
2424
- props.model[item] = void 0;
2425
- }
2426
- });
2427
- };
2428
2433
  const changeHandler = (v) => {
2429
2434
  const value2 = v || [];
2430
2435
  if (props.name) {
2431
2436
  emit("change", value2);
2432
2437
  } else {
2433
- if (names?.length) {
2434
- setValue(value2);
2438
+ if (props.config.names?.length) {
2439
+ const newChangeRecords = [];
2440
+ props.config.names.forEach((item, index) => {
2441
+ if (!props.model) {
2442
+ return;
2443
+ }
2444
+ if (Array.isArray(v)) {
2445
+ newChangeRecords.push({
2446
+ propPath: props.prop ? `${props.prop}.${item}` : item,
2447
+ value: v[index]
2448
+ });
2449
+ } else {
2450
+ newChangeRecords.push({
2451
+ propPath: props.prop ? `${props.prop}.${item}` : item,
2452
+ value: void 0
2453
+ });
2454
+ }
2455
+ });
2456
+ emit("change", props.model, {
2457
+ changeRecords: newChangeRecords
2458
+ });
2435
2459
  }
2436
- emit("change", props.model);
2437
2460
  }
2438
2461
  };
2439
2462
  return (_ctx, _cache) => {
@@ -2447,11 +2470,12 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
2447
2470
  "unlink-panels": true,
2448
2471
  disabled: __props.disabled,
2449
2472
  "default-time": __props.config.defaultTime,
2473
+ format: `${__props.config.dateFormat || "YYYY/MM/DD"} ${__props.config.timeFormat || "HH:mm:ss"}`,
2450
2474
  "value-format": __props.config.valueFormat || "YYYY/MM/DD HH:mm:ss",
2451
2475
  "date-format": __props.config.dateFormat || "YYYY/MM/DD",
2452
2476
  "time-format": __props.config.timeFormat || "HH:mm:ss",
2453
2477
  "onUpdate:modelValue": changeHandler
2454
- }, null, 8, ["model-value", "size", "disabled", "default-time", "value-format", "date-format", "time-format"]);
2478
+ }, null, 8, ["model-value", "size", "disabled", "default-time", "format", "value-format", "date-format", "time-format"]);
2455
2479
  };
2456
2480
  }
2457
2481
  });
@@ -2960,8 +2984,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2960
2984
  };
2961
2985
  const save = async () => {
2962
2986
  try {
2987
+ const changeRecords = form.value?.changeRecords;
2963
2988
  const values = await form.value?.submitForm();
2964
- emit("submit", values, { changeRecords: form.value?.changeRecords });
2989
+ emit("submit", values, { changeRecords });
2965
2990
  } catch (e) {
2966
2991
  emit("error", e);
2967
2992
  }
@@ -3178,7 +3203,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3178
3203
  if (typeof props.config.form === "function") {
3179
3204
  return props.config.form(mForm, {
3180
3205
  model: props.model || {},
3181
- values: props.values || {}
3206
+ values: mForm ? readonly(mForm.initValues) : null,
3207
+ formValue: props.values || {}
3182
3208
  });
3183
3209
  }
3184
3210
  return props.config.form;
@@ -4035,10 +4061,25 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
4035
4061
  const buttonClickHandler = () => {
4036
4062
  if (!appendConfig.value) return;
4037
4063
  if (typeof appendConfig.value.handler === "function") {
4064
+ const newChangeRecords = [];
4065
+ const setModel = (key, value) => {
4066
+ newChangeRecords.push({ propPath: props.prop.replace(`${props.name}`, key), value });
4067
+ };
4068
+ const setFormValue = (key, value) => {
4069
+ newChangeRecords.push({ propPath: key, value });
4070
+ };
4038
4071
  appendConfig.value.handler(mForm, {
4039
4072
  model: props.model,
4040
- values: mForm?.values
4073
+ values: mForm ? readonly(mForm.initValues) : null,
4074
+ formValue: props.values || {},
4075
+ setModel,
4076
+ setFormValue
4041
4077
  });
4078
+ if (newChangeRecords.length > 0) {
4079
+ emit("change", props.model[props.name], {
4080
+ changeRecords: newChangeRecords
4081
+ });
4082
+ }
4042
4083
  }
4043
4084
  };
4044
4085
  const keyUpHandler = ($event) => {
@@ -4460,6 +4501,7 @@ const useAdd = (props, emit) => {
4460
4501
  if (typeof props.config.defaultAdd === "function") {
4461
4502
  inputs = await props.config.defaultAdd(mForm, {
4462
4503
  model: props.model[modelName],
4504
+ prop: props.prop,
4463
4505
  formValue: mForm?.values
4464
4506
  });
4465
4507
  } else if (props.config.defaultAdd) {
@@ -4490,16 +4532,10 @@ const useAdd = (props, emit) => {
4490
4532
 
4491
4533
  const useFullscreen = () => {
4492
4534
  const isFullscreen = ref(false);
4493
- const mTableEl = useTemplateRef("mTable");
4494
- const { nextZIndex } = useZIndex();
4495
4535
  const toggleFullscreen = () => {
4496
- if (!mTableEl.value) return;
4497
4536
  if (isFullscreen.value) {
4498
- mTableEl.value.classList.remove("fixed");
4499
4537
  isFullscreen.value = false;
4500
4538
  } else {
4501
- mTableEl.value.classList.add("fixed");
4502
- mTableEl.value.style.zIndex = `${nextZIndex()}`;
4503
4539
  isFullscreen.value = true;
4504
4540
  }
4505
4541
  };
@@ -4985,11 +5021,10 @@ const useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
4985
5021
  };
4986
5022
  };
4987
5023
 
4988
- const _hoisted_1$1 = { class: "m-fields-table-wrap" };
4989
- const _hoisted_2 = ["innerHTML"];
4990
- const _hoisted_3 = { style: { "display": "flex", "justify-content": "space-between", "margin": "10px 0" } };
4991
- const _hoisted_4 = { style: { "display": "flex" } };
4992
- const _hoisted_5 = {
5024
+ const _hoisted_1$1 = ["innerHTML"];
5025
+ const _hoisted_2 = { style: { "display": "flex", "justify-content": "space-between", "margin": "10px 0" } };
5026
+ const _hoisted_3 = { style: { "display": "flex" } };
5027
+ const _hoisted_4 = {
4993
5028
  key: 1,
4994
5029
  class: "bottom",
4995
5030
  style: { "text-align": "right" }
@@ -5025,6 +5060,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
5025
5060
  props,
5026
5061
  modelName
5027
5062
  );
5063
+ const { nextZIndex } = useZIndex();
5028
5064
  const { addable, newHandler } = useAdd(props, emit);
5029
5065
  const { columns } = useTableColumns(props, emit, currentPage, pageSize, modelName);
5030
5066
  useSortable(props, emit, tMagicTableRef, modelName);
@@ -5062,170 +5098,176 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
5062
5098
  toggleRowSelection
5063
5099
  });
5064
5100
  return (_ctx, _cache) => {
5065
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
5066
- (openBlock(), createBlock(Teleport, {
5067
- to: "body",
5068
- disabled: !unref(isFullscreen)
5069
- }, [
5070
- createElementVNode(
5071
- "div",
5072
- {
5073
- ref: "mTable",
5074
- class: normalizeClass(["m-fields-table", { "m-fields-table-item-extra": __props.config.itemExtra }])
5075
- },
5076
- [
5077
- __props.config.extra ? (openBlock(), createElementBlock("span", {
5078
- key: 0,
5079
- style: { "color": "rgba(0, 0, 0, 0.45)" },
5080
- innerHTML: __props.config.extra
5081
- }, null, 8, _hoisted_2)) : createCommentVNode("v-if", true),
5082
- createVNode(unref(TMagicTooltip), {
5083
- content: "拖拽可排序",
5084
- placement: "left-start",
5085
- disabled: __props.config.dropSort !== true
5086
- }, {
5087
- default: withCtx(() => [
5088
- __props.model[modelName.value] ? (openBlock(), createBlock(unref(TMagicTable), {
5089
- ref: "tMagicTable",
5090
- style: { "width": "100%" },
5091
- "show-header": "",
5092
- "row-key": __props.config.rowKey || "id",
5093
- columns: unref(columns),
5094
- data: data.value,
5095
- border: __props.config.border,
5096
- "max-height": __props.config.maxHeight,
5097
- "default-expand-all": true,
5098
- key: updateKey.value,
5099
- onSelect: unref(selectHandle),
5100
- onSortChange: sortChangeHandler
5101
- }, null, 8, ["row-key", "columns", "data", "border", "max-height", "onSelect"])) : createCommentVNode("v-if", true)
5102
- ]),
5103
- _: 1
5104
- /* STABLE */
5105
- }, 8, ["disabled"]),
5106
- renderSlot(_ctx.$slots, "default"),
5107
- createElementVNode("div", _hoisted_3, [
5108
- unref(addable) ? (openBlock(), createBlock(unref(TMagicButton), {
5101
+ return openBlock(), createBlock(Teleport, {
5102
+ to: "body",
5103
+ disabled: !unref(isFullscreen)
5104
+ }, [
5105
+ createElementVNode(
5106
+ "div",
5107
+ mergeProps(_ctx.$attrs, {
5108
+ class: ["m-fields-table-wrap", { fixed: unref(isFullscreen) }],
5109
+ style: unref(isFullscreen) ? `z-index: ${unref(nextZIndex)()}` : ""
5110
+ }),
5111
+ [
5112
+ createElementVNode(
5113
+ "div",
5114
+ {
5115
+ class: normalizeClass(["m-fields-table", { "m-fields-table-item-extra": __props.config.itemExtra }])
5116
+ },
5117
+ [
5118
+ __props.config.extra ? (openBlock(), createElementBlock("span", {
5109
5119
  key: 0,
5110
- size: "small",
5111
- type: "primary",
5112
- disabled: __props.disabled,
5113
- plain: "",
5114
- onClick: _cache[0] || (_cache[0] = ($event) => unref(newHandler)())
5120
+ style: { "color": "rgba(0, 0, 0, 0.45)" },
5121
+ innerHTML: __props.config.extra
5122
+ }, null, 8, _hoisted_1$1)) : createCommentVNode("v-if", true),
5123
+ createVNode(unref(TMagicTooltip), {
5124
+ content: "拖拽可排序",
5125
+ placement: "left-start",
5126
+ disabled: __props.config.dropSort !== true
5115
5127
  }, {
5116
- default: withCtx(() => [..._cache[1] || (_cache[1] = [
5117
- createTextVNode(
5118
- "新增一行",
5119
- -1
5120
- /* CACHED */
5121
- )
5122
- ])]),
5128
+ default: withCtx(() => [
5129
+ __props.model[modelName.value] ? (openBlock(), createBlock(unref(TMagicTable), {
5130
+ ref: "tMagicTable",
5131
+ style: { "width": "100%" },
5132
+ "show-header": "",
5133
+ "row-key": __props.config.rowKey || "id",
5134
+ columns: unref(columns),
5135
+ data: data.value,
5136
+ border: __props.config.border,
5137
+ "max-height": __props.config.maxHeight,
5138
+ "default-expand-all": true,
5139
+ key: updateKey.value,
5140
+ onSelect: unref(selectHandle),
5141
+ onSortChange: sortChangeHandler
5142
+ }, null, 8, ["row-key", "columns", "data", "border", "max-height", "onSelect"])) : createCommentVNode("v-if", true)
5143
+ ]),
5123
5144
  _: 1
5124
5145
  /* STABLE */
5125
- }, 8, ["disabled"])) : createCommentVNode("v-if", true),
5126
- createElementVNode("div", _hoisted_4, [
5127
- __props.enableToggleMode && __props.config.enableToggleMode !== false && !unref(isFullscreen) ? (openBlock(), createBlock(unref(TMagicButton), {
5146
+ }, 8, ["disabled"]),
5147
+ renderSlot(_ctx.$slots, "default"),
5148
+ createElementVNode("div", _hoisted_2, [
5149
+ createElementVNode("div", _hoisted_3, [
5150
+ __props.enableToggleMode && __props.config.enableToggleMode !== false && !unref(isFullscreen) ? (openBlock(), createBlock(unref(TMagicButton), {
5151
+ key: 0,
5152
+ icon: unref(Grid),
5153
+ size: "small",
5154
+ onClick: toggleMode
5155
+ }, {
5156
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [
5157
+ createTextVNode(
5158
+ "展开配置",
5159
+ -1
5160
+ /* CACHED */
5161
+ )
5162
+ ])]),
5163
+ _: 1
5164
+ /* STABLE */
5165
+ }, 8, ["icon"])) : createCommentVNode("v-if", true),
5166
+ __props.config.enableFullscreen !== false ? (openBlock(), createBlock(unref(TMagicButton), {
5167
+ key: 1,
5168
+ icon: unref(FullScreen),
5169
+ size: "small",
5170
+ onClick: unref(toggleFullscreen)
5171
+ }, {
5172
+ default: withCtx(() => [
5173
+ createTextVNode(
5174
+ toDisplayString(unref(isFullscreen) ? "退出全屏" : "全屏编辑"),
5175
+ 1
5176
+ /* TEXT */
5177
+ )
5178
+ ]),
5179
+ _: 1
5180
+ /* STABLE */
5181
+ }, 8, ["icon", "onClick"])) : createCommentVNode("v-if", true),
5182
+ unref(importable) ? (openBlock(), createBlock(unref(TMagicUpload), {
5183
+ key: 2,
5184
+ style: { "display": "inline-block" },
5185
+ ref: "excelBtn",
5186
+ action: "/noop",
5187
+ disabled: __props.disabled,
5188
+ "on-change": unref(excelHandler),
5189
+ "auto-upload": false
5190
+ }, {
5191
+ default: withCtx(() => [
5192
+ createVNode(unref(TMagicButton), {
5193
+ size: "small",
5194
+ type: "success",
5195
+ disabled: __props.disabled,
5196
+ plain: ""
5197
+ }, {
5198
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
5199
+ createTextVNode(
5200
+ "导入EXCEL",
5201
+ -1
5202
+ /* CACHED */
5203
+ )
5204
+ ])]),
5205
+ _: 1
5206
+ /* STABLE */
5207
+ }, 8, ["disabled"])
5208
+ ]),
5209
+ _: 1
5210
+ /* STABLE */
5211
+ }, 8, ["disabled", "on-change"])) : createCommentVNode("v-if", true),
5212
+ unref(importable) ? (openBlock(), createBlock(unref(TMagicButton), {
5213
+ key: 3,
5214
+ size: "small",
5215
+ type: "warning",
5216
+ disabled: __props.disabled,
5217
+ plain: "",
5218
+ onClick: unref(clearHandler)
5219
+ }, {
5220
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
5221
+ createTextVNode(
5222
+ "清空",
5223
+ -1
5224
+ /* CACHED */
5225
+ )
5226
+ ])]),
5227
+ _: 1
5228
+ /* STABLE */
5229
+ }, 8, ["disabled", "onClick"])) : createCommentVNode("v-if", true)
5230
+ ]),
5231
+ unref(addable) ? (openBlock(), createBlock(unref(TMagicButton), {
5128
5232
  key: 0,
5129
- icon: unref(Grid),
5130
- size: "small",
5131
- type: "primary",
5132
- onClick: toggleMode
5133
- }, {
5134
- default: withCtx(() => [..._cache[2] || (_cache[2] = [
5135
- createTextVNode(
5136
- "展开配置",
5137
- -1
5138
- /* CACHED */
5139
- )
5140
- ])]),
5141
- _: 1
5142
- /* STABLE */
5143
- }, 8, ["icon"])) : createCommentVNode("v-if", true),
5144
- __props.config.enableFullscreen !== false ? (openBlock(), createBlock(unref(TMagicButton), {
5145
- key: 1,
5146
- icon: unref(FullScreen),
5147
5233
  size: "small",
5148
5234
  type: "primary",
5149
- onClick: unref(toggleFullscreen)
5150
- }, {
5151
- default: withCtx(() => [
5152
- createTextVNode(
5153
- toDisplayString(unref(isFullscreen) ? "退出全屏" : "全屏编辑"),
5154
- 1
5155
- /* TEXT */
5156
- )
5157
- ]),
5158
- _: 1
5159
- /* STABLE */
5160
- }, 8, ["icon", "onClick"])) : createCommentVNode("v-if", true),
5161
- unref(importable) ? (openBlock(), createBlock(unref(TMagicUpload), {
5162
- key: 2,
5163
- style: { "display": "inline-block" },
5164
- ref: "excelBtn",
5165
- action: "/noop",
5166
- disabled: __props.disabled,
5167
- "on-change": unref(excelHandler),
5168
- "auto-upload": false
5169
- }, {
5170
- default: withCtx(() => [
5171
- createVNode(unref(TMagicButton), {
5172
- size: "small",
5173
- type: "success",
5174
- disabled: __props.disabled,
5175
- plain: ""
5176
- }, {
5177
- default: withCtx(() => [..._cache[3] || (_cache[3] = [
5178
- createTextVNode(
5179
- "导入EXCEL",
5180
- -1
5181
- /* CACHED */
5182
- )
5183
- ])]),
5184
- _: 1
5185
- /* STABLE */
5186
- }, 8, ["disabled"])
5187
- ]),
5188
- _: 1
5189
- /* STABLE */
5190
- }, 8, ["disabled", "on-change"])) : createCommentVNode("v-if", true),
5191
- unref(importable) ? (openBlock(), createBlock(unref(TMagicButton), {
5192
- key: 3,
5193
- size: "small",
5194
- type: "warning",
5195
5235
  disabled: __props.disabled,
5196
5236
  plain: "",
5197
- onClick: unref(clearHandler)
5237
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(newHandler)())
5198
5238
  }, {
5199
5239
  default: withCtx(() => [..._cache[4] || (_cache[4] = [
5200
5240
  createTextVNode(
5201
- "清空",
5241
+ "新增一行",
5202
5242
  -1
5203
5243
  /* CACHED */
5204
5244
  )
5205
5245
  ])]),
5206
5246
  _: 1
5207
5247
  /* STABLE */
5208
- }, 8, ["disabled", "onClick"])) : createCommentVNode("v-if", true)
5209
- ])
5210
- ]),
5211
- __props.config.pagination ? (openBlock(), createElementBlock("div", _hoisted_5, [
5212
- createVNode(unref(TMagicPagination), {
5213
- layout: "total, sizes, prev, pager, next, jumper",
5214
- "hide-on-single-page": __props.model[modelName.value].length < unref(pageSize),
5215
- "current-page": unref(currentPage) + 1,
5216
- "page-sizes": [unref(pageSize), 60, 120, 300],
5217
- "page-size": unref(pageSize),
5218
- total: __props.model[modelName.value].length,
5219
- onSizeChange: unref(handleSizeChange),
5220
- onCurrentChange: unref(handleCurrentChange)
5221
- }, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total", "onSizeChange", "onCurrentChange"])
5222
- ])) : createCommentVNode("v-if", true)
5223
- ],
5224
- 2
5225
- /* CLASS */
5226
- )
5227
- ], 8, ["disabled"]))
5228
- ]);
5248
+ }, 8, ["disabled"])) : createCommentVNode("v-if", true)
5249
+ ]),
5250
+ __props.config.pagination ? (openBlock(), createElementBlock("div", _hoisted_4, [
5251
+ createVNode(unref(TMagicPagination), {
5252
+ layout: "total, sizes, prev, pager, next, jumper",
5253
+ "hide-on-single-page": __props.model[modelName.value].length < unref(pageSize),
5254
+ "current-page": unref(currentPage) + 1,
5255
+ "page-sizes": [unref(pageSize), 60, 120, 300],
5256
+ "page-size": unref(pageSize),
5257
+ total: __props.model[modelName.value].length,
5258
+ onSizeChange: unref(handleSizeChange),
5259
+ onCurrentChange: unref(handleCurrentChange)
5260
+ }, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total", "onSizeChange", "onCurrentChange"])
5261
+ ])) : createCommentVNode("v-if", true)
5262
+ ],
5263
+ 2
5264
+ /* CLASS */
5265
+ )
5266
+ ],
5267
+ 16
5268
+ /* FULL_PROPS */
5269
+ )
5270
+ ], 8, ["disabled"]);
5229
5271
  };
5230
5272
  }
5231
5273
  });
@@ -5269,8 +5311,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5269
5311
  });
5270
5312
  const submitHandler = async () => {
5271
5313
  try {
5314
+ const changeRecords = form.value?.changeRecords;
5272
5315
  const values = await form.value?.submitForm();
5273
- emit("submit", values, { changeRecords: form.value?.changeRecords });
5316
+ emit("submit", values, { changeRecords });
5274
5317
  } catch (e) {
5275
5318
  emit("error", e);
5276
5319
  }
@@ -5464,8 +5507,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
5464
5507
  });
5465
5508
  const submitHandler = async () => {
5466
5509
  try {
5510
+ const changeRecords = form.value?.changeRecords;
5467
5511
  const values = await form.value?.submitForm();
5468
- emit("submit", values, { changeRecords: form.value?.changeRecords });
5512
+ emit("submit", values, { changeRecords });
5469
5513
  } catch (e) {
5470
5514
  emit("error", e);
5471
5515
  }