@tmagic/form 1.3.5 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/LICENSE +5432 -0
  2. package/dist/style.css +2 -10
  3. package/dist/tmagic-form.js +280 -270
  4. package/dist/tmagic-form.js.map +1 -1
  5. package/dist/tmagic-form.umd.cjs +279 -269
  6. package/dist/tmagic-form.umd.cjs.map +1 -1
  7. package/package.json +15 -15
  8. package/src/containers/Container.vue +2 -0
  9. package/src/containers/Table.vue +168 -166
  10. package/src/fields/Cascader.vue +6 -2
  11. package/src/fields/Select.vue +5 -3
  12. package/src/theme/table.scss +4 -11
  13. package/types/Form.vue.d.ts +5 -1
  14. package/types/FormBox.vue.d.ts +14 -6
  15. package/types/FormDialog.vue.d.ts +15 -6
  16. package/types/FormDrawer.vue.d.ts +18 -6
  17. package/types/containers/Col.vue.d.ts +4 -1
  18. package/types/containers/Container.vue.d.ts +4 -1
  19. package/types/containers/Fieldset.vue.d.ts +4 -1
  20. package/types/containers/GroupList.vue.d.ts +4 -1
  21. package/types/containers/GroupListItem.vue.d.ts +6 -1
  22. package/types/containers/Panel.vue.d.ts +4 -1
  23. package/types/containers/Row.vue.d.ts +4 -1
  24. package/types/containers/Step.vue.d.ts +4 -1
  25. package/types/containers/Table.vue.d.ts +8 -4
  26. package/types/containers/Tabs.vue.d.ts +4 -1
  27. package/types/fields/Cascader.vue.d.ts +3 -1
  28. package/types/fields/Checkbox.vue.d.ts +3 -1
  29. package/types/fields/CheckboxGroup.vue.d.ts +3 -1
  30. package/types/fields/ColorPicker.vue.d.ts +5 -1
  31. package/types/fields/Date.vue.d.ts +5 -1
  32. package/types/fields/DateTime.vue.d.ts +5 -1
  33. package/types/fields/Daterange.vue.d.ts +3 -1
  34. package/types/fields/DynamicField.vue.d.ts +3 -1
  35. package/types/fields/Link.vue.d.ts +3 -1
  36. package/types/fields/Number.vue.d.ts +7 -1
  37. package/types/fields/NumberRange.vue.d.ts +5 -1
  38. package/types/fields/RadioGroup.vue.d.ts +3 -1
  39. package/types/fields/Select.vue.d.ts +3 -1
  40. package/types/fields/Switch.vue.d.ts +5 -1
  41. package/types/fields/Text.vue.d.ts +7 -1
  42. package/types/fields/Textarea.vue.d.ts +7 -1
  43. package/types/fields/Time.vue.d.ts +5 -1
  44. package/types/fields/Timerange.vue.d.ts +3 -1
@@ -165,7 +165,7 @@
165
165
  return valuesTmp || {};
166
166
  };
167
167
 
168
- const _hoisted_1$e = ["innerHTML"];
168
+ const _hoisted_1$e = ["id", "data-magic-id"];
169
169
  const _hoisted_2$8 = ["innerHTML"];
170
170
  const _hoisted_3$4 = ["innerHTML"];
171
171
  const _hoisted_4$4 = ["innerHTML"];
@@ -177,7 +177,8 @@
177
177
  const _hoisted_10 = ["innerHTML"];
178
178
  const _hoisted_11 = ["innerHTML"];
179
179
  const _hoisted_12 = ["innerHTML"];
