From 89f5452f4db00a1ad9a6d880fa9fe97a3a04736f Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 7 Jan 2026 16:28:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AD=90=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=BE=85=E5=8A=A9=E5=87=BD=E6=95=B0=E4=BD=9C=E7=94=A8?= =?UTF-8?q?=E5=9F=9F=E9=97=AE=E9=A2=98=20-=20=E5=B0=86=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E7=A7=BB=E5=88=B0=E6=A8=A1=E5=9D=97=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/TaskHall.vue | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/frontend/src/views/TaskHall.vue b/frontend/src/views/TaskHall.vue index 0ae6a5d..81dc767 100644 --- a/frontend/src/views/TaskHall.vue +++ b/frontend/src/views/TaskHall.vue @@ -2710,6 +2710,16 @@ const formatEstimatedTime = (hours: number | undefined) => { const days = Math.floor(hours / WORK_HOURS_PER_DAY) const remainingHours = Math.round((hours % WORK_HOURS_PER_DAY) * 100) / 100 + if (days === 0) { + return Number.isInteger(remainingHours) ? `${remainingHours}小时` : `${remainingHours.toFixed(1)}小时` + } else if (remainingHours === 0) { + return `${days}天` + } else { + const hourStr = Number.isInteger(remainingHours) ? `${remainingHours}小时` : `${remainingHours.toFixed(1)}小时` + return `${days}天${hourStr}` + } +} + // 子任务时间线辅助函数 const getSubTaskStatusClass = (status: string | undefined) => { switch (status) { @@ -2742,17 +2752,6 @@ const hasInProgressSubTask = (task: any) => { return (task.subTaskInProgress || 0) > 0 } - - if (days === 0) { - return Number.isInteger(remainingHours) ? `${remainingHours}小时` : `${remainingHours.toFixed(1)}小时` - } else if (remainingHours === 0) { - return `${days}天` - } else { - const hourStr = Number.isInteger(remainingHours) ? `${remainingHours}小时` : `${remainingHours.toFixed(1)}小时` - return `${days}天${hourStr}` - } -} - /** * 获取任务流程阶段 * @param task 任务对象