fix(admin-web): 修复系统维护"立即激活"按钮不显示的问题

- 修复 getStatusTag 函数逻辑,未激活状态使用 'inactive' 样式而不是 'expired'
- 添加更细化的状态判断:维护中、已过期、已计划、未激活、待激活
- 添加 inactive 标签样式(橙色背景)
- 现在未激活的维护计划会正确显示"立即激活"按钮

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-28 04:59:06 -08:00
parent 8df2046a4e
commit ba3a21d049
2 changed files with 13 additions and 2 deletions

View File

@ -182,6 +182,11 @@
color: #1890ff;
}
&--inactive {
background: #fff7e6;
color: #fa8c16;
}
&--expired {
background: #f5f5f5;
color: #8c8c8c;

View File

@ -33,10 +33,16 @@ const getStatusTag = (item: MaintenanceItem) => {
if (now > endTime) {
return { label: '已过期', style: 'expired' };
}
if (now < startTime) {
if (item.isActive && now < startTime) {
return { label: '已计划', style: 'scheduled' };
}
return { label: '未激活', style: 'expired' };
if (!item.isActive && now >= startTime && now <= endTime) {
return { label: '未激活', style: 'inactive' }; // 在时间范围内但未激活
}
if (!item.isActive && now < startTime) {
return { label: '待激活', style: 'scheduled' }; // 未到开始时间且未激活
}
return { label: '未激活', style: 'inactive' };
};
// 获取项目样式类名