@tmagic/form 1.3.6 → 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.
package/dist/style.css CHANGED
@@ -124,22 +124,14 @@ fieldset.m-fieldset .m-form-tip {
124
124
  }
125
125
  .m-fields-table.fixed {
126
126
  position: fixed;
127
+ height: 100%;
128
+ overflow: auto;
127
129
  top: 0;
128
130
  right: 0;
129
131
  left: 0;
130
132
  bottom: 0;
131
133
  z-index: 100;
132
- }
133
- .m-fields-table.fixed::before {
134
- content: " ";
135
- display: block;
136
134
  background: rgba(0, 0, 0, 0.5);
137
- position: fixed;
138
- top: 0;
139
- right: 0;
140
- left: 0;
141
- bottom: 0;
142
- z-index: 100;
143
135
  }
144
136
  .m-fields-table.fixed > .el-form-item__content {
145
137
  z-index: 101;
@@ -1,4 +1,4 @@
1
- import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, watch, openBlock, createElementBlock, normalizeStyle, normalizeClass, createBlock, resolveDynamicComponent, Fragment, createVNode, unref, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, withDirectives, vShow, renderSlot, onMounted, toRefs, mergeProps, getCurrentInstance, reactive, onBeforeUnmount, vModelText, provide, onBeforeMount, resolveDirective, createSlots, withModifiers } from 'vue';
1
+ import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, watch, openBlock, createElementBlock, normalizeStyle, normalizeClass, createBlock, resolveDynamicComponent, Fragment, createVNode, unref, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, withDirectives, vShow, renderSlot, onMounted, Teleport, toRefs, mergeProps, getCurrentInstance, reactive, onBeforeUnmount, vModelText, provide, onBeforeMount, nextTick, resolveDirective, createSlots, withModifiers } from 'vue';
2
2
  import { WarningFilled, CaretBottom, CaretRight, Delete, CaretTop, Grid, ArrowUp, ArrowDown, FullScreen } from '@element-plus/icons-vue';
3
3
  import { cloneDeep, isEqual, isEmpty } from 'lodash-es';
4
4
  import { TMagicFormItem, TMagicTooltip, TMagicIcon, TMagicButton, TMagicCheckbox, TMagicCard, TMagicCol, TMagicRow, TMagicSteps, TMagicStep, TMagicTable, TMagicTableColumn, TMagicUpload, TMagicPagination, tMagicMessage, getConfig as getConfig$1, TMagicBadge, TMagicCascader, TMagicCheckboxGroup, TMagicColorPicker, TMagicDatePicker, TMagicForm, TMagicInput, TMagicDialog, TMagicInputNumber, TMagicRadioGroup, TMagicRadio, TMagicOptionGroup, TMagicOption, TMagicSelect, TMagicSwitch, TMagicTimePicker, TMagicDrawer } from '@tmagic/design';
@@ -166,7 +166,7 @@ const initValue = async (mForm, { initValues, config }) => {
166
166
  return valuesTmp || {};
167
167
  };
168
168
 
169
- const _hoisted_1$e = ["id"];
169
+ const _hoisted_1$e = ["id", "data-magic-id"];
170
170
  const _hoisted_2$8 = ["innerHTML"];
171
171
  const _hoisted_3$4 = ["innerHTML"];
172
172
  const _hoisted_4$4 = ["innerHTML"];
