@dt-frames/ui 2.0.11 → 2.0.13
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 +7 -5
- 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 +79 -18
- package/es/components/table/src/enums/table.enum.d.ts +5 -0
- package/es/components/table/src/index.d.ts +10 -10
- package/es/components/table/src/props.d.ts +3 -3
- 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
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Spin } from "ant-design-vue/es";
|
|
2
|
+
import "ant-design-vue/es/spin/style";
|
|
3
|
+
import { defineComponent, ref, unref, watch, openBlock, createElementBlock, createVNode, withCtx, createElementVNode } from "vue";
|
|
4
|
+
import { windowResizeFn, dispatchResize } from "@dt-frames/core";
|
|
5
|
+
const _hoisted_1 = { class: "iframe-page" };
|
|
6
|
+
const _hoisted_2 = ["src"];
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "index",
|
|
9
|
+
props: {
|
|
10
|
+
showLoading: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: true
|
|
13
|
+
},
|
|
14
|
+
src: {
|
|
15
|
+
type: String
|
|
16
|
+
},
|
|
17
|
+
exeReduce: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 78
|
|
20
|
+
},
|
|
21
|
+
postMsg: null
|
|
22
|
+
},
|
|
23
|
+
setup(__props) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
const loading = ref(true);
|
|
26
|
+
const frameRef = ref();
|
|
27
|
+
windowResizeFn(calcHeight, 150, { immediate: true });
|
|
28
|
+
function calcHeight() {
|
|
29
|
+
const iframe = unref(frameRef);
|
|
30
|
+
if (!iframe) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const clientHeight = document.documentElement.clientHeight - props.exeReduce;
|
|
34
|
+
iframe.style.height = `${clientHeight}px`;
|
|
35
|
+
}
|
|
36
|
+
watch(
|
|
37
|
+
() => props.exeReduce,
|
|
38
|
+
(v) => {
|
|
39
|
+
calcHeight();
|
|
40
|
+
dispatchResize();
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
function afterLoaded() {
|
|
44
|
+
loading.value = false;
|
|
45
|
+
calcHeight();
|
|
46
|
+
dispatchResize();
|
|
47
|
+
}
|
|
48
|
+
return (_ctx, _cache) => {
|
|
49
|
+
const _component_ASpin = Spin;
|
|
50
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
51
|
+
createVNode(_component_ASpin, {
|
|
52
|
+
spinning: loading.value,
|
|
53
|
+
size: "large"
|
|
54
|
+
}, {
|
|
55
|
+
default: withCtx(() => [
|
|
56
|
+
createElementVNode("iframe", {
|
|
57
|
+
src: __props.src,
|
|
58
|
+
class: "iframe-page__main",
|
|
59
|
+
ref_key: "frameRef",
|
|
60
|
+
ref: frameRef,
|
|
61
|
+
onLoad: _cache[0] || (_cache[0] = ($event) => afterLoaded())
|
|
62
|
+
}, null, 40, _hoisted_2)
|
|
63
|
+
]),
|
|
64
|
+
_: 1
|
|
65
|
+
}, 8, ["spinning"])
|
|
66
|
+
]);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
_sfc_main as DtIframe
|
|
72
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.iframe-page{
|
|
2
|
+
height: 100%;
|
|
3
|
+
.ant-spin-nested-loading {
|
|
4
|
+
position: relative;
|
|
5
|
+
height: 100%;
|
|
6
|
+
|
|
7
|
+
.ant-spin-container {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&__mask {
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&__main {
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
background-color: #fff;
|
|
26
|
+
border: 0;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
2
|
+
showLoading: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
src: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
};
|
|
9
|
+
exeReduce: {
|
|
10
|
+
type: NumberConstructor;
|
|
11
|
+
default: number;
|
|
12
|
+
};
|
|
13
|
+
postMsg: any;
|
|
14
|
+
}, {
|
|
15
|
+
props: any;
|
|
16
|
+
loading: import("vue").Ref<boolean>;
|
|
17
|
+
frameRef: import("vue").Ref<any>;
|
|
18
|
+
calcHeight: () => void;
|
|
19
|
+
afterLoaded: () => void;
|
|
20
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
+
showLoading: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
src: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
};
|
|
28
|
+
exeReduce: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
postMsg: any;
|
|
33
|
+
}>>, {
|
|
34
|
+
showLoading: boolean;
|
|
35
|
+
exeReduce: number;
|
|
36
|
+
postMsg: any;
|
|
37
|
+
}>;
|
|
38
|
+
export default _sfc_main;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useApp, isFunction, isObject, error, useTimeoutFn, useSlots, useI18n, windowResizeFn, dispatchResize, isArray, deepMerge } from "@dt-frames/core";
|
|
1
|
+
import { useApp, isFunction, isObject, error, useTimeoutFn, useSlots, getPopupContainer, useI18n, windowResizeFn, dispatchResize, isArray, deepMerge } from "@dt-frames/core";
|
|
2
2
|
import { reactive, ref, getCurrentInstance, watchEffect, unref, nextTick, onUnmounted, toRaw, toRefs, useAttrs, createVNode, isVNode, defineComponent, computed, openBlock, createElementBlock, normalizeClass, Fragment, createBlock, withCtx, createElementVNode, createCommentVNode, onMounted, watch, normalizeStyle, renderSlot, mergeProps, createSlots, createTextVNode, toDisplayString, renderList, normalizeProps, guardReactiveProps } from "vue";
|
|
3
3
|
import { Tooltip, Spin } from "ant-design-vue/es";
|
|
4
4
|
import "ant-design-vue/es/spin/style";
|
|
@@ -98,7 +98,7 @@ function useModal(props, setModalData) {
|
|
|
98
98
|
if (!setModalData || !isFunction(setModalData))
|
|
99
99
|
return;
|
|
100
100
|
nextTick(() => {
|
|
101
|
-
setModalData(data);
|
|
101
|
+
setModalData(data ?? {});
|
|
102
102
|
if (!data)
|
|
103
103
|
return;
|
|
104
104
|
if (props?.title && isFunction(props?.title)) {
|
|
@@ -311,7 +311,8 @@ const _sfc_main$4 = {
|
|
|
311
311
|
...unref(attrs),
|
|
312
312
|
...props,
|
|
313
313
|
destroyOnClose: true,
|
|
314
|
-
onCancel
|
|
314
|
+
onCancel,
|
|
315
|
+
getContainer: getPopupContainer()
|
|
315
316
|
};
|
|
316
317
|
if (!propsData?.visible)
|
|
317
318
|
return null;
|
|
@@ -566,13 +567,17 @@ function useFullScreen(wrapClassName) {
|
|
|
566
567
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
567
568
|
__name: "index",
|
|
568
569
|
props: basicProps,
|
|
569
|
-
emits: ["visible-change", "height-change", "cancel", "save", "register", "update:visible"],
|
|
570
|
+
emits: ["visible-change", "height-change", "cancel", "save", "register", "toggle-fullscreen", "update:visible"],
|
|
570
571
|
setup(__props, { emit: emits }) {
|
|
571
572
|
const props = __props;
|
|
572
573
|
const visibleRef = ref(false);
|
|
573
574
|
const propsRef = ref();
|
|
574
575
|
const modalWrapperRef = ref(null);
|
|
575
576
|
const { getWrapClassName, toggleFullScreen, fullScreenRef } = useFullScreen(computed(() => unref(propsRef)?.wrapClassName));
|
|
577
|
+
function handleFullscreen(e) {
|
|
578
|
+
toggleFullScreen(e);
|
|
579
|
+
emits("toggle-fullscreen", unref(fullScreenRef));
|
|
580
|
+
}
|
|
576
581
|
const getMergeProps = computed(() => {
|
|
577
582
|
return {
|
|
578
583
|
...props,
|
|
@@ -698,8 +703,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
698
703
|
canFullscreen: unref(getBindValue).canFullscreen,
|
|
699
704
|
fullScreen: unref(fullScreenRef),
|
|
700
705
|
onCancel: handleCancel,
|
|
701
|
-
onFullscreen:
|
|
702
|
-
}, null, 8, ["canFullscreen", "fullScreen"
|
|
706
|
+
onFullscreen: handleFullscreen
|
|
707
|
+
}, null, 8, ["canFullscreen", "fullScreen"])
|
|
703
708
|
]),
|
|
704
709
|
key: "0"
|
|
705
710
|
} : void 0,
|
|
@@ -100,7 +100,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
100
100
|
afterClose: FunctionConstructor;
|
|
101
101
|
}, {
|
|
102
102
|
props: any;
|
|
103
|
-
emits: (event: "visible-change" | "height-change" | "cancel" | "save" | "register" | "update:visible", ...args: any[]) => void;
|
|
103
|
+
emits: (event: "visible-change" | "height-change" | "cancel" | "save" | "register" | "toggle-fullscreen" | "update:visible", ...args: any[]) => void;
|
|
104
104
|
visibleRef: import("vue").Ref<boolean>;
|
|
105
105
|
propsRef: import("vue").Ref<Partial<ExtractPropTypes<{
|
|
106
106
|
t: {
|
|
@@ -204,6 +204,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
204
204
|
getWrapClassName: import("vue").ComputedRef<string>;
|
|
205
205
|
toggleFullScreen: (e: Event) => void;
|
|
206
206
|
fullScreenRef: import("vue").Ref<boolean>;
|
|
207
|
+
handleFullscreen: (e: Event) => void;
|
|
207
208
|
getMergeProps: import("vue").ComputedRef<any>;
|
|
208
209
|
getBindValue: import("vue").ComputedRef<any>;
|
|
209
210
|
getWrapperHeight: import("vue").ComputedRef<any>;
|
|
@@ -492,7 +493,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
492
493
|
showSave: boolean;
|
|
493
494
|
showCancel: boolean;
|
|
494
495
|
}>;
|
|
495
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("visible-change" | "height-change" | "cancel" | "save" | "register" | "update:visible")[], "visible-change" | "height-change" | "cancel" | "save" | "register" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
496
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("visible-change" | "height-change" | "cancel" | "save" | "register" | "toggle-fullscreen" | "update:visible")[], "visible-change" | "height-change" | "cancel" | "save" | "register" | "toggle-fullscreen" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
496
497
|
t: {
|
|
497
498
|
type: StringConstructor;
|
|
498
499
|
};
|
|
@@ -595,6 +596,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
595
596
|
onCancel?: (...args: any[]) => any;
|
|
596
597
|
onSave?: (...args: any[]) => any;
|
|
597
598
|
onRegister?: (...args: any[]) => any;
|
|
599
|
+
"onToggle-fullscreen"?: (...args: any[]) => any;
|
|
598
600
|
"onUpdate:visible"?: (...args: any[]) => any;
|
|
599
601
|
}, {
|
|
600
602
|
visible: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
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
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";
|
|
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";
|
|
@@ -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";
|
|
@@ -526,7 +526,7 @@ function handleChildren(children, ellipsis) {
|
|
|
526
526
|
function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
527
527
|
const { getIsZH } = useHeader();
|
|
528
528
|
const { t } = useI18n("UI");
|
|
529
|
-
const { showIndexColumn, indexColumnProps, isTreeTable } = unref(propsRef);
|
|
529
|
+
const { showIndexColumn, indexColumnProps, isTreeTable, virtual } = unref(propsRef);
|
|
530
530
|
let pushIndexColumns = false;
|
|
531
531
|
if (unref(isTreeTable)) {
|
|
532
532
|
return;
|
|
@@ -547,7 +547,9 @@ function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
|
547
547
|
width: unref(getIsZH) ? 50 : 70,
|
|
548
548
|
title: t("NUMBER"),
|
|
549
549
|
align: "center",
|
|
550
|
-
customRender: ({ index }) => {
|
|
550
|
+
customRender: ({ index, renderIndex, record }) => {
|
|
551
|
+
if (virtual && record?.index)
|
|
552
|
+
return record?.index;
|
|
551
553
|
const getPagination = unref(getPaginationRef);
|
|
552
554
|
const { appConf } = useAppStore();
|
|
553
555
|
const { defaultPageSize } = appConf.ui.table;
|
|
@@ -1087,6 +1089,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1087
1089
|
const table = getTableInstance();
|
|
1088
1090
|
const [registerDialog, { openModal }] = useModalOut();
|
|
1089
1091
|
const { appConf } = useAppStore();
|
|
1092
|
+
const getPopupContainer$1 = () => document.getElementById("dt-layout-content") || getPopupContainer();
|
|
1090
1093
|
const { t } = useI18n("UI");
|
|
1091
1094
|
const isInclude = (type) => {
|
|
1092
1095
|
return isBoolean(props2.download) && props2.download && appConf?.ui?.table?.exportTable.includes(type) || isArray(props2.download) && props2.download.includes(type);
|
|
@@ -1119,7 +1122,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1119
1122
|
createVNode(_component_ADropdown, {
|
|
1120
1123
|
placement: "bottom",
|
|
1121
1124
|
trigger: ["click"],
|
|
1122
|
-
getPopupContainer:
|
|
1125
|
+
getPopupContainer: getPopupContainer$1
|
|
1123
1126
|
}, {
|
|
1124
1127
|
overlay: withCtx(() => [
|
|
1125
1128
|
createVNode(_component_AMenu, { onClick: handleTitleClick }, {
|
|
@@ -1150,7 +1153,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1150
1153
|
_hoisted_1$4
|
|
1151
1154
|
]),
|
|
1152
1155
|
_: 1
|
|
1153
|
-
}
|
|
1156
|
+
}),
|
|
1154
1157
|
createVNode(_sfc_main$6, { onRegister: unref(registerDialog) }, null, 8, ["onRegister"])
|
|
1155
1158
|
]),
|
|
1156
1159
|
_: 1
|
|
@@ -1338,7 +1341,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1338
1341
|
state.checkedList = checkList;
|
|
1339
1342
|
}
|
|
1340
1343
|
function getPopupContainer$1() {
|
|
1341
|
-
return isFunction$1(attrs.getPopupContainer) ? attrs.getPopupContainer() : getPopupContainer();
|
|
1344
|
+
return isFunction$1(attrs.getPopupContainer) ? attrs.getPopupContainer() : document.getElementById("dt-layout-content") || getPopupContainer();
|
|
1342
1345
|
}
|
|
1343
1346
|
return (_ctx, _cache) => {
|
|
1344
1347
|
const _component_ACheckbox = Checkbox$1;
|
|
@@ -1776,10 +1779,16 @@ function useRowSelection(propsRef, emit) {
|
|
|
1776
1779
|
setSelectedRowKeys
|
|
1777
1780
|
};
|
|
1778
1781
|
}
|
|
1782
|
+
var TABLE_SIZE_HEIGHT = /* @__PURE__ */ ((TABLE_SIZE_HEIGHT2) => {
|
|
1783
|
+
TABLE_SIZE_HEIGHT2[TABLE_SIZE_HEIGHT2["large"] = 56] = "large";
|
|
1784
|
+
TABLE_SIZE_HEIGHT2[TABLE_SIZE_HEIGHT2["middle"] = 47] = "middle";
|
|
1785
|
+
TABLE_SIZE_HEIGHT2[TABLE_SIZE_HEIGHT2["small"] = 32] = "small";
|
|
1786
|
+
return TABLE_SIZE_HEIGHT2;
|
|
1787
|
+
})(TABLE_SIZE_HEIGHT || {});
|
|
1779
1788
|
function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
1780
1789
|
const tableHeightRef = ref(0), filterSource = ref([]);
|
|
1781
|
-
ref(null);
|
|
1782
1790
|
let footerEl, bodyEl;
|
|
1791
|
+
let oldPageNum = -1;
|
|
1783
1792
|
const debounceRedoHeight = useDebounceFn(redoHeight, 100);
|
|
1784
1793
|
windowResizeFn(calcTableHeight, 280);
|
|
1785
1794
|
const getCanResize = computed(() => {
|
|
@@ -1835,7 +1844,9 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
1835
1844
|
if (!unref(getCanResize) || !unref(tableData))
|
|
1836
1845
|
return;
|
|
1837
1846
|
await nextTick();
|
|
1838
|
-
let headerHeight = 0, paginationHeight = 2, footerHeight = 0, titleHeight = tableEl.querySelector(".ant-table-title")?.offsetHeight ?? 0
|
|
1847
|
+
let headerHeight = 0, paginationHeight = 2, footerHeight = 0, titleHeight = tableEl.querySelector(".ant-table-title")?.offsetHeight ?? 0;
|
|
1848
|
+
const { paddingBottom, paddingTop, marginTop, marginBottom } = getComputedStyle(tableEl, null);
|
|
1849
|
+
const marginHeight = parseInt(paddingBottom) + parseInt(paddingTop) + parseInt(marginTop) + parseInt(marginBottom);
|
|
1839
1850
|
const headEl = tableEl.querySelector(".ant-table-thead ");
|
|
1840
1851
|
if (headEl) {
|
|
1841
1852
|
headerHeight = headEl.offsetHeight;
|
|
@@ -1855,7 +1866,7 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
1855
1866
|
footerHeight += offsetHeight || 0;
|
|
1856
1867
|
}
|
|
1857
1868
|
} else {
|
|
1858
|
-
paginationHeight =
|
|
1869
|
+
paginationHeight = 0;
|
|
1859
1870
|
}
|
|
1860
1871
|
const tableHeight = table?.$el?.offsetHeight ?? 0;
|
|
1861
1872
|
if (tableData.length === 0)
|
|
@@ -1866,7 +1877,7 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
1866
1877
|
bodyEl.style.height = `${height}px`;
|
|
1867
1878
|
if (tableData.length === 0)
|
|
1868
1879
|
return;
|
|
1869
|
-
filterSource.value = unref(propsRef)?.dataSource;
|
|
1880
|
+
virtual ? calcTableScroll() : filterSource.value = unref(propsRef)?.dataSource;
|
|
1870
1881
|
}
|
|
1871
1882
|
const getScrollX = computed(() => {
|
|
1872
1883
|
let width = 0;
|
|
@@ -1896,10 +1907,60 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
1896
1907
|
...scroll
|
|
1897
1908
|
};
|
|
1898
1909
|
});
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1910
|
+
async function calcTableScroll() {
|
|
1911
|
+
const tableEl = unref(tableElRef)?.$el;
|
|
1912
|
+
bodyEl = tableEl.querySelector(".ant-table-body");
|
|
1913
|
+
const { getUiSize } = useHeader();
|
|
1914
|
+
const rowHeight = TABLE_SIZE_HEIGHT[unref(getUiSize)];
|
|
1915
|
+
const itemSize = Math.ceil(tableHeightRef.value / rowHeight);
|
|
1916
|
+
createScrollWrap(bodyEl, rowHeight * itemSize * 2);
|
|
1917
|
+
calcScroll(bodyEl, rowHeight, itemSize);
|
|
1918
|
+
const fn = () => calcScroll(bodyEl, rowHeight, itemSize);
|
|
1919
|
+
tryOnMounted(() => off(bodyEl, "scroll", fn));
|
|
1920
|
+
on(bodyEl, "scroll", fn);
|
|
1921
|
+
}
|
|
1922
|
+
function createScrollWrap(el, prefixH) {
|
|
1923
|
+
let data = unref(propsRef)?.dataSource?.length;
|
|
1924
|
+
const { getUiSize } = useHeader();
|
|
1925
|
+
const rowHeight = TABLE_SIZE_HEIGHT[unref(getUiSize)];
|
|
1926
|
+
let scrollWrap = el.querySelector(".tableScrollWrap");
|
|
1927
|
+
let wrapHeight = data * rowHeight - prefixH + "px";
|
|
1928
|
+
if (scrollWrap) {
|
|
1929
|
+
scrollWrap.style.height = wrapHeight;
|
|
1930
|
+
} else {
|
|
1931
|
+
let div = document.createElement("div");
|
|
1932
|
+
div.className = "tableScrollWrap";
|
|
1933
|
+
div.style.height = wrapHeight;
|
|
1934
|
+
el.insertBefore(div, el.querySelector("table")[0]);
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
function changeSize(bodyEl2, pageNum, itemH, itemSize) {
|
|
1938
|
+
requestAnimationFrame(() => {
|
|
1939
|
+
if (pageNum > 0) {
|
|
1940
|
+
if (oldPageNum === pageNum)
|
|
1941
|
+
return;
|
|
1942
|
+
else
|
|
1943
|
+
oldPageNum = pageNum;
|
|
1944
|
+
let data = unref(propsRef)?.dataSource?.length;
|
|
1945
|
+
let maxIndex = (pageNum + 2) * itemSize;
|
|
1946
|
+
let minIndex = (pageNum - 1) * itemSize;
|
|
1947
|
+
if (maxIndex > data) {
|
|
1948
|
+
maxIndex = data;
|
|
1949
|
+
minIndex = data - itemSize * 2;
|
|
1950
|
+
}
|
|
1951
|
+
bodyEl2.querySelector("table").style.transform = `translateY(${minIndex * itemH}px)`;
|
|
1952
|
+
filterSource.value = unref(propsRef)?.dataSource.slice(minIndex, maxIndex);
|
|
1953
|
+
} else {
|
|
1954
|
+
bodyEl2.querySelector("table").style.transform = `translateY(0px)`;
|
|
1955
|
+
filterSource.value = unref(propsRef)?.dataSource.slice(0, itemSize * 3);
|
|
1956
|
+
}
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
async function calcScroll(el, itemH, itemSize) {
|
|
1960
|
+
const scrollTop = el.scrollTop;
|
|
1961
|
+
const currentPage = Math.floor(scrollTop / (itemH * itemSize));
|
|
1962
|
+
changeSize(el, currentPage, itemH, itemSize);
|
|
1963
|
+
}
|
|
1903
1964
|
return {
|
|
1904
1965
|
getScrollRef,
|
|
1905
1966
|
filterSource
|
|
@@ -1966,10 +2027,10 @@ const _sfc_main$1 = {
|
|
|
1966
2027
|
if (!apiStruc) {
|
|
1967
2028
|
error(`${struc}\u672A\u5728structure\u4E2D\u914D\u7F6E`);
|
|
1968
2029
|
} else {
|
|
1969
|
-
renderText = getDictValueByCode(text, apiStruc);
|
|
2030
|
+
renderText = computed(() => getDictValueByCode(text, apiStruc));
|
|
1970
2031
|
}
|
|
1971
2032
|
} else if (dict) {
|
|
1972
|
-
renderText = getDictValueByCode(text, dict);
|
|
2033
|
+
renderText = computed(() => getDictValueByCode(text, dict));
|
|
1973
2034
|
} else if (date) {
|
|
1974
2035
|
renderText.value = (text && dayjs(text).format(date || "YYYY-MM-DD")) ?? "";
|
|
1975
2036
|
} else if (number) {
|
|
@@ -2026,7 +2087,7 @@ const TableProps = {
|
|
|
2026
2087
|
}
|
|
2027
2088
|
},
|
|
2028
2089
|
rowKey: {
|
|
2029
|
-
type: String,
|
|
2090
|
+
type: [String, Number],
|
|
2030
2091
|
default: "id"
|
|
2031
2092
|
},
|
|
2032
2093
|
columnCode: { type: String, default: "" },
|
|
@@ -45,11 +45,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
45
45
|
default: any;
|
|
46
46
|
};
|
|
47
47
|
filterFn: {
|
|
48
|
-
type: import("vue").PropType<(data:
|
|
49
|
-
default: (data:
|
|
48
|
+
type: import("vue").PropType<(data: import("@dt-frames/core").Recordable<string[]>) => any>;
|
|
49
|
+
default: (data: import("@dt-frames/core").Recordable<string[]>) => import("@dt-frames/core").Recordable<string[]>;
|
|
50
50
|
};
|
|
51
51
|
rowKey: {
|
|
52
|
-
type:
|
|
52
|
+
type: import("vue").PropType<string | number>;
|
|
53
53
|
default: string;
|
|
54
54
|
};
|
|
55
55
|
columnCode: {
|
|
@@ -192,7 +192,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
192
192
|
locale?: import("ant-design-vue/es/table/interface").TableLocale;
|
|
193
193
|
prefixCls?: string;
|
|
194
194
|
onChange?: (pagination: import("ant-design-vue/es/table").TablePaginationConfig, filters: Record<string, import("ant-design-vue/es/table/interface").FilterValue>, sorter: import("ant-design-vue/es/table/interface").SorterResult<any> | import("ant-design-vue/es/table/interface").SorterResult<any>[], extra: import("ant-design-vue/es/table/interface").TableCurrentDataSource<any>) => void;
|
|
195
|
-
rowKey: string |
|
|
195
|
+
rowKey: (string | import("ant-design-vue/es/vc-table/interface").GetRowKey<any>) & (string | number);
|
|
196
196
|
dataSource: import("@dt-frames/core").Recordable<any>[];
|
|
197
197
|
bordered: boolean;
|
|
198
198
|
loading: (boolean | Partial<import("vue").ExtractPropTypes<{
|
|
@@ -302,7 +302,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
302
302
|
resizable: boolean;
|
|
303
303
|
virtual: boolean;
|
|
304
304
|
sortFn: Function;
|
|
305
|
-
filterFn: (data:
|
|
305
|
+
filterFn: (data: import("@dt-frames/core").Recordable<string[]>) => any;
|
|
306
306
|
columnCode: string;
|
|
307
307
|
columns: import("./types/table.type").BasicColumn[];
|
|
308
308
|
slotsTemplate: {};
|
|
@@ -444,11 +444,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
444
444
|
default: any;
|
|
445
445
|
};
|
|
446
446
|
filterFn: {
|
|
447
|
-
type: import("vue").PropType<(data:
|
|
448
|
-
default: (data:
|
|
447
|
+
type: import("vue").PropType<(data: import("@dt-frames/core").Recordable<string[]>) => any>;
|
|
448
|
+
default: (data: import("@dt-frames/core").Recordable<string[]>) => import("@dt-frames/core").Recordable<string[]>;
|
|
449
449
|
};
|
|
450
450
|
rowKey: {
|
|
451
|
-
type:
|
|
451
|
+
type: import("vue").PropType<string | number>;
|
|
452
452
|
default: string;
|
|
453
453
|
};
|
|
454
454
|
columnCode: {
|
|
@@ -593,8 +593,8 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
593
593
|
virtual: boolean;
|
|
594
594
|
sortFn: Function;
|
|
595
595
|
defSort: any;
|
|
596
|
-
filterFn: (data:
|
|
597
|
-
rowKey: string;
|
|
596
|
+
filterFn: (data: import("@dt-frames/core").Recordable<string[]>) => any;
|
|
597
|
+
rowKey: string | number;
|
|
598
598
|
columnCode: string;
|
|
599
599
|
columns: import("./types/table.type").BasicColumn[];
|
|
600
600
|
slotsTemplate: {};
|
|
@@ -49,11 +49,11 @@ export declare const TableProps: {
|
|
|
49
49
|
default: any;
|
|
50
50
|
};
|
|
51
51
|
filterFn: {
|
|
52
|
-
type: PropType<(data:
|
|
53
|
-
default: (data:
|
|
52
|
+
type: PropType<(data: Recordable<string[]>) => any>;
|
|
53
|
+
default: (data: Recordable<string[]>) => Recordable<string[]>;
|
|
54
54
|
};
|
|
55
55
|
rowKey: {
|
|
56
|
-
type:
|
|
56
|
+
type: PropType<string | number>;
|
|
57
57
|
default: string;
|
|
58
58
|
};
|
|
59
59
|
columnCode: {
|