@tmagic/form 1.5.20 → 1.5.22

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.
@@ -411,277 +411,238 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
411
411
  "label-width": itemLabelWidth.value,
412
412
  onChange: onChangeHandler,
413
413
  onAddDiffCount
414
- }, null, 40, ["size", "model", "last-values", "is-compare", "config", "disabled", "name", "prop", "step-active", "expand-more", "label-width"])) : type.value && display$1.value && !showDiff.value ? (openBlock(), createElementBlock(
415
- Fragment,
416
- { key: 2 },
417
- [
418
- createVNode(unref(TMagicFormItem), {
419
- style: normalizeStyle(_ctx.config.tip ? "flex: 1" : ""),
420
- class: normalizeClass({ "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value }),
421
- prop: itemProp.value,
422
- "label-width": itemLabelWidth.value,
423
- "label-position": _ctx.config.labelPosition,
424
- rules: rule.value
425
- }, {
426
- label: withCtx(() => [
427
- createElementVNode("span", {
428
- innerHTML: type.value === "checkbox" ? "" : text.value,
429
- title: _ctx.config.labelTitle
430
- }, null, 8, _hoisted_2$7)
431
- ]),
432
- default: withCtx(() => [
433
- tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
434
- content: withCtx(() => [
435
- createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_3$5)
436
- ]),
437
- default: withCtx(() => [
438
- (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
439
- key: key(_ctx.config),
440
- size: _ctx.size,
441
- model: _ctx.model,
442
- "last-values": _ctx.lastValues,
443
- config: _ctx.config,
444
- name: name.value,
445
- disabled: disabled.value,
446
- prop: itemProp.value,
447
- onChange: onChangeHandler,
448
- onAddDiffCount
449
- }, null, 40, ["size", "model", "last-values", "config", "name", "disabled", "prop"]))
450
- ]),
451
- _: 1
452
- /* STABLE */
453
- })) : (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
454
- key: key(_ctx.config),
455
- size: _ctx.size,
456
- model: _ctx.model,
457
- "last-values": _ctx.lastValues,
458
- config: _ctx.config,
459
- name: name.value,
460
- disabled: disabled.value,
461
- prop: itemProp.value,
462
- onChange: onChangeHandler,
463
- onAddDiffCount
464
- }, null, 40, ["size", "model", "last-values", "config", "name", "disabled", "prop"])),
465
- extra.value && type.value !== "table" ? (openBlock(), createElementBlock("div", {
466
- key: 2,
467
- innerHTML: extra.value,
468
- class: "m-form-tip"
469
- }, null, 8, _hoisted_4$3)) : createCommentVNode("v-if", true)
470
- ]),
471
- _: 1
472
- /* STABLE */
473
- }, 8, ["style", "class", "prop", "label-width", "label-position", "rules"]),
474
- _ctx.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
475
- key: 0,
476
- placement: "left"
477
- }, {
478
- content: withCtx(() => [
479
- createElementVNode("div", {
480
- innerHTML: _ctx.config.tip
481
- }, null, 8, _hoisted_5$3)
482
- ]),
483
- default: withCtx(() => [
484
- createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
485
- default: withCtx(() => [
486
- createVNode(unref(WarningFilled))
487
- ]),
488
- _: 1
489
- /* STABLE */
490
- })
491
- ]),
492
- _: 1
493
- /* STABLE */
494
- })) : createCommentVNode("v-if", true)
495
- ],
496
- 64
497
- /* STABLE_FRAGMENT */
498
- )) : type.value && display$1.value && showDiff.value ? (openBlock(), createElementBlock(
499
- Fragment,
500
- { key: 3 },
501
- [
502
- createCommentVNode(" 对比 "),
503
- createCommentVNode(" 上次内容 "),
504
- createVNode(unref(TMagicFormItem), {
505
- style: normalizeStyle([_ctx.config.tip ? "flex: 1" : "", { "background": "#f7dadd" }]),
506
- class: normalizeClass({ "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value }),
507
- prop: itemProp.value,
414
+ }, null, 40, ["size", "model", "last-values", "is-compare", "config", "disabled", "name", "prop", "step-active", "expand-more", "label-width"])) : type.value && display$1.value && !showDiff.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
415
+ createVNode(unref(TMagicFormItem), {
416
+ style: normalizeStyle(_ctx.config.tip ? "flex: 1" : ""),
417
+ class: normalizeClass({ "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value }),
418
+ prop: itemProp.value,
419
+ "label-width": itemLabelWidth.value,
420
+ "label-position": _ctx.config.labelPosition,
421
+ rules: rule.value
422
+ }, {
423
+ label: withCtx(() => [
424
+ createElementVNode("span", {
425
+ innerHTML: type.value === "checkbox" ? "" : text.value,
426
+ title: _ctx.config.labelTitle
427
+ }, null, 8, _hoisted_2$7)
428
+ ]),
429
+ default: withCtx(() => [
430
+ tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
431
+ content: withCtx(() => [
432
+ createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_3$5)
433
+ ]),
434
+ default: withCtx(() => [
435
+ (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
436
+ key: key(_ctx.config),
437
+ size: _ctx.size,
438
+ model: _ctx.model,
439
+ "last-values": _ctx.lastValues,
440
+ config: _ctx.config,
441
+ name: name.value,
442
+ disabled: disabled.value,
443
+ prop: itemProp.value,
444
+ onChange: onChangeHandler,
445
+ onAddDiffCount
446
+ }, null, 40, ["size", "model", "last-values", "config", "name", "disabled", "prop"]))
447
+ ]),
448
+ _: 1
449
+ })) : (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
450
+ key: key(_ctx.config),
451
+ size: _ctx.size,
452
+ model: _ctx.model,
453
+ "last-values": _ctx.lastValues,
454
+ config: _ctx.config,
455
+ name: name.value,
456
+ disabled: disabled.value,
457
+ prop: itemProp.value,
458
+ onChange: onChangeHandler,
459
+ onAddDiffCount
460
+ }, null, 40, ["size", "model", "last-values", "config", "name", "disabled", "prop"])),
461
+ extra.value && type.value !== "table" ? (openBlock(), createElementBlock("div", {
462
+ key: 2,
463
+ innerHTML: extra.value,
464
+ class: "m-form-tip"
465
+ }, null, 8, _hoisted_4$3)) : createCommentVNode("", true)
466
+ ]),
467
+ _: 1
468
+ }, 8, ["style", "class", "prop", "label-width", "label-position", "rules"]),
469
+ _ctx.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
470
+ key: 0,
471
+ placement: "left"
472
+ }, {
473
+ content: withCtx(() => [
474
+ createElementVNode("div", {
475
+ innerHTML: _ctx.config.tip
476
+ }, null, 8, _hoisted_5$3)
477
+ ]),
478
+ default: withCtx(() => [
479
+ createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
480
+ default: withCtx(() => [
481
+ createVNode(unref(WarningFilled))
482
+ ]),
483
+ _: 1
484
+ })
485
+ ]),
486
+ _: 1
487
+ })) : createCommentVNode("", true)
488
+ ], 64)) : type.value && display$1.value && showDiff.value ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
489
+ createVNode(unref(TMagicFormItem), {
490
+ style: normalizeStyle([_ctx.config.tip ? "flex: 1" : "", { "background": "#f7dadd" }]),
491
+ class: normalizeClass({ "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value }),
492
+ prop: itemProp.value,
493
+ "label-width": itemLabelWidth.value,
494
+ "label-position": _ctx.config.labelPosition,
495
+ rules: rule.value
496
+ }, {
497
+ label: withCtx(() => [
498
+ createElementVNode("span", {
499
+ innerHTML: type.value === "checkbox" ? "" : text.value,
500
+ title: _ctx.config.labelTitle
501
+ }, null, 8, _hoisted_6$2)
502
+ ]),
503
+ default: withCtx(() => [
504
+ tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
505
+ content: withCtx(() => [
506
+ createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_7$1)
507
+ ]),
508
+ default: withCtx(() => [
509
+ (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
510
+ key: key(_ctx.config),
511
+ size: _ctx.size,
512
+ model: _ctx.lastValues,
513
+ config: _ctx.config,
514
+ name: name.value,
515
+ disabled: disabled.value,
516
+ prop: itemProp.value,
517
+ onChange: onChangeHandler
518
+ }, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
519
+ ]),
520
+ _: 1
521
+ })) : (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
522
+ key: key(_ctx.config),
523
+ size: _ctx.size,
524
+ model: _ctx.lastValues,
525
+ config: _ctx.config,
526
+ name: name.value,
527
+ disabled: disabled.value,
528
+ prop: itemProp.value,
529
+ onChange: onChangeHandler
530
+ }, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
531
+ extra.value ? (openBlock(), createElementBlock("div", {
532
+ key: 2,
533
+ innerHTML: extra.value,
534
+ class: "m-form-tip"
535
+ }, null, 8, _hoisted_8$1)) : createCommentVNode("", true)
536
+ ]),
537
+ _: 1
538
+ }, 8, ["style", "class", "prop", "label-width", "label-position", "rules"]),
539
+ _ctx.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
540
+ key: 0,
541
+ placement: "left"
542
+ }, {
543
+ content: withCtx(() => [
544
+ createElementVNode("div", {
545
+ innerHTML: _ctx.config.tip
546
+ }, null, 8, _hoisted_9)
547
+ ]),
548
+ default: withCtx(() => [
549
+ createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
550
+ default: withCtx(() => [
551
+ createVNode(unref(WarningFilled))
552
+ ]),
553
+ _: 1
554
+ })
555
+ ]),
556
+ _: 1
557
+ })) : createCommentVNode("", true),
558
+ createVNode(unref(TMagicFormItem), {
559
+ style: normalizeStyle([_ctx.config.tip ? "flex: 1" : "", { "background": "#def7da" }]),
560
+ class: normalizeClass({ "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value }),
561
+ prop: itemProp.value,
562
+ "label-width": itemLabelWidth.value,
563
+ "label-position": _ctx.config.labelPosition,
564
+ rules: rule.value
565
+ }, {
566
+ label: withCtx(() => [
567
+ createElementVNode("span", {
568
+ innerHTML: type.value === "checkbox" ? "" : text.value,
569
+ title: _ctx.config.labelTitle
570
+ }, null, 8, _hoisted_10)
571
+ ]),
572
+ default: withCtx(() => [
573
+ tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
574
+ content: withCtx(() => [
575
+ createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_11)
576
+ ]),
577
+ default: withCtx(() => [
578
+ (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
579
+ key: key(_ctx.config),
580
+ size: _ctx.size,
581
+ model: _ctx.model,
582
+ config: _ctx.config,
583
+ name: name.value,
584
+ disabled: disabled.value,
585
+ prop: itemProp.value,
586
+ onChange: onChangeHandler
587
+ }, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
588
+ ]),
589
+ _: 1
590
+ })) : (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
591
+ key: key(_ctx.config),
592
+ size: _ctx.size,
593
+ model: _ctx.model,
594
+ config: _ctx.config,
595
+ name: name.value,
596
+ disabled: disabled.value,
597
+ prop: itemProp.value,
598
+ onChange: onChangeHandler
599
+ }, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
600
+ extra.value ? (openBlock(), createElementBlock("div", {
601
+ key: 2,
602
+ innerHTML: extra.value,
603
+ class: "m-form-tip"
604
+ }, null, 8, _hoisted_12)) : createCommentVNode("", true)
605
+ ]),
606
+ _: 1
607
+ }, 8, ["style", "class", "prop", "label-width", "label-position", "rules"]),
608
+ _ctx.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
609
+ key: 1,
610
+ placement: "left"
611
+ }, {
612
+ content: withCtx(() => [
613
+ createElementVNode("div", {
614
+ innerHTML: _ctx.config.tip
615
+ }, null, 8, _hoisted_13)
616
+ ]),
617
+ default: withCtx(() => [
618
+ createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
619
+ default: withCtx(() => [
620
+ createVNode(unref(WarningFilled))
621
+ ]),
622
+ _: 1
623
+ })
624
+ ]),
625
+ _: 1
626
+ })) : createCommentVNode("", true)
627
+ ], 64)) : items.value && display$1.value ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
628
+ (isValidName() ? _ctx.model[name.value] : _ctx.model) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(items.value, (item) => {
629
+ return openBlock(), createBlock(_component_Container, {
630
+ key: key(item),
631
+ model: isValidName() ? _ctx.model[name.value] : _ctx.model,
632
+ "last-values": isValidName() ? _ctx.lastValues[name.value] || {} : _ctx.lastValues,
633
+ "is-compare": _ctx.isCompare,
634
+ config: item,
635
+ size: _ctx.size,
636
+ disabled: disabled.value,
637
+ "step-active": _ctx.stepActive,
638
+ "expand-more": expand.value,
508
639
  "label-width": itemLabelWidth.value,
509
- "label-position": _ctx.config.labelPosition,
510
- rules: rule.value
511
- }, {
512
- label: withCtx(() => [
513
- createElementVNode("span", {
514
- innerHTML: type.value === "checkbox" ? "" : text.value,
515
- title: _ctx.config.labelTitle
516
- }, null, 8, _hoisted_6$2)
517
- ]),
518
- default: withCtx(() => [
519
- tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
520
- content: withCtx(() => [
521
- createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_7$1)
522
- ]),
523
- default: withCtx(() => [
524
- (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
525
- key: key(_ctx.config),
526
- size: _ctx.size,
527
- model: _ctx.lastValues,
528
- config: _ctx.config,
529
- name: name.value,
530
- disabled: disabled.value,
531
- prop: itemProp.value,
532
- onChange: onChangeHandler
533
- }, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
534
- ]),
535
- _: 1
536
- /* STABLE */
537
- })) : (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
538
- key: key(_ctx.config),
539
- size: _ctx.size,
540
- model: _ctx.lastValues,
541
- config: _ctx.config,
542
- name: name.value,
543
- disabled: disabled.value,
544
- prop: itemProp.value,
545
- onChange: onChangeHandler
546
- }, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
547
- extra.value ? (openBlock(), createElementBlock("div", {
548
- key: 2,
549
- innerHTML: extra.value,
550
- class: "m-form-tip"
551
- }, null, 8, _hoisted_8$1)) : createCommentVNode("v-if", true)
552
- ]),
553
- _: 1
554
- /* STABLE */
555
- }, 8, ["style", "class", "prop", "label-width", "label-position", "rules"]),
556
- _ctx.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
557
- key: 0,
558
- placement: "left"
559
- }, {
560
- content: withCtx(() => [
561
- createElementVNode("div", {
562
- innerHTML: _ctx.config.tip
563
- }, null, 8, _hoisted_9)
564
- ]),
565
- default: withCtx(() => [
566
- createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
567
- default: withCtx(() => [
568
- createVNode(unref(WarningFilled))
569
- ]),
570
- _: 1
571
- /* STABLE */
572
- })
573
- ]),
574
- _: 1
575
- /* STABLE */
576
- })) : createCommentVNode("v-if", true),
577
- createCommentVNode(" 当前内容 "),
578
- createVNode(unref(TMagicFormItem), {
579
- style: normalizeStyle([_ctx.config.tip ? "flex: 1" : "", { "background": "#def7da" }]),
580
- class: normalizeClass({ "tmagic-form-hidden": `${itemLabelWidth.value}` === "0" || !text.value }),
581
640
  prop: itemProp.value,
582
- "label-width": itemLabelWidth.value,
583
- "label-position": _ctx.config.labelPosition,
584
- rules: rule.value
585
- }, {
586
- label: withCtx(() => [
587
- createElementVNode("span", {
588
- innerHTML: type.value === "checkbox" ? "" : text.value,
589
- title: _ctx.config.labelTitle
590
- }, null, 8, _hoisted_10)
591
- ]),
592
- default: withCtx(() => [
593
- tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
594
- content: withCtx(() => [
595
- createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_11)
596
- ]),
597
- default: withCtx(() => [
598
- (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
599
- key: key(_ctx.config),
600
- size: _ctx.size,
601
- model: _ctx.model,
602
- config: _ctx.config,
603
- name: name.value,
604
- disabled: disabled.value,
605
- prop: itemProp.value,
606
- onChange: onChangeHandler
607
- }, null, 40, ["size", "model", "config", "name", "disabled", "prop"]))
608
- ]),
609
- _: 1
610
- /* STABLE */
611
- })) : (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
612
- key: key(_ctx.config),
613
- size: _ctx.size,
614
- model: _ctx.model,
615
- config: _ctx.config,
616
- name: name.value,
617
- disabled: disabled.value,
618
- prop: itemProp.value,
619
- onChange: onChangeHandler
620
- }, null, 40, ["size", "model", "config", "name", "disabled", "prop"])),
621
- extra.value ? (openBlock(), createElementBlock("div", {
622
- key: 2,
623
- innerHTML: extra.value,
624
- class: "m-form-tip"
625
- }, null, 8, _hoisted_12)) : createCommentVNode("v-if", true)
626
- ]),
627
- _: 1
628
- /* STABLE */
629
- }, 8, ["style", "class", "prop", "label-width", "label-position", "rules"]),
630
- _ctx.config.tip ? (openBlock(), createBlock(unref(TMagicTooltip), {
631
- key: 1,
632
- placement: "left"
633
- }, {
634
- content: withCtx(() => [
635
- createElementVNode("div", {
636
- innerHTML: _ctx.config.tip
637
- }, null, 8, _hoisted_13)
638
- ]),
639
- default: withCtx(() => [
640
- createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
641
- default: withCtx(() => [
642
- createVNode(unref(WarningFilled))
643
- ]),
644
- _: 1
645
- /* STABLE */
646
- })
647
- ]),
648
- _: 1
649
- /* STABLE */
650
- })) : createCommentVNode("v-if", true)
651
- ],
652
- 64
653
- /* STABLE_FRAGMENT */
654
- )) : items.value && display$1.value ? (openBlock(), createElementBlock(
655
- Fragment,
656
- { key: 4 },
657
- [
658
- (isValidName() ? _ctx.model[name.value] : _ctx.model) ? (openBlock(true), createElementBlock(
659
- Fragment,
660
- { key: 0 },
661
- renderList(items.value, (item) => {
662
- return openBlock(), createBlock(_component_Container, {
663
- key: key(item),
664
- model: isValidName() ? _ctx.model[name.value] : _ctx.model,
665
- "last-values": isValidName() ? _ctx.lastValues[name.value] || {} : _ctx.lastValues,
666
- "is-compare": _ctx.isCompare,
667
- config: item,
668
- size: _ctx.size,
669
- disabled: disabled.value,
670
- "step-active": _ctx.stepActive,
671
- "expand-more": expand.value,
672
- "label-width": itemLabelWidth.value,
673
- prop: itemProp.value,
674
- onChange: onChangeHandler,
675
- onAddDiffCount
676
- }, null, 8, ["model", "last-values", "is-compare", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
677
- }),
678
- 128
679
- /* KEYED_FRAGMENT */
680
- )) : createCommentVNode("v-if", true)
681
- ],
682
- 64
683
- /* STABLE_FRAGMENT */
684
- )) : createCommentVNode("v-if", true),
641
+ onChange: onChangeHandler,
642
+ onAddDiffCount
643
+ }, null, 8, ["model", "last-values", "is-compare", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
644
+ }), 128)) : createCommentVNode("", true)
645
+ ], 64)) : createCommentVNode("", true),
685
646
  _ctx.config.expand && type.value !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_14, [
686
647
  createVNode(unref(TMagicButton), {
687
648
  type: "primary",
@@ -691,17 +652,12 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
691
652
  onClick: expandHandler
692
653
  }, {
693
654
  default: withCtx(() => [
694
- createTextVNode(
695
- toDisplayString(expand.value ? "收起配置" : "展开更多配置"),
696
- 1
697
- /* TEXT */
698
- )
655
+ createTextVNode(toDisplayString(expand.value ? "收起配置" : "展开更多配置"), 1)
699
656
  ]),
700
657
  _: 1
701
- /* STABLE */
702
658
  })
703
- ])) : createCommentVNode("v-if", true)
704
- ], 14, _hoisted_1$e)) : createCommentVNode("v-if", true);
659
+ ])) : createCommentVNode("", true)
660
+ ], 14, _hoisted_1$e)) : createCommentVNode("", true);
705
661
  };
