diff --git a/frontend/src/views/api-test/management/components/management/case/caseTable.vue b/frontend/src/views/api-test/management/components/management/case/caseTable.vue index 09b9c881c9..ad8b469e68 100644 --- a/frontend/src/views/api-test/management/components/management/case/caseTable.vue +++ b/frontend/src/views/api-test/management/components/management/case/caseTable.vue @@ -652,6 +652,13 @@ } } + watch( + () => propsRes.value.data, + () => { + initStatistics(); + } + ); + async function loadCaseList() { const selectModules = await getModuleIds(); const params = { @@ -666,7 +673,6 @@ }; setLoadListParams(params); await loadList(); - initStatistics(); } function loadCaseListAndResetSelector() { resetSelector(); diff --git a/frontend/src/views/api-test/scenario/components/scenarioTable.vue b/frontend/src/views/api-test/scenario/components/scenarioTable.vue index 27388cf058..8b1d7167ad 100644 --- a/frontend/src/views/api-test/scenario/components/scenarioTable.vue +++ b/frontend/src/views/api-test/scenario/components/scenarioTable.vue @@ -966,7 +966,7 @@ try { const res = await getScenarioStatistics(propsRes.value.data.map((item) => item.id)); propsRes.value.data.forEach((e) => { - const item = res.find((i: any) => i.scenarioId === e.id); + const item = res.find((i: any) => i.id === e.id); if (item) { e.execPassRate = item.execPassRate; } @@ -977,6 +977,13 @@ } } + watch( + () => propsRes.value.data, + () => { + initStatistics(); + } + ); + async function loadScenarioList(refreshTreeCount?: boolean) { const moduleIds = await getModuleIds(); const params = { @@ -986,7 +993,6 @@ }; setLoadListParams({ ...params, viewId: viewId.value, combineSearch: advanceFilter }); await loadList(); - initStatistics(); if (refreshTreeCount && !isAdvancedSearchMode.value) { emit('refreshModuleTree', params); }