🎈 perf: 处理一些细节问题

This commit is contained in:
砂糖
2025-08-27 16:25:52 +08:00
parent cd822d4296
commit 278b0c8258
12 changed files with 484 additions and 271 deletions

View File

@@ -53,7 +53,9 @@ export default {
return;
}
// 处理数据,兼容多种字段名,保证任务名唯一
const taskData = this.tasks.map((item, idx) => {
const taskData = this.tasks
.map((item, idx) => {
const name = (item.taskName || item.planName || item.remark || item.productName || item.name || `任务${idx+1}`) + (item.productName ? `-${item.productName}` : '');
const start = item.startDate || item.start_time || item.start || item.start_date;
const end = item.endDate || item.end_time || item.end || item.end_date;
@@ -72,7 +74,10 @@ export default {
startDate: start,
endDate: end
};
});
})
// 确保三个字段都存在startDate,endDate,name
.filter(item => item.startDate && item.endDate && item.name);
// 先全部用 getColor 分配基础色
taskData.forEach((item, idx) => {
item._color = getColor(item.lineId, item.orderId, idx);