706
662
  }
707
663
  });
@@ -758,85 +714,50 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
758
714
  const key = (item, index) => item[mForm?.keyProp || "__key"] ?? index;
759
715
  const onAddDiffCount = () => emit("addDiffCount");
760
716
  return (_ctx, _cache) => {
761
- return (name.value ? _ctx.model[name.value] : _ctx.model) ? (openBlock(), createElementBlock(
762
- "fieldset",
763
- {
764
- key: 0,
765
- class: "m-fieldset",
766
- style: normalizeStyle(show.value ? "padding: 15px" : "border: 0")
767
- },
768
- [
769
- name.value && _ctx.config.checkbox ? (openBlock(), createBlock(resolveDynamicComponent(!show.value ? "div" : "legend"), { key: 0 }, {
770
- default: withCtx(() => [
771
- createVNode(unref(TMagicCheckbox), {
772
- modelValue: _ctx.model[name.value].value,
773
- "onUpdate:modelValue": [
774
- _cache[0] || (_cache[0] = ($event) => _ctx.model[name.value].value = $event),
775
- valueChangeHandler
776
- ],
777
- prop: `${_ctx.prop}${_ctx.prop ? "." : ""}${_ctx.config.name}.value`,
778
- "true-value": 1,
779
- "false-value": 0
780
- }, {
781
- default: withCtx(() => [
782
- createElementVNode("span", {
783
- innerHTML: _ctx.config.legend
784
- }, null, 8, _hoisted_1$d),
785
- _ctx.config.extra ? (openBlock(), createElementBlock("span", {
786
- key: 0,
787
- innerHTML: _ctx.config.extra,
788
- class: "m-form-tip"
789
- }, null, 8, _hoisted_2$6)) : createCommentVNode("v-if", true)
790
- ]),
791
- _: 1
792
- /* STABLE */
793
- }, 8, ["modelValue", "prop"])
794
- ]),
795
- _: 1
796
- /* STABLE */
797
- })) : (openBlock(), createElementBlock("legend", _hoisted_3$4, [
798
- createElementVNode("span", {
799
- innerHTML: _ctx.config.legend
800
- }, null, 8, _hoisted_4$2),
801
- _ctx.config.extra ? (openBlock(), createElementBlock("span", {
802
- key: 0,
803
- innerHTML: _ctx.config.extra,
804
- class: "m-form-tip"
805
- }, null, 8, _hoisted_5$2)) : createCommentVNode("v-if", true)
806
- ])),
807
- _ctx.config.schematic && show.value ? (openBlock(), createElementBlock("div", _hoisted_6$1, [
808
- createElementVNode("div", _hoisted_7, [
809
- (openBlock(true), createElementBlock(
810
- Fragment,
811
- null,
812
- renderList(_ctx.config.items, (item, index) => {
813
- return openBlock(), createBlock(_sfc_main$x, {
814
- key: key(item, index),
815
- model: name.value ? _ctx.model[name.value] : _ctx.model,
816
- lastValues: name.value ? _ctx.lastValues[name.value] : _ctx.lastValues,
817
- "is-compare": _ctx.isCompare,
818
- rules: name.value ? _ctx.rules[name.value] : [],
819
- config: item,
820
- prop: _ctx.prop,
821
- disabled: _ctx.disabled,
822
- labelWidth: lWidth.value,
823
- size: _ctx.size,
824
- onChange: changeHandler,
825
- onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
826
- }, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "disabled", "labelWidth", "size"]);
827
- }),
828
- 128
829
- /* KEYED_FRAGMENT */
830
- ))
831
- ]),
832
- createElementVNode("img", {
833
- class: "m-form-schematic",
834
- src: _ctx.config.schematic
835
- }, null, 8, _hoisted_8)
836
- ])) : show.value ? (openBlock(true), createElementBlock(
837
- Fragment,
838
- { key: 3 },
839
- renderList(_ctx.config.items, (item, index) => {
717
+ return (name.value ? _ctx.model[name.value] : _ctx.model) ? (openBlock(), createElementBlock("fieldset", {
718
+ key: 0,
719
+ class: "m-fieldset",
720
+ style: normalizeStyle(show.value ? "padding: 15px" : "border: 0")
721
+ }, [
722
+ name.value && _ctx.config.checkbox ? (openBlock(), createBlock(resolveDynamicComponent(!show.value ? "div" : "legend"), { key: 0 }, {
723
+ default: withCtx(() => [
724
+ createVNode(unref(TMagicCheckbox), {
725
+ modelValue: _ctx.model[name.value].value,
726
+ "onUpdate:modelValue": [
727
+ _cache[0] || (_cache[0] = ($event) => _ctx.model[name.value].value = $event),
728
+ valueChangeHandler
729
+ ],
730
+ prop: `${_ctx.prop}${_ctx.prop ? "." : ""}${_ctx.config.name}.value`,
731
+ "true-value": 1,
732
+ "false-value": 0
733
+ }, {
734
+ default: withCtx(() => [
735
+ createElementVNode("span", {
736
+ innerHTML: _ctx.config.legend
737
+ }, null, 8, _hoisted_1$d),
738
+ _ctx.config.extra ? (openBlock(), createElementBlock("span", {
739
+ key: 0,
740
+ innerHTML: _ctx.config.extra,
741
+ class: "m-form-tip"
742
+ }, null, 8, _hoisted_2$6)) : createCommentVNode("", true)
743
+ ]),
744
+ _: 1
745
+ }, 8, ["modelValue", "prop"])
746
+ ]),
747
+ _: 1
748
+ })) : (openBlock(), createElementBlock("legend", _hoisted_3$4, [
749
+ createElementVNode("span", {
750
+ innerHTML: _ctx.config.legend
751
+ }, null, 8, _hoisted_4$2),
752
+ _ctx.config.extra ? (openBlock(), createElementBlock("span", {
753
+ key: 0,
754
+ innerHTML: _ctx.config.extra,
755
+ class: "m-form-tip"
756
+ }, null, 8, _hoisted_5$2)) : createCommentVNode("", true)
757
+ ])),
758
+ _ctx.config.schematic && show.value ? (openBlock(), createElementBlock("div", _hoisted_6$1, [
759
+ createElementVNode("div", _hoisted_7, [
760
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.items, (item, index) => {
840
761
  return openBlock(), createBlock(_sfc_main$x, {
841
762
  key: key(item, index),
842
763
  model: name.value ? _ctx.model[name.value] : _ctx.model,
@@ -845,20 +766,35 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
845
766
  rules: name.value ? _ctx.rules[name.value] : [],
846
767
  config: item,
847
768
  prop: _ctx.prop,
769
+ disabled: _ctx.disabled,
848
770
  labelWidth: lWidth.value,
849
771
  size: _ctx.size,
850
- disabled: _ctx.disabled,
851
772
  onChange: changeHandler,
852
- onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
853
- }, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "labelWidth", "size", "disabled"]);
854
- }),
855
- 128
856
- /* KEYED_FRAGMENT */
857
- )) : createCommentVNode("v-if", true)
858
- ],
859
- 4
860
- /* STYLE */
861
- )) : createCommentVNode("v-if", true);
773
+ onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
774
+ }, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "disabled", "labelWidth", "size"]);
775
+ }), 128))
776
+ ]),
777
+ createElementVNode("img", {
778
+ class: "m-form-schematic",
779
+ src: _ctx.config.schematic
780
+ }, null, 8, _hoisted_8)
781
+ ])) : show.value ? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(_ctx.config.items, (item, index) => {
782
+ return openBlock(), createBlock(_sfc_main$x, {
783
+ key: key(item, index),
784
+ model: name.value ? _ctx.model[name.value] : _ctx.model,
785
+ lastValues: name.value ? _ctx.lastValues[name.value] : _ctx.lastValues,
786
+ "is-compare": _ctx.isCompare,
787
+ rules: name.value ? _ctx.rules[name.value] : [],
788
+ config: item,
789
+ prop: _ctx.prop,
790
+ labelWidth: lWidth.value,
791
+ size: _ctx.size,
792
+ disabled: _ctx.disabled,
793
+ onChange: changeHandler,
794
+ onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
795
+ }, null, 8, ["model", "lastValues", "is-compare", "rules", "config", "prop", "labelWidth", "size", "disabled"]);
796
+ }), 128)) : createCommentVNode("", true)
797
+ ], 4)) : createCommentVNode("", true);
862
798
  };
863
799
  }
864
800
  });
@@ -888,7 +824,8 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
888
824
  const props = __props;
889
825
  const emit = __emit;
890
826
  const mForm = inject("mForm");
891
- const expand = ref(props.config.expandAll || !props.index);
827
+ const defaultExpandQuantity = props.config.defaultExpandQuantity ?? 7;
828
+ const expand = ref(props.config.expandAll || defaultExpandQuantity > props.index);
892
829
  const rowConfig = computed(() => ({
893
830
  type: "row",
894
831
  span: props.config.span || 24,
@@ -956,16 +893,10 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
956
893
  expand.value ? (openBlock(), createBlock(unref(CaretBottom), { key: 0 })) : (openBlock(), createBlock(unref(CaretRight), { key: 1 }))
957
894
  ]),
958
895
  _: 1
959
- /* STABLE */
960
896
  }),
961
- createTextVNode(
962
- toDisplayString(title.value),
963
- 1
964
- /* TEXT */
965
- )
897
+ createTextVNode(toDisplayString(title.value), 1)
966
898
  ]),
967
899
  _: 1
968
- /* STABLE */
969
900
  }, 8, ["disabled"]),
970
901
  withDirectives(createVNode(unref(TMagicButton), {
971
902
  type: "danger",
@@ -990,46 +921,37 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
990
921
  createTextVNode("复制")
991
922
  ])),
992
923
  _: 1
