@tmagic/form 1.2.6 → 1.2.7

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,14 +1,13 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons-vue'), require('@tmagic/design'), require('lodash-es'), require('sortablejs'), require('@tmagic/utils'), require('lodash-es/cloneDeep'), require('lodash-es/isEqual')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons-vue', '@tmagic/design', 'lodash-es', 'sortablejs', '@tmagic/utils', 'lodash-es/cloneDeep', 'lodash-es/isEqual'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicForm = {}, global.Vue, global.iconsVue, global.design, global.lodashEs, global.Sortable, global.utils, global.cloneDeep, global.isEqual));
5
- })(this, (function (exports, vue, iconsVue, design, lodashEs, Sortable, utils, cloneDeep, isEqual) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons-vue'), require('lodash-es'), require('@tmagic/design'), require('sortablejs'), require('@tmagic/utils'), require('lodash-es/cloneDeep')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons-vue', 'lodash-es', '@tmagic/design', 'sortablejs', '@tmagic/utils', 'lodash-es/cloneDeep'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicForm = {}, global.Vue, global.iconsVue, global.lodashEs, global.design, global.Sortable, global.utils, global.cloneDeep));
5
+ })(this, (function (exports, vue, iconsVue, lodashEs, design, Sortable, utils, cloneDeep) { 'use strict';
6
6
 
7
7
  const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
8
8
 
9
9
  const Sortable__default = /*#__PURE__*/_interopDefaultLegacy(Sortable);
10
10
  const cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
11
- const isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
12
11
 
13
12
  const isTableSelect = (type) => typeof type === "string" && ["table-select", "tableSelect"].includes(type);
14
13
  const asyncLoadConfig = (value, initValue2, { asyncLoad, name, type }) => {
@@ -170,12 +169,20 @@
170
169
  return valuesTmp || {};
171
170
  };
172
171
 
173
- const _hoisted_1$b = ["innerHTML"];
172
+ const _hoisted_1$c = ["innerHTML"];
174
173
  const _hoisted_2$7 = ["innerHTML"];
175
174
  const _hoisted_3$7 = ["innerHTML"];
176
175
  const _hoisted_4$6 = ["innerHTML"];
177
- const _hoisted_5$4 = {
178
- key: 4,
176
+ const _hoisted_5$4 = ["innerHTML"];
177
+ const _hoisted_6$3 = ["innerHTML"];
178
+ const _hoisted_7$3 = ["innerHTML"];
179
+ const _hoisted_8$2 = ["innerHTML"];
180
+ const _hoisted_9$1 = ["innerHTML"];
181
+ const _hoisted_10$1 = ["innerHTML"];
182
+ const _hoisted_11 = ["innerHTML"];
183
+ const _hoisted_12 = ["innerHTML"];
184
+ const _hoisted_13 = {
185
+ key: 5,
179
186
  style: { "text-align": "center" }
180
187
  };
181
188
  const __default__$v = vue.defineComponent({
@@ -185,20 +192,29 @@
185
192
  ...__default__$v,
186
193
  props: {
187
194
  model: null,
195
+ lastValues: { default: () => ({}) },
188
196
  config: null,
189
197
  prop: { default: "" },
190
198
  disabled: { type: Boolean },
191
199
  labelWidth: null,
192
200
  expandMore: { type: Boolean, default: false },
193
201
  stepActive: null,
194
- size: { default: "small" }
202
+ size: { default: "small" },
203
+ isCompare: { type: Boolean, default: false }
195
204
  },
196
- emits: ["change"],
205
+ emits: ["change", "addDiffCount"],
197
206
  setup(__props, { emit }) {
198
207
  const props = __props;
199
208
  const mForm = vue.inject("mForm");
200
209
  const expand = vue.ref(false);
201
210
  const name = vue.computed(() => props.config.name || "");
211
+ const showDiff = vue.computed(() => {
212
+ if (!props.isCompare)
213
+ return false;
214
+ const curValue = name.value ? props.model[name.value] : props.model;
215
+ const lastValue = name.value ? props.lastValues[name.value] : props.lastValues;
216
+ return !lodashEs.isEqual(curValue, lastValue);
217
+ });
202
218
  const items = vue.computed(() => props.config.items);
203
219
  const itemProp = vue.computed(() => {
204
220
  let n = "";
@@ -244,6 +260,21 @@
244
260
  vue.watchEffect(() => {
245
261
  expand.value = props.expandMore;
246
262
  });
263
+ vue.watch(
264
+ showDiff,
265
+ (showDiff2) => {
266
+ if (type.value === "hidden")
267
+ return;
268
+ if (items.value && !props.config.text && type.value && display$1.value)
269
+ return;
270
+ if (display$1.value && showDiff2 && type.value) {
271
+ emit("addDiffCount");
272
+ }
273
+ },
274
+ {
275
+ immediate: true
276
+ }
277
+ );
247
278
  const expandHandler = () => expand.value = !expand.value;
248
279
  const key = (config) => config[mForm?.keyProps];
249
280
  const filterHandler = (filter, value) => {
@@ -277,6 +308,7 @@
277
308
  return value.replace(/^\s*/, "").replace(/\s*$/, "");
278
309
  }
279
310
  };
311
+ const onAddDiffCount = () => emit("addDiffCount");
280
312
  const onChangeHandler = async function(v, key2) {
281
313
  const { filter, onChange, trim, name: name2, dynamicKey } = props.config;
282
314
  let value = v;
@@ -314,6 +346,8 @@
314
346
  key: key(__props.config),
315
347
  size: __props.size,
316
348
  model: __props.model,
349
+ "last-values": __props.lastValues,
350
+ "is-compare": __props.isCompare,
317
351
  config: __props.config,
318
352
  disabled: vue.unref(disabled),
319
353
  name: vue.unref(name),
@@ -321,8 +355,9 @@
321
355
  "step-active": __props.stepActive,
322
356
  "expand-more": expand.value,
323
357
  "label-width": vue.unref(itemLabelWidth),
324
- onChange: onChangeHandler
325
- }, null, 40, ["size", "model", "config", "disabled", "name", "prop", "step-active", "expand-more", "label-width"])) : vue.unref(type) && vue.unref(display$1) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
358
+ onChange: onChangeHandler,
359
+ onAddDiffCount
360
+ }, null, 40, ["size", "model", "last-values", "is-compare", "config", "disabled", "name", "prop", "step-active", "expand-more", "label-width"])) : vue.unref(type) && vue.unref(display$1) && !vue.unref(showDiff) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
326
361
  vue.createVNode(vue.unref(design.TMagicFormItem), {
327
362
  style: vue.normalizeStyle(__props.config.tip ? "flex: 1" : ""),
328
363
  class: vue.normalizeClass({ hidden: `${vue.unref(itemLabelWidth)}` === "0" || !__props.config.text }),
@@ -333,7 +368,7 @@
333
368
  label: vue.withCtx(() => [
334
369
  vue.createElementVNode("span", {
335
370
  innerHTML: vue.unref(type) === "checkbox" ? "" : __props.config.text
336
- }, null, 8, _hoisted_1$b)
371
+ }, null, 8, _hoisted_1$c)
337
372
  ]),
338
373
  default: vue.withCtx(() => [
339
374
  vue.unref(tooltip) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
@@ -349,7 +384,8 @@
349
384
  name: vue.unref(name),
350
385
  disabled: vue.unref(disabled),
351
386
  prop: vue.unref(itemProp),
352
- onChange: onChangeHandler
387
+ onChange: onChangeHandler,
388
+ onAddDiffCount
353
389
  }, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
354
390
  ]),
355
391
  _: 1
@@ -361,7 +397,8 @@
361
397
  name: vue.unref(name),
362
398
  disabled: vue.unref(disabled),
363
399
  prop: vue.unref(itemProp),
364
- onChange: onChangeHandler
400
+ onChange: onChangeHandler,
401
+ onAddDiffCount
365
402
  }, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
366
403
  vue.unref(extra) ? (vue.openBlock(), vue.createElementBlock("div", {
367
404
  key: 2,
@@ -390,11 +427,148 @@
390
427
  ]),
391
428
  _: 1
392
429
  })) : vue.createCommentVNode("", true)
