@dt-frames/ui 2.0.21 → 2.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/table/index.js +68 -86
- package/package.json +1 -1
|
@@ -270,11 +270,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
270
270
|
key: 0,
|
|
271
271
|
class: normalizeClass(unref(getExpandNum) ? "dt-expand-has-collapse" : "")
|
|
272
272
|
}, [
|
|
273
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(actionBtns.value, (item,
|
|
273
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(actionBtns.value, (item, index) => {
|
|
274
274
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
275
275
|
item.ifShow ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
276
276
|
unref(getExpandNum) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
277
|
-
|
|
277
|
+
index < unref(getExpandNum) ? withDirectives((openBlock(), createElementBlock("span", {
|
|
278
278
|
key: 0,
|
|
279
279
|
class: "dt-table-action-btn w-8 inline-block",
|
|
280
280
|
onClick: ($event) => handleAction(item)
|
|
@@ -282,30 +282,30 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
282
282
|
createTextVNode(toDisplayString(item.label()), 1)
|
|
283
283
|
], 8, _hoisted_1$8)), [
|
|
284
284
|
[_directive_auth, getAuth(item.auth)]
|
|
285
|
-
]) : createCommentVNode("
|
|
286
|
-
|
|
285
|
+
]) : createCommentVNode("", true),
|
|
286
|
+
index >= unref(getExpandNum) && index === actionBtns.value.length - 1 ? (openBlock(), createBlock(_component_ADropdown, {
|
|
287
287
|
key: 1,
|
|
288
288
|
"get-popup-container": getPopupContainer$1,
|
|
289
|
-
trigger: ["click"]
|
|
289
|
+
trigger: ["click"],
|
|
290
|
+
destroyPopupOnHide: true
|
|
290
291
|
}, {
|
|
291
292
|
overlay: withCtx(() => [
|
|
292
293
|
createVNode(_component_AMenu, { class: "dt-action-select flex flex-col" }, {
|
|
293
294
|
default: withCtx(() => [
|
|
294
295
|
(openBlock(true), createElementBlock(Fragment, null, renderList(actionBtns.value, (item1, index1) => {
|
|
295
296
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
296
|
-
index1 >= unref(getExpandNum) ? withDirectives((openBlock(), createElementBlock("span", _hoisted_3$2, [
|
|
297
|
-
|
|
298
|
-
key: 0,
|
|
297
|
+
index1 >= unref(getExpandNum) && item1.ifShow ? withDirectives((openBlock(), createElementBlock("span", _hoisted_3$2, [
|
|
298
|
+
createVNode(_component_AMenuItem, {
|
|
299
299
|
onClick: ($event) => handleAction(item1)
|
|
300
300
|
}, {
|
|
301
301
|
default: withCtx(() => [
|
|
302
302
|
createElementVNode("span", _hoisted_4$2, toDisplayString(item1.label()), 1)
|
|
303
303
|
]),
|
|
304
304
|
_: 2
|
|
305
|
-
}, 1032, ["onClick"])
|
|
305
|
+
}, 1032, ["onClick"])
|
|
306
306
|
])), [
|
|
307
307
|
[_directive_auth, getAuth(item1.auth)]
|
|
308
|
-
]) : createCommentVNode("
|
|
308
|
+
]) : createCommentVNode("", true)
|
|
309
309
|
], 64);
|
|
310
310
|
}), 256))
|
|
311
311
|
]),
|
|
@@ -313,10 +313,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
313
313
|
})
|
|
314
314
|
]),
|
|
315
315
|
default: withCtx(() => [
|
|
316
|
-
unref(showMore) ? (openBlock(), createElementBlock("span", _hoisted_2$3, " \u66F4\u591A ")) : createCommentVNode("
|
|
316
|
+
unref(showMore) ? (openBlock(), createElementBlock("span", _hoisted_2$3, " \u66F4\u591A ")) : createCommentVNode("", true)
|
|
317
317
|
]),
|
|
318
318
|
_: 1
|
|
319
|
-
})) : createCommentVNode("
|
|
319
|
+
})) : createCommentVNode("", true)
|
|
320
320
|
], 64)) : (openBlock(), createBlock(_component_ATooltip, {
|
|
321
321
|
key: 1,
|
|
322
322
|
placement: "bottom"
|
|
@@ -337,7 +337,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
337
337
|
]),
|
|
338
338
|
_: 2
|
|
339
339
|
}, 1024))
|
|
340
|
-
], 64)) : createCommentVNode("
|
|
340
|
+
], 64)) : createCommentVNode("", true)
|
|
341
341
|
], 64);
|
|
342
342
|
}), 256))
|
|
343
343
|
], 2)) : (openBlock(), createBlock(_component_ADropdown, {
|
|
@@ -364,7 +364,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
364
364
|
createElementVNode("span", _hoisted_8, toDisplayString(item.label()), 1)
|
|
365
365
|
]),
|
|
366
366
|
_: 2
|
|
367
|
-
}, 1032, ["onClick"])) : createCommentVNode("
|
|
367
|
+
}, 1032, ["onClick"])) : createCommentVNode("", true)
|
|
368
368
|
])), [
|
|
369
369
|
[_directive_auth, getAuth(item.auth)]
|
|
370
370
|
]);
|
|
@@ -381,14 +381,6 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
381
381
|
};
|
|
382
382
|
}
|
|
383
383
|
});
|
|
384
|
-
const _export_sfc = (sfc, props2) => {
|
|
385
|
-
const target = sfc.__vccOpts || sfc;
|
|
386
|
-
for (const [key, val] of props2) {
|
|
387
|
-
target[key] = val;
|
|
388
|
-
}
|
|
389
|
-
return target;
|
|
390
|
-
};
|
|
391
|
-
const TableAction = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/TableAction.vue"]]);
|
|
392
384
|
const tableKey = Symbol("dt-page");
|
|
393
385
|
function createTableInstance(instance) {
|
|
394
386
|
provide(tableKey, instance);
|
|
@@ -482,9 +474,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
482
474
|
const valueField = isCheckValue ? "checked" : "value";
|
|
483
475
|
const val = unref(currentValueRef);
|
|
484
476
|
let compProps = props2.column?.editComponentProps ?? {};
|
|
485
|
-
const { record, column, index
|
|
477
|
+
const { record, column, index } = props2;
|
|
486
478
|
if (isFunction(compProps)) {
|
|
487
|
-
compProps = compProps({ text: val, record, column, index
|
|
479
|
+
compProps = compProps({ text: val, record, column, index }) ?? {};
|
|
488
480
|
}
|
|
489
481
|
if (unref(getComponent) === "InputNumber") {
|
|
490
482
|
compProps = {
|
|
@@ -564,9 +556,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
564
556
|
};
|
|
565
557
|
}
|
|
566
558
|
});
|
|
567
|
-
const EditableCell = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/editTable/EditTableCell.vue"]]);
|
|
568
559
|
function renderEditCell(column) {
|
|
569
|
-
return ({ text: value, record, index
|
|
560
|
+
return ({ text: value, record, index }) => {
|
|
570
561
|
record.onValid = async () => {
|
|
571
562
|
if (isArray(record?.validCbs)) {
|
|
572
563
|
const validFns = (record?.validCbs || []).map((fn) => fn());
|
|
@@ -594,11 +585,11 @@ function renderEditCell(column) {
|
|
|
594
585
|
}
|
|
595
586
|
return true;
|
|
596
587
|
};
|
|
597
|
-
return h(
|
|
588
|
+
return h(_sfc_main$8, {
|
|
598
589
|
value,
|
|
599
590
|
record,
|
|
600
591
|
column,
|
|
601
|
-
index
|
|
592
|
+
index
|
|
602
593
|
});
|
|
603
594
|
};
|
|
604
595
|
}
|
|
@@ -658,7 +649,7 @@ function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
|
658
649
|
width: unref(getIsZH) ? 50 : 70,
|
|
659
650
|
title: t("NUMBER"),
|
|
660
651
|
align: "center",
|
|
661
|
-
customRender: ({ index
|
|
652
|
+
customRender: ({ index, renderIndex, record }) => {
|
|
662
653
|
if (virtual && record?.index) {
|
|
663
654
|
return record?.index;
|
|
664
655
|
}
|
|
@@ -666,10 +657,10 @@ function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
|
666
657
|
const { appConf } = useAppStore();
|
|
667
658
|
const { defaultPageSize } = appConf.ui.table;
|
|
668
659
|
if (isBoolean(getPagination)) {
|
|
669
|
-
return `${
|
|
660
|
+
return `${index + 1}`;
|
|
670
661
|
}
|
|
671
662
|
const { current = 1, pageSize = defaultPageSize } = getPagination;
|
|
672
|
-
return ((current < 1 ? 1 : current) - 1) * pageSize +
|
|
663
|
+
return ((current < 1 ? 1 : current) - 1) * pageSize + index + 1;
|
|
673
664
|
},
|
|
674
665
|
...isFixedLeft ? {
|
|
675
666
|
fixed: "left"
|
|
@@ -685,8 +676,8 @@ function handleActionColumn(propsRef, columns) {
|
|
|
685
676
|
{
|
|
686
677
|
label: t("EDIT"),
|
|
687
678
|
icon: "mdi:text-box-edit-outline",
|
|
688
|
-
onClick: (row,
|
|
689
|
-
unref(propsRef).onOpenUpdateDialog(row,
|
|
679
|
+
onClick: (row, index) => {
|
|
680
|
+
unref(propsRef).onOpenUpdateDialog(row, index, unref(propsRef).rowKey);
|
|
690
681
|
}
|
|
691
682
|
},
|
|
692
683
|
{
|
|
@@ -723,8 +714,8 @@ function handleActionColumn(propsRef, columns) {
|
|
|
723
714
|
if (expand) {
|
|
724
715
|
if (expandNum) {
|
|
725
716
|
let showMore = false;
|
|
726
|
-
column.btns.forEach((btn,
|
|
727
|
-
if (
|
|
717
|
+
column.btns.forEach((btn, index) => {
|
|
718
|
+
if (index < expandNum && (btn.auth && allAuths.includes(getAuth(btn.auth)) || !btn.auth)) {
|
|
728
719
|
w += (unref(getIsZH) ? btn.label.length : btn.enLabel.length) * 14 + 8;
|
|
729
720
|
} else if (btn.auth && allAuths.includes(getAuth(btn.auth)) || !btn.auth) {
|
|
730
721
|
showMore = true;
|
|
@@ -750,15 +741,15 @@ function handleActionColumn(propsRef, columns) {
|
|
|
750
741
|
};
|
|
751
742
|
columns.push({
|
|
752
743
|
...columnObj,
|
|
753
|
-
customRender: ({ record, index
|
|
744
|
+
customRender: ({ record, index }) => {
|
|
754
745
|
return h(
|
|
755
|
-
|
|
746
|
+
_sfc_main$9,
|
|
756
747
|
omit(
|
|
757
748
|
{
|
|
758
749
|
...columnObj,
|
|
759
750
|
authPrefix,
|
|
760
751
|
record,
|
|
761
|
-
index
|
|
752
|
+
index
|
|
762
753
|
},
|
|
763
754
|
"align"
|
|
764
755
|
)
|
|
@@ -928,7 +919,7 @@ function useColumns(propsRef, getPaginationRef, tableElRef) {
|
|
|
928
919
|
};
|
|
929
920
|
}
|
|
930
921
|
function useCustomRow(propsRef, { setSelectedRowKeys, getSelectedRowKeys, clearSelectedRowKeys, emits }) {
|
|
931
|
-
const customRow = (record,
|
|
922
|
+
const customRow = (record, index) => {
|
|
932
923
|
return {
|
|
933
924
|
onClick: (e) => {
|
|
934
925
|
e?.stopPropagation();
|
|
@@ -987,19 +978,19 @@ function useCustomRow(propsRef, { setSelectedRowKeys, getSelectedRowKeys, clearS
|
|
|
987
978
|
}
|
|
988
979
|
}
|
|
989
980
|
handleClick();
|
|
990
|
-
emits("row-click", record,
|
|
981
|
+
emits("row-click", record, index, e);
|
|
991
982
|
},
|
|
992
983
|
onDblclick: (event) => {
|
|
993
|
-
emits("row-dbClick", record,
|
|
984
|
+
emits("row-dbClick", record, index, event);
|
|
994
985
|
},
|
|
995
986
|
onContextmenu: (event) => {
|
|
996
|
-
emits("row-contextmenu", record,
|
|
987
|
+
emits("row-contextmenu", record, index, event);
|
|
997
988
|
},
|
|
998
989
|
onMouseenter: (event) => {
|
|
999
|
-
emits("row-mouseenter", record,
|
|
990
|
+
emits("row-mouseenter", record, index, event);
|
|
1000
991
|
},
|
|
1001
992
|
onMouseleave: (event) => {
|
|
1002
|
-
emits("row-mouseleave", record,
|
|
993
|
+
emits("row-mouseleave", record, index, event);
|
|
1003
994
|
}
|
|
1004
995
|
};
|
|
1005
996
|
};
|
|
@@ -1121,7 +1112,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1121
1112
|
const _component_ATooltip = Tooltip;
|
|
1122
1113
|
return openBlock(), createBlock(_component_ATooltip, { placement: "top" }, {
|
|
1123
1114
|
title: withCtx(() => [
|
|
1124
|
-
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$6, toDisplayString(unref(t)("FULLSCREEN")), 1)) : createCommentVNode("
|
|
1115
|
+
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$6, toDisplayString(unref(t)("FULLSCREEN")), 1)) : createCommentVNode("", true)
|
|
1125
1116
|
]),
|
|
1126
1117
|
default: withCtx(() => [
|
|
1127
1118
|
createElementVNode("span", {
|
|
@@ -1138,7 +1129,6 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1138
1129
|
};
|
|
1139
1130
|
}
|
|
1140
1131
|
});
|
|
1141
|
-
const FullscreenSetting = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/tableSetting/Fullscreen.vue"]]);
|
|
1142
1132
|
const _hoisted_1$5 = { class: "column-select" };
|
|
1143
1133
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1144
1134
|
__name: "DownloadCtrl",
|
|
@@ -1210,7 +1200,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1210
1200
|
createVNode(_component_ADivider, { dashed: "" }),
|
|
1211
1201
|
createVNode(_component_ARow, null, {
|
|
1212
1202
|
default: withCtx(() => [
|
|
1213
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(modalData.value, (it,
|
|
1203
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(modalData.value, (it, index) => {
|
|
1214
1204
|
return openBlock(), createBlock(_component_ACol, { span: 8 }, {
|
|
1215
1205
|
default: withCtx(() => [
|
|
1216
1206
|
createVNode(_component_ACheckbox, {
|
|
@@ -1236,7 +1226,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1236
1226
|
};
|
|
1237
1227
|
}
|
|
1238
1228
|
});
|
|
1239
|
-
const DownloadCtrl = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/tableSetting/DownloadCtrl.vue"]]);
|
|
1240
1229
|
const _hoisted_1$4 = /* @__PURE__ */ createElementVNode("span", { class: "flex" }, [
|
|
1241
1230
|
/* @__PURE__ */ createElementVNode("i", { class: "i ic:baseline-download w-7 leading-7 text-center cursor-pointer" })
|
|
1242
1231
|
], -1);
|
|
@@ -1295,19 +1284,19 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1295
1284
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_CURRENT_PAGE")), 1)
|
|
1296
1285
|
]),
|
|
1297
1286
|
_: 1
|
|
1298
|
-
})) : createCommentVNode("
|
|
1287
|
+
})) : createCommentVNode("", true),
|
|
1299
1288
|
unref(showSelectedDownload) ? (openBlock(), createBlock(_component_AMenuItem, { key: "select" }, {
|
|
1300
1289
|
default: withCtx(() => [
|
|
1301
1290
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_SELECT_COLUMN")), 1)
|
|
1302
1291
|
]),
|
|
1303
1292
|
_: 1
|
|
1304
|
-
})) : createCommentVNode("
|
|
1293
|
+
})) : createCommentVNode("", true),
|
|
1305
1294
|
unref(showBackDownload) ? (openBlock(), createBlock(_component_AMenuItem, { key: "all" }, {
|
|
1306
1295
|
default: withCtx(() => [
|
|
1307
1296
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_ALL")), 1)
|
|
1308
1297
|
]),
|
|
1309
1298
|
_: 1
|
|
1310
|
-
})) : createCommentVNode("
|
|
1299
|
+
})) : createCommentVNode("", true)
|
|
1311
1300
|
]),
|
|
1312
1301
|
_: 1
|
|
1313
1302
|
})
|
|
@@ -1317,14 +1306,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1317
1306
|
]),
|
|
1318
1307
|
_: 1
|
|
1319
1308
|
}),
|
|
1320
|
-
createVNode(
|
|
1309
|
+
createVNode(_sfc_main$6, { onRegister: unref(registerDialog) }, null, 8, ["onRegister"])
|
|
1321
1310
|
]),
|
|
1322
1311
|
_: 1
|
|
1323
1312
|
});
|
|
1324
1313
|
};
|
|
1325
1314
|
}
|
|
1326
1315
|
});
|
|
1327
|
-
const Download = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/tableSetting/Download.vue"]]);
|
|
1328
1316
|
const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("i", { class: "i ant-design:drag-outlined drag-icon cursor-pointer" }, null, -1);
|
|
1329
1317
|
const _hoisted_2$2 = ["onClick"];
|
|
1330
1318
|
const _hoisted_3$1 = ["onClick"];
|
|
@@ -1467,9 +1455,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1467
1455
|
return;
|
|
1468
1456
|
const columns = getColumns();
|
|
1469
1457
|
const isFixed = item.fixed === fixed ? false : fixed;
|
|
1470
|
-
const
|
|
1471
|
-
if (
|
|
1472
|
-
columns[
|
|
1458
|
+
const index = columns.findIndex((col) => col.dataIndex === item.dataIndex);
|
|
1459
|
+
if (index !== -1) {
|
|
1460
|
+
columns[index].fixed = isFixed;
|
|
1473
1461
|
}
|
|
1474
1462
|
item.fixed = isFixed;
|
|
1475
1463
|
if (isFixed && !item.width) {
|
|
@@ -1660,7 +1648,6 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1660
1648
|
};
|
|
1661
1649
|
}
|
|
1662
1650
|
});
|
|
1663
|
-
const ColumnSetting = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/tableSetting/Column.vue"]]);
|
|
1664
1651
|
const _hoisted_1$2 = { class: "flex dt-table-setting" };
|
|
1665
1652
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1666
1653
|
__name: "index",
|
|
@@ -1686,17 +1673,16 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1686
1673
|
}
|
|
1687
1674
|
return (_ctx, _cache) => {
|
|
1688
1675
|
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
1689
|
-
unref(getSetting).download ? (openBlock(), createBlock(
|
|
1690
|
-
unref(getSetting).setting ? (openBlock(), createBlock(
|
|
1676
|
+
unref(getSetting).download ? (openBlock(), createBlock(_sfc_main$5, normalizeProps(mergeProps({ key: 0 }, unref(getSetting))), null, 16)) : createCommentVNode("", true),
|
|
1677
|
+
unref(getSetting).setting ? (openBlock(), createBlock(_sfc_main$4, {
|
|
1691
1678
|
key: 1,
|
|
1692
1679
|
onColumnsChange: handleColumnChange
|
|
1693
|
-
})) : createCommentVNode("
|
|
1694
|
-
unref(getSetting).fullscreen ? (openBlock(), createBlock(
|
|
1680
|
+
})) : createCommentVNode("", true),
|
|
1681
|
+
unref(getSetting).fullscreen ? (openBlock(), createBlock(_sfc_main$7, { key: 2 })) : createCommentVNode("", true)
|
|
1695
1682
|
]);
|
|
1696
1683
|
};
|
|
1697
1684
|
}
|
|
1698
1685
|
});
|
|
1699
|
-
const DtTableSetting = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/tableSetting/index.vue"]]);
|
|
1700
1686
|
const _hoisted_1$1 = { class: "dt-table-header" };
|
|
1701
1687
|
const _hoisted_2$1 = { class: "flex flex-row justify-between" };
|
|
1702
1688
|
const _hoisted_3 = { class: "flex flex-row flex-1" };
|
|
@@ -1732,21 +1718,20 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1732
1718
|
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1733
1719
|
createElementVNode("div", _hoisted_2$1, [
|
|
1734
1720
|
createElementVNode("div", _hoisted_3, [
|
|
1735
|
-
unref(getActionsProps)?.buttonList.length ? (openBlock(), createBlock(unref(DtFormButtons), normalizeProps(mergeProps({ key: 0 }, unref(getActionsProps))), null, 16)) : createCommentVNode("
|
|
1721
|
+
unref(getActionsProps)?.buttonList.length ? (openBlock(), createBlock(unref(DtFormButtons), normalizeProps(mergeProps({ key: 0 }, unref(getActionsProps))), null, 16)) : createCommentVNode("", true),
|
|
1736
1722
|
renderSlot(_ctx.$slots, "toolbar")
|
|
1737
1723
|
]),
|
|
1738
1724
|
__props.tableSetting ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
1739
|
-
createVNode(
|
|
1740
|
-
])) : createCommentVNode("
|
|
1725
|
+
createVNode(_sfc_main$3, { setting: __props.tableSetting }, null, 8, ["setting"])
|
|
1726
|
+
])) : createCommentVNode("", true)
|
|
1741
1727
|
]),
|
|
1742
1728
|
_ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
1743
1729
|
renderSlot(_ctx.$slots, "headerTop")
|
|
1744
|
-
])) : createCommentVNode("
|
|
1730
|
+
])) : createCommentVNode("", true)
|
|
1745
1731
|
]);
|
|
1746
1732
|
};
|
|
1747
1733
|
}
|
|
1748
1734
|
});
|
|
1749
|
-
const TableHeader = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/TableHeader.vue"]]);
|
|
1750
1735
|
function useTableHeader(propsRef, slots, handlers) {
|
|
1751
1736
|
const { t } = useI18n("UI");
|
|
1752
1737
|
const getHeaderProps = computed(() => {
|
|
@@ -1759,7 +1744,7 @@ function useTableHeader(propsRef, slots, handlers) {
|
|
|
1759
1744
|
const hideTitle = (!toolbar || !toolbar.filter((it) => it.show ?? true).length) && !slots.toolbar && !slots.headerTop && !tableSetting;
|
|
1760
1745
|
return {
|
|
1761
1746
|
title: hideTitle ? null : () => h(
|
|
1762
|
-
|
|
1747
|
+
_sfc_main$2,
|
|
1763
1748
|
{
|
|
1764
1749
|
tableSetting,
|
|
1765
1750
|
toolbar,
|
|
@@ -2054,14 +2039,14 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
2054
2039
|
};
|
|
2055
2040
|
}
|
|
2056
2041
|
function useRows(propsRef) {
|
|
2057
|
-
function getRowClassName(record,
|
|
2042
|
+
function getRowClassName(record, index) {
|
|
2058
2043
|
const { striped, rowClassName } = unref(propsRef);
|
|
2059
2044
|
const classNames = [];
|
|
2060
2045
|
if (striped) {
|
|
2061
|
-
classNames.push(
|
|
2046
|
+
classNames.push(index % 2 === 1 ? "table-striped" : "");
|
|
2062
2047
|
}
|
|
2063
2048
|
if (rowClassName && isFunction(rowClassName)) {
|
|
2064
|
-
classNames.push(rowClassName(record,
|
|
2049
|
+
classNames.push(rowClassName(record, index));
|
|
2065
2050
|
}
|
|
2066
2051
|
return classNames.join(" ");
|
|
2067
2052
|
}
|
|
@@ -2091,7 +2076,7 @@ const _sfc_main$1 = {
|
|
|
2091
2076
|
const {
|
|
2092
2077
|
column,
|
|
2093
2078
|
record,
|
|
2094
|
-
index
|
|
2079
|
+
index
|
|
2095
2080
|
} = props2;
|
|
2096
2081
|
const {
|
|
2097
2082
|
render,
|
|
@@ -2136,7 +2121,7 @@ const _sfc_main$1 = {
|
|
|
2136
2121
|
let txt = link.text ?? text;
|
|
2137
2122
|
renderText.value = createVNode("a", {
|
|
2138
2123
|
"class": "primary-color-link",
|
|
2139
|
-
"onClick": () => link(record,
|
|
2124
|
+
"onClick": () => link(record, index)
|
|
2140
2125
|
}, [txt]);
|
|
2141
2126
|
} else if (isVnode(render)) {
|
|
2142
2127
|
renderText.value = createVNode(Fragment, null, [createTextVNode(" "), render, createTextVNode(" ")]);
|
|
@@ -2147,7 +2132,7 @@ const _sfc_main$1 = {
|
|
|
2147
2132
|
});
|
|
2148
2133
|
}
|
|
2149
2134
|
} else if (isFunction(render)) {
|
|
2150
|
-
let afterRenderData = render(record,
|
|
2135
|
+
let afterRenderData = render(record, index, text);
|
|
2151
2136
|
if (afterRenderData.__v_isRef) {
|
|
2152
2137
|
renderText = afterRenderData;
|
|
2153
2138
|
} else if (afterRenderData.setup) {
|
|
@@ -2165,7 +2150,6 @@ const _sfc_main$1 = {
|
|
|
2165
2150
|
return () => createVNode("span", null, [unref(renderText)]);
|
|
2166
2151
|
}
|
|
2167
2152
|
};
|
|
2168
|
-
const TableRender = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/TableRender.vue"]]);
|
|
2169
2153
|
const DEFAULT_SORT_FN = (sortInfo) => {
|
|
2170
2154
|
const { field, order } = sortInfo;
|
|
2171
2155
|
return field && order ? { field, order } : {};
|
|
@@ -2267,11 +2251,11 @@ const TableProps = {
|
|
|
2267
2251
|
},
|
|
2268
2252
|
onOpenUpdateDialog: {
|
|
2269
2253
|
type: Function,
|
|
2270
|
-
default: (row,
|
|
2254
|
+
default: (row, index) => ({})
|
|
2271
2255
|
},
|
|
2272
2256
|
onDelete: {
|
|
2273
2257
|
type: Function,
|
|
2274
|
-
default: (row,
|
|
2258
|
+
default: (row, index) => ({})
|
|
2275
2259
|
},
|
|
2276
2260
|
onDeletes: {
|
|
2277
2261
|
type: Function,
|
|
@@ -2427,16 +2411,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2427
2411
|
"row-class-name": unref(getRowClassName),
|
|
2428
2412
|
onChange: unref(handleTableChange)
|
|
2429
2413
|
}), createSlots({
|
|
2430
|
-
bodyCell: withCtx(({ column, record, index
|
|
2431
|
-
_ctx.$slots.bodyCell ? renderSlot(_ctx.$slots, "bodyCell", normalizeProps(mergeProps({ key: 0 }, { column, record, index
|
|
2432
|
-
column.slot ? renderSlot(_ctx.$slots, column.slot, normalizeProps(mergeProps({ key: 1 }, { column, record, index
|
|
2433
|
-
|
|
2434
|
-
column?.render && !column.slot && !_ctx.$slots.bodyCell ? (openBlock(), createBlock(TableRender, {
|
|
2414
|
+
bodyCell: withCtx(({ column, record, index }) => [
|
|
2415
|
+
_ctx.$slots.bodyCell ? renderSlot(_ctx.$slots, "bodyCell", normalizeProps(mergeProps({ key: 0 }, { column, record, index }))) : createCommentVNode("", true),
|
|
2416
|
+
column.slot ? renderSlot(_ctx.$slots, column.slot, normalizeProps(mergeProps({ key: 1 }, { column, record, index }))) : createCommentVNode("", true),
|
|
2417
|
+
column?.render && !column.slot && !_ctx.$slots.bodyCell ? (openBlock(), createBlock(_sfc_main$1, {
|
|
2435
2418
|
key: 2,
|
|
2436
2419
|
column,
|
|
2437
2420
|
record,
|
|
2438
|
-
index
|
|
2439
|
-
}, null, 8, ["column", "record", "index"])) : createCommentVNode("
|
|
2421
|
+
index
|
|
2422
|
+
}, null, 8, ["column", "record", "index"])) : createCommentVNode("", true)
|
|
2440
2423
|
]),
|
|
2441
2424
|
emptyText: withCtx(() => [
|
|
2442
2425
|
_hoisted_1,
|
|
@@ -2456,8 +2439,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2456
2439
|
};
|
|
2457
2440
|
}
|
|
2458
2441
|
});
|
|
2459
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/index.vue"]]);
|
|
2460
2442
|
export {
|
|
2461
|
-
|
|
2443
|
+
_sfc_main as DtTable,
|
|
2462
2444
|
useTable
|
|
2463
2445
|
};
|