993
- /* STABLE */
994
- }, 8, ["icon", "disabled"])) : createCommentVNode("v-if", true),
995
- movable.value ? (openBlock(), createElementBlock(
996
- Fragment,
997
- { key: 1 },
998
- [
999
- withDirectives(createVNode(unref(TMagicButton), {
1000
- link: "",
1001
- size: "small",
1002
- disabled: _ctx.disabled,
1003
- icon: unref(CaretTop),
1004
- onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
1005
- }, {
1006
- default: withCtx(() => _cache[7] || (_cache[7] = [
1007
- createTextVNode("上移")
1008
- ])),
1009
- _: 1
1010
- /* STABLE */
1011
- }, 8, ["disabled", "icon"]), [
1012
- [vShow, _ctx.index !== 0]
1013
- ]),
1014
- withDirectives(createVNode(unref(TMagicButton), {
1015
- link: "",
1016
- size: "small",
1017
- disabled: _ctx.disabled,
1018
- icon: unref(CaretBottom),
1019
- onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
1020
- }, {
1021
- default: withCtx(() => _cache[8] || (_cache[8] = [
1022
- createTextVNode("下移")
1023
- ])),
1024
- _: 1
1025
- /* STABLE */
1026
- }, 8, ["disabled", "icon"]), [
1027
- [vShow, _ctx.index !== length.value - 1]
1028
- ])
1029
- ],
1030
- 64
1031
- /* STABLE_FRAGMENT */
1032
- )) : createCommentVNode("v-if", true),
924
+ }, 8, ["icon", "disabled"])) : createCommentVNode("", true),
925
+ movable.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
926
+ withDirectives(createVNode(unref(TMagicButton), {
927
+ link: "",
928
+ size: "small",
929
+ disabled: _ctx.disabled,
930
+ icon: unref(CaretTop),
931
+ onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
932
+ }, {
933
+ default: withCtx(() => _cache[7] || (_cache[7] = [
934
+ createTextVNode("上移")
935
+ ])),
936
+ _: 1
937
+ }, 8, ["disabled", "icon"]), [
938
+ [vShow, _ctx.index !== 0]
939
+ ]),
940
+ withDirectives(createVNode(unref(TMagicButton), {
941
+ link: "",
942
+ size: "small",
943
+ disabled: _ctx.disabled,
944
+ icon: unref(CaretBottom),
945
+ onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
946
+ }, {
947
+ default: withCtx(() => _cache[8] || (_cache[8] = [
948
+ createTextVNode("下移")
949
+ ])),
950
+ _: 1
951
+ }, 8, ["disabled", "icon"]), [
952
+ [vShow, _ctx.index !== length.value - 1]
953
+ ])
954
+ ], 64)) : createCommentVNode("", true),
1033
955
  _ctx.config.moveSpecifyLocation ? (openBlock(), createBlock(unref(TMagicPopover), {
1034
956
  key: 2,
1035
957
  trigger: "click",
@@ -1050,7 +972,6 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1050
972
  createTextVNode("移动至")
1051
973
  ])),
1052
974
  _: 1
1053
- /* STABLE */
1054
975
  }, 8, ["icon", "disabled"])
1055
976
  ]),
1056
977
  default: withCtx(() => [
@@ -1077,7 +998,6 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1077
998
  createTextVNode("取消")
1078
999
  ])),
1079
1000
  _: 1
1080
- /* STABLE */
1081
1001
  }),
1082
1002
  createVNode(unref(TMagicButton), {
1083
1003
  size: "small",
@@ -1088,19 +1008,17 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1088
1008
  createTextVNode("确认")
1089
1009
  ])),
1090
1010
  _: 1
1091
- /* STABLE */
1092
1011
  })
1093
1012
  ])
1094
1013
  ])
1095
1014
  ]),
1096
1015
  _: 1
1097
- /* STABLE */
1098
- }, 8, ["visible"])) : createCommentVNode("v-if", true),
1016
+ }, 8, ["visible"])) : createCommentVNode("", true),
1099
1017
  itemExtra.value ? (openBlock(), createElementBlock("span", {
1100
1018
  key: 3,
1101
1019
  innerHTML: itemExtra.value,
1102
1020
  class: "m-form-tip"
1103
- }, null, 8, _hoisted_3$3)) : createCommentVNode("v-if", true)
1021
+ }, null, 8, _hoisted_3$3)) : createCommentVNode("", true)
1104
1022
  ]),
1105
1023
  expand.value ? (openBlock(), createBlock(_sfc_main$x, {
1106
1024
  key: 0,
@@ -1114,7 +1032,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1114
1032
  disabled: _ctx.disabled,
1115
1033
  onChange: changeHandler,
1116
1034
  onAddDiffCount: _cache[5] || (_cache[5] = ($event) => onAddDiffCount())
1117
- }, null, 8, ["config", "model", "lastValues", "is-compare", "labelWidth", "prop", "size", "disabled"])) : createCommentVNode("v-if", true)
1035
+ }, null, 8, ["config", "model", "lastValues", "is-compare", "labelWidth", "prop", "size", "disabled"])) : createCommentVNode("", true)
1118
1036
  ]);
1119
1037
  };
1120
1038
  }
@@ -1221,41 +1139,29 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
1221
1139
  key: 0,
1222
1140
  innerHTML: _ctx.config.extra,
1223
1141
  style: { "color": "rgba(0, 0, 0, 0.45)" }
1224
- }, null, 8, _hoisted_2$4)) : createCommentVNode("v-if", true),
1142
+ }, null, 8, _hoisted_2$4)) : createCommentVNode("", true),
1225
1143
  !_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (openBlock(), createElementBlock("div", _hoisted_3$2, _cache[1] || (_cache[1] = [
1226
- createElementVNode(
1227
- "span",
1228
- { class: "el-table__empty-text" },
1229
- "暂无数据",
1230
- -1
1231
- /* HOISTED */
1232
- )
1233
- ]))) : (openBlock(true), createElementBlock(
1234
- Fragment,
1235
- { key: 2 },
1236
- renderList(_ctx.model[_ctx.name], (item, index) => {
1237
- return openBlock(), createBlock(_sfc_main$v, {
1238
- key: index,
1239
- model: item,
1240
- lastValues: getLastValues(_ctx.lastValues[_ctx.name], index),
1241
- "is-compare": _ctx.isCompare,
1242
- config: _ctx.config,
1243
- prop: _ctx.prop,
1244
- index,
1245
- "label-width": _ctx.labelWidth,
1246
- size: _ctx.size,
1247
- disabled: _ctx.disabled,
1248
- "group-model": _ctx.model[_ctx.name],
1249
- onRemoveItem: removeHandler,
1250
- onCopyItem: copyHandler,
1251
- onSwapItem: swapHandler,
1252
- onChange: changeHandler,
1253
- onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
1254
- }, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "index", "label-width", "size", "disabled", "group-model"]);
1255
- }),
1256
- 128
1257
- /* KEYED_FRAGMENT */
1258
- )),
1144
+ createElementVNode("span", { class: "el-table__empty-text" }, "暂无数据", -1)
1145
+ ]))) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(_ctx.model[_ctx.name], (item, index) => {
1146
+ return openBlock(), createBlock(_sfc_main$v, {
1147
+ key: index,
1148
+ model: item,
1149
+ lastValues: getLastValues(_ctx.lastValues[_ctx.name], index),
1150
+ "is-compare": _ctx.isCompare,
1151
+ config: _ctx.config,
1152
+ prop: _ctx.prop,
1153
+ index,
1154
+ "label-width": _ctx.labelWidth,
1155
+ size: _ctx.size,
1156
+ disabled: _ctx.disabled,
1157
+ "group-model": _ctx.model[_ctx.name],
1158
+ onRemoveItem: removeHandler,
1159
+ onCopyItem: copyHandler,
1160
+ onSwapItem: swapHandler,
1161
+ onChange: changeHandler,
1162
+ onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
1163
+ }, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "index", "label-width", "size", "disabled", "group-model"]);
1164
+ }), 128)),
1259
1165
  addable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1260
1166
  key: 3,
1261
1167
  type: "primary",
@@ -1267,8 +1173,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
1267
1173
  createTextVNode("新增")
1268
1174
  ])),
1269
1175
  _: 1
1270
- /* STABLE */
1271
- }, 8, ["size", "disabled"])) : createCommentVNode("v-if", true),
1176
+ }, 8, ["size", "disabled"])) : createCommentVNode("", true),
1272
1177
  _ctx.config.enableToggleMode ? (openBlock(), createBlock(unref(TMagicButton), {
1273
1178
  key: 4,
1274
1179
  icon: unref(Grid),
@@ -1279,8 +1184,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
1279
1184
  createTextVNode("切换为表格")
1280
1185
  ])),
1281
1186
  _: 1
1282
- /* STABLE */
1283
- }, 8, ["icon"])) : createCommentVNode("v-if", true)
1187
+ }, 8, ["icon"])) : createCommentVNode("", true)
1284
1188
  ]);
1285
1189
  };
1286
1190
  }
@@ -1340,13 +1244,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
1340
1244
  key: 0,
1341
1245
  innerHTML: _ctx.config.extra,
1342
1246
  class: "m-form-tip"
1343
- }, null, 8, _hoisted_2$3)) : createCommentVNode("v-if", true),
1247
+ }, null, 8, _hoisted_2$3)) : createCommentVNode("", true),
1344
1248
  renderSlot(_ctx.$slots, "header", {}, () => [
1345
- createTextVNode(
1346
- toDisplayString(filter(_ctx.config.title)),
1347
- 1
1348
- /* TEXT */
1349
- )
1249
+ createTextVNode(toDisplayString(filter(_ctx.config.title)), 1)
1350
1250
  ])
1351
1251
  ])
1352
1252
  ]),
@@ -1355,58 +1255,45 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
1355
1255
  renderSlot(_ctx.$slots, "default"),
1356
1256
  _ctx.config.schematic ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
1357
1257
  createElementVNode("div", _hoisted_4$1, [
1358
- (openBlock(true), createElementBlock(
1359
- Fragment,
1360
- null,
1361
- renderList(items.value, (item, index) => {
1362
- return openBlock(), createBlock(_sfc_main$x, {
1363
- key: item[unref(mForm)?.keyProp || "__key"] ?? index,
1364
- config: item,
1365
- model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
1366
- lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
1367
- "is-compare": _ctx.isCompare,
1368
- prop: _ctx.prop,
1369
- size: _ctx.size,
1370
- disabled: _ctx.disabled,
1371
- "label-width": _ctx.config.labelWidth || _ctx.labelWidth,
1372
- onChange: changeHandler,
1373
- onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1374
- }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
1375
- }),
1376
- 128
1377
- /* KEYED_FRAGMENT */
1378
- ))
1258
+ (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
1259
+ return openBlock(), createBlock(_sfc_main$x, {
1260
+ key: item[unref(mForm)?.keyProp || "__key"] ?? index,
1261
+ config: item,
1262
+ model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
1263
+ lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
1264
+ "is-compare": _ctx.isCompare,
1265
+ prop: _ctx.prop,
1266
+ size: _ctx.size,
1267
+ disabled: _ctx.disabled,
1268
+ "label-width": _ctx.config.labelWidth || _ctx.labelWidth,
1269
+ onChange: changeHandler,
1270
+ onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1271
+ }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
1272
+ }), 128))
1379
1273
  ]),
1380
1274
  createElementVNode("img", {
1381
1275
  class: "m-form-schematic",
1382
1276
  src: _ctx.config.schematic
1383
1277
  }, null, 8, _hoisted_5$1)
1384
- ])) : (openBlock(true), createElementBlock(
1385
- Fragment,
1386
- { key: 1 },
1387
- renderList(items.value, (item, index) => {
1388
- return openBlock(), createBlock(_sfc_main$x, {
1389
- key: item[unref(mForm)?.keyProp || "__key"] ?? index,
1390
- config: item,
1391
- model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
1392
- lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
1393
- "is-compare": _ctx.isCompare,
1394
- prop: _ctx.prop,
1395
- size: _ctx.size,
1396
- disabled: _ctx.disabled,
1397
- "label-width": _ctx.config.labelWidth || _ctx.labelWidth,
1398
- onChange: changeHandler,
1399
- onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
1400
- }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
1401
- }),
1402
- 128
1403
- /* KEYED_FRAGMENT */
1404
- ))
1278
+ ])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(items.value, (item, index) => {
1279
+ return openBlock(), createBlock(_sfc_main$x, {
1280
+ key: item[unref(mForm)?.keyProp || "__key"] ?? index,
1281
+ config: item,
1282
+ model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
1283
+ lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
1284
+ "is-compare": _ctx.isCompare,
1285
+ prop: _ctx.prop,
1286
+ size: _ctx.size,
1287
+ disabled: _ctx.disabled,
1288
+ "label-width": _ctx.config.labelWidth || _ctx.labelWidth,
1289
+ onChange: changeHandler,
1290
+ onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
1291
+ }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"]);
1292
+ }), 128))
1405
1293
  ])
1406
1294
  ]),
1407
1295
  _: 3
1408
- /* FORWARDED */
1409
- }, 8, ["body-style"])) : createCommentVNode("v-if", true);
1296
+ }, 8, ["body-style"])) : createCommentVNode("", true);
1410
1297
  };
1411
1298
  }
1412
1299
  });
@@ -1454,7 +1341,6 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
1454
1341
  }, null, 8, ["model", "lastValues", "is-compare", "config", "prop", "label-width", "expand-more", "size", "disabled"])
1455
1342
  ]),
1456
1343
  _: 1
1457
- /* STABLE */
1458
1344
  }, 8, ["span"])), [
1459
1345
  [vShow, display$1.value && _ctx.config.type !== "hidden"]
1460
1346
  ]);
@@ -1491,32 +1377,25 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1491
1377
  return (_ctx, _cache) => {
1492
1378
  return openBlock(), createBlock(unref(TMagicRow), { gutter: 10 }, {
1493
1379
  default: withCtx(() => [
1494
- (openBlock(true), createElementBlock(
1495
- Fragment,
1496
- null,
1497
- renderList(_ctx.config.items, (col, index) => {
1498
- return openBlock(), createBlock(_sfc_main$s, {
1499
- key: col[unref(mForm)?.keyProp || "__key"] ?? index,
1500
- span: col.span || _ctx.config.span || 24 / _ctx.config.items.length,
1501
- config: col,
1502
- labelWidth: _ctx.config.labelWidth || _ctx.labelWidth,
1503
- expandMore: _ctx.expandMore,
1504
- model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
1505
- lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
1506
- "is-compare": _ctx.isCompare,
1507
- prop: _ctx.prop,
1508
- size: _ctx.size,
1509
- disabled: _ctx.disabled,
1510
- onChange: changeHandler,
1511
- onAddDiffCount
1512
- }, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "lastValues", "is-compare", "prop", "size", "disabled"]);
1513
- }),
1514
- 128
1515
- /* KEYED_FRAGMENT */
1516
- ))
1380
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.items, (col, index) => {
1381
+ return openBlock(), createBlock(_sfc_main$s, {
1382
+ key: col[unref(mForm)?.keyProp || "__key"] ?? index,
1383
+ span: col.span || _ctx.config.span || 24 / _ctx.config.items.length,
1384
+ config: col,
1385
+ labelWidth: _ctx.config.labelWidth || _ctx.labelWidth,
1386
+ expandMore: _ctx.expandMore,
1387
+ model: _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
1388
+ lastValues: _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
1389
+ "is-compare": _ctx.isCompare,
1390
+ prop: _ctx.prop,
1391
+ size: _ctx.size,
1392
+ disabled: _ctx.disabled,
1393
+ onChange: changeHandler,
1394
+ onAddDiffCount
1395
+ }, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "lastValues", "is-compare", "prop", "size", "disabled"]);
1396
+ }), 128))
1517
1397
  ]),
1518
1398
  _: 1
1519
- /* STABLE */
1520
1399
  });
1521
1400
  };
1522
1401
  }
@@ -1563,71 +1442,40 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
1563
1442
  space: _ctx.config.space
1564
1443
  }, {
1565
1444
  default: withCtx(() => [
1566
- (openBlock(true), createElementBlock(
1567
- Fragment,
1568
- null,
1569
- renderList(_ctx.config.items, (item, index) => {
1570
- return openBlock(), createBlock(unref(TMagicStep), {
1571
- key: item.__key,
1572
- title: item.title,
1573
- active: active.value,
1574
- onClick: ($event) => stepClick(index)
1575
- }, null, 8, ["title", "active", "onClick"]);
1576
- }),
1577
- 128
1578
- /* KEYED_FRAGMENT */
1579
- ))
1445
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.items, (item, index) => {
1446
+ return openBlock(), createBlock(unref(TMagicStep), {
1447
+ key: item.__key,
1448
+ title: item.title,
1449
+ active: active.value,
1450
+ onClick: ($event) => stepClick(index)
1451
+ }, null, 8, ["title", "active", "onClick"]);
1452
+ }), 128))
1580
1453
  ]),
1581
1454
  _: 1
