vxe-gantt 4.6.6 → 4.6.8
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/dist/all.esm.js +89 -36
- package/es/gantt/src/gantt-body.js +3 -1
- package/es/gantt/src/gantt-header.js +34 -8
- package/es/gantt/src/gantt-view.js +50 -25
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/gantt-body.js +5 -1
- package/lib/gantt/src/gantt-body.min.js +1 -1
- package/lib/gantt/src/gantt-header.js +29 -8
- package/lib/gantt/src/gantt-header.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +61 -26
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/index.umd.js +97 -37
- 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 +3 -3
- package/packages/gantt/src/gantt-body.ts +3 -1
- package/packages/gantt/src/gantt-header.ts +33 -8
- package/packages/gantt/src/gantt-view.ts +53 -25
package/dist/all.esm.js
CHANGED
|
@@ -6,7 +6,7 @@ import DomZIndex from 'dom-zindex';
|
|
|
6
6
|
import { VxeTable } from 'vxe-table';
|
|
7
7
|
|
|
8
8
|
const { setConfig: setConfig$1, setIcon } = VxeUI;
|
|
9
|
-
VxeUI.ganttVersion = "4.6.
|
|
9
|
+
VxeUI.ganttVersion = "4.6.8";
|
|
10
10
|
const ymdFormat = 'yyyy-MM-dd';
|
|
11
11
|
const ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
|
|
12
12
|
setConfig$1({
|
|
@@ -115,7 +115,7 @@ setIcon({
|
|
|
115
115
|
});
|
|
116
116
|
|
|
117
117
|
const { log } = VxeUI;
|
|
118
|
-
const ganttVersion = `gantt v${"4.6.
|
|
118
|
+
const ganttVersion = `gantt v${"4.6.8"}`;
|
|
119
119
|
function createComponentLog(name) {
|
|
120
120
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
121
121
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|
|
@@ -451,7 +451,7 @@ var GanttViewHeaderComponent = defineVxeComponent({
|
|
|
451
451
|
setup() {
|
|
452
452
|
const $xeGantt = inject('$xeGantt', {});
|
|
453
453
|
const $xeGanttView = inject('$xeGanttView', {});
|
|
454
|
-
const { computeTaskViewOpts } = $xeGantt.getComputeMaps();
|
|
454
|
+
const { computeTaskViewOpts, computeScaleStep, computeMinScale } = $xeGantt.getComputeMaps();
|
|
455
455
|
const { reactData, internalData } = $xeGanttView;
|
|
456
456
|
const refElem = ref();
|
|
457
457
|
const refHeaderScroll = ref();
|
|
@@ -461,6 +461,8 @@ var GanttViewHeaderComponent = defineVxeComponent({
|
|
|
461
461
|
const { headerGroups, viewCellWidth } = reactData;
|
|
462
462
|
const { todayDateMaps, visibleColumn } = internalData;
|
|
463
463
|
const taskViewOpts = computeTaskViewOpts.value;
|
|
464
|
+
const minScale = computeMinScale.value;
|
|
465
|
+
const scaleStep = computeScaleStep.value;
|
|
464
466
|
const { showNowLine } = taskViewOpts;
|
|
465
467
|
return h('div', {
|
|
466
468
|
ref: refElem,
|
|
@@ -495,17 +497,31 @@ var GanttViewHeaderComponent = defineVxeComponent({
|
|
|
495
497
|
return h('tr', {
|
|
496
498
|
key: $rowIndex
|
|
497
499
|
}, columns.map((column, cIndex) => {
|
|
498
|
-
const { field, childCount, dateObj } = column;
|
|
500
|
+
const { field, childCount, dateObj, startDateObj, endDateObj } = column;
|
|
499
501
|
let label = `${column.title}`;
|
|
500
|
-
if (
|
|
501
|
-
label = getI18n$1(`vxe.gantt.
|
|
502
|
+
if ((isLast || (minScale && (minScale.type === 'date' || minScale.type === 'day') && (type === 'date' || type === 'day'))) && scaleStep > 1) {
|
|
503
|
+
label = getI18n$1(`vxe.gantt.stepFormat.${type}`, {
|
|
504
|
+
start: startDateObj,
|
|
505
|
+
end: endDateObj,
|
|
506
|
+
eStartLabel: getI18n$1(`vxe.gantt.dayss.w${startDateObj.e}`),
|
|
507
|
+
eEndLabel: getI18n$1(`vxe.gantt.dayss.w${endDateObj.e}`)
|
|
508
|
+
});
|
|
502
509
|
}
|
|
503
510
|
else {
|
|
504
|
-
if (
|
|
505
|
-
|
|
511
|
+
if (type === 'day') {
|
|
512
|
+
if ($rowIndex) {
|
|
513
|
+
label = getI18n$1(`vxe.gantt.tSimpleFormat.${type}`, {
|
|
514
|
+
eLabel: getI18n$1(`vxe.gantt.dayss.w${dateObj.e}`)
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
label = getI18n$1(`vxe.gantt.tFullFormat.${type}`, {
|
|
519
|
+
eLabel: getI18n$1(`vxe.gantt.dayss.w${dateObj.e}`)
|
|
520
|
+
});
|
|
521
|
+
}
|
|
506
522
|
}
|
|
507
523
|
else {
|
|
508
|
-
if (
|
|
524
|
+
if ($rowIndex) {
|
|
509
525
|
label = getI18n$1(`vxe.gantt.tSimpleFormat.${type}`, dateObj);
|
|
510
526
|
}
|
|
511
527
|
else {
|
|
@@ -514,7 +530,17 @@ var GanttViewHeaderComponent = defineVxeComponent({
|
|
|
514
530
|
}
|
|
515
531
|
}
|
|
516
532
|
let cellVNs = label;
|
|
517
|
-
const ctParams = {
|
|
533
|
+
const ctParams = {
|
|
534
|
+
source: sourceType$4,
|
|
535
|
+
type: viewType$3,
|
|
536
|
+
column,
|
|
537
|
+
scaleObj: scaleItem,
|
|
538
|
+
title: label,
|
|
539
|
+
dateObj,
|
|
540
|
+
startDateObj,
|
|
541
|
+
endDateObj,
|
|
542
|
+
$rowIndex
|
|
543
|
+
};
|
|
518
544
|
if (titleSlot) {
|
|
519
545
|
cellVNs = $xeGantt.callSlot(titleSlot, ctParams);
|
|
520
546
|
}
|
|
@@ -1022,7 +1048,7 @@ var GanttViewBodyComponent = defineVxeComponent({
|
|
|
1022
1048
|
const { showNowLine, viewStyle } = taskViewOpts;
|
|
1023
1049
|
const scaleUnit = computeScaleUnit.value;
|
|
1024
1050
|
const { scaleItem } = headerGroups[headerGroups.length - 1] || {};
|
|
1025
|
-
const { field, dateObj } = column;
|
|
1051
|
+
const { field, dateObj, startDateObj, endDateObj } = column;
|
|
1026
1052
|
const { cellClassName, cellStyle } = viewStyle || {};
|
|
1027
1053
|
const todayValue = showNowLine && scaleItem ? todayDateMaps[scaleItem.type] : null;
|
|
1028
1054
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
@@ -1066,6 +1092,8 @@ var GanttViewBodyComponent = defineVxeComponent({
|
|
|
1066
1092
|
type: viewType$1,
|
|
1067
1093
|
scaleType: scaleUnit,
|
|
1068
1094
|
dateObj,
|
|
1095
|
+
startDateObj,
|
|
1096
|
+
endDateObj,
|
|
1069
1097
|
row,
|
|
1070
1098
|
column,
|
|
1071
1099
|
$rowIndex,
|
|
@@ -1393,7 +1421,7 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1393
1421
|
let rightSize = ganttReactData.currRightSpacing + XEUtils.toNumber(gridding ? gridding.rightSpacing || 0 : 0);
|
|
1394
1422
|
if (scaleStep > 0) {
|
|
1395
1423
|
leftSize *= scaleStep;
|
|
1396
|
-
rightSize *=
|
|
1424
|
+
rightSize *= scaleStep;
|
|
1397
1425
|
}
|
|
1398
1426
|
switch (type) {
|
|
1399
1427
|
case 'year': {
|
|
@@ -1561,6 +1589,8 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1561
1589
|
const minScale = computeMinScale.value;
|
|
1562
1590
|
const weekScale = computeWeekScale.value;
|
|
1563
1591
|
const scaleDateList = computeScaleDateList.value;
|
|
1592
|
+
const scaleStep = computeScaleStep.value;
|
|
1593
|
+
const weekStartDay = weekScale ? weekScale.startDay : undefined;
|
|
1564
1594
|
const fullCols = [];
|
|
1565
1595
|
const groupCols = [];
|
|
1566
1596
|
if (minScale && scaleUnit && scaleDateList.length) {
|
|
@@ -1606,65 +1636,88 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1606
1636
|
currGpCol.children.push(minCol);
|
|
1607
1637
|
}
|
|
1608
1638
|
};
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
const e = itemDate.getDay();
|
|
1639
|
+
const createDateObj = (date) => {
|
|
1640
|
+
let [yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss] = XEUtils.toDateString(date, 'yy-yyyy-M-MM-d-dd-H-HH-m-mm-s-ss').split('-');
|
|
1641
|
+
const e = date.getDay();
|
|
1613
1642
|
const E = e + 1;
|
|
1614
|
-
const q = Math.ceil((
|
|
1615
|
-
const W = `${XEUtils.getYearWeek(
|
|
1643
|
+
const q = Math.ceil((date.getMonth() + 1) / 3);
|
|
1644
|
+
const W = `${XEUtils.getYearWeek(date, weekScale ? weekScale.startDay : undefined)}`;
|
|
1616
1645
|
const WW = XEUtils.padStart(W, 2, '0');
|
|
1617
1646
|
if (isMinWeek && checkWeekOfsetYear(W, M)) {
|
|
1618
1647
|
yyyy = `${Number(yyyy) + 1}`;
|
|
1619
1648
|
M = '1';
|
|
1620
1649
|
MM = '0' + M;
|
|
1621
1650
|
}
|
|
1622
|
-
|
|
1651
|
+
return { date, yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss, q, W, WW, E, e };
|
|
1652
|
+
};
|
|
1653
|
+
for (let i = 0; i < scaleDateList.length; i++) {
|
|
1654
|
+
const itemDate = scaleDateList[i];
|
|
1655
|
+
const dateObj = createDateObj(itemDate);
|
|
1656
|
+
const { yyyy, MM, dd, HH, mm, ss, q, W, E } = dateObj;
|
|
1657
|
+
const startDateObj = dateObj;
|
|
1623
1658
|
const colMaps = {
|
|
1624
1659
|
year: {
|
|
1625
1660
|
field: yyyy,
|
|
1626
1661
|
title: yyyy,
|
|
1627
|
-
dateObj
|
|
1662
|
+
dateObj,
|
|
1663
|
+
startDateObj,
|
|
1664
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatYear(itemDate, scaleStep - 1)) : startDateObj
|
|
1628
1665
|
},
|
|
1629
1666
|
quarter: {
|
|
1630
1667
|
field: `${yyyy}_q${q}`,
|
|
1631
1668
|
title: `${q}`,
|
|
1632
|
-
dateObj
|
|
1669
|
+
dateObj,
|
|
1670
|
+
startDateObj,
|
|
1671
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatQuarter(itemDate, scaleStep - 1)) : startDateObj
|
|
1633
1672
|
},
|
|
1634
1673
|
month: {
|
|
1635
1674
|
field: `${yyyy}_${MM}`,
|
|
1636
1675
|
title: MM,
|
|
1637
|
-
dateObj
|
|
1676
|
+
dateObj,
|
|
1677
|
+
startDateObj,
|
|
1678
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatMonth(itemDate, scaleStep - 1)) : startDateObj
|
|
1638
1679
|
},
|
|
1639
1680
|
week: {
|
|
1640
1681
|
field: `${yyyy}_W${W}`,
|
|
1641
1682
|
title: `${W}`,
|
|
1642
|
-
dateObj
|
|
1683
|
+
dateObj,
|
|
1684
|
+
startDateObj,
|
|
1685
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatWeek(itemDate, scaleStep - 1, weekStartDay, weekStartDay)) : startDateObj
|
|
1643
1686
|
},
|
|
1644
1687
|
day: {
|
|
1645
1688
|
field: `${yyyy}_${MM}_${dd}_E${E}`,
|
|
1646
1689
|
title: `${E}`,
|
|
1647
|
-
dateObj
|
|
1690
|
+
dateObj,
|
|
1691
|
+
startDateObj,
|
|
1692
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
|
|
1648
1693
|
},
|
|
1649
1694
|
date: {
|
|
1650
1695
|
field: `${yyyy}_${MM}_${dd}`,
|
|
1651
1696
|
title: dd,
|
|
1652
|
-
dateObj
|
|
1697
|
+
dateObj,
|
|
1698
|
+
startDateObj,
|
|
1699
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
|
|
1653
1700
|
},
|
|
1654
1701
|
hour: {
|
|
1655
1702
|
field: `${yyyy}_${MM}_${dd}_${HH}`,
|
|
1656
1703
|
title: HH,
|
|
1657
|
-
dateObj
|
|
1704
|
+
dateObj,
|
|
1705
|
+
startDateObj,
|
|
1706
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatHours(itemDate, scaleStep - 1)) : startDateObj
|
|
1658
1707
|
},
|
|
1659
1708
|
minute: {
|
|
1660
1709
|
field: `${yyyy}_${MM}_${dd}_${HH}_${mm}`,
|
|
1661
1710
|
title: mm,
|
|
1662
|
-
dateObj
|
|
1711
|
+
dateObj,
|
|
1712
|
+
startDateObj,
|
|
1713
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatMinutes(itemDate, scaleStep - 1)) : startDateObj
|
|
1663
1714
|
},
|
|
1664
1715
|
second: {
|
|
1665
1716
|
field: `${yyyy}_${MM}_${dd}_${HH}_${mm}_${ss}`,
|
|
1666
1717
|
title: ss,
|
|
1667
|
-
dateObj
|
|
1718
|
+
dateObj,
|
|
1719
|
+
startDateObj,
|
|
1720
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatSeconds(itemDate, scaleStep - 1)) : startDateObj
|
|
1668
1721
|
}
|
|
1669
1722
|
};
|
|
1670
1723
|
const minCol = colMaps[minScale.type];
|
|
@@ -1767,7 +1820,7 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1767
1820
|
let currStep = scaleStep - 1;
|
|
1768
1821
|
while (currStep) {
|
|
1769
1822
|
const currStr = XEUtils.toDateString(XEUtils.getWhatYear(dateObj.date, scaleStep - currStep), renderFormat);
|
|
1770
|
-
indexMaps[currStr] = i + currRatio;
|
|
1823
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
1771
1824
|
currStep--;
|
|
1772
1825
|
}
|
|
1773
1826
|
}
|
|
@@ -1813,7 +1866,7 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1813
1866
|
let currStep = scaleStep - 1;
|
|
1814
1867
|
while (currStep) {
|
|
1815
1868
|
const currStr = XEUtils.toDateString(XEUtils.getWhatQuarter(dateObj.date, scaleStep - currStep), renderFormat);
|
|
1816
|
-
indexMaps[currStr] = i + currRatio;
|
|
1869
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
1817
1870
|
currStep--;
|
|
1818
1871
|
}
|
|
1819
1872
|
}
|
|
@@ -1859,7 +1912,7 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1859
1912
|
let currStep = scaleStep - 1;
|
|
1860
1913
|
while (currStep) {
|
|
1861
1914
|
const currStr = XEUtils.toDateString(XEUtils.getWhatMonth(dateObj.date, scaleStep - currStep), renderFormat);
|
|
1862
|
-
indexMaps[currStr] = i + currRatio;
|
|
1915
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
1863
1916
|
currStep--;
|
|
1864
1917
|
}
|
|
1865
1918
|
}
|
|
@@ -1911,7 +1964,7 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1911
1964
|
yyyy = `${Number(yyyy) + 1}`;
|
|
1912
1965
|
}
|
|
1913
1966
|
const currStr = `${yyyy}-${W}`;
|
|
1914
|
-
indexMaps[currStr] = i + currRatio;
|
|
1967
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
1915
1968
|
currStep--;
|
|
1916
1969
|
}
|
|
1917
1970
|
}
|
|
@@ -1958,7 +2011,7 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1958
2011
|
let currStep = scaleStep - 1;
|
|
1959
2012
|
while (currStep) {
|
|
1960
2013
|
const currStr = XEUtils.toDateString(XEUtils.getWhatDay(dateObj.date, scaleStep - currStep), renderFormat);
|
|
1961
|
-
indexMaps[currStr] = i + currRatio;
|
|
2014
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
1962
2015
|
currStep--;
|
|
1963
2016
|
}
|
|
1964
2017
|
}
|
|
@@ -2001,7 +2054,7 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
2001
2054
|
let currStep = scaleStep - 1;
|
|
2002
2055
|
while (currStep) {
|
|
2003
2056
|
const currStr = XEUtils.toDateString(XEUtils.getWhatHours(dateObj.date, scaleStep - currStep), renderFormat);
|
|
2004
|
-
indexMaps[currStr] = i + currRatio;
|
|
2057
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
2005
2058
|
currStep--;
|
|
2006
2059
|
}
|
|
2007
2060
|
}
|
|
@@ -2044,7 +2097,7 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
2044
2097
|
let currStep = scaleStep - 1;
|
|
2045
2098
|
while (currStep) {
|
|
2046
2099
|
const currStr = XEUtils.toDateString(XEUtils.getWhatMinutes(dateObj.date, scaleStep - currStep), renderFormat);
|
|
2047
|
-
indexMaps[currStr] = i + currRatio;
|
|
2100
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
2048
2101
|
currStep--;
|
|
2049
2102
|
}
|
|
2050
2103
|
}
|
|
@@ -2087,7 +2140,7 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
2087
2140
|
let currStep = scaleStep - 1;
|
|
2088
2141
|
while (currStep) {
|
|
2089
2142
|
const currStr = XEUtils.toDateString(XEUtils.getWhatSeconds(dateObj.date, scaleStep - currStep), renderFormat);
|
|
2090
|
-
indexMaps[currStr] = i + currRatio;
|
|
2143
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
2091
2144
|
currStep--;
|
|
2092
2145
|
}
|
|
2093
2146
|
}
|
|
@@ -35,7 +35,7 @@ export default defineVxeComponent({
|
|
|
35
35
|
const { showNowLine, viewStyle } = taskViewOpts;
|
|
36
36
|
const scaleUnit = computeScaleUnit.value;
|
|
37
37
|
const { scaleItem } = headerGroups[headerGroups.length - 1] || {};
|
|
38
|
-
const { field, dateObj } = column;
|
|
38
|
+
const { field, dateObj, startDateObj, endDateObj } = column;
|
|
39
39
|
const { cellClassName, cellStyle } = viewStyle || {};
|
|
40
40
|
const todayValue = showNowLine && scaleItem ? todayDateMaps[scaleItem.type] : null;
|
|
41
41
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
@@ -79,6 +79,8 @@ export default defineVxeComponent({
|
|
|
79
79
|
type: viewType,
|
|
80
80
|
scaleType: scaleUnit,
|
|
81
81
|
dateObj,
|
|
82
|
+
startDateObj,
|
|
83
|
+
endDateObj,
|
|
82
84
|
row,
|
|
83
85
|
column,
|
|
84
86
|
$rowIndex,
|
|
@@ -10,7 +10,7 @@ export default defineVxeComponent({
|
|
|
10
10
|
setup() {
|
|
11
11
|
const $xeGantt = inject('$xeGantt', {});
|
|
12
12
|
const $xeGanttView = inject('$xeGanttView', {});
|
|
13
|
-
const { computeTaskViewOpts } = $xeGantt.getComputeMaps();
|
|
13
|
+
const { computeTaskViewOpts, computeScaleStep, computeMinScale } = $xeGantt.getComputeMaps();
|
|
14
14
|
const { reactData, internalData } = $xeGanttView;
|
|
15
15
|
const refElem = ref();
|
|
16
16
|
const refHeaderScroll = ref();
|
|
@@ -20,6 +20,8 @@ export default defineVxeComponent({
|
|
|
20
20
|
const { headerGroups, viewCellWidth } = reactData;
|
|
21
21
|
const { todayDateMaps, visibleColumn } = internalData;
|
|
22
22
|
const taskViewOpts = computeTaskViewOpts.value;
|
|
23
|
+
const minScale = computeMinScale.value;
|
|
24
|
+
const scaleStep = computeScaleStep.value;
|
|
23
25
|
const { showNowLine } = taskViewOpts;
|
|
24
26
|
return h('div', {
|
|
25
27
|
ref: refElem,
|
|
@@ -54,17 +56,31 @@ export default defineVxeComponent({
|
|
|
54
56
|
return h('tr', {
|
|
55
57
|
key: $rowIndex
|
|
56
58
|
}, columns.map((column, cIndex) => {
|
|
57
|
-
const { field, childCount, dateObj } = column;
|
|
59
|
+
const { field, childCount, dateObj, startDateObj, endDateObj } = column;
|
|
58
60
|
let label = `${column.title}`;
|
|
59
|
-
if (
|
|
60
|
-
label = getI18n(`vxe.gantt.
|
|
61
|
+
if ((isLast || (minScale && (minScale.type === 'date' || minScale.type === 'day') && (type === 'date' || type === 'day'))) && scaleStep > 1) {
|
|
62
|
+
label = getI18n(`vxe.gantt.stepFormat.${type}`, {
|
|
63
|
+
start: startDateObj,
|
|
64
|
+
end: endDateObj,
|
|
65
|
+
eStartLabel: getI18n(`vxe.gantt.dayss.w${startDateObj.e}`),
|
|
66
|
+
eEndLabel: getI18n(`vxe.gantt.dayss.w${endDateObj.e}`)
|
|
67
|
+
});
|
|
61
68
|
}
|
|
62
69
|
else {
|
|
63
|
-
if (
|
|
64
|
-
|
|
70
|
+
if (type === 'day') {
|
|
71
|
+
if ($rowIndex) {
|
|
72
|
+
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, {
|
|
73
|
+
eLabel: getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
label = getI18n(`vxe.gantt.tFullFormat.${type}`, {
|
|
78
|
+
eLabel: getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
|
|
79
|
+
});
|
|
80
|
+
}
|
|
65
81
|
}
|
|
66
82
|
else {
|
|
67
|
-
if (
|
|
83
|
+
if ($rowIndex) {
|
|
68
84
|
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj);
|
|
69
85
|
}
|
|
70
86
|
else {
|
|
@@ -73,7 +89,17 @@ export default defineVxeComponent({
|
|
|
73
89
|
}
|
|
74
90
|
}
|
|
75
91
|
let cellVNs = label;
|
|
76
|
-
const ctParams = {
|
|
92
|
+
const ctParams = {
|
|
93
|
+
source: sourceType,
|
|
94
|
+
type: viewType,
|
|
95
|
+
column,
|
|
96
|
+
scaleObj: scaleItem,
|
|
97
|
+
title: label,
|
|
98
|
+
dateObj,
|
|
99
|
+
startDateObj,
|
|
100
|
+
endDateObj,
|
|
101
|
+
$rowIndex
|
|
102
|
+
};
|
|
77
103
|
if (titleSlot) {
|
|
78
104
|
cellVNs = $xeGantt.callSlot(titleSlot, ctParams);
|
|
79
105
|
}
|
|
@@ -114,7 +114,7 @@ export default defineVxeComponent({
|
|
|
114
114
|
let rightSize = ganttReactData.currRightSpacing + XEUtils.toNumber(gridding ? gridding.rightSpacing || 0 : 0);
|
|
115
115
|
if (scaleStep > 0) {
|
|
116
116
|
leftSize *= scaleStep;
|
|
117
|
-
rightSize *=
|
|
117
|
+
rightSize *= scaleStep;
|
|
118
118
|
}
|
|
119
119
|
switch (type) {
|
|
120
120
|
case 'year': {
|
|
@@ -282,6 +282,8 @@ export default defineVxeComponent({
|
|
|
282
282
|
const minScale = computeMinScale.value;
|
|
283
283
|
const weekScale = computeWeekScale.value;
|
|
284
284
|
const scaleDateList = computeScaleDateList.value;
|
|
285
|
+
const scaleStep = computeScaleStep.value;
|
|
286
|
+
const weekStartDay = weekScale ? weekScale.startDay : undefined;
|
|
285
287
|
const fullCols = [];
|
|
286
288
|
const groupCols = [];
|
|
287
289
|
if (minScale && scaleUnit && scaleDateList.length) {
|
|
@@ -327,65 +329,88 @@ export default defineVxeComponent({
|
|
|
327
329
|
currGpCol.children.push(minCol);
|
|
328
330
|
}
|
|
329
331
|
};
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
const e = itemDate.getDay();
|
|
332
|
+
const createDateObj = (date) => {
|
|
333
|
+
let [yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss] = XEUtils.toDateString(date, 'yy-yyyy-M-MM-d-dd-H-HH-m-mm-s-ss').split('-');
|
|
334
|
+
const e = date.getDay();
|
|
334
335
|
const E = e + 1;
|
|
335
|
-
const q = Math.ceil((
|
|
336
|
-
const W = `${XEUtils.getYearWeek(
|
|
336
|
+
const q = Math.ceil((date.getMonth() + 1) / 3);
|
|
337
|
+
const W = `${XEUtils.getYearWeek(date, weekScale ? weekScale.startDay : undefined)}`;
|
|
337
338
|
const WW = XEUtils.padStart(W, 2, '0');
|
|
338
339
|
if (isMinWeek && checkWeekOfsetYear(W, M)) {
|
|
339
340
|
yyyy = `${Number(yyyy) + 1}`;
|
|
340
341
|
M = '1';
|
|
341
342
|
MM = '0' + M;
|
|
342
343
|
}
|
|
343
|
-
|
|
344
|
+
return { date, yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss, q, W, WW, E, e };
|
|
345
|
+
};
|
|
346
|
+
for (let i = 0; i < scaleDateList.length; i++) {
|
|
347
|
+
const itemDate = scaleDateList[i];
|
|
348
|
+
const dateObj = createDateObj(itemDate);
|
|
349
|
+
const { yyyy, MM, dd, HH, mm, ss, q, W, E } = dateObj;
|
|
350
|
+
const startDateObj = dateObj;
|
|
344
351
|
const colMaps = {
|
|
345
352
|
year: {
|
|
346
353
|
field: yyyy,
|
|
347
354
|
title: yyyy,
|
|
348
|
-
dateObj
|
|
355
|
+
dateObj,
|
|
356
|
+
startDateObj,
|
|
357
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatYear(itemDate, scaleStep - 1)) : startDateObj
|
|
349
358
|
},
|
|
350
359
|
quarter: {
|
|
351
360
|
field: `${yyyy}_q${q}`,
|
|
352
361
|
title: `${q}`,
|
|
353
|
-
dateObj
|
|
362
|
+
dateObj,
|
|
363
|
+
startDateObj,
|
|
364
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatQuarter(itemDate, scaleStep - 1)) : startDateObj
|
|
354
365
|
},
|
|
355
366
|
month: {
|
|
356
367
|
field: `${yyyy}_${MM}`,
|
|
357
368
|
title: MM,
|
|
358
|
-
dateObj
|
|
369
|
+
dateObj,
|
|
370
|
+
startDateObj,
|
|
371
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatMonth(itemDate, scaleStep - 1)) : startDateObj
|
|
359
372
|
},
|
|
360
373
|
week: {
|
|
361
374
|
field: `${yyyy}_W${W}`,
|
|
362
375
|
title: `${W}`,
|
|
363
|
-
dateObj
|
|
376
|
+
dateObj,
|
|
377
|
+
startDateObj,
|
|
378
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatWeek(itemDate, scaleStep - 1, weekStartDay, weekStartDay)) : startDateObj
|
|
364
379
|
},
|
|
365
380
|
day: {
|
|
366
381
|
field: `${yyyy}_${MM}_${dd}_E${E}`,
|
|
367
382
|
title: `${E}`,
|
|
368
|
-
dateObj
|
|
383
|
+
dateObj,
|
|
384
|
+
startDateObj,
|
|
385
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
|
|
369
386
|
},
|
|
370
387
|
date: {
|
|
371
388
|
field: `${yyyy}_${MM}_${dd}`,
|
|
372
389
|
title: dd,
|
|
373
|
-
dateObj
|
|
390
|
+
dateObj,
|
|
391
|
+
startDateObj,
|
|
392
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
|
|
374
393
|
},
|
|
375
394
|
hour: {
|
|
376
395
|
field: `${yyyy}_${MM}_${dd}_${HH}`,
|
|
377
396
|
title: HH,
|
|
378
|
-
dateObj
|
|
397
|
+
dateObj,
|
|
398
|
+
startDateObj,
|
|
399
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatHours(itemDate, scaleStep - 1)) : startDateObj
|
|
379
400
|
},
|
|
380
401
|
minute: {
|
|
381
402
|
field: `${yyyy}_${MM}_${dd}_${HH}_${mm}`,
|
|
382
403
|
title: mm,
|
|
383
|
-
dateObj
|
|
404
|
+
dateObj,
|
|
405
|
+
startDateObj,
|
|
406
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatMinutes(itemDate, scaleStep - 1)) : startDateObj
|
|
384
407
|
},
|
|
385
408
|
second: {
|
|
386
409
|
field: `${yyyy}_${MM}_${dd}_${HH}_${mm}_${ss}`,
|
|
387
410
|
title: ss,
|
|
388
|
-
dateObj
|
|
411
|
+
dateObj,
|
|
412
|
+
startDateObj,
|
|
413
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatSeconds(itemDate, scaleStep - 1)) : startDateObj
|
|
389
414
|
}
|
|
390
415
|
};
|
|
391
416
|
const minCol = colMaps[minScale.type];
|
|
@@ -488,7 +513,7 @@ export default defineVxeComponent({
|
|
|
488
513
|
let currStep = scaleStep - 1;
|
|
489
514
|
while (currStep) {
|
|
490
515
|
const currStr = XEUtils.toDateString(XEUtils.getWhatYear(dateObj.date, scaleStep - currStep), renderFormat);
|
|
491
|
-
indexMaps[currStr] = i + currRatio;
|
|
516
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
492
517
|
currStep--;
|
|
493
518
|
}
|
|
494
519
|
}
|
|
@@ -534,7 +559,7 @@ export default defineVxeComponent({
|
|
|
534
559
|
let currStep = scaleStep - 1;
|
|
535
560
|
while (currStep) {
|
|
536
561
|
const currStr = XEUtils.toDateString(XEUtils.getWhatQuarter(dateObj.date, scaleStep - currStep), renderFormat);
|
|
537
|
-
indexMaps[currStr] = i + currRatio;
|
|
562
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
538
563
|
currStep--;
|
|
539
564
|
}
|
|
540
565
|
}
|
|
@@ -580,7 +605,7 @@ export default defineVxeComponent({
|
|
|
580
605
|
let currStep = scaleStep - 1;
|
|
581
606
|
while (currStep) {
|
|
582
607
|
const currStr = XEUtils.toDateString(XEUtils.getWhatMonth(dateObj.date, scaleStep - currStep), renderFormat);
|
|
583
|
-
indexMaps[currStr] = i + currRatio;
|
|
608
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
584
609
|
currStep--;
|
|
585
610
|
}
|
|
586
611
|
}
|
|
@@ -632,7 +657,7 @@ export default defineVxeComponent({
|
|
|
632
657
|
yyyy = `${Number(yyyy) + 1}`;
|
|
633
658
|
}
|
|
634
659
|
const currStr = `${yyyy}-${W}`;
|
|
635
|
-
indexMaps[currStr] = i + currRatio;
|
|
660
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
636
661
|
currStep--;
|
|
637
662
|
}
|
|
638
663
|
}
|
|
@@ -679,7 +704,7 @@ export default defineVxeComponent({
|
|
|
679
704
|
let currStep = scaleStep - 1;
|
|
680
705
|
while (currStep) {
|
|
681
706
|
const currStr = XEUtils.toDateString(XEUtils.getWhatDay(dateObj.date, scaleStep - currStep), renderFormat);
|
|
682
|
-
indexMaps[currStr] = i + currRatio;
|
|
707
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
683
708
|
currStep--;
|
|
684
709
|
}
|
|
685
710
|
}
|
|
@@ -722,7 +747,7 @@ export default defineVxeComponent({
|
|
|
722
747
|
let currStep = scaleStep - 1;
|
|
723
748
|
while (currStep) {
|
|
724
749
|
const currStr = XEUtils.toDateString(XEUtils.getWhatHours(dateObj.date, scaleStep - currStep), renderFormat);
|
|
725
|
-
indexMaps[currStr] = i + currRatio;
|
|
750
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
726
751
|
currStep--;
|
|
727
752
|
}
|
|
728
753
|
}
|
|
@@ -765,7 +790,7 @@ export default defineVxeComponent({
|
|
|
765
790
|
let currStep = scaleStep - 1;
|
|
766
791
|
while (currStep) {
|
|
767
792
|
const currStr = XEUtils.toDateString(XEUtils.getWhatMinutes(dateObj.date, scaleStep - currStep), renderFormat);
|
|
768
|
-
indexMaps[currStr] = i + currRatio;
|
|
793
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
769
794
|
currStep--;
|
|
770
795
|
}
|
|
771
796
|
}
|
|
@@ -808,7 +833,7 @@ export default defineVxeComponent({
|
|
|
808
833
|
let currStep = scaleStep - 1;
|
|
809
834
|
while (currStep) {
|
|
810
835
|
const currStr = XEUtils.toDateString(XEUtils.getWhatSeconds(dateObj.date, scaleStep - currStep), renderFormat);
|
|
811
|
-
indexMaps[currStr] = i + currRatio;
|
|
836
|
+
indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
|
|
812
837
|
currStep--;
|
|
813
838
|
}
|
|
814
839
|
}
|
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${"4.6.
|
|
3
|
+
const ganttVersion = `gantt v${"4.6.8"}`;
|
|
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}` : '';
|
|
@@ -71,7 +71,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
71
71
|
} = headerGroups[headerGroups.length - 1] || {};
|
|
72
72
|
const {
|
|
73
73
|
field,
|
|
74
|
-
dateObj
|
|
74
|
+
dateObj,
|
|
75
|
+
startDateObj,
|
|
76
|
+
endDateObj
|
|
75
77
|
} = column;
|
|
76
78
|
const {
|
|
77
79
|
cellClassName,
|
|
@@ -119,6 +121,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
119
121
|
type: viewType,
|
|
120
122
|
scaleType: scaleUnit,
|
|
121
123
|
dateObj,
|
|
124
|
+
startDateObj,
|
|
125
|
+
endDateObj,
|
|
122
126
|
row,
|
|
123
127
|
column,
|
|
124
128
|
$rowIndex,
|