feat(全局): MsTree组件传入虚拟滚动参数调整

This commit is contained in:
baiqi 2024-02-19 17:26:12 +08:00 committed by 刘瑞斌
parent b95bc846b2
commit f455ac0085
14 changed files with 50 additions and 2 deletions

View File

@ -198,6 +198,9 @@
const virtualListProps = computed(() => { const virtualListProps = computed(() => {
return { return {
height: 'calc(100vh - 251px)', height: 'calc(100vh - 251px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
}); });

View File

@ -153,6 +153,9 @@
const virtualListProps = computed(() => { const virtualListProps = computed(() => {
return { return {
height: 'calc(100vh - 251px)', height: 'calc(100vh - 251px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
}); });

View File

@ -77,6 +77,9 @@
const virtualListProps = computed(() => { const virtualListProps = computed(() => {
return { return {
height: 'calc(100vh - 296px)', height: 'calc(100vh - 296px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
}); });

View File

@ -82,6 +82,7 @@
import { mapTree } from '@/utils/index'; import { mapTree } from '@/utils/index';
import type { MsTreeFieldNames, MsTreeNodeData, MsTreeSelectedData } from './types'; import type { MsTreeFieldNames, MsTreeNodeData, MsTreeSelectedData } from './types';
import { VirtualListProps } from '@arco-design/web-vue/es/_components/virtual-list-v2/interface';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -102,7 +103,7 @@
checkable?: boolean; // checkable?: boolean; //
checkedStrategy?: 'all' | 'parent' | 'child'; // checkedStrategy?: 'all' | 'parent' | 'child'; //
checkedKeys?: Array<string | number>; // key checkedKeys?: Array<string | number>; // key
virtualListProps?: Record<string, unknown>; // virtualListProps?: VirtualListProps; //
titleTooltipPosition?: titleTooltipPosition?:
| 'top' | 'top'
| 'tl' | 'tl'

View File

@ -745,7 +745,7 @@
saveLoading.value = true; saveLoading.value = true;
if (requestVModel.value.isNew) { if (requestVModel.value.isNew) {
// //
await props.createApi({ const res = await props.createApi({
...makeRequestParams(), ...makeRequestParams(),
...saveModalForm.value, ...saveModalForm.value,
protocol: requestVModel.value.protocol, protocol: requestVModel.value.protocol,
@ -753,6 +753,8 @@
uploadFileIds: [], uploadFileIds: [],
linkFileIds: [], linkFileIds: [],
}); });
requestVModel.value.id = res.id;
requestVModel.value.isNew = false;
} else { } else {
await props.updateApi({ await props.updateApi({
...makeRequestParams(), ...makeRequestParams(),

View File

@ -45,6 +45,9 @@
:empty-text="t('apiTestDebug.noMatchModule')" :empty-text="t('apiTestDebug.noMatchModule')"
:virtual-list-props="{ :virtual-list-props="{
height: '100%', height: '100%',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}" }"
:field-names="{ :field-names="{
title: 'name', title: 'name',

View File

@ -209,10 +209,16 @@
if (props.readOnly) { if (props.readOnly) {
return { return {
height: 'calc(60vh - 190px)', height: 'calc(60vh - 190px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
} }
return { return {
height: 'calc(100vh - 305px)', height: 'calc(100vh - 305px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
}); });

View File

@ -332,6 +332,9 @@
const virtualListProps = computed(() => { const virtualListProps = computed(() => {
return { return {
height: 'calc(100vh - 366px)', height: 'calc(100vh - 366px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
}); });

View File

@ -422,6 +422,9 @@
const virtualListProps = computed(() => { const virtualListProps = computed(() => {
return { return {
height: 'calc(100vh - 270px)', height: 'calc(100vh - 270px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
}); });

View File

@ -190,6 +190,9 @@
const virtualListProps = computed(() => { const virtualListProps = computed(() => {
return { return {
height: 'calc(100vh - 251px)', height: 'calc(100vh - 251px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
}); });

View File

@ -75,6 +75,9 @@
const virtualListProps = computed(() => { const virtualListProps = computed(() => {
return { return {
height: 'calc(100vh - 460px)', height: 'calc(100vh - 460px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
}); });

View File

@ -128,10 +128,16 @@
if (props.isModal) { if (props.isModal) {
return { return {
height: 'calc(60vh - 190px)', height: 'calc(60vh - 190px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
} }
return { return {
height: 'calc(100vh - 325px)', height: 'calc(100vh - 325px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
}); });

View File

@ -105,10 +105,16 @@
if (props.isModal) { if (props.isModal) {
return { return {
height: 'calc(60vh - 190px)', height: 'calc(60vh - 190px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
} }
return { return {
height: 'calc(100vh - 325px)', height: 'calc(100vh - 325px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
}); });
const moduleKeyword = ref(''); const moduleKeyword = ref('');

View File

@ -319,6 +319,9 @@
const virtualListProps = computed(() => { const virtualListProps = computed(() => {
return { return {
height: 'calc(100vh - 366px)', height: 'calc(100vh - 366px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
}; };
}); });