1582
- /* STABLE */
1583
1455
  }, 8, ["active", "space"]),
1584
- (openBlock(true), createElementBlock(
1585
- Fragment,
1586
- null,
1587
- renderList(_ctx.config.items, (step, index) => {
1588
- return openBlock(), createElementBlock(
1589
- Fragment,
1590
- null,
1591
- [
1592
- (openBlock(true), createElementBlock(
1593
- Fragment,
1594
- null,
1595
- renderList(step.items, (item) => {
1596
- return openBlock(), createElementBlock(
1597
- Fragment,
1598
- null,
1599
- [
1600
- item ? withDirectives((openBlock(), createBlock(_sfc_main$x, {
1601
- key: item[unref(mForm)?.keyProp || "__key"],
1602
- config: item,
1603
- model: step.name ? _ctx.model[step.name] : _ctx.model,
1604
- lastValues: step.name ? _ctx.lastValues[step.name] : _ctx.lastValues,
1605
- "is-compare": _ctx.isCompare,
1606
- prop: `${step.name}`,
1607
- size: _ctx.size,
1608
- disabled: _ctx.disabled,
1609
- "label-width": _ctx.config.labelWidth || _ctx.labelWidth,
1610
- onChange: changeHandler,
1611
- onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
1612
- }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"])), [
1613
- [vShow, active.value - 1 === index]
1614
- ]) : createCommentVNode("v-if", true)
1615
- ],
1616
- 64
1617
- /* STABLE_FRAGMENT */
1618
- );
1619
- }),
1620
- 256
1621
- /* UNKEYED_FRAGMENT */
1622
- ))
1623
- ],
1624
- 64
1625
- /* STABLE_FRAGMENT */
1626
- );
1627
- }),
1628
- 256
1629
- /* UNKEYED_FRAGMENT */
1630
- ))
1456
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.items, (step, index) => {
1457
+ return openBlock(), createElementBlock(Fragment, null, [
1458
+ (openBlock(true), createElementBlock(Fragment, null, renderList(step.items, (item) => {
1459
+ return openBlock(), createElementBlock(Fragment, null, [
1460
+ item ? withDirectives((openBlock(), createBlock(_sfc_main$x, {
1461
+ key: item[unref(mForm)?.keyProp || "__key"],
1462
+ config: item,
1463
+ model: step.name ? _ctx.model[step.name] : _ctx.model,
1464
+ lastValues: step.name ? _ctx.lastValues[step.name] : _ctx.lastValues,
1465
+ "is-compare": _ctx.isCompare,
1466
+ prop: `${step.name}`,
1467
+ size: _ctx.size,
1468
+ disabled: _ctx.disabled,
1469
+ "label-width": _ctx.config.labelWidth || _ctx.labelWidth,
1470
+ onChange: changeHandler,
1471
+ onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
1472
+ }, null, 8, ["config", "model", "lastValues", "is-compare", "prop", "size", "disabled", "label-width"])), [
1473
+ [vShow, active.value - 1 === index]
1474
+ ]) : createCommentVNode("", true)
1475
+ ], 64);
1476
+ }), 256))
1477
+ ], 64);
1478
+ }), 256))
1631
1479
  ]);
1632
1480
  };
1633
1481
  }
@@ -2024,329 +1872,276 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
2024
1872
  to: "body",
2025
1873
  disabled: !isFullscreen.value