180
- const _hoisted_13 = {
180
+ const _hoisted_13 = ["innerHTML"];
181
+ const _hoisted_14 = {
181
182
  key: 5,
182
183
  style: { "text-align": "center" }
183
184
  };
@@ -330,6 +331,8 @@
330
331
  const _component_Container = vue.resolveComponent("Container", true);
331
332
  return _ctx.config ? (vue.openBlock(), vue.createElementBlock("div", {
332
333
  key: 0,
334
+ id: _ctx.config.id,
335
+ "data-magic-id": _ctx.config.id,
333
336
  style: vue.normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
334
337
  class: vue.normalizeClass(`m-form-container m-container-${type.value || ""} ${_ctx.config.className || ""}`)
335
338
  }, [
@@ -366,12 +369,12 @@
366
369
  label: vue.withCtx(() => [
367
370
  vue.createElementVNode("span", {
368
371
  innerHTML: type.value === "checkbox" ? "" : text.value
369
- }, null, 8, _hoisted_1$e)
372
+ }, null, 8, _hoisted_2$8)
370
373
  ]),
371
374
  default: vue.withCtx(() => [
372
375
  tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
373
376
  content: vue.withCtx(() => [
374
- vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_2$8)
377
+ vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_3$4)
375
378
  ]),
376
379
  default: vue.withCtx(() => [
377
380
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
@@ -404,7 +407,7 @@
404
407
  key: 2,
405
408
  innerHTML: extra.value,
406
409
  class: "m-form-tip"
407
- }, null, 8, _hoisted_3$4)) : vue.createCommentVNode("", true)
410
+ }, null, 8, _hoisted_4$4)) : vue.createCommentVNode("", true)
408
411
  ]),
409
412
  _: 1
410
413
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
@@ -415,7 +418,7 @@
415
418
  content: vue.withCtx(() => [
416
419
  vue.createElementVNode("div", {
417
420
  innerHTML: _ctx.config.tip
418
- }, null, 8, _hoisted_4$4)
421
+ }, null, 8, _hoisted_5$4)
419
422
  ]),
420
423
  default: vue.withCtx(() => [
421
424
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -438,12 +441,12 @@
438
441
  label: vue.withCtx(() => [
439
442
  vue.createElementVNode("span", {
440
443
  innerHTML: type.value === "checkbox" ? "" : text.value
441
- }, null, 8, _hoisted_5$4)
444
+ }, null, 8, _hoisted_6$1)
442
445
  ]),
443
446
  default: vue.withCtx(() => [
444
447
  tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
445
448
  content: vue.withCtx(() => [
446
- vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_6$1)
449
+ vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_7$1)
447
450
  ]),
448
451
  default: vue.withCtx(() => [
449
452
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
@@ -472,7 +475,7 @@
472
475
  key: 2,
473
476
  innerHTML: extra.value,
474
477
  class: "m-form-tip"
475
- }, null, 8, _hoisted_7$1)) : vue.createCommentVNode("", true)
478
+ }, null, 8, _hoisted_8$1)) : vue.createCommentVNode("", true)
476
479
  ]),
477
480
  _: 1
478
481
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
@@ -483,7 +486,7 @@
483
486
  content: vue.withCtx(() => [
484
487
  vue.createElementVNode("div", {
485
488
  innerHTML: _ctx.config.tip
486
- }, null, 8, _hoisted_8$1)
489
+ }, null, 8, _hoisted_9)
487
490
  ]),
488
491
  default: vue.withCtx(() => [
489
492
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -505,12 +508,12 @@
505
508
  label: vue.withCtx(() => [
506
509
  vue.createElementVNode("span", {
507
510
  innerHTML: type.value === "checkbox" ? "" : text.value
508
- }, null, 8, _hoisted_9)
511
+ }, null, 8, _hoisted_10)
509
512
  ]),
510
513
  default: vue.withCtx(() => [
511
514
  tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
512
515
  content: vue.withCtx(() => [
513
- vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_10)
516
+ vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_11)
514
517
  ]),
515
518
  default: vue.withCtx(() => [
516
519
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
@@ -539,7 +542,7 @@
539
542
  key: 2,
540
543
  innerHTML: extra.value,
541
544
  class: "m-form-tip"
542
- }, null, 8, _hoisted_11)) : vue.createCommentVNode("", true)
545
+ }, null, 8, _hoisted_12)) : vue.createCommentVNode("", true)
543
546
  ]),
544
547
  _: 1
