fix(接口测试): 调整组件treeFolderAll操作按钮显隐

This commit is contained in:
teukkk 2024-06-12 12:22:43 +08:00 committed by 刘瑞斌
parent 90f6c45d0b
commit 635d92fad0
2 changed files with 15 additions and 13 deletions

View File

@ -9,7 +9,7 @@
<template #expandLeft>
<a-dropdown v-model:popup-visible="visible" :hide-on-select="false">
<MsButton
v-show="typeof isExpandAll !== 'undefined'"
v-show="!props.notShowOperation"
type="icon"
status="secondary"
class="!mr-[4px] p-[4px]"
@ -81,6 +81,7 @@
folderName: string; //
allCount: number; //
showExpandApi?: boolean; //
notShowOperation?: boolean; //
}>();
const emit = defineEmits<{
(e: 'setActiveFolder', val: string): void;
@ -88,7 +89,7 @@
(e: 'selectedProtocolsChange'): void;
}>();
const isExpandAll = defineModel<boolean>('isExpandAll', {
const isExpandAll = defineModel<boolean | undefined>('isExpandAll', {
required: false,
default: undefined,
});
@ -147,6 +148,17 @@
}
);
watch(
() => props.notShowOperation,
(val) => {
if (val) {
isExpandAll.value = undefined;
} else {
isExpandAll.value = false;
}
}
);
onBeforeMount(() => {
initProtocolList();
});

View File

@ -10,6 +10,7 @@
<TreeFolderAll
v-model:isExpandAll="isExpandAll"
v-model:selectedProtocols="selectedProtocols"
:not-show-operation="props.treeType === 'COLLECTION'"
:active-folder="activeFolder"
:folder-name="t('apiTestManagement.allApi')"
:all-count="allCount"
@ -90,17 +91,6 @@
const allCount = ref(0);
const isExpandAll = ref<boolean | undefined>(false);
watch(
() => props.treeType,
(val) => {
if (val === 'COLLECTION') {
isExpandAll.value = undefined;
} else {
isExpandAll.value = false;
}
}
);
function setActiveFolder(id: string) {
activeFolder.value = id;
emit('folderNodeSelect', [id], []);