2026
1874
  }, [
2027
- createElementVNode(
2028
- "div",
2029
- {
2030
- ref_key: "mTable",
2031
- ref: mTable,
2032
- class: normalizeClass(["m-fields-table", { "m-fields-table-item-extra": _ctx.config.itemExtra }])
2033
- },
2034
- [
2035
- _ctx.config.extra ? (openBlock(), createElementBlock("span", {
2036
- key: 0,
2037
- style: { "color": "rgba(0, 0, 0, 0.45)" },
2038
- innerHTML: _ctx.config.extra
2039
- }, null, 8, _hoisted_2$2)) : createCommentVNode("v-if", true),
2040
- createVNode(unref(TMagicTooltip), {
2041
- content: "拖拽可排序",
2042
- placement: "left-start",
2043
- disabled: _ctx.config.dropSort !== true
2044
- }, {
2045
- default: withCtx(() => [
2046
- _ctx.model[modelName.value] ? (openBlock(), createBlock(unref(TMagicTable), {
2047
- ref_key: "tMagicTable",
2048
- ref: tMagicTable,
2049
- style: { "width": "100%" },
2050
- "row-key": _ctx.config.rowKey || "id",
2051
- data: data.value,
2052
- lastData: lastData.value,
2053
- border: _ctx.config.border,
2054
- "max-height": _ctx.config.maxHeight,
2055
- "default-expand-all": true,
2056
- key: updateKey.value,
2057
- onSelect: selectHandle,
2058
- onSortChange: sortChange
2059
- }, {
2060
- default: withCtx(() => [
2061
- _ctx.config.itemExtra && !_ctx.config.dropSort ? (openBlock(), createBlock(unref(TMagicTableColumn), {
2062
- key: 0,
2063
- fixed: "left",
2064
- width: "30",
2065
- type: "expand"
2066
- }, {
2067
- default: withCtx((scope) => [
2068
- createElementVNode("span", {
2069
- innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
2070
- class: "m-form-tip"
2071
- }, null, 8, _hoisted_3)
1875
+ createElementVNode("div", {
1876
+ ref_key: "mTable",
1877
+ ref: mTable,
1878
+ class: normalizeClass(["m-fields-table", { "m-fields-table-item-extra": _ctx.config.itemExtra }])
1879
+ }, [
1880
+ _ctx.config.extra ? (openBlock(), createElementBlock("span", {
1881
+ key: 0,
1882
+ style: { "color": "rgba(0, 0, 0, 0.45)" },
1883
+ innerHTML: _ctx.config.extra
1884
+ }, null, 8, _hoisted_2$2)) : createCommentVNode("", true),
1885
+ createVNode(unref(TMagicTooltip), {
1886
+ content: "拖拽可排序",
1887
+ placement: "left-start",
1888
+ disabled: _ctx.config.dropSort !== true
1889
+ }, {
1890
+ default: withCtx(() => [
1891
+ _ctx.model[modelName.value] ? (openBlock(), createBlock(unref(TMagicTable), {
1892
+ ref_key: "tMagicTable",
1893
+ ref: tMagicTable,
1894
+ style: { "width": "100%" },
1895
+ "row-key": _ctx.config.rowKey || "id",
1896
+ data: data.value,
1897
+ lastData: lastData.value,
1898
+ border: _ctx.config.border,
1899
+ "max-height": _ctx.config.maxHeight,
1900
+ "default-expand-all": true,
1901
+ key: updateKey.value,
1902
+ onSelect: selectHandle,
1903
+ onSortChange: sortChange
1904
+ }, {
1905
+ default: withCtx(() => [
1906
+ _ctx.config.itemExtra && !_ctx.config.dropSort ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1907
+ key: 0,
1908
+ fixed: "left",
1909
+ width: "30",
1910
+ type: "expand"
1911
+ }, {
1912
+ default: withCtx((scope) => [
1913
+ createElementVNode("span", {
1914
+ innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
1915
+ class: "m-form-tip"
1916
+ }, null, 8, _hoisted_3)
1917
+ ]),
1918
+ _: 1
1919
+ })) : createCommentVNode("", true),
1920
+ createVNode(unref(TMagicTableColumn), {
1921
+ label: "操作",
1922
+ width: _ctx.config.operateColWidth || 100,
1923
+ align: "center",
1924
+ fixed: _ctx.config.fixed === false ? void 0 : "left"
1925
+ }, {
1926
+ default: withCtx((scope) => [
1927
+ renderSlot(_ctx.$slots, "operateCol", { scope }),
1928
+ withDirectives(createVNode(unref(TMagicButton), {
1929
+ size: "small",
1930
+ type: "danger",
1931
+ link: "",
1932
+ title: "删除",
1933
+ icon: unref(Delete),
1934
+ onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1935
+ }, null, 8, ["icon", "onClick"]), [
1936
+ [vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
2072
1937
  ]),
2073
- _: 1
2074
- /* STABLE */
2075
- })) : createCommentVNode("v-if", true),
2076
- createVNode(unref(TMagicTableColumn), {
2077
- label: "操作",
2078
- width: _ctx.config.operateColWidth || 100,
2079
- align: "center",
2080
- fixed: _ctx.config.fixed === false ? void 0 : "left"
2081
- }, {
2082
- default: withCtx((scope) => [
2083
- renderSlot(_ctx.$slots, "operateCol", { scope }),
2084
- withDirectives(createVNode(unref(TMagicButton), {
2085
- size: "small",
2086
- type: "danger",
2087
- link: "",
2088
- title: "删除",
2089
- icon: unref(Delete),
2090
- onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
2091
- }, null, 8, ["icon", "onClick"]), [
2092
- [vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
1938
+ copyable(scope.$index + 1 + pagecontext.value * pagesize.value - 1) ? (openBlock(), createBlock(unref(TMagicButton), {
1939
+ key: 0,
1940
+ link: "",
1941
+ size: "small",
1942
+ type: "primary",
1943
+ title: "复制",
1944
+ icon: unref(DocumentCopy),
1945
+ disabled: _ctx.disabled,
1946
+ onClick: ($event) => copyHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1947
+ }, null, 8, ["icon", "disabled", "onClick"])) : createCommentVNode("", true)
1948
+ ]),
1949
+ _: 3
1950
+ }, 8, ["width", "fixed"]),
1951
+ _ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1952
+ key: 1,
1953
+ label: "排序",
1954
+ width: "60"
1955
+ }, {
1956
+ default: withCtx((scope) => [
1957
+ scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (openBlock(), createBlock(unref(TMagicTooltip), {
1958
+ key: 0,
1959
+ content: "点击上移,双击置顶",
1960
+ placement: "top"
1961
+ }, {
1962
+ default: withCtx(() => [
1963
+ createVNode(unref(TMagicButton), {
1964
+ plain: "",
1965
+ size: "small",
1966
+ type: "primary",
1967
+ icon: unref(ArrowUp),
1968
+ disabled: _ctx.disabled,
1969
+ link: "",
1970
+ onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1971
+ onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1972
+ }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
2093
1973
  ]),
2094
- copyable(scope.$index + 1 + pagecontext.value * pagesize.value - 1) ? (openBlock(), createBlock(unref(TMagicButton), {
2095
- key: 0,
2096
- link: "",
2097
- size: "small",
2098
- type: "primary",
2099
- title: "复制",
2100
- icon: unref(DocumentCopy),
2101
- disabled: _ctx.disabled,
2102
- onClick: ($event) => copyHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
2103
- }, null, 8, ["icon", "disabled", "onClick"])) : createCommentVNode("v-if", true)
2104
- ]),
2105
- _: 3
2106
- /* FORWARDED */
2107
- }, 8, ["width", "fixed"]),
2108
- _ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (openBlock(), createBlock(unref(TMagicTableColumn), {
2109
- key: 1,
2110
- label: "排序",
2111
- width: "60"
2112
- }, {
2113
- default: withCtx((scope) => [
2114
- scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (openBlock(), createBlock(
2115
- unref(TMagicTooltip),
2116
- {
1974
+ _: 2
1975
+ }, 1024)) : createCommentVNode("", true),
1976
+ scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (openBlock(), createBlock(unref(TMagicTooltip), {
1977
+ key: 1,
1978
+ content: "点击下移,双击置底",
1979
+ placement: "top"
1980
+ }, {
1981
+ default: withCtx(() => [
1982
+ createVNode(unref(TMagicButton), {
1983
+ plain: "",
1984
+ size: "small",
1985
+ type: "primary",
1986
+ icon: unref(ArrowDown),
1987
+ disabled: _ctx.disabled,
1988
+ link: "",
1989
+ onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1990
+ onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1991
+ }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1992
+ ]),
1993
+ _: 2
1994
+ }, 1024)) : createCommentVNode("", true)
1995
+ ]),
1996
+ _: 1
1997
+ })) : createCommentVNode("", true),
1998
+ selection.value ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1999
+ key: 2,
2000
+ align: "center",
2001
+ "header-align": "center",
2002
+ type: "selection",
2003
+ width: "45"
2004
+ })) : createCommentVNode("", true),
2005
+ _ctx.showIndex && _ctx.config.showIndex ? (openBlock(), createBlock(unref(TMagicTableColumn), {
2006
+ key: 3,
2007
+ width: "60",
2008
+ label: "序号"
2009
+ }, {
2010
+ default: withCtx((scope) => [
2011
+ createTextVNode(toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
2012
+ ]),
2013
+ _: 1
2014
+ })) : createCommentVNode("", true),
2015
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.items, (column, index) => {
2016
+ return openBlock(), createElementBlock(Fragment, null, [
2017
+ column.type !== "hidden" && display$1(column.display) ? (openBlock(), createBlock(unref(TMagicTableColumn), {
2018
+ prop: column.name,
2019
+ width: column.width,
2020
+ label: column.label,
2021
+ sortable: column.sortable,
2022
+ "sort-orders": ["ascending", "descending"],
2023
+ key: column[unref(mForm)?.keyProp || "__key"] ?? index,
2024
+ "class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
2025
+ }, {
2026
+ default: withCtx((scope) => [
2027
+ scope.$index > -1 ? (openBlock(), createBlock(_sfc_main$x, {
2117
2028
  key: 0,
2118
- content: "点击上移,双击置顶",
2119
- placement: "top"
2120
- },
2121
- {
2122
- default: withCtx(() => [
2123
- createVNode(unref(TMagicButton), {
2124
- plain: "",
2125
- size: "small",
2126
- type: "primary",
2127
- icon: unref(ArrowUp),
2128
- disabled: _ctx.disabled,
2129
- link: "",
2130
- onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
2131
- onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
2132
- }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
2133
- ]),
2134
- _: 2
2135
- /* DYNAMIC */
2136
- },
2137
- 1024
2138
- /* DYNAMIC_SLOTS */
2139
- )) : createCommentVNode("v-if", true),
2140
- scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (openBlock(), createBlock(
2141
- unref(TMagicTooltip),
2142
- {
2143
- key: 1,
2144
- content: "点击下移,双击置底",
2145
- placement: "top"
2146
- },
2147
- {
2148
- default: withCtx(() => [
2149
- createVNode(unref(TMagicButton), {
2150
- plain: "",
2151
- size: "small",
2152
- type: "primary",
2153
- icon: unref(ArrowDown),
2154
- disabled: _ctx.disabled,
2155
- link: "",
2156
- onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
2157
- onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
2158
- }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
2159
- ]),
2160
- _: 2
2161
- /* DYNAMIC */
2162
- },
2163
- 1024
2164
- /* DYNAMIC_SLOTS */
2165
- )) : createCommentVNode("v-if", true)
2166
- ]),
2167
- _: 1
2168
- /* STABLE */
2169
- })) : createCommentVNode("v-if", true),
2170
- selection.value ? (openBlock(), createBlock(unref(TMagicTableColumn), {
2171
- key: 2,
2172
- align: "center",
2173
- "header-align": "center",
2174
- type: "selection",
2175
- width: "45"
2176
- })) : createCommentVNode("v-if", true),
2177
- _ctx.showIndex && _ctx.config.showIndex ? (openBlock(), createBlock(unref(TMagicTableColumn), {
2178
- key: 3,
2179
- width: "60",
2180
- label: "序号"
2181
- }, {
2182
- default: withCtx((scope) => [
2183
- createTextVNode(
2184
- toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value),
2185
- 1
2186
- /* TEXT */
2187
- )
2188
- ]),
2189
- _: 1
2190
- /* STABLE */
2191
- })) : createCommentVNode("v-if", true),
2192
- (openBlock(true), createElementBlock(
2193
- Fragment,
2194
- null,
2195
- renderList(_ctx.config.items, (column, index) => {
2196
- return openBlock(), createElementBlock(
2197
- Fragment,
2198
- null,
2199
- [
2200
- column.type !== "hidden" && display$1(column.display) ? (openBlock(), createBlock(unref(TMagicTableColumn), {
2201
- prop: column.name,
2202
- width: column.width,
2203
- label: column.label,
2204
- sortable: column.sortable,
2205
- "sort-orders": ["ascending", "descending"],
2206
- key: column[unref(mForm)?.keyProp || "__key"] ?? index,
2207
- "class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
2208
- }, {
2209
- default: withCtx((scope) => [
2210
- scope.$index > -1 ? (openBlock(), createBlock(_sfc_main$x, {
2211
- key: 0,
2212
- labelWidth: "0",
2213
- disabled: _ctx.disabled,
2214
- prop: getProp(scope.$index),
2215
- rules: column.rules,
2216
- config: makeConfig(column, scope.row),
2217
- model: scope.row,
2218
- lastValues: lastData.value[scope.$index],
2219
- "is-compare": _ctx.isCompare,
2220
- size: _ctx.size,
2221
- onChange: changeHandler,
2222
- onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
2223
- }, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : createCommentVNode("v-if", true)
2224
- ]),
2225
- _: 2
2226
- /* DYNAMIC */
2227
- }, 1032, ["prop", "width", "label", "sortable", "class-name"])) : createCommentVNode("v-if", true)
2228
- ],
2229
- 64
2230
- /* STABLE_FRAGMENT */
2231
- );
2232
- }),
2233
- 256
2234
- /* UNKEYED_FRAGMENT */
2235
- ))
2236
- ]),
2237
- _: 3
2238
- /* FORWARDED */
2239
- }, 8, ["row-key", "data", "lastData", "border", "max-height"])) : createCommentVNode("v-if", true)
2240
- ]),
2241
- _: 3
2242
- /* FORWARDED */
2243
- }, 8, ["disabled"]),
2244
- renderSlot(_ctx.$slots, "default"),
2245
- createElementVNode("div", _hoisted_4, [
2246
- addable.value ? (openBlock(), createBlock(unref(TMagicButton), {
2029
+ labelWidth: "0",
2030
+ disabled: _ctx.disabled,
2031
+ prop: getProp(scope.$index),
2032
+ rules: column.rules,
2033
+ config: makeConfig(column, scope.row),
2034
+ model: scope.row,
2035
+ lastValues: lastData.value[scope.$index],
2036
+ "is-compare": _ctx.isCompare,
2037
+ size: _ctx.size,
2038
+ onChange: changeHandler,
2039
+ onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
2040
+ }, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : createCommentVNode("", true)
2041
+ ]),
2042
+ _: 2
2043
+ }, 1032, ["prop", "width", "label", "sortable", "class-name"])) : createCommentVNode("", true)
2044
+ ], 64);
2045
+ }), 256))
2046
+ ]),
2047
+ _: 3
2048
+ }, 8, ["row-key", "data", "lastData", "border", "max-height"])) : createCommentVNode("", true)
2049
+ ]),
2050
+ _: 3
2051
+ }, 8, ["disabled"]),
2052
+ renderSlot(_ctx.$slots, "default"),
2053
+ createElementVNode("div", _hoisted_4, [
2054
+ addable.value ? (openBlock(), createBlock(unref(TMagicButton), {
2055
+ key: 0,
2056
+ size: "small",
2057
+ type: "primary",
2058
+ disabled: _ctx.disabled,
2059
+ plain: "",
2060
+ onClick: _cache[1] || (_cache[1] = ($event) => newHandler())
2061
+ }, {
2062
+ default: withCtx(() => _cache[3] || (_cache[3] = [
2063
+ createTextVNode("新增一行")
2064
+ ])),
2065
+ _: 1
2066
+ }, 8, ["disabled"])) : createCommentVNode("", true),
2067
+ createElementVNode("div", _hoisted_5, [
2068
+ _ctx.enableToggleMode && _ctx.config.enableToggleMode !== false && !isFullscreen.value ? (openBlock(), createBlock(unref(TMagicButton), {
2247
2069
  key: 0,
2070
+ icon: unref(Grid),
2071
+ size: "small",
2072
+ type: "primary",
2073
+ onClick: toggleMode
2074
+ }, {
2075
+ default: withCtx(() => _cache[4] || (_cache[4] = [
2076
+ createTextVNode("展开配置")
2077
+ ])),
2078
+ _: 1
2079
+ }, 8, ["icon"])) : createCommentVNode("", true),
2080
+ _ctx.config.enableFullscreen !== false ? (openBlock(), createBlock(unref(TMagicButton), {
2081
+ key: 1,
2082
+ icon: unref(FullScreen),
2083
+ size: "small",
2084
+ type: "primary",
2085
+ onClick: toggleFullscreen
2086
+ }, {
2087
+ default: withCtx(() => [
2088
+ createTextVNode(toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
2089
+ ]),
2090
+ _: 1
2091
+ }, 8, ["icon"])) : createCommentVNode("", true),
2092
+ importable.value ? (openBlock(), createBlock(unref(TMagicUpload), {
2093
+ key: 2,
2094
+ style: { "display": "inline-block" },
2095
+ ref_key: "excelBtn",
2096
+ ref: excelBtn,
2097
+ action: "/noop",
2098
+ disabled: _ctx.disabled,
2099
+ "on-change": excelHandler,
2100
+ "auto-upload": false
2101
+ }, {
2102
+ default: withCtx(() => [
2103
+ createVNode(unref(TMagicButton), {
2104
+ size: "small",
2105
+ type: "success",
2106
+ disabled: _ctx.disabled,
2107
+ plain: ""
2108
+ }, {
2109
+ default: withCtx(() => _cache[5] || (_cache[5] = [
2110
+ createTextVNode("导入EXCEL")
2111
+ ])),
2112
+ _: 1
2113
+ }, 8, ["disabled"])
2114
+ ]),
2115
+ _: 1
2116
+ }, 8, ["disabled"])) : createCommentVNode("", true),
2117
+ importable.value ? (openBlock(), createBlock(unref(TMagicButton), {
2118
+ key: 3,
2248
2119
  size: "small",
2249
- type: "primary",
2120
+ type: "warning",
2250
2121
  disabled: _ctx.disabled,
2251
2122
  plain: "",
2252
- onClick: _cache[1] || (_cache[1] = ($event) => newHandler())
2123
+ onClick: _cache[2] || (_cache[2] = ($event) => clearHandler())
2253
2124
  }, {
2254
- default: withCtx(() => _cache[3] || (_cache[3] = [
2255
- createTextVNode("新增一行")
2125
+ default: withCtx(() => _cache[6] || (_cache[6] = [
2126
+ createTextVNode("清空")
2256
2127
  ])),
2257
2128
  _: 1
2258
- /* STABLE */
2259
- }, 8, ["disabled"])) : createCommentVNode("v-if", true),
2260
- createElementVNode("div", _hoisted_5, [
2261
- _ctx.enableToggleMode && _ctx.config.enableToggleMode !== false && !isFullscreen.value ? (openBlock(), createBlock(unref(TMagicButton), {
2262
- key: 0,
2263
- icon: unref(Grid),
2264
- size: "small",
2265
- type: "primary",
2266
- onClick: toggleMode
2267
- }, {
2268
- default: withCtx(() => _cache[4] || (_cache[4] = [
2269
- createTextVNode("展开配置")
2270
- ])),
2271
- _: 1
2272
- /* STABLE */
2273
- }, 8, ["icon"])) : createCommentVNode("v-if", true),
2274
- _ctx.config.enableFullscreen !== false ? (openBlock(), createBlock(unref(TMagicButton), {
2275
- key: 1,
2276
- icon: unref(FullScreen),
2277
- size: "small",
2278
- type: "primary",
2279
- onClick: toggleFullscreen
2280
- }, {
2281
- default: withCtx(() => [
2282
- createTextVNode(
2283
- toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"),
2284
- 1
2285
- /* TEXT */
2286
- )
2287
- ]),
2288
- _: 1
2289
- /* STABLE */
2290
- }, 8, ["icon"])) : createCommentVNode("v-if", true),
2291
- importable.value ? (openBlock(), createBlock(unref(TMagicUpload), {
2292
- key: 2,
2293
- style: { "display": "inline-block" },
2294
- ref_key: "excelBtn",
2295
- ref: excelBtn,
2296
- action: "/noop",
2297
- disabled: _ctx.disabled,
2298
- "on-change": excelHandler,
2299
- "auto-upload": false
2300
- }, {
2301
- default: withCtx(() => [
2302
- createVNode(unref(TMagicButton), {
2303
- size: "small",
2304
- type: "success",
2305
- disabled: _ctx.disabled,
2306
- plain: ""
2307
- }, {
2308
- default: withCtx(() => _cache[5] || (_cache[5] = [
2309
- createTextVNode("导入EXCEL")
2310
- ])),
2311
- _: 1
2312
- /* STABLE */
2313
- }, 8, ["disabled"])
2314
- ]),
2315
- _: 1
2316
- /* STABLE */
2317
- }, 8, ["disabled"])) : createCommentVNode("v-if", true),
2318
- importable.value ? (openBlock(), createBlock(unref(TMagicButton), {
2319
- key: 3,
2320
- size: "small",
2321
- type: "warning",
2322
- disabled: _ctx.disabled,
2323
- plain: "",
2324
- onClick: _cache[2] || (_cache[2] = ($event) => clearHandler())
2325
- }, {
2326
- default: withCtx(() => _cache[6] || (_cache[6] = [
2327
- createTextVNode("清空")
2328
- ])),
2329
- _: 1
2330
- /* STABLE */
2331
- }, 8, ["disabled"])) : createCommentVNode("v-if", true)
2332
- ])
2333
- ]),
2334
- _ctx.config.pagination ? (openBlock(), createElementBlock("div", _hoisted_6, [
2335
- createVNode(unref(TMagicPagination), {
2336
- layout: "total, sizes, prev, pager, next, jumper",
2337
- "hide-on-single-page": _ctx.model[modelName.value].length < pagesize.value,
2338
- "current-page": pagecontext.value + 1,
2339
- "page-sizes": [pagesize.value, 60, 120, 300],
2340
- "page-size": pagesize.value,
2341
- total: _ctx.model[modelName.value].length,
2342
- onSizeChange: handleSizeChange,
2343
- onCurrentChange: handleCurrentChange
2344
- }, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
2345
- ])) : createCommentVNode("v-if", true)
2346
- ],
2347
- 2
2348
- /* CLASS */
2349
- )
2129
+ }, 8, ["disabled"])) : createCommentVNode("", true)
2130
+ ])
2131
+ ]),
2132
+ _ctx.config.pagination ? (openBlock(), createElementBlock("div", _hoisted_6, [
2133
+ createVNode(unref(TMagicPagination), {
2134
+ layout: "total, sizes, prev, pager, next, jumper",
2135
+ "hide-on-single-page": _ctx.model[modelName.value].length < pagesize.value,
2136
+ "current-page": pagecontext.value + 1,
2137
+ "page-sizes": [pagesize.value, 60, 120, 300],
2138
+ "page-size": pagesize.value,
2139
+ total: _ctx.model[modelName.value].length,
2140
+ onSizeChange: handleSizeChange,
2141
+ onCurrentChange: handleCurrentChange
2142
+ }, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
2143
+ ])) : createCommentVNode("", true)
2144
+ ], 2)
2350
2145
  ], 8, ["disabled"]))
2351
2146
  ]);
2352
2147
  };
@@ -2491,71 +2286,47 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
2491
2286
  }
2492
2287
  ), {
2493
2288
  default: withCtx(() => [
2494
- (openBlock(true), createElementBlock(
2495
- Fragment,
2496
- null,
2497
- renderList(tabs.value, (tab, tabIndex) => {
2498
- return openBlock(), createBlock(
2499
- resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"),
2500
- mergeProps(
2501
- {
2502
- key: tab[unref(mForm)?.keyProp || "__key"] ?? tabIndex,
2503
- ref_for: true
2504
- },
2505
- unref(tabPaneComponent)?.props({ name: filter(tab.status) || tabIndex.toString(), lazy: tab.lazy || false }) || {}
2506
- ),
2507
- {
2508
- label: withCtx(() => [
2509
- createElementVNode("span", null, [
2510
- createTextVNode(
2511
- toDisplayString(filter(tab.title)),
2512
- 1
2513
- /* TEXT */
2514
- ),
2515
- createVNode(unref(TMagicBadge), {
2516
- hidden: !diffCount.value[tabIndex],
2517
- value: diffCount.value[tabIndex],
2518
- class: "diff-count-badge"
2519
- }, null, 8, ["hidden", "value"])
2520
- ])
2521
- ]),
2522
- default: withCtx(() => [
2523
- (openBlock(true), createElementBlock(
2524
- Fragment,
2525
- null,
2526
- renderList(tabItems(tab), (item) => {
2527
- return openBlock(), createBlock(_sfc_main$x, {
2528
- key: item[unref(mForm)?.keyProp || "__key"],
2529
- config: item,
2530
- disabled: _ctx.disabled,
2531
- model: _ctx.config.dynamic ? (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model)[tabIndex] : tab.name ? (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model)[tab.name] : _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
2532
- "last-values": unref(isEmpty)(_ctx.lastValues) ? {} : _ctx.config.dynamic ? (_ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues)[tabIndex] : tab.name ? (_ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues)[tab.name] : _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
2533
- "is-compare": _ctx.isCompare,
2534
- prop: _ctx.config.dynamic ? `${_ctx.prop}${_ctx.prop ? "." : ""}${String(tabIndex)}` : _ctx.prop,
2535
- size: _ctx.size,
2536
- "label-width": tab.labelWidth || _ctx.labelWidth,
2537
- "expand-more": _ctx.expandMore,
2538
- onChange: changeHandler,
2539
- onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
2540
- }, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
2541
- }),
2542
- 128
2543
- /* KEYED_FRAGMENT */
2544
- ))
2545
- ]),
2546
- _: 2
2547
- /* DYNAMIC */
2548
- },
2549
- 1040
2550
- /* FULL_PROPS, DYNAMIC_SLOTS */
2551
- );
2552
- }),
2553
- 128
2554
- /* KEYED_FRAGMENT */
2555
- ))
2289
+ (openBlock(true), createElementBlock(Fragment, null, renderList(tabs.value, (tab, tabIndex) => {
2290
+ return openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), mergeProps(
2291
+ {
2292
+ key: tab[unref(mForm)?.keyProp || "__key"] ?? tabIndex,
2293
+ ref_for: true
2294
+ },
2295
+ unref(tabPaneComponent)?.props({ name: filter(tab.status) || tabIndex.toString(), lazy: tab.lazy || false }) || {}
2296
+ ), {
2297
+ label: withCtx(() => [
2298
+ createElementVNode("span", null, [
2299
+ createTextVNode(toDisplayString(filter(tab.title)), 1),
2300
+ createVNode(unref(TMagicBadge), {
2301
+ hidden: !diffCount.value[tabIndex],
2302
+ value: diffCount.value[tabIndex],
2303
+ class: "diff-count-badge"
2304
+ }, null, 8, ["hidden", "value"])
2305
+ ])
2306
+ ]),
2307
+ default: withCtx(() => [
2308
+ (openBlock(true), createElementBlock(Fragment, null, renderList(tabItems(tab), (item) => {
2309
+ return openBlock(), createBlock(_sfc_main$x, {
2310
+ key: item[unref(mForm)?.keyProp || "__key"],
2311
+ config: item,
2312
+ disabled: _ctx.disabled,
2313
+ model: _ctx.config.dynamic ? (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model)[tabIndex] : tab.name ? (_ctx.name ? _ctx.model[_ctx.name] : _ctx.model)[tab.name] : _ctx.name ? _ctx.model[_ctx.name] : _ctx.model,
2314
+ "last-values": unref(isEmpty)(_ctx.lastValues) ? {} : _ctx.config.dynamic ? (_ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues)[tabIndex] : tab.name ? (_ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues)[tab.name] : _ctx.name ? _ctx.lastValues[_ctx.name] : _ctx.lastValues,
2315
+ "is-compare": _ctx.isCompare,
2316
+ prop: _ctx.config.dynamic ? `${_ctx.prop}${_ctx.prop ? "." : ""}${String(tabIndex)}` : _ctx.prop,
2317
+ size: _ctx.size,
2318
+ "label-width": tab.labelWidth || _ctx.labelWidth,
2319
+ "expand-more": _ctx.expandMore,
2320
+ onChange: changeHandler,
2321
+ onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
2322
+ }, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
2323
+ }), 128))
2324
+ ]),
2325
+ _: 2
2326
+ }, 1040);
2327
+ }), 128))
2556
2328
  ]),
2557
2329
  _: 1
2558
- /* STABLE */
2559
2330
  }, 16, ["modelValue", "class"]);
