fix(接口测试): 调整组件treeFolderAll操作按钮显隐
This commit is contained in:
parent
90f6c45d0b
commit
635d92fad0
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -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], []);
|
||||
|
|
Loading…
Reference in New Issue