fix(接口测试): 调整组件treeFolderAll操作按钮显隐
This commit is contained in:
parent
90f6c45d0b
commit
635d92fad0
|
@ -9,7 +9,7 @@
|
||||||
<template #expandLeft>
|
<template #expandLeft>
|
||||||
<a-dropdown v-model:popup-visible="visible" :hide-on-select="false">
|
<a-dropdown v-model:popup-visible="visible" :hide-on-select="false">
|
||||||
<MsButton
|
<MsButton
|
||||||
v-show="typeof isExpandAll !== 'undefined'"
|
v-show="!props.notShowOperation"
|
||||||
type="icon"
|
type="icon"
|
||||||
status="secondary"
|
status="secondary"
|
||||||
class="!mr-[4px] p-[4px]"
|
class="!mr-[4px] p-[4px]"
|
||||||
|
@ -81,6 +81,7 @@
|
||||||
folderName: string; // 名称
|
folderName: string; // 名称
|
||||||
allCount: number; // 总数
|
allCount: number; // 总数
|
||||||
showExpandApi?: boolean; // 展示 展开请求的开关
|
showExpandApi?: boolean; // 展示 展开请求的开关
|
||||||
|
notShowOperation?: boolean; // 是否展示操作按钮
|
||||||
}>();
|
}>();
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'setActiveFolder', val: string): void;
|
(e: 'setActiveFolder', val: string): void;
|
||||||
|
@ -88,7 +89,7 @@
|
||||||
(e: 'selectedProtocolsChange'): void;
|
(e: 'selectedProtocolsChange'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const isExpandAll = defineModel<boolean>('isExpandAll', {
|
const isExpandAll = defineModel<boolean | undefined>('isExpandAll', {
|
||||||
required: false,
|
required: false,
|
||||||
default: undefined,
|
default: undefined,
|
||||||
});
|
});
|
||||||
|
@ -147,6 +148,17 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.notShowOperation,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
isExpandAll.value = undefined;
|
||||||
|
} else {
|
||||||
|
isExpandAll.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
initProtocolList();
|
initProtocolList();
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<TreeFolderAll
|
<TreeFolderAll
|
||||||
v-model:isExpandAll="isExpandAll"
|
v-model:isExpandAll="isExpandAll"
|
||||||
v-model:selectedProtocols="selectedProtocols"
|
v-model:selectedProtocols="selectedProtocols"
|
||||||
|
:not-show-operation="props.treeType === 'COLLECTION'"
|
||||||
:active-folder="activeFolder"
|
:active-folder="activeFolder"
|
||||||
:folder-name="t('apiTestManagement.allApi')"
|
:folder-name="t('apiTestManagement.allApi')"
|
||||||
:all-count="allCount"
|
:all-count="allCount"
|
||||||
|
@ -90,17 +91,6 @@
|
||||||
const allCount = ref(0);
|
const allCount = ref(0);
|
||||||
const isExpandAll = ref<boolean | undefined>(false);
|
const isExpandAll = ref<boolean | undefined>(false);
|
||||||
|
|
||||||
watch(
|
|
||||||
() => props.treeType,
|
|
||||||
(val) => {
|
|
||||||
if (val === 'COLLECTION') {
|
|
||||||
isExpandAll.value = undefined;
|
|
||||||
} else {
|
|
||||||
isExpandAll.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
function setActiveFolder(id: string) {
|
function setActiveFolder(id: string) {
|
||||||
activeFolder.value = id;
|
activeFolder.value = id;
|
||||||
emit('folderNodeSelect', [id], []);
|
emit('folderNodeSelect', [id], []);
|
||||||
|
|
Loading…
Reference in New Issue