2560
2331
  };
2561
2332
  }
@@ -2762,14 +2533,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
2762
2533
  onChange: changeHandler
2763
2534
  }, {
2764
2535
  default: withCtx(() => [
2765
- createTextVNode(
2766
- toDisplayString(_ctx.config.text),
2767
- 1
2768
- /* TEXT */
2769
- )
2536
+ createTextVNode(toDisplayString(_ctx.config.text), 1)
2770
2537
  ]),
2771
2538
  _: 1
2772
- /* STABLE */
2773
2539
  }, 8, ["modelValue", "size", "trueValue", "falseValue", "disabled"]);
2774
2540
  };
2775
2541
  }
@@ -2818,32 +2584,20 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
2818
2584
  onChange: changeHandler
2819
2585
  }, {
2820
2586
  default: withCtx(() => [
2821
- (openBlock(true), createElementBlock(
2822
- Fragment,
2823
- null,
2824
- renderList(options.value, (option) => {
2825
- return openBlock(), createBlock(unref(TMagicCheckbox), {
2826
- value: option.value,
2827
- key: option.value,
2828
- disabled: option.disabled
2829
- }, {
2830
- default: withCtx(() => [
2831
- createTextVNode(
2832
- toDisplayString(option.text),
2833
- 1
2834
- /* TEXT */
2835
- )
2836
- ]),
2837
- _: 2
2838
- /* DYNAMIC */
2839
- }, 1032, ["value", "disabled"]);
2840
- }),
2841
- 128
2842
- /* KEYED_FRAGMENT */
2843
- ))
2587
+ (openBlock(true), createElementBlock(Fragment, null, renderList(options.value, (option) => {
2588
+ return openBlock(), createBlock(unref(TMagicCheckbox), {
2589
+ value: option.value,
2590
+ key: option.value,
2591
+ disabled: option.disabled
2592
+ }, {
2593
+ default: withCtx(() => [
2594
+ createTextVNode(toDisplayString(option.text), 1)
2595
+ ]),
2596
+ _: 2
2597
+ }, 1032, ["value", "disabled"]);
2598
+ }), 128))
2844
2599
  ]),
2845
2600
  _: 1
2846
- /* STABLE */
2847
2601
  }, 8, ["modelValue", "size", "disabled"]);
2848
2602
  };
2849
2603
  }
@@ -3103,13 +2857,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
3103
2857
  }
3104
2858
  useAddField(props.prop);
3105
2859
  return (_ctx, _cache) => {
3106
- return _ctx.model ? (openBlock(), createElementBlock(
3107
- "span",
3108
- _hoisted_1$8,
3109
- toDisplayString(_ctx.model[_ctx.name]),
3110
- 1
3111
- /* TEXT */
3112
- )) : createCommentVNode("v-if", true);
2860
+ return _ctx.model ? (openBlock(), createElementBlock("span", _hoisted_1$8, toDisplayString(_ctx.model[_ctx.name]), 1)) : createCommentVNode("", true);
3113
2861
  };
3114
2862
  }
3115
2863
  });
@@ -3184,32 +2932,24 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
3184
2932
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
3185
2933
  createVNode(unref(TMagicForm), { size: "small" }, {
3186
2934
  default: withCtx(() => [
3187
- (openBlock(true), createElementBlock(
3188
- Fragment,
3189
- null,
3190
- renderList(Object.keys(fieldMap.value), (key) => {
3191
- return openBlock(), createBlock(unref(TMagicFormItem), {
3192
- key,
3193
- label: fieldLabelMap.value[key]
3194
- }, {
3195
- default: withCtx(() => [
3196
- createVNode(unref(TMagicInput), {
3197
- modelValue: fieldMap.value[key],
3198
- "onUpdate:modelValue": ($event) => fieldMap.value[key] = $event,
3199
- placeholder: fieldLabelMap.value[key],
3200
- onChange: ($event) => inputChangeHandler(key)
3201
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])
3202
- ]),
3203
- _: 2
3204
- /* DYNAMIC */
3205
- }, 1032, ["label"]);
3206
- }),
3207
- 128
3208
- /* KEYED_FRAGMENT */
3209
- ))
2935
+ (openBlock(true), createElementBlock(Fragment, null, renderList(Object.keys(fieldMap.value), (key) => {
2936
+ return openBlock(), createBlock(unref(TMagicFormItem), {
2937
+ key,
2938
+ label: fieldLabelMap.value[key]
2939
+ }, {
2940
+ default: withCtx(() => [
2941
+ createVNode(unref(TMagicInput), {
2942
+ modelValue: fieldMap.value[key],
2943
+ "onUpdate:modelValue": ($event) => fieldMap.value[key] = $event,
2944
+ placeholder: fieldLabelMap.value[key],
2945
+ onChange: ($event) => inputChangeHandler(key)
2946
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])
2947
+ ]),
2948
+ _: 2
2949
+ }, 1032, ["label"]);
2950
+ }), 128))
3210
2951
  ]),
3211
2952
  _: 1
3212
- /* STABLE */
3213
2953
  })
3214
2954
  ]);
3215
2955
  };
@@ -3236,19 +2976,13 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3236
2976
  const props = __props;
3237
2977
  useAddField(props.prop);
3238
2978
  return (_ctx, _cache) => {
3239
- return _ctx.model ? withDirectives((openBlock(), createElementBlock(
3240
- "input",
3241
- {
3242
- key: 0,
3243
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
3244
- type: "hidden"
3245
- },
3246
- null,
3247
- 512
3248
- /* NEED_PATCH */
3249
- )), [
2979
+ return _ctx.model ? withDirectives((openBlock(), createElementBlock("input", {
2980
+ key: 0,
2981
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
2982
+ type: "hidden"
2983
+ }, null, 512)), [
3250
2984
  [vModelText, _ctx.model[_ctx.name]]
3251
- ]) : createCommentVNode("v-if", true);
2985
+ ]) : createCommentVNode("", true);
3252
2986
  };
3253
2987
  }
3254
2988
  });
@@ -3408,29 +3142,22 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3408
3142
  onSubmit: submitHandler
3409
3143
  }, {
3410
3144
  default: withCtx(() => [
3411
- initialized.value && Array.isArray(_ctx.config) ? (openBlock(true), createElementBlock(
3412
- Fragment,
3413
- { key: 0 },
3414
- renderList(_ctx.config, (item, index) => {
3415
- return openBlock(), createBlock(_sfc_main$x, {
3416
- disabled: _ctx.disabled,
3417
- key: item[_ctx.keyProp] ?? index,
3418
- config: item,
3419
- model: values.value,
3420
- "last-values": lastValuesProcessed.value,
3421
- "is-compare": _ctx.isCompare,
3422
- "label-width": item.labelWidth || _ctx.labelWidth,
3423
- "step-active": _ctx.stepActive,
3424
- size: _ctx.size,
3425
- onChange: changeHandler
3426
- }, null, 8, ["disabled", "config", "model", "last-values", "is-compare", "label-width", "step-active", "size"]);
3427
- }),
3428
- 128
3429
- /* KEYED_FRAGMENT */
3430
- )) : createCommentVNode("v-if", true)
3145
+ initialized.value && Array.isArray(_ctx.config) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.config, (item, index) => {
3146
+ return openBlock(), createBlock(_sfc_main$x, {
3147
+ disabled: _ctx.disabled,
3148
+ key: item[_ctx.keyProp] ?? index,
3149
+ config: item,
3150
+ model: values.value,
3151
+ "last-values": lastValuesProcessed.value,
3152
+ "is-compare": _ctx.isCompare,
3153
+ "label-width": item.labelWidth || _ctx.labelWidth,
3154
+ "step-active": _ctx.stepActive,
3155
+ size: _ctx.size,
3156
+ onChange: changeHandler
3157
+ }, null, 8, ["disabled", "config", "model", "last-values", "is-compare", "label-width", "step-active", "size"]);
3158
+ }), 128)) : createCommentVNode("", true)
3431
3159
  ]),
3432
3160
  _: 1
3433
- /* STABLE */
3434
3161
  }, 8, ["model", "label-width", "style", "inline", "label-position"]);
3435
3162
  };
3436
3163
  }
@@ -3551,7 +3278,6 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3551
3278
  ])
3552
3279
  ]),
3553
3280
  _: 3
3554
- /* FORWARDED */
3555
3281
  }),
3556
3282
  createVNode(unref(TMagicCol), { span: 12 }, {
3557
3283
  default: withCtx(() => [
@@ -3564,7 +3290,6 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3564
3290
  createTextVNode("取 消")
3565
3291
  ])),
3566
3292
  _: 1
3567
- /* STABLE */
3568
3293
  }),
3569
3294
  hasStep.value && stepActive.value > 1 ? (openBlock(), createBlock(unref(TMagicButton), {
3570
3295
  key: 0,
@@ -3576,8 +3301,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3576
3301
  createTextVNode("上一步")
3577
3302
  ])),
3578
3303
  _: 1
3579
- /* STABLE */
3580
- })) : createCommentVNode("v-if", true),
3304
+ })) : createCommentVNode("", true),
3581
3305
  hasStep.value && stepCount.value > stepActive.value ? (openBlock(), createBlock(unref(TMagicButton), {
3582
3306
  key: 1,
3583
3307
  type: "info",
@@ -3588,7 +3312,6 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3588
3312
  createTextVNode("下一步")
3589
3313
  ])),
3590
3314
  _: 1
3591
- /* STABLE */
3592
3315
  })) : (openBlock(), createBlock(unref(TMagicButton), {
3593
3316
  key: 2,
3594
3317
  type: "primary",
@@ -3598,58 +3321,44 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3598
3321
  onClick: save
3599
3322
  }, {
3600
3323
  default: withCtx(() => [
3601
- createTextVNode(
3602
- toDisplayString(_ctx.confirmText),
3603
- 1
3604
- /* TEXT */
3605
- )
3324
+ createTextVNode(toDisplayString(_ctx.confirmText), 1)
3606
3325
  ]),
3607
3326
  _: 1
3608
- /* STABLE */
3609
3327
  }, 8, ["disabled", "loading"]))
3610
3328
  ])
3611
3329
  ]),
3612
3330
  _: 3
3613
- /* FORWARDED */
3614
3331
  })
3615
3332
  ]),
3616
3333
  _: 3
3617
- /* FORWARDED */
3618
3334
  })
3619
3335
  ]),
3620
3336
  default: withCtx(() => [
3621
- dialogVisible.value ? (openBlock(), createElementBlock(
3622
- "div",
3623
- {
3624
- key: 0,
3625
- class: "m-dialog-body",
3626
- style: normalizeStyle(`max-height: ${bodyHeight.value}; overflow-y: auto; overflow-x: hidden;`)
3627
- },
3628
- [
3629
- createVNode(_sfc_main$d, {
3630
- modelValue: stepActive.value,
3631
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => stepActive.value = $event),
3632
- ref_key: "form",
3633
- ref: form,
3634
- size: _ctx.size,
3635
- disabled: _ctx.disabled,
3636
- config: _ctx.config,
3637
- "init-values": _ctx.values,
3638
- "parent-values": _ctx.parentValues,
3639
- "label-width": _ctx.labelWidth,
3640
- "label-position": _ctx.labelPosition,
3641
- inline: _ctx.inline,
3642
- "prevent-submit-default": _ctx.preventSubmitDefault,
3643
- onChange: changeHandler
3644
- }, null, 8, ["modelValue", "size", "disabled", "config", "init-values", "parent-values", "label-width", "label-position", "inline", "prevent-submit-default"]),
3645
- renderSlot(_ctx.$slots, "default")
3646
- ],
3647
- 4
3648
- /* STYLE */
3649
- )) : createCommentVNode("v-if", true)
3337
+ dialogVisible.value ? (openBlock(), createElementBlock("div", {
3338
+ key: 0,
3339
+ class: "m-dialog-body",
3340
+ style: normalizeStyle(`max-height: ${bodyHeight.value}; overflow-y: auto; overflow-x: hidden;`)
3341
+ }, [
3342
+ createVNode(_sfc_main$d, {
3343
+ modelValue: stepActive.value,
3344
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => stepActive.value = $event),
3345
+ ref_key: "form",
3346
+ ref: form,
3347
+ size: _ctx.size,
3348
+ disabled: _ctx.disabled,
3349
+ config: _ctx.config,
3350
+ "init-values": _ctx.values,
3351
+ "parent-values": _ctx.parentValues,
3352
+ "label-width": _ctx.labelWidth,
3353
+ "label-position": _ctx.labelPosition,
3354
+ inline: _ctx.inline,
3355
+ "prevent-submit-default": _ctx.preventSubmitDefault,
3356
+ onChange: changeHandler
3357
+ }, null, 8, ["modelValue", "size", "disabled", "config", "init-values", "parent-values", "label-width", "label-position", "inline", "prevent-submit-default"]),
3358
+ renderSlot(_ctx.$slots, "default")
3359
+ ], 4)) : createCommentVNode("", true)
3650
3360
  ]),
3651
3361
  _: 3
3652
- /* FORWARDED */
3653
3362
  }, 8, ["modelValue", "title", "width", "zIndex", "fullscreen"]);
3654
3363
  };
3655
3364
  }
@@ -3729,16 +3438,10 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3729
3438
  target: "_blank",
3730
3439
  href: href.value,
3731
3440
  style: normalizeStyle(_ctx.config.css || {})
3732
- }, toDisplayString(displayText.value), 13, _hoisted_1$5)) : _ctx.config.href && _ctx.disabled ? (openBlock(), createElementBlock(
3733
- "span",
3734
- {
3735
- key: 1,
3736
- style: normalizeStyle(_ctx.config.disabledCss || {})
3737
- },
3738
- toDisplayString(displayText.value),
3739
- 5
3740
- /* TEXT, STYLE */
3741
- )) : (openBlock(), createElementBlock("div", _hoisted_2$1, [
3441
+ }, toDisplayString(displayText.value), 13, _hoisted_1$5)) : _ctx.config.href && _ctx.disabled ? (openBlock(), createElementBlock("span", {
3442
+ key: 1,
3443
+ style: normalizeStyle(_ctx.config.disabledCss || {})
3444
+ }, toDisplayString(displayText.value), 5)) : (openBlock(), createElementBlock("div", _hoisted_2$1, [
3742
3445
  createVNode(unref(TMagicButton), {
3743
3446
  link: "",
3744
3447
  type: "primary",
@@ -3748,7 +3451,6 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
3748
3451
  createTextVNode("点击编辑")
3749
3452
  ])),
3750
3453
  _: 1
3751
- /* STABLE */
3752
3454
  }),