545
548
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
@@ -550,7 +553,7 @@
550
553
  content: vue.withCtx(() => [
551
554
  vue.createElementVNode("div", {
552
555
  innerHTML: _ctx.config.tip
553
- }, null, 8, _hoisted_12)
556
+ }, null, 8, _hoisted_13)
554
557
  ]),
555
558
  default: vue.withCtx(() => [
556
559
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -581,7 +584,7 @@
581
584
  }, null, 8, ["model", "last-values", "is-compare", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
582
585
  }), 128)) : vue.createCommentVNode("", true)
583
586
  ], 64)) : vue.createCommentVNode("", true),
584
- _ctx.config.expand && type.value !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
587
+ _ctx.config.expand && type.value !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
585
588
  vue.createVNode(vue.unref(design.TMagicButton), {
586
589
  type: "primary",
587
590
  size: "small",
@@ -595,7 +598,7 @@
595
598
  _: 1
596
599
  })
597
600
  ])) : vue.createCommentVNode("", true)
598
- ], 6)) : vue.createCommentVNode("", true);
601
+ ], 14, _hoisted_1$e)) : vue.createCommentVNode("", true);
599
602
  };
600
603
  }
601
604
  });
@@ -1678,267 +1681,272 @@
1678
1681
  toggleRowSelection
1679
1682
  });