393
- ], 64)) : vue.unref(items) && vue.unref(display$1) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
430
+ ], 64)) : vue.unref(type) && vue.unref(display$1) && vue.unref(showDiff) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
431
+ vue.createVNode(vue.unref(design.TMagicFormItem), {
432
+ style: vue.normalizeStyle([__props.config.tip ? "flex: 1" : "", { "background": "#f7dadd" }]),
433
+ class: vue.normalizeClass({ hidden: `${vue.unref(itemLabelWidth)}` === "0" || !__props.config.text }),
434
+ prop: vue.unref(itemProp),
435
+ "label-width": vue.unref(itemLabelWidth),
436
+ rules: vue.unref(rule)
437
+ }, {
438
+ label: vue.withCtx(() => [
439
+ vue.createElementVNode("span", {
440
+ innerHTML: vue.unref(type) === "checkbox" ? "" : __props.config.text
441
+ }, null, 8, _hoisted_5$4)
442
+ ]),
443
+ default: vue.withCtx(() => [
444
+ vue.unref(tooltip) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
445
+ content: vue.withCtx(() => [
446
+ vue.createElementVNode("div", { innerHTML: vue.unref(tooltip) }, null, 8, _hoisted_6$3)
447
+ ]),
448
+ default: vue.withCtx(() => [
449
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tagName)), {
450
+ key: key(__props.config),
451
+ size: __props.size,
452
+ model: __props.lastValues,
453
+ config: __props.config,
454
+ name: vue.unref(name),
455
+ disabled: vue.unref(disabled),
456
+ prop: vue.unref(itemProp),
457
+ onChange: onChangeHandler
458
+ }, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
459
+ ]),
460
+ _: 1
461
+ })) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tagName)), {
462
+ key: key(__props.config),
463
+ size: __props.size,
464
+ model: __props.lastValues,
465
+ config: __props.config,
466
+ name: vue.unref(name),
467
+ disabled: vue.unref(disabled),
468
+ prop: vue.unref(itemProp),
469
+ onChange: onChangeHandler
470
+ }, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
471
+ vue.unref(extra) ? (vue.openBlock(), vue.createElementBlock("div", {
472
+ key: 2,
473
+ innerHTML: vue.unref(extra),
474
+ class: "m-form-tip"
475
+ }, null, 8, _hoisted_7$3)) : vue.createCommentVNode("", true)
476
+ ]),
477
+ _: 1
478
+ }, 8, ["style", "class", "prop", "label-width", "rules"]),
479
+ __props.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
480
+ key: 0,
481
+ placement: "left"
482
+ }, {
483
+ content: vue.withCtx(() => [
484
+ vue.createElementVNode("div", {
485
+ innerHTML: __props.config.tip
486
+ }, null, 8, _hoisted_8$2)
487
+ ]),
488
+ default: vue.withCtx(() => [
489
+ vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
490
+ default: vue.withCtx(() => [
491
+ vue.createVNode(vue.unref(iconsVue.WarningFilled))
492
+ ]),
493
+ _: 1
494
+ })
495
+ ]),
496
+ _: 1
497
+ })) : vue.createCommentVNode("", true),
498
+ vue.createVNode(vue.unref(design.TMagicFormItem), {
499
+ style: vue.normalizeStyle([__props.config.tip ? "flex: 1" : "", { "background": "#def7da" }]),
500
+ class: vue.normalizeClass({ hidden: `${vue.unref(itemLabelWidth)}` === "0" || !__props.config.text }),
501
+ prop: vue.unref(itemProp),
502
+ "label-width": vue.unref(itemLabelWidth),
503
+ rules: vue.unref(rule)
504
+ }, {
505
+ label: vue.withCtx(() => [
506
+ vue.createElementVNode("span", {
507
+ innerHTML: vue.unref(type) === "checkbox" ? "" : __props.config.text
508
+ }, null, 8, _hoisted_9$1)
509
+ ]),
510
+ default: vue.withCtx(() => [
511
+ vue.unref(tooltip) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
512
+ content: vue.withCtx(() => [
513
+ vue.createElementVNode("div", { innerHTML: vue.unref(tooltip) }, null, 8, _hoisted_10$1)
514
+ ]),
515
+ default: vue.withCtx(() => [
516
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tagName)), {
517
+ key: key(__props.config),
518
+ size: __props.size,
519
+ model: __props.model,
520
+ config: __props.config,
521
+ name: vue.unref(name),
522
+ disabled: vue.unref(disabled),
523
+ prop: vue.unref(itemProp),
524
+ onChange: onChangeHandler
525
+ }, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
526
+ ]),
527
+ _: 1
528
+ })) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tagName)), {
529
+ key: key(__props.config),
530
+ size: __props.size,
531
+ model: __props.model,
532
+ config: __props.config,
533
+ name: vue.unref(name),
534
+ disabled: vue.unref(disabled),
535
+ prop: vue.unref(itemProp),
536
+ onChange: onChangeHandler
537
+ }, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
538
+ vue.unref(extra) ? (vue.openBlock(), vue.createElementBlock("div", {
539
+ key: 2,
540
+ innerHTML: vue.unref(extra),
541
+ class: "m-form-tip"
542
+ }, null, 8, _hoisted_11)) : vue.createCommentVNode("", true)
543
+ ]),
544
+ _: 1
545
+ }, 8, ["style", "class", "prop", "label-width", "rules"]),
546
+ __props.config.tip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
547
+ key: 1,
548
+ placement: "left"
549
+ }, {
550
+ content: vue.withCtx(() => [
551
+ vue.createElementVNode("div", {
552
+ innerHTML: __props.config.tip
553
+ }, null, 8, _hoisted_12)
554
+ ]),
555
+ default: vue.withCtx(() => [
556
+ vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
557
+ default: vue.withCtx(() => [
558
+ vue.createVNode(vue.unref(iconsVue.WarningFilled))
559
+ ]),
560
+ _: 1
561
+ })
562
+ ]),
563
+ _: 1
564
+ })) : vue.createCommentVNode("", true)
565
+ ], 64)) : vue.unref(items) && vue.unref(display$1) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 4 }, [
394
566
  (vue.unref(name) || vue.unref(name) === 0 ? __props.model[vue.unref(name)] : __props.model) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(vue.unref(items), (item) => {
395
567
  return vue.openBlock(), vue.createBlock(_component_Container, {
396
568
  key: key(item),
397
569
  model: vue.unref(name) || vue.unref(name) === 0 ? __props.model[vue.unref(name)] : __props.model,
570
+ "last-values": vue.unref(name) || vue.unref(name) === 0 ? __props.lastValues[vue.unref(name)] : __props.lastValues,
571
+ "is-compare": __props.isCompare,
398
572
  config: item,
399
573
  size: __props.size,
400
574
  disabled: vue.unref(disabled),
@@ -402,11 +576,12 @@
402
576
  "expand-more": expand.value,
403
577
  "label-width": vue.unref(itemLabelWidth),
404
578
  prop: vue.unref(itemProp),
405
- onChange: onChangeHandler
406
- }, null, 8, ["model", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
579
+ onChange: onChangeHandler,
580
+ onAddDiffCount
581
+ }, null, 8, ["model", "last-values", "is-compare", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
407
582
  }), 128)) : vue.createCommentVNode("", true)
408
583
  ], 64)) : vue.createCommentVNode("", true),