3753
3455
  createVNode(_sfc_main$c, {
3754
3456
  ref_key: "editor",
@@ -3810,7 +3512,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3810
3512
  disabled: _ctx.disabled,
3811
3513
  onChange: changeHandler,
3812
3514
  onInput: inputHandler
3813
- }, null, 8, ["modelValue", "size", "max", "min", "step", "placeholder", "disabled"])) : createCommentVNode("v-if", true);
3515
+ }, null, 8, ["modelValue", "size", "max", "min", "step", "placeholder", "disabled"])) : createCommentVNode("", true);
3814
3516
  };
3815
3517
  }
3816
3518
  });
@@ -3856,13 +3558,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3856
3558
  disabled: _ctx.disabled,
3857
3559
  onChange: minChangeHandler
3858
3560
  }, null, 8, ["modelValue", "size", "disabled"]),
3859
- _cache[2] || (_cache[2] = createElementVNode(
3860
- "span",
3861
- { class: "split-tag" },
3862
- "-",
3863
- -1
3864
- /* HOISTED */
3865
- )),
3561
+ _cache[2] || (_cache[2] = createElementVNode("span", { class: "split-tag" }, "-", -1)),
3866
3562
  createVNode(unref(TMagicInput), {
3867
3563
  modelValue: _ctx.model[_ctx.name][1],
3868
3564
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.model[_ctx.name][1] = $event),
@@ -3915,87 +3611,52 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
3915
3611
  disabled: _ctx.disabled
3916
3612
  }, {
3917
3613
  default: withCtx(() => [
3918
- (openBlock(true), createElementBlock(
3919
- Fragment,
3920
- null,
3921
- renderList(_ctx.config.options, (option) => {
3922
- return openBlock(), createBlock(resolveDynamicComponent(itemComponent.value), {
3923
- value: option.value,
3924
- key: `${option.value}`,
3925
- onClick: withModifiers(($event) => clickHandler(option.value), ["prevent"])
3926
- }, {
3927
- default: withCtx(() => [
3928
- option.tooltip ? (openBlock(), createBlock(unref(TMagicTooltip), {
3929
- key: 0,
3930
- placement: "top-start",
3931
- content: option.tooltip
3932
- }, {
3933
- default: withCtx(() => [
3934
- createElementVNode("div", null, [
3935
- option.icon ? (openBlock(), createBlock(
3936
- unref(TMagicIcon),
3937
- {
3938
- key: 0,
3939
- size: "16"
3940
- },
3941
- {
3942
- default: withCtx(() => [
3943
- (openBlock(), createBlock(resolveDynamicComponent(option.icon)))
3944
- ]),
3945
- _: 2
3946
- /* DYNAMIC */
3947
- },
3948
- 1024
3949
- /* DYNAMIC_SLOTS */
3950
- )) : createCommentVNode("v-if", true),
3951
- createElementVNode(
3952
- "span",
3953
- null,
3954
- toDisplayString(option.text),
3955
- 1
3956
- /* TEXT */
3957
- )
3958
- ])
3959
- ]),
3960
- _: 2
3961
- /* DYNAMIC */
3962
- }, 1032, ["content"])) : (openBlock(), createElementBlock("div", _hoisted_1$3, [
3963
- option.icon ? (openBlock(), createBlock(
3964
- unref(TMagicIcon),
3965
- {
3614
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.options, (option) => {
3615
+ return openBlock(), createBlock(resolveDynamicComponent(itemComponent.value), {
3616
+ value: option.value,
3617
+ key: `${option.value}`,
3618
+ onClick: withModifiers(($event) => clickHandler(option.value), ["prevent"])
3619
+ }, {
3620
+ default: withCtx(() => [
3621
+ option.tooltip ? (openBlock(), createBlock(unref(TMagicTooltip), {
3622
+ key: 0,
3623
+ placement: "top-start",
3624
+ content: option.tooltip
3625
+ }, {
3626
+ default: withCtx(() => [
3627
+ createElementVNode("div", null, [
3628
+ option.icon ? (openBlock(), createBlock(unref(TMagicIcon), {
3966
3629
  key: 0,
3967
3630
  size: "16"
3968
- },
3969
- {
3631
+ }, {
3970
3632
  default: withCtx(() => [
3971
3633
  (openBlock(), createBlock(resolveDynamicComponent(option.icon)))
3972
3634
  ]),
3973
3635
  _: 2
3974
- /* DYNAMIC */
3975
- },
3976
- 1024
3977
- /* DYNAMIC_SLOTS */
3978
- )) : createCommentVNode("v-if", true),
3979
- createElementVNode(
3980
- "span",
3981
- null,
3982
- toDisplayString(option.text),
3983
- 1
3984
- /* TEXT */
3985
- )
3986
- ]))
3987
- ]),
3988
- _: 2
3989
- /* DYNAMIC */
3990
- }, 1032, ["value", "onClick"]);
3991
- }),
3992
- 128
3993
- /* KEYED_FRAGMENT */
3994
- ))
3636
+ }, 1024)) : createCommentVNode("", true),
3637
+ createElementVNode("span", null, toDisplayString(option.text), 1)
3638
+ ])
3639
+ ]),
3640
+ _: 2
3641
+ }, 1032, ["content"])) : (openBlock(), createElementBlock("div", _hoisted_1$3, [
3642
+ option.icon ? (openBlock(), createBlock(unref(TMagicIcon), {
3643
+ key: 0,
3644
+ size: "16"
3645
+ }, {
3646
+ default: withCtx(() => [
3647
+ (openBlock(), createBlock(resolveDynamicComponent(option.icon)))
3648
+ ]),
3649
+ _: 2
3650
+ }, 1024)) : createCommentVNode("", true),
3651
+ createElementVNode("span", null, toDisplayString(option.text), 1)
3652
+ ]))
3653
+ ]),
3654
+ _: 2
3655
+ }, 1032, ["value", "onClick"]);
3656
+ }), 128))
3995
3657
  ]),
3996
3658
  _: 1
3997
- /* STABLE */
3998
- }, 8, ["modelValue", "size", "disabled"])) : createCommentVNode("v-if", true);
3659
+ }, 8, ["modelValue", "size", "disabled"])) : createCommentVNode("", true);
3999
3660
  };
4000
3661
  }
4001
3662
  });
@@ -4018,7 +3679,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4018
3679
  lastValues: {}
4019
3680
  },
4020
3681
  emits: ["change"],
4021
- setup(__props, { emit: __emit }) {
3682
+ setup(__props, { expose: __expose, emit: __emit }) {
4022
3683
  const props = __props;
4023
3684
  const emit = __emit;
4024
3685
  const optionComponent = getDesignConfig("components")?.option;
@@ -4094,7 +3755,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4094
3755
  postOptions.data = body;
4095
3756
  const requestFuc = getConfig("request");
4096
3757
  if (typeof option.beforeRequest === "function") {
4097
- postOptions = option.beforeRequest(mForm, postOptions, {
3758
+ postOptions = await option.beforeRequest(mForm, postOptions, {
4098
3759
  model: props.model,
4099
3760
  formValue: mForm?.values,
4100
3761
  formValues: mForm?.values,
@@ -4107,7 +3768,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4107
3768
  }
4108
3769
  let res = await requestFuc(postOptions);
4109
3770
  if (typeof option.afterRequest === "function") {
4110
- res = option.afterRequest(mForm, res, {
3771
+ res = await option.afterRequest(mForm, res, {
4111
3772
  model: props.model,
4112
3773
  formValue: mForm?.values,
4113
3774
  formValues: mForm?.values,
@@ -4196,7 +3857,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4196
3857
  json: option.json || false
4197
3858
  };
4198
3859
  if (typeof option.beforeInitRequest === "function") {
4199
- postOptions = option.beforeInitRequest(mForm, postOptions, {
3860
+ postOptions = await option.beforeInitRequest(mForm, postOptions, {
4200
3861
  model: props.model,
4201
3862
  formValue: mForm?.values,
4202
3863
  formValues: mForm?.values,
@@ -4210,7 +3871,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4210
3871
  const requestFuc = getConfig("request");
4211
3872
  let res = await requestFuc(postOptions);
4212
3873
  if (typeof option.afterRequest === "function") {
4213
- res = option.afterRequest(mForm, res, {
3874
+ res = await option.afterRequest(mForm, res, {
4214
3875
  model: props.model,
4215
3876
  formValue: mForm?.values,
4216
3877
  formValues: mForm?.values,
@@ -4232,6 +3893,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4232
3893
  }
4233
3894
  return options2;
4234
3895
  };
3896
+ const setOptions = (data) => {
3897
+ options.value = data;
3898
+ };
4235
3899
  if (typeof props.config.options === "function") {
4236
3900
  watchEffect(() => {
4237
3901
  typeof props.config.options === "function" && Promise.resolve(
@@ -4243,12 +3907,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4243
3907
  config: props.config
4244
3908
  })
4245
3909
  ).then((data) => {
4246
- options.value = data;
3910
+ setOptions(data);
4247
3911
  });
4248
3912
  });
4249
3913
  } else if (Array.isArray(props.config.options)) {
4250
3914
  watchEffect(() => {
4251
- options.value = props.config.options;
3915
+ setOptions(props.config.options);
4252
3916
  });
4253
3917
  } else if (props.config.option) {
4254
3918
  onBeforeMount(() => {
@@ -4256,7 +3920,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4256
3920
  const v = props.model[props.name];
4257
3921
  if (Array.isArray(v) ? v.length : typeof v !== "undefined") {
4258
3922
  getInitOption().then((data) => {
4259
- options.value = data;
3923
+ setOptions(data);
4260
3924
  });
4261
3925
  }
4262
3926
  });
@@ -4282,7 +3946,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4282
3946
  }
4283
3947
  moreLoadingVisible.value = true;
4284
3948
  pgIndex.value += 1;
4285
- options.value = await getOptions();
3949
+ setOptions(await getOptions());
4286
3950
  moreLoadingVisible.value = false;
4287
3951
  });
4288
3952
  },
@@ -4303,20 +3967,24 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4303
3967
  tMagicSelect.value.setPreviousQuery(query.value);
4304
3968
  tMagicSelect.value.setSelectedLabel(query.value);
4305
3969
  } else if (options.value.length <= (props.config.multiple ? props.model?.[props.name].length : 1)) {
4306
- options.value = await getOptions();
3970
+ setOptions(await getOptions());
4307
3971
  }
4308
3972
  };
4309
3973
  const remoteMethod = async (q) => {
4310
3974
  if (!localOptions.value.length) {
4311
3975
  query.value = q;
4312
3976
  pgIndex.value = 0;
4313
- options.value = await getOptions();
3977
+ setOptions(await getOptions());
4314
3978
  if (props.config.multiple)
4315
3979
  setTimeout(() => {
4316
3980
  tMagicSelect.value?.setSelected();
4317
3981
  }, 0);
4318
3982
  }
4319
3983
  };
3984
+ __expose({
3985
+ options,
3986
+ setOptions
3987
+ });
4320
3988
  return (_ctx, _cache) => {
4321
3989
  const _directive_loading = resolveDirective("loading");
4322
3990
  return _ctx.model ? withDirectives((openBlock(), createBlock(unref(TMagicSelect), {
@@ -4341,111 +4009,67 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4341
4009
  onVisibleChange: visibleHandler
4342
4010
  }, {
4343
4011
  default: withCtx(() => [
4344
- _ctx.config.group ? (openBlock(true), createElementBlock(
4345
- Fragment,
4346
- { key: 0 },
4347
- renderList(options.value, (group, index) => {
4348
- return openBlock(), createBlock(
4349
- resolveDynamicComponent(unref(optionGroupComponent)?.component || "el-option-group"),
4350
- mergeProps(
4351
- {
4352
- key: index,
4353
- ref_for: true
4354
- },
4355
- unref(optionGroupComponent)?.props({
4356
- label: group.label,
4357
- disabled: group.disabled
4358
- }) || {
4359
- label: group.label,
4360
- disabled: group.disabled
4361
- }
4362
- ),
4363
- {
4364
- default: withCtx(() => [
4365
- (openBlock(true), createElementBlock(
4366
- Fragment,
4367
- null,
4368
- renderList(group.options, (item, index2) => {
4369
- return openBlock(), createBlock(
4370
- resolveDynamicComponent(unref(optionComponent)?.component || "el-option"),
4371
- mergeProps(
4372
- {
4373
- key: index2,
4374
- ref_for: true
4375
- },
4376
- unref(optionComponent)?.props({
4377
- label: item.label || item.text,
4378
- value: item.value,
4379
- disabled: item.disabled
4380
- }) || {
4381
- label: item.label || item.text,
4382
- value: item.value,
4383
- disabled: item.disabled
4384
- }
4385
- ),
4386
- null,
4387
- 16
4388
- /* FULL_PROPS */
4389
- );
4390
- }),
4391
- 128
4392
- /* KEYED_FRAGMENT */
4393
- ))
4394
- ]),
4395
- _: 2
4396
- /* DYNAMIC */
4397
- },
4398
- 1040
4399
- /* FULL_PROPS, DYNAMIC_SLOTS */
4400
- );
4401
- }),
4402
- 128
4403
- /* KEYED_FRAGMENT */
4404
- )) : (openBlock(true), createElementBlock(
4405
- Fragment,
4406
- { key: 1 },
4407
- renderList(options.value, (option) => {
4408
- return openBlock(), createBlock(
4409
- resolveDynamicComponent(unref(optionComponent)?.component || "el-option"),
4410
- mergeProps(
4411
- {
4412
- class: "tmagic-design-option",
4413
- key: _ctx.config.valueKey ? option.value[_ctx.config.valueKey] : option.value,
4414
- ref_for: true
4415
- },
4416
- unref(optionComponent)?.props({
4417
- label: option.text,
4418
- value: option.value,
4419
- disabled: option.disabled
4420
- }) || {
4421
- label: option.text,
4422
- value: option.value,
4423
- disabled: option.disabled
4424
- }
4425
- ),
4426
- null,
4427
- 16
4428
- /* FULL_PROPS */
4429
- );
4430
- }),
4431
- 128
4432
- /* KEYED_FRAGMENT */
4433
- )),
4434
- moreLoadingVisible.value ? withDirectives((openBlock(), createElementBlock(
4435
- "div",
4436
- _hoisted_1$2,
4437
- null,
4438
- 512
4439
- /* NEED_PATCH */
4440
- )), [
4012
+ _ctx.config.group ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(options.value, (group, index) => {
4013
+ return openBlock(), createBlock(resolveDynamicComponent(unref(optionGroupComponent)?.component || "el-option-group"), mergeProps(
4014
+ {
4015
+ key: index,
4016
+ ref_for: true
4017
+ },
4018
+ unref(optionGroupComponent)?.props({
4019
+ label: group.label,
4020
+ disabled: group.disabled
4021
+ }) || {
4022
+ label: group.label,
4023
+ disabled: group.disabled
4024
+ }
4025
+ ), {
4026
+ default: withCtx(() => [
4027
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group.options, (item, index2) => {
4028
+ return openBlock(), createBlock(resolveDynamicComponent(unref(optionComponent)?.component || "el-option"), mergeProps(
4029
+ {
4030
+ key: index2,
4031
+ ref_for: true
4032
+ },
4033
+ unref(optionComponent)?.props({
4034
+ label: item.label || item.text,
4035
+ value: item.value,
4036
+ disabled: item.disabled
4037
+ }) || {
4038
+ label: item.label || item.text,
4039
+ value: item.value,
4040
+ disabled: item.disabled
4041
+ }
4042
+ ), null, 16);
4043
+ }), 128))
4044
+ ]),
4045
+ _: 2
4046
+ }, 1040);
4047
+ }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(options.value, (option) => {
4048
+ return openBlock(), createBlock(resolveDynamicComponent(unref(optionComponent)?.component || "el-option"), mergeProps(
4049
+ {
4050
+ class: "tmagic-design-option",
4051
+ key: _ctx.config.valueKey ? option.value[_ctx.config.valueKey] : option.value,
4052
+ ref_for: true
4053
+ },
4054
+ unref(optionComponent)?.props({
4055
+ label: option.text,
4056
+ value: option.value,
4057
+ disabled: option.disabled
4058
+ }) || {
4059
+ label: option.text,
4060
+ value: option.value,
4061
+ disabled: option.disabled
4062
+ }
4063
+ ), null, 16);
4064
+ }), 128)),
4065
+ moreLoadingVisible.value ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$2, null, 512)), [
4441
4066
  [_directive_loading, true]
4442
- ]) : createCommentVNode("v-if", true)
4067
+ ]) : createCommentVNode("", true)
4443
4068
  ]),
4444
4069
  _: 1
4445
- /* STABLE */
4446
4070
  }, 8, ["modelValue", "clearable", "filterable", "popper-class", "size", "remote", "placeholder", "multiple", "value-key", "allow-create", "disabled", "remote-method"])), [
4447
4071
  [_directive_loading, loading.value]
4448
- ]) : createCommentVNode("v-if", true);
4072
+ ]) : createCommentVNode("", true);
4449
4073
  };
4450
4074
  }
4451
4075
  });
