From e063833f1210afe263557a1d79ba1ae81fe56514 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Sun, 2 Feb 2020 22:30:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=BB=E5=8A=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/task/TaskDetail.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/views/task/TaskDetail.vue b/frontend/src/views/task/TaskDetail.vue index f52597ca..39aca864 100644 --- a/frontend/src/views/task/TaskDetail.vue +++ b/frontend/src/views/task/TaskDetail.vue @@ -137,6 +137,7 @@ export default { }, computed: { ...mapState('task', [ + 'taskForm', 'taskResultsData', 'taskResultsTotalCount' ]), @@ -164,6 +165,9 @@ export default { set (value) { this.$store.commit('task/SET_RESULTS_PAGE_SIZE', value) } + }, + isRunning () { + return ['pending', 'running'].includes(this.taskForm.status) } }, methods: { @@ -197,6 +201,9 @@ export default { this.getTaskLog() this.handle = setInterval(() => { + if (!this.isRunning) return + this.$store.dispatch('task/getTaskData', this.$route.params.id) + this.$store.dispatch('task/getTaskResults', this.$route.params.id) this.getTaskLog() }, 5000) },