409
- __props.config.expand && vue.unref(type) !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$4, [
584
+ __props.config.expand && vue.unref(type) !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
410
585
  vue.createVNode(vue.unref(design.TMagicButton), {
411
586
  type: "primary",
412
587
  size: "small",
@@ -425,7 +600,7 @@
425
600
  }
426
601
  });
427
602
 
428
- const _hoisted_1$a = ["innerHTML"];
603
+ const _hoisted_1$b = ["innerHTML"];
429
604
  const _hoisted_2$6 = ["innerHTML"];
430
605
  const _hoisted_3$6 = { key: 1 };
431
606
  const _hoisted_4$5 = ["innerHTML"];
@@ -446,11 +621,13 @@
446
621
  prop: { default: "" },
447
622
  size: null,
448
623
  model: null,
624
+ lastValues: { default: () => ({}) },
625
+ isCompare: { type: Boolean, default: false },
449
626
  config: null,
450
627
  rules: { default: {} },
451
628
  disabled: { type: Boolean }
452
629
  },
453
- emits: ["change"],
630
+ emits: ["change", "addDiffCount"],
454
631
  setup(__props, { emit }) {
455
632
  const props = __props;
456
633
  const mForm = vue.inject("mForm");
@@ -479,6 +656,7 @@
479
656
  }
480
657
  );
481
658
  }
659
+ const onAddDiffCount = () => emit("addDiffCount");
482
660
  return (_ctx, _cache) => {
483
661
  return (vue.unref(name) ? __props.model[vue.unref(name)] : __props.model) ? (vue.openBlock(), vue.createElementBlock("fieldset", {
484
662
  key: 0,
@@ -497,7 +675,7 @@
497
675
  default: vue.withCtx(() => [
498
676
  vue.createElementVNode("span", {
499
677
  innerHTML: __props.config.legend
500
- }, null, 8, _hoisted_1$a),
678
+ }, null, 8, _hoisted_1$b),
501
679
  __props.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
502
680
  key: 0,
503
681
  innerHTML: __props.config.extra,
@@ -524,14 +702,17 @@
524
702
  return vue.openBlock(), vue.createBlock(_sfc_main$v, {
525
703
  key: key(item, index),
526
704
  model: vue.unref(name) ? __props.model[vue.unref(name)] : __props.model,
705
+ lastValues: vue.unref(name) ? __props.lastValues[vue.unref(name)] : __props.lastValues,
706
+ "is-compare": __props.isCompare,
527
707
  rules: vue.unref(name) ? __props.rules[vue.unref(name)] : [],
528
708
  config: item,
529
709
  prop: __props.prop,
530
710
  disabled: __props.disabled,
531
711
  labelWidth: vue.unref(lWidth),
532
712
  size: __props.size,
533
- onChange: change
534
- }, null, 8, ["model", "rules", "config", "prop", "disabled", "labelWidth", "size"]);
713
+ onChange: change,
714
+ onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
715
+ }, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "disabled", "labelWidth", "size"]);
535
716
  }), 128))
