fix(测试用例): 场景导入系统-切换tab清空高级筛选

--bug=1048893 --user=吕梦园
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001048893
This commit is contained in:
teukkk 2024-11-19 16:36:19 +08:00 committed by Craftsman
parent ed98065194
commit a9e6c8a0ed
3 changed files with 15 additions and 19 deletions

View File

@ -798,14 +798,11 @@
clearSelector();
}
});
watch(
() => innerProject.value,
(val) => {
if (val) {
msAdvanceFilterRef.value?.clearFilter();
}
watch([() => innerProject.value, () => showType.value], (val) => {
if (val) {
msAdvanceFilterRef.value?.clearFilter();
}
);
});
</script>
<style scoped lang="less">

View File

@ -7,7 +7,7 @@
disabled-width-drag
>
<div class="h-full w-full overflow-hidden">
<a-tabs v-model:active-key="activeKey" @change="resetModule">
<a-tabs v-model:active-key="activeKey">
<a-tab-pane key="api" :title="t('apiScenario.api')" />
<a-tab-pane key="case" :title="t('apiScenario.case')" />
<a-tab-pane key="scenario" :title="t('apiScenario.scenario')" />
@ -225,19 +225,23 @@
const apiTableRef = ref<InstanceType<typeof apiTable>>();
const moduleIds = ref<(string | number)[]>([]);
function initModuleTree() {
nextTick(() => {
moduleTreeRef.value?.init(protocolsParam.value, activeKey.value);
});
}
watch(
() => protocol.value,
(val) => {
setLocalStorage(ProtocolKeyEnum.API_SCENARIO_IMPORT_PROTOCOL, val);
nextTick(() => {
moduleTreeRef.value?.init(protocolsParam.value, activeKey.value);
});
initModuleTree();
}
);
function handleAdvSearch(isStartAdvance: boolean) {
isAdvancedSearchMode.value = isStartAdvance;
moduleTreeRef.value?.init(protocolsParam.value, activeKey.value);
initModuleTree();
}
function handleModuleSelect(ids: (string | number)[], node: MsTreeNodeData) {
@ -491,15 +495,9 @@
scenarioUseTreeSelection.clearSelector();
}
function resetModule() {
nextTick(() => {
moduleTreeRef.value?.init(protocolsParam.value, activeKey.value);
});
}
function handleChangeProject() {
clearSelected();
resetModule();
initModuleTree();
}
onBeforeMount(async () => {

View File

@ -468,6 +468,7 @@
() => props.type,
() => {
keyword.value = '';
msAdvanceFilterRef.value?.clearFilter();
}
);