代码调整

This commit is contained in:
dong 2023-10-27 17:54:24 +08:00
parent d3b3d50150
commit 7bfea1a651

View File

@ -105,11 +105,12 @@ import {
getSimulationList,
destroySimulation,
} from 'src/api/Simulation';
import { useRouter } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import { PublishItem, getPublishList } from 'src/api/PublishApi';
import { getRunconfigList } from 'src/api/RunconfigApi';
const router = useRouter();
const route = useRoute();
const $q = useQuasar();
const props = withDefaults(
@ -180,7 +181,7 @@ const pagination = ref({
rowsNumber: 10,
});
let time: NodeJS.Timeout;
let time: NodeJS.Timeout | null;
function intervalRequest() {
getSimulationList()
.then((res) => {
@ -188,20 +189,22 @@ function intervalRequest() {
rows.splice(0, rows.length, ...(data as []));
pagination.value.rowsNumber = rows.length;
pagination.value.rowsPerPage = rows.length;
})
.finally(() => {
if (route.path != '/testManage/test') {
return;
}
time = setTimeout(() => {
intervalRequest();
}, 3000);
})
.catch((err) => {
console.log(err);
time = setTimeout(() => {
intervalRequest();
}, 5000);
});
}
onUnmounted(() => {
clearInterval(time);
if (time) {
clearTimeout(time);
time = null;
}
});
const createFormShow = ref(false);