536
717
  ]),
537
718
  vue.createElementVNode("img", {
@@ -542,21 +723,24 @@
542
723
  return vue.openBlock(), vue.createBlock(_sfc_main$v, {
543
724
  key: key(item, index),
544
725
  model: vue.unref(name) ? __props.model[vue.unref(name)] : __props.model,
726
+ lastValues: vue.unref(name) ? __props.lastValues[vue.unref(name)] : __props.lastValues,
727
+ "is-compare": __props.isCompare,
545
728
  rules: vue.unref(name) ? __props.rules[vue.unref(name)] : [],
546
729
  config: item,
547
730
  prop: __props.prop,
548
731
  labelWidth: vue.unref(lWidth),
549
732
  size: __props.size,
550
733
  disabled: __props.disabled,
551
- onChange: change
552
- }, null, 8, ["model", "rules", "config", "prop", "labelWidth", "size", "disabled"]);
734
+ onChange: change,
735
+ onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
736
+ }, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "labelWidth", "size", "disabled"]);
553
737
  }), 128)) : vue.createCommentVNode("", true)
554
738
  ], 4)) : vue.createCommentVNode("", true);
555
739
  };
556
740
  }
557
741
  });
558
742
 
559
- const _hoisted_1$9 = { class: "m-fields-group-list-item" };
743
+ const _hoisted_1$a = { class: "m-fields-group-list-item" };
560
744
  const _hoisted_2$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0A\u79FB");
561
745
  const _hoisted_3$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0B\u79FB");
562
746
  const _hoisted_4$4 = ["innerHTML"];
@@ -567,6 +751,8 @@
567
751
  ...__default__$t,
568
752
  props: {
569
753
  model: null,
754
+ lastValues: null,
755
+ isCompare: { type: Boolean },
570
756
  groupModel: null,
571
757
  config: null,
572
758
  labelWidth: null,
@@ -575,7 +761,7 @@
575
761
  index: null,
576
762
  disabled: { type: Boolean }
577
763
  },
578
- emits: ["swap-item", "remove-item", "change"],
764
+ emits: ["swap-item", "remove-item", "change", "addDiffCount"],
579
765
  setup(__props, { emit }) {
580
766
  const props = __props;
581
767
  const mForm = vue.inject("mForm");
@@ -620,8 +806,9 @@
620
806
  }
621
807
  return movable2;
622
808
  };
809
+ const onAddDiffCount = () => emit("addDiffCount");
623
810
  return (_ctx, _cache) => {
624
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
811
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
625
812
  vue.createElementVNode("div", null, [
626
813
  vue.createVNode(vue.unref(design.TMagicIcon), {
627
814
  style: { "margin-right": "7px" },
@@ -701,18 +888,21 @@
701
888
  key: 0,
702
889
  config: vue.unref(rowConfig),
703
890
  model: __props.model,
891
+ lastValues: __props.lastValues,
892
+ "is-compare": __props.isCompare,
704
893
  labelWidth: __props.labelWidth,
705
894
  prop: `${__props.prop}${__props.prop ? "." : ""}${String(__props.index)}`,
706
895
  size: __props.size,
707
896
  disabled: __props.disabled,
708
- onChange: changeHandler
709
- }, null, 8, ["config", "model", "labelWidth", "prop", "size", "disabled"])) : vue.createCommentVNode("", true)
897
+ onChange: changeHandler,
898
+ onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
899
+ }, null, 8, ["config", "model", "lastValues", "is-compare", "labelWidth", "prop", "size", "disabled"])) : vue.createCommentVNode("", true)
710
900
  ]);
711
901
  };
712
902
  }
713
903
  });
714
904
 
715
- const _hoisted_1$8 = { class: "m-fields-group-list" };
905
+ const _hoisted_1$9 = { class: "m-fields-group-list" };
716
906
  const _hoisted_2$4 = ["innerHTML"];
717
907
  const _hoisted_3$4 = {
718
908
  key: 1,
@@ -731,6 +921,8 @@
731
921
  ...__default__$s,
732
922
  props: {
733
923
  model: null,
924
+ lastValues: null,
925
+ isCompare: { type: Boolean },
734
926
  config: null,
735
927
  name: null,
736
928
  labelWidth: null,
@@ -738,7 +930,7 @@
738
930
  size: null,
739
931
  disabled: { type: Boolean }
740
932
  },
741
- emits: ["change"],
933
+ emits: ["change", "addDiffCount"],
742
934
  setup(__props, { emit }) {
743
935
  const props = __props;
744
936
  const mForm = vue.inject("mForm");
@@ -802,8 +994,10 @@
802
994
  text: null
803
995
  }));
804
996
  };
997
+ const onAddDiffCount = () => emit("addDiffCount");
998
+ const getLastValues = (item, index) => item?.[index] || {};
805
999
  return (_ctx, _cache) => {
806
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
1000
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
807
1001
  __props.config.extra ? (vue.openBlock(), vue.createElementBlock("div", {
808
1002
  key: 0,
809
1003
  innerHTML: __props.config.extra,
@@ -813,6 +1007,8 @@
813
1007
  return vue.openBlock(), vue.createBlock(_sfc_main$t, {
814
1008
  key: index,
815
1009
  model: item,
1010
+ lastValues: getLastValues(__props.lastValues[__props.name], index),
1011
+ "is-compare": __props.isCompare,
816
1012
  config: __props.config,
817
1013
  prop: __props.prop,
818
1014
  index,
@@ -822,8 +1018,9 @@
822
1018
  "group-model": __props.model[__props.name],
823
1019
  onRemoveItem: removeHandler,
824
1020
  onSwapItem: swapHandler,
825
- onChange: changeHandler
826
- }, null, 8, ["model", "config", "prop", "index", "label-width", "size", "disabled", "group-model"]);
1021
+ onChange: changeHandler,
1022
+ onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
1023
+ }, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "index", "label-width", "size", "disabled", "group-model"]);
827
1024
  }), 128)),