1680
1683
  return (_ctx, _cache) => {
1681
- return vue.openBlock(), vue.createElementBlock("div", {
1682
- ref_key: "mTable",
1683
- ref: mTable,
1684
- class: vue.normalizeClass(["m-fields-table", { "m-fields-table-item-extra": _ctx.config.itemExtra }])
1684
+ return vue.openBlock(), vue.createBlock(vue.Teleport, {
1685
+ to: "body",
1686
+ disabled: !isFullscreen.value
1685
1687
  }, [
1686
- _ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
1687
- key: 0,
1688
- style: { "color": "rgba(0, 0, 0, 0.45)" },
1689
- innerHTML: _ctx.config.extra
1690
- }, null, 8, _hoisted_1$9)) : vue.createCommentVNode("", true),
1691
- vue.createVNode(vue.unref(design.TMagicTooltip), {
1692
- content: "拖拽可排序",
1693
- placement: "left-start",
1694
- disabled: _ctx.config.dropSort !== true
1695
- }, {
1696
- default: vue.withCtx(() => [
1697
- _ctx.model[modelName.value] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTable), {
1698
- ref_key: "tMagicTable",
1699
- ref: tMagicTable,
1700
- style: { "width": "100%" },
1701
- "row-key": _ctx.config.rowKey || "id",
1702
- data: data.value,
1703
- lastData: lastData.value,
1704
- border: _ctx.config.border,
1705
- "max-height": _ctx.config.maxHeight,
1706
- "default-expand-all": true,
1707
- key: updateKey.value,
1708
- onSelect: selectHandle,
1709
- onSortChange: sortChange
1710
- }, {
1711
- default: vue.withCtx(() => [
1712
- _ctx.config.itemExtra ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1713
- key: 0,
1714
- fixed: "left",
1715
- width: "30",
1716
- type: "expand"
1717
- }, {
1718
- default: vue.withCtx((scope) => [
1719
- vue.createElementVNode("span", {
1720
- innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
1721
- class: "m-form-tip"
1722
- }, null, 8, _hoisted_2$3)
1723
- ]),
1724
- _: 1
1725
- })) : vue.createCommentVNode("", true),
1726
- vue.createVNode(vue.unref(design.TMagicTableColumn), {
1727
- label: "操作",
1728
- width: _ctx.config.operateColWidth || 55,
1729
- align: "center",
1730
- fixed: _ctx.config.fixed === false ? void 0 : "left"
1731
- }, {
1732
- default: vue.withCtx((scope) => [
1733
- vue.renderSlot(_ctx.$slots, "operateCol", { scope }),
1734
- vue.withDirectives(vue.createVNode(vue.unref(design.TMagicIcon), {
1735
- class: "m-table-delete-icon",
1736
- onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1737
- }, {
1738
- default: vue.withCtx(() => [
1739
- vue.createVNode(vue.unref(iconsVue.Delete))
1740
- ]),
1741
- _: 2
1742
- }, 1032, ["onClick"]), [
1743
- [vue.vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
1744
- ])
1745
- ]),
1746
- _: 3
1747
- }, 8, ["width", "fixed"]),
1748
- _ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1749
- key: 1,
1750
- label: "排序",
1751
- width: "60"
1752
- }, {
1753
- default: vue.withCtx((scope) => [
1754
- scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1755
- key: 0,
1756
- content: "点击上移,双击置顶",
1757
- placement: "top"
1758
- }, {
1759
- default: vue.withCtx(() => [
1760
- vue.createVNode(vue.unref(design.TMagicButton), {
1761
- plain: "",
1762
- size: "small",
1763
- type: "primary",
1764
- icon: vue.unref(iconsVue.ArrowUp),
1765
- disabled: _ctx.disabled,
1766
- text: "",
1767
- onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1768
- onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1769
- }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1770
- ]),
1771
- _: 2
1772
- }, 1024)) : vue.createCommentVNode("", true),
1773
- scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1774
- key: 1,
1775
- content: "点击下移,双击置底",
1776
- placement: "top"
1777
- }, {
1778
- default: vue.withCtx(() => [
1779
- vue.createVNode(vue.unref(design.TMagicButton), {
1780
- plain: "",
1781
- size: "small",
1782
- type: "primary",
1783
- icon: vue.unref(iconsVue.ArrowDown),
1784
- disabled: _ctx.disabled,
1785
- text: "",
1786
- onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1787
- onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1788
- }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1789
- ]),
1790
- _: 2
1791
- }, 1024)) : vue.createCommentVNode("", true)
1792
- ]),
1793
- _: 1
1794
- })) : vue.createCommentVNode("", true),
1795
- selection.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1796
- key: 2,
1797
- align: "center",
1798
- "header-align": "center",
1799
- type: "selection",
1800
- width: "45"
1801
- })) : vue.createCommentVNode("", true),
1802
- _ctx.showIndex && _ctx.config.showIndex ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1803
- key: 3,
1804
- width: "60",
1805
- label: "序号"
1806
- }, {
1807
- default: vue.withCtx((scope) => [
1808
- vue.createTextVNode(vue.toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
1809
- ]),
1810
- _: 1
1811
- })) : vue.createCommentVNode("", true),
1812
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (column, index) => {
1813
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1814
- column.type !== "hidden" && display$1(column.display) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1815
- prop: column.name,
1816
- width: column.width,
1817
- label: column.label,
1818
- sortable: column.sortable,
1819
- "sort-orders": ["ascending", "descending"],
1820
- key: column[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1821
- "class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
1822
- }, {
1823
- default: vue.withCtx((scope) => [
1824
- scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
1825
- key: 0,
1826
- labelWidth: "0",
1827
- disabled: _ctx.disabled,
1828
- prop: getProp(scope.$index),
1829
- rules: column.rules,
1830
- config: makeConfig(column, scope.row),
1831
- model: scope.row,
1832
- lastValues: lastData.value[scope.$index],
1833
- "is-compare": _ctx.isCompare,
1834
- size: _ctx.size,
1835
- onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", _ctx.model[modelName.value])),
1836
- onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1837
- }, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : vue.createCommentVNode("", true)
1838
- ]),
1839
- _: 2
1840
- }, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
1841
- ], 64);
1842
- }), 256))
1843
- ]),
1844
- _: 3
1845
- }, 8, ["row-key", "data", "lastData", "border", "max-height"])) : vue.createCommentVNode("", true)
1846
- ]),
1847
- _: 3
1848
- }, 8, ["disabled"]),
1849
- vue.renderSlot(_ctx.$slots, "default"),
1850
- vue.createElementVNode("div", _hoisted_3, [
1851
- addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1688
+ vue.createElementVNode("div", {
1689
+ ref_key: "mTable",
1690
+ ref: mTable,
1691
+ class: vue.normalizeClass(["m-fields-table", { "m-fields-table-item-extra": _ctx.config.itemExtra }])
1692
+ }, [
1693
+ _ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
1852
1694
  key: 0,
1853
- size: "small",
1854
- type: "primary",
1855
- disabled: _ctx.disabled,
1856
- plain: "",
1857
- onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
1695
+ style: { "color": "rgba(0, 0, 0, 0.45)" },
1696
+ innerHTML: _ctx.config.extra
1697
+ }, null, 8, _hoisted_1$9)) : vue.createCommentVNode("", true),
1698
+ vue.createVNode(vue.unref(design.TMagicTooltip), {
1699
+ content: "拖拽可排序",
1700
+ placement: "left-start",
1701
+ disabled: _ctx.config.dropSort !== true
1858
1702
  }, {
1859
1703
  default: vue.withCtx(() => [
1860
- vue.createTextVNode("新增一行")
1704
+ _ctx.model[modelName.value] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTable), {
1705
+ ref_key: "tMagicTable",
1706
+ ref: tMagicTable,
1707
+ style: { "width": "100%" },
1708
+ "row-key": _ctx.config.rowKey || "id",
1709
+ data: data.value,
1710
+ lastData: lastData.value,
1711
+ border: _ctx.config.border,
1712
+ "max-height": _ctx.config.maxHeight,
1713
+ "default-expand-all": true,
1714
+ key: updateKey.value,
1715
+ onSelect: selectHandle,
1716
+ onSortChange: sortChange
1717
+ }, {
1718
+ default: vue.withCtx(() => [
1719
+ _ctx.config.itemExtra ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1720
+ key: 0,
1721
+ fixed: "left",
1722
+ width: "30",
1723
+ type: "expand"
1724
+ }, {
1725
+ default: vue.withCtx((scope) => [
1726
+ vue.createElementVNode("span", {
1727
+ innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
1728
+ class: "m-form-tip"
1729
+ }, null, 8, _hoisted_2$3)
1730
+ ]),
1731
+ _: 1
1732
+ })) : vue.createCommentVNode("", true),
1733
+ vue.createVNode(vue.unref(design.TMagicTableColumn), {
1734
+ label: "操作",
1735
+ width: _ctx.config.operateColWidth || 55,
1736
+ align: "center",
1737
+ fixed: _ctx.config.fixed === false ? void 0 : "left"
1738
+ }, {
1739
+ default: vue.withCtx((scope) => [
1740
+ vue.renderSlot(_ctx.$slots, "operateCol", { scope }),
1741
+ vue.withDirectives(vue.createVNode(vue.unref(design.TMagicIcon), {
1742
+ class: "m-table-delete-icon",
1743
+ onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1744
+ }, {
1745
+ default: vue.withCtx(() => [
1746
+ vue.createVNode(vue.unref(iconsVue.Delete))
1747
+ ]),
1748
+ _: 2
1749
+ }, 1032, ["onClick"]), [
1750
+ [vue.vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
1751
+ ])
1752
+ ]),
1753
+ _: 3
1754
+ }, 8, ["width", "fixed"]),
1755
+ _ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1756
+ key: 1,
1757
+ label: "排序",
1758
+ width: "60"
1759
+ }, {
1760
+ default: vue.withCtx((scope) => [
1761
+ scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1762
+ key: 0,
1763
+ content: "点击上移,双击置顶",
1764
+ placement: "top"
1765
+ }, {
1766
+ default: vue.withCtx(() => [
1767
+ vue.createVNode(vue.unref(design.TMagicButton), {
1768
+ plain: "",
1769
+ size: "small",
1770
+ type: "primary",
1771
+ icon: vue.unref(iconsVue.ArrowUp),
1772
+ disabled: _ctx.disabled,
1773
+ text: "",
1774
+ onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1775
+ onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1776
+ }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1777
+ ]),
1778
+ _: 2
1779
+ }, 1024)) : vue.createCommentVNode("", true),
1780
+ scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1781
+ key: 1,
1782
+ content: "点击下移,双击置底",
1783
+ placement: "top"
1784
+ }, {
1785
+ default: vue.withCtx(() => [
1786
+ vue.createVNode(vue.unref(design.TMagicButton), {
1787
+ plain: "",
1788
+ size: "small",
1789
+ type: "primary",
1790
+ icon: vue.unref(iconsVue.ArrowDown),
1791
+ disabled: _ctx.disabled,
1792
+ text: "",
1793
+ onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1794
+ onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1795
+ }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1796
+ ]),
1797
+ _: 2
1798
+ }, 1024)) : vue.createCommentVNode("", true)
1799
+ ]),
1800
+ _: 1
1801
+ })) : vue.createCommentVNode("", true),
1802
+ selection.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1803
+ key: 2,
1804
+ align: "center",
1805
+ "header-align": "center",
1806
+ type: "selection",
1807
+ width: "45"
1808
+ })) : vue.createCommentVNode("", true),
1809
+ _ctx.showIndex && _ctx.config.showIndex ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1810
+ key: 3,
1811
+ width: "60",
1812
+ label: "序号"
1813
+ }, {
1814
+ default: vue.withCtx((scope) => [
1815
+ vue.createTextVNode(vue.toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
1816
+ ]),
1817
+ _: 1
1818
+ })) : vue.createCommentVNode("", true),
1819
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (column, index) => {
1820
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1821
+ column.type !== "hidden" && display$1(column.display) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
1822
+ prop: column.name,
1823
+ width: column.width,
1824
+ label: column.label,
1825
+ sortable: column.sortable,
1826
+ "sort-orders": ["ascending", "descending"],
1827
+ key: column[vue.unref(mForm)?.keyProp || "__key"] ?? index,
1828
+ "class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
1829
+ }, {
1830
+ default: vue.withCtx((scope) => [
1831
+ scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
1832
+ key: 0,
1833
+ labelWidth: "0",
1834
+ disabled: _ctx.disabled,
1835
+ prop: getProp(scope.$index),
1836
+ rules: column.rules,
1837
+ config: makeConfig(column, scope.row),
1838
+ model: scope.row,
1839
+ lastValues: lastData.value[scope.$index],
1840
+ "is-compare": _ctx.isCompare,
1841
+ size: _ctx.size,
1842
+ onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", _ctx.model[modelName.value])),
1843
+ onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1844
+ }, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : vue.createCommentVNode("", true)
1845
+ ]),
1846
+ _: 2
1847
+ }, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
1848
+ ], 64);
1849
+ }), 256))
1850
+ ]),
1851
+ _: 3
1852
+ }, 8, ["row-key", "data", "lastData", "border", "max-height"])) : vue.createCommentVNode("", true)
1861
1853
  ]),
