diff --git a/frontend/src/views/workbench/homePage/components/testPlanOverview.vue b/frontend/src/views/workbench/homePage/components/testPlanOverview.vue index ff77e4ffb4..120ba2668e 100644 --- a/frontend/src/views/workbench/homePage/components/testPlanOverview.vue +++ b/frontend/src/views/workbench/homePage/components/testPlanOverview.vue @@ -357,23 +357,6 @@ } } - async function changeHandler(value: string[]) { - selectValue.value = value; - innerPlanId.value = value[value.length - 1]; - innerProjectIds.value = [value[0]]; - const planLevel = 3; - if (value.length === planLevel) { - innerGroupPlanId.value = value[value.length - 2]; - } else { - innerGroupPlanId.value = ''; - } - - await nextTick(); - labelPath.value = getLabelPath(innerPlanId.value); - initOverViewDetail(); - emit('change'); - } - async function loadMore(option: CascaderOption, done: (children?: CascaderOption[]) => void) { try { let testPlanOptionsNode = await getWorkTestPlanListUrl(option.value as string); @@ -419,6 +402,22 @@ } } + async function changeHandler(value: string[]) { + selectValue.value = value; + + innerPlanId.value = value[value.length - 1]; + const [newProjectId] = value; + innerProjectIds.value = [newProjectId]; + + const planLevel = 3; + innerGroupPlanId.value = value.length === planLevel ? value[planLevel - 2] : ''; + + await nextTick(); + refreshHandler(newProjectId); + labelPath.value = getLabelPath(innerPlanId.value); + emit('change'); + } + function getSelectedParams() { const [newProjectId] = innerProjectIds.value; const selectedData = [newProjectId, innerGroupPlanId.value, innerPlanId.value];