🎈 perf: 处理一些细节问题
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user