vxe-gantt 3.4.10 → 3.5.0
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 +167 -92
- package/es/gantt/src/gantt.js +6 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/gantt-view.js +170 -94
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +6 -0
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/index.umd.js +227 -143
- 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 +4 -4
- package/packages/gantt/src/gantt-view.ts +167 -92
- package/packages/gantt/src/gantt.ts +7 -0
|
@@ -8,8 +8,10 @@ import GanttViewBodyComponent from './gantt-body';
|
|
|
8
8
|
import GanttViewFooterComponent from './gantt-footer';
|
|
9
9
|
const { globalEvents } = VxeUI;
|
|
10
10
|
const sourceType = 'gantt';
|
|
11
|
+
const secondMs = 1000;
|
|
11
12
|
const minuteMs = 1000 * 60;
|
|
12
|
-
const
|
|
13
|
+
const hourMs = 1000 * 60 * 60;
|
|
14
|
+
const dayMs = hourMs * 24;
|
|
13
15
|
function createInternalData() {
|
|
14
16
|
return {
|
|
15
17
|
xeTable: null,
|
|
@@ -70,8 +72,7 @@ const maxYHeight = 5e6;
|
|
|
70
72
|
// const maxXWidth = 5e6
|
|
71
73
|
function parseStringDate($xeGanttView, dateValue) {
|
|
72
74
|
const $xeGantt = $xeGanttView.$xeGantt;
|
|
73
|
-
const
|
|
74
|
-
const { dateFormat } = taskOpts;
|
|
75
|
+
const dateFormat = $xeGantt.computeDateFormat;
|
|
75
76
|
return XEUtils.toStringDate(dateValue, dateFormat || null);
|
|
76
77
|
}
|
|
77
78
|
function updateTodayData($xeGanttView) {
|
|
@@ -304,196 +305,270 @@ function parseWeekObj(date, firstDay) {
|
|
|
304
305
|
}
|
|
305
306
|
function createChartRender($xeGanttView, fullCols) {
|
|
306
307
|
const $xeGantt = $xeGanttView.$xeGantt;
|
|
307
|
-
const reactData = $xeGanttView.reactData;
|
|
308
|
-
const { minViewDate } = reactData;
|
|
309
308
|
const minScale = $xeGantt.computeMinScale;
|
|
310
309
|
const scaleUnit = $xeGantt.computeScaleUnit;
|
|
311
310
|
const weekScale = $xeGantt.computeWeekScale;
|
|
311
|
+
const dateFormat = $xeGantt.computeDateFormat;
|
|
312
312
|
if (minScale) {
|
|
313
313
|
switch (scaleUnit) {
|
|
314
314
|
case 'year': {
|
|
315
|
+
const showActualProgress = /M|d|H|mm|ss|S/.test(dateFormat);
|
|
316
|
+
const renderFormat = 'yyyy';
|
|
315
317
|
const indexMaps = {};
|
|
316
318
|
fullCols.forEach(({ dateObj }, i) => {
|
|
317
319
|
const yyyyMM = XEUtils.toDateString(dateObj.date, 'yyyy');
|
|
318
320
|
indexMaps[yyyyMM] = i;
|
|
319
321
|
});
|
|
320
322
|
return (startValue, endValue) => {
|
|
321
|
-
const
|
|
322
|
-
const
|
|
323
|
-
const startStr = XEUtils.toDateString(
|
|
324
|
-
const
|
|
325
|
-
const
|
|
323
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
324
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
325
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
326
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatYear(startValDate, 0, 'first');
|
|
327
|
+
const startFirstDate = XEUtils.getWhatYear(startValDate, 0, 'first');
|
|
328
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
329
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatYear(endValDate, 0, 'last');
|
|
326
330
|
const endFirstDate = XEUtils.getWhatYear(endDate, 0, 'first');
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
+
// 当前是年维度,当指定解析格式精确到天时,显示实际进度
|
|
332
|
+
let startSubtractSize = 0;
|
|
333
|
+
let endSubtractSize = 1;
|
|
334
|
+
if (showActualProgress) {
|
|
335
|
+
// 按年的天数比计算
|
|
336
|
+
const syDaySize = XEUtils.getDayOfYear(startDate, 0);
|
|
337
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / syDaySize;
|
|
338
|
+
const eyDaySize = XEUtils.getDayOfYear(endDate, 0);
|
|
339
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / eyDaySize;
|
|
340
|
+
}
|
|
341
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
331
342
|
return {
|
|
332
343
|
offsetLeftSize,
|
|
333
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
344
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
334
345
|
};
|
|
335
346
|
};
|
|
336
347
|
}
|
|
337
348
|
case 'quarter': {
|
|
349
|
+
const showActualProgress = /M|d|H|mm|ss|S/.test(dateFormat);
|
|
350
|
+
const renderFormat = 'yyyy-q';
|
|
338
351
|
const indexMaps = {};
|
|
339
352
|
fullCols.forEach(({ dateObj }, i) => {
|
|
340
|
-
const q = XEUtils.toDateString(dateObj.date,
|
|
353
|
+
const q = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
341
354
|
indexMaps[q] = i;
|
|
342
355
|
});
|
|
343
356
|
return (startValue, endValue) => {
|
|
344
|
-
const
|
|
345
|
-
const
|
|
346
|
-
const startStr = XEUtils.toDateString(
|
|
347
|
-
const
|
|
348
|
-
const
|
|
357
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
358
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
359
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
360
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatQuarter(startValDate, 0, 'first');
|
|
361
|
+
const startFirstDate = XEUtils.getWhatQuarter(startValDate, 0, 'first');
|
|
362
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
363
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatQuarter(endValDate, 0, 'last');
|
|
349
364
|
const endFirstDate = XEUtils.getWhatQuarter(endDate, 0, 'first');
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
365
|
+
// 当前是季度维度,当指定解析格式精确到天时,显示实际进度
|
|
366
|
+
let startSubtractSize = 0;
|
|
367
|
+
let endSubtractSize = 1;
|
|
368
|
+
if (showActualProgress) {
|
|
369
|
+
// 按季度天数比计算
|
|
370
|
+
const sqDaySize = XEUtils.getDayOfQuarter(startDate, 0);
|
|
371
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / sqDaySize;
|
|
372
|
+
const eqDaySize = XEUtils.getDayOfQuarter(endDate, 0);
|
|
373
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / eqDaySize;
|
|
374
|
+
}
|
|
375
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
354
376
|
return {
|
|
355
377
|
offsetLeftSize,
|
|
356
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
378
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
357
379
|
};
|
|
358
380
|
};
|
|
359
381
|
}
|
|
360
382
|
case 'month': {
|
|
383
|
+
const renderFormat = 'yyyy-MM';
|
|
384
|
+
const showActualProgress = /d|H|mm|ss|S/.test(dateFormat);
|
|
361
385
|
const indexMaps = {};
|
|
362
386
|
fullCols.forEach(({ dateObj }, i) => {
|
|
363
|
-
const yyyyMM = XEUtils.toDateString(dateObj.date,
|
|
387
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
364
388
|
indexMaps[yyyyMM] = i;
|
|
365
389
|
});
|
|
366
390
|
return (startValue, endValue) => {
|
|
367
|
-
const
|
|
368
|
-
const
|
|
369
|
-
const startStr = XEUtils.toDateString(
|
|
370
|
-
const
|
|
371
|
-
const
|
|
391
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
392
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
393
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
394
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatMonth(startValDate, 0, 'first');
|
|
395
|
+
const startFirstDate = XEUtils.getWhatMonth(startValDate, 0, 'first');
|
|
396
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
397
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatMonth(endValDate, 0, 'last');
|
|
372
398
|
const endFirstDate = XEUtils.getWhatMonth(endDate, 0, 'first');
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
399
|
+
// 当前是月维度,当指定解析格式精确到天时,显示实际进度
|
|
400
|
+
let startSubtractSize = 0;
|
|
401
|
+
let endSubtractSize = 1;
|
|
402
|
+
if (showActualProgress) {
|
|
403
|
+
// 按月天数比计算
|
|
404
|
+
const smDaySize = XEUtils.getDayOfMonth(startDate, 0);
|
|
405
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / smDaySize;
|
|
406
|
+
const emDaySize = XEUtils.getDayOfMonth(endDate, 0);
|
|
407
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / emDaySize;
|
|
408
|
+
}
|
|
409
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
377
410
|
return {
|
|
378
411
|
offsetLeftSize,
|
|
379
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
412
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
380
413
|
};
|
|
381
414
|
};
|
|
382
415
|
}
|
|
383
416
|
case 'week': {
|
|
417
|
+
const showActualProgress = /d|mm|ss|S/.test(dateFormat);
|
|
384
418
|
const indexMaps = {};
|
|
385
419
|
fullCols.forEach(({ dateObj }, i) => {
|
|
386
420
|
const yyyyW = `${dateObj.yyyy}-${dateObj.W}`;
|
|
387
421
|
indexMaps[yyyyW] = i;
|
|
388
422
|
});
|
|
389
423
|
return (startValue, endValue) => {
|
|
390
|
-
const
|
|
391
|
-
const
|
|
392
|
-
const
|
|
424
|
+
const weekStartDay = weekScale ? weekScale.startDay : undefined;
|
|
425
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
426
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
427
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatWeek(startValDate, 0, 'first', weekStartDay);
|
|
428
|
+
const startWeekObj = parseWeekObj(startDate, weekStartDay);
|
|
393
429
|
const startStr = `${startWeekObj.yyyy}-${startWeekObj.W}`;
|
|
394
|
-
const startFirstDate = XEUtils.getWhatWeek(startDate, 0,
|
|
395
|
-
const
|
|
430
|
+
const startFirstDate = XEUtils.getWhatWeek(startDate, 0, 'first', weekStartDay);
|
|
431
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatWeek(endValDate, 0, 'first', weekStartDay);
|
|
432
|
+
const endWeekObj = parseWeekObj(endDate, weekStartDay);
|
|
396
433
|
const endStr = `${endWeekObj.yyyy}-${endWeekObj.W}`;
|
|
397
|
-
const endFirstDate = XEUtils.getWhatWeek(endDate, 0,
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
434
|
+
const endFirstDate = XEUtils.getWhatWeek(endDate, 0, 'first', weekStartDay);
|
|
435
|
+
// 当前是周维度,当指定解析格式精确到天时,显示实际进度
|
|
436
|
+
let startSubtractSize = 0;
|
|
437
|
+
let endSubtractSize = 1;
|
|
438
|
+
if (showActualProgress) {
|
|
439
|
+
// 按周天数比计算
|
|
440
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / 7;
|
|
441
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / 7;
|
|
442
|
+
}
|
|
443
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
402
444
|
return {
|
|
403
445
|
offsetLeftSize,
|
|
404
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
446
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
405
447
|
};
|
|
406
448
|
};
|
|
407
449
|
}
|
|
408
450
|
case 'day':
|
|
409
451
|
case 'date': {
|
|
452
|
+
const renderFormat = 'yyyy-MM-dd';
|
|
453
|
+
const showActualProgress = /mm|ss|S/.test(dateFormat);
|
|
410
454
|
const indexMaps = {};
|
|
411
455
|
fullCols.forEach(({ dateObj }, i) => {
|
|
412
|
-
const yyyyMM = XEUtils.toDateString(dateObj.date,
|
|
456
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
413
457
|
indexMaps[yyyyMM] = i;
|
|
414
458
|
});
|
|
415
459
|
return (startValue, endValue) => {
|
|
416
|
-
const
|
|
417
|
-
const
|
|
418
|
-
const startStr = XEUtils.toDateString(
|
|
460
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
461
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
462
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
463
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatDay(startValDate, 0, 'first');
|
|
419
464
|
const startFirstDate = XEUtils.getWhatDay(startDate, 0, 'first');
|
|
420
|
-
const endStr = XEUtils.toDateString(
|
|
465
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
466
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatDay(endValDate, 0, 'last');
|
|
421
467
|
const endFirstDate = XEUtils.getWhatDay(endDate, 0, 'first');
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
468
|
+
// 当前是天维度,当指定解析格式精确到时分秒豪秒时,显示实际进度
|
|
469
|
+
let startSubtractSize = 0;
|
|
470
|
+
let endSubtractSize = 1;
|
|
471
|
+
if (showActualProgress) {
|
|
472
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs;
|
|
473
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs;
|
|
474
|
+
}
|
|
475
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
429
476
|
return {
|
|
430
477
|
offsetLeftSize,
|
|
431
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
478
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
432
479
|
};
|
|
433
480
|
};
|
|
434
481
|
}
|
|
435
482
|
case 'hour': {
|
|
483
|
+
const renderFormat = 'yyyy-MM-dd HH';
|
|
484
|
+
const showActualProgress = /mm|ss|S/.test(dateFormat);
|
|
436
485
|
const indexMaps = {};
|
|
437
486
|
fullCols.forEach(({ dateObj }, i) => {
|
|
438
|
-
const yyyyMM = XEUtils.toDateString(dateObj.date,
|
|
487
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
439
488
|
indexMaps[yyyyMM] = i;
|
|
440
489
|
});
|
|
441
490
|
return (startValue, endValue) => {
|
|
442
|
-
const
|
|
443
|
-
const
|
|
444
|
-
const startStr = XEUtils.toDateString(
|
|
491
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
492
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
493
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
494
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatHours(startValDate, 0, 'first');
|
|
445
495
|
const startFirstDate = XEUtils.getWhatHours(startDate, 0, 'first');
|
|
446
|
-
const endStr = XEUtils.toDateString(
|
|
496
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
497
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatHours(endValDate, 0, 'last');
|
|
447
498
|
const endFirstDate = XEUtils.getWhatHours(endDate, 0, 'first');
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
499
|
+
// 当前是小时维度,当指定解析格式精确到分秒豪秒时,显示实际进度
|
|
500
|
+
let startSubtractSize = 0;
|
|
501
|
+
let endSubtractSize = 1;
|
|
502
|
+
if (showActualProgress) {
|
|
503
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / hourMs;
|
|
504
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / hourMs;
|
|
505
|
+
}
|
|
506
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
454
507
|
return {
|
|
455
508
|
offsetLeftSize,
|
|
456
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
509
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
457
510
|
};
|
|
458
511
|
};
|
|
459
512
|
}
|
|
460
513
|
case 'minute': {
|
|
514
|
+
const renderFormat = 'yyyy-MM-dd HH:mm';
|
|
515
|
+
const showActualProgress = /ss|S/.test(dateFormat);
|
|
461
516
|
const indexMaps = {};
|
|
462
517
|
fullCols.forEach(({ dateObj }, i) => {
|
|
463
|
-
const yyyyMM = XEUtils.toDateString(dateObj.date,
|
|
518
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
464
519
|
indexMaps[yyyyMM] = i;
|
|
465
520
|
});
|
|
466
521
|
return (startValue, endValue) => {
|
|
467
|
-
const
|
|
468
|
-
const
|
|
469
|
-
const startStr = XEUtils.toDateString(
|
|
522
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
523
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
524
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
525
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatMinutes(startValDate, 0, 'first');
|
|
470
526
|
const startFirstDate = XEUtils.getWhatMinutes(startDate, 0, 'first');
|
|
471
|
-
const endStr = XEUtils.toDateString(
|
|
527
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
528
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatMinutes(endValDate, 0, 'last');
|
|
472
529
|
const endFirstDate = XEUtils.getWhatMinutes(endDate, 0, 'first');
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
530
|
+
// 当前是分钟维度,当指定解析格式精确到秒豪秒时,显示实际进度
|
|
531
|
+
let startSubtractSize = 0;
|
|
532
|
+
let endSubtractSize = 1;
|
|
533
|
+
if (showActualProgress) {
|
|
534
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / minuteMs;
|
|
535
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / minuteMs;
|
|
536
|
+
}
|
|
537
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
477
538
|
return {
|
|
478
539
|
offsetLeftSize,
|
|
479
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
540
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
480
541
|
};
|
|
481
542
|
};
|
|
482
543
|
}
|
|
483
544
|
case 'second': {
|
|
484
|
-
const
|
|
545
|
+
const renderFormat = 'yyyy-MM-dd HH:mm:ss';
|
|
546
|
+
const showActualProgress = /S/.test(dateFormat);
|
|
547
|
+
const indexMaps = {};
|
|
548
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
549
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
550
|
+
indexMaps[yyyyMM] = i;
|
|
551
|
+
});
|
|
485
552
|
return (startValue, endValue) => {
|
|
486
|
-
const
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
553
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
554
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
555
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
556
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatSeconds(startValDate, 0, 'first');
|
|
557
|
+
const startFirstDate = XEUtils.getWhatSeconds(startDate, 0, 'first');
|
|
558
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
559
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatSeconds(endValDate, 0, 'last');
|
|
560
|
+
const endFirstDate = XEUtils.getWhatSeconds(endDate, 0, 'first');
|
|
561
|
+
// 当前是秒维度,当指定解析格式精确到豪秒时,显示实际进度
|
|
562
|
+
let startSubtractSize = 0;
|
|
563
|
+
let endSubtractSize = 1;
|
|
564
|
+
if (showActualProgress) {
|
|
565
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / secondMs;
|
|
566
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / secondMs;
|
|
493
567
|
}
|
|
568
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
494
569
|
return {
|
|
495
570
|
offsetLeftSize,
|
|
496
|
-
offsetWidthSize
|
|
571
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
497
572
|
};
|
|
498
573
|
};
|
|
499
574
|
}
|
package/es/gantt/src/gantt.js
CHANGED
|
@@ -244,6 +244,12 @@ export default {
|
|
|
244
244
|
const minScale = $xeGantt.computeMinScale;
|
|
245
245
|
return minScale ? minScale.type : 'date';
|
|
246
246
|
},
|
|
247
|
+
computeDateFormat() {
|
|
248
|
+
const $xeGantt = this;
|
|
249
|
+
const taskOpts = $xeGantt.computeTaskOpts;
|
|
250
|
+
const { dateFormat } = taskOpts;
|
|
251
|
+
return dateFormat || 'yyyy-MM-dd HH:m:ss';
|
|
252
|
+
},
|
|
247
253
|
computeMinScale() {
|
|
248
254
|
const $xeGantt = this;
|
|
249
255
|
const reactData = $xeGantt.reactData;
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
const { log } = VxeUI;
|
|
3
|
-
const ganttVersion = `gantt v${"3.
|
|
3
|
+
const ganttVersion = `gantt v${"3.5.0"}`;
|
|
4
4
|
export function createComponentLog(name) {
|
|
5
5
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
6
6
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|