@dt-frames/ui 2.0.20 → 2.0.21
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/form/index.less +0 -45
- package/es/components/table/index.js +88 -67
- package/es/theme/index.js +98 -147
- package/es/theme/src/components/header/components/size.d.ts +1 -262
- package/es/theme/src/components/header/index.d.ts +1 -262
- package/es/theme/src/components/header/multiple-header.d.ts +1 -262
- package/es/theme/src/index.d.ts +2 -524
- package/package.json +1 -1
|
@@ -44,52 +44,7 @@
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.ant-input{
|
|
48
|
-
font-size: 13px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.ant-btn{
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
justify-content: center;
|
|
55
|
-
font-size: 13px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.ant-btn.ant-btn-sm{
|
|
59
|
-
font-size: 12px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.ant-btn.ant-btn-lg {
|
|
63
|
-
font-size: 14px;
|
|
64
|
-
height: 34px;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.ant-input-sm{
|
|
68
|
-
font-size: 12px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.ant-input-lg{
|
|
72
|
-
font-size: 14px;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.ant-form-item{
|
|
76
|
-
// align-items: center;
|
|
77
|
-
.prefix, .suffix {
|
|
78
|
-
display: flex;
|
|
79
|
-
align-items: center;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
47
|
|
|
83
|
-
.ant-input-affix-wrapper{
|
|
84
|
-
display: flex;
|
|
85
|
-
align-items: center;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.ant-picker{
|
|
89
|
-
width: 100%;
|
|
90
|
-
height: 100%;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
48
|
|
|
94
49
|
.ant-form-item.small {
|
|
95
50
|
line-height: 30px;
|
|
@@ -241,9 +241,12 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
241
241
|
return label;
|
|
242
242
|
};
|
|
243
243
|
watch(
|
|
244
|
-
() =>
|
|
245
|
-
|
|
246
|
-
|
|
244
|
+
() => [
|
|
245
|
+
unref(props2.btns),
|
|
246
|
+
unref(props2.record)
|
|
247
|
+
],
|
|
248
|
+
([btns]) => {
|
|
249
|
+
actionBtns.value = btns.map((it) => {
|
|
247
250
|
return {
|
|
248
251
|
...it,
|
|
249
252
|
ifShow: isBoolean(it.show) ? it.show : isFunction(it.show) ? it.show(props2.record) : true,
|
|
@@ -267,11 +270,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
267
270
|
key: 0,
|
|
268
271
|
class: normalizeClass(unref(getExpandNum) ? "dt-expand-has-collapse" : "")
|
|
269
272
|
}, [
|
|
270
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(actionBtns.value, (item,
|
|
273
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(actionBtns.value, (item, index2) => {
|
|
271
274
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
272
275
|
item.ifShow ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
273
276
|
unref(getExpandNum) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
274
|
-
|
|
277
|
+
index2 < unref(getExpandNum) ? withDirectives((openBlock(), createElementBlock("span", {
|
|
275
278
|
key: 0,
|
|
276
279
|
class: "dt-table-action-btn w-8 inline-block",
|
|
277
280
|
onClick: ($event) => handleAction(item)
|
|
@@ -279,8 +282,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
279
282
|
createTextVNode(toDisplayString(item.label()), 1)
|
|
280
283
|
], 8, _hoisted_1$8)), [
|
|
281
284
|
[_directive_auth, getAuth(item.auth)]
|
|
282
|
-
]) : createCommentVNode("", true),
|
|
283
|
-
|
|
285
|
+
]) : createCommentVNode("v-if", true),
|
|
286
|
+
index2 >= unref(getExpandNum) && index2 === actionBtns.value.length - 1 ? (openBlock(), createBlock(_component_ADropdown, {
|
|
284
287
|
key: 1,
|
|
285
288
|
"get-popup-container": getPopupContainer$1,
|
|
286
289
|
trigger: ["click"]
|
|
@@ -299,10 +302,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
299
302
|
createElementVNode("span", _hoisted_4$2, toDisplayString(item1.label()), 1)
|
|
300
303
|
]),
|
|
301
304
|
_: 2
|
|
302
|
-
}, 1032, ["onClick"])) : createCommentVNode("", true)
|
|
305
|
+
}, 1032, ["onClick"])) : createCommentVNode("v-if", true)
|
|
303
306
|
])), [
|
|
304
307
|
[_directive_auth, getAuth(item1.auth)]
|
|
305
|
-
]) : createCommentVNode("", true)
|
|
308
|
+
]) : createCommentVNode("v-if", true)
|
|
306
309
|
], 64);
|
|
307
310
|
}), 256))
|
|
308
311
|
]),
|
|
@@ -310,10 +313,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
310
313
|
})
|
|
311
314
|
]),
|
|
312
315
|
default: withCtx(() => [
|
|
313
|
-
unref(showMore) ? (openBlock(), createElementBlock("span", _hoisted_2$3, " \u66F4\u591A ")) : createCommentVNode("", true)
|
|
316
|
+
unref(showMore) ? (openBlock(), createElementBlock("span", _hoisted_2$3, " \u66F4\u591A ")) : createCommentVNode("v-if", true)
|
|
314
317
|
]),
|
|
315
318
|
_: 1
|
|
316
|
-
})) : createCommentVNode("", true)
|
|
319
|
+
})) : createCommentVNode("v-if", true)
|
|
317
320
|
], 64)) : (openBlock(), createBlock(_component_ATooltip, {
|
|
318
321
|
key: 1,
|
|
319
322
|
placement: "bottom"
|
|
@@ -334,7 +337,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
334
337
|
]),
|
|
335
338
|
_: 2
|
|
336
339
|
}, 1024))
|
|
337
|
-
], 64)) : createCommentVNode("", true)
|
|
340
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
338
341
|
], 64);
|
|
339
342
|
}), 256))
|
|
340
343
|
], 2)) : (openBlock(), createBlock(_component_ADropdown, {
|
|
@@ -361,7 +364,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
361
364
|
createElementVNode("span", _hoisted_8, toDisplayString(item.label()), 1)
|
|
362
365
|
]),
|
|
363
366
|
_: 2
|
|
364
|
-
}, 1032, ["onClick"])) : createCommentVNode("", true)
|
|
367
|
+
}, 1032, ["onClick"])) : createCommentVNode("v-if", true)
|
|
365
368
|
])), [
|
|
366
369
|
[_directive_auth, getAuth(item.auth)]
|
|
367
370
|
]);
|
|
@@ -378,6 +381,14 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
378
381
|
};
|
|
379
382
|
}
|
|
380
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"]]);
|
|
381
392
|
const tableKey = Symbol("dt-page");
|
|
382
393
|
function createTableInstance(instance) {
|
|
383
394
|
provide(tableKey, instance);
|
|
@@ -471,9 +482,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
471
482
|
const valueField = isCheckValue ? "checked" : "value";
|
|
472
483
|
const val = unref(currentValueRef);
|
|
473
484
|
let compProps = props2.column?.editComponentProps ?? {};
|
|
474
|
-
const { record, column, index } = props2;
|
|
485
|
+
const { record, column, index: index2 } = props2;
|
|
475
486
|
if (isFunction(compProps)) {
|
|
476
|
-
compProps = compProps({ text: val, record, column, index }) ?? {};
|
|
487
|
+
compProps = compProps({ text: val, record, column, index: index2 }) ?? {};
|
|
477
488
|
}
|
|
478
489
|
if (unref(getComponent) === "InputNumber") {
|
|
479
490
|
compProps = {
|
|
@@ -553,8 +564,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
553
564
|
};
|
|
554
565
|
}
|
|
555
566
|
});
|
|
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"]]);
|
|
556
568
|
function renderEditCell(column) {
|
|
557
|
-
return ({ text: value, record, index }) => {
|
|
569
|
+
return ({ text: value, record, index: index2 }) => {
|
|
558
570
|
record.onValid = async () => {
|
|
559
571
|
if (isArray(record?.validCbs)) {
|
|
560
572
|
const validFns = (record?.validCbs || []).map((fn) => fn());
|
|
@@ -582,11 +594,11 @@ function renderEditCell(column) {
|
|
|
582
594
|
}
|
|
583
595
|
return true;
|
|
584
596
|
};
|
|
585
|
-
return h(
|
|
597
|
+
return h(EditableCell, {
|
|
586
598
|
value,
|
|
587
599
|
record,
|
|
588
600
|
column,
|
|
589
|
-
index
|
|
601
|
+
index: index2
|
|
590
602
|
});
|
|
591
603
|
};
|
|
592
604
|
}
|
|
@@ -646,7 +658,7 @@ function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
|
646
658
|
width: unref(getIsZH) ? 50 : 70,
|
|
647
659
|
title: t("NUMBER"),
|
|
648
660
|
align: "center",
|
|
649
|
-
customRender: ({ index, renderIndex, record }) => {
|
|
661
|
+
customRender: ({ index: index2, renderIndex, record }) => {
|
|
650
662
|
if (virtual && record?.index) {
|
|
651
663
|
return record?.index;
|
|
652
664
|
}
|
|
@@ -654,10 +666,10 @@ function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
|
654
666
|
const { appConf } = useAppStore();
|
|
655
667
|
const { defaultPageSize } = appConf.ui.table;
|
|
656
668
|
if (isBoolean(getPagination)) {
|
|
657
|
-
return `${
|
|
669
|
+
return `${index2 + 1}`;
|
|
658
670
|
}
|
|
659
671
|
const { current = 1, pageSize = defaultPageSize } = getPagination;
|
|
660
|
-
return ((current < 1 ? 1 : current) - 1) * pageSize +
|
|
672
|
+
return ((current < 1 ? 1 : current) - 1) * pageSize + index2 + 1;
|
|
661
673
|
},
|
|
662
674
|
...isFixedLeft ? {
|
|
663
675
|
fixed: "left"
|
|
@@ -673,8 +685,8 @@ function handleActionColumn(propsRef, columns) {
|
|
|
673
685
|
{
|
|
674
686
|
label: t("EDIT"),
|
|
675
687
|
icon: "mdi:text-box-edit-outline",
|
|
676
|
-
onClick: (row,
|
|
677
|
-
unref(propsRef).onOpenUpdateDialog(row,
|
|
688
|
+
onClick: (row, index2) => {
|
|
689
|
+
unref(propsRef).onOpenUpdateDialog(row, index2, unref(propsRef).rowKey);
|
|
678
690
|
}
|
|
679
691
|
},
|
|
680
692
|
{
|
|
@@ -711,8 +723,8 @@ function handleActionColumn(propsRef, columns) {
|
|
|
711
723
|
if (expand) {
|
|
712
724
|
if (expandNum) {
|
|
713
725
|
let showMore = false;
|
|
714
|
-
column.btns.forEach((btn,
|
|
715
|
-
if (
|
|
726
|
+
column.btns.forEach((btn, index2) => {
|
|
727
|
+
if (index2 < expandNum && (btn.auth && allAuths.includes(getAuth(btn.auth)) || !btn.auth)) {
|
|
716
728
|
w += (unref(getIsZH) ? btn.label.length : btn.enLabel.length) * 14 + 8;
|
|
717
729
|
} else if (btn.auth && allAuths.includes(getAuth(btn.auth)) || !btn.auth) {
|
|
718
730
|
showMore = true;
|
|
@@ -738,15 +750,15 @@ function handleActionColumn(propsRef, columns) {
|
|
|
738
750
|
};
|
|
739
751
|
columns.push({
|
|
740
752
|
...columnObj,
|
|
741
|
-
customRender: ({ record, index }) => {
|
|
753
|
+
customRender: ({ record, index: index2 }) => {
|
|
742
754
|
return h(
|
|
743
|
-
|
|
755
|
+
TableAction,
|
|
744
756
|
omit(
|
|
745
757
|
{
|
|
746
758
|
...columnObj,
|
|
747
759
|
authPrefix,
|
|
748
760
|
record,
|
|
749
|
-
index
|
|
761
|
+
index: index2
|
|
750
762
|
},
|
|
751
763
|
"align"
|
|
752
764
|
)
|
|
@@ -916,7 +928,7 @@ function useColumns(propsRef, getPaginationRef, tableElRef) {
|
|
|
916
928
|
};
|
|
917
929
|
}
|
|
918
930
|
function useCustomRow(propsRef, { setSelectedRowKeys, getSelectedRowKeys, clearSelectedRowKeys, emits }) {
|
|
919
|
-
const customRow = (record,
|
|
931
|
+
const customRow = (record, index2) => {
|
|
920
932
|
return {
|
|
921
933
|
onClick: (e) => {
|
|
922
934
|
e?.stopPropagation();
|
|
@@ -975,19 +987,19 @@ function useCustomRow(propsRef, { setSelectedRowKeys, getSelectedRowKeys, clearS
|
|
|
975
987
|
}
|
|
976
988
|
}
|
|
977
989
|
handleClick();
|
|
978
|
-
emits("row-click", record,
|
|
990
|
+
emits("row-click", record, index2, e);
|
|
979
991
|
},
|
|
980
992
|
onDblclick: (event) => {
|
|
981
|
-
emits("row-dbClick", record,
|
|
993
|
+
emits("row-dbClick", record, index2, event);
|
|
982
994
|
},
|
|
983
995
|
onContextmenu: (event) => {
|
|
984
|
-
emits("row-contextmenu", record,
|
|
996
|
+
emits("row-contextmenu", record, index2, event);
|
|
985
997
|
},
|
|
986
998
|
onMouseenter: (event) => {
|
|
987
|
-
emits("row-mouseenter", record,
|
|
999
|
+
emits("row-mouseenter", record, index2, event);
|
|
988
1000
|
},
|
|
989
1001
|
onMouseleave: (event) => {
|
|
990
|
-
emits("row-mouseleave", record,
|
|
1002
|
+
emits("row-mouseleave", record, index2, event);
|
|
991
1003
|
}
|
|
992
1004
|
};
|
|
993
1005
|
};
|
|
@@ -1109,7 +1121,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1109
1121
|
const _component_ATooltip = Tooltip;
|
|
1110
1122
|
return openBlock(), createBlock(_component_ATooltip, { placement: "top" }, {
|
|
1111
1123
|
title: withCtx(() => [
|
|
1112
|
-
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$6, toDisplayString(unref(t)("FULLSCREEN")), 1)) : createCommentVNode("", true)
|
|
1124
|
+
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$6, toDisplayString(unref(t)("FULLSCREEN")), 1)) : createCommentVNode("v-if", true)
|
|
1113
1125
|
]),
|
|
1114
1126
|
default: withCtx(() => [
|
|
1115
1127
|
createElementVNode("span", {
|
|
@@ -1126,6 +1138,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1126
1138
|
};
|
|
1127
1139
|
}
|
|
1128
1140
|
});
|
|
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"]]);
|
|
1129
1142
|
const _hoisted_1$5 = { class: "column-select" };
|
|
1130
1143
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1131
1144
|
__name: "DownloadCtrl",
|
|
@@ -1197,7 +1210,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1197
1210
|
createVNode(_component_ADivider, { dashed: "" }),
|
|
1198
1211
|
createVNode(_component_ARow, null, {
|
|
1199
1212
|
default: withCtx(() => [
|
|
1200
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(modalData.value, (it,
|
|
1213
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(modalData.value, (it, index2) => {
|
|
1201
1214
|
return openBlock(), createBlock(_component_ACol, { span: 8 }, {
|
|
1202
1215
|
default: withCtx(() => [
|
|
1203
1216
|
createVNode(_component_ACheckbox, {
|
|
@@ -1223,6 +1236,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1223
1236
|
};
|
|
1224
1237
|
}
|
|
1225
1238
|
});
|
|
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"]]);
|
|
1226
1240
|
const _hoisted_1$4 = /* @__PURE__ */ createElementVNode("span", { class: "flex" }, [
|
|
1227
1241
|
/* @__PURE__ */ createElementVNode("i", { class: "i ic:baseline-download w-7 leading-7 text-center cursor-pointer" })
|
|
1228
1242
|
], -1);
|
|
@@ -1281,19 +1295,19 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1281
1295
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_CURRENT_PAGE")), 1)
|
|
1282
1296
|
]),
|
|
1283
1297
|
_: 1
|
|
1284
|
-
})) : createCommentVNode("", true),
|
|
1298
|
+
})) : createCommentVNode("v-if", true),
|
|
1285
1299
|
unref(showSelectedDownload) ? (openBlock(), createBlock(_component_AMenuItem, { key: "select" }, {
|
|
1286
1300
|
default: withCtx(() => [
|
|
1287
1301
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_SELECT_COLUMN")), 1)
|
|
1288
1302
|
]),
|
|
1289
1303
|
_: 1
|
|
1290
|
-
})) : createCommentVNode("", true),
|
|
1304
|
+
})) : createCommentVNode("v-if", true),
|
|
1291
1305
|
unref(showBackDownload) ? (openBlock(), createBlock(_component_AMenuItem, { key: "all" }, {
|
|
1292
1306
|
default: withCtx(() => [
|
|
1293
1307
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_ALL")), 1)
|
|
1294
1308
|
]),
|
|
1295
1309
|
_: 1
|
|
1296
|
-
})) : createCommentVNode("", true)
|
|
1310
|
+
})) : createCommentVNode("v-if", true)
|
|
1297
1311
|
]),
|
|
1298
1312
|
_: 1
|
|
1299
1313
|
})
|
|
@@ -1303,13 +1317,14 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1303
1317
|
]),
|
|
1304
1318
|
_: 1
|
|
1305
1319
|
}),
|
|
1306
|
-
createVNode(
|
|
1320
|
+
createVNode(DownloadCtrl, { onRegister: unref(registerDialog) }, null, 8, ["onRegister"])
|
|
1307
1321
|
]),
|
|
1308
1322
|
_: 1
|
|
1309
1323
|
});
|
|
1310
1324
|
};
|
|
1311
1325
|
}
|
|
1312
1326
|
});
|
|
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"]]);
|
|
1313
1328
|
const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("i", { class: "i ant-design:drag-outlined drag-icon cursor-pointer" }, null, -1);
|
|
1314
1329
|
const _hoisted_2$2 = ["onClick"];
|
|
1315
1330
|
const _hoisted_3$1 = ["onClick"];
|
|
@@ -1452,9 +1467,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1452
1467
|
return;
|
|
1453
1468
|
const columns = getColumns();
|
|
1454
1469
|
const isFixed = item.fixed === fixed ? false : fixed;
|
|
1455
|
-
const
|
|
1456
|
-
if (
|
|
1457
|
-
columns[
|
|
1470
|
+
const index2 = columns.findIndex((col) => col.dataIndex === item.dataIndex);
|
|
1471
|
+
if (index2 !== -1) {
|
|
1472
|
+
columns[index2].fixed = isFixed;
|
|
1458
1473
|
}
|
|
1459
1474
|
item.fixed = isFixed;
|
|
1460
1475
|
if (isFixed && !item.width) {
|
|
@@ -1645,6 +1660,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1645
1660
|
};
|
|
1646
1661
|
}
|
|
1647
1662
|
});
|
|
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"]]);
|
|
1648
1664
|
const _hoisted_1$2 = { class: "flex dt-table-setting" };
|
|
1649
1665
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1650
1666
|
__name: "index",
|
|
@@ -1670,16 +1686,17 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1670
1686
|
}
|
|
1671
1687
|
return (_ctx, _cache) => {
|
|
1672
1688
|
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
1673
|
-
unref(getSetting).download ? (openBlock(), createBlock(
|
|
1674
|
-
unref(getSetting).setting ? (openBlock(), createBlock(
|
|
1689
|
+
unref(getSetting).download ? (openBlock(), createBlock(Download, normalizeProps(mergeProps({ key: 0 }, unref(getSetting))), null, 16)) : createCommentVNode("v-if", true),
|
|
1690
|
+
unref(getSetting).setting ? (openBlock(), createBlock(ColumnSetting, {
|
|
1675
1691
|
key: 1,
|
|
1676
1692
|
onColumnsChange: handleColumnChange
|
|
1677
|
-
})) : createCommentVNode("", true),
|
|
1678
|
-
unref(getSetting).fullscreen ? (openBlock(), createBlock(
|
|
1693
|
+
})) : createCommentVNode("v-if", true),
|
|
1694
|
+
unref(getSetting).fullscreen ? (openBlock(), createBlock(FullscreenSetting, { key: 2 })) : createCommentVNode("v-if", true)
|
|
1679
1695
|
]);
|
|
1680
1696
|
};
|
|
1681
1697
|
}
|
|
1682
1698
|
});
|
|
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"]]);
|
|
1683
1700
|
const _hoisted_1$1 = { class: "dt-table-header" };
|
|
1684
1701
|
const _hoisted_2$1 = { class: "flex flex-row justify-between" };
|
|
1685
1702
|
const _hoisted_3 = { class: "flex flex-row flex-1" };
|
|
@@ -1715,20 +1732,21 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1715
1732
|
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1716
1733
|
createElementVNode("div", _hoisted_2$1, [
|
|
1717
1734
|
createElementVNode("div", _hoisted_3, [
|
|
1718
|
-
unref(getActionsProps)?.buttonList.length ? (openBlock(), createBlock(unref(DtFormButtons), normalizeProps(mergeProps({ key: 0 }, unref(getActionsProps))), null, 16)) : createCommentVNode("", true),
|
|
1735
|
+
unref(getActionsProps)?.buttonList.length ? (openBlock(), createBlock(unref(DtFormButtons), normalizeProps(mergeProps({ key: 0 }, unref(getActionsProps))), null, 16)) : createCommentVNode("v-if", true),
|
|
1719
1736
|
renderSlot(_ctx.$slots, "toolbar")
|
|
1720
1737
|
]),
|
|
1721
1738
|
__props.tableSetting ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
1722
|
-
createVNode(
|
|
1723
|
-
])) : createCommentVNode("", true)
|
|
1739
|
+
createVNode(DtTableSetting, { setting: __props.tableSetting }, null, 8, ["setting"])
|
|
1740
|
+
])) : createCommentVNode("v-if", true)
|
|
1724
1741
|
]),
|
|
1725
1742
|
_ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
1726
1743
|
renderSlot(_ctx.$slots, "headerTop")
|
|
1727
|
-
])) : createCommentVNode("", true)
|
|
1744
|
+
])) : createCommentVNode("v-if", true)
|
|
1728
1745
|
]);
|
|
1729
1746
|
};
|
|
1730
1747
|
}
|
|
1731
1748
|
});
|
|
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"]]);
|
|
1732
1750
|
function useTableHeader(propsRef, slots, handlers) {
|
|
1733
1751
|
const { t } = useI18n("UI");
|
|
1734
1752
|
const getHeaderProps = computed(() => {
|
|
@@ -1741,7 +1759,7 @@ function useTableHeader(propsRef, slots, handlers) {
|
|
|
1741
1759
|
const hideTitle = (!toolbar || !toolbar.filter((it) => it.show ?? true).length) && !slots.toolbar && !slots.headerTop && !tableSetting;
|
|
1742
1760
|
return {
|
|
1743
1761
|
title: hideTitle ? null : () => h(
|
|
1744
|
-
|
|
1762
|
+
TableHeader,
|
|
1745
1763
|
{
|
|
1746
1764
|
tableSetting,
|
|
1747
1765
|
toolbar,
|
|
@@ -2036,14 +2054,14 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
2036
2054
|
};
|
|
2037
2055
|
}
|
|
2038
2056
|
function useRows(propsRef) {
|
|
2039
|
-
function getRowClassName(record,
|
|
2057
|
+
function getRowClassName(record, index2) {
|
|
2040
2058
|
const { striped, rowClassName } = unref(propsRef);
|
|
2041
2059
|
const classNames = [];
|
|
2042
2060
|
if (striped) {
|
|
2043
|
-
classNames.push(
|
|
2061
|
+
classNames.push(index2 % 2 === 1 ? "table-striped" : "");
|
|
2044
2062
|
}
|
|
2045
2063
|
if (rowClassName && isFunction(rowClassName)) {
|
|
2046
|
-
classNames.push(rowClassName(record,
|
|
2064
|
+
classNames.push(rowClassName(record, index2));
|
|
2047
2065
|
}
|
|
2048
2066
|
return classNames.join(" ");
|
|
2049
2067
|
}
|
|
@@ -2073,7 +2091,7 @@ const _sfc_main$1 = {
|
|
|
2073
2091
|
const {
|
|
2074
2092
|
column,
|
|
2075
2093
|
record,
|
|
2076
|
-
index
|
|
2094
|
+
index: index2
|
|
2077
2095
|
} = props2;
|
|
2078
2096
|
const {
|
|
2079
2097
|
render,
|
|
@@ -2118,7 +2136,7 @@ const _sfc_main$1 = {
|
|
|
2118
2136
|
let txt = link.text ?? text;
|
|
2119
2137
|
renderText.value = createVNode("a", {
|
|
2120
2138
|
"class": "primary-color-link",
|
|
2121
|
-
"onClick": () => link(record,
|
|
2139
|
+
"onClick": () => link(record, index2)
|
|
2122
2140
|
}, [txt]);
|
|
2123
2141
|
} else if (isVnode(render)) {
|
|
2124
2142
|
renderText.value = createVNode(Fragment, null, [createTextVNode(" "), render, createTextVNode(" ")]);
|
|
@@ -2129,7 +2147,7 @@ const _sfc_main$1 = {
|
|
|
2129
2147
|
});
|
|
2130
2148
|
}
|
|
2131
2149
|
} else if (isFunction(render)) {
|
|
2132
|
-
let afterRenderData = render(record,
|
|
2150
|
+
let afterRenderData = render(record, index2, text);
|
|
2133
2151
|
if (afterRenderData.__v_isRef) {
|
|
2134
2152
|
renderText = afterRenderData;
|
|
2135
2153
|
} else if (afterRenderData.setup) {
|
|
@@ -2147,6 +2165,7 @@ const _sfc_main$1 = {
|
|
|
2147
2165
|
return () => createVNode("span", null, [unref(renderText)]);
|
|
2148
2166
|
}
|
|
2149
2167
|
};
|
|
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"]]);
|
|
2150
2169
|
const DEFAULT_SORT_FN = (sortInfo) => {
|
|
2151
2170
|
const { field, order } = sortInfo;
|
|
2152
2171
|
return field && order ? { field, order } : {};
|
|
@@ -2248,11 +2267,11 @@ const TableProps = {
|
|
|
2248
2267
|
},
|
|
2249
2268
|
onOpenUpdateDialog: {
|
|
2250
2269
|
type: Function,
|
|
2251
|
-
default: (row,
|
|
2270
|
+
default: (row, index2) => ({})
|
|
2252
2271
|
},
|
|
2253
2272
|
onDelete: {
|
|
2254
2273
|
type: Function,
|
|
2255
|
-
default: (row,
|
|
2274
|
+
default: (row, index2) => ({})
|
|
2256
2275
|
},
|
|
2257
2276
|
onDeletes: {
|
|
2258
2277
|
type: Function,
|
|
@@ -2408,15 +2427,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2408
2427
|
"row-class-name": unref(getRowClassName),
|
|
2409
2428
|
onChange: unref(handleTableChange)
|
|
2410
2429
|
}), createSlots({
|
|
2411
|
-
bodyCell: withCtx(({ column, record, index }) => [
|
|
2412
|
-
_ctx.$slots.bodyCell ? renderSlot(_ctx.$slots, "bodyCell", normalizeProps(mergeProps({ key: 0 }, { column, record, index }))) : createCommentVNode("", true),
|
|
2413
|
-
column.slot ? renderSlot(_ctx.$slots, column.slot, normalizeProps(mergeProps({ key: 1 }, { column, record, index }))) : createCommentVNode("", true),
|
|
2414
|
-
|
|
2430
|
+
bodyCell: withCtx(({ column, record, index: index2 }) => [
|
|
2431
|
+
_ctx.$slots.bodyCell ? renderSlot(_ctx.$slots, "bodyCell", normalizeProps(mergeProps({ key: 0 }, { column, record, index: index2 }))) : createCommentVNode("v-if", true),
|
|
2432
|
+
column.slot ? renderSlot(_ctx.$slots, column.slot, normalizeProps(mergeProps({ key: 1 }, { column, record, index: index2 }))) : createCommentVNode("v-if", true),
|
|
2433
|
+
createCommentVNode(" \u9759\u6001\u7684\u6570\u636E\u53EF\u4EE5\u901A\u8FC7customRender, \u4F46\u662F\u54CD\u5E94\u5F0F\u6570\u636E, \u5F02\u6B65\u51FD\u6570,\u7EC4\u4EF6\u7B49\u9700\u8981\u4F7F\u7528bodyCell\u6E32\u67D3 "),
|
|
2434
|
+
column?.render && !column.slot && !_ctx.$slots.bodyCell ? (openBlock(), createBlock(TableRender, {
|
|
2415
2435
|
key: 2,
|
|
2416
2436
|
column,
|
|
2417
2437
|
record,
|
|
2418
|
-
index
|
|
2419
|
-
}, null, 8, ["column", "record", "index"])) : createCommentVNode("", true)
|
|
2438
|
+
index: index2
|
|
2439
|
+
}, null, 8, ["column", "record", "index"])) : createCommentVNode("v-if", true)
|
|
2420
2440
|
]),
|
|
2421
2441
|
emptyText: withCtx(() => [
|
|
2422
2442
|
_hoisted_1,
|
|
@@ -2436,7 +2456,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2436
2456
|
};
|
|
2437
2457
|
}
|
|
2438
2458
|
});
|
|
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"]]);
|
|
2439
2460
|
export {
|
|
2440
|
-
|
|
2461
|
+
index as DtTable,
|
|
2441
2462
|
useTable
|
|
2442
2463
|
};
|