mirror of
https://github.com/rustfs/console.git
synced 2026-09-19 01:47:44 +08:00
refactor: 优化任务列表展示方式
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<n-progress type="line" :height="2" :percentage="percentage" :show-indicator="false" :processing="percentage < 100" />
|
||||
</div>
|
||||
<n-tabs type="line" animated>
|
||||
<n-tabs type="line" animated :value="tab">
|
||||
<n-tab-pane :tab="`待处理(${pending.length})`" name="pending">
|
||||
<object-upload-task-list :tasks="pending" />
|
||||
</n-tab-pane>
|
||||
@@ -56,6 +56,17 @@ const uploading = computed(() => tasks.value.filter(task => task.status === 'upl
|
||||
const completed = computed(() => tasks.value.filter(task => task.status === 'completed'))
|
||||
const failed = computed(() => tasks.value.filter(task => task.status === 'failed'))
|
||||
|
||||
const tab = ref('pending')
|
||||
|
||||
// 根据任务执行状态切换任务列表,如果有进行中的任务则默认展示进行中,否则展示已完成
|
||||
watch([pending, uploading], () => {
|
||||
if (uploading.value.length > 0) {
|
||||
tab.value = 'uploading'
|
||||
} else {
|
||||
tab.value = 'completed'
|
||||
}
|
||||
})
|
||||
|
||||
const toggleDrawer = () => {
|
||||
showDrawer.value = !showDrawer.value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user