fix(接口测试): 场景&用例表格通过率统计

This commit is contained in:
baiqi 2024-11-08 10:01:54 +08:00 committed by Craftsman
parent 3011af0be5
commit 298208d0ef
2 changed files with 15 additions and 3 deletions

View File

@ -652,6 +652,13 @@
} }
} }
watch(
() => propsRes.value.data,
() => {
initStatistics();
}
);
async function loadCaseList() { async function loadCaseList() {
const selectModules = await getModuleIds(); const selectModules = await getModuleIds();
const params = { const params = {
@ -666,7 +673,6 @@
}; };
setLoadListParams(params); setLoadListParams(params);
await loadList(); await loadList();
initStatistics();
} }
function loadCaseListAndResetSelector() { function loadCaseListAndResetSelector() {
resetSelector(); resetSelector();

View File

@ -966,7 +966,7 @@
try { try {
const res = await getScenarioStatistics(propsRes.value.data.map((item) => item.id)); const res = await getScenarioStatistics(propsRes.value.data.map((item) => item.id));
propsRes.value.data.forEach((e) => { 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) { if (item) {
e.execPassRate = item.execPassRate; e.execPassRate = item.execPassRate;
} }
@ -977,6 +977,13 @@
} }
} }
watch(
() => propsRes.value.data,
() => {
initStatistics();
}
);
async function loadScenarioList(refreshTreeCount?: boolean) { async function loadScenarioList(refreshTreeCount?: boolean) {
const moduleIds = await getModuleIds(); const moduleIds = await getModuleIds();
const params = { const params = {
@ -986,7 +993,6 @@
}; };
setLoadListParams({ ...params, viewId: viewId.value, combineSearch: advanceFilter }); setLoadListParams({ ...params, viewId: viewId.value, combineSearch: advanceFilter });
await loadList(); await loadList();
initStatistics();
if (refreshTreeCount && !isAdvancedSearchMode.value) { if (refreshTreeCount && !isAdvancedSearchMode.value) {
emit('refreshModuleTree', params); emit('refreshModuleTree', params);
} }