1862
- _: 1
1863
- }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1864
- vue.createElementVNode("div", _hoisted_4, [
1865
- _ctx.enableToggleMode && _ctx.config.enableToggleMode !== false && !isFullscreen.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1854
+ _: 3
1855
+ }, 8, ["disabled"]),
1856
+ vue.renderSlot(_ctx.$slots, "default"),
1857
+ vue.createElementVNode("div", _hoisted_3, [
1858
+ addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1866
1859
  key: 0,
1867
- icon: vue.unref(iconsVue.Grid),
1868
- size: "small",
1869
- type: "primary",
1870
- onClick: toggleMode
1871
- }, {
1872
- default: vue.withCtx(() => [
1873
- vue.createTextVNode("展开配置")
1874
- ]),
1875
- _: 1
1876
- }, 8, ["icon"])) : vue.createCommentVNode("", true),
1877
- _ctx.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1878
- key: 1,
1879
- icon: vue.unref(iconsVue.FullScreen),
1880
1860
  size: "small",
1881
1861
  type: "primary",
1882
- onClick: toggleFullscreen
1883
- }, {
1884
- default: vue.withCtx(() => [
1885
- vue.createTextVNode(vue.toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
1886
- ]),
1887
- _: 1
1888
- }, 8, ["icon"])) : vue.createCommentVNode("", true),
1889
- importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
1890
- key: 2,
1891
- style: { "display": "inline-block" },
1892
- ref_key: "excelBtn",
1893
- ref: excelBtn,
1894
- action: "/noop",
1895
- disabled: _ctx.disabled,
1896
- "on-change": excelHandler,
1897
- "auto-upload": false
1898
- }, {
1899
- default: vue.withCtx(() => [
1900
- vue.createVNode(vue.unref(design.TMagicButton), {
1901
- size: "small",
1902
- type: "success",
1903
- disabled: _ctx.disabled,
1904
- plain: ""
1905
- }, {
1906
- default: vue.withCtx(() => [
1907
- vue.createTextVNode("导入EXCEL")
1908
- ]),
1909
- _: 1
1910
- }, 8, ["disabled"])
1911
- ]),
1912
- _: 1
1913
- }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1914
- importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1915
- key: 3,
1916
- size: "small",
1917
- type: "warning",
1918
1862
  disabled: _ctx.disabled,
