@dt-frames/ui 2.0.11 → 2.0.12
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/container/index.d.ts +2 -93
- package/es/components/curd/src/components/Curd.d.ts +6 -2
- package/es/components/curd/src/props.d.ts +3 -1
- package/es/components/drawer/index.d.ts +1 -1
- package/es/components/drawer/index.js +4 -4
- package/es/components/drawer/src/index.d.ts +1 -1
- package/es/components/drawer/src/types/index.type.d.ts +1 -1
- package/es/components/form/index.js +32 -13
- package/es/components/form/src/components/FormItem.d.ts +3 -1
- package/es/components/form/src/components/formIcon.d.ts +0 -8
- package/es/components/form/src/props.d.ts +3 -1
- package/es/components/form/src/types/form.type.d.ts +1 -0
- package/es/components/form/src/types/items.type.d.ts +6 -4
- package/es/components/icons/index.d.ts +497 -497
- package/es/components/iframe/index.d.ts +2 -0
- package/es/components/iframe/index.js +72 -0
- package/es/components/iframe/index.less +29 -0
- package/es/components/iframe/src/index.d.ts +38 -0
- package/es/components/modal/index.js +11 -6
- package/es/components/modal/src/index.d.ts +4 -2
- package/es/components/table/index.js +173 -94
- package/es/components/tree/index.js +39 -29
- package/es/components/upload/index.js +414 -11
- package/es/components/upload/index.less +37 -0
- package/es/components/upload/src/basicProps.d.ts +89 -0
- package/es/components/upload/src/components/PdfView.d.ts +9 -0
- package/es/components/upload/src/hooks/useFile.d.ts +15 -0
- package/es/components/upload/src/index.d.ts +236 -2
- package/es/components/upload/src/type/file.d.ts +10 -0
- package/es/components/upload/src/utils/upload.d.ts +2 -0
- package/es/theme/index.js +3 -1
- package/es/theme/index.less +5 -1
- package/es/theme/src/components/content/index.d.ts +2 -0
- package/es/theme/src/components/header/index.d.ts +809 -809
- package/es/theme/src/components/header/multiple-header.d.ts +918 -918
- package/es/theme/src/index.d.ts +2059 -2057
- package/index.d.ts +3 -1
- package/index.js +3 -1
- package/manualContentPath.js +14 -0
- package/package.json +4 -2
- package/vite.config.ts +3 -0
- package/vite.config.ts.timestamp-1678694558071.mjs +0 -59
- package/vite.config.ts.timestamp-1678700851971.mjs +0 -61
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useAppStore, useSlots, error, http, useApp, getDynamicProps, isBoolean, isFunction, getPopupContainer, useI18n, isNumber, isArray, isObject, isString, useMessage, isNullAndUnDef, windowResizeFn, getDictValueByCode, formatNumber, isVnode } from "@dt-frames/core";
|
|
2
|
-
import { useSlots as useSlots$1, unref, ref, watch, onUnmounted, defineComponent, useAttrs, resolveDirective, openBlock, createElementBlock, Fragment, renderList, withDirectives, createVNode, withCtx, createTextVNode, toDisplayString, createElementVNode, normalizeClass, normalizeStyle, createCommentVNode, createBlock, provide, inject, h as h$1, computed, mergeProps, nextTick, toRaw as toRaw$1, reactive, watchEffect, normalizeProps, renderSlot, onMounted, createSlots, guardReactiveProps } from "vue";
|
|
1
|
+
import { useAppStore, useSlots, error, http, useApp, getDynamicProps, isBoolean, isFunction, getPopupContainer, useI18n, isNumber, isArray, isObject, isString, useMessage, isNullAndUnDef, windowResizeFn, off, on, getDictValueByCode, formatNumber, isVnode } from "@dt-frames/core";
|
|
2
|
+
import { useSlots as useSlots$1, unref, ref, watch, onUnmounted, defineComponent, useAttrs, resolveDirective, openBlock, createElementBlock, Fragment, renderList, withDirectives, createVNode, withCtx, createTextVNode, toDisplayString, createElementVNode, normalizeClass, normalizeStyle, createCommentVNode, createBlock, provide, inject, h as h$1, computed as computed$1, mergeProps, nextTick, toRaw as toRaw$1, reactive, watchEffect, normalizeProps, renderSlot, onMounted, createSlots, guardReactiveProps } from "vue";
|
|
3
3
|
import { useHeader } from "../../theme";
|
|
4
4
|
import { Tooltip, MenuItem, Menu, Dropdown, Checkbox as Checkbox$1, Divider, Col, Row, Button, CheckboxGroup, Popover as Popover$1, Table } from "ant-design-vue/es";
|
|
5
5
|
import "ant-design-vue/es/table/style";
|
|
@@ -7,7 +7,7 @@ import { omit, cloneDeep, isEqual } from "lodash-es";
|
|
|
7
7
|
import "ant-design-vue/es/dropdown/style";
|
|
8
8
|
import "ant-design-vue/es/menu/style";
|
|
9
9
|
import "ant-design-vue/es/tooltip/style";
|
|
10
|
-
import { useDebounceFn, useFullscreen, isFunction as isFunction$1 } from "@vueuse/core";
|
|
10
|
+
import { useDebounceFn, useFullscreen, isFunction as isFunction$1, tryOnMounted } from "@vueuse/core";
|
|
11
11
|
import { Input, InputNumber, Select, TreeSelect, Switch, Checkbox, DatePicker, TimePicker, Popover } from "ant-design-vue";
|
|
12
12
|
import { DtFormButtons } from "../form";
|
|
13
13
|
import { useModal, DtModal, useModalOut } from "../modal";
|
|
@@ -237,7 +237,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
237
237
|
}, 1024)
|
|
238
238
|
])), [
|
|
239
239
|
[_directive_auth, item.auth]
|
|
240
|
-
]) : createCommentVNode("", true)
|
|
240
|
+
]) : createCommentVNode("v-if", true)
|
|
241
241
|
], 64);
|
|
242
242
|
}), 256))
|
|
243
243
|
])) : (openBlock(), createBlock(_component_ADropdown, {
|
|
@@ -264,7 +264,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
264
264
|
createElementVNode("span", _hoisted_5$1, toDisplayString(item.label()), 1)
|
|
265
265
|
]),
|
|
266
266
|
_: 2
|
|
267
|
-
}, 1032, ["onClick"])) : createCommentVNode("", true)
|
|
267
|
+
}, 1032, ["onClick"])) : createCommentVNode("v-if", true)
|
|
268
268
|
])), [
|
|
269
269
|
[_directive_auth, item.auth]
|
|
270
270
|
]);
|
|
@@ -281,6 +281,14 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
283
|
});
|
|
284
|
+
const _export_sfc = (sfc, props2) => {
|
|
285
|
+
const target = sfc.__vccOpts || sfc;
|
|
286
|
+
for (const [key, val] of props2) {
|
|
287
|
+
target[key] = val;
|
|
288
|
+
}
|
|
289
|
+
return target;
|
|
290
|
+
};
|
|
291
|
+
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"]]);
|
|
284
292
|
const tableKey = Symbol("dt-page");
|
|
285
293
|
function createTableInstance(instance) {
|
|
286
294
|
provide(tableKey, instance);
|
|
@@ -349,14 +357,14 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
349
357
|
const ruleVisible = ref(false);
|
|
350
358
|
const optionsRef = ref([]);
|
|
351
359
|
const currentValueRef = ref(props2.value);
|
|
352
|
-
const getComponent = computed(() => props2.column?.editComponent || "Input");
|
|
353
|
-
const getRuleVisible = computed(() => {
|
|
360
|
+
const getComponent = computed$1(() => props2.column?.editComponent || "Input");
|
|
361
|
+
const getRuleVisible = computed$1(() => {
|
|
354
362
|
return unref(ruleMessage) && unref(ruleVisible);
|
|
355
363
|
});
|
|
356
|
-
const getWrapperClass = computed(() => {
|
|
364
|
+
const getWrapperClass = computed$1(() => {
|
|
357
365
|
return `edit-cell-align-${align}`;
|
|
358
366
|
});
|
|
359
|
-
const getIsCheckComp = computed(() => {
|
|
367
|
+
const getIsCheckComp = computed$1(() => {
|
|
360
368
|
const component = unref(getComponent);
|
|
361
369
|
return ["Checkbox", "Switch"].includes(component);
|
|
362
370
|
});
|
|
@@ -369,15 +377,15 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
369
377
|
const setTableValue = () => {
|
|
370
378
|
props2.record[props2.column.dataIndex] = unref(currentValueRef);
|
|
371
379
|
};
|
|
372
|
-
const getComponentProps = computed(() => {
|
|
380
|
+
const getComponentProps = computed$1(() => {
|
|
373
381
|
const isCheckValue = unref(getIsCheckComp);
|
|
374
382
|
const valueField = isCheckValue ? "checked" : "value";
|
|
375
383
|
const val = unref(currentValueRef);
|
|
376
384
|
const value = isCheckValue ? isNumber(val) && isBoolean(val) ? val : !!val : val;
|
|
377
385
|
let compProps = props2.column?.editComponentProps ?? {};
|
|
378
|
-
const { record, column, index } = props2;
|
|
386
|
+
const { record, column, index: index2 } = props2;
|
|
379
387
|
if (isFunction(compProps)) {
|
|
380
|
-
compProps = compProps({ text: val, record, column, index }) ?? {};
|
|
388
|
+
compProps = compProps({ text: val, record, column, index: index2 }) ?? {};
|
|
381
389
|
}
|
|
382
390
|
if (unref(getComponent) === "InputNumber") {
|
|
383
391
|
compProps = {
|
|
@@ -457,8 +465,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
457
465
|
};
|
|
458
466
|
}
|
|
459
467
|
});
|
|
468
|
+
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"]]);
|
|
460
469
|
function renderEditCell(column) {
|
|
461
|
-
return ({ text: value, record, index }) => {
|
|
470
|
+
return ({ text: value, record, index: index2 }) => {
|
|
462
471
|
record.onValid = async () => {
|
|
463
472
|
if (isArray(record?.validCbs)) {
|
|
464
473
|
const validFns = (record?.validCbs || []).map((fn) => fn());
|
|
@@ -486,11 +495,11 @@ function renderEditCell(column) {
|
|
|
486
495
|
}
|
|
487
496
|
return true;
|
|
488
497
|
};
|
|
489
|
-
return h(
|
|
498
|
+
return h(EditableCell, {
|
|
490
499
|
value,
|
|
491
500
|
record,
|
|
492
501
|
column,
|
|
493
|
-
index
|
|
502
|
+
index: index2
|
|
494
503
|
});
|
|
495
504
|
};
|
|
496
505
|
}
|
|
@@ -526,7 +535,7 @@ function handleChildren(children, ellipsis) {
|
|
|
526
535
|
function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
527
536
|
const { getIsZH } = useHeader();
|
|
528
537
|
const { t } = useI18n("UI");
|
|
529
|
-
const { showIndexColumn, indexColumnProps, isTreeTable } = unref(propsRef);
|
|
538
|
+
const { showIndexColumn, indexColumnProps, isTreeTable, virtual } = unref(propsRef);
|
|
530
539
|
let pushIndexColumns = false;
|
|
531
540
|
if (unref(isTreeTable)) {
|
|
532
541
|
return;
|
|
@@ -547,15 +556,17 @@ function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
|
547
556
|
width: unref(getIsZH) ? 50 : 70,
|
|
548
557
|
title: t("NUMBER"),
|
|
549
558
|
align: "center",
|
|
550
|
-
customRender: ({ index }) => {
|
|
559
|
+
customRender: ({ index: index2, renderIndex, record }) => {
|
|
560
|
+
if (virtual && record?.index)
|
|
561
|
+
return record?.index;
|
|
551
562
|
const getPagination = unref(getPaginationRef);
|
|
552
563
|
const { appConf } = useAppStore();
|
|
553
564
|
const { defaultPageSize } = appConf.ui.table;
|
|
554
565
|
if (isBoolean(getPagination)) {
|
|
555
|
-
return `${
|
|
566
|
+
return `${index2 + 1}`;
|
|
556
567
|
}
|
|
557
568
|
const { current = 1, pageSize = defaultPageSize } = getPagination;
|
|
558
|
-
return ((current < 1 ? 1 : current) - 1) * pageSize +
|
|
569
|
+
return ((current < 1 ? 1 : current) - 1) * pageSize + index2 + 1;
|
|
559
570
|
},
|
|
560
571
|
...isFixedLeft ? {
|
|
561
572
|
fixed: "left"
|
|
@@ -593,13 +604,13 @@ function handleActionColumn(propsRef, columns) {
|
|
|
593
604
|
};
|
|
594
605
|
columns.push({
|
|
595
606
|
...columnObj,
|
|
596
|
-
customRender: ({ record, index }) => {
|
|
607
|
+
customRender: ({ record, index: index2 }) => {
|
|
597
608
|
return h$1(
|
|
598
|
-
|
|
609
|
+
TableAction,
|
|
599
610
|
omit({
|
|
600
611
|
...columnObj,
|
|
601
612
|
record,
|
|
602
|
-
index
|
|
613
|
+
index: index2
|
|
603
614
|
}, "align")
|
|
604
615
|
);
|
|
605
616
|
}
|
|
@@ -633,10 +644,10 @@ function useColumns(propsRef, getPaginationRef, tableElRef) {
|
|
|
633
644
|
const columnsRef = ref(unref(propsRef).columns);
|
|
634
645
|
let cacheColumns = unref(propsRef).columns;
|
|
635
646
|
const { appConf } = useAppStore();
|
|
636
|
-
const getColumnsRef = computed(() => {
|
|
647
|
+
const getColumnsRef = computed$1(() => {
|
|
637
648
|
const columns = cloneDeep(unref(columnsRef));
|
|
638
649
|
const { ellipsis } = unref(propsRef);
|
|
639
|
-
columns.forEach((it,
|
|
650
|
+
columns.forEach((it, index2) => {
|
|
640
651
|
it.class = it.class ?? "";
|
|
641
652
|
if (!it.class.split(" ").includes("__column")) {
|
|
642
653
|
it.class = `${it.class} __column`;
|
|
@@ -656,7 +667,7 @@ function useColumns(propsRef, getPaginationRef, tableElRef) {
|
|
|
656
667
|
handleActionColumn(propsRef, columns);
|
|
657
668
|
return columns;
|
|
658
669
|
});
|
|
659
|
-
const getViewColumns = computed(() => {
|
|
670
|
+
const getViewColumns = computed$1(() => {
|
|
660
671
|
const viewColumns = sortFixedColumn(unref(getColumnsRef));
|
|
661
672
|
const columns = cloneDeep(viewColumns);
|
|
662
673
|
return columns.filter((column) => isIfShow(column)).map((column) => {
|
|
@@ -770,7 +781,7 @@ function useColumns(propsRef, getPaginationRef, tableElRef) {
|
|
|
770
781
|
};
|
|
771
782
|
}
|
|
772
783
|
function useCustomRow(propsRef, { setSelectedRowKeys, getSelectedRowKeys, clearSelectedRowKeys, emits }) {
|
|
773
|
-
const customRow = (record,
|
|
784
|
+
const customRow = (record, index2) => {
|
|
774
785
|
return {
|
|
775
786
|
onClick: (e) => {
|
|
776
787
|
e?.stopPropagation();
|
|
@@ -824,19 +835,19 @@ function useCustomRow(propsRef, { setSelectedRowKeys, getSelectedRowKeys, clearS
|
|
|
824
835
|
}
|
|
825
836
|
}
|
|
826
837
|
handleClick();
|
|
827
|
-
emits("row-click", record,
|
|
838
|
+
emits("row-click", record, index2, e);
|
|
828
839
|
},
|
|
829
840
|
onDblclick: (event) => {
|
|
830
|
-
emits("row-dbClick", record,
|
|
841
|
+
emits("row-dbClick", record, index2, event);
|
|
831
842
|
},
|
|
832
843
|
onContextmenu: (event) => {
|
|
833
|
-
emits("row-contextmenu", record,
|
|
844
|
+
emits("row-contextmenu", record, index2, event);
|
|
834
845
|
},
|
|
835
846
|
onMouseenter: (event) => {
|
|
836
|
-
emits("row-mouseenter", record,
|
|
847
|
+
emits("row-mouseenter", record, index2, event);
|
|
837
848
|
},
|
|
838
849
|
onMouseleave: (event) => {
|
|
839
|
-
emits("row-mouseleave", record,
|
|
850
|
+
emits("row-mouseleave", record, index2, event);
|
|
840
851
|
}
|
|
841
852
|
};
|
|
842
853
|
};
|
|
@@ -859,7 +870,7 @@ function useDataSource(propsRef, {
|
|
|
859
870
|
immediate: true
|
|
860
871
|
}
|
|
861
872
|
);
|
|
862
|
-
const getDataSourceRef = computed(() => {
|
|
873
|
+
const getDataSourceRef = computed$1(() => {
|
|
863
874
|
return unref(dataSourceRef);
|
|
864
875
|
});
|
|
865
876
|
function handleTableChange(pagination, filters, sorter) {
|
|
@@ -958,7 +969,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
958
969
|
const _component_ATooltip = Tooltip;
|
|
959
970
|
return openBlock(), createBlock(_component_ATooltip, { placement: "top" }, {
|
|
960
971
|
title: withCtx(() => [
|
|
961
|
-
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$6, toDisplayString(unref(t)("FULLSCREEN")), 1)) : createCommentVNode("", true)
|
|
972
|
+
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$6, toDisplayString(unref(t)("FULLSCREEN")), 1)) : createCommentVNode("v-if", true)
|
|
962
973
|
]),
|
|
963
974
|
default: withCtx(() => [
|
|
964
975
|
createElementVNode("span", {
|
|
@@ -975,6 +986,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
975
986
|
};
|
|
976
987
|
}
|
|
977
988
|
});
|
|
989
|
+
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"]]);
|
|
978
990
|
const _hoisted_1$5 = { class: "column-select" };
|
|
979
991
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
980
992
|
__name: "DownloadCtrl",
|
|
@@ -1046,7 +1058,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1046
1058
|
createVNode(_component_ADivider, { dashed: "" }),
|
|
1047
1059
|
createVNode(_component_ARow, null, {
|
|
1048
1060
|
default: withCtx(() => [
|
|
1049
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(modalData.value, (it,
|
|
1061
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(modalData.value, (it, index2) => {
|
|
1050
1062
|
return openBlock(), createBlock(_component_ACol, { span: 8 }, {
|
|
1051
1063
|
default: withCtx(() => [
|
|
1052
1064
|
createVNode(_component_ACheckbox, {
|
|
@@ -1072,6 +1084,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1072
1084
|
};
|
|
1073
1085
|
}
|
|
1074
1086
|
});
|
|
1087
|
+
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"]]);
|
|
1075
1088
|
const _hoisted_1$4 = /* @__PURE__ */ createElementVNode("span", { class: "flex" }, [
|
|
1076
1089
|
/* @__PURE__ */ createElementVNode("i", { class: "i ic:baseline-download w-7 leading-7 text-center cursor-pointer" })
|
|
1077
1090
|
], -1);
|
|
@@ -1087,13 +1100,14 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1087
1100
|
const table = getTableInstance();
|
|
1088
1101
|
const [registerDialog, { openModal }] = useModalOut();
|
|
1089
1102
|
const { appConf } = useAppStore();
|
|
1103
|
+
const getPopupContainer$1 = () => document.getElementById("dt-layout-content") || getPopupContainer();
|
|
1090
1104
|
const { t } = useI18n("UI");
|
|
1091
1105
|
const isInclude = (type) => {
|
|
1092
1106
|
return isBoolean(props2.download) && props2.download && appConf?.ui?.table?.exportTable.includes(type) || isArray(props2.download) && props2.download.includes(type);
|
|
1093
1107
|
};
|
|
1094
|
-
const showCurrentDownload = computed(() => isInclude("current"));
|
|
1095
|
-
const showSelectedDownload = computed(() => isInclude("select"));
|
|
1096
|
-
const showBackDownload = computed(() => isInclude("all"));
|
|
1108
|
+
const showCurrentDownload = computed$1(() => isInclude("current"));
|
|
1109
|
+
const showSelectedDownload = computed$1(() => isInclude("select"));
|
|
1110
|
+
const showBackDownload = computed$1(() => isInclude("all"));
|
|
1097
1111
|
function handleTitleClick({ key }) {
|
|
1098
1112
|
const { onDownload, columns: allColumns, dataSource } = unref(table.getBind);
|
|
1099
1113
|
const excludesFlag = ["ACTION", "CHECKBOX", "RADIO"];
|
|
@@ -1119,7 +1133,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1119
1133
|
createVNode(_component_ADropdown, {
|
|
1120
1134
|
placement: "bottom",
|
|
1121
1135
|
trigger: ["click"],
|
|
1122
|
-
getPopupContainer:
|
|
1136
|
+
getPopupContainer: getPopupContainer$1
|
|
1123
1137
|
}, {
|
|
1124
1138
|
overlay: withCtx(() => [
|
|
1125
1139
|
createVNode(_component_AMenu, { onClick: handleTitleClick }, {
|
|
@@ -1129,19 +1143,19 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1129
1143
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_CURRENT_PAGE")), 1)
|
|
1130
1144
|
]),
|
|
1131
1145
|
_: 1
|
|
1132
|
-
})) : createCommentVNode("", true),
|
|
1146
|
+
})) : createCommentVNode("v-if", true),
|
|
1133
1147
|
unref(showSelectedDownload) ? (openBlock(), createBlock(_component_AMenuItem, { key: "select" }, {
|
|
1134
1148
|
default: withCtx(() => [
|
|
1135
1149
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_SELECT_COLUMN")), 1)
|
|
1136
1150
|
]),
|
|
1137
1151
|
_: 1
|
|
1138
|
-
})) : createCommentVNode("", true),
|
|
1152
|
+
})) : createCommentVNode("v-if", true),
|
|
1139
1153
|
unref(showBackDownload) ? (openBlock(), createBlock(_component_AMenuItem, { key: "all" }, {
|
|
1140
1154
|
default: withCtx(() => [
|
|
1141
1155
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_ALL")), 1)
|
|
1142
1156
|
]),
|
|
1143
1157
|
_: 1
|
|
1144
|
-
})) : createCommentVNode("", true)
|
|
1158
|
+
})) : createCommentVNode("v-if", true)
|
|
1145
1159
|
]),
|
|
1146
1160
|
_: 1
|
|
1147
1161
|
})
|
|
@@ -1150,14 +1164,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1150
1164
|
_hoisted_1$4
|
|
1151
1165
|
]),
|
|
1152
1166
|
_: 1
|
|
1153
|
-
}
|
|
1154
|
-
createVNode(
|
|
1167
|
+
}),
|
|
1168
|
+
createVNode(DownloadCtrl, { onRegister: unref(registerDialog) }, null, 8, ["onRegister"])
|
|
1155
1169
|
]),
|
|
1156
1170
|
_: 1
|
|
1157
1171
|
});
|
|
1158
1172
|
};
|
|
1159
1173
|
}
|
|
1160
1174
|
});
|
|
1175
|
+
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"]]);
|
|
1161
1176
|
const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("i", { class: "i ant-design:drag-outlined drag-icon cursor-pointer" }, null, -1);
|
|
1162
1177
|
const _hoisted_2$1 = ["onClick"];
|
|
1163
1178
|
const _hoisted_3$1 = ["onClick"];
|
|
@@ -1180,7 +1195,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1180
1195
|
const columnListRef = ref(null);
|
|
1181
1196
|
const checkIndex = ref(false);
|
|
1182
1197
|
const checkSelect = ref(false);
|
|
1183
|
-
const getValues = computed(() => {
|
|
1198
|
+
const getValues = computed$1(() => {
|
|
1184
1199
|
return unref(table?.getBind);
|
|
1185
1200
|
});
|
|
1186
1201
|
let sortable;
|
|
@@ -1190,7 +1205,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1190
1205
|
checkedList: [],
|
|
1191
1206
|
defaultCheckList: []
|
|
1192
1207
|
});
|
|
1193
|
-
const indeterminate = computed(() => {
|
|
1208
|
+
const indeterminate = computed$1(() => {
|
|
1194
1209
|
let len = plainOptions.value.length;
|
|
1195
1210
|
let checkedLen = state.checkedList.length;
|
|
1196
1211
|
unref(checkIndex) && checkedLen--;
|
|
@@ -1300,9 +1315,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1300
1315
|
return;
|
|
1301
1316
|
const columns = getColumns();
|
|
1302
1317
|
const isFixed = item.fixed === fixed ? false : fixed;
|
|
1303
|
-
const
|
|
1304
|
-
if (
|
|
1305
|
-
columns[
|
|
1318
|
+
const index2 = columns.findIndex((col) => col.dataIndex === item.dataIndex);
|
|
1319
|
+
if (index2 !== -1) {
|
|
1320
|
+
columns[index2].fixed = isFixed;
|
|
1306
1321
|
}
|
|
1307
1322
|
item.fixed = isFixed;
|
|
1308
1323
|
if (isFixed && !item.width) {
|
|
@@ -1338,7 +1353,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1338
1353
|
state.checkedList = checkList;
|
|
1339
1354
|
}
|
|
1340
1355
|
function getPopupContainer$1() {
|
|
1341
|
-
return isFunction$1(attrs.getPopupContainer) ? attrs.getPopupContainer() : getPopupContainer();
|
|
1356
|
+
return isFunction$1(attrs.getPopupContainer) ? attrs.getPopupContainer() : document.getElementById("dt-layout-content") || getPopupContainer();
|
|
1342
1357
|
}
|
|
1343
1358
|
return (_ctx, _cache) => {
|
|
1344
1359
|
const _component_ACheckbox = Checkbox$1;
|
|
@@ -1493,6 +1508,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1493
1508
|
};
|
|
1494
1509
|
}
|
|
1495
1510
|
});
|
|
1511
|
+
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"]]);
|
|
1496
1512
|
const _hoisted_1$2 = { class: "flex dt-table-setting" };
|
|
1497
1513
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1498
1514
|
__name: "index",
|
|
@@ -1505,7 +1521,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1505
1521
|
emits: ["columns-change"],
|
|
1506
1522
|
setup(__props, { emit: emits }) {
|
|
1507
1523
|
const props2 = __props;
|
|
1508
|
-
const getSetting = computed(() => {
|
|
1524
|
+
const getSetting = computed$1(() => {
|
|
1509
1525
|
return {
|
|
1510
1526
|
download: true,
|
|
1511
1527
|
setting: true,
|
|
@@ -1518,16 +1534,17 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1518
1534
|
}
|
|
1519
1535
|
return (_ctx, _cache) => {
|
|
1520
1536
|
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
1521
|
-
unref(getSetting).download ? (openBlock(), createBlock(
|
|
1522
|
-
unref(getSetting).setting ? (openBlock(), createBlock(
|
|
1537
|
+
unref(getSetting).download ? (openBlock(), createBlock(Download, normalizeProps(mergeProps({ key: 0 }, unref(getSetting))), null, 16)) : createCommentVNode("v-if", true),
|
|
1538
|
+
unref(getSetting).setting ? (openBlock(), createBlock(ColumnSetting, {
|
|
1523
1539
|
key: 1,
|
|
1524
1540
|
onColumnsChange: handleColumnChange
|
|
1525
|
-
})) : createCommentVNode("", true),
|
|
1526
|
-
unref(getSetting).fullscreen ? (openBlock(), createBlock(
|
|
1541
|
+
})) : createCommentVNode("v-if", true),
|
|
1542
|
+
unref(getSetting).fullscreen ? (openBlock(), createBlock(FullscreenSetting, { key: 2 })) : createCommentVNode("v-if", true)
|
|
1527
1543
|
]);
|
|
1528
1544
|
};
|
|
1529
1545
|
}
|
|
1530
1546
|
});
|
|
1547
|
+
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"]]);
|
|
1531
1548
|
const _hoisted_1$1 = { class: "dt-table-header" };
|
|
1532
1549
|
const _hoisted_2 = { class: "flex flex-row justify-between" };
|
|
1533
1550
|
const _hoisted_3 = { class: "flex flex-row flex-1" };
|
|
@@ -1559,23 +1576,24 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1559
1576
|
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1560
1577
|
createElementVNode("div", _hoisted_2, [
|
|
1561
1578
|
createElementVNode("div", _hoisted_3, [
|
|
1562
|
-
unref(getActionsProps)?.buttonList.length ? (openBlock(), createBlock(unref(DtFormButtons), normalizeProps(mergeProps({ key: 0 }, unref(getActionsProps))), null, 16)) : createCommentVNode("", true),
|
|
1579
|
+
unref(getActionsProps)?.buttonList.length ? (openBlock(), createBlock(unref(DtFormButtons), normalizeProps(mergeProps({ key: 0 }, unref(getActionsProps))), null, 16)) : createCommentVNode("v-if", true),
|
|
1563
1580
|
renderSlot(_ctx.$slots, "toolbar")
|
|
1564
1581
|
]),
|
|
1565
1582
|
__props.tableSetting ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
1566
|
-
createVNode(
|
|
1567
|
-
])) : createCommentVNode("", true)
|
|
1583
|
+
createVNode(DtTableSetting, { setting: __props.tableSetting }, null, 8, ["setting"])
|
|
1584
|
+
])) : createCommentVNode("v-if", true)
|
|
1568
1585
|
]),
|
|
1569
1586
|
_ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
1570
1587
|
renderSlot(_ctx.$slots, "headerTop")
|
|
1571
|
-
])) : createCommentVNode("", true)
|
|
1588
|
+
])) : createCommentVNode("v-if", true)
|
|
1572
1589
|
]);
|
|
1573
1590
|
};
|
|
1574
1591
|
}
|
|
1575
1592
|
});
|
|
1593
|
+
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"]]);
|
|
1576
1594
|
function useTableHeader(propsRef, slots, handlers) {
|
|
1577
1595
|
const { t } = useI18n("UI");
|
|
1578
|
-
const getHeaderProps = computed(() => {
|
|
1596
|
+
const getHeaderProps = computed$1(() => {
|
|
1579
1597
|
const TABLE_TOOLS = [
|
|
1580
1598
|
{ t: "\u65B0\u589E", label: t("ADD"), preIcon: "mdi:plus", type: "primary", onClick: unref(propsRef).onOPenAddDialog },
|
|
1581
1599
|
{ t: "\u5220\u9664", label: t("DELETE"), preIcon: "mdi:delete-outline", onClick: unref(propsRef).onDeletes }
|
|
@@ -1585,7 +1603,7 @@ function useTableHeader(propsRef, slots, handlers) {
|
|
|
1585
1603
|
const hideTitle = (!toolbar || !toolbar.filter((it) => it.show ?? true).length) && !slots.toolbar && !slots.headerTop && !tableSetting;
|
|
1586
1604
|
return {
|
|
1587
1605
|
title: hideTitle ? null : () => h$1(
|
|
1588
|
-
|
|
1606
|
+
TableHeader,
|
|
1589
1607
|
{
|
|
1590
1608
|
tableSetting,
|
|
1591
1609
|
toolbar,
|
|
@@ -1635,7 +1653,7 @@ function usePagination(props2) {
|
|
|
1635
1653
|
}
|
|
1636
1654
|
}
|
|
1637
1655
|
);
|
|
1638
|
-
const getPaginationInfo = computed(() => {
|
|
1656
|
+
const getPaginationInfo = computed$1(() => {
|
|
1639
1657
|
const { appConf } = useAppStore();
|
|
1640
1658
|
let { pagination } = unref(props2);
|
|
1641
1659
|
if (isBoolean(pagination) && !pagination) {
|
|
@@ -1688,7 +1706,7 @@ const DEFAULT_CONFIG = {
|
|
|
1688
1706
|
function useRowSelection(propsRef, emit) {
|
|
1689
1707
|
const selectedRowKeysRef = ref([]);
|
|
1690
1708
|
const selectedRowRef = ref([]);
|
|
1691
|
-
const getRowSelectionRef = computed(() => {
|
|
1709
|
+
const getRowSelectionRef = computed$1(() => {
|
|
1692
1710
|
const { rowSelection, showCheckboxColumn, checkStrictly } = unref(propsRef);
|
|
1693
1711
|
if (!rowSelection && !showCheckboxColumn)
|
|
1694
1712
|
return null;
|
|
@@ -1776,13 +1794,19 @@ function useRowSelection(propsRef, emit) {
|
|
|
1776
1794
|
setSelectedRowKeys
|
|
1777
1795
|
};
|
|
1778
1796
|
}
|
|
1797
|
+
var TABLE_SIZE_HEIGHT = /* @__PURE__ */ ((TABLE_SIZE_HEIGHT2) => {
|
|
1798
|
+
TABLE_SIZE_HEIGHT2[TABLE_SIZE_HEIGHT2["large"] = 56] = "large";
|
|
1799
|
+
TABLE_SIZE_HEIGHT2[TABLE_SIZE_HEIGHT2["middle"] = 47] = "middle";
|
|
1800
|
+
TABLE_SIZE_HEIGHT2[TABLE_SIZE_HEIGHT2["small"] = 32] = "small";
|
|
1801
|
+
return TABLE_SIZE_HEIGHT2;
|
|
1802
|
+
})(TABLE_SIZE_HEIGHT || {});
|
|
1779
1803
|
function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
1780
1804
|
const tableHeightRef = ref(0), filterSource = ref([]);
|
|
1781
|
-
ref(null);
|
|
1782
1805
|
let footerEl, bodyEl;
|
|
1806
|
+
let oldPageNum = -1;
|
|
1783
1807
|
const debounceRedoHeight = useDebounceFn(redoHeight, 100);
|
|
1784
1808
|
windowResizeFn(calcTableHeight, 280);
|
|
1785
|
-
const getCanResize = computed(() => {
|
|
1809
|
+
const getCanResize = computed$1(() => {
|
|
1786
1810
|
const { canResize, scroll } = unref(propsRef);
|
|
1787
1811
|
return canResize && !(scroll || {}).y;
|
|
1788
1812
|
});
|
|
@@ -1835,7 +1859,9 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
1835
1859
|
if (!unref(getCanResize) || !unref(tableData))
|
|
1836
1860
|
return;
|
|
1837
1861
|
await nextTick();
|
|
1838
|
-
let headerHeight = 0, paginationHeight = 2, footerHeight = 0, titleHeight = tableEl.querySelector(".ant-table-title")?.offsetHeight ?? 0
|
|
1862
|
+
let headerHeight = 0, paginationHeight = 2, footerHeight = 0, titleHeight = tableEl.querySelector(".ant-table-title")?.offsetHeight ?? 0;
|
|
1863
|
+
const { paddingBottom, paddingTop, marginTop, marginBottom } = getComputedStyle(tableEl, null);
|
|
1864
|
+
const marginHeight = parseInt(paddingBottom) + parseInt(paddingTop) + parseInt(marginTop) + parseInt(marginBottom);
|
|
1839
1865
|
const headEl = tableEl.querySelector(".ant-table-thead ");
|
|
1840
1866
|
if (headEl) {
|
|
1841
1867
|
headerHeight = headEl.offsetHeight;
|
|
@@ -1855,7 +1881,7 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
1855
1881
|
footerHeight += offsetHeight || 0;
|
|
1856
1882
|
}
|
|
1857
1883
|
} else {
|
|
1858
|
-
paginationHeight =
|
|
1884
|
+
paginationHeight = 0;
|
|
1859
1885
|
}
|
|
1860
1886
|
const tableHeight = table?.$el?.offsetHeight ?? 0;
|
|
1861
1887
|
if (tableData.length === 0)
|
|
@@ -1866,9 +1892,9 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
1866
1892
|
bodyEl.style.height = `${height}px`;
|
|
1867
1893
|
if (tableData.length === 0)
|
|
1868
1894
|
return;
|
|
1869
|
-
filterSource.value = unref(propsRef)?.dataSource;
|
|
1895
|
+
virtual ? calcTableScroll() : filterSource.value = unref(propsRef)?.dataSource;
|
|
1870
1896
|
}
|
|
1871
|
-
const getScrollX = computed(() => {
|
|
1897
|
+
const getScrollX = computed$1(() => {
|
|
1872
1898
|
let width = 0;
|
|
1873
1899
|
if (unref(rowSelectionRef)) {
|
|
1874
1900
|
width += 32;
|
|
@@ -1882,11 +1908,11 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
1882
1908
|
const tableWidth = table?.$el?.offsetWidth ?? 0;
|
|
1883
1909
|
return tableWidth > width ? "100%" : width;
|
|
1884
1910
|
});
|
|
1885
|
-
const hideScrollX = computed(() => {
|
|
1911
|
+
const hideScrollX = computed$1(() => {
|
|
1886
1912
|
let operations = unref(propsRef).operations;
|
|
1887
1913
|
return !operations || isObject(operations) && operations?.btns && !operations?.btns?.length || isArray(operations) && !operations.length;
|
|
1888
1914
|
});
|
|
1889
|
-
const getScrollRef = computed(() => {
|
|
1915
|
+
const getScrollRef = computed$1(() => {
|
|
1890
1916
|
const tableHeight = unref(tableHeightRef);
|
|
1891
1917
|
const { canResize, scroll } = unref(propsRef);
|
|
1892
1918
|
return {
|
|
@@ -1896,24 +1922,74 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
1896
1922
|
...scroll
|
|
1897
1923
|
};
|
|
1898
1924
|
});
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1925
|
+
async function calcTableScroll() {
|
|
1926
|
+
const tableEl = unref(tableElRef)?.$el;
|
|
1927
|
+
bodyEl = tableEl.querySelector(".ant-table-body");
|
|
1928
|
+
const { getUiSize } = useHeader();
|
|
1929
|
+
const rowHeight = TABLE_SIZE_HEIGHT[unref(getUiSize)];
|
|
1930
|
+
const itemSize = Math.ceil(tableHeightRef.value / rowHeight);
|
|
1931
|
+
createScrollWrap(bodyEl, rowHeight * itemSize * 2);
|
|
1932
|
+
calcScroll(bodyEl, rowHeight, itemSize);
|
|
1933
|
+
const fn = () => calcScroll(bodyEl, rowHeight, itemSize);
|
|
1934
|
+
tryOnMounted(() => off(bodyEl, "scroll", fn));
|
|
1935
|
+
on(bodyEl, "scroll", fn);
|
|
1936
|
+
}
|
|
1937
|
+
function createScrollWrap(el, prefixH) {
|
|
1938
|
+
let data = unref(propsRef)?.dataSource?.length;
|
|
1939
|
+
const { getUiSize } = useHeader();
|
|
1940
|
+
const rowHeight = TABLE_SIZE_HEIGHT[unref(getUiSize)];
|
|
1941
|
+
let scrollWrap = el.querySelector(".tableScrollWrap");
|
|
1942
|
+
let wrapHeight = data * rowHeight - prefixH + "px";
|
|
1943
|
+
if (scrollWrap) {
|
|
1944
|
+
scrollWrap.style.height = wrapHeight;
|
|
1945
|
+
} else {
|
|
1946
|
+
let div = document.createElement("div");
|
|
1947
|
+
div.className = "tableScrollWrap";
|
|
1948
|
+
div.style.height = wrapHeight;
|
|
1949
|
+
el.insertBefore(div, el.querySelector("table")[0]);
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
function changeSize(bodyEl2, pageNum, itemH, itemSize) {
|
|
1953
|
+
requestAnimationFrame(() => {
|
|
1954
|
+
if (pageNum > 0) {
|
|
1955
|
+
if (oldPageNum === pageNum)
|
|
1956
|
+
return;
|
|
1957
|
+
else
|
|
1958
|
+
oldPageNum = pageNum;
|
|
1959
|
+
let data = unref(propsRef)?.dataSource?.length;
|
|
1960
|
+
let maxIndex = (pageNum + 2) * itemSize;
|
|
1961
|
+
let minIndex = (pageNum - 1) * itemSize;
|
|
1962
|
+
if (maxIndex > data) {
|
|
1963
|
+
maxIndex = data;
|
|
1964
|
+
minIndex = data - itemSize * 2;
|
|
1965
|
+
}
|
|
1966
|
+
bodyEl2.querySelector("table").style.transform = `translateY(${minIndex * itemH}px)`;
|
|
1967
|
+
filterSource.value = unref(propsRef)?.dataSource.slice(minIndex, maxIndex);
|
|
1968
|
+
} else {
|
|
1969
|
+
bodyEl2.querySelector("table").style.transform = `translateY(0px)`;
|
|
1970
|
+
filterSource.value = unref(propsRef)?.dataSource.slice(0, itemSize * 3);
|
|
1971
|
+
}
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
async function calcScroll(el, itemH, itemSize) {
|
|
1975
|
+
const scrollTop = el.scrollTop;
|
|
1976
|
+
const currentPage = Math.floor(scrollTop / (itemH * itemSize));
|
|
1977
|
+
changeSize(el, currentPage, itemH, itemSize);
|
|
1978
|
+
}
|
|
1903
1979
|
return {
|
|
1904
1980
|
getScrollRef,
|
|
1905
1981
|
filterSource
|
|
1906
1982
|
};
|
|
1907
1983
|
}
|
|
1908
1984
|
function useRows(propsRef) {
|
|
1909
|
-
function getRowClassName(record,
|
|
1985
|
+
function getRowClassName(record, index2) {
|
|
1910
1986
|
const { striped, rowClassName } = unref(propsRef);
|
|
1911
1987
|
const classNames = [];
|
|
1912
1988
|
if (striped) {
|
|
1913
|
-
classNames.push(
|
|
1989
|
+
classNames.push(index2 % 2 === 1 ? "table-striped" : "");
|
|
1914
1990
|
}
|
|
1915
1991
|
if (rowClassName && isFunction(rowClassName)) {
|
|
1916
|
-
classNames.push(rowClassName(record,
|
|
1992
|
+
classNames.push(rowClassName(record, index2));
|
|
1917
1993
|
}
|
|
1918
1994
|
return classNames.join(" ");
|
|
1919
1995
|
}
|
|
@@ -1943,7 +2019,7 @@ const _sfc_main$1 = {
|
|
|
1943
2019
|
const {
|
|
1944
2020
|
column,
|
|
1945
2021
|
record,
|
|
1946
|
-
index
|
|
2022
|
+
index: index2
|
|
1947
2023
|
} = props2;
|
|
1948
2024
|
const {
|
|
1949
2025
|
render,
|
|
@@ -1966,10 +2042,10 @@ const _sfc_main$1 = {
|
|
|
1966
2042
|
if (!apiStruc) {
|
|
1967
2043
|
error(`${struc}\u672A\u5728structure\u4E2D\u914D\u7F6E`);
|
|
1968
2044
|
} else {
|
|
1969
|
-
renderText = getDictValueByCode(text, apiStruc);
|
|
2045
|
+
renderText = computed(() => getDictValueByCode(text, apiStruc));
|
|
1970
2046
|
}
|
|
1971
2047
|
} else if (dict) {
|
|
1972
|
-
renderText = getDictValueByCode(text, dict);
|
|
2048
|
+
renderText = computed(() => getDictValueByCode(text, dict));
|
|
1973
2049
|
} else if (date) {
|
|
1974
2050
|
renderText.value = (text && dayjs(text).format(date || "YYYY-MM-DD")) ?? "";
|
|
1975
2051
|
} else if (number) {
|
|
@@ -1985,7 +2061,7 @@ const _sfc_main$1 = {
|
|
|
1985
2061
|
});
|
|
1986
2062
|
}
|
|
1987
2063
|
} else if (isFunction(render)) {
|
|
1988
|
-
let afterRenderData = render(record,
|
|
2064
|
+
let afterRenderData = render(record, index2, text);
|
|
1989
2065
|
if (afterRenderData.__v_isRef) {
|
|
1990
2066
|
renderText = afterRenderData;
|
|
1991
2067
|
} else if (afterRenderData["setup"]) {
|
|
@@ -2003,6 +2079,7 @@ const _sfc_main$1 = {
|
|
|
2003
2079
|
return () => createVNode("span", null, [unref(renderText)]);
|
|
2004
2080
|
}
|
|
2005
2081
|
};
|
|
2082
|
+
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"]]);
|
|
2006
2083
|
const DEFAULT_SORT_FN = (sortInfo) => {
|
|
2007
2084
|
const { field, order } = sortInfo;
|
|
2008
2085
|
return field && order ? { field, order } : {};
|
|
@@ -2026,7 +2103,7 @@ const TableProps = {
|
|
|
2026
2103
|
}
|
|
2027
2104
|
},
|
|
2028
2105
|
rowKey: {
|
|
2029
|
-
type: String,
|
|
2106
|
+
type: [String, Number],
|
|
2030
2107
|
default: "id"
|
|
2031
2108
|
},
|
|
2032
2109
|
columnCode: { type: String, default: "" },
|
|
@@ -2104,11 +2181,11 @@ const TableProps = {
|
|
|
2104
2181
|
},
|
|
2105
2182
|
onOpenUpdateDialog: {
|
|
2106
2183
|
type: Function,
|
|
2107
|
-
default: (row,
|
|
2184
|
+
default: (row, index2) => ({})
|
|
2108
2185
|
},
|
|
2109
2186
|
onDelete: {
|
|
2110
2187
|
type: Function,
|
|
2111
|
-
default: (row,
|
|
2188
|
+
default: (row, index2) => ({})
|
|
2112
2189
|
},
|
|
2113
2190
|
onDeletes: {
|
|
2114
2191
|
type: Function,
|
|
@@ -2139,11 +2216,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2139
2216
|
const attrs = useAttrs();
|
|
2140
2217
|
const slots = useSlots$1();
|
|
2141
2218
|
const innerPropsRef = ref();
|
|
2142
|
-
const getProps = computed(() => {
|
|
2219
|
+
const getProps = computed$1(() => {
|
|
2143
2220
|
return { ...props2, ...unref(innerPropsRef) };
|
|
2144
2221
|
});
|
|
2145
2222
|
const { getRowClassName } = useRows(getProps);
|
|
2146
|
-
const tableCls = computed(() => {
|
|
2223
|
+
const tableCls = computed$1(() => {
|
|
2147
2224
|
return [
|
|
2148
2225
|
"dt-table",
|
|
2149
2226
|
"box-border",
|
|
@@ -2185,7 +2262,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2185
2262
|
clearSelectedRowKeys
|
|
2186
2263
|
}
|
|
2187
2264
|
);
|
|
2188
|
-
const getBind = computed(() => {
|
|
2265
|
+
const getBind = computed$1(() => {
|
|
2189
2266
|
return {
|
|
2190
2267
|
...attrs,
|
|
2191
2268
|
...unref(getProps),
|
|
@@ -2256,15 +2333,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2256
2333
|
rowClassName: unref(getRowClassName),
|
|
2257
2334
|
onChange: unref(handleTableChange)
|
|
2258
2335
|
}), createSlots({
|
|
2259
|
-
bodyCell: withCtx(({ column, record, index }) => [
|
|
2260
|
-
_ctx.$slots.bodyCell ? renderSlot(_ctx.$slots, "bodyCell", normalizeProps(mergeProps({ key: 0 }, { column, record, index }))) : createCommentVNode("", true),
|
|
2261
|
-
column.slot ? renderSlot(_ctx.$slots, column.slot, normalizeProps(mergeProps({ key: 1 }, { column, record, index }))) : createCommentVNode("", true),
|
|
2262
|
-
|
|
2336
|
+
bodyCell: withCtx(({ column, record, index: index2 }) => [
|
|
2337
|
+
_ctx.$slots.bodyCell ? renderSlot(_ctx.$slots, "bodyCell", normalizeProps(mergeProps({ key: 0 }, { column, record, index: index2 }))) : createCommentVNode("v-if", true),
|
|
2338
|
+
column.slot ? renderSlot(_ctx.$slots, column.slot, normalizeProps(mergeProps({ key: 1 }, { column, record, index: index2 }))) : createCommentVNode("v-if", true),
|
|
2339
|
+
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 "),
|
|
2340
|
+
column?.render && !column.slot && !_ctx.$slots.bodyCell ? (openBlock(), createBlock(TableRender, {
|
|
2263
2341
|
key: 2,
|
|
2264
2342
|
column,
|
|
2265
2343
|
record,
|
|
2266
|
-
index
|
|
2267
|
-
}, null, 8, ["column", "record", "index"])) : createCommentVNode("", true)
|
|
2344
|
+
index: index2
|
|
2345
|
+
}, null, 8, ["column", "record", "index"])) : createCommentVNode("v-if", true)
|
|
2268
2346
|
]),
|
|
2269
2347
|
emptyText: withCtx(() => [
|
|
2270
2348
|
_hoisted_1
|
|
@@ -2283,7 +2361,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2283
2361
|
};
|
|
2284
2362
|
}
|
|
2285
2363
|
});
|
|
2364
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/index.vue"]]);
|
|
2286
2365
|
export {
|
|
2287
|
-
|
|
2366
|
+
index as DtTable,
|
|
2288
2367
|
useTable
|
|
2289
2368
|
};
|