fix(接口测试): 修复接口测试场景关联模块多选项目切换重置bug

This commit is contained in:
xinxin.wu 2024-10-24 10:54:34 +08:00 committed by Craftsman
parent 22d62b4ccd
commit d1558051f4
1 changed files with 11 additions and 2 deletions

View File

@ -17,7 +17,11 @@
<div class="w-[300px] border-r p-[16px]">
<div class="flex flex-col">
<div class="mb-[12px] flex items-center gap-[8px] overflow-hidden">
<MsProjectSelect v-model:project="currentProject" class="flex-1 overflow-hidden" @change="resetModule" />
<MsProjectSelect
v-model:project="currentProject"
class="flex-1 overflow-hidden"
@change="handleChangeProject"
/>
<a-select
v-if="activeKey !== 'scenario'"
v-model:model-value="protocol"
@ -473,11 +477,16 @@
}
function resetModule() {
clearSelected();
nextTick(() => {
moduleTreeRef.value?.init(activeKey.value);
});
}
function handleChangeProject() {
clearSelected();
resetModule();
}
onBeforeMount(async () => {
await initProtocolList();
const localProtocol = getLocalStorage<string>(ProtocolKeyEnum.API_SCENARIO_IMPORT_PROTOCOL);