@@ -333,6 +333,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
333
333
  return _ctx.config ? (openBlock(), createElementBlock("div", {
334
334
  key: 0,
335
335
  id: _ctx.config.id,
336
+ "data-magic-id": _ctx.config.id,
336
337
  style: normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
337
338
  class: normalizeClass(`m-form-container m-container-${type.value || ""} ${_ctx.config.className || ""}`)
338
339
  }, [
@@ -1681,267 +1682,272 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1681
1682
  toggleRowSelection
1682
1683
  });
1683
1684
  return (_ctx, _cache) => {
1684
- return openBlock(), createElementBlock("div", {
1685
- ref_key: "mTable",
1686
- ref: mTable,
1687
- class: normalizeClass(["m-fields-table", { "m-fields-table-item-extra": _ctx.config.itemExtra }])
1685
+ return openBlock(), createBlock(Teleport, {
1686
+ to: "body",
1687
+ disabled: !isFullscreen.value
1688
1688
  }, [
1689
- _ctx.config.extra ? (openBlock(), createElementBlock("span", {
1690
- key: 0,
1691
- style: { "color": "rgba(0, 0, 0, 0.45)" },
1692
- innerHTML: _ctx.config.extra
1693
- }, null, 8, _hoisted_1$9)) : createCommentVNode("", true),
1694
- createVNode(unref(TMagicTooltip), {
1695
- content: "拖拽可排序",
1696
- placement: "left-start",
1697
- disabled: _ctx.config.dropSort !== true
1698
- }, {
1699
- default: withCtx(() => [
1700
- _ctx.model[modelName.value] ? (openBlock(), createBlock(unref(TMagicTable), {
1701
- ref_key: "tMagicTable",
1702
- ref: tMagicTable,
1703
- style: { "width": "100%" },
1704
- "row-key": _ctx.config.rowKey || "id",
1705
- data: data.value,
1706
- lastData: lastData.value,
1707
- border: _ctx.config.border,
1708
- "max-height": _ctx.config.maxHeight,
1709
- "default-expand-all": true,
1710
- key: updateKey.value,
1711
- onSelect: selectHandle,
1712
- onSortChange: sortChange
1713
- }, {
1714
- default: withCtx(() => [
1715
- _ctx.config.itemExtra ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1716
- key: 0,
1717
- fixed: "left",
1718
- width: "30",
1719
- type: "expand"
1720
- }, {
1721
- default: withCtx((scope) => [
1722
- createElementVNode("span", {
1723
- innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
1724
- class: "m-form-tip"
1725
- }, null, 8, _hoisted_2$3)
1726
- ]),
1727
- _: 1
1728
- })) : createCommentVNode("", true),
1729
- createVNode(unref(TMagicTableColumn), {
1730
- label: "操作",
1731
- width: _ctx.config.operateColWidth || 55,
1732
- align: "center",
1733
- fixed: _ctx.config.fixed === false ? void 0 : "left"
1734
- }, {
1735
- default: withCtx((scope) => [
1736
- renderSlot(_ctx.$slots, "operateCol", { scope }),
1737
- withDirectives(createVNode(unref(TMagicIcon), {
1738
- class: "m-table-delete-icon",
1739
- onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1740
- }, {
1741
- default: withCtx(() => [
1742
- createVNode(unref(Delete))
1743
- ]),
1744
- _: 2
1745
- }, 1032, ["onClick"]), [
1746
- [vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
1747
- ])
1748
- ]),
1749
- _: 3
1750
- }, 8, ["width", "fixed"]),
1751
- _ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1752
- key: 1,
1753
- label: "排序",
1754
- width: "60"
1755
- }, {
1756
- default: withCtx((scope) => [
1757
- scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (openBlock(), createBlock(unref(TMagicTooltip), {
1758
- key: 0,
1759
- content: "点击上移,双击置顶",
1760
- placement: "top"
1761
- }, {
1762
- default: withCtx(() => [
1763
- createVNode(unref(TMagicButton), {
1764
- plain: "",
1765
- size: "small",
1766
- type: "primary",
1767
- icon: unref(ArrowUp),
1768
- disabled: _ctx.disabled,
1769
- text: "",
1770
- onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1771
- onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1772
- }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1773
- ]),
1774
- _: 2
1775
- }, 1024)) : createCommentVNode("", true),
1776
- scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (openBlock(), createBlock(unref(TMagicTooltip), {
1777
- key: 1,
1778
- content: "点击下移,双击置底",
1779
- placement: "top"
1780
- }, {
1781
- default: withCtx(() => [
1782
- createVNode(unref(TMagicButton), {
1783
- plain: "",
1784
- size: "small",
1785
- type: "primary",
1786
- icon: unref(ArrowDown),
1787
- disabled: _ctx.disabled,
1788
- text: "",
1789
- onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1790
- onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1791
- }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1792
- ]),
1793
- _: 2
1794
- }, 1024)) : createCommentVNode("", true)
1795
- ]),
1796
- _: 1
1797
- })) : createCommentVNode("", true),
1798
- selection.value ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1799
- key: 2,
1800
- align: "center",
1801
- "header-align": "center",
1802
- type: "selection",
1803
- width: "45"
1804
- })) : createCommentVNode("", true),
1805
- _ctx.showIndex && _ctx.config.showIndex ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1806
- key: 3,
1807
- width: "60",
1808
- label: "序号"
1809
- }, {
1810
- default: withCtx((scope) => [
1811
- createTextVNode(toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
1812
- ]),
1813
- _: 1
1814
- })) : createCommentVNode("", true),
1815
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.items, (column, index) => {
1816
- return openBlock(), createElementBlock(Fragment, null, [
1817
- column.type !== "hidden" && display$1(column.display) ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1818
- prop: column.name,
1819
- width: column.width,
1820
- label: column.label,
1821
- sortable: column.sortable,
1822
- "sort-orders": ["ascending", "descending"],
1823
- key: column[unref(mForm)?.keyProp || "__key"] ?? index,
1824
- "class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
1825
- }, {
1826
- default: withCtx((scope) => [
1827
- scope.$index > -1 ? (openBlock(), createBlock(_sfc_main$z, {
1828
- key: 0,
1829
- labelWidth: "0",
1830
- disabled: _ctx.disabled,
1831
- prop: getProp(scope.$index),
1832
- rules: column.rules,
1833
- config: makeConfig(column, scope.row),
1834
- model: scope.row,
1835
- lastValues: lastData.value[scope.$index],
1836
- "is-compare": _ctx.isCompare,
1837
- size: _ctx.size,
1838
- onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", _ctx.model[modelName.value])),
1839
- onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1840
- }, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : createCommentVNode("", true)
1841
- ]),
1842
- _: 2
1843
- }, 1032, ["prop", "width", "label", "sortable", "class-name"])) : createCommentVNode("", true)
1844
- ], 64);
1845
- }), 256))
1846
- ]),
1847
- _: 3
1848
- }, 8, ["row-key", "data", "lastData", "border", "max-height"])) : createCommentVNode("", true)
1849
- ]),
1850
- _: 3
1851
- }, 8, ["disabled"]),
1852
- renderSlot(_ctx.$slots, "default"),
1853
- createElementVNode("div", _hoisted_3, [
1854
- addable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1689
+ createElementVNode("div", {
1690
+ ref_key: "mTable",
1691
+ ref: mTable,
1692
+ class: normalizeClass(["m-fields-table", { "m-fields-table-item-extra": _ctx.config.itemExtra }])
1693
+ }, [
1694
+ _ctx.config.extra ? (openBlock(), createElementBlock("span", {
1855
1695
  key: 0,
1856
- size: "small",
1857
- type: "primary",
1858
- disabled: _ctx.disabled,
1859
- plain: "",
1860
- onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
1696
+ style: { "color": "rgba(0, 0, 0, 0.45)" },
1697
+ innerHTML: _ctx.config.extra
1698
+ }, null, 8, _hoisted_1$9)) : createCommentVNode("", true),
1699
+ createVNode(unref(TMagicTooltip), {
1700
+ content: "拖拽可排序",
1701
+ placement: "left-start",
1702
+ disabled: _ctx.config.dropSort !== true
1861
1703
  }, {
1862
1704
  default: withCtx(() => [
1863
- createTextVNode("新增一行")
1705
+ _ctx.model[modelName.value] ? (openBlock(), createBlock(unref(TMagicTable), {
1706
+ ref_key: "tMagicTable",
1707
+ ref: tMagicTable,
1708
+ style: { "width": "100%" },
1709
+ "row-key": _ctx.config.rowKey || "id",
1710
+ data: data.value,
1711
+ lastData: lastData.value,
1712
+ border: _ctx.config.border,
1713
+ "max-height": _ctx.config.maxHeight,
1714
+ "default-expand-all": true,
1715
+ key: updateKey.value,
1716
+ onSelect: selectHandle,
1717
+ onSortChange: sortChange
1718
+ }, {
1719
+ default: withCtx(() => [
1720
+ _ctx.config.itemExtra ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1721
+ key: 0,
1722
+ fixed: "left",
1723
+ width: "30",
1724
+ type: "expand"
1725
+ }, {
1726
+ default: withCtx((scope) => [
1727
+ createElementVNode("span", {
1728
+ innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
1729
+ class: "m-form-tip"
1730
+ }, null, 8, _hoisted_2$3)
1731
+ ]),
1732
+ _: 1
1733
+ })) : createCommentVNode("", true),
1734
+ createVNode(unref(TMagicTableColumn), {
1735
+ label: "操作",
1736
+ width: _ctx.config.operateColWidth || 55,
1737
+ align: "center",
1738
+ fixed: _ctx.config.fixed === false ? void 0 : "left"
1739
+ }, {
1740
+ default: withCtx((scope) => [
1741
+ renderSlot(_ctx.$slots, "operateCol", { scope }),
1742
+ withDirectives(createVNode(unref(TMagicIcon), {
1743
+ class: "m-table-delete-icon",
1744
+ onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1745
+ }, {
1746
+ default: withCtx(() => [
1747
+ createVNode(unref(Delete))
1748
+ ]),
1749
+ _: 2
1750
+ }, 1032, ["onClick"]), [
1751
+ [vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
1752
+ ])
1753
+ ]),
1754
+ _: 3
1755
+ }, 8, ["width", "fixed"]),
1756
+ _ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1757
+ key: 1,
1758
+ label: "排序",
1759
+ width: "60"
1760
+ }, {
1761
+ default: withCtx((scope) => [
1762
+ scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (openBlock(), createBlock(unref(TMagicTooltip), {
1763
+ key: 0,
1764
+ content: "点击上移,双击置顶",
1765
+ placement: "top"
1766
+ }, {
1767
+ default: withCtx(() => [
1768
+ createVNode(unref(TMagicButton), {
1769
+ plain: "",
1770
+ size: "small",
1771
+ type: "primary",
1772
+ icon: unref(ArrowUp),
1773
+ disabled: _ctx.disabled,
1774
+ text: "",
1775
+ onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1776
+ onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1777
+ }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1778
+ ]),
1779
+ _: 2
1780
+ }, 1024)) : createCommentVNode("", true),
1781
+ scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (openBlock(), createBlock(unref(TMagicTooltip), {
1782
+ key: 1,
1783
+ content: "点击下移,双击置底",
1784
+ placement: "top"
1785
+ }, {
1786
+ default: withCtx(() => [
1787
+ createVNode(unref(TMagicButton), {
1788
+ plain: "",
1789
+ size: "small",
1790
+ type: "primary",
1791
+ icon: unref(ArrowDown),
1792
+ disabled: _ctx.disabled,
1793
+ text: "",
1794
+ onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
1795
+ onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
1796
+ }, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
1797
+ ]),
1798
+ _: 2
1799
+ }, 1024)) : createCommentVNode("", true)
1800
+ ]),
1801
+ _: 1
1802
+ })) : createCommentVNode("", true),
1803
+ selection.value ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1804
+ key: 2,
1805
+ align: "center",
1806
+ "header-align": "center",
1807
+ type: "selection",
1808
+ width: "45"
1809
+ })) : createCommentVNode("", true),
1810
+ _ctx.showIndex && _ctx.config.showIndex ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1811
+ key: 3,
1812
+ width: "60",
1813
+ label: "序号"
1814
+ }, {
1815
+ default: withCtx((scope) => [
1816
+ createTextVNode(toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
1817
+ ]),
1818
+ _: 1
1819
+ })) : createCommentVNode("", true),
1820
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.config.items, (column, index) => {
1821
+ return openBlock(), createElementBlock(Fragment, null, [
1822
+ column.type !== "hidden" && display$1(column.display) ? (openBlock(), createBlock(unref(TMagicTableColumn), {
1823
+ prop: column.name,
1824
+ width: column.width,
1825
+ label: column.label,
1826
+ sortable: column.sortable,
1827
+ "sort-orders": ["ascending", "descending"],
1828
+ key: column[unref(mForm)?.keyProp || "__key"] ?? index,
1829
+ "class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
1830
+ }, {
1831
+ default: withCtx((scope) => [
1832
+ scope.$index > -1 ? (openBlock(), createBlock(_sfc_main$z, {
1833
+ key: 0,
1834
+ labelWidth: "0",
1835
+ disabled: _ctx.disabled,
1836
+ prop: getProp(scope.$index),
1837
+ rules: column.rules,
1838
+ config: makeConfig(column, scope.row),
1839
+ model: scope.row,
1840
+ lastValues: lastData.value[scope.$index],
1841
+ "is-compare": _ctx.isCompare,
1842
+ size: _ctx.size,
1843
+ onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", _ctx.model[modelName.value])),
1844
+ onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
1845
+ }, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : createCommentVNode("", true)
1846
+ ]),
1847
+ _: 2
1848
+ }, 1032, ["prop", "width", "label", "sortable", "class-name"])) : createCommentVNode("", true)
1849
+ ], 64);
1850
+ }), 256))
1851
+ ]),
1852
+ _: 3
1853
+ }, 8, ["row-key", "data", "lastData", "border", "max-height"])) : createCommentVNode("", true)
1864
1854
  ]),
