vxe-gantt 3.6.6 → 3.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.
@@ -40,7 +40,7 @@ export default defineVxeComponent({
40
40
  const { showNowLine, viewStyle } = taskViewOpts;
41
41
  const scaleUnit = $xeGantt.computeScaleUnit;
42
42
  const { scaleItem } = headerGroups[headerGroups.length - 1] || {};
43
- const { field, dateObj } = column;
43
+ const { field, dateObj, startDateObj, endDateObj } = column;
44
44
  const { cellClassName, cellStyle } = viewStyle || {};
45
45
  const todayValue = showNowLine && scaleItem ? todayDateMaps[scaleItem.type] : null;
46
46
  const rowRest = fullAllDataRowIdData[rowid] || {};
@@ -86,6 +86,8 @@ export default defineVxeComponent({
86
86
  type: viewType,
87
87
  scaleType: scaleUnit,
88
88
  dateObj,
89
+ startDateObj,
90
+ endDateObj,
89
91
  row,
90
92
  column,
91
93
  $rowIndex,
@@ -28,6 +28,8 @@ export default defineVxeComponent({
28
28
  const { headerGroups, viewCellWidth } = reactData;
29
29
  const { todayDateMaps, visibleColumn } = internalData;
30
30
  const taskViewOpts = $xeGantt.computeTaskViewOpts;
31
+ const minScale = $xeGantt.computeMinScale;
32
+ const scaleStep = $xeGantt.computeScaleStep;
31
33
  const { showNowLine } = taskViewOpts;
32
34
  return h('div', {
33
35
  ref: 'refElem',
@@ -64,17 +66,31 @@ export default defineVxeComponent({
64
66
  return h('tr', {
65
67
  key: $rowIndex
66
68
  }, columns.map((column, cIndex) => {
67
- const { field, childCount, dateObj } = column;
69
+ const { field, childCount, dateObj, startDateObj, endDateObj } = column;
68
70
  let label = `${column.title}`;
69
- if (scaleItem.type === 'day') {
70
- label = getI18n(`vxe.gantt.dayss.w${dateObj.e}`);
71
+ if ((isLast || (minScale && (minScale.type === 'date' || minScale.type === 'day') && (type === 'date' || type === 'day'))) && scaleStep > 1) {
72
+ label = getI18n(`vxe.gantt.stepFormat.${type}`, {
73
+ start: startDateObj,
74
+ end: endDateObj,
75
+ eStartLabel: getI18n(`vxe.gantt.dayss.w${startDateObj.e}`),
76
+ eEndLabel: getI18n(`vxe.gantt.dayss.w${endDateObj.e}`)
77
+ });
71
78
  }
72
79
  else {
73
- if ($rowIndex) {
74
- label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj);
80
+ if (type === 'day') {
81
+ if ($rowIndex) {
82
+ label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, {
83
+ eLabel: getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
84
+ });
85
+ }
86
+ else {
87
+ label = getI18n(`vxe.gantt.tFullFormat.${type}`, {
88
+ eLabel: getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
89
+ });
90
+ }
75
91
  }
76
92
  else {
77
- if (isLast && scaleItem.type === 'week') {
93
+ if ($rowIndex) {
78
94
  label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj);
79
95
  }
80
96
  else {
@@ -83,7 +99,17 @@ export default defineVxeComponent({
83
99
  }
84
100
  }
85
101
  let cellVNs = label;
86
- const ctParams = { source: sourceType, type: viewType, column, scaleObj: scaleItem, title: label, dateObj: dateObj, $rowIndex };
102
+ const ctParams = {
103
+ source: sourceType,
104
+ type: viewType,
105
+ column,
106
+ scaleObj: scaleItem,
107
+ title: label,
108
+ dateObj,
109
+ startDateObj,
110
+ endDateObj,
111
+ $rowIndex
112
+ };
87
113
  if (titleSlot) {
88
114
  cellVNs = $xeGantt.callSlot(titleSlot, ctParams, h);
89
115
  }
@@ -117,6 +117,8 @@ function handleColumnHeader($xeGanttView) {
117
117
  const minScale = $xeGantt.computeMinScale;
118
118
  const weekScale = $xeGantt.computeWeekScale;
119
119
  const scaleDateList = $xeGanttView.computeScaleDateList;
120
+ const scaleStep = $xeGantt.computeScaleStep;
121
+ const weekStartDay = weekScale ? weekScale.startDay : undefined;
120
122
  const fullCols = [];
121
123
  const groupCols = [];
122
124
  if (minScale && scaleUnit && scaleDateList.length) {
@@ -162,65 +164,88 @@ function handleColumnHeader($xeGanttView) {
162
164
  currGpCol.children.push(minCol);
163
165
  }
164
166
  };
165
- for (let i = 0; i < scaleDateList.length; i++) {
166
- const itemDate = scaleDateList[i];
167
- let [yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss] = XEUtils.toDateString(itemDate, 'yy-yyyy-M-MM-d-dd-H-HH-m-mm-s-ss').split('-');
168
- const e = itemDate.getDay();
167
+ const createDateObj = (date) => {
168
+ 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('-');
169
+ const e = date.getDay();
169
170
  const E = e + 1;
170
- const q = Math.ceil((itemDate.getMonth() + 1) / 3);
171
- const W = `${XEUtils.getYearWeek(itemDate, weekScale ? weekScale.startDay : undefined)}`;
171
+ const q = Math.ceil((date.getMonth() + 1) / 3);
172
+ const W = `${XEUtils.getYearWeek(date, weekScale ? weekScale.startDay : undefined)}`;
172
173
  const WW = XEUtils.padStart(W, 2, '0');
173
174
  if (isMinWeek && checkWeekOfsetYear(W, M)) {
174
175
  yyyy = `${Number(yyyy) + 1}`;
175
176
  M = '1';
176
177
  MM = '0' + M;
177
178
  }
178
- const dateObj = { date: itemDate, yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss, q, W, WW, E, e };
179
+ return { date, yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss, q, W, WW, E, e };
180
+ };
181
+ for (let i = 0; i < scaleDateList.length; i++) {
182
+ const itemDate = scaleDateList[i];
183
+ const dateObj = createDateObj(itemDate);
184
+ const { yyyy, MM, dd, HH, mm, ss, q, W, E } = dateObj;
185
+ const startDateObj = dateObj;
179
186
  const colMaps = {
180
187
  year: {
181
188
  field: yyyy,
182
189
  title: yyyy,
183
- dateObj
190
+ dateObj,
191
+ startDateObj,
192
+ endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatYear(itemDate, scaleStep - 1)) : startDateObj
184
193
  },
185
194
  quarter: {
186
195
  field: `${yyyy}_q${q}`,
187
196
  title: `${q}`,
188
- dateObj
197
+ dateObj,
198
+ startDateObj,
199
+ endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatQuarter(itemDate, scaleStep - 1)) : startDateObj
189
200
  },
190
201
  month: {
191
202
  field: `${yyyy}_${MM}`,
192
203
  title: MM,
193
- dateObj
204
+ dateObj,
205
+ startDateObj,
206
+ endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatMonth(itemDate, scaleStep - 1)) : startDateObj
194
207
  },
195
208
  week: {
196
209
  field: `${yyyy}_W${W}`,
197
210
  title: `${W}`,
198
- dateObj
211
+ dateObj,
212
+ startDateObj,
213
+ endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatWeek(itemDate, scaleStep - 1, weekStartDay, weekStartDay)) : startDateObj
199
214
  },
200
215
  day: {
201
216
  field: `${yyyy}_${MM}_${dd}_E${E}`,
202
217
  title: `${E}`,
203
- dateObj
218
+ dateObj,
219
+ startDateObj,
220
+ endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
204
221
  },
205
222
  date: {
206
223
  field: `${yyyy}_${MM}_${dd}`,
207
224
  title: dd,
208
- dateObj
225
+ dateObj,
226
+ startDateObj,
227
+ endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
209
228
  },
210
229
  hour: {
211
230
  field: `${yyyy}_${MM}_${dd}_${HH}`,
212
231
  title: HH,
213
- dateObj
232
+ dateObj,
233
+ startDateObj,
234
+ endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatHours(itemDate, scaleStep - 1)) : startDateObj
214
235
  },
215
236
  minute: {
216
237
  field: `${yyyy}_${MM}_${dd}_${HH}_${mm}`,
217
238
  title: mm,
218
- dateObj
239
+ dateObj,
240
+ startDateObj,
241
+ endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatMinutes(itemDate, scaleStep - 1)) : startDateObj
219
242
  },
220
243
  second: {
221
244
  field: `${yyyy}_${MM}_${dd}_${HH}_${mm}_${ss}`,
222
245
  title: ss,
223
- dateObj
246
+ dateObj,
247
+ startDateObj,
248
+ endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatSeconds(itemDate, scaleStep - 1)) : startDateObj
224
249
  }
225
250
  };
226
251
  const minCol = colMaps[minScale.type];
@@ -324,7 +349,7 @@ function createChartRender($xeGanttView, fullCols) {
324
349
  let currStep = scaleStep - 1;
325
350
  while (currStep) {
326
351
  const currStr = XEUtils.toDateString(XEUtils.getWhatYear(dateObj.date, scaleStep - currStep), renderFormat);
327
- indexMaps[currStr] = i + currRatio;
352
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
328
353
  currStep--;
329
354
  }
330
355
  }
@@ -370,7 +395,7 @@ function createChartRender($xeGanttView, fullCols) {
370
395
  let currStep = scaleStep - 1;
371
396
  while (currStep) {
372
397
  const currStr = XEUtils.toDateString(XEUtils.getWhatQuarter(dateObj.date, scaleStep - currStep), renderFormat);
373
- indexMaps[currStr] = i + currRatio;
398
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
374
399
  currStep--;
375
400
  }
376
401
  }
@@ -416,7 +441,7 @@ function createChartRender($xeGanttView, fullCols) {
416
441
  let currStep = scaleStep - 1;
417
442
  while (currStep) {
418
443
  const currStr = XEUtils.toDateString(XEUtils.getWhatMonth(dateObj.date, scaleStep - currStep), renderFormat);
419
- indexMaps[currStr] = i + currRatio;
444
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
420
445
  currStep--;
421
446
  }
422
447
  }
@@ -468,7 +493,7 @@ function createChartRender($xeGanttView, fullCols) {
468
493
  yyyy = `${Number(yyyy) + 1}`;
469
494
  }
470
495
  const currStr = `${yyyy}-${W}`;
471
- indexMaps[currStr] = i + currRatio;
496
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
472
497
  currStep--;
473
498
  }
474
499
  }
@@ -515,7 +540,7 @@ function createChartRender($xeGanttView, fullCols) {
515
540
  let currStep = scaleStep - 1;
516
541
  while (currStep) {
517
542
  const currStr = XEUtils.toDateString(XEUtils.getWhatDay(dateObj.date, scaleStep - currStep), renderFormat);
518
- indexMaps[currStr] = i + currRatio;
543
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
519
544
  currStep--;
520
545
  }
521
546
  }
@@ -558,7 +583,7 @@ function createChartRender($xeGanttView, fullCols) {
558
583
  let currStep = scaleStep - 1;
559
584
  while (currStep) {
560
585
  const currStr = XEUtils.toDateString(XEUtils.getWhatHours(dateObj.date, scaleStep - currStep), renderFormat);
561
- indexMaps[currStr] = i + currRatio;
586
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
562
587
  currStep--;
563
588
  }
564
589
  }
@@ -601,7 +626,7 @@ function createChartRender($xeGanttView, fullCols) {
601
626
  let currStep = scaleStep - 1;
602
627
  while (currStep) {
603
628
  const currStr = XEUtils.toDateString(XEUtils.getWhatMinutes(dateObj.date, scaleStep - currStep), renderFormat);
604
- indexMaps[currStr] = i + currRatio;
629
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio);
605
630
  currStep--;
606
631
  }
607
632
  }
@@ -644,7 +669,7 @@ function createChartRender($xeGanttView, fullCols) {
644
669
  let currStep = scaleStep - 1;
645
670
  while (currStep) {
646
671
  const yyyyMM = XEUtils.toDateString(XEUtils.getWhatSeconds(dateObj.date, scaleStep - currStep), renderFormat);
647
- indexMaps[yyyyMM] = i + currRatio;
672
+ indexMaps[yyyyMM] = i + ((scaleStep - currStep) * currRatio);
648
673
  currStep--;
649
674
  }
650
675
  }
@@ -1518,7 +1543,7 @@ export default defineVxeComponent({
1518
1543
  let rightSize = ganttReactData.currRightSpacing + XEUtils.toNumber(gridding ? gridding.rightSpacing || 0 : 0);
1519
1544
  if (scaleStep > 0) {
1520
1545
  leftSize *= scaleStep;
1521
- rightSize *= rightSize;
1546
+ rightSize *= scaleStep;
1522
1547
  }
1523
1548
  switch (type) {
1524
1549
  case 'year': {
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { setConfig, setIcon } = VxeUI;
3
- VxeUI.ganttVersion = "3.6.6";
3
+ VxeUI.ganttVersion = "3.6.8";
4
4
  const ymdFormat = 'yyyy-MM-dd';
5
5
  const ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
6
6
  setConfig({
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.6.6"}`;
3
+ const ganttVersion = `gantt v${"3.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}` : '';
@@ -58,7 +58,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
58
58
  var _ref = headerGroups[headerGroups.length - 1] || {},
59
59
  scaleItem = _ref.scaleItem;
60
60
  var field = column.field,
61
- dateObj = column.dateObj;
61
+ dateObj = column.dateObj,
62
+ startDateObj = column.startDateObj,
63
+ endDateObj = column.endDateObj;
62
64
  var _ref2 = viewStyle || {},
63
65
  cellClassName = _ref2.cellClassName,
64
66
  cellStyle = _ref2.cellStyle;
@@ -110,6 +112,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
110
112
  type: viewType,
111
113
  scaleType: scaleUnit,
112
114
  dateObj: dateObj,
115
+ startDateObj: startDateObj,
116
+ endDateObj: endDateObj,
113
117
  row: row,
114
118
  column: column,
115
119
  $rowIndex: $rowIndex,
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_util=require("./util"),_utils=require("../../ui/src/utils"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ganttChart=_interopRequireDefault(require("./gantt-chart"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var sourceType="gantt",viewType="body",_default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeGanttViewBody",inject:{$xeGantt:{default:null},$xeGanttView:{default:null}},computed:Object.assign({},{}),methods:{renderColumn:function(e,t,r,n,o,a,l,i,c){var s,u=this.$xeGanttView,d=this.$xeGantt,p=u.reactData,w=t.resizeHeightFlag,y=t.fullAllDataRowIdData,f=t.visibleColumn,m=t.computeCellOpts,v=t.computeRowOpts,g=t.computeResizableOpts.isAllRowDrag,p=p.headerGroups,u=u.internalData.todayDateMaps,h=d.computeTaskViewOpts,x=h.showNowLine,b=d.computeScaleUnit,p=(p[p.length-1]||{}).scaleItem,_=i.field,R=i.dateObj,h=h.viewStyle||{},T=h.cellClassName,h=h.cellStyle,u=x&&p?u[p.type]:null,p=y[n]||{},y=w?(0,_util.getCellRestHeight)(p,m,v,t.computeDefaultRowHeight):0,w=[],C=(g&&v.resizable&&(s={$table:t,$grid:null,$gantt:d,seq:-1,rowid:n,row:r,rowIndex:o,$rowIndex:a,_rowIndex:l,column:f[0],columnIndex:0,$columnIndex:0,_columnIndex:0,fixed:"",source:sourceType,type:viewType,isHidden:!1,isEdit:!1,level:-1,visibleData:[],data:[],items:[]},w.push(e("div",{class:"vxe-gantt-view-cell--row-resizable",on:{mousedown:function(e){return t.handleRowResizeMousedownEvent(e,s)},dblclick:function(e){return t.handleRowResizeDblclickEvent(e,s)}}}))),{$gantt:d,source:sourceType,type:viewType,scaleType:b,dateObj:R,row:r,column:i,$rowIndex:a,rowIndex:o,_rowIndex:l});return e("td",{key:T||h?_:c,class:["vxe-gantt-view--body-column",{"is--now":x&&u===_},(0,_utils.getClass)(T,C)],style:h?Object.assign({},_xeUtils.default.isFunction(h)?h(C):h,{height:"".concat(y,"px")}):{height:"".concat(y,"px")},on:{click:function(e){d.handleTaskCellClickEvent(e,{row:r,column:i})},dblclick:function(e){d.handleTaskCellDblclickEvent(e,{row:r,column:i})},contextmenu:function(e){d.handleTaskBodyContextmenuEvent(e,C)}}},w)},renderRows:function(c,s,e){var u=this,t=u.$xeGanttView,d=u.$xeGantt,t=t.reactData,p=s.treeConfig,w=s.stripe,y=s.highlightHoverRow,f=s.editConfig,m=s.treeExpandedFlag,v=s.selectRadioRow,g=s.pendingRowFlag,h=s.isRowGroupStatus,x=s.fullAllDataRowIdData,b=s.treeExpandedMaps,_=s.pendingRowMaps,R=s.computeRadioOpts,T=s.computeCheckboxOpts,C=s.computeRowOpts,r=s.computeTreeOpts,S=r.transform,D=r.children||r.childrenField,I=d.computeScaleUnit,r=d.computeTaskViewOpts.viewStyle||{},$=r.rowClassName,k=r.rowStyle,A=r.cellClassName,E=r.cellStyle,O=t.tableColumn,B=t.scrollYLoad,G=[];return e.forEach(function(r,n){var o=s.getRowid(r),e=x[o]||{},t={},a=n,l=-1,e=(e&&(a=e.index,l=e._index),!1),i=(f&&(e=s.isInsertByRow(r)),(C.isHover||y)&&(t.mouseenter=function(e){s.triggerHoverEvent(e,{row:r,rowIndex:a})},t.mouseleave=function(){s.clearHoverRow()}),!C.drag||h||p&&!S||(t.dragstart=s.handleRowDragDragstartEvent,t.dragend=s.handleRowDragDragendEvent,t.dragover=s.handleRowDragDragoverEvent),{$gantt:d,source:sourceType,type:viewType,scaleType:I,row:r,rowIndex:a,$rowIndex:n,_rowIndex:l}),e=(G.push(c("tr",{key:$||k||A||E?o:n,class:["vxe-gantt-view--body-row",{"row--stripe":w&&(l+1)%2==0,"is--new":e,"row--radio":R.highlight&&s.eqRow(v,r),"row--checked":T.highlight&&s.isCheckedByCheckboxRow(r),"row--pending":!!g&&!!_[o]},(0,_utils.getClass)($,i)],style:k?_xeUtils.default.isFunction(k)?k(i)||void 0:k:void 0,attrs:{rowid:o},on:t},O.map(function(e,t){return u.renderColumn(c,s,r,o,a,n,l,e,t)}))),!1),i=[];!p||B||S||(i=r[D],e=!!m&&i&&0<i.length&&!!b[o]),e&&G.push.apply(G,_toConsumableArray(u.renderRows(c,s,i)))}),G},renderVN:function(r){var t=this.$xeGantt,e=this.$xeGanttView,n=e.reactData,o=e.internalData.xeTable,a=n.tableData,l=n.tableColumn,i=n.viewCellWidth;return r("div",{ref:"refElem",class:"vxe-gantt-view--body-wrapper"},[r("div",{ref:"refBodyScroll",class:"vxe-gantt-view--body-inner-wrapper",on:{scroll:e.triggerBodyScrollEvent,contextmenu:function(e){t.handleTaskBodyContextmenuEvent(e,{source:sourceType,type:viewType,rowIndex:-1,$rowIndex:-1,_rowIndex:-1})}}},[r("div",{ref:"refBodyXSpace",class:"vxe-body--x-space"}),r("div",{ref:"refBodyYSpace",class:"vxe-body--y-space"}),r("table",{ref:"refBodyTable",class:"vxe-gantt-view--body-table"},[r("colgroup",{},l.map(function(e,t){return r("col",{key:t,style:{width:"".concat(i,"px")}})})),r("tbody",{},o?this.renderRows(r,o,a):[])]),r(_ganttChart.default)])])}},mounted:function(){var e=this,t=e.$xeGanttView.internalData.elemStore,r="main-body-";t["".concat(r,"wrapper")]=e.$refs.refElem,t["".concat(r,"scroll")]=e.$refs.refBodyScroll,t["".concat(r,"table")]=e.$refs.refBodyTable,t["".concat(r,"xSpace")]=e.$refs.refBodyXSpace,t["".concat(r,"ySpace")]=e.$refs.refBodyYSpace},destroyed:function(){var e=this.$xeGanttView.internalData.elemStore,t="main-body-";e["".concat(t,"wrapper")]=null,e["".concat(t,"scroll")]=null,e["".concat(t,"table")]=null,e["".concat(t,"xSpace")]=null,e["".concat(t,"ySpace")]=null},render:function(e){return this.renderVN(e)}});
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_util=require("./util"),_utils=require("../../ui/src/utils"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ganttChart=_interopRequireDefault(require("./gantt-chart"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}var sourceType="gantt",viewType="body",_default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeGanttViewBody",inject:{$xeGantt:{default:null},$xeGanttView:{default:null}},computed:Object.assign({},{}),methods:{renderColumn:function(e,t,r,a,n,o,l,i,c){var s,u=this.$xeGanttView,d=this.$xeGantt,p=u.reactData,w=t.resizeHeightFlag,y=t.fullAllDataRowIdData,f=t.visibleColumn,m=t.computeCellOpts,v=t.computeRowOpts,g=t.computeResizableOpts.isAllRowDrag,p=p.headerGroups,u=u.internalData.todayDateMaps,h=d.computeTaskViewOpts,x=h.showNowLine,b=d.computeScaleUnit,p=(p[p.length-1]||{}).scaleItem,_=i.field,R=i.dateObj,D=i.startDateObj,T=i.endDateObj,h=h.viewStyle||{},C=h.cellClassName,h=h.cellStyle,u=x&&p?u[p.type]:null,p=y[a]||{},y=w?(0,_util.getCellRestHeight)(p,m,v,t.computeDefaultRowHeight):0,w=[],S=(g&&v.resizable&&(s={$table:t,$grid:null,$gantt:d,seq:-1,rowid:a,row:r,rowIndex:n,$rowIndex:o,_rowIndex:l,column:f[0],columnIndex:0,$columnIndex:0,_columnIndex:0,fixed:"",source:sourceType,type:viewType,isHidden:!1,isEdit:!1,level:-1,visibleData:[],data:[],items:[]},w.push(e("div",{class:"vxe-gantt-view-cell--row-resizable",on:{mousedown:function(e){return t.handleRowResizeMousedownEvent(e,s)},dblclick:function(e){return t.handleRowResizeDblclickEvent(e,s)}}}))),{$gantt:d,source:sourceType,type:viewType,scaleType:b,dateObj:R,startDateObj:D,endDateObj:T,row:r,column:i,$rowIndex:o,rowIndex:n,_rowIndex:l});return e("td",{key:C||h?_:c,class:["vxe-gantt-view--body-column",{"is--now":x&&u===_},(0,_utils.getClass)(C,S)],style:h?Object.assign({},_xeUtils.default.isFunction(h)?h(S):h,{height:"".concat(y,"px")}):{height:"".concat(y,"px")},on:{click:function(e){d.handleTaskCellClickEvent(e,{row:r,column:i})},dblclick:function(e){d.handleTaskCellDblclickEvent(e,{row:r,column:i})},contextmenu:function(e){d.handleTaskBodyContextmenuEvent(e,S)}}},w)},renderRows:function(c,s,e){var u=this,t=u.$xeGanttView,d=u.$xeGantt,t=t.reactData,p=s.treeConfig,w=s.stripe,y=s.highlightHoverRow,f=s.editConfig,m=s.treeExpandedFlag,v=s.selectRadioRow,g=s.pendingRowFlag,h=s.isRowGroupStatus,x=s.fullAllDataRowIdData,b=s.treeExpandedMaps,_=s.pendingRowMaps,R=s.computeRadioOpts,D=s.computeCheckboxOpts,T=s.computeRowOpts,r=s.computeTreeOpts,C=r.transform,S=r.children||r.childrenField,I=d.computeScaleUnit,r=d.computeTaskViewOpts.viewStyle||{},$=r.rowClassName,k=r.rowStyle,A=r.cellClassName,O=r.cellStyle,E=t.tableColumn,B=t.scrollYLoad,G=[];return e.forEach(function(r,a){var n=s.getRowid(r),e=x[n]||{},t={},o=a,l=-1,e=(e&&(o=e.index,l=e._index),!1),i=(f&&(e=s.isInsertByRow(r)),(T.isHover||y)&&(t.mouseenter=function(e){s.triggerHoverEvent(e,{row:r,rowIndex:o})},t.mouseleave=function(){s.clearHoverRow()}),!T.drag||h||p&&!C||(t.dragstart=s.handleRowDragDragstartEvent,t.dragend=s.handleRowDragDragendEvent,t.dragover=s.handleRowDragDragoverEvent),{$gantt:d,source:sourceType,type:viewType,scaleType:I,row:r,rowIndex:o,$rowIndex:a,_rowIndex:l}),e=(G.push(c("tr",{key:$||k||A||O?n:a,class:["vxe-gantt-view--body-row",{"row--stripe":w&&(l+1)%2==0,"is--new":e,"row--radio":R.highlight&&s.eqRow(v,r),"row--checked":D.highlight&&s.isCheckedByCheckboxRow(r),"row--pending":!!g&&!!_[n]},(0,_utils.getClass)($,i)],style:k?_xeUtils.default.isFunction(k)?k(i)||void 0:k:void 0,attrs:{rowid:n},on:t},E.map(function(e,t){return u.renderColumn(c,s,r,n,o,a,l,e,t)}))),!1),i=[];!p||B||C||(i=r[S],e=!!m&&i&&0<i.length&&!!b[n]),e&&G.push.apply(G,_toConsumableArray(u.renderRows(c,s,i)))}),G},renderVN:function(r){var t=this.$xeGantt,e=this.$xeGanttView,a=e.reactData,n=e.internalData.xeTable,o=a.tableData,l=a.tableColumn,i=a.viewCellWidth;return r("div",{ref:"refElem",class:"vxe-gantt-view--body-wrapper"},[r("div",{ref:"refBodyScroll",class:"vxe-gantt-view--body-inner-wrapper",on:{scroll:e.triggerBodyScrollEvent,contextmenu:function(e){t.handleTaskBodyContextmenuEvent(e,{source:sourceType,type:viewType,rowIndex:-1,$rowIndex:-1,_rowIndex:-1})}}},[r("div",{ref:"refBodyXSpace",class:"vxe-body--x-space"}),r("div",{ref:"refBodyYSpace",class:"vxe-body--y-space"}),r("table",{ref:"refBodyTable",class:"vxe-gantt-view--body-table"},[r("colgroup",{},l.map(function(e,t){return r("col",{key:t,style:{width:"".concat(i,"px")}})})),r("tbody",{},n?this.renderRows(r,n,o):[])]),r(_ganttChart.default)])])}},mounted:function(){var e=this,t=e.$xeGanttView.internalData.elemStore,r="main-body-";t["".concat(r,"wrapper")]=e.$refs.refElem,t["".concat(r,"scroll")]=e.$refs.refBodyScroll,t["".concat(r,"table")]=e.$refs.refBodyTable,t["".concat(r,"xSpace")]=e.$refs.refBodyXSpace,t["".concat(r,"ySpace")]=e.$refs.refBodyYSpace},destroyed:function(){var e=this.$xeGanttView.internalData.elemStore,t="main-body-";e["".concat(t,"wrapper")]=null,e["".concat(t,"scroll")]=null,e["".concat(t,"table")]=null,e["".concat(t,"xSpace")]=null,e["".concat(t,"ySpace")]=null},render:function(e){return this.renderVN(e)}});
@@ -37,6 +37,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
37
37
  var todayDateMaps = internalData.todayDateMaps,
38
38
  visibleColumn = internalData.visibleColumn;
39
39
  var taskViewOpts = $xeGantt.computeTaskViewOpts;
40
+ var minScale = $xeGantt.computeMinScale;
41
+ var scaleStep = $xeGantt.computeScaleStep;
40
42
  var showNowLine = taskViewOpts.showNowLine;
41
43
  return h('div', {
42
44
  ref: 'refElem',
@@ -76,15 +78,30 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
76
78
  }, columns.map(function (column, cIndex) {
77
79
  var field = column.field,
78
80
  childCount = column.childCount,
79
- dateObj = column.dateObj;
81
+ dateObj = column.dateObj,
82
+ startDateObj = column.startDateObj,
83
+ endDateObj = column.endDateObj;
80
84
  var label = "".concat(column.title);
81
- if (scaleItem.type === 'day') {
82
- label = getI18n("vxe.gantt.dayss.w".concat(dateObj.e));
85
+ if ((isLast || minScale && (minScale.type === 'date' || minScale.type === 'day') && (type === 'date' || type === 'day')) && scaleStep > 1) {
86
+ label = getI18n("vxe.gantt.stepFormat.".concat(type), {
87
+ start: startDateObj,
88
+ end: endDateObj,
89
+ eStartLabel: getI18n("vxe.gantt.dayss.w".concat(startDateObj.e)),
90
+ eEndLabel: getI18n("vxe.gantt.dayss.w".concat(endDateObj.e))
91
+ });
83
92
  } else {
84
- if ($rowIndex) {
85
- label = getI18n("vxe.gantt.tSimpleFormat.".concat(type), dateObj);
93
+ if (type === 'day') {
94
+ if ($rowIndex) {
95
+ label = getI18n("vxe.gantt.tSimpleFormat.".concat(type), {
96
+ eLabel: getI18n("vxe.gantt.dayss.w".concat(dateObj.e))
97
+ });
98
+ } else {
99
+ label = getI18n("vxe.gantt.tFullFormat.".concat(type), {
100
+ eLabel: getI18n("vxe.gantt.dayss.w".concat(dateObj.e))
101
+ });
102
+ }
86
103
  } else {
87
- if (isLast && scaleItem.type === 'week') {
104
+ if ($rowIndex) {
88
105
  label = getI18n("vxe.gantt.tSimpleFormat.".concat(type), dateObj);
89
106
  } else {
90
107
  label = getI18n("vxe.gantt.tFullFormat.".concat(type), dateObj);
@@ -99,6 +116,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
99
116
  scaleObj: scaleItem,
100
117
  title: label,
101
118
  dateObj: dateObj,
119
+ startDateObj: startDateObj,
120
+ endDateObj: endDateObj,
102
121
  $rowIndex: $rowIndex
103
122
  };
104
123
  if (titleSlot) {
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_core=require("@vxe-ui/core"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var getI18n=_core.VxeUI.getI18n,sourceType="gantt",viewType="header",_default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeGanttViewHeader",inject:{$xeGantt:{default:null},$xeGanttView:{default:null}},computed:Object.assign({},{}),methods:{renderVN:function(h){var w=this.$xeGantt,e=this.$xeGanttView,t=e.reactData,a=e.internalData,n=t.headerGroups,r=t.viewCellWidth,l=a.todayDateMaps,t=a.visibleColumn,y=w.computeTaskViewOpts.showNowLine;return h("div",{ref:"refElem",class:"vxe-gantt-view--header-wrapper"},[h("div",{ref:"refHeaderScroll",class:"vxe-gantt-view--header-inner-wrapper",on:{scroll:e.triggerHeaderScrollEvent}},[h("div",{ref:"refHeaderXSpace",class:"vxe-body--x-space"}),h("table",{ref:"refHeaderTable",class:"vxe-gantt-view--header-table"},[h("colgroup",{},t.map(function(e,t){return h("col",{key:t,style:{width:"".concat(r,"px")}})})),h("thead",{},n.map(function(e,i){var u=e.scaleItem,e=e.columns,s=u.type,d=u.titleFormat,p=u.titleMethod,f=u.headerCellStyle,t=u.slots,v=t?t.title:null,x=i===n.length-1,m=x&&y?l[s]:null;return h("tr",{key:i},e.map(function(e,t){var a=e.field,n=e.childCount,r=e.dateObj,l="".concat(e.title),o=l="day"===u.type?getI18n("vxe.gantt.dayss.w".concat(r.e)):i||x&&"week"===u.type?getI18n("vxe.gantt.tSimpleFormat.".concat(s),r):getI18n("vxe.gantt.tFullFormat.".concat(s),r),c={source:sourceType,type:viewType,column:e,scaleObj:u,title:l,dateObj:r,$rowIndex:i},e=(v?o=w.callSlot(v,c,h):p?o="".concat(p(c)):d&&(o=_xeUtils.default.toDateString(r.date,d)),{});return f&&(e=_xeUtils.default.isFunction(f)?f(c)||null:f),h("th",{key:t,class:["vxe-gantt-view--header-column",{"is--now":y&&m&&m===a}],attrs:{colspan:n||null,title:v?null:l},style:e||void 0,on:{contextmenu:function(e){w.handleTaskHeaderContextmenuEvent(e,c)}}},o)}))}))])])])}},mounted:function(){var e=this,t=e.$xeGanttView.internalData.elemStore,a="main-header-";t["".concat(a,"wrapper")]=e.$refs.refElem,t["".concat(a,"scroll")]=e.$refs.refHeaderScroll,t["".concat(a,"table")]=e.$refs.refHeaderTable,t["".concat(a,"xSpace")]=e.$refs.refHeaderXSpace},destroyed:function(){var e=this.$xeGanttView.internalData.elemStore,t="main-header-";e["".concat(t,"wrapper")]=null,e["".concat(t,"scroll")]=null,e["".concat(t,"table")]=null,e["".concat(t,"xSpace")]=null},render:function(e){return this.renderVN(e)}});
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../ui/src/comp"),_core=require("@vxe-ui/core"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var getI18n=_core.VxeUI.getI18n,sourceType="gantt",viewType="header",_default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeGanttViewHeader",inject:{$xeGantt:{default:null},$xeGanttView:{default:null}},computed:Object.assign({},{}),methods:{renderVN:function(h){var y=this.$xeGantt,e=this.$xeGanttView,t=e.reactData,a=e.internalData,n=t.headerGroups,r=t.viewCellWidth,l=a.todayDateMaps,t=a.visibleColumn,a=y.computeTaskViewOpts,b=y.computeMinScale,S=y.computeScaleStep,_=a.showNowLine;return h("div",{ref:"refElem",class:"vxe-gantt-view--header-wrapper"},[h("div",{ref:"refHeaderScroll",class:"vxe-gantt-view--header-inner-wrapper",on:{scroll:e.triggerHeaderScrollEvent}},[h("div",{ref:"refHeaderXSpace",class:"vxe-body--x-space"}),h("table",{ref:"refHeaderTable",class:"vxe-gantt-view--header-table"},[h("colgroup",{},t.map(function(e,t){return h("col",{key:t,style:{width:"".concat(r,"px")}})})),h("thead",{},n.map(function(e,s){var u=e.scaleItem,e=e.columns,p=u.type,f=u.titleFormat,v=u.titleMethod,x=u.headerCellStyle,t=u.slots,m=t?t.title:null,w=s===n.length-1,g=w&&_?l[p]:null;return h("tr",{key:s},e.map(function(e,t){var a=e.field,n=e.childCount,r=e.dateObj,l=e.startDateObj,o=e.endDateObj,c="".concat(e.title),i=c=(w||b&&("date"===b.type||"day"===b.type)&&("date"===p||"day"===p))&&1<S?getI18n("vxe.gantt.stepFormat.".concat(p),{start:l,end:o,eStartLabel:getI18n("vxe.gantt.dayss.w".concat(l.e)),eEndLabel:getI18n("vxe.gantt.dayss.w".concat(o.e))}):getI18n((s?"vxe.gantt.tSimpleFormat.":"vxe.gantt.tFullFormat.").concat(p),"day"===p?{eLabel:getI18n("vxe.gantt.dayss.w".concat(r.e))}:r),d={source:sourceType,type:viewType,column:e,scaleObj:u,title:c,dateObj:r,startDateObj:l,endDateObj:o,$rowIndex:s},e=(m?i=y.callSlot(m,d,h):v?i="".concat(v(d)):f&&(i=_xeUtils.default.toDateString(r.date,f)),{});return x&&(e=_xeUtils.default.isFunction(x)?x(d)||null:x),h("th",{key:t,class:["vxe-gantt-view--header-column",{"is--now":_&&g&&g===a}],attrs:{colspan:n||null,title:m?null:c},style:e||void 0,on:{contextmenu:function(e){y.handleTaskHeaderContextmenuEvent(e,d)}}},i)}))}))])])])}},mounted:function(){var e=this,t=e.$xeGanttView.internalData.elemStore,a="main-header-";t["".concat(a,"wrapper")]=e.$refs.refElem,t["".concat(a,"scroll")]=e.$refs.refHeaderScroll,t["".concat(a,"table")]=e.$refs.refHeaderTable,t["".concat(a,"xSpace")]=e.$refs.refHeaderXSpace},destroyed:function(){var e=this.$xeGanttView.internalData.elemStore,t="main-header-";e["".concat(t,"wrapper")]=null,e["".concat(t,"scroll")]=null,e["".concat(t,"table")]=null,e["".concat(t,"xSpace")]=null},render:function(e){return this.renderVN(e)}});
@@ -140,6 +140,8 @@ function handleColumnHeader($xeGanttView) {
140
140
  var minScale = $xeGantt.computeMinScale;
141
141
  var weekScale = $xeGantt.computeWeekScale;
142
142
  var scaleDateList = $xeGanttView.computeScaleDateList;
143
+ var scaleStep = $xeGantt.computeScaleStep;
144
+ var weekStartDay = weekScale ? weekScale.startDay : undefined;
143
145
  var fullCols = [];
144
146
  var groupCols = [];
145
147
  if (minScale && scaleUnit && scaleDateList.length) {
@@ -185,9 +187,8 @@ function handleColumnHeader($xeGanttView) {
185
187
  currGpCol.children.push(minCol);
186
188
  }
187
189
  };
188
- for (var i = 0; i < scaleDateList.length; i++) {
189
- var itemDate = scaleDateList[i];
190
- var _XEUtils$toDateString3 = _xeUtils.default.toDateString(itemDate, 'yy-yyyy-M-MM-d-dd-H-HH-m-mm-s-ss').split('-'),
190
+ var createDateObj = function createDateObj(date) {
191
+ var _XEUtils$toDateString3 = _xeUtils.default.toDateString(date, 'yy-yyyy-M-MM-d-dd-H-HH-m-mm-s-ss').split('-'),
191
192
  _XEUtils$toDateString4 = _slicedToArray(_XEUtils$toDateString3, 12),
192
193
  yy = _XEUtils$toDateString4[0],
193
194
  yyyy = _XEUtils$toDateString4[1],
@@ -201,18 +202,18 @@ function handleColumnHeader($xeGanttView) {
201
202
  mm = _XEUtils$toDateString4[9],
202
203
  s = _XEUtils$toDateString4[10],
203
204
  ss = _XEUtils$toDateString4[11];
204
- var e = itemDate.getDay();
205
+ var e = date.getDay();
205
206
  var E = e + 1;
206
- var q = Math.ceil((itemDate.getMonth() + 1) / 3);
207
- var W = "".concat(_xeUtils.default.getYearWeek(itemDate, weekScale ? weekScale.startDay : undefined));
207
+ var q = Math.ceil((date.getMonth() + 1) / 3);
208
+ var W = "".concat(_xeUtils.default.getYearWeek(date, weekScale ? weekScale.startDay : undefined));
208
209
  var WW = _xeUtils.default.padStart(W, 2, '0');
209
210
  if (isMinWeek && checkWeekOfsetYear(W, M)) {
210
211
  yyyy = "".concat(Number(yyyy) + 1);
211
212
  M = '1';
212
213
  MM = '0' + M;
213
214
  }
214
- var dateObj = {
215
- date: itemDate,
215
+ return {
216
+ date: date,
216
217
  yy: yy,
217
218
  yyyy: yyyy,
218
219
  M: M,
@@ -231,51 +232,83 @@ function handleColumnHeader($xeGanttView) {
231
232
  E: E,
232
233
  e: e
233
234
  };
235
+ };
236
+ for (var i = 0; i < scaleDateList.length; i++) {
237
+ var itemDate = scaleDateList[i];
238
+ var dateObj = createDateObj(itemDate);
239
+ var yyyy = dateObj.yyyy,
240
+ MM = dateObj.MM,
241
+ dd = dateObj.dd,
242
+ HH = dateObj.HH,
243
+ mm = dateObj.mm,
244
+ ss = dateObj.ss,
245
+ q = dateObj.q,
246
+ W = dateObj.W,
247
+ E = dateObj.E;
248
+ var startDateObj = dateObj;
234
249
  var colMaps = {
235
250
  year: {
236
251
  field: yyyy,
237
252
  title: yyyy,
238
- dateObj: dateObj
253
+ dateObj: dateObj,
254
+ startDateObj: startDateObj,
255
+ endDateObj: scaleStep > 1 ? createDateObj(_xeUtils.default.getWhatYear(itemDate, scaleStep - 1)) : startDateObj
239
256
  },
240
257
  quarter: {
241
258
  field: "".concat(yyyy, "_q").concat(q),
242
259
  title: "".concat(q),
243
- dateObj: dateObj
260
+ dateObj: dateObj,
261
+ startDateObj: startDateObj,
262
+ endDateObj: scaleStep > 1 ? createDateObj(_xeUtils.default.getWhatQuarter(itemDate, scaleStep - 1)) : startDateObj
244
263
  },
245
264
  month: {
246
265
  field: "".concat(yyyy, "_").concat(MM),
247
266
  title: MM,
248
- dateObj: dateObj
267
+ dateObj: dateObj,
268
+ startDateObj: startDateObj,
269
+ endDateObj: scaleStep > 1 ? createDateObj(_xeUtils.default.getWhatMonth(itemDate, scaleStep - 1)) : startDateObj
249
270
  },
250
271
  week: {
251
272
  field: "".concat(yyyy, "_W").concat(W),
252
273
  title: "".concat(W),
253
- dateObj: dateObj
274
+ dateObj: dateObj,
275
+ startDateObj: startDateObj,
276
+ endDateObj: scaleStep > 1 ? createDateObj(_xeUtils.default.getWhatWeek(itemDate, scaleStep - 1, weekStartDay, weekStartDay)) : startDateObj
254
277
  },
255
278
  day: {
256
279
  field: "".concat(yyyy, "_").concat(MM, "_").concat(dd, "_E").concat(E),
257
280
  title: "".concat(E),
258
- dateObj: dateObj
281
+ dateObj: dateObj,
282
+ startDateObj: startDateObj,
283
+ endDateObj: scaleStep > 1 ? createDateObj(_xeUtils.default.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
259
284
  },
260
285
  date: {
261
286
  field: "".concat(yyyy, "_").concat(MM, "_").concat(dd),
262
287
  title: dd,
263
- dateObj: dateObj
288
+ dateObj: dateObj,
289
+ startDateObj: startDateObj,
290
+ endDateObj: scaleStep > 1 ? createDateObj(_xeUtils.default.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
264
291
  },
265
292
  hour: {
266
293
  field: "".concat(yyyy, "_").concat(MM, "_").concat(dd, "_").concat(HH),
267
294
  title: HH,
268
- dateObj: dateObj
295
+ dateObj: dateObj,
296
+ startDateObj: startDateObj,
297
+ endDateObj: scaleStep > 1 ? createDateObj(_xeUtils.default.getWhatHours(itemDate, scaleStep - 1)) : startDateObj
269
298
  },
270
299
  minute: {
271
300
  field: "".concat(yyyy, "_").concat(MM, "_").concat(dd, "_").concat(HH, "_").concat(mm),
272
301
  title: mm,
273
- dateObj: dateObj
302
+ dateObj: dateObj,
303
+ startDateObj: startDateObj,
304
+ endDateObj: scaleStep > 1 ? createDateObj(_xeUtils.default.getWhatMinutes(itemDate, scaleStep - 1)) : startDateObj
274
305
  },
275
306
  second: {
276
307
  field: "".concat(yyyy, "_").concat(MM, "_").concat(dd, "_").concat(HH, "_").concat(mm, "_").concat(ss),
277
308
  title: ss,
278
- dateObj: dateObj
309
+ dateObj: dateObj,
310
+ startDateObj: startDateObj,
311
+ endDateObj: scaleStep > 1 ? createDateObj(_xeUtils.default.getWhatSeconds(itemDate, scaleStep - 1)) : startDateObj
279
312
  }
280
313
  };
281
314
  var minCol = colMaps[minScale.type];
@@ -381,7 +414,7 @@ function createChartRender($xeGanttView, fullCols) {
381
414
  var currStep = scaleStep - 1;
382
415
  while (currStep) {
383
416
  var _currStr = _xeUtils.default.toDateString(_xeUtils.default.getWhatYear(dateObj.date, scaleStep - currStep), renderFormat);
384
- indexMaps[_currStr] = i + currRatio;
417
+ indexMaps[_currStr] = i + (scaleStep - currStep) * currRatio;
385
418
  currStep--;
386
419
  }
387
420
  }
@@ -429,7 +462,7 @@ function createChartRender($xeGanttView, fullCols) {
429
462
  var currStep = scaleStep - 1;
430
463
  while (currStep) {
431
464
  var _currStr2 = _xeUtils.default.toDateString(_xeUtils.default.getWhatQuarter(dateObj.date, scaleStep - currStep), _renderFormat);
432
- _indexMaps[_currStr2] = i + currRatio;
465
+ _indexMaps[_currStr2] = i + (scaleStep - currStep) * currRatio;
433
466
  currStep--;
434
467
  }
435
468
  }
@@ -477,7 +510,7 @@ function createChartRender($xeGanttView, fullCols) {
477
510
  var currStep = scaleStep - 1;
478
511
  while (currStep) {
479
512
  var _currStr3 = _xeUtils.default.toDateString(_xeUtils.default.getWhatMonth(dateObj.date, scaleStep - currStep), _renderFormat2);
480
- _indexMaps2[_currStr3] = i + currRatio;
513
+ _indexMaps2[_currStr3] = i + (scaleStep - currStep) * currRatio;
481
514
  currStep--;
482
515
  }
483
516
  }
@@ -534,7 +567,7 @@ function createChartRender($xeGanttView, fullCols) {
534
567
  yyyy = "".concat(Number(yyyy) + 1);
535
568
  }
536
569
  var _currStr4 = "".concat(yyyy, "-").concat(W);
537
- _indexMaps3[_currStr4] = i + currRatio;
570
+ _indexMaps3[_currStr4] = i + (scaleStep - currStep) * currRatio;
538
571
  currStep--;
539
572
  }
540
573
  }
@@ -583,7 +616,7 @@ function createChartRender($xeGanttView, fullCols) {
583
616
  var currStep = scaleStep - 1;
584
617
  while (currStep) {
585
618
  var _currStr5 = _xeUtils.default.toDateString(_xeUtils.default.getWhatDay(dateObj.date, scaleStep - currStep), _renderFormat3);
586
- _indexMaps4[_currStr5] = i + currRatio;
619
+ _indexMaps4[_currStr5] = i + (scaleStep - currStep) * currRatio;
587
620
  currStep--;
588
621
  }
589
622
  }
@@ -628,7 +661,7 @@ function createChartRender($xeGanttView, fullCols) {
628
661
  var currStep = scaleStep - 1;
629
662
  while (currStep) {
630
663
  var _currStr6 = _xeUtils.default.toDateString(_xeUtils.default.getWhatHours(dateObj.date, scaleStep - currStep), _renderFormat4);
631
- _indexMaps5[_currStr6] = i + currRatio;
664
+ _indexMaps5[_currStr6] = i + (scaleStep - currStep) * currRatio;
632
665
  currStep--;
633
666
  }
634
667
  }
@@ -673,7 +706,7 @@ function createChartRender($xeGanttView, fullCols) {
673
706
  var currStep = scaleStep - 1;
674
707
  while (currStep) {
675
708
  var _currStr7 = _xeUtils.default.toDateString(_xeUtils.default.getWhatMinutes(dateObj.date, scaleStep - currStep), _renderFormat5);
676
- _indexMaps6[_currStr7] = i + currRatio;
709
+ _indexMaps6[_currStr7] = i + (scaleStep - currStep) * currRatio;
677
710
  currStep--;
678
711
  }
679
712
  }
@@ -718,7 +751,7 @@ function createChartRender($xeGanttView, fullCols) {
718
751
  var currStep = scaleStep - 1;
719
752
  while (currStep) {
720
753
  var _yyyyMM = _xeUtils.default.toDateString(_xeUtils.default.getWhatSeconds(dateObj.date, scaleStep - currStep), _renderFormat6);
721
- _indexMaps7[_yyyyMM] = i + currRatio;
754
+ _indexMaps7[_yyyyMM] = i + (scaleStep - currStep) * currRatio;
722
755
  currStep--;
723
756
  }
724
757
  }
@@ -1628,7 +1661,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
1628
1661
  var rightSize = ganttReactData.currRightSpacing + _xeUtils.default.toNumber(gridding ? gridding.rightSpacing || 0 : 0);
1629
1662
  if (scaleStep > 0) {
1630
1663
  leftSize *= scaleStep;
1631
- rightSize *= rightSize;
1664
+ rightSize *= scaleStep;
1632
1665
  }
1633
1666
  switch (type) {
1634
1667
  case 'year':