@@ -4662,10 +4286,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4662
4286
  onChange: changeHandler,
4663
4287
  onInput: inputHandler,
4664
4288
  onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
4665
- }, createSlots({
4666
- _: 2
4667
- /* DYNAMIC */
4668
- }, [
4289
+ }, createSlots({ _: 2 }, [
4669
4290
  appendConfig.value ? {
4670
4291
  name: "append",
4671
4292
  fn: withCtx(() => [
@@ -4676,74 +4297,49 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4676
4297
  onClick: withModifiers(buttonClickHandler, ["prevent"])
4677
4298
  }, {
4678
4299
  default: withCtx(() => [
4679
- createTextVNode(
4680
- toDisplayString(appendConfig.value.text),
4681
- 1
4682
- /* TEXT */
4683
- )
4300
+ createTextVNode(toDisplayString(appendConfig.value.text), 1)
4684
4301
  ]),
4685
4302
  _: 1
4686
- /* STABLE */
4687
- }, 8, ["size"])) : createCommentVNode("v-if", true)
4303
+ }, 8, ["size"])) : createCommentVNode("", true)
4688
4304
  ]),
4689
4305
  key: "0"
4690
4306
  } : void 0
4691
4307
  ]), 1032, ["modelValue", "size", "placeholder", "disabled"]),
4692
4308
  (openBlock(), createBlock(Teleport, { to: "body" }, [
4693
- popoverVisible.value ? (openBlock(), createElementBlock(
4694
- "div",
4695
- {
4696
- key: 0,
4697
- class: "tmagic-form-text-popper m-form-item__content",
4698
- ref_key: "popoverEl",
4699
- ref: popoverEl
4700
- },
4701
- [
4702
- _cache[5] || (_cache[5] = createElementVNode(
4703
- "div",
4704
- { class: "m-form-validate__warning" },
4705
- "输入内容前后有空格,是否移除空格?",
4706
- -1
4707
- /* HOISTED */
4708
- )),
4709
- createElementVNode("div", _hoisted_2, [
4710
- createVNode(unref(TMagicButton), {
4711
- link: "",
4712
- size: "small",
4713
- onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
4714
- }, {
4715
- default: withCtx(() => _cache[3] || (_cache[3] = [
4716
- createTextVNode("保持原样")
4717
- ])),
4718
- _: 1
4719
- /* STABLE */
4720
- }),
4721
- createVNode(unref(TMagicButton), {
4722
- type: "primary",
4723
- size: "small",
4724
- onClick: confirmTrimHandler
4725
- }, {
4726
- default: withCtx(() => _cache[4] || (_cache[4] = [
4727
- createTextVNode("移除空格")
4728
- ])),
4729
- _: 1
4730
- /* STABLE */
4731
- })
4732
- ]),
4733
- _cache[6] || (_cache[6] = createElementVNode(
4734
- "span",
4735
- {
4736
- class: "tmagic-form-text-popper-arrow",
4737
- "data-popper-arrow": ""
4738
- },
4739
- null,
4740
- -1
4741
- /* HOISTED */
4742
- ))
4743
- ],
4744
- 512
4745
- /* NEED_PATCH */
4746
- )) : createCommentVNode("v-if", true)
4309
+ popoverVisible.value ? (openBlock(), createElementBlock("div", {
4310
+ key: 0,
4311
+ class: "tmagic-form-text-popper m-form-item__content",
4312
+ ref_key: "popoverEl",
4313
+ ref: popoverEl
4314
+ }, [
4315
+ _cache[5] || (_cache[5] = createElementVNode("div", { class: "m-form-validate__warning" }, "输入内容前后有空格,是否移除空格?", -1)),
4316
+ createElementVNode("div", _hoisted_2, [
4317
+ createVNode(unref(TMagicButton), {
4318
+ link: "",
4319
+ size: "small",
4320
+ onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
4321
+ }, {
4322
+ default: withCtx(() => _cache[3] || (_cache[3] = [
4323
+ createTextVNode("保持原样")
4324
+ ])),
4325
+ _: 1
4326
+ }),
4327
+ createVNode(unref(TMagicButton), {
4328
+ type: "primary",
4329
+ size: "small",
4330
+ onClick: confirmTrimHandler
4331
+ }, {
4332
+ default: withCtx(() => _cache[4] || (_cache[4] = [
4333
+ createTextVNode("移除空格")
4334
+ ])),
4335
+ _: 1
4336
+ })
4337
+ ]),
4338
+ _cache[6] || (_cache[6] = createElementVNode("span", {
4339
+ class: "tmagic-form-text-popper-arrow",
4340
+ "data-popper-arrow": ""
4341
+ }, null, -1))
4342
+ ], 512)) : createCommentVNode("", true)
4747
4343
  ]))
4748
4344
  ]);
4749
4345
  };
@@ -5020,7 +4616,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5020
4616
  ])
5021
4617
  ]),
5022
4618
  _: 3
5023
- /* FORWARDED */
5024
4619
  }),
5025
4620
  createVNode(unref(TMagicCol), { span: 12 }, {
5026
4621
  default: withCtx(() => [
@@ -5030,7 +4625,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5030
4625
  createTextVNode("关闭")
5031
4626
  ])),
5032
4627
  _: 1
5033
- /* STABLE */
5034
4628
  }),
5035
4629
  createVNode(unref(TMagicButton), {
5036
4630
  type: "primary",
@@ -5039,57 +4633,43 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5039
4633
  onClick: submitHandler
5040
4634
  }, {
5041
4635
  default: withCtx(() => [
5042
- createTextVNode(
5043
- toDisplayString(_ctx.confirmText),
5044
- 1
5045
- /* TEXT */
5046
- )
4636
+ createTextVNode(toDisplayString(_ctx.confirmText), 1)
5047
4637
  ]),
5048
4638
  _: 1
5049
- /* STABLE */
5050
4639
  }, 8, ["disabled", "loading"])
5051
4640
  ])
5052
4641
  ]),
5053
4642
  _: 3
5054
- /* FORWARDED */
5055
4643
  })
5056
4644
  ]),
5057
4645
  _: 3
5058
- /* FORWARDED */
5059
4646
  })
5060
4647
  ]),
5061
4648
  default: withCtx(() => [
5062
- visible.value ? (openBlock(), createElementBlock(
5063
- "div",
5064
- {
5065
- key: 0,
5066
- ref_key: "drawerBody",
5067
- ref: drawerBody,
5068
- class: "m-drawer-body"
5069
- },
5070
- [
5071
- createVNode(_sfc_main$d, {
5072
- ref_key: "form",
5073
- ref: form,
5074
- size: _ctx.size,
5075
- disabled: _ctx.disabled,
5076
- config: _ctx.config,
5077
- "init-values": _ctx.values,
5078
- "parent-values": _ctx.parentValues,
5079
- "label-width": _ctx.labelWidth,
5080
- "label-position": _ctx.labelPosition,
5081
- inline: _ctx.inline,
5082
- "prevent-submit-default": _ctx.preventSubmitDefault,
5083
- onChange: changeHandler
5084
- }, null, 8, ["size", "disabled", "config", "init-values", "parent-values", "label-width", "label-position", "inline", "prevent-submit-default"]),
5085
- renderSlot(_ctx.$slots, "default")
5086
- ],
5087
- 512
5088
- /* NEED_PATCH */
5089
- )) : createCommentVNode("v-if", true)
4649
+ visible.value ? (openBlock(), createElementBlock("div", {
4650
+ key: 0,
4651
+ ref_key: "drawerBody",
4652
+ ref: drawerBody,
4653
+ class: "m-drawer-body"
4654
+ }, [
4655
+ createVNode(_sfc_main$d, {
4656
+ ref_key: "form",
4657
+ ref: form,
4658
+ size: _ctx.size,
4659
+ disabled: _ctx.disabled,
4660
+ config: _ctx.config,
4661
+ "init-values": _ctx.values,
4662
+ "parent-values": _ctx.parentValues,
4663
+ "label-width": _ctx.labelWidth,
4664
+ "label-position": _ctx.labelPosition,
4665
+ inline: _ctx.inline,
4666
+ "prevent-submit-default": _ctx.preventSubmitDefault,
4667
+ onChange: changeHandler
4668
+ }, null, 8, ["size", "disabled", "config", "init-values", "parent-values", "label-width", "label-position", "inline", "prevent-submit-default"]),
4669
+ renderSlot(_ctx.$slots, "default")
4670
+ ], 512)) : createCommentVNode("", true)
5090
4671
  ]),
5091
4672
  _: 3
5092
- /* FORWARDED */
5093
4673
  }, 8, ["modelValue", "title", "close-on-press-escape", "size", "zIndex", "before-close"]);
5094
4674
  };
5095
4675
  }
@@ -5160,84 +4740,60 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
5160
4740
  hide
5161
4741
  });
5162
4742
  return (_ctx, _cache) => {
5163
- return openBlock(), createElementBlock(
5164
- "div",
5165
- {
5166
- class: "m-form-box",
5167
- style: normalizeStyle(style.value)
5168
- },
5169
- [
5170
- createElementVNode(
5171
- "div",
5172
- {
5173
- class: "m-box-body",
5174
- style: normalizeStyle(bodyHeight.value ? { height: `${bodyHeight.value}px` } : {})
5175
- },
5176
- [
5177
- createVNode(unref(TMagicScrollbar), null, {
4743
+ return openBlock(), createElementBlock("div", {
4744
+ class: "m-form-box",
4745
+ style: normalizeStyle(style.value)
4746
+ }, [
4747
+ createElementVNode("div", {
4748
+ class: "m-box-body",
4749
+ style: normalizeStyle(bodyHeight.value ? { height: `${bodyHeight.value}px` } : {})
4750
+ }, [
4751
+ createVNode(unref(TMagicScrollbar), null, {
4752
+ default: withCtx(() => [
4753
+ createVNode(_sfc_main$d, {
4754
+ ref_key: "form",
4755
+ ref: form,
4756
+ size: _ctx.size,
4757
+ disabled: _ctx.disabled,
4758
+ config: _ctx.config,
4759
+ "init-values": _ctx.values,
4760
+ "parent-values": _ctx.parentValues,
4761
+ "label-width": _ctx.labelWidth,
4762
+ "label-position": _ctx.labelPosition,
4763
+ inline: _ctx.inline,
4764
+ "prevent-submit-default": _ctx.preventSubmitDefault,
4765
+ onChange: changeHandler
4766
+ }, null, 8, ["size", "disabled", "config", "init-values", "parent-values", "label-width", "label-position", "inline", "prevent-submit-default"]),
4767
+ renderSlot(_ctx.$slots, "default")
4768
+ ]),
4769
+ _: 3
4770
+ })
4771
+ ], 4),
4772
+ createElementVNode("div", {
4773
+ class: "dialog-footer",
4774
+ style: normalizeStyle(`height: ${footerHeight}px`)
4775
+ }, [
4776
+ createElementVNode("div", null, [
4777
+ renderSlot(_ctx.$slots, "left")
4778
+ ]),
4779
+ createElementVNode("div", null, [
4780
+ renderSlot(_ctx.$slots, "footer", {}, () => [
4781
+ createVNode(unref(TMagicButton), {
4782
+ type: "primary",
4783
+ size: _ctx.size,
4784
+ disabled: _ctx.disabled,
4785
+ loading: saveFetch.value,
4786
+ onClick: submitHandler
4787
+ }, {
5178
4788
  default: withCtx(() => [
5179
- createVNode(_sfc_main$d, {
5180
- ref_key: "form",
5181
- ref: form,
5182
- size: _ctx.size,
5183
- disabled: _ctx.disabled,
5184
- config: _ctx.config,
5185
- "init-values": _ctx.values,
5186
- "parent-values": _ctx.parentValues,
5187
- "label-width": _ctx.labelWidth,
5188
- "label-position": _ctx.labelPosition,
5189
- inline: _ctx.inline,
5190
- "prevent-submit-default": _ctx.preventSubmitDefault,
5191
- onChange: changeHandler
5192
- }, null, 8, ["size", "disabled", "config", "init-values", "parent-values", "label-width", "label-position", "inline", "prevent-submit-default"]),
5193
- renderSlot(_ctx.$slots, "default")
4789
+ createTextVNode(toDisplayString(_ctx.confirmText), 1)
5194
4790
  ]),
5195
- _: 3
5196
- /* FORWARDED */
5197
- })
5198
- ],
5199
- 4
5200
- /* STYLE */
5201
- ),
5202
- createElementVNode(
5203
- "div",
5204
- {
5205
- class: "dialog-footer",
5206
- style: normalizeStyle(`height: ${footerHeight}px`)
5207
- },
5208
- [
5209
- createElementVNode("div", null, [
5210
- renderSlot(_ctx.$slots, "left")
5211
- ]),
5212
- createElementVNode("div", null, [
5213
- renderSlot(_ctx.$slots, "footer", {}, () => [
5214
- createVNode(unref(TMagicButton), {
5215
- type: "primary",
5216
- size: _ctx.size,
5217
- disabled: _ctx.disabled,
5218
- loading: saveFetch.value,
5219
- onClick: submitHandler
5220
- }, {
5221
- default: withCtx(() => [
5222
- createTextVNode(
5223
- toDisplayString(_ctx.confirmText),
5224
- 1
5225
- /* TEXT */
5226
- )
5227
- ]),
5228
- _: 1
5229
- /* STABLE */
5230
- }, 8, ["size", "disabled", "loading"])
5231
- ])
5232
- ])
5233
- ],
5234
- 4
5235
- /* STYLE */
5236
- )
5237
- ],
5238
- 4
5239
- /* STYLE */
5240
- );
4791
+ _: 1
4792
+ }, 8, ["size", "disabled", "loading"])
4793
+ ])
4794
+ ])
4795
+ ], 4)
4796
+ ], 4);
5241
4797
  };
5242
4798
  }
5243
4799
  });