1865
- _: 1
1866
- }, 8, ["disabled"])) : createCommentVNode("", true),
1867
- createElementVNode("div", _hoisted_4, [
1868
- _ctx.enableToggleMode && _ctx.config.enableToggleMode !== false && !isFullscreen.value ? (openBlock(), createBlock(unref(TMagicButton), {
1855
+ _: 3
1856
+ }, 8, ["disabled"]),
1857
+ renderSlot(_ctx.$slots, "default"),
1858
+ createElementVNode("div", _hoisted_3, [
1859
+ addable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1869
1860
  key: 0,
1870
- icon: unref(Grid),
1871
1861
  size: "small",
1872
1862
  type: "primary",
1873
- onClick: toggleMode
1874
- }, {
1875
- default: withCtx(() => [
1876
- createTextVNode("展开配置")
1877
- ]),
1878
- _: 1
1879
- }, 8, ["icon"])) : createCommentVNode("", true),
1880
- _ctx.config.enableFullscreen !== false ? (openBlock(), createBlock(unref(TMagicButton), {
1881
- key: 1,
1882
- icon: unref(FullScreen),
1883
- size: "small",
1884
- type: "primary",
1885
- onClick: toggleFullscreen
1886
- }, {
1887
- default: withCtx(() => [
1888
- createTextVNode(toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
1889
- ]),
1890
- _: 1
1891
- }, 8, ["icon"])) : createCommentVNode("", true),
1892
- importable.value ? (openBlock(), createBlock(unref(TMagicUpload), {
1893
- key: 2,
1894
- style: { "display": "inline-block" },
1895
- ref_key: "excelBtn",
1896
- ref: excelBtn,
1897
- action: "/noop",
1898
- disabled: _ctx.disabled,
1899
- "on-change": excelHandler,
1900
- "auto-upload": false
1901
- }, {
1902
- default: withCtx(() => [
1903
- createVNode(unref(TMagicButton), {
1904
- size: "small",
1905
- type: "success",
1906
- disabled: _ctx.disabled,
1907
- plain: ""
1908
- }, {
1909
- default: withCtx(() => [
1910
- createTextVNode("导入EXCEL")
1911
- ]),
1912
- _: 1
1913
- }, 8, ["disabled"])
1914
- ]),
1915
- _: 1
1916
- }, 8, ["disabled"])) : createCommentVNode("", true),
1917
- importable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1918
- key: 3,
1919
- size: "small",
1920
- type: "warning",
1921
1863
  disabled: _ctx.disabled,
1922
1864
  plain: "",
1923
- onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
1865
+ onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
1924
1866
  }, {
1925
1867
  default: withCtx(() => [
1926
- createTextVNode("清空")
1868
+ createTextVNode("新增一行")
1927
1869
  ]),
1928
1870
  _: 1
1929
- }, 8, ["disabled"])) : createCommentVNode("", true)
1930
- ])
1931
- ]),
1932
- _ctx.config.pagination ? (openBlock(), createElementBlock("div", _hoisted_5, [
1933
- createVNode(unref(TMagicPagination), {
1934
- layout: "total, sizes, prev, pager, next, jumper",
1935
- "hide-on-single-page": _ctx.model[modelName.value].length < pagesize.value,
1936
- "current-page": pagecontext.value + 1,
1937
- "page-sizes": [pagesize.value, 60, 120, 300],
1938
- "page-size": pagesize.value,
1939
- total: _ctx.model[modelName.value].length,
1940
- onSizeChange: handleSizeChange,
1941
- onCurrentChange: handleCurrentChange
1942
- }, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
1943
- ])) : createCommentVNode("", true)
1944
- ], 2);
1871
+ }, 8, ["disabled"])) : createCommentVNode("", true),
1872
+ createElementVNode("div", _hoisted_4, [
1873
+ _ctx.enableToggleMode && _ctx.config.enableToggleMode !== false && !isFullscreen.value ? (openBlock(), createBlock(unref(TMagicButton), {
1874
+ key: 0,
1875
+ icon: unref(Grid),
1876
+ size: "small",
1877
+ type: "primary",
1878
+ onClick: toggleMode
1879
+ }, {
1880
+ default: withCtx(() => [
1881
+ createTextVNode("展开配置")
1882
+ ]),
1883
+ _: 1
1884
+ }, 8, ["icon"])) : createCommentVNode("", true),
1885
+ _ctx.config.enableFullscreen !== false ? (openBlock(), createBlock(unref(TMagicButton), {
1886
+ key: 1,
1887
+ icon: unref(FullScreen),
1888
+ size: "small",
1889
+ type: "primary",
1890
+ onClick: toggleFullscreen
1891
+ }, {
1892
+ default: withCtx(() => [
1893
+ createTextVNode(toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
1894
+ ]),
1895
+ _: 1
1896
+ }, 8, ["icon"])) : createCommentVNode("", true),
1897
+ importable.value ? (openBlock(), createBlock(unref(TMagicUpload), {
1898
+ key: 2,
1899
+ style: { "display": "inline-block" },
1900
+ ref_key: "excelBtn",
1901
+ ref: excelBtn,
1902
+ action: "/noop",
1903
+ disabled: _ctx.disabled,
1904
+ "on-change": excelHandler,
1905
+ "auto-upload": false
1906
+ }, {
1907
+ default: withCtx(() => [
1908
+ createVNode(unref(TMagicButton), {
1909
+ size: "small",
1910
+ type: "success",
1911
+ disabled: _ctx.disabled,
1912
+ plain: ""
1913
+ }, {
1914
+ default: withCtx(() => [
1915
+ createTextVNode("导入EXCEL")
1916
+ ]),
1917
+ _: 1
1918
+ }, 8, ["disabled"])
1919
+ ]),
1920
+ _: 1
1921
+ }, 8, ["disabled"])) : createCommentVNode("", true),
1922
+ importable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1923
+ key: 3,
1924
+ size: "small",
1925
+ type: "warning",
1926
+ disabled: _ctx.disabled,
1927
+ plain: "",
1928
+ onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
1929
+ }, {
1930
+ default: withCtx(() => [
1931
+ createTextVNode("清空")
1932
+ ]),
1933
+ _: 1
1934
+ }, 8, ["disabled"])) : createCommentVNode("", true)
1935
+ ])
1936
+ ]),
1937
+ _ctx.config.pagination ? (openBlock(), createElementBlock("div", _hoisted_5, [
1938
+ createVNode(unref(TMagicPagination), {
1939
+ layout: "total, sizes, prev, pager, next, jumper",
1940
+ "hide-on-single-page": _ctx.model[modelName.value].length < pagesize.value,
1941
+ "current-page": pagecontext.value + 1,
1942
+ "page-sizes": [pagesize.value, 60, 120, 300],
1943
+ "page-size": pagesize.value,
1944
+ total: _ctx.model[modelName.value].length,
1945
+ onSizeChange: handleSizeChange,
1946
+ onCurrentChange: handleCurrentChange
1947
+ }, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
1948
+ ])) : createCommentVNode("", true)
1949
+ ], 2)
1950
+ ], 8, ["disabled"]);
1945
1951
  };
1946
1952
  }
1947
1953
  });
@@ -3697,12 +3703,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3697
3703
  });
3698
3704
  }
3699
3705
  if (props.config.remote) {
3700
- const unWacth = watch(
3706
+ const unWatch = watch(
3701
3707
  () => tMagicSelect.value?.scrollbarWrap,
3702
3708
  (scrollbarWrap) => {
3703
3709
  if (!scrollbarWrap) {
3704
3710
  return;
3705
3711
  }
3712
+ nextTick(() => unWatch());
3706
3713
  scrollbarWrap.addEventListener("scroll", async (e) => {
3707
3714
  const el = e.currentTarget;
3708
3715
  if (moreLoadingVisible.value) {
@@ -3719,7 +3726,6 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3719
3726
  options.value = await getOptions();
3720
3727
  moreLoadingVisible.value = false;
3721
3728
  });
3722
- unWacth();
3723
3729
  },
3724
3730
  {
3725
3731
  immediate: true