diff --git a/components/object/upload/stats.vue b/components/object/upload/stats.vue index d5d2c08..1e450e3 100644 --- a/components/object/upload/stats.vue +++ b/components/object/upload/stats.vue @@ -21,7 +21,7 @@ - + @@ -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 }