1919
1863
  plain: "",
1920
- onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
1864
+ onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
1921
1865
  }, {
1922
1866
  default: vue.withCtx(() => [
1923
- vue.createTextVNode("清空")
1867
+ vue.createTextVNode("新增一行")
1924
1868
  ]),
1925
1869
  _: 1
1926
- }, 8, ["disabled"])) : vue.createCommentVNode("", true)
1927
- ])
1928
- ]),
1929
- _ctx.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
1930
- vue.createVNode(vue.unref(design.TMagicPagination), {
1931
- layout: "total, sizes, prev, pager, next, jumper",
1932
- "hide-on-single-page": _ctx.model[modelName.value].length < pagesize.value,
1933
- "current-page": pagecontext.value + 1,
1934
- "page-sizes": [pagesize.value, 60, 120, 300],
1935
- "page-size": pagesize.value,
1936
- total: _ctx.model[modelName.value].length,
1937
- onSizeChange: handleSizeChange,
1938
- onCurrentChange: handleCurrentChange
1939
- }, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
1940
- ])) : vue.createCommentVNode("", true)
1941
- ], 2);
1870
+ }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1871
+ vue.createElementVNode("div", _hoisted_4, [
1872
+ _ctx.enableToggleMode && _ctx.config.enableToggleMode !== false && !isFullscreen.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1873
+ key: 0,
1874
+ icon: vue.unref(iconsVue.Grid),
1875
+ size: "small",
1876
+ type: "primary",
1877
+ onClick: toggleMode
1878
+ }, {
1879
+ default: vue.withCtx(() => [
1880
+ vue.createTextVNode("展开配置")
1881
+ ]),
1882
+ _: 1
1883
+ }, 8, ["icon"])) : vue.createCommentVNode("", true),
1884
+ _ctx.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1885
+ key: 1,
1886
+ icon: vue.unref(iconsVue.FullScreen),
1887
+ size: "small",
1888
+ type: "primary",
1889
+ onClick: toggleFullscreen
1890
+ }, {
1891
+ default: vue.withCtx(() => [
1892
+ vue.createTextVNode(vue.toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
1893
+ ]),
1894
+ _: 1
1895
+ }, 8, ["icon"])) : vue.createCommentVNode("", true),
1896
+ importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
1897
+ key: 2,
1898
+ style: { "display": "inline-block" },
1899
+ ref_key: "excelBtn",
1900
+ ref: excelBtn,
1901
+ action: "/noop",
1902
+ disabled: _ctx.disabled,
1903
+ "on-change": excelHandler,
1904
+ "auto-upload": false
1905
+ }, {
1906
+ default: vue.withCtx(() => [
1907
+ vue.createVNode(vue.unref(design.TMagicButton), {
1908
+ size: "small",
1909
+ type: "success",
1910
+ disabled: _ctx.disabled,
1911
+ plain: ""
1912
+ }, {
1913
+ default: vue.withCtx(() => [
1914
+ vue.createTextVNode("导入EXCEL")
1915
+ ]),
1916
+ _: 1
1917
+ }, 8, ["disabled"])
1918
+ ]),
1919
+ _: 1
1920
+ }, 8, ["disabled"])) : vue.createCommentVNode("", true),
1921
+ importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1922
+ key: 3,
1923
+ size: "small",
1924
+ type: "warning",
1925
+ disabled: _ctx.disabled,
1926
+ plain: "",
1927
+ onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
1928
+ }, {
1929
+ default: vue.withCtx(() => [
1930
+ vue.createTextVNode("清空")
1931
+ ]),
1932
+ _: 1
1933
+ }, 8, ["disabled"])) : vue.createCommentVNode("", true)
1934
+ ])
1935
+ ]),
1936
+ _ctx.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
1937
+ vue.createVNode(vue.unref(design.TMagicPagination), {
1938
+ layout: "total, sizes, prev, pager, next, jumper",
1939
+ "hide-on-single-page": _ctx.model[modelName.value].length < pagesize.value,
1940
+ "current-page": pagecontext.value + 1,
1941
+ "page-sizes": [pagesize.value, 60, 120, 300],
1942
+ "page-size": pagesize.value,
1943
+ total: _ctx.model[modelName.value].length,
1944
+ onSizeChange: handleSizeChange,
1945
+ onCurrentChange: handleCurrentChange
1946
+ }, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
1947
+ ])) : vue.createCommentVNode("", true)
1948
+ ], 2)
1949
+ ], 8, ["disabled"]);
1942
1950
  };
