fix(测试计划): 修复测试计划关联用例切换项目初始化全部

This commit is contained in:
xinxin.wu 2024-06-20 20:00:48 +08:00 committed by Craftsman
parent 9ff9a3d25a
commit a2479398eb
4 changed files with 19 additions and 46 deletions

View File

@ -305,18 +305,6 @@
});
}
watch(
() => props.currentProject,
() => {
setPagination({
current: 1,
});
resetSelector();
resetFilterParams();
emit('refresh');
}
);
const selectIds = computed(() => {
return [...propsRes.value.selectedKeys];
});
@ -328,14 +316,11 @@
}
);
watch(
() => props.activeModule,
() => {
watch([() => props.currentProject, () => props.activeModule], () => {
resetSelector();
resetFilterParams();
loadCaseList();
}
);
});
onMounted(() => {
loadCaseList();

View File

@ -132,7 +132,7 @@
/**
* 初始化模块树
*/
async function initModules() {
async function initModules(setDefault = false) {
try {
moduleLoading.value = true;
const getModuleParams = {
@ -149,6 +149,9 @@
count: props.modulesCount?.[node.id] || 0,
};
});
if (setDefault) {
setActiveFolder('all');
}
emit('init', caseTree.value, selectedProtocols.value);
} catch (error) {
// eslint-disable-next-line no-console
@ -190,8 +193,10 @@
watch(
() => props.currentProject,
() => {
initModules();
(val) => {
if (val) {
initModules(true);
}
}
);
</script>

View File

@ -471,8 +471,6 @@
selectedProtocols.value = _protocols || [];
if (props.associatedType === CaseLinkEnum.API) {
loadCaseList();
} else {
activeFolder.value = 'all';
}
}
@ -514,6 +512,7 @@
(val) => {
if (val) {
associationType.value = props.associatedType;
activeFolder.value = 'all';
initProjectList();
}
selectPopVisible.value = false;

View File

@ -268,18 +268,6 @@
}
);
watch(
() => props.currentProject,
() => {
setPagination({
current: 1,
});
resetSelector();
resetFilterParams();
emit('refresh');
}
);
function getScenarioSaveParams() {
const { excludeKeys, selectedKeys, selectorStatus } = propsRes.value;
const tableParams = getTableParams();
@ -298,20 +286,16 @@
pId: record.projectId,
});
}
watch([() => props.currentProject, () => props.activeModule], () => {
resetSelector();
resetFilterParams();
loadScenarioList();
});
onMounted(() => {
loadScenarioList();
});
watch(
() => props.activeModule,
() => {
resetSelector();
resetFilterParams();
loadScenarioList();
}
);
defineExpose({
getScenarioSaveParams,
loadScenarioList,