828
1025
  vue.unref(addable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
829
1026
  key: 3,
@@ -852,7 +1049,7 @@
852
1049
  }
853
1050
  });
854
1051
 
855
- const _hoisted_1$7 = { class: "clearfix" };
1052
+ const _hoisted_1$8 = { class: "clearfix" };
856
1053
  const _hoisted_2$3 = ["innerHTML"];
857
1054
  const _hoisted_3$3 = {
858
1055
  key: 0,
@@ -867,6 +1064,8 @@
867
1064
  ...__default__$r,
868
1065
  props: {
869
1066
  model: null,
1067
+ lastValues: null,
1068
+ isCompare: { type: Boolean },
870
1069
  config: null,
871
1070
  name: null,
872
1071
  labelWidth: null,
@@ -874,7 +1073,7 @@
874
1073
  size: null,
875
1074
  disabled: { type: Boolean }
876
1075
  },
877
- emits: ["change"],
1076
+ emits: ["change", "addDiffCount"],
878
1077
  setup(__props, { emit }) {
879
1078
  const props = __props;
880
1079
  const mForm = vue.inject("mForm");
@@ -882,6 +1081,7 @@
882
1081
  const items = vue.computed(() => props.config.items);
883
1082
  const filter = (config) => filterFunction(mForm, config, props);
884
1083
  const changeHandler = () => emit("change", props.model);
1084
+ const onAddDiffCount = () => emit("addDiffCount");
885
1085
  return (_ctx, _cache) => {
886
1086
  return vue.unref(items) && vue.unref(items).length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCard), {
887
1087
  key: 0,
@@ -889,7 +1089,7 @@
889
1089
  "body-style": { display: expand.value ? "block" : "none" }
890
1090
  }, {
891
1091
  header: vue.withCtx(() => [
892
- vue.createElementVNode("div", _hoisted_1$7, [
1092
+ vue.createElementVNode("div", _hoisted_1$8, [
893
1093
  vue.createElementVNode("a", {
894
1094
  href: "javascript:",
895
1095
  style: { "width": "100%", "display": "block" },
@@ -920,12 +1120,15 @@
920
1120
  key: item[vue.unref(mForm)?.keyProp || "__key"] ?? index,
921
1121
  config: item,
922
1122
  model: __props.name ? __props.model[__props.name] : __props.model,
1123
+ lastValues: __props.name ? __props.lastValues[__props.name] : __props.lastValues,
1124
+ "is-compare": __props.isCompare,
923
1125
  prop: __props.prop,
924
1126
  size: __props.size,
925
1127
  disabled: __props.disabled,
926
1128
  "label-width": __props.config.labelWidth || __props.labelWidth,
927
- onChange: changeHandler
928
- }, null, 8, ["config", "model", "prop", "size", "disabled", "label-width"]);
1129
+ onChange: changeHandler,
1130
+ onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1131
+ }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
929
1132
  }), 128))
930
1133
  ]),
931
1134
  vue.createElementVNode("img", {
@@ -937,12 +1140,15 @@
937
1140
  key: item[vue.unref(mForm)?.keyProp || "__key"] ?? index,
938
1141
  config: item,
939
1142
  model: __props.name ? __props.model[__props.name] : __props.model,
1143
+ lastValues: __props.name ? __props.lastValues[__props.name] : __props.lastValues,
1144
+ "is-compare": __props.isCompare,
940
1145
  prop: __props.prop,
941
1146
  size: __props.size,
942
1147
  disabled: __props.disabled,
943
1148
  "label-width": __props.config.labelWidth || __props.labelWidth,
944
- onChange: changeHandler
945
- }, null, 8, ["config", "model", "prop", "size", "disabled", "label-width"]);
1149
+ onChange: changeHandler,
1150
+ onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
1151
+ }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
946
1152
  }), 128))
947
1153
  ])
948
1154
  ]),
@@ -959,6 +1165,8 @@
959
1165
  ...__default__$q,
960
1166
  props: {
961
1167
  model: null,
1168
+ lastValues: null,
1169
+ isCompare: { type: Boolean },
962
1170
  config: null,
963
1171
  labelWidth: null,
964
1172
  expandMore: { type: Boolean },
@@ -967,25 +1175,29 @@
967
1175
  prop: null,
968
1176
  disabled: { type: Boolean }
969
1177
  },
970
- emits: ["change"],
1178
+ emits: ["change", "addDiffCount"],
971
1179
  setup(__props, { emit }) {
972
1180
  const props = __props;
973
1181
  const mForm = vue.inject("mForm");
974
1182
  const display$1 = vue.computed(() => display(mForm, props.config.display, props));
975
1183
  const changeHandler = () => emit("change", props.model);
1184
+ const onAddDiffCount = () => emit("addDiffCount");
976
1185
  return (_ctx, _cache) => {
977
1186
  return vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCol), { span: __props.span }, {
978
1187
  default: vue.withCtx(() => [
979
1188
  vue.createVNode(_sfc_main$v, {
980
1189
  model: __props.model,
1190
+ lastValues: __props.lastValues,
1191
+ "is-compare": __props.isCompare,
981
1192
  config: __props.config,
982
1193
  prop: __props.prop,
983
1194
  "label-width": __props.config.labelWidth || __props.labelWidth,
984
1195
  "expand-more": __props.expandMore,
985
1196
  size: __props.size,
986
1197
  disabled: __props.disabled,
987
- onChange: changeHandler
988
- }, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "disabled"])
1198
+ onChange: changeHandler,
1199
+ onAddDiffCount
1200
+ }, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "label-width", "expand-more", "size", "disabled"])
989
1201
  ]),
990
1202
  _: 1
