= 400 ? "bg-rose-500" : "bg-amber-500",
- // 选中时明显高亮:提高不透明度、描边、阴影与z-index
- selectedTask === task.id
- ? "opacity-100 ring-2 ring-cyan-300/90 shadow-[0_0_10px_rgba(34,211,238,0.6)] z-10"
- : "opacity-80 hover:opacity-95",
- task.level === 1 && "opacity-70"
+ selectedTask === task.id && "ring-2 ring-cyan-300/90 shadow-[0_0_8px_rgba(34,211,238,0.6)]"
)}
style={{
left: `${(task.startTime / maxTime) * 100}%`,
width: `${Math.max((task.executionTime / maxTime) * 100, 0.5)}%`
}}
- onClick={() => setSelectedTask(task.id)}
- title={(() => {
- const taskTimes = getTaskTimes(task);
- return `${task.displayName}
-执行时间: ${formatTime(task.executionTime)}
-状态: ${getTaskStatusText(task.status)}
-${task.status === 'IN_PROGRESS' ? `进度: ${task.progress}%` : ''}
-开始时间: ${formatDateTime(taskTimes.startTime)}
-结束时间: ${formatDateTime(taskTimes.endTime)}`;
- })()}
- >
- {/* 基于状态的单色进度条 */}
-
- {/* 背景条 */}
-
-
- {/* 进度条 - 根据任务状态和进度显示 */}
- {task.status === 'IN_PROGRESS' && (
-
- )}
-
- {/* 完成状态显示满进度 */}
- {task.status === 'COMPLETED' && (
-
- )}
-
- {/* 失败状态显示部分进度 */}
- {task.status === 'FAILED' && (
-
- )}
-
- {/* 等待状态显示微弱指示 */}
- {task.status === 'PENDING' && (
-
- )}
-
- {/* 智能百分比文字显示 - 只在主任务且有足够空间时显示 */}
+ title={`${task.displayName} - ${formatTime(task.executionTime)}`}
+ >
+ {/* 进度百分比显示 */}
{(() => {
const barWidth = (task.executionTime / maxTime) * 100;
- const showPercentage = task.level === 0 && barWidth > 6; // 主任务且宽度足够
+ const showPercentage = barWidth > 8; // 只在有足够空间时显示
if (!showPercentage) return null;
@@ -1580,37 +1474,13 @@ ${task.status === 'IN_PROGRESS' ? `进度: ${task.progress}%` : ''}
const percentageText = getPercentageText();
if (!percentageText) return null;
- // 根据进度条宽度和进度值决定文字位置
- const progressWidth = task.status === 'IN_PROGRESS' ? task.progress :
- task.status === 'COMPLETED' ? 100 :
- task.status === 'FAILED' ? Math.max(task.progress, 15) : 8;
-
- const shouldCenterInProgress = task.status === 'IN_PROGRESS' && progressWidth > 30;
- const shouldCenterInBar = (task.status === 'COMPLETED') ||
- (task.status === 'FAILED' && progressWidth > 25);
-
return (
-
+
12 ? '11px' : '10px',
- fontWeight: '600'
+ textShadow: '0 1px 2px rgba(0,0,0,0.8)',
+ fontSize: '10px'
}}
>
{percentageText}
@@ -1620,41 +1490,20 @@ ${task.status === 'IN_PROGRESS' ? `进度: ${task.progress}%` : ''}
})()}
- {/* 子任务进度指示器和百分比 */}
- {task.level === 1 && task.status === 'IN_PROGRESS' && (
- <>
-
- {/* 子任务百分比 - 只在有足够空间时显示 */}
- {(() => {
- const barWidth = (task.executionTime / maxTime) * 100;
- if (barWidth < 4) return null; // 子任务条太窄不显示
-
- return (
-
-
- {task.progress}%
-
+ {/* 时间刻度标记 */}
+
+ {Array.from({ length: 5 }, (_, i) => (
+
+ ))}
- );
- })()}
- >
- )}
+