vxe-gantt 4.4.10 → 4.5.1
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 +181 -99
- package/es/gantt/src/gantt-view.js +169 -93
- package/es/gantt/src/gantt.js +6 -0
- package/es/gantt/src/table-emits.js +4 -4
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/gantt-view.js +171 -97
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +8 -0
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/gantt/src/table-emits.js +9 -1
- package/lib/index.umd.js +243 -153
- 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 +169 -93
- package/packages/gantt/src/gantt.ts +7 -0
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.
|
|
9
|
+
VxeUI.ganttVersion = "4.5.1";
|
|
10
10
|
const ymdFormat = 'yyyy-MM-dd';
|
|
11
11
|
const ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
|
|
12
12
|
setConfig$1({
|
|
@@ -114,7 +114,7 @@ setIcon({
|
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
const { log } = VxeUI;
|
|
117
|
-
const ganttVersion = `gantt v${"4.
|
|
117
|
+
const ganttVersion = `gantt v${"4.5.1"}`;
|
|
118
118
|
function createComponentLog(name) {
|
|
119
119
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
120
120
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|
|
@@ -257,7 +257,7 @@ const tableEmits = [
|
|
|
257
257
|
'columns-change',
|
|
258
258
|
'data-change',
|
|
259
259
|
'footer-data-change',
|
|
260
|
-
'current-change',
|
|
260
|
+
'current-change', // 已废弃
|
|
261
261
|
'current-row-change',
|
|
262
262
|
'current-row-disabled',
|
|
263
263
|
'current-column-change',
|
|
@@ -291,7 +291,7 @@ const tableEmits = [
|
|
|
291
291
|
'filter-visible',
|
|
292
292
|
'clear-filter',
|
|
293
293
|
'clear-all-filter',
|
|
294
|
-
'resizable-change',
|
|
294
|
+
'resizable-change', // 废弃
|
|
295
295
|
'column-resizable-change',
|
|
296
296
|
'row-resizable-change',
|
|
297
297
|
'toggle-row-group-expand',
|
|
@@ -309,7 +309,7 @@ const tableEmits = [
|
|
|
309
309
|
'column-dragend',
|
|
310
310
|
'enter-append-row',
|
|
311
311
|
'tab-append-row',
|
|
312
|
-
'edit-actived',
|
|
312
|
+
'edit-actived', // 废弃
|
|
313
313
|
'edit-activated',
|
|
314
314
|
'edit-disabled',
|
|
315
315
|
'valid-error',
|
|
@@ -320,7 +320,7 @@ const tableEmits = [
|
|
|
320
320
|
'custom-visible-all',
|
|
321
321
|
'custom-fixed-change',
|
|
322
322
|
'custom-sort-change',
|
|
323
|
-
'change-fnr',
|
|
323
|
+
'change-fnr', // 废弃
|
|
324
324
|
'open-fnr',
|
|
325
325
|
'show-fnr',
|
|
326
326
|
'hide-fnr',
|
|
@@ -1278,8 +1278,10 @@ var GanttViewFooterComponent = defineVxeComponent({
|
|
|
1278
1278
|
|
|
1279
1279
|
const { globalEvents: globalEvents$1 } = VxeUI;
|
|
1280
1280
|
const sourceType = 'gantt';
|
|
1281
|
+
const secondMs = 1000;
|
|
1281
1282
|
const minuteMs = 1000 * 60;
|
|
1282
|
-
const
|
|
1283
|
+
const hourMs = 1000 * 60 * 60;
|
|
1284
|
+
const dayMs = hourMs * 24;
|
|
1283
1285
|
function createInternalData$1() {
|
|
1284
1286
|
return {
|
|
1285
1287
|
xeTable: null,
|
|
@@ -1344,7 +1346,7 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1344
1346
|
const xID = XEUtils.uniqueId();
|
|
1345
1347
|
const $xeGantt = inject('$xeGantt', {});
|
|
1346
1348
|
const { reactData: ganttReactData, internalData: ganttInternalData } = $xeGantt;
|
|
1347
|
-
const {
|
|
1349
|
+
const { computeDateFormat, computeTaskViewOpts, computeStartField, computeEndField, computeTypeField, computeScrollbarOpts, computeScrollbarXToTop, computeScrollbarYToLeft, computeScaleUnit, computeWeekScale, computeMinScale, computeTaskNowLineOpts } = $xeGantt.getComputeMaps();
|
|
1348
1350
|
const refElem = ref();
|
|
1349
1351
|
const refScrollXVirtualElem = ref();
|
|
1350
1352
|
const refScrollYVirtualElem = ref();
|
|
@@ -1503,9 +1505,8 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1503
1505
|
getComputeMaps: () => computeMaps
|
|
1504
1506
|
};
|
|
1505
1507
|
const parseStringDate = (dateValue) => {
|
|
1506
|
-
const
|
|
1507
|
-
|
|
1508
|
-
return XEUtils.toStringDate(dateValue, dateFormat || null);
|
|
1508
|
+
const dateFormat = computeDateFormat.value;
|
|
1509
|
+
return XEUtils.toStringDate(dateValue, dateFormat);
|
|
1509
1510
|
};
|
|
1510
1511
|
const updateTodayData = () => {
|
|
1511
1512
|
const ganttReactData = $xeGantt.reactData;
|
|
@@ -1733,195 +1734,270 @@ var GanttViewComponent = defineVxeComponent({
|
|
|
1733
1734
|
};
|
|
1734
1735
|
};
|
|
1735
1736
|
const createChartRender = (fullCols) => {
|
|
1736
|
-
const { minViewDate } = reactData;
|
|
1737
1737
|
const minScale = computeMinScale.value;
|
|
1738
1738
|
const scaleUnit = computeScaleUnit.value;
|
|
1739
1739
|
const weekScale = computeWeekScale.value;
|
|
1740
|
+
const dateFormat = computeDateFormat.value;
|
|
1740
1741
|
if (minScale) {
|
|
1741
1742
|
switch (scaleUnit) {
|
|
1742
1743
|
case 'year': {
|
|
1744
|
+
const showActualProgress = /M|d|H|mm|ss|S/.test(dateFormat);
|
|
1745
|
+
const renderFormat = 'yyyy';
|
|
1743
1746
|
const indexMaps = {};
|
|
1744
1747
|
fullCols.forEach(({ dateObj }, i) => {
|
|
1745
1748
|
const yyyyMM = XEUtils.toDateString(dateObj.date, 'yyyy');
|
|
1746
1749
|
indexMaps[yyyyMM] = i;
|
|
1747
1750
|
});
|
|
1748
1751
|
return (startValue, endValue) => {
|
|
1749
|
-
const
|
|
1750
|
-
const
|
|
1751
|
-
const startStr = XEUtils.toDateString(
|
|
1752
|
-
const
|
|
1753
|
-
const
|
|
1752
|
+
const startValDate = parseStringDate(startValue);
|
|
1753
|
+
const endValDate = parseStringDate(endValue);
|
|
1754
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
1755
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatYear(startValDate, 0, 'first');
|
|
1756
|
+
const startFirstDate = XEUtils.getWhatYear(startValDate, 0, 'first');
|
|
1757
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
1758
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatYear(endValDate, 0, 'last');
|
|
1754
1759
|
const endFirstDate = XEUtils.getWhatYear(endDate, 0, 'first');
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1760
|
+
// 当前是年维度,当指定解析格式精确到天时,显示实际进度
|
|
1761
|
+
let startSubtractSize = 0;
|
|
1762
|
+
let endSubtractSize = 1;
|
|
1763
|
+
if (showActualProgress) {
|
|
1764
|
+
// 按年的天数比计算
|
|
1765
|
+
const syDaySize = XEUtils.getDayOfYear(startDate, 0);
|
|
1766
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / syDaySize;
|
|
1767
|
+
const eyDaySize = XEUtils.getDayOfYear(endDate, 0);
|
|
1768
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / eyDaySize;
|
|
1769
|
+
}
|
|
1770
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
1759
1771
|
return {
|
|
1760
1772
|
offsetLeftSize,
|
|
1761
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
1773
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
1762
1774
|
};
|
|
1763
1775
|
};
|
|
1764
1776
|
}
|
|
1765
1777
|
case 'quarter': {
|
|
1778
|
+
const showActualProgress = /M|d|H|mm|ss|S/.test(dateFormat);
|
|
1779
|
+
const renderFormat = 'yyyy-q';
|
|
1766
1780
|
const indexMaps = {};
|
|
1767
1781
|
fullCols.forEach(({ dateObj }, i) => {
|
|
1768
|
-
const q = XEUtils.toDateString(dateObj.date,
|
|
1782
|
+
const q = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
1769
1783
|
indexMaps[q] = i;
|
|
1770
1784
|
});
|
|
1771
1785
|
return (startValue, endValue) => {
|
|
1772
|
-
const
|
|
1773
|
-
const
|
|
1774
|
-
const startStr = XEUtils.toDateString(
|
|
1775
|
-
const
|
|
1776
|
-
const
|
|
1786
|
+
const startValDate = parseStringDate(startValue);
|
|
1787
|
+
const endValDate = parseStringDate(endValue);
|
|
1788
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
1789
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatQuarter(startValDate, 0, 'first');
|
|
1790
|
+
const startFirstDate = XEUtils.getWhatQuarter(startValDate, 0, 'first');
|
|
1791
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
1792
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatQuarter(endValDate, 0, 'last');
|
|
1777
1793
|
const endFirstDate = XEUtils.getWhatQuarter(endDate, 0, 'first');
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1794
|
+
// 当前是季度维度,当指定解析格式精确到天时,显示实际进度
|
|
1795
|
+
let startSubtractSize = 0;
|
|
1796
|
+
let endSubtractSize = 1;
|
|
1797
|
+
if (showActualProgress) {
|
|
1798
|
+
// 按季度天数比计算
|
|
1799
|
+
const sqDaySize = XEUtils.getDayOfQuarter(startDate, 0);
|
|
1800
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / sqDaySize;
|
|
1801
|
+
const eqDaySize = XEUtils.getDayOfQuarter(endDate, 0);
|
|
1802
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / eqDaySize;
|
|
1803
|
+
}
|
|
1804
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
1782
1805
|
return {
|
|
1783
1806
|
offsetLeftSize,
|
|
1784
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
1807
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
1785
1808
|
};
|
|
1786
1809
|
};
|
|
1787
1810
|
}
|
|
1788
1811
|
case 'month': {
|
|
1812
|
+
const renderFormat = 'yyyy-MM';
|
|
1813
|
+
const showActualProgress = /d|H|mm|ss|S/.test(dateFormat);
|
|
1789
1814
|
const indexMaps = {};
|
|
1790
1815
|
fullCols.forEach(({ dateObj }, i) => {
|
|
1791
|
-
const yyyyMM = XEUtils.toDateString(dateObj.date,
|
|
1816
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
1792
1817
|
indexMaps[yyyyMM] = i;
|
|
1793
1818
|
});
|
|
1794
1819
|
return (startValue, endValue) => {
|
|
1795
|
-
const
|
|
1796
|
-
const
|
|
1797
|
-
const startStr = XEUtils.toDateString(
|
|
1798
|
-
const
|
|
1799
|
-
const
|
|
1820
|
+
const startValDate = parseStringDate(startValue);
|
|
1821
|
+
const endValDate = parseStringDate(endValue);
|
|
1822
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
1823
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatMonth(startValDate, 0, 'first');
|
|
1824
|
+
const startFirstDate = XEUtils.getWhatMonth(startValDate, 0, 'first');
|
|
1825
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
1826
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatMonth(endValDate, 0, 'last');
|
|
1800
1827
|
const endFirstDate = XEUtils.getWhatMonth(endDate, 0, 'first');
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1828
|
+
// 当前是月维度,当指定解析格式精确到天时,显示实际进度
|
|
1829
|
+
let startSubtractSize = 0;
|
|
1830
|
+
let endSubtractSize = 1;
|
|
1831
|
+
if (showActualProgress) {
|
|
1832
|
+
// 按月天数比计算
|
|
1833
|
+
const smDaySize = XEUtils.getDayOfMonth(startDate, 0);
|
|
1834
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / smDaySize;
|
|
1835
|
+
const emDaySize = XEUtils.getDayOfMonth(endDate, 0);
|
|
1836
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / emDaySize;
|
|
1837
|
+
}
|
|
1838
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
1805
1839
|
return {
|
|
1806
1840
|
offsetLeftSize,
|
|
1807
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
1841
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
1808
1842
|
};
|
|
1809
1843
|
};
|
|
1810
1844
|
}
|
|
1811
1845
|
case 'week': {
|
|
1846
|
+
const showActualProgress = /d|mm|ss|S/.test(dateFormat);
|
|
1812
1847
|
const indexMaps = {};
|
|
1813
1848
|
fullCols.forEach(({ dateObj }, i) => {
|
|
1814
1849
|
const yyyyW = `${dateObj.yyyy}-${dateObj.W}`;
|
|
1815
1850
|
indexMaps[yyyyW] = i;
|
|
1816
1851
|
});
|
|
1817
1852
|
return (startValue, endValue) => {
|
|
1818
|
-
const
|
|
1819
|
-
const
|
|
1820
|
-
const
|
|
1853
|
+
const weekStartDay = weekScale ? weekScale.startDay : undefined;
|
|
1854
|
+
const startValDate = parseStringDate(startValue);
|
|
1855
|
+
const endValDate = parseStringDate(endValue);
|
|
1856
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatWeek(startValDate, 0, 'first', weekStartDay);
|
|
1857
|
+
const startWeekObj = parseWeekObj(startDate, weekStartDay);
|
|
1821
1858
|
const startStr = `${startWeekObj.yyyy}-${startWeekObj.W}`;
|
|
1822
|
-
const startFirstDate = XEUtils.getWhatWeek(startDate, 0,
|
|
1823
|
-
const
|
|
1859
|
+
const startFirstDate = XEUtils.getWhatWeek(startDate, 0, 'first', weekStartDay);
|
|
1860
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatWeek(endValDate, 0, 'first', weekStartDay);
|
|
1861
|
+
const endWeekObj = parseWeekObj(endDate, weekStartDay);
|
|
1824
1862
|
const endStr = `${endWeekObj.yyyy}-${endWeekObj.W}`;
|
|
1825
|
-
const endFirstDate = XEUtils.getWhatWeek(endDate, 0,
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1863
|
+
const endFirstDate = XEUtils.getWhatWeek(endDate, 0, 'first', weekStartDay);
|
|
1864
|
+
// 当前是周维度,当指定解析格式精确到天时,显示实际进度
|
|
1865
|
+
let startSubtractSize = 0;
|
|
1866
|
+
let endSubtractSize = 1;
|
|
1867
|
+
if (showActualProgress) {
|
|
1868
|
+
// 按周天数比计算
|
|
1869
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / 7;
|
|
1870
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / 7;
|
|
1871
|
+
}
|
|
1872
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
1830
1873
|
return {
|
|
1831
1874
|
offsetLeftSize,
|
|
1832
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
1875
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
1833
1876
|
};
|
|
1834
1877
|
};
|
|
1835
1878
|
}
|
|
1836
1879
|
case 'day':
|
|
1837
1880
|
case 'date': {
|
|
1881
|
+
const renderFormat = 'yyyy-MM-dd';
|
|
1882
|
+
const showActualProgress = /mm|ss|S/.test(dateFormat);
|
|
1838
1883
|
const indexMaps = {};
|
|
1839
1884
|
fullCols.forEach(({ dateObj }, i) => {
|
|
1840
|
-
const yyyyMM = XEUtils.toDateString(dateObj.date,
|
|
1885
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
1841
1886
|
indexMaps[yyyyMM] = i;
|
|
1842
1887
|
});
|
|
1843
1888
|
return (startValue, endValue) => {
|
|
1844
|
-
const
|
|
1845
|
-
const
|
|
1846
|
-
const startStr = XEUtils.toDateString(
|
|
1889
|
+
const startValDate = parseStringDate(startValue);
|
|
1890
|
+
const endValDate = parseStringDate(endValue);
|
|
1891
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
1892
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatDay(startValDate, 0, 'first');
|
|
1847
1893
|
const startFirstDate = XEUtils.getWhatDay(startDate, 0, 'first');
|
|
1848
|
-
const endStr = XEUtils.toDateString(
|
|
1894
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
1895
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatDay(endValDate, 0, 'last');
|
|
1849
1896
|
const endFirstDate = XEUtils.getWhatDay(endDate, 0, 'first');
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1897
|
+
// 当前是天维度,当指定解析格式精确到时分秒豪秒时,显示实际进度
|
|
1898
|
+
let startSubtractSize = 0;
|
|
1899
|
+
let endSubtractSize = 1;
|
|
1900
|
+
if (showActualProgress) {
|
|
1901
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs;
|
|
1902
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs;
|
|
1903
|
+
}
|
|
1904
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
1857
1905
|
return {
|
|
1858
1906
|
offsetLeftSize,
|
|
1859
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
1907
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
1860
1908
|
};
|
|
1861
1909
|
};
|
|
1862
1910
|
}
|
|
1863
1911
|
case 'hour': {
|
|
1912
|
+
const renderFormat = 'yyyy-MM-dd HH';
|
|
1913
|
+
const showActualProgress = /mm|ss|S/.test(dateFormat);
|
|
1864
1914
|
const indexMaps = {};
|
|
1865
1915
|
fullCols.forEach(({ dateObj }, i) => {
|
|
1866
|
-
const yyyyMM = XEUtils.toDateString(dateObj.date,
|
|
1916
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
1867
1917
|
indexMaps[yyyyMM] = i;
|
|
1868
1918
|
});
|
|
1869
1919
|
return (startValue, endValue) => {
|
|
1870
|
-
const
|
|
1871
|
-
const
|
|
1872
|
-
const startStr = XEUtils.toDateString(
|
|
1920
|
+
const startValDate = parseStringDate(startValue);
|
|
1921
|
+
const endValDate = parseStringDate(endValue);
|
|
1922
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
1923
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatHours(startValDate, 0, 'first');
|
|
1873
1924
|
const startFirstDate = XEUtils.getWhatHours(startDate, 0, 'first');
|
|
1874
|
-
const endStr = XEUtils.toDateString(
|
|
1925
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
1926
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatHours(endValDate, 0, 'last');
|
|
1875
1927
|
const endFirstDate = XEUtils.getWhatHours(endDate, 0, 'first');
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1928
|
+
// 当前是小时维度,当指定解析格式精确到分秒豪秒时,显示实际进度
|
|
1929
|
+
let startSubtractSize = 0;
|
|
1930
|
+
let endSubtractSize = 1;
|
|
1931
|
+
if (showActualProgress) {
|
|
1932
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / hourMs;
|
|
1933
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / hourMs;
|
|
1934
|
+
}
|
|
1935
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
1882
1936
|
return {
|
|
1883
1937
|
offsetLeftSize,
|
|
1884
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
1938
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
1885
1939
|
};
|
|
1886
1940
|
};
|
|
1887
1941
|
}
|
|
1888
1942
|
case 'minute': {
|
|
1943
|
+
const renderFormat = 'yyyy-MM-dd HH:mm';
|
|
1944
|
+
const showActualProgress = /ss|S/.test(dateFormat);
|
|
1889
1945
|
const indexMaps = {};
|
|
1890
1946
|
fullCols.forEach(({ dateObj }, i) => {
|
|
1891
|
-
const yyyyMM = XEUtils.toDateString(dateObj.date,
|
|
1947
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
1892
1948
|
indexMaps[yyyyMM] = i;
|
|
1893
1949
|
});
|
|
1894
1950
|
return (startValue, endValue) => {
|
|
1895
|
-
const
|
|
1896
|
-
const
|
|
1897
|
-
const startStr = XEUtils.toDateString(
|
|
1951
|
+
const startValDate = parseStringDate(startValue);
|
|
1952
|
+
const endValDate = parseStringDate(endValue);
|
|
1953
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
1954
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatMinutes(startValDate, 0, 'first');
|
|
1898
1955
|
const startFirstDate = XEUtils.getWhatMinutes(startDate, 0, 'first');
|
|
1899
|
-
const endStr = XEUtils.toDateString(
|
|
1956
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
1957
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatMinutes(endValDate, 0, 'last');
|
|
1900
1958
|
const endFirstDate = XEUtils.getWhatMinutes(endDate, 0, 'first');
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1959
|
+
// 当前是分钟维度,当指定解析格式精确到秒豪秒时,显示实际进度
|
|
1960
|
+
let startSubtractSize = 0;
|
|
1961
|
+
let endSubtractSize = 1;
|
|
1962
|
+
if (showActualProgress) {
|
|
1963
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / minuteMs;
|
|
1964
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / minuteMs;
|
|
1965
|
+
}
|
|
1966
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
1905
1967
|
return {
|
|
1906
1968
|
offsetLeftSize,
|
|
1907
|
-
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize +
|
|
1969
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
1908
1970
|
};
|
|
1909
1971
|
};
|
|
1910
1972
|
}
|
|
1911
1973
|
case 'second': {
|
|
1912
|
-
const
|
|
1974
|
+
const renderFormat = 'yyyy-MM-dd HH:mm:ss';
|
|
1975
|
+
const showActualProgress = /S/.test(dateFormat);
|
|
1976
|
+
const indexMaps = {};
|
|
1977
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
1978
|
+
const yyyyMM = XEUtils.toDateString(dateObj.date, renderFormat);
|
|
1979
|
+
indexMaps[yyyyMM] = i;
|
|
1980
|
+
});
|
|
1913
1981
|
return (startValue, endValue) => {
|
|
1914
|
-
const
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1982
|
+
const startValDate = parseStringDate(startValue);
|
|
1983
|
+
const endValDate = parseStringDate(endValue);
|
|
1984
|
+
const startStr = XEUtils.toDateString(startValDate, renderFormat);
|
|
1985
|
+
const startDate = showActualProgress ? startValDate : XEUtils.getWhatSeconds(startValDate, 0, 'first');
|
|
1986
|
+
const startFirstDate = XEUtils.getWhatSeconds(startDate, 0, 'first');
|
|
1987
|
+
const endStr = XEUtils.toDateString(endValDate, renderFormat);
|
|
1988
|
+
const endDate = showActualProgress ? endValDate : XEUtils.getWhatSeconds(endValDate, 0, 'last');
|
|
1989
|
+
const endFirstDate = XEUtils.getWhatSeconds(endDate, 0, 'first');
|
|
1990
|
+
// 当前是秒维度,当指定解析格式精确到豪秒时,显示实际进度
|
|
1991
|
+
let startSubtractSize = 0;
|
|
1992
|
+
let endSubtractSize = 1;
|
|
1993
|
+
if (showActualProgress) {
|
|
1994
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / secondMs;
|
|
1995
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / secondMs;
|
|
1921
1996
|
}
|
|
1997
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
1922
1998
|
return {
|
|
1923
1999
|
offsetLeftSize,
|
|
1924
|
-
offsetWidthSize
|
|
2000
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
1925
2001
|
};
|
|
1926
2002
|
};
|
|
1927
2003
|
}
|
|
@@ -3214,6 +3290,11 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
3214
3290
|
const computeTaskLinkOpts = computed(() => {
|
|
3215
3291
|
return Object.assign({}, getConfig().gantt.taskLinkConfig, props.taskLinkConfig);
|
|
3216
3292
|
});
|
|
3293
|
+
const computeDateFormat = computed(() => {
|
|
3294
|
+
const taskOpts = computeTaskOpts.value;
|
|
3295
|
+
const { dateFormat } = taskOpts;
|
|
3296
|
+
return dateFormat || '';
|
|
3297
|
+
});
|
|
3217
3298
|
const computeScaleUnit = computed(() => {
|
|
3218
3299
|
const minScale = computeMinScale.value;
|
|
3219
3300
|
return minScale ? minScale.type : 'date';
|
|
@@ -3480,6 +3561,7 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
3480
3561
|
computeTaskLinkOpts,
|
|
3481
3562
|
computeTaskViewScales,
|
|
3482
3563
|
computeScaleUnit,
|
|
3564
|
+
computeDateFormat,
|
|
3483
3565
|
computeMinScale,
|
|
3484
3566
|
computeWeekScale,
|
|
3485
3567
|
computeTitleField,
|