991
1203
  }, 8, ["span"])), [
@@ -1002,6 +1214,8 @@
1002
1214
  ...__default__$p,
1003
1215
  props: {
1004
1216
  model: null,
1217
+ lastValues: null,
1218
+ isCompare: { type: Boolean },
1005
1219
  config: null,
1006
1220
  name: null,
1007
1221
  labelWidth: null,
@@ -1010,11 +1224,12 @@
1010
1224
  expandMore: { type: Boolean },
1011
1225
  disabled: { type: Boolean }
1012
1226
  },
1013
- emits: ["change"],
1227
+ emits: ["change", "addDiffCount"],
1014
1228
  setup(__props, { emit }) {
1015
1229
  const props = __props;
1016
1230
  const mForm = vue.inject("mForm");
1017
1231
  const changeHandler = () => emit("change", props.name ? props.model[props.name] : props.model);
1232
+ const onAddDiffCount = () => emit("addDiffCount");
1018
1233
  return (_ctx, _cache) => {
1019
1234
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRow), { gutter: 10 }, {
1020
1235
  default: vue.withCtx(() => [
@@ -1026,11 +1241,14 @@
1026
1241
  labelWidth: __props.config.labelWidth || __props.labelWidth,
1027
1242
  expandMore: __props.expandMore,
1028
1243
  model: __props.name ? __props.model[__props.name] : __props.model,
1244
+ lastValues: __props.name ? __props.lastValues[__props.name] : __props.lastValues,
1245
+ "is-compare": __props.isCompare,
1029
1246
  prop: __props.prop,
1030
1247
  size: __props.size,
1031
1248
  disabled: __props.disabled,
1032
- onChange: changeHandler
1033
- }, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size", "disabled"]);
1249
+ onChange: changeHandler,
1250
+ onAddDiffCount
1251
+ }, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "lastValues", "is-compare", "prop", "size", "disabled"]);
1034
1252
  }), 128))
1035
1253
  ]),
1036
1254
  _: 1
@@ -1046,13 +1264,15 @@
1046
1264
  ...__default__$o,
1047
1265
  props: {
1048
1266
  model: null,
1267
+ lastValues: null,
1268
+ isCompare: { type: Boolean },
1049
1269
  config: null,
1050
1270
  stepActive: { default: 1 },
1051
1271
  labelWidth: null,
1052
1272
  size: null,
1053
1273
  disabled: { type: Boolean }
1054
1274
  },
1055
- emits: ["change"],
1275
+ emits: ["change", "addDiffCount"],
1056
1276
  setup(__props, { emit }) {
1057
1277
  const props = __props;
1058
1278
  const mForm = vue.inject("mForm");
@@ -1067,6 +1287,7 @@
1067
1287
  const changeHandler = () => {
1068
1288
  emit("change", props.model);
1069
1289
  };
1290
+ const onAddDiffCount = () => emit("addDiffCount");
1070
1291
  return (_ctx, _cache) => {
1071
1292
  return vue.openBlock(), vue.createElementBlock("div", null, [
1072
1293
  vue.createVNode(vue.unref(design.TMagicSteps), {
@@ -1094,12 +1315,15 @@
1094
1315
  key: item[vue.unref(mForm)?.keyProp || "__key"],
1095
1316
  config: item,
1096
1317
  model: step.name ? __props.model[step.name] : __props.model,
1318
+ lastValues: step.name ? __props.lastValues[step.name] : __props.lastValues,
1319
+ "is-compare": __props.isCompare,
1097
1320
  prop: `${step.name}`,
1098
1321
  size: __props.size,
1099
1322
  disabled: __props.disabled,
1100
1323
  "label-width": __props.config.labelWidth || __props.labelWidth,
1101
- onChange: changeHandler
1102
- }, null, 8, ["config", "model", "prop", "size", "disabled", "label-width"])), [
1324
+ onChange: changeHandler,
1325
+ onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
1326
+ }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"])), [
1103
1327
  [vue.vShow, active.value - 1 === index]
1104
1328
  ]) : vue.createCommentVNode("", true)
1105
1329
  ], 64);
@@ -1111,7 +1335,7 @@
1111
1335
  }
1112
1336
  });
1113
1337
 
1114
- const _hoisted_1$6 = ["innerHTML"];
1338
+ const _hoisted_1$7 = ["innerHTML"];
1115
1339
  const _hoisted_2$2 = { class: "el-form-item__content" };
1116
1340
  const _hoisted_3$2 = ["innerHTML"];
1117
1341
  const _hoisted_4$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0");
@@ -1132,6 +1356,8 @@
1132
1356
  ...__default__$n,
1133
1357
  props: {
1134
1358
  model: null,
1359
+ lastValues: { default: () => ({}) },
1360
+ isCompare: { type: Boolean, default: false },
1135
1361
  config: null,
1136
1362
  name: null,
1137
1363
  prop: { default: "" },
@@ -1144,7 +1370,7 @@
1144
1370
  enableToggleMode: { type: Boolean, default: true },
1145
1371
  showIndex: { type: Boolean, default: true }
1146
1372
  },
1147
- emits: ["change", "select"],
1373
+ emits: ["change", "select", "addDiffCount"],
1148
1374
  setup(__props, { expose, emit }) {
1149
1375
  const props = __props;
1150
1376
  let timer = null;
@@ -1162,6 +1388,11 @@
1162
1388
  (item, index) => index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value
1163
1389
  ) : props.model[modelName.value]
1164
1390
  );
