From 456d6ed3fb5412575cb7541d3a0a601466d97038 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期一, 13 十一月 2023 16:56:11 +0800
Subject: [PATCH] feat: step组件适配工序过多情况;修复任务少于3条时展示收起按钮的问题
---
src/stores/tasks.ts | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/stores/tasks.ts b/src/stores/tasks.ts
index e115738..971a627 100644
--- a/src/stores/tasks.ts
+++ b/src/stores/tasks.ts
@@ -28,15 +28,14 @@
return getTaskList(params)
.then((res) => {
channels.value = res.data
-
- // 棣栨鑾峰彇閫氶亾鏁版嵁鏃惰嚜鍔ㄩ�変腑绗竴涓换鍔�
- if (!activeTask?.value) {
- selectFirstTask(channels.value)
- }
})
.catch((err) => {
console.error(err)
channels.value = []
+ })
+ .finally(() => {
+ // 棣栨鑾峰彇閫氶亾鏁版嵁鏃惰嚜鍔ㄩ�変腑绗竴涓换鍔�
+ selectFirstTask(channels.value)
})
}
@@ -44,12 +43,15 @@
const firstNotEmptyChannel = Object.entries(channels).find((ele) => {
const taskList = (ele[1] as TasksResponse)?.Tasks
- return !!taskList.length
+ return !!taskList?.length
})
if (firstNotEmptyChannel) {
const channelNumber = +firstNotEmptyChannel[0]
activeTask.value = channels[channelNumber].Tasks[0]
+ } else {
+ // 濡傛灉娌℃湁浠诲姟灏辨竻绌哄綋鍓嶉�変腑鐨勪换鍔�
+ activeTask.value = undefined
}
}
--
Gitblit v1.8.0