测试管理调整

This commit is contained in:
dong 2023-08-31 10:36:22 +08:00
parent 57307fb8fb
commit b956dc786d

View File

@ -8,7 +8,11 @@
:columns="columnDefs"
row-key="id"
v-model:pagination="pagination"
:rows-per-page-options="[10, 20, 50, 100]"
:rows-per-page-options="[0]"
:pagination-label="
(firstRowIndex, endRowIndex, totalRowsNumber) =>
`总行数:${totalRowsNumber}`
"
:loading="loading"
:filter="filter"
binary-state-sort
@ -156,7 +160,7 @@ const pagination = ref({
sortBy: 'desc',
descending: false,
page: 1,
rowsPerPage: 10,
rowsPerPage: 0,
rowsNumber: 10,
});
@ -166,6 +170,8 @@ async function onRequest(props: any) {
try {
const res = await getSimulationList();
rows.splice(0, rows.length, ...(res as []));
pagination.value.rowsNumber = rows.length;
pagination.value.rowsPerPage = rows.length;
} catch (err) {
const error = err as ApiError;
$q.notify({
@ -253,7 +259,27 @@ function joinTest(val: SimulationIem) {
startSimulationByProject(val.projectId);
}
function endTest(val: SimulationIem) {
destroySimulation({ simulationId: val.simulationId });
operateDisabled.value = true;
const name = getProjectName(val.projectId);
$q.dialog({
title: '确认',
message: `确认结束项目 "${name}" 吗?`,
cancel: true,
})
.onOk(async () => {
try {
await destroySimulation({ simulationId: val.simulationId });
} catch (err) {
const error = err as ApiError;
$q.notify({
type: 'negative',
message: error.title,
});
}
})
.onDismiss(() => {
operateDisabled.value = false;
});
}
interface ObjMap {