1391
+ const lastData = vue.computed(
1392
+ () => props.config.pagination ? props.lastValues[modelName.value].filter(
1393
+ (item, index) => index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value
1394
+ ) : props.lastValues[modelName.value] || {}
1395
+ );
1165
1396
  const sortChange = ({ prop, order }) => {
1166
1397
  if (order === "ascending") {
1167
1398
  props.model[modelName.value] = props.model[modelName.value].sort((a, b) => a[prop] - b[prop]);
@@ -1463,6 +1694,7 @@
1463
1694
  const { prop } = vue.toRefs(props);
1464
1695
  return `${prop.value}${prop.value ? "." : ""}${index + 1 + pagecontext.value * pagesize.value - 1}`;
1465
1696
  };
1697
+ const onAddDiffCount = () => emit("addDiffCount");
1466
1698
  expose({
1467
1699
  toggleRowSelection
1468
1700
  });
@@ -1476,7 +1708,7 @@
1476
1708
  key: 0,
1477
1709
  style: { "color": "rgba(0, 0, 0, 0.45)" },
1478
1710
  innerHTML: __props.config.extra
1479
- }, null, 8, _hoisted_1$6)) : vue.createCommentVNode("", true),
1711
+ }, null, 8, _hoisted_1$7)) : vue.createCommentVNode("", true),
1480
1712
  vue.createElementVNode("div", _hoisted_2$2, [
1481
1713
  vue.createVNode(vue.unref(design.TMagicTooltip), {
1482
1714
  content: "\u62D6\u62FD\u53EF\u6392\u5E8F",
@@ -1490,6 +1722,7 @@
1490
1722
  style: { "width": "100%" },
1491
1723
  "row-key": __props.config.rowKey || "id",
1492
1724
  data: vue.unref(data),
1725
+ lastData: vue.unref(lastData),
1493
1726
  border: __props.config.border,
1494
1727
  "max-height": __props.config.maxHeight,
1495
1728
  "default-expand-all": true,
@@ -1618,9 +1851,12 @@
1618
1851
  rules: column.rules,
1619
1852
  config: makeConfig(column, scope.row),
1620
1853
  model: scope.row,
1854
+ lastValues: vue.unref(lastData)[scope.$index],
1855
+ "is-compare": __props.isCompare,
1621
1856
  size: __props.size,
1622
- onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", __props.model[vue.unref(modelName)]))
1623
- }, null, 8, ["disabled", "prop", "rules", "config", "model", "size"])) : vue.createCommentVNode("", true)
1857
+ onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", __props.model[vue.unref(modelName)])),
1858
+ onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1859
+ }, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : vue.createCommentVNode("", true)
1624
1860
  ]),
1625
1861
  _: 2
1626
1862
  }, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
@@ -1628,7 +1864,7 @@
1628
1864
  }), 256))
1629
1865
  ]),
1630
1866
  _: 3
1631
- }, 8, ["row-key", "data", "border", "max-height"])) : vue.createCommentVNode("", true)
1867
+ }, 8, ["row-key", "data", "lastData", "border", "max-height"])) : vue.createCommentVNode("", true)
1632
1868
  ]),
1633
1869
  _: 3
1634
1870
  }, 8, ["disabled"]),
@@ -1639,7 +1875,7 @@
1639
1875
  type: "primary",
1640
1876
  disabled: __props.disabled,
1641
1877
  plain: "",
1642
- onClick: _cache[1] || (_cache[1] = ($event) => newHandler())
1878
+ onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
1643
1879
  }, {
1644
1880
  default: vue.withCtx(() => [
1645
1881
  _hoisted_4$1
@@ -1703,7 +1939,7 @@
1703
1939
  type: "warning",
1704
1940
  disabled: __props.disabled,
1705
1941
  plain: "",
1706
- onClick: _cache[2] || (_cache[2] = ($event) => clearHandler())
1942
+ onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
1707
1943
  }, {
1708
1944
  default: vue.withCtx(() => [
1709
1945
  _hoisted_9
@@ -1728,6 +1964,7 @@
1728
1964
  }
1729
1965
  });
1730
1966
 
1967
+ const _hoisted_1$6 = { class: "custom-tabs-label" };
1731
1968
  const __default__$m = vue.defineComponent({
1732
1969
  name: "MFormTabs"
1733
1970
  });
@@ -1735,6 +1972,8 @@
1735
1972
  ...__default__$m,
1736
1973
  props: {
1737
1974
  model: null,
1975
+ lastValues: { default: () => ({}) },
1976
+ isCompare: { type: Boolean, default: false },
1738
1977
  config: null,
1739
1978
  name: null,
1740
1979
  size: null,
@@ -1743,7 +1982,7 @@
1743
1982
  expandMore: { type: Boolean },
1744
1983
  disabled: { type: Boolean }
1745
1984
  },
1746
- emits: ["change"],
1985
+ emits: ["change", "addDiffCount"],
1747
1986
  setup(__props, { emit }) {
1748
1987
  const props = __props;
1749
1988
  const uiComponent = design.getConfig("components").tabPane;
@@ -1771,6 +2010,7 @@
1771
2010
  };
1772
2011
  const mForm = vue.inject("mForm");
1773
2012
  const activeTabName = vue.ref(getActive(mForm, props, ""));
2013
+ const diffCount = vue.ref({});
1774
2014
  const tabs = vue.computed(() => {
1775
2015
  if (props.config.dynamic) {
1776
2016
  if (!props.config.name)
@@ -1833,7 +2073,27 @@
1833
2073
  props.config.onChange(mForm, { model: props.model, prop: props.prop, config: props.config });
1834
2074
  }
1835
2075
  };
2076
+ const getValues = (model, tabIndex, tab) => {
2077
+ const tabName = props.config.dynamic ? (model[props?.name] || model)[tabIndex] : tab.name;
2078
+ let propName = props.name;
2079
+ if (tabName) {
2080
+ propName = (model[props?.name] || model)[tab.name];
2081
+ }
2082
+ if (propName) {
2083
+ return model[props.name];
2084
+ }
2085
+ return model;
2086
+ };
2087
+ const onAddDiffCount = (tabIndex) => {
2088
+ if (!diffCount.value[tabIndex]) {
2089
+ diffCount.value[tabIndex] = 1;
2090
+ } else {
2091
+ diffCount.value[tabIndex] += 1;
2092
+ }
2093
+ emit("addDiffCount");
2094
+ };
1836
2095
  return (_ctx, _cache) => {
2096
+ const _component_el_badge = vue.resolveComponent("el-badge");
1837
2097
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTabs), {
1838
2098
  modelValue: activeTabName.value,
1839
2099
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event),
@@ -1854,19 +2114,32 @@
1854
2114
  label: filter(tab.title),
1855
2115
  lazy: tab.lazy || false
1856
2116
  }, {
2117
+ label: vue.withCtx(() => [
2118
+ vue.createElementVNode("span", _hoisted_1$6, [
2119
+ vue.createTextVNode(vue.toDisplayString(filter(tab.title)), 1),
2120
+ vue.createVNode(_component_el_badge, {
2121
+ hidden: !diffCount.value[tabIndex],
2122
+ value: diffCount.value[tabIndex],
2123
+ class: "diff-count-badge"
2124
+ }, null, 8, ["hidden", "value"])
2125
+ ])
2126
+ ]),
1857
2127
  default: vue.withCtx(() => [
1858
2128
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tabItems(tab), (item) => {
1859
2129
  return vue.openBlock(), vue.createBlock(_sfc_main$v, {
1860
2130
  key: item[vue.unref(mForm)?.keyProp || "__key"],
1861
2131
  config: item,
1862
2132
  disabled: __props.disabled,
1863
- model: __props.config.dynamic ? (__props.name ? __props.model[__props.name] : __props.model)[tabIndex] : tab.name ? (__props.name ? __props.model[__props.name] : __props.model)[tab.name] : __props.name ? __props.model[__props.name] : __props.model,
2133
+ model: getValues(__props.model, tabIndex, tab),
2134
+ "last-values": getValues(__props.lastValues, tabIndex, tab),
2135
+ "is-compare": __props.isCompare,
1864
2136
  prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : __props.prop,
1865
2137
  size: __props.size,
1866
2138
  "label-width": tab.labelWidth || __props.labelWidth,
1867
2139
  "expand-more": __props.expandMore,
1868
- onChange: changeHandler
1869
- }, null, 8, ["config", "disabled", "model", "prop", "size", "label-width", "expand-more"]);
2140
+ onChange: changeHandler,
2141
+ onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
2142
+ }, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
1870
2143
  }), 128))
1871
2144
  ]),
