vxe-gantt 4.3.17 → 4.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/gantt/src/gantt-view.js +204 -200
- package/es/gantt/src/gantt.js +5 -4
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/gantt-view.js +229 -225
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +7 -7
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/index.umd.js +2034 -1953
- package/lib/index.umd.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/gantt/src/gantt-view.ts +196 -192
- package/packages/gantt/src/gantt.ts +5 -4
|
@@ -102,11 +102,11 @@ export default defineVxeComponent({
|
|
|
102
102
|
const taskViewOpts = computeTaskViewOpts.value;
|
|
103
103
|
const minScale = computeMinScale.value;
|
|
104
104
|
const { gridding } = taskViewOpts;
|
|
105
|
-
const { type, startDay } = minScale;
|
|
106
105
|
const dateList = [];
|
|
107
|
-
if (!minViewDate || !maxViewDate) {
|
|
106
|
+
if (!minScale || !minViewDate || !maxViewDate) {
|
|
108
107
|
return dateList;
|
|
109
108
|
}
|
|
109
|
+
const { type, startDay } = minScale;
|
|
110
110
|
const leftSize = -(ganttReactData.currLeftSpacing + XEUtils.toNumber(gridding ? gridding.leftSpacing || 0 : 0));
|
|
111
111
|
const rightSize = ganttReactData.currRightSpacing + XEUtils.toNumber(gridding ? gridding.rightSpacing || 0 : 0);
|
|
112
112
|
const currStep = 1; // XEUtils.toNumber(step || 1) || 1
|
|
@@ -242,31 +242,33 @@ export default defineVxeComponent({
|
|
|
242
242
|
const ganttReactData = $xeGantt.reactData;
|
|
243
243
|
const { taskScaleList } = ganttReactData;
|
|
244
244
|
const minScale = computeMinScale.value;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
245
|
+
if (minScale) {
|
|
246
|
+
const weekScale = taskScaleList.find(item => item.type === 'week');
|
|
247
|
+
const isMinWeek = minScale.type === 'week';
|
|
248
|
+
const itemDate = new Date();
|
|
249
|
+
let [yyyy, M, MM, dd, HH, mm, ss] = XEUtils.toDateString(itemDate, 'yyyy-M-MM-dd-HH-mm-ss').split('-');
|
|
250
|
+
const e = itemDate.getDay();
|
|
251
|
+
const E = e + 1;
|
|
252
|
+
const q = Math.ceil((itemDate.getMonth() + 1) / 3);
|
|
253
|
+
const W = `${XEUtils.getYearWeek(itemDate, weekScale ? weekScale.startDay : undefined)}`;
|
|
254
|
+
if (isMinWeek && checkWeekOfsetYear(W, M)) {
|
|
255
|
+
yyyy = `${Number(yyyy) + 1}`;
|
|
256
|
+
M = '1';
|
|
257
|
+
MM = '0' + M;
|
|
258
|
+
}
|
|
259
|
+
ganttReactData.nowTime = itemDate.getTime();
|
|
260
|
+
internalData.todayDateMaps = {
|
|
261
|
+
year: yyyy,
|
|
262
|
+
quarter: `${yyyy}_q${q}`,
|
|
263
|
+
month: `${yyyy}_${MM}`,
|
|
264
|
+
week: `${yyyy}_W${W}`,
|
|
265
|
+
day: `${yyyy}_${MM}_${dd}_E${E}`,
|
|
266
|
+
date: `${yyyy}_${MM}_${dd}`,
|
|
267
|
+
hour: `${yyyy}_${MM}_${dd}_${HH}`,
|
|
268
|
+
minute: `${yyyy}_${MM}_${dd}_${HH}_${mm}`,
|
|
269
|
+
second: `${yyyy}_${MM}_${dd}_${HH}_${mm}_${ss}`
|
|
270
|
+
};
|
|
257
271
|
}
|
|
258
|
-
ganttReactData.nowTime = itemDate.getTime();
|
|
259
|
-
internalData.todayDateMaps = {
|
|
260
|
-
year: yyyy,
|
|
261
|
-
quarter: `${yyyy}_q${q}`,
|
|
262
|
-
month: `${yyyy}_${MM}`,
|
|
263
|
-
week: `${yyyy}_W${W}`,
|
|
264
|
-
day: `${yyyy}_${MM}_${dd}_E${E}`,
|
|
265
|
-
date: `${yyyy}_${MM}_${dd}`,
|
|
266
|
-
hour: `${yyyy}_${MM}_${dd}_${HH}`,
|
|
267
|
-
minute: `${yyyy}_${MM}_${dd}_${HH}_${mm}`,
|
|
268
|
-
second: `${yyyy}_${MM}_${dd}_${HH}_${mm}_${ss}`
|
|
269
|
-
};
|
|
270
272
|
};
|
|
271
273
|
const handleColumnHeader = () => {
|
|
272
274
|
const ganttReactData = $xeGantt.reactData;
|
|
@@ -466,188 +468,190 @@ export default defineVxeComponent({
|
|
|
466
468
|
const minScale = computeMinScale.value;
|
|
467
469
|
const scaleUnit = computeScaleUnit.value;
|
|
468
470
|
const weekScale = computeWeekScale.value;
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
471
|
+
if (minScale) {
|
|
472
|
+
switch (scaleUnit) {
|
|
473
|
+
case 'year': {
|
|
474
|
+
const indexMaps = {};
|
|
475
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
476
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, 'yyyy');
|
|
477
|
+
indexMaps[yyyyMM] = i;
|
|
478
|
+
});
|
|
479
|
+
return (startValue, endValue) => {
|
|
480
|
+
const startDate = parseStringDate(startValue);
|
|
481
|
+
const endDate = parseStringDate(endValue);
|
|
482
|
+
const startStr = XEUtils.toDateString(startDate, 'yyyy');
|
|
483
|
+
const startFirstDate = XEUtils.getWhatYear(startDate, 0, 'first');
|
|
484
|
+
const endStr = XEUtils.toDateString(endDate, 'yyyy');
|
|
485
|
+
const endFirstDate = XEUtils.getWhatYear(endDate, 0, 'first');
|
|
486
|
+
const dateSize = Math.floor((XEUtils.getWhatYear(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / dayMs);
|
|
487
|
+
const subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
|
|
488
|
+
const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
|
|
489
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
|
|
490
|
+
return {
|
|
491
|
+
offsetLeftSize,
|
|
492
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
|
|
493
|
+
};
|
|
490
494
|
};
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
495
|
+
}
|
|
496
|
+
case 'quarter': {
|
|
497
|
+
const indexMaps = {};
|
|
498
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
499
|
+
const q = XEUtils.toDateString(dateObj.date, 'yyyy-q');
|
|
500
|
+
indexMaps[q] = i;
|
|
501
|
+
});
|
|
502
|
+
return (startValue, endValue) => {
|
|
503
|
+
const startDate = parseStringDate(startValue);
|
|
504
|
+
const endDate = parseStringDate(endValue);
|
|
505
|
+
const startStr = XEUtils.toDateString(startDate, 'yyyy-q');
|
|
506
|
+
const startFirstDate = XEUtils.getWhatQuarter(startDate, 0, 'first');
|
|
507
|
+
const endStr = XEUtils.toDateString(endDate, 'yyyy-q');
|
|
508
|
+
const endFirstDate = XEUtils.getWhatQuarter(endDate, 0, 'first');
|
|
509
|
+
const dateSize = Math.floor((XEUtils.getWhatQuarter(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / dayMs);
|
|
510
|
+
const subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
|
|
511
|
+
const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
|
|
512
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
|
|
513
|
+
return {
|
|
514
|
+
offsetLeftSize,
|
|
515
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
|
|
516
|
+
};
|
|
513
517
|
};
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
518
|
+
}
|
|
519
|
+
case 'month': {
|
|
520
|
+
const indexMaps = {};
|
|
521
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
522
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, 'yyyy-MM');
|
|
523
|
+
indexMaps[yyyyMM] = i;
|
|
524
|
+
});
|
|
525
|
+
return (startValue, endValue) => {
|
|
526
|
+
const startDate = parseStringDate(startValue);
|
|
527
|
+
const endDate = parseStringDate(endValue);
|
|
528
|
+
const startStr = XEUtils.toDateString(startDate, 'yyyy-MM');
|
|
529
|
+
const startFirstDate = XEUtils.getWhatMonth(startDate, 0, 'first');
|
|
530
|
+
const endStr = XEUtils.toDateString(endDate, 'yyyy-MM');
|
|
531
|
+
const endFirstDate = XEUtils.getWhatMonth(endDate, 0, 'first');
|
|
532
|
+
const dateSize = Math.floor((XEUtils.getWhatMonth(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / dayMs);
|
|
533
|
+
const subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
|
|
534
|
+
const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
|
|
535
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
|
|
536
|
+
return {
|
|
537
|
+
offsetLeftSize,
|
|
538
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
|
|
539
|
+
};
|
|
536
540
|
};
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
541
|
+
}
|
|
542
|
+
case 'week': {
|
|
543
|
+
const indexMaps = {};
|
|
544
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
545
|
+
const yyyyW = `${dateObj.yyyy}-${dateObj.W}`;
|
|
546
|
+
indexMaps[yyyyW] = i;
|
|
547
|
+
});
|
|
548
|
+
return (startValue, endValue) => {
|
|
549
|
+
const startDate = parseStringDate(startValue);
|
|
550
|
+
const endDate = parseStringDate(endValue);
|
|
551
|
+
const startWeekObj = parseWeekObj(startDate, weekScale ? weekScale.startDay : undefined);
|
|
552
|
+
const startStr = `${startWeekObj.yyyy}-${startWeekObj.W}`;
|
|
553
|
+
const startFirstDate = XEUtils.getWhatWeek(startDate, 0, weekScale ? weekScale.startDay : undefined, weekScale ? weekScale.startDay : undefined);
|
|
554
|
+
const endWeekObj = parseWeekObj(endDate, weekScale ? weekScale.startDay : undefined);
|
|
555
|
+
const endStr = `${endWeekObj.yyyy}-${endWeekObj.W}`;
|
|
556
|
+
const endFirstDate = XEUtils.getWhatWeek(endDate, 0, weekScale ? weekScale.startDay : undefined, weekScale ? weekScale.startDay : undefined);
|
|
557
|
+
const dateSize = Math.floor((XEUtils.getWhatWeek(endDate, 1, weekScale ? weekScale.startDay : undefined, weekScale ? weekScale.startDay : undefined).getTime() - endFirstDate.getTime()) / dayMs);
|
|
558
|
+
const subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
|
|
559
|
+
const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
|
|
560
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
|
|
561
|
+
return {
|
|
562
|
+
offsetLeftSize,
|
|
563
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
|
|
564
|
+
};
|
|
561
565
|
};
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
566
|
+
}
|
|
567
|
+
case 'day':
|
|
568
|
+
case 'date': {
|
|
569
|
+
const indexMaps = {};
|
|
570
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
571
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, 'yyyy-MM-dd');
|
|
572
|
+
indexMaps[yyyyMM] = i;
|
|
573
|
+
});
|
|
574
|
+
return (startValue, endValue) => {
|
|
575
|
+
const startDate = parseStringDate(startValue);
|
|
576
|
+
const endDate = parseStringDate(endValue);
|
|
577
|
+
const startStr = XEUtils.toDateString(startDate, 'yyyy-MM-dd');
|
|
578
|
+
const startFirstDate = XEUtils.getWhatDay(startDate, 0, 'first');
|
|
579
|
+
const endStr = XEUtils.toDateString(endDate, 'yyyy-MM-dd');
|
|
580
|
+
const endFirstDate = XEUtils.getWhatDay(endDate, 0, 'first');
|
|
581
|
+
const minuteSize = Math.floor((XEUtils.getWhatDay(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / minuteMs);
|
|
582
|
+
const subtract = (startDate.getTime() - startFirstDate.getTime()) / minuteMs / minuteSize;
|
|
583
|
+
const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / minuteMs + 1) / minuteSize;
|
|
584
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
|
|
585
|
+
// 如果最小轴为天,当存在时分秒时,在当前单元格内渲染维度;如果不存在,则填充满单元格
|
|
586
|
+
return {
|
|
587
|
+
offsetLeftSize,
|
|
588
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize + (subtract ? 0 : 1)
|
|
589
|
+
};
|
|
586
590
|
};
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
591
|
+
}
|
|
592
|
+
case 'hour': {
|
|
593
|
+
const indexMaps = {};
|
|
594
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
595
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, 'yyyy-MM-dd HH');
|
|
596
|
+
indexMaps[yyyyMM] = i;
|
|
597
|
+
});
|
|
598
|
+
return (startValue, endValue) => {
|
|
599
|
+
const startDate = parseStringDate(startValue);
|
|
600
|
+
const endDate = parseStringDate(endValue);
|
|
601
|
+
const startStr = XEUtils.toDateString(startDate, 'yyyy-MM-dd HH');
|
|
602
|
+
const startFirstDate = XEUtils.getWhatHours(startDate, 0, 'first');
|
|
603
|
+
const endStr = XEUtils.toDateString(endDate, 'yyyy-MM-dd HH');
|
|
604
|
+
const endFirstDate = XEUtils.getWhatHours(endDate, 0, 'first');
|
|
605
|
+
const minuteSize = Math.floor((XEUtils.getWhatHours(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / minuteMs);
|
|
606
|
+
const subtract = (startDate.getTime() - startFirstDate.getTime()) / minuteMs / minuteSize;
|
|
607
|
+
const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / minuteMs + 1) / minuteSize;
|
|
608
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
|
|
609
|
+
return {
|
|
610
|
+
offsetLeftSize,
|
|
611
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
|
|
612
|
+
};
|
|
609
613
|
};
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
614
|
+
}
|
|
615
|
+
case 'minute': {
|
|
616
|
+
const indexMaps = {};
|
|
617
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
618
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, 'yyyy-MM-dd HH:mm');
|
|
619
|
+
indexMaps[yyyyMM] = i;
|
|
620
|
+
});
|
|
621
|
+
return (startValue, endValue) => {
|
|
622
|
+
const startDate = parseStringDate(startValue);
|
|
623
|
+
const endDate = parseStringDate(endValue);
|
|
624
|
+
const startStr = XEUtils.toDateString(startDate, 'yyyy-MM-dd HH:mm');
|
|
625
|
+
const startFirstDate = XEUtils.getWhatMinutes(startDate, 0, 'first');
|
|
626
|
+
const endStr = XEUtils.toDateString(endDate, 'yyyy-MM-dd HH:mm');
|
|
627
|
+
const endFirstDate = XEUtils.getWhatMinutes(endDate, 0, 'first');
|
|
628
|
+
const minuteSize = Math.floor((XEUtils.getWhatMinutes(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / minuteMs);
|
|
629
|
+
const subtract = (startDate.getTime() - startFirstDate.getTime()) / minuteMs / minuteSize;
|
|
630
|
+
const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / minuteMs + 1) / minuteSize;
|
|
631
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
|
|
632
|
+
return {
|
|
633
|
+
offsetLeftSize,
|
|
634
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
|
|
635
|
+
};
|
|
632
636
|
};
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
637
|
+
}
|
|
638
|
+
case 'second': {
|
|
639
|
+
const gapTime = getStandardGapTime(minScale.type);
|
|
640
|
+
return (startValue, endValue) => {
|
|
641
|
+
const startDate = parseStringDate(startValue);
|
|
642
|
+
const endDate = parseStringDate(endValue);
|
|
643
|
+
let offsetLeftSize = 0;
|
|
644
|
+
let offsetWidthSize = 0;
|
|
645
|
+
if (minViewDate) {
|
|
646
|
+
offsetLeftSize = (startDate.getTime() - minViewDate.getTime()) / gapTime;
|
|
647
|
+
offsetWidthSize = ((endDate.getTime() - startDate.getTime()) / gapTime);
|
|
648
|
+
}
|
|
649
|
+
return {
|
|
650
|
+
offsetLeftSize,
|
|
651
|
+
offsetWidthSize
|
|
652
|
+
};
|
|
649
653
|
};
|
|
650
|
-
}
|
|
654
|
+
}
|
|
651
655
|
}
|
|
652
656
|
}
|
|
653
657
|
return () => {
|
package/es/gantt/src/gantt.js
CHANGED
|
@@ -500,7 +500,9 @@ export default defineVxeComponent({
|
|
|
500
500
|
const scaleList = (taskScaleConfs && taskScaleConfs.length ? taskScaleConfs : ['month', 'date']);
|
|
501
501
|
scaleList.forEach(conf => {
|
|
502
502
|
const sConf = !conf || XEUtils.isString(conf) ? { type: conf } : conf;
|
|
503
|
-
const
|
|
503
|
+
const type = sConf.type;
|
|
504
|
+
const step = sConf.step;
|
|
505
|
+
const level = getViewTypeLevel(type);
|
|
504
506
|
if (step) {
|
|
505
507
|
errLog('vxe.error.errProp', [`step=${step}`, 'step=1']);
|
|
506
508
|
}
|
|
@@ -512,10 +514,9 @@ export default defineVxeComponent({
|
|
|
512
514
|
errLog('vxe.error.repeatProp', ['type', type]);
|
|
513
515
|
return;
|
|
514
516
|
}
|
|
517
|
+
const scaleObj = Object.assign({}, type ? (taskViewScaleOpts[type] || {}) : {}, sConf, { level });
|
|
515
518
|
keyMaps[type] = true;
|
|
516
|
-
scaleConfs.push(
|
|
517
|
-
level: getViewTypeLevel(type)
|
|
518
|
-
}));
|
|
519
|
+
scaleConfs.push(scaleObj);
|
|
519
520
|
});
|
|
520
521
|
reactData.taskScaleList = XEUtils.orderBy(scaleConfs, { field: 'level', order: 'desc' });
|
|
521
522
|
};
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED