任务取消样式优化

This commit is contained in:
WindowBird 2025-11-24 09:27:41 +08:00
parent b139fd23fe
commit 225ecab0e1
3 changed files with 40 additions and 3 deletions

View File

@ -195,7 +195,7 @@
</view>
<!-- 立即处理按钮 -->
<view class="task-action" v-if="task.status !== 'completed'">
<view class="task-action" v-if="task.status !== 'completed'&&task.status !=='cancelled'">
<uv-button
:type="getButtonType(task.status)"
size="small"
@ -518,12 +518,32 @@ const determineTaskStatus = (item, expireTime) => {
const transformTaskData = (item) => {
const expireTime = item.expireTime || item.expire_time || '';
// - status===4 status==='4' completed
// -
// statustaskStatusstatusId
const taskStatus = item.status !== undefined ? item.status :
item.taskStatus !== undefined ? item.taskStatus :
item.statusId !== undefined ? item.statusId : null;
// 6'6'-
const isCancelled = taskStatus === 6 ||
taskStatus === '6' ||
String(taskStatus) === '6';
//
if (isCancelled) {
return {
id: item.id || '',
status: 'cancelled', // cancelled
createName: item.createName || '',
date: formatDate(expireTime) || '',
project: item.projectName || item.project_name || '',
description: item.description || item.task_name || '',
owner: getOwnerNames(item.memberList || item.member_list || []),
releaseTime: formatDate(item.createTime || item.create_time) || '',
remainingDays: null //
};
}
// 4'4''completed'
const isCompleted = taskStatus === 4 ||
taskStatus === '4' ||
@ -583,7 +603,8 @@ const getTaskCardClass = (status) => {
'task-card-imminent': status === 'imminent',
'task-card-pending': status === 'pending',
'task-card-completed': status === 'completed',
'task-card-overdue': status === 'overdue'
'task-card-overdue': status === 'overdue',
'task-card-cancelled': status === 'cancelled'
};
};

View File

@ -37,6 +37,13 @@
border-left: 4px solid #f56c6c;
box-shadow: 0 2px 12px rgba(255, 68, 68, 0.1);
}
// 已取消卡片样式 - 优先级高于逾期
&.task-card-cancelled {
border-left: 4px solid #909399;
opacity: 0.75;
background: #f5f5f5;
}
}
.task-header {

View File

@ -53,6 +53,13 @@ export const TASK_STATUS_COLORS = {
color: '#fff',
borderColor: '#909399',
type: 'info'
},
// 已取消任务
cancelled: {
backgroundColor: '#909399',
color: '#fff',
borderColor: '#909399',
type: 'info'
}
};
@ -62,6 +69,7 @@ export const STATUS_TEXT_MAP = {
'pending': '待完成',
'completed': '已完成',
'overdue': '逾期',
'cancelled': '已取消',
'urgent': '紧急',
'important': '重要',
'normal': '普通'
@ -73,6 +81,7 @@ export const STATUS_TYPE_MAP = {
'pending': 'primary',
'completed': 'info',
'overdue': 'error',
'cancelled': 'info',
'urgent': 'error',
'important': 'primary',
'normal': 'info'