1872
2145
  _: 2
@@ -2491,6 +2764,8 @@
2491
2764
  props: {
2492
2765
  config: { default: () => [] },
2493
2766
  initValues: { default: () => ({}) },
2767
+ lastValues: { default: () => ({}) },
2768
+ isCompare: { type: Boolean, default: false },
2494
2769
  parentValues: { default: () => ({}) },
2495
2770
  labelWidth: { default: "200px" },
2496
2771
  disabled: { type: Boolean, default: false },
@@ -2508,6 +2783,7 @@
2508
2783
  const tMagicForm = vue.ref();
2509
2784
  const initialized = vue.ref(false);
2510
2785
  const values = vue.ref({});
2786
+ const lastValuesProcessed = vue.ref({});
2511
2787
  const fields = /* @__PURE__ */ new Map();
2512
2788
  const requestFuc = getConfig("request");
2513
2789
  const formState = vue.reactive({
@@ -2515,8 +2791,11 @@
2515
2791
  popperClass: props.popperClass,
2516
2792
  config: props.config,
2517
2793
  initValues: props.initValues,
2794
+ isCompare: props.isCompare,
2795
+ lastValues: props.lastValues,
2518
2796
  parentValues: props.parentValues,
2519
2797
  values,
2798
+ lastValuesProcessed,
2520
2799
  $emit: emit,
2521
2800
  fields,
2522
2801
  setField: (prop, field) => fields.set(prop, field),
@@ -2533,6 +2812,8 @@
2533
2812
  });
2534
2813
  vue.watchEffect(() => {
2535
2814
  formState.initValues = props.initValues;
2815
+ formState.lastValues = props.lastValues;
2816
+ formState.isCompare = props.isCompare;
2536
2817
  formState.config = props.config;
2537
2818
  formState.keyProp = props.keyProp;
2538
2819
  formState.popperClass = props.popperClass;
@@ -2542,7 +2823,7 @@
2542
2823
  vue.watch(
2543
2824
  [() => props.config, () => props.initValues],
2544
2825
  ([config], [preConfig]) => {
2545
- if (!isEqual__default.default(vue.toRaw(config), vue.toRaw(preConfig))) {
2826
+ if (!lodashEs.isEqual(vue.toRaw(config), vue.toRaw(preConfig))) {
2546
2827
  initialized.value = false;
2547
2828
  }
2548
2829
  initValue(formState, {
@@ -2550,8 +2831,17 @@
2550
2831
  config: props.config
2551
2832
  }).then((value) => {
2552
2833
  values.value = value;
2553
- initialized.value = true;
2834
+ initialized.value = !props.isCompare;
2554
2835
  });
2836
+ if (props.isCompare) {
2837
+ initValue(formState, {
2838
+ initValues: props.lastValues,
2839
+ config: props.config
2840
+ }).then((value) => {
2841
+ lastValuesProcessed.value = value;
2842
+ initialized.value = true;
2843
+ });
2844
+ }
2555
2845
  },
2556
2846
  { immediate: true }
2557
2847
  );
@@ -2560,6 +2850,7 @@
2560
2850
  };
2561
2851
  expose({
2562
2852
  values,
2853
+ lastValuesProcessed,
2563
2854
  formState,
2564
2855
  initialized,
2565
2856
  changeHandler,
@@ -2602,11 +2893,13 @@
2602
2893
  key: item[__props.keyProp] ?? index,
2603
2894
  config: item,
2604
2895
  model: values.value,
2896
+ "last-values": lastValuesProcessed.value,
2897
+ "is-compare": __props.isCompare,
2605
2898
  "label-width": item.labelWidth || __props.labelWidth,
2606
2899
  "step-active": __props.stepActive,
2607
2900
  size: __props.size,
2608
2901
  onChange: changeHandler
2609
- }, null, 8, ["disabled", "config", "model", "label-width", "step-active", "size"]);
2902
+ }, null, 8, ["disabled", "config", "model", "last-values", "is-compare", "label-width", "step-active", "size"]);
2610
2903
  }), 128)) : vue.createCommentVNode("", true)
2611
2904
  ]),
2612
2905
  _: 1