fix(测试计划): 执行操作-请求不可重复发起

This commit is contained in:
teukkk 2024-06-18 10:40:26 +08:00 committed by Craftsman
parent c564a5b8f5
commit 00a3c58939
2 changed files with 135 additions and 129 deletions

View File

@ -12,6 +12,7 @@
@adv-search="loadCaseList()"
@refresh="loadCaseList()"
/>
<a-spin :loading="tableLoading" class="w-full">
<MsBaseTable
ref="tableRef"
class="mt-[16px]"
@ -74,6 +75,7 @@
</MsPopconfirm>
</template>
</MsBaseTable>
</a-spin>
<CaseAndScenarioReportDrawer
v-model:visible="reportVisible"
:report-id="reportId"
@ -310,7 +312,7 @@
selectable: hasOperationPermission.value,
});
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector, setLoading } = useTable(
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector } = useTable(
getPlanDetailApiCaseList,
tableProps.value,
(record) => {
@ -491,9 +493,10 @@
}
//
const tableLoading = ref(false); //
async function handleRun(record: PlanDetailApiCaseItem) {
try {
setLoading(true);
tableLoading.value = true;
await runApiCase(record.id);
Message.success(t('common.executionSuccess'));
resetSelectorAndCaseList();
@ -502,14 +505,14 @@
// eslint-disable-next-line no-console
console.log(error);
} finally {
setLoading(false);
tableLoading.value = false;
}
}
//
async function handleBatchRun() {
try {
setLoading(true);
tableLoading.value = true;
const tableParams = await getTableParams(true);
await batchRunApiCase({
selectIds: tableSelected.value as string[],
@ -524,7 +527,7 @@
// eslint-disable-next-line no-console
console.log(error);
} finally {
setLoading(false);
tableLoading.value = false;
}
}

View File

@ -12,6 +12,7 @@
@adv-search="loadCaseList()"
@refresh="loadCaseList()"
/>
<a-spin :loading="tableLoading" class="w-full">
<MsBaseTable
ref="tableRef"
class="mt-[16px]"
@ -71,6 +72,7 @@
</MsPopconfirm>
</template>
</MsBaseTable>
</a-spin>
<CaseAndScenarioReportDrawer
v-model:visible="reportVisible"
:report-id="reportId"
@ -291,7 +293,7 @@
selectable: hasOperationPermission.value,
});
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector, setLoading } = useTable(
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector } = useTable(
getPlanDetailApiScenarioList,
tableProps.value,
(record) => {
@ -474,9 +476,10 @@
}
//
const tableLoading = ref(false); //
async function handleRun(record: PlanDetailApiScenarioItem) {
try {
setLoading(true);
tableLoading.value = true;
await runApiScenario(record.id);
Message.success(t('common.executionSuccess'));
resetSelectorAndCaseList();
@ -485,14 +488,14 @@
// eslint-disable-next-line no-console
console.log(error);
} finally {
setLoading(false);
tableLoading.value = false;
}
}
//
async function handleBatchRun() {
try {
setLoading(true);
tableLoading.value = true;
const tableParams = await getTableParams(true);
await batchRunApiScenario({
selectIds: tableSelected.value as string[],
@ -507,7 +510,7 @@
// eslint-disable-next-line no-console
console.log(error);
} finally {
setLoading(false);
tableLoading.value = false;
}
}