Skip to content

Commit

Permalink
任务状态改变时自动切换到对应tab
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie committed Nov 1, 2018
1 parent 2e52b32 commit 1ada206
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions front/src/views/Tasks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ export default {
case 'CREATE':
if (data.info.status == 1) {
this.runList.push(data)
this.activeTab = 'run'
} else {
this.waitList.push(data)
this.activeTab = 'wait'
}
this.refreshMaxHeight()
break
Expand All @@ -143,13 +145,15 @@ export default {
task.info.status = 2
return true
})
this.activeTab = 'wait'
break
case 'ERROR':
updateTask([data.id], [this.runList], this.waitList, task => {
//Update the task status to error
task.info.status = 3
return true
})
this.activeTab = 'wait'
break
case 'RESUME':
updateTask(data.pauseIds, [this.runList, this.waitList], this.waitList, task => {
Expand All @@ -167,6 +171,7 @@ export default {
task.info.status = 1
return true
})
this.activeTab = 'run'
break
case 'DELETE': {
let list = this[this.activeTab + 'List']
Expand Down

0 comments on commit 1ada206

Please sign in to comment.