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(() => {
return {
height: 'calc(100vh - 251px)',
threshold: 200,
fixedSize: true,
buffer: 15, // 10 padding
};
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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