1943
1951
  }
1944
1952
  });
@@ -2174,7 +2182,7 @@
2174
2182
  useAddField(props.prop);
2175
2183
  const requestFunc = getConfig("request");
2176
2184
  const tMagicCascader = vue.ref();
2177
- const options = Array.isArray(props.config.options) ? vue.ref(props.config.options) : vue.ref([]);
2185
+ const options = vue.ref([]);
2178
2186
  const remoteData = vue.ref(null);
2179
2187
  const setRemoteOptions = async function() {
2180
2188
  const { config } = props;
@@ -2211,6 +2219,10 @@
2211
2219
  );
2212
2220
  } else if (!props.config.options?.length || props.config.remote) {
2213
2221
  Promise.resolve(setRemoteOptions());
2222
+ } else if (Array.isArray(props.config.options)) {
2223
+ vue.watchEffect(() => {
2224
+ options.value = props.config.options;
2225
+ });
2214
2226
  }
2215
2227
  const changeHandler = (value) => {
2216
2228
  if (!tMagicCascader.value)
@@ -2231,7 +2243,7 @@
2231
2243
  size: _ctx.size,
2232
2244
  placeholder: _ctx.config.placeholder,
2233
2245
  disabled: _ctx.disabled,
2234
- options: vue.unref(options),
2246
+ options: options.value,
2235
2247
  props: {
2236
2248
  multiple: _ctx.config.multiple ?? false,
2237
2249
  emitPath: _ctx.config.emitPath ?? true,
@@ -3690,12 +3702,13 @@
3690
3702
  });
3691
3703
  }
3692
3704
  if (props.config.remote) {
3693
- const unWacth = vue.watch(
3705
+ const unWatch = vue.watch(
3694
3706
  () => tMagicSelect.value?.scrollbarWrap,
3695
3707
  (scrollbarWrap) => {
3696
3708
  if (!scrollbarWrap) {
3697
3709
  return;
3698
3710
  }
3711
+ vue.nextTick(() => unWatch());
3699
3712
  scrollbarWrap.addEventListener("scroll", async (e) => {
3700
3713
  const el = e.currentTarget;
3701
3714
  if (moreLoadingVisible.value) {
@@ -3712,7 +3725,6 @@
3712
3725
  options.value = await getOptions();
3713
3726
  moreLoadingVisible.value = false;
3714
3727
  });
3715
- unWacth();
3716
3728
  },
3717
3729
  {
3718
3730
  immediate: true
@@ -4139,8 +4151,6 @@
4139
4151
  }
4140
4152
  });
4141
4153
 
4142
- const index$1 = '';
4143
-
4144
4154
  const _hoisted_1$1 = { style: { "min-height": "1px" } };
4145
4155
  const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
4146
4156
  ...{