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(); clearSelector();
} }
}); });
watch( watch([() => innerProject.value, () => showType.value], (val) => {
() => innerProject.value,
(val) => {
if (val) { if (val) {
msAdvanceFilterRef.value?.clearFilter(); msAdvanceFilterRef.value?.clearFilter();
} }
} });
);
</script> </script>
<style scoped lang="less"> <style scoped lang="less">

View File

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

View File

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