feat: 为所有任务页面卡片添加发布人信息显示

This commit is contained in:
Your Name 2026-01-16 17:59:37 +08:00
parent f685f99688
commit 8f1bfec562

View File

@ -749,6 +749,12 @@
</a>
</span>
</div>
<div v-if="task.publisherName" class="detail-item">
<span class="icon">
<Icon name="user" size="sm" color="#31f08b" />
</span>
<span>发布人: {{ task.publisherName }}</span>
</div>
</div>
<!-- 任务编号(底部) -->
@ -1141,6 +1147,12 @@
</a>
</span>
</div>
<div v-if="task.publisherName" class="detail-item">
<span class="icon">
<Icon name="user" size="sm" color="#31f08b" />
</span>
<span>发布人: {{ task.publisherName }}</span>
</div>
</div>
<!-- 进度条(进行中和已完成的任务显示) -->
@ -1557,6 +1569,12 @@
</a>
</span>
</div>
<div v-if="task.publisherName" class="detail-item">
<span class="icon">
<Icon name="user" size="sm" color="#31f08b" />
</span>
<span>发布人: {{ task.publisherName }}</span>
</div>
</div>
<!-- 进度条(已完成任务显示100%) -->
@ -1987,6 +2005,12 @@
</a>
</span>
</div>
<div v-if="task.publisherName" class="detail-item">
<span class="icon">
<Icon name="user" size="sm" color="#31f08b" />
</span>
<span>发布人: {{ task.publisherName }}</span>
</div>
</div>
<!-- 进度条(进行中和已完成的任务显示) -->
@ -3123,11 +3147,16 @@ const formatDeadline = (deadline: string | undefined) => {
}
// 格式化时效要求(工时转换为天+小时,基于工作时间配置)
// 🔥 最低时效为1小时:低于1小时的任务显示为1小时
const formatEstimatedTime = (hours: number | undefined) => {
if (!hours) return '--'
// 最低时效1小时:低于1小时的显示为1小时
const effectiveHours = hours < 1 ? 1 : hours
const workHours = workHoursPerDay.value || 9 // 默认9小时
const days = Math.floor(hours / workHours)
const remainingHours = Math.round((hours % workHours) * 100) / 100
const days = Math.floor(effectiveHours / workHours)
const remainingHours = Math.round((effectiveHours % workHours) * 100) / 100
if (days === 0) {
return Number.isInteger(remainingHours) ? `${remainingHours}小时` : `${remainingHours.toFixed(1)}小时`