@tmagic/form 1.3.8 → 1.3.10
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 +11 -0
- package/dist/tmagic-form.js +401 -326
- package/dist/tmagic-form.js.map +1 -1
- package/dist/tmagic-form.umd.cjs +400 -324
- package/dist/tmagic-form.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/containers/Container.vue +2 -1
- package/src/containers/GroupListItem.vue +4 -4
- package/src/containers/Panel.vue +1 -1
- package/src/containers/Table.vue +184 -170
- package/src/fields/Link.vue +1 -1
- package/src/fields/Text.vue +69 -25
- package/src/index.ts +5 -0
- package/src/schema.ts +2 -1
- package/src/theme/index.scss +1 -0
- package/src/theme/table.scss +4 -0
- package/src/theme/text.scss +6 -0
- package/types/index.d.ts +2 -0
- package/types/schema.d.ts +2 -1
- package/src/utils/createForm.ts +0 -25
- package/types/utils/createForm.d.ts +0 -3
package/dist/tmagic-form.umd.cjs
CHANGED
|
@@ -166,11 +166,11 @@
|
|
|
166
166
|
};
|
|
167
167
|
|
|
168
168
|
const _hoisted_1$e = ["id", "data-magic-id"];
|
|
169
|
-
const _hoisted_2$
|
|
170
|
-
const _hoisted_3$
|
|
169
|
+
const _hoisted_2$9 = ["innerHTML"];
|
|
170
|
+
const _hoisted_3$5 = ["innerHTML"];
|
|
171
171
|
const _hoisted_4$4 = ["innerHTML"];
|
|
172
172
|
const _hoisted_5$4 = ["innerHTML"];
|
|
173
|
-
const _hoisted_6$
|
|
173
|
+
const _hoisted_6$2 = ["innerHTML"];
|
|
174
174
|
const _hoisted_7$1 = ["innerHTML"];
|
|
175
175
|
const _hoisted_8$1 = ["innerHTML"];
|
|
176
176
|
const _hoisted_9 = ["innerHTML"];
|
|
@@ -246,6 +246,8 @@
|
|
|
246
246
|
}
|
|
247
247
|
if (type2 === "form")
|
|
248
248
|
return "";
|
|
249
|
+
if (type2 === "container")
|
|
250
|
+
return "";
|
|
249
251
|
return type2?.replace(/([A-Z])/g, "-$1").toLowerCase() || (items.value ? "" : "text");
|
|
250
252
|
});
|
|
251
253
|
const display$1 = vue.computed(() => {
|
|
@@ -369,12 +371,12 @@
|
|
|
369
371
|
label: vue.withCtx(() => [
|
|
370
372
|
vue.createElementVNode("span", {
|
|
371
373
|
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
372
|
-
}, null, 8, _hoisted_2$
|
|
374
|
+
}, null, 8, _hoisted_2$9)
|
|
373
375
|
]),
|
|
374
376
|
default: vue.withCtx(() => [
|
|
375
377
|
tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
|
|
376
378
|
content: vue.withCtx(() => [
|
|
377
|
-
vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_3$
|
|
379
|
+
vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_3$5)
|
|
378
380
|
]),
|
|
379
381
|
default: vue.withCtx(() => [
|
|
380
382
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
@@ -441,7 +443,7 @@
|
|
|
441
443
|
label: vue.withCtx(() => [
|
|
442
444
|
vue.createElementVNode("span", {
|
|
443
445
|
innerHTML: type.value === "checkbox" ? "" : text.value
|
|
444
|
-
}, null, 8, _hoisted_6$
|
|
446
|
+
}, null, 8, _hoisted_6$2)
|
|
445
447
|
]),
|
|
446
448
|
default: vue.withCtx(() => [
|
|
447
449
|
tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
|
|
@@ -589,7 +591,7 @@
|
|
|
589
591
|
type: "primary",
|
|
590
592
|
size: "small",
|
|
591
593
|
disabled: false,
|
|
592
|
-
|
|
594
|
+
link: "",
|
|
593
595
|
onClick: expandHandler
|
|
594
596
|
}, {
|
|
595
597
|
default: vue.withCtx(() => [
|
|
@@ -604,11 +606,11 @@
|
|
|
604
606
|
});
|
|
605
607
|
|
|
606
608
|
const _hoisted_1$d = ["innerHTML"];
|
|
607
|
-
const _hoisted_2$
|
|
608
|
-
const _hoisted_3$
|
|
609
|
+
const _hoisted_2$8 = ["innerHTML"];
|
|
610
|
+
const _hoisted_3$4 = { key: 1 };
|
|
609
611
|
const _hoisted_4$3 = ["innerHTML"];
|
|
610
612
|
const _hoisted_5$3 = ["innerHTML"];
|
|
611
|
-
const _hoisted_6 = {
|
|
613
|
+
const _hoisted_6$1 = {
|
|
612
614
|
key: 2,
|
|
613
615
|
style: { "display": "flex" }
|
|
614
616
|
};
|
|
@@ -679,13 +681,13 @@
|
|
|
679
681
|
key: 0,
|
|
680
682
|
innerHTML: _ctx.config.extra,
|
|
681
683
|
class: "m-form-tip"
|
|
682
|
-
}, null, 8, _hoisted_2$
|
|
684
|
+
}, null, 8, _hoisted_2$8)) : vue.createCommentVNode("", true)
|
|
683
685
|
]),
|
|
684
686
|
_: 1
|
|
685
687
|
}, 8, ["modelValue", "prop"])
|
|
686
688
|
]),
|
|
687
689
|
_: 1
|
|
688
|
-
})) : (vue.openBlock(), vue.createElementBlock("legend", _hoisted_3$
|
|
690
|
+
})) : (vue.openBlock(), vue.createElementBlock("legend", _hoisted_3$4, [
|
|
689
691
|
vue.createElementVNode("span", {
|
|
690
692
|
innerHTML: _ctx.config.legend
|
|
691
693
|
}, null, 8, _hoisted_4$3),
|
|
@@ -695,7 +697,7 @@
|
|
|
695
697
|
class: "m-form-tip"
|
|
696
698
|
}, null, 8, _hoisted_5$3)) : vue.createCommentVNode("", true)
|
|
697
699
|
])),
|
|
698
|
-
_ctx.config.schematic && show.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
|
|
700
|
+
_ctx.config.schematic && show.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$1, [
|
|
699
701
|
vue.createElementVNode("div", _hoisted_7, [
|
|
700
702
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (item, index) => {
|
|
701
703
|
return vue.openBlock(), vue.createBlock(_sfc_main$z, {
|
|
@@ -740,7 +742,7 @@
|
|
|
740
742
|
});
|
|
741
743
|
|
|
742
744
|
const _hoisted_1$c = { class: "m-fields-group-list-item" };
|
|
743
|
-
const _hoisted_2$
|
|
745
|
+
const _hoisted_2$7 = ["innerHTML"];
|
|
744
746
|
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
745
747
|
...{
|
|
746
748
|
name: "MFormGroupListItem"
|
|
@@ -810,7 +812,7 @@
|
|
|
810
812
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
811
813
|
vue.createElementVNode("div", null, [
|
|
812
814
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
813
|
-
|
|
815
|
+
link: "",
|
|
814
816
|
disabled: _ctx.disabled,
|
|
815
817
|
icon: expand.value ? vue.unref(iconsVue.CaretBottom) : vue.unref(iconsVue.CaretRight),
|
|
816
818
|
onClick: expandHandler
|
|
@@ -822,7 +824,7 @@
|
|
|
822
824
|
}, 8, ["disabled", "icon"]),
|
|
823
825
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
824
826
|
style: { "color": "#f56c6c" },
|
|
825
|
-
|
|
827
|
+
link: "",
|
|
826
828
|
icon: vue.unref(iconsVue.Delete),
|
|
827
829
|
disabled: _ctx.disabled,
|
|
828
830
|
onClick: removeHandler
|
|
@@ -831,7 +833,7 @@
|
|
|
831
833
|
]),
|
|
832
834
|
movable() ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
833
835
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
834
|
-
|
|
836
|
+
link: "",
|
|
835
837
|
disabled: _ctx.disabled,
|
|
836
838
|
size: "small",
|
|
837
839
|
onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
|
|
@@ -851,7 +853,7 @@
|
|
|
851
853
|
]),
|
|
852
854
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
853
855
|
disabled: _ctx.disabled,
|
|
854
|
-
|
|
856
|
+
link: "",
|
|
855
857
|
size: "small",
|
|
856
858
|
onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
|
|
857
859
|
}, {
|
|
@@ -873,7 +875,7 @@
|
|
|
873
875
|
key: 1,
|
|
874
876
|
innerHTML: itemExtra.value,
|
|
875
877
|
class: "m-form-tip"
|
|
876
|
-
}, null, 8, _hoisted_2$
|
|
878
|
+
}, null, 8, _hoisted_2$7)) : vue.createCommentVNode("", true)
|
|
877
879
|
]),
|
|
878
880
|
expand.value ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
|
|
879
881
|
key: 0,
|
|
@@ -894,8 +896,8 @@
|
|
|
894
896
|
});
|
|
895
897
|
|
|
896
898
|
const _hoisted_1$b = { class: "m-fields-group-list" };
|
|
897
|
-
const _hoisted_2$
|
|
898
|
-
const _hoisted_3$
|
|
899
|
+
const _hoisted_2$6 = ["innerHTML"];
|
|
900
|
+
const _hoisted_3$3 = {
|
|
899
901
|
key: 1,
|
|
900
902
|
class: "el-table__empty-block"
|
|
901
903
|
};
|
|
@@ -992,8 +994,8 @@
|
|
|
992
994
|
key: 0,
|
|
993
995
|
innerHTML: _ctx.config.extra,
|
|
994
996
|
style: { "color": "rgba(0, 0, 0, 0.45)" }
|
|
995
|
-
}, null, 8, _hoisted_2$
|
|
996
|
-
!_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$
|
|
997
|
+
}, null, 8, _hoisted_2$6)) : vue.createCommentVNode("", true),
|
|
998
|
+
!_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, _hoisted_5$2)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(_ctx.model[_ctx.name], (item, index) => {
|
|
997
999
|
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
998
1000
|
key: index,
|
|
999
1001
|
model: item,
|
|
@@ -1040,8 +1042,8 @@
|
|
|
1040
1042
|
});
|
|
1041
1043
|
|
|
1042
1044
|
const _hoisted_1$a = { style: { "width": "100%", "display": "flex", "align-items": "center" } };
|
|
1043
|
-
const _hoisted_2$
|
|
1044
|
-
const _hoisted_3$
|
|
1045
|
+
const _hoisted_2$5 = ["innerHTML"];
|
|
1046
|
+
const _hoisted_3$2 = {
|
|
1045
1047
|
key: 0,
|
|
1046
1048
|
style: { "display": "flex" }
|
|
1047
1049
|
};
|
|
@@ -1083,7 +1085,7 @@
|
|
|
1083
1085
|
vue.createElementVNode("div", _hoisted_1$a, [
|
|
1084
1086
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1085
1087
|
style: { "padding": "0" },
|
|
1086
|
-
|
|
1088
|
+
link: "",
|
|
1087
1089
|
icon: expand.value ? vue.unref(iconsVue.CaretBottom) : vue.unref(iconsVue.CaretRight),
|
|
1088
1090
|
onClick: _cache[0] || (_cache[0] = ($event) => expand.value = !expand.value)
|
|
1089
1091
|
}, null, 8, ["icon"]),
|
|
@@ -1091,7 +1093,7 @@
|
|
|
1091
1093
|
key: 0,
|
|
1092
1094
|
innerHTML: _ctx.config.extra,
|
|
1093
1095
|
class: "m-form-tip"
|
|
1094
|
-
}, null, 8, _hoisted_2$
|
|
1096
|
+
}, null, 8, _hoisted_2$5)) : vue.createCommentVNode("", true),
|
|
1095
1097
|
vue.renderSlot(_ctx.$slots, "header", {}, () => [
|
|
1096
1098
|
vue.createTextVNode(vue.toDisplayString(filter(_ctx.config.title)), 1)
|
|
1097
1099
|
])
|
|
@@ -1100,7 +1102,7 @@
|
|
|
1100
1102
|
default: vue.withCtx(() => [
|
|
1101
1103
|
vue.createElementVNode("div", null, [
|
|
1102
1104
|
vue.renderSlot(_ctx.$slots, "default"),
|
|
1103
|
-
_ctx.config.schematic ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$
|
|
1105
|
+
_ctx.config.schematic ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, [
|
|
1104
1106
|
vue.createElementVNode("div", _hoisted_4$1, [
|
|
1105
1107
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items.value, (item, index) => {
|
|
1106
1108
|
return vue.openBlock(), vue.createBlock(_sfc_main$z, {
|
|
@@ -1325,11 +1327,12 @@
|
|
|
1325
1327
|
}
|
|
1326
1328
|
});
|
|
1327
1329
|
|
|
1328
|
-
const _hoisted_1$9 =
|
|
1329
|
-
const _hoisted_2$
|
|
1330
|
-
const _hoisted_3 =
|
|
1331
|
-
const _hoisted_4 = { style: { "display": "flex" } };
|
|
1332
|
-
const _hoisted_5 = {
|
|
1330
|
+
const _hoisted_1$9 = { class: "m-fields-table-wrap" };
|
|
1331
|
+
const _hoisted_2$4 = ["innerHTML"];
|
|
1332
|
+
const _hoisted_3$1 = ["innerHTML"];
|
|
1333
|
+
const _hoisted_4 = { style: { "display": "flex", "justify-content": "space-between", "margin": "10px 0" } };
|
|
1334
|
+
const _hoisted_5 = { style: { "display": "flex" } };
|
|
1335
|
+
const _hoisted_6 = {
|
|
1333
1336
|
key: 1,
|
|
1334
1337
|
class: "bottom",
|
|
1335
1338
|
style: { "text-align": "right" }
|
|
@@ -1361,6 +1364,7 @@
|
|
|
1361
1364
|
const emit = __emit;
|
|
1362
1365
|
let timer = null;
|
|
1363
1366
|
const mForm = vue.inject("mForm");
|
|
1367
|
+
const { nextZIndex } = design.useZIndex();
|
|
1364
1368
|
const tMagicTable = vue.ref();
|
|
1365
1369
|
const excelBtn = vue.ref();
|
|
1366
1370
|
const mTable = vue.ref();
|
|
@@ -1673,11 +1677,14 @@
|
|
|
1673
1677
|
});
|
|
1674
1678
|
};
|
|
1675
1679
|
const toggleFullscreen = () => {
|
|
1680
|
+
if (!mTable.value)
|
|
1681
|
+
return;
|
|
1676
1682
|
if (isFullscreen.value) {
|
|
1677
|
-
mTable.value
|
|
1683
|
+
mTable.value.classList.remove("fixed");
|
|
1678
1684
|
isFullscreen.value = false;
|
|
1679
1685
|
} else {
|
|
1680
|
-
mTable.value
|
|
1686
|
+
mTable.value.classList.add("fixed");
|
|
1687
|
+
mTable.value.style.zIndex = `${nextZIndex()}`;
|
|
1681
1688
|
isFullscreen.value = true;
|
|
1682
1689
|
}
|
|
1683
1690
|
};
|
|
@@ -1690,272 +1697,274 @@
|
|
|
1690
1697
|
toggleRowSelection
|
|
1691
1698
|
});
|
|
1692
1699
|
return (_ctx, _cache) => {
|
|
1693
|
-
return vue.openBlock(), vue.
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
vue.createElementVNode("div", {
|
|
1698
|
-
ref_key: "mTable",
|
|
1699
|
-
ref: mTable,
|
|
1700
|
-
class: vue.normalizeClass(["m-fields-table", { "m-fields-table-item-extra": _ctx.config.itemExtra }])
|
|
1700
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
1701
|
+
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
1702
|
+
to: "body",
|
|
1703
|
+
disabled: !isFullscreen.value
|
|
1701
1704
|
}, [
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
},
|
|
1707
|
-
|
|
1708
|
-
content: "拖拽可排序",
|
|
1709
|
-
placement: "left-start",
|
|
1710
|
-
disabled: _ctx.config.dropSort !== true
|
|
1711
|
-
}, {
|
|
1712
|
-
default: vue.withCtx(() => [
|
|
1713
|
-
_ctx.model[modelName.value] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTable), {
|
|
1714
|
-
ref_key: "tMagicTable",
|
|
1715
|
-
ref: tMagicTable,
|
|
1716
|
-
style: { "width": "100%" },
|
|
1717
|
-
"row-key": _ctx.config.rowKey || "id",
|
|
1718
|
-
data: data.value,
|
|
1719
|
-
lastData: lastData.value,
|
|
1720
|
-
border: _ctx.config.border,
|
|
1721
|
-
"max-height": _ctx.config.maxHeight,
|
|
1722
|
-
"default-expand-all": true,
|
|
1723
|
-
key: updateKey.value,
|
|
1724
|
-
onSelect: selectHandle,
|
|
1725
|
-
onSortChange: sortChange
|
|
1726
|
-
}, {
|
|
1727
|
-
default: vue.withCtx(() => [
|
|
1728
|
-
_ctx.config.itemExtra ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1729
|
-
key: 0,
|
|
1730
|
-
fixed: "left",
|
|
1731
|
-
width: "30",
|
|
1732
|
-
type: "expand"
|
|
1733
|
-
}, {
|
|
1734
|
-
default: vue.withCtx((scope) => [
|
|
1735
|
-
vue.createElementVNode("span", {
|
|
1736
|
-
innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
|
|
1737
|
-
class: "m-form-tip"
|
|
1738
|
-
}, null, 8, _hoisted_2$3)
|
|
1739
|
-
]),
|
|
1740
|
-
_: 1
|
|
1741
|
-
})) : vue.createCommentVNode("", true),
|
|
1742
|
-
vue.createVNode(vue.unref(design.TMagicTableColumn), {
|
|
1743
|
-
label: "操作",
|
|
1744
|
-
width: _ctx.config.operateColWidth || 55,
|
|
1745
|
-
align: "center",
|
|
1746
|
-
fixed: _ctx.config.fixed === false ? void 0 : "left"
|
|
1747
|
-
}, {
|
|
1748
|
-
default: vue.withCtx((scope) => [
|
|
1749
|
-
vue.renderSlot(_ctx.$slots, "operateCol", { scope }),
|
|
1750
|
-
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicIcon), {
|
|
1751
|
-
class: "m-table-delete-icon",
|
|
1752
|
-
onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1753
|
-
}, {
|
|
1754
|
-
default: vue.withCtx(() => [
|
|
1755
|
-
vue.createVNode(vue.unref(iconsVue.Delete))
|
|
1756
|
-
]),
|
|
1757
|
-
_: 2
|
|
1758
|
-
}, 1032, ["onClick"]), [
|
|
1759
|
-
[vue.vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
|
|
1760
|
-
])
|
|
1761
|
-
]),
|
|
1762
|
-
_: 3
|
|
1763
|
-
}, 8, ["width", "fixed"]),
|
|
1764
|
-
_ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1765
|
-
key: 1,
|
|
1766
|
-
label: "排序",
|
|
1767
|
-
width: "60"
|
|
1768
|
-
}, {
|
|
1769
|
-
default: vue.withCtx((scope) => [
|
|
1770
|
-
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
1771
|
-
key: 0,
|
|
1772
|
-
content: "点击上移,双击置顶",
|
|
1773
|
-
placement: "top"
|
|
1774
|
-
}, {
|
|
1775
|
-
default: vue.withCtx(() => [
|
|
1776
|
-
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1777
|
-
plain: "",
|
|
1778
|
-
size: "small",
|
|
1779
|
-
type: "primary",
|
|
1780
|
-
icon: vue.unref(iconsVue.ArrowUp),
|
|
1781
|
-
disabled: _ctx.disabled,
|
|
1782
|
-
text: "",
|
|
1783
|
-
onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
1784
|
-
onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1785
|
-
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
1786
|
-
]),
|
|
1787
|
-
_: 2
|
|
1788
|
-
}, 1024)) : vue.createCommentVNode("", true),
|
|
1789
|
-
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
1790
|
-
key: 1,
|
|
1791
|
-
content: "点击下移,双击置底",
|
|
1792
|
-
placement: "top"
|
|
1793
|
-
}, {
|
|
1794
|
-
default: vue.withCtx(() => [
|
|
1795
|
-
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1796
|
-
plain: "",
|
|
1797
|
-
size: "small",
|
|
1798
|
-
type: "primary",
|
|
1799
|
-
icon: vue.unref(iconsVue.ArrowDown),
|
|
1800
|
-
disabled: _ctx.disabled,
|
|
1801
|
-
text: "",
|
|
1802
|
-
onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
1803
|
-
onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1804
|
-
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
1805
|
-
]),
|
|
1806
|
-
_: 2
|
|
1807
|
-
}, 1024)) : vue.createCommentVNode("", true)
|
|
1808
|
-
]),
|
|
1809
|
-
_: 1
|
|
1810
|
-
})) : vue.createCommentVNode("", true),
|
|
1811
|
-
selection.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1812
|
-
key: 2,
|
|
1813
|
-
align: "center",
|
|
1814
|
-
"header-align": "center",
|
|
1815
|
-
type: "selection",
|
|
1816
|
-
width: "45"
|
|
1817
|
-
})) : vue.createCommentVNode("", true),
|
|
1818
|
-
_ctx.showIndex && _ctx.config.showIndex ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1819
|
-
key: 3,
|
|
1820
|
-
width: "60",
|
|
1821
|
-
label: "序号"
|
|
1822
|
-
}, {
|
|
1823
|
-
default: vue.withCtx((scope) => [
|
|
1824
|
-
vue.createTextVNode(vue.toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
|
|
1825
|
-
]),
|
|
1826
|
-
_: 1
|
|
1827
|
-
})) : vue.createCommentVNode("", true),
|
|
1828
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (column, index) => {
|
|
1829
|
-
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
1830
|
-
column.type !== "hidden" && display$1(column.display) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1831
|
-
prop: column.name,
|
|
1832
|
-
width: column.width,
|
|
1833
|
-
label: column.label,
|
|
1834
|
-
sortable: column.sortable,
|
|
1835
|
-
"sort-orders": ["ascending", "descending"],
|
|
1836
|
-
key: column[vue.unref(mForm)?.keyProp || "__key"] ?? index,
|
|
1837
|
-
"class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
|
|
1838
|
-
}, {
|
|
1839
|
-
default: vue.withCtx((scope) => [
|
|
1840
|
-
scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
|
|
1841
|
-
key: 0,
|
|
1842
|
-
labelWidth: "0",
|
|
1843
|
-
disabled: _ctx.disabled,
|
|
1844
|
-
prop: getProp(scope.$index),
|
|
1845
|
-
rules: column.rules,
|
|
1846
|
-
config: makeConfig(column, scope.row),
|
|
1847
|
-
model: scope.row,
|
|
1848
|
-
lastValues: lastData.value[scope.$index],
|
|
1849
|
-
"is-compare": _ctx.isCompare,
|
|
1850
|
-
size: _ctx.size,
|
|
1851
|
-
onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", _ctx.model[modelName.value])),
|
|
1852
|
-
onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
|
|
1853
|
-
}, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : vue.createCommentVNode("", true)
|
|
1854
|
-
]),
|
|
1855
|
-
_: 2
|
|
1856
|
-
}, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
|
|
1857
|
-
], 64);
|
|
1858
|
-
}), 256))
|
|
1859
|
-
]),
|
|
1860
|
-
_: 3
|
|
1861
|
-
}, 8, ["row-key", "data", "lastData", "border", "max-height"])) : vue.createCommentVNode("", true)
|
|
1862
|
-
]),
|
|
1863
|
-
_: 3
|
|
1864
|
-
}, 8, ["disabled"]),
|
|
1865
|
-
vue.renderSlot(_ctx.$slots, "default"),
|
|
1866
|
-
vue.createElementVNode("div", _hoisted_3, [
|
|
1867
|
-
addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1705
|
+
vue.createElementVNode("div", {
|
|
1706
|
+
ref_key: "mTable",
|
|
1707
|
+
ref: mTable,
|
|
1708
|
+
class: vue.normalizeClass(["m-fields-table", { "m-fields-table-item-extra": _ctx.config.itemExtra }])
|
|
1709
|
+
}, [
|
|
1710
|
+
_ctx.config.extra ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
1868
1711
|
key: 0,
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1712
|
+
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
1713
|
+
innerHTML: _ctx.config.extra
|
|
1714
|
+
}, null, 8, _hoisted_2$4)) : vue.createCommentVNode("", true),
|
|
1715
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
1716
|
+
content: "拖拽可排序",
|
|
1717
|
+
placement: "left-start",
|
|
1718
|
+
disabled: _ctx.config.dropSort !== true
|
|
1874
1719
|
}, {
|
|
1875
1720
|
default: vue.withCtx(() => [
|
|
1876
|
-
vue.
|
|
1721
|
+
_ctx.model[modelName.value] ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTable), {
|
|
1722
|
+
ref_key: "tMagicTable",
|
|
1723
|
+
ref: tMagicTable,
|
|
1724
|
+
style: { "width": "100%" },
|
|
1725
|
+
"row-key": _ctx.config.rowKey || "id",
|
|
1726
|
+
data: data.value,
|
|
1727
|
+
lastData: lastData.value,
|
|
1728
|
+
border: _ctx.config.border,
|
|
1729
|
+
"max-height": _ctx.config.maxHeight,
|
|
1730
|
+
"default-expand-all": true,
|
|
1731
|
+
key: updateKey.value,
|
|
1732
|
+
onSelect: selectHandle,
|
|
1733
|
+
onSortChange: sortChange
|
|
1734
|
+
}, {
|
|
1735
|
+
default: vue.withCtx(() => [
|
|
1736
|
+
_ctx.config.itemExtra ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1737
|
+
key: 0,
|
|
1738
|
+
fixed: "left",
|
|
1739
|
+
width: "30",
|
|
1740
|
+
type: "expand"
|
|
1741
|
+
}, {
|
|
1742
|
+
default: vue.withCtx((scope) => [
|
|
1743
|
+
vue.createElementVNode("span", {
|
|
1744
|
+
innerHTML: itemExtra(_ctx.config.itemExtra, scope.$index),
|
|
1745
|
+
class: "m-form-tip"
|
|
1746
|
+
}, null, 8, _hoisted_3$1)
|
|
1747
|
+
]),
|
|
1748
|
+
_: 1
|
|
1749
|
+
})) : vue.createCommentVNode("", true),
|
|
1750
|
+
vue.createVNode(vue.unref(design.TMagicTableColumn), {
|
|
1751
|
+
label: "操作",
|
|
1752
|
+
width: _ctx.config.operateColWidth || 55,
|
|
1753
|
+
align: "center",
|
|
1754
|
+
fixed: _ctx.config.fixed === false ? void 0 : "left"
|
|
1755
|
+
}, {
|
|
1756
|
+
default: vue.withCtx((scope) => [
|
|
1757
|
+
vue.renderSlot(_ctx.$slots, "operateCol", { scope }),
|
|
1758
|
+
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicIcon), {
|
|
1759
|
+
class: "m-table-delete-icon",
|
|
1760
|
+
onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1761
|
+
}, {
|
|
1762
|
+
default: vue.withCtx(() => [
|
|
1763
|
+
vue.createVNode(vue.unref(iconsVue.Delete))
|
|
1764
|
+
]),
|
|
1765
|
+
_: 2
|
|
1766
|
+
}, 1032, ["onClick"]), [
|
|
1767
|
+
[vue.vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
|
|
1768
|
+
])
|
|
1769
|
+
]),
|
|
1770
|
+
_: 3
|
|
1771
|
+
}, 8, ["width", "fixed"]),
|
|
1772
|
+
_ctx.sort && _ctx.model[modelName.value] && _ctx.model[modelName.value].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1773
|
+
key: 1,
|
|
1774
|
+
label: "排序",
|
|
1775
|
+
width: "60"
|
|
1776
|
+
}, {
|
|
1777
|
+
default: vue.withCtx((scope) => [
|
|
1778
|
+
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
1779
|
+
key: 0,
|
|
1780
|
+
content: "点击上移,双击置顶",
|
|
1781
|
+
placement: "top"
|
|
1782
|
+
}, {
|
|
1783
|
+
default: vue.withCtx(() => [
|
|
1784
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1785
|
+
plain: "",
|
|
1786
|
+
size: "small",
|
|
1787
|
+
type: "primary",
|
|
1788
|
+
icon: vue.unref(iconsVue.ArrowUp),
|
|
1789
|
+
disabled: _ctx.disabled,
|
|
1790
|
+
link: "",
|
|
1791
|
+
onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
1792
|
+
onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1793
|
+
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
1794
|
+
]),
|
|
1795
|
+
_: 2
|
|
1796
|
+
}, 1024)) : vue.createCommentVNode("", true),
|
|
1797
|
+
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== _ctx.model[modelName.value].length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
1798
|
+
key: 1,
|
|
1799
|
+
content: "点击下移,双击置底",
|
|
1800
|
+
placement: "top"
|
|
1801
|
+
}, {
|
|
1802
|
+
default: vue.withCtx(() => [
|
|
1803
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1804
|
+
plain: "",
|
|
1805
|
+
size: "small",
|
|
1806
|
+
type: "primary",
|
|
1807
|
+
icon: vue.unref(iconsVue.ArrowDown),
|
|
1808
|
+
disabled: _ctx.disabled,
|
|
1809
|
+
link: "",
|
|
1810
|
+
onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
1811
|
+
onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1812
|
+
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
1813
|
+
]),
|
|
1814
|
+
_: 2
|
|
1815
|
+
}, 1024)) : vue.createCommentVNode("", true)
|
|
1816
|
+
]),
|
|
1817
|
+
_: 1
|
|
1818
|
+
})) : vue.createCommentVNode("", true),
|
|
1819
|
+
selection.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1820
|
+
key: 2,
|
|
1821
|
+
align: "center",
|
|
1822
|
+
"header-align": "center",
|
|
1823
|
+
type: "selection",
|
|
1824
|
+
width: "45"
|
|
1825
|
+
})) : vue.createCommentVNode("", true),
|
|
1826
|
+
_ctx.showIndex && _ctx.config.showIndex ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1827
|
+
key: 3,
|
|
1828
|
+
width: "60",
|
|
1829
|
+
label: "序号"
|
|
1830
|
+
}, {
|
|
1831
|
+
default: vue.withCtx((scope) => [
|
|
1832
|
+
vue.createTextVNode(vue.toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
|
|
1833
|
+
]),
|
|
1834
|
+
_: 1
|
|
1835
|
+
})) : vue.createCommentVNode("", true),
|
|
1836
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (column, index) => {
|
|
1837
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
1838
|
+
column.type !== "hidden" && display$1(column.display) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1839
|
+
prop: column.name,
|
|
1840
|
+
width: column.width,
|
|
1841
|
+
label: column.label,
|
|
1842
|
+
sortable: column.sortable,
|
|
1843
|
+
"sort-orders": ["ascending", "descending"],
|
|
1844
|
+
key: column[vue.unref(mForm)?.keyProp || "__key"] ?? index,
|
|
1845
|
+
"class-name": _ctx.config.dropSort === true ? "el-table__column--dropable" : ""
|
|
1846
|
+
}, {
|
|
1847
|
+
default: vue.withCtx((scope) => [
|
|
1848
|
+
scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
|
|
1849
|
+
key: 0,
|
|
1850
|
+
labelWidth: "0",
|
|
1851
|
+
disabled: _ctx.disabled,
|
|
1852
|
+
prop: getProp(scope.$index),
|
|
1853
|
+
rules: column.rules,
|
|
1854
|
+
config: makeConfig(column, scope.row),
|
|
1855
|
+
model: scope.row,
|
|
1856
|
+
lastValues: lastData.value[scope.$index],
|
|
1857
|
+
"is-compare": _ctx.isCompare,
|
|
1858
|
+
size: _ctx.size,
|
|
1859
|
+
onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", _ctx.model[modelName.value])),
|
|
1860
|
+
onAddDiffCount: _cache[1] || (_cache[1] = ($event) => onAddDiffCount())
|
|
1861
|
+
}, null, 8, ["disabled", "prop", "rules", "config", "model", "lastValues", "is-compare", "size"])) : vue.createCommentVNode("", true)
|
|
1862
|
+
]),
|
|
1863
|
+
_: 2
|
|
1864
|
+
}, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
|
|
1865
|
+
], 64);
|
|
1866
|
+
}), 256))
|
|
1867
|
+
]),
|
|
1868
|
+
_: 3
|
|
1869
|
+
}, 8, ["row-key", "data", "lastData", "border", "max-height"])) : vue.createCommentVNode("", true)
|
|
1877
1870
|
]),
|
|
1878
|
-
_:
|
|
1879
|
-
}, 8, ["disabled"])
|
|
1871
|
+
_: 3
|
|
1872
|
+
}, 8, ["disabled"]),
|
|
1873
|
+
vue.renderSlot(_ctx.$slots, "default"),
|
|
1880
1874
|
vue.createElementVNode("div", _hoisted_4, [
|
|
1881
|
-
|
|
1875
|
+
addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1882
1876
|
key: 0,
|
|
1883
|
-
icon: vue.unref(iconsVue.Grid),
|
|
1884
1877
|
size: "small",
|
|
1885
1878
|
type: "primary",
|
|
1886
|
-
onClick: toggleMode
|
|
1887
|
-
}, {
|
|
1888
|
-
default: vue.withCtx(() => [
|
|
1889
|
-
vue.createTextVNode("展开配置")
|
|
1890
|
-
]),
|
|
1891
|
-
_: 1
|
|
1892
|
-
}, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
1893
|
-
_ctx.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1894
|
-
key: 1,
|
|
1895
|
-
icon: vue.unref(iconsVue.FullScreen),
|
|
1896
|
-
size: "small",
|
|
1897
|
-
type: "primary",
|
|
1898
|
-
onClick: toggleFullscreen
|
|
1899
|
-
}, {
|
|
1900
|
-
default: vue.withCtx(() => [
|
|
1901
|
-
vue.createTextVNode(vue.toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
|
|
1902
|
-
]),
|
|
1903
|
-
_: 1
|
|
1904
|
-
}, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
1905
|
-
importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
|
|
1906
|
-
key: 2,
|
|
1907
|
-
style: { "display": "inline-block" },
|
|
1908
|
-
ref_key: "excelBtn",
|
|
1909
|
-
ref: excelBtn,
|
|
1910
|
-
action: "/noop",
|
|
1911
|
-
disabled: _ctx.disabled,
|
|
1912
|
-
"on-change": excelHandler,
|
|
1913
|
-
"auto-upload": false
|
|
1914
|
-
}, {
|
|
1915
|
-
default: vue.withCtx(() => [
|
|
1916
|
-
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1917
|
-
size: "small",
|
|
1918
|
-
type: "success",
|
|
1919
|
-
disabled: _ctx.disabled,
|
|
1920
|
-
plain: ""
|
|
1921
|
-
}, {
|
|
1922
|
-
default: vue.withCtx(() => [
|
|
1923
|
-
vue.createTextVNode("导入EXCEL")
|
|
1924
|
-
]),
|
|
1925
|
-
_: 1
|
|
1926
|
-
}, 8, ["disabled"])
|
|
1927
|
-
]),
|
|
1928
|
-
_: 1
|
|
1929
|
-
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
1930
|
-
importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1931
|
-
key: 3,
|
|
1932
|
-
size: "small",
|
|
1933
|
-
type: "warning",
|
|
1934
1879
|
disabled: _ctx.disabled,
|
|
1935
1880
|
plain: "",
|
|
1936
|
-
onClick: _cache[
|
|
1881
|
+
onClick: _cache[2] || (_cache[2] = ($event) => newHandler())
|
|
1937
1882
|
}, {
|
|
1938
1883
|
default: vue.withCtx(() => [
|
|
1939
|
-
vue.createTextVNode("
|
|
1884
|
+
vue.createTextVNode("新增一行")
|
|
1940
1885
|
]),
|
|
1941
1886
|
_: 1
|
|
1942
|
-
}, 8, ["disabled"])) : vue.createCommentVNode("", true)
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1887
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
1888
|
+
vue.createElementVNode("div", _hoisted_5, [
|
|
1889
|
+
_ctx.enableToggleMode && _ctx.config.enableToggleMode !== false && !isFullscreen.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1890
|
+
key: 0,
|
|
1891
|
+
icon: vue.unref(iconsVue.Grid),
|
|
1892
|
+
size: "small",
|
|
1893
|
+
type: "primary",
|
|
1894
|
+
onClick: toggleMode
|
|
1895
|
+
}, {
|
|
1896
|
+
default: vue.withCtx(() => [
|
|
1897
|
+
vue.createTextVNode("展开配置")
|
|
1898
|
+
]),
|
|
1899
|
+
_: 1
|
|
1900
|
+
}, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
1901
|
+
_ctx.config.enableFullscreen !== false ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1902
|
+
key: 1,
|
|
1903
|
+
icon: vue.unref(iconsVue.FullScreen),
|
|
1904
|
+
size: "small",
|
|
1905
|
+
type: "primary",
|
|
1906
|
+
onClick: toggleFullscreen
|
|
1907
|
+
}, {
|
|
1908
|
+
default: vue.withCtx(() => [
|
|
1909
|
+
vue.createTextVNode(vue.toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
|
|
1910
|
+
]),
|
|
1911
|
+
_: 1
|
|
1912
|
+
}, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
1913
|
+
importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
|
|
1914
|
+
key: 2,
|
|
1915
|
+
style: { "display": "inline-block" },
|
|
1916
|
+
ref_key: "excelBtn",
|
|
1917
|
+
ref: excelBtn,
|
|
1918
|
+
action: "/noop",
|
|
1919
|
+
disabled: _ctx.disabled,
|
|
1920
|
+
"on-change": excelHandler,
|
|
1921
|
+
"auto-upload": false
|
|
1922
|
+
}, {
|
|
1923
|
+
default: vue.withCtx(() => [
|
|
1924
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1925
|
+
size: "small",
|
|
1926
|
+
type: "success",
|
|
1927
|
+
disabled: _ctx.disabled,
|
|
1928
|
+
plain: ""
|
|
1929
|
+
}, {
|
|
1930
|
+
default: vue.withCtx(() => [
|
|
1931
|
+
vue.createTextVNode("导入EXCEL")
|
|
1932
|
+
]),
|
|
1933
|
+
_: 1
|
|
1934
|
+
}, 8, ["disabled"])
|
|
1935
|
+
]),
|
|
1936
|
+
_: 1
|
|
1937
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
1938
|
+
importable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1939
|
+
key: 3,
|
|
1940
|
+
size: "small",
|
|
1941
|
+
type: "warning",
|
|
1942
|
+
disabled: _ctx.disabled,
|
|
1943
|
+
plain: "",
|
|
1944
|
+
onClick: _cache[3] || (_cache[3] = ($event) => clearHandler())
|
|
1945
|
+
}, {
|
|
1946
|
+
default: vue.withCtx(() => [
|
|
1947
|
+
vue.createTextVNode("清空")
|
|
1948
|
+
]),
|
|
1949
|
+
_: 1
|
|
1950
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true)
|
|
1951
|
+
])
|
|
1952
|
+
]),
|
|
1953
|
+
_ctx.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
|
|
1954
|
+
vue.createVNode(vue.unref(design.TMagicPagination), {
|
|
1955
|
+
layout: "total, sizes, prev, pager, next, jumper",
|
|
1956
|
+
"hide-on-single-page": _ctx.model[modelName.value].length < pagesize.value,
|
|
1957
|
+
"current-page": pagecontext.value + 1,
|
|
1958
|
+
"page-sizes": [pagesize.value, 60, 120, 300],
|
|
1959
|
+
"page-size": pagesize.value,
|
|
1960
|
+
total: _ctx.model[modelName.value].length,
|
|
1961
|
+
onSizeChange: handleSizeChange,
|
|
1962
|
+
onCurrentChange: handleCurrentChange
|
|
1963
|
+
}, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
|
|
1964
|
+
])) : vue.createCommentVNode("", true)
|
|
1965
|
+
], 2)
|
|
1966
|
+
], 8, ["disabled"]))
|
|
1967
|
+
]);
|
|
1959
1968
|
};
|
|
1960
1969
|
}
|
|
1961
1970
|
});
|
|
@@ -3135,7 +3144,7 @@
|
|
|
3135
3144
|
});
|
|
3136
3145
|
|
|
3137
3146
|
const _hoisted_1$5 = ["href"];
|
|
3138
|
-
const _hoisted_2$
|
|
3147
|
+
const _hoisted_2$3 = {
|
|
3139
3148
|
key: 2,
|
|
3140
3149
|
class: "m-fields-link"
|
|
3141
3150
|
};
|
|
@@ -3211,9 +3220,9 @@
|
|
|
3211
3220
|
}, vue.toDisplayString(displayText.value), 13, _hoisted_1$5)) : _ctx.config.href && _ctx.disabled ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
3212
3221
|
key: 1,
|
|
3213
3222
|
style: vue.normalizeStyle(_ctx.config.disabledCss || {})
|
|
3214
|
-
}, vue.toDisplayString(displayText.value), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
3223
|
+
}, vue.toDisplayString(displayText.value), 5)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, [
|
|
3215
3224
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3216
|
-
|
|
3225
|
+
link: "",
|
|
3217
3226
|
type: "primary",
|
|
3218
3227
|
onClick: editHandler
|
|
3219
3228
|
}, {
|
|
@@ -3288,7 +3297,7 @@
|
|
|
3288
3297
|
});
|
|
3289
3298
|
|
|
3290
3299
|
const _hoisted_1$4 = { class: "m-fields-number-range" };
|
|
3291
|
-
const _hoisted_2$
|
|
3300
|
+
const _hoisted_2$2 = /* @__PURE__ */ vue.createElementVNode("span", { class: "split-tag" }, "-", -1);
|
|
3292
3301
|
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
3293
3302
|
...{
|
|
3294
3303
|
name: "MFormNumberRange"
|
|
@@ -3329,7 +3338,7 @@
|
|
|
3329
3338
|
disabled: _ctx.disabled,
|
|
3330
3339
|
onChange: minChangeHandler
|
|
3331
3340
|
}, null, 8, ["modelValue", "size", "disabled"]),
|
|
3332
|
-
_hoisted_2$
|
|
3341
|
+
_hoisted_2$2,
|
|
3333
3342
|
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
3334
3343
|
modelValue: _ctx.model[_ctx.name][1],
|
|
3335
3344
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.model[_ctx.name][1] = $event),
|
|
@@ -3872,7 +3881,9 @@
|
|
|
3872
3881
|
}
|
|
3873
3882
|
});
|
|
3874
3883
|
|
|
3875
|
-
const _hoisted_1$2 = {
|
|
3884
|
+
const _hoisted_1$2 = { class: "m-form-item__content" };
|
|
3885
|
+
const _hoisted_2$1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "m-form-validate__warning" }, "输入内容前后有空格,是否移除空格?", -1);
|
|
3886
|
+
const _hoisted_3 = { style: { "display": "flex", "justify-content": "flex-end" } };
|
|
3876
3887
|
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
3877
3888
|
...{
|
|
3878
3889
|
name: "MFormText"
|
|
@@ -3895,18 +3906,45 @@
|
|
|
3895
3906
|
const emit = __emit;
|
|
3896
3907
|
useAddField(props.prop);
|
|
3897
3908
|
const mForm = vue.inject("mForm");
|
|
3909
|
+
const appendConfig = vue.computed(() => {
|
|
3910
|
+
if (typeof props.config.append === "string") {
|
|
3911
|
+
return {
|
|
3912
|
+
text: props.config.append,
|
|
3913
|
+
type: "button",
|
|
3914
|
+
handler: void 0
|
|
3915
|
+
};
|
|
3916
|
+
}
|
|
3917
|
+
if (props.config.append && typeof props.config.append === "object") {
|
|
3918
|
+
if (props.config.append.value === 0) {
|
|
3919
|
+
return false;
|
|
3920
|
+
}
|
|
3921
|
+
return props.config.append;
|
|
3922
|
+
}
|
|
3923
|
+
return false;
|
|
3924
|
+
});
|
|
3925
|
+
const popoverVisible = vue.ref(false);
|
|
3926
|
+
const confirmTrimHandler = () => {
|
|
3927
|
+
emit("change", props.model[props.name].trim() || "");
|
|
3928
|
+
popoverVisible.value = false;
|
|
3929
|
+
};
|
|
3930
|
+
const checkWhiteSpace = (value) => {
|
|
3931
|
+
if (typeof value === "string" && !props.config.trim) {
|
|
3932
|
+
popoverVisible.value = value.trim() !== value;
|
|
3933
|
+
}
|
|
3934
|
+
};
|
|
3898
3935
|
const changeHandler = (value) => {
|
|
3899
3936
|
emit("change", value);
|
|
3900
3937
|
};
|
|
3901
3938
|
const inputHandler = (v) => {
|
|
3939
|
+
checkWhiteSpace(v);
|
|
3902
3940
|
emit("input", v);
|
|
3903
3941
|
mForm?.$emit("field-input", props.prop, v);
|
|
3904
3942
|
};
|
|
3905
3943
|
const buttonClickHandler = () => {
|
|
3906
|
-
if (
|
|
3944
|
+
if (!appendConfig.value)
|
|
3907
3945
|
return;
|
|
3908
|
-
if (
|
|
3909
|
-
|
|
3946
|
+
if (typeof appendConfig.value.handler === "function") {
|
|
3947
|
+
appendConfig.value.handler(mForm, {
|
|
3910
3948
|
model: props.model,
|
|
3911
3949
|
values: mForm?.values
|
|
3912
3950
|
});
|
|
@@ -3964,36 +4002,70 @@
|
|
|
3964
4002
|
emit("change", props.model[props.name]);
|
|
3965
4003
|
};
|
|
3966
4004
|
return (_ctx, _cache) => {
|
|
3967
|
-
return vue.openBlock(), vue.createBlock(vue.unref(design.
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
4005
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicPopover), {
|
|
4006
|
+
visible: popoverVisible.value,
|
|
4007
|
+
width: "220px"
|
|
4008
|
+
}, {
|
|
4009
|
+
reference: vue.withCtx(() => [
|
|
4010
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
4011
|
+
modelValue: _ctx.model[_ctx.name],
|
|
4012
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.model[_ctx.name] = $event),
|
|
4013
|
+
clearable: "",
|
|
4014
|
+
size: _ctx.size,
|
|
4015
|
+
placeholder: _ctx.config.placeholder,
|
|
4016
|
+
disabled: _ctx.disabled,
|
|
4017
|
+
onChange: changeHandler,
|
|
4018
|
+
onInput: inputHandler,
|
|
4019
|
+
onKeyup: _cache[1] || (_cache[1] = ($event) => keyUpHandler($event))
|
|
4020
|
+
}, vue.createSlots({ _: 2 }, [
|
|
4021
|
+
appendConfig.value ? {
|
|
4022
|
+
name: "append",
|
|
4023
|
+
fn: vue.withCtx(() => [
|
|
4024
|
+
appendConfig.value.type === "button" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
4025
|
+
key: 0,
|
|
4026
|
+
style: { "color": "#409eff" },
|
|
4027
|
+
size: _ctx.size,
|
|
4028
|
+
onClick: vue.withModifiers(buttonClickHandler, ["prevent"])
|
|
4029
|
+
}, {
|
|
4030
|
+
default: vue.withCtx(() => [
|
|
4031
|
+
vue.createTextVNode(vue.toDisplayString(appendConfig.value.text), 1)
|
|
4032
|
+
]),
|
|
4033
|
+
_: 1
|
|
4034
|
+
}, 8, ["size", "onClick"])) : vue.createCommentVNode("", true)
|
|
3990
4035
|
]),
|
|
3991
|
-
|
|
3992
|
-
}
|
|
3993
|
-
]),
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
4036
|
+
key: "0"
|
|
4037
|
+
} : void 0
|
|
4038
|
+
]), 1032, ["modelValue", "size", "placeholder", "disabled"])
|
|
4039
|
+
]),
|
|
4040
|
+
default: vue.withCtx(() => [
|
|
4041
|
+
vue.createElementVNode("div", _hoisted_1$2, [
|
|
4042
|
+
_hoisted_2$1,
|
|
4043
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
4044
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4045
|
+
type: "text",
|
|
4046
|
+
size: "small",
|
|
4047
|
+
onClick: _cache[2] || (_cache[2] = ($event) => popoverVisible.value = false)
|
|
4048
|
+
}, {
|
|
4049
|
+
default: vue.withCtx(() => [
|
|
4050
|
+
vue.createTextVNode("保持原样")
|
|
4051
|
+
]),
|
|
4052
|
+
_: 1
|
|
4053
|
+
}),
|
|
4054
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4055
|
+
type: "primary",
|
|
4056
|
+
size: "small",
|
|
4057
|
+
onClick: confirmTrimHandler
|
|
4058
|
+
}, {
|
|
4059
|
+
default: vue.withCtx(() => [
|
|
4060
|
+
vue.createTextVNode("移除空格")
|
|
4061
|
+
]),
|
|
4062
|
+
_: 1
|
|
4063
|
+
})
|
|
4064
|
+
])
|
|
4065
|
+
])
|
|
4066
|
+
]),
|
|
4067
|
+
_: 1
|
|
4068
|
+
}, 8, ["visible"]);
|
|
3997
4069
|
};
|
|
3998
4070
|
}
|
|
3999
4071
|
});
|
|
@@ -4442,6 +4514,9 @@
|
|
|
4442
4514
|
}
|
|
4443
4515
|
});
|
|
4444
4516
|
|
|
4517
|
+
const createForm = function(config) {
|
|
4518
|
+
return config;
|
|
4519
|
+
};
|
|
4445
4520
|
const defaultInstallOpt = {};
|
|
4446
4521
|
const index = {
|
|
4447
4522
|
install(app, opt = {}) {
|
|
@@ -4512,6 +4587,7 @@
|
|
|
4512
4587
|
exports.MTextarea = _sfc_main$4;
|
|
4513
4588
|
exports.MTime = _sfc_main$3;
|
|
4514
4589
|
exports.MTimerange = _sfc_main$2;
|
|
4590
|
+
exports.createForm = createForm;
|
|
4515
4591
|
exports.createValues = createValues;
|
|
4516
4592
|
exports.default = index;
|
|
4517
4593
|
exports.display = display;
|