From 298208d0ef258b98b8889d197fe6366c958569b9 Mon Sep 17 00:00:00 2001 From: baiqi Date: Fri, 8 Nov 2024 10:01:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E5=9C=BA=E6=99=AF&=E7=94=A8=E4=BE=8B=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E7=8E=87=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/management/case/caseTable.vue | 8 +++++++- .../api-test/scenario/components/scenarioTable.vue | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) 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); }