vxe-gantt 3.0.27 → 3.1.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/lib/index.umd.js CHANGED
@@ -8182,7 +8182,7 @@ var core_ = __webpack_require__(4345);
8182
8182
  ;// ./packages/ui/src/log.ts
8183
8183
 
8184
8184
  var log = core_.VxeUI.log;
8185
- var version = "gantt v".concat("3.0.27");
8185
+ var version = "gantt v".concat("3.1.1");
8186
8186
  var warnLog = log.create('warn', version);
8187
8187
  var errLog = log.create('error', version);
8188
8188
  ;// ./packages/ui/index.ts
@@ -8192,7 +8192,7 @@ var errLog = log.create('error', version);
8192
8192
  var setConfig = core_.VxeUI.setConfig,
8193
8193
  setIcon = core_.VxeUI.setIcon,
8194
8194
  checkVersion = core_.VxeUI.checkVersion;
8195
- core_.VxeUI.ganttVersion = "3.0.27";
8195
+ core_.VxeUI.ganttVersion = "3.1.1";
8196
8196
  setConfig({
8197
8197
  gantt: {
8198
8198
  // size: null,
@@ -8231,6 +8231,9 @@ setConfig({
8231
8231
  // beforeSave: null,
8232
8232
  // afterSave: null
8233
8233
  },
8234
+ taskBarTooltipConfig: {
8235
+ enterable: true
8236
+ },
8234
8237
  taskViewScaleConfig: {
8235
8238
  week: {
8236
8239
  startDay: 1
@@ -8523,6 +8526,8 @@ function _objectSpread2(e) {
8523
8526
  return e;
8524
8527
  }
8525
8528
 
8529
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find.js
8530
+ var es_array_find = __webpack_require__(113);
8526
8531
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.includes.js
8527
8532
  var es_array_includes = __webpack_require__(4423);
8528
8533
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.join.js
@@ -8531,6 +8536,8 @@ var es_array_join = __webpack_require__(8598);
8531
8536
  var es_array_map = __webpack_require__(2062);
8532
8537
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.sort.js
8533
8538
  var es_array_sort = __webpack_require__(6910);
8539
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.find.js
8540
+ var es_iterator_find = __webpack_require__(116);
8534
8541
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.map.js
8535
8542
  var es_iterator_map = __webpack_require__(1701);
8536
8543
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
@@ -8710,6 +8717,9 @@ var getConfig = core_.VxeUI.getConfig;
8710
8717
  function isEnableConf(conf) {
8711
8718
  return conf && conf.enabled !== false;
8712
8719
  }
8720
+ function isEmptyValue(cellValue) {
8721
+ return cellValue === null || cellValue === undefined || cellValue === '';
8722
+ }
8713
8723
  function nextZIndex() {
8714
8724
  return index_esm.getNext();
8715
8725
  }
@@ -8735,6 +8745,9 @@ function getFuncText(content, args) {
8735
8745
  }
8736
8746
  return '';
8737
8747
  }
8748
+ function formatText(value, placeholder) {
8749
+ return '' + (isEmptyValue(value) ? placeholder ? core_.VxeUI.getConfig().emptyCell : '' : value);
8750
+ }
8738
8751
  /**
8739
8752
  * 判断值为:'' | null | undefined 时都属于空值
8740
8753
  */
@@ -8966,10 +8979,6 @@ function getSlotVNs(vns) {
8966
8979
  }
8967
8980
  return [vns];
8968
8981
  }
8969
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find.js
8970
- var es_array_find = __webpack_require__(113);
8971
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.find.js
8972
- var es_iterator_find = __webpack_require__(116);
8973
8982
  ;// ./packages/gantt/src/util.ts
8974
8983
  function getRefElem(refEl) {
8975
8984
  if (refEl) {
@@ -8980,6 +8989,17 @@ function getRefElem(refEl) {
8980
8989
  function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
8981
8990
  return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
8982
8991
  }
8992
+ function getStandardGapTime(type) {
8993
+ switch (type) {
8994
+ case 'hour':
8995
+ return 1000 * 60 * 60;
8996
+ case 'minute':
8997
+ return 1000 * 60;
8998
+ case 'second':
8999
+ return 1000;
9000
+ }
9001
+ return 1000 * 60 * 60 * 24;
9002
+ }
8983
9003
  ;// ./packages/gantt/src/gantt-header.ts
8984
9004
 
8985
9005
 
@@ -8989,7 +9009,6 @@ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
8989
9009
 
8990
9010
 
8991
9011
 
8992
-
8993
9012
  var getI18n = core_.VxeUI.getI18n;
8994
9013
  var sourceType = 'gantt';
8995
9014
  var viewType = 'header';
@@ -9046,11 +9065,13 @@ var viewType = 'header';
9046
9065
  var scaleItem = _ref.scaleItem,
9047
9066
  columns = _ref.columns;
9048
9067
  var type = scaleItem.type,
9068
+ titleFormat = scaleItem.titleFormat,
9049
9069
  titleMethod = scaleItem.titleMethod,
9050
9070
  headerCellStyle = scaleItem.headerCellStyle,
9051
9071
  slots = scaleItem.slots;
9052
9072
  var titleSlot = slots ? slots.title : null;
9053
- var todayValue = showNowLine && $rowIndex === headerGroups.length - 1 ? todayDateMaps[type] : null;
9073
+ var isLast = $rowIndex === headerGroups.length - 1;
9074
+ var todayValue = isLast && showNowLine ? todayDateMaps[type] : null;
9054
9075
  return h('tr', {
9055
9076
  key: $rowIndex
9056
9077
  }, columns.map(function (column, cIndex) {
@@ -9058,11 +9079,17 @@ var viewType = 'header';
9058
9079
  childCount = column.childCount,
9059
9080
  dateObj = column.dateObj;
9060
9081
  var label = "".concat(column.title);
9061
- if ($rowIndex < headerGroups.length - 1) {
9062
- if (scaleItem.type === 'day') {
9063
- label = getI18n("vxe.gantt.dayss.w".concat(dateObj.e));
9082
+ if (scaleItem.type === 'day') {
9083
+ label = getI18n("vxe.gantt.dayss.w".concat(dateObj.e));
9084
+ } else {
9085
+ if ($rowIndex) {
9086
+ label = getI18n("vxe.gantt.tSimpleFormat.".concat(type), dateObj);
9064
9087
  } else {
9065
- label = getI18n("vxe.gantt.".concat(!$rowIndex && headerGroups.length > 1 ? 'tFullFormat' : 'tSimpleFormat', ".").concat(type), dateObj);
9088
+ if (isLast && scaleItem.type === 'week') {
9089
+ label = getI18n("vxe.gantt.tSimpleFormat.".concat(type), dateObj);
9090
+ } else {
9091
+ label = getI18n("vxe.gantt.tFullFormat.".concat(type), dateObj);
9092
+ }
9066
9093
  }
9067
9094
  }
9068
9095
  var cellVNs = label;
@@ -9079,6 +9106,8 @@ var viewType = 'header';
9079
9106
  cellVNs = $xeGantt.callSlot(titleSlot, ctParams, h);
9080
9107
  } else if (titleMethod) {
9081
9108
  cellVNs = "".concat(titleMethod(ctParams));
9109
+ } else if (titleFormat) {
9110
+ cellVNs = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, titleFormat);
9082
9111
  }
9083
9112
  var cellStys = {};
9084
9113
  if (headerCellStyle) {
@@ -9147,6 +9176,7 @@ var viewType = 'header';
9147
9176
 
9148
9177
 
9149
9178
 
9179
+
9150
9180
  var renderEmptyElement = core_.VxeUI.renderEmptyElement;
9151
9181
  var gantt_chart_sourceType = 'gantt';
9152
9182
  var gantt_chart_viewType = 'chart';
@@ -9194,7 +9224,8 @@ var gantt_chart_viewType = 'chart';
9194
9224
  showContent = taskBarOpts.showContent,
9195
9225
  contentMethod = taskBarOpts.contentMethod,
9196
9226
  barStyle = taskBarOpts.barStyle,
9197
- drag = taskBarOpts.drag;
9227
+ drag = taskBarOpts.drag,
9228
+ showTooltip = taskBarOpts.showTooltip;
9198
9229
  var isBarRowStyle = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(barStyle);
9199
9230
  var barStyObj = (barStyle ? isBarRowStyle ? barStyle(barParams) : barStyle : {}) || {};
9200
9231
  var round = barStyObj.round;
@@ -9230,8 +9261,34 @@ var gantt_chart_viewType = 'chart';
9230
9261
  row: row,
9231
9262
  $rowIndex: $rowIndex,
9232
9263
  rowIndex: rowIndex,
9233
- _rowIndex: _rowIndex
9264
+ _rowIndex: _rowIndex,
9265
+ $gantt: $xeGantt
9266
+ };
9267
+ var ons = {
9268
+ click: function click(evnt) {
9269
+ $xeGantt.handleTaskBarClickEvent(evnt, barParams);
9270
+ },
9271
+ dblclick: function dblclick(evnt) {
9272
+ $xeGantt.handleTaskBarDblclickEvent(evnt, barParams);
9273
+ },
9274
+ mousedown: function mousedown(evnt) {
9275
+ if ($xeGantt.handleTaskBarMousedownEvent) {
9276
+ $xeGantt.handleTaskBarMousedownEvent(evnt, barParams);
9277
+ }
9278
+ }
9234
9279
  };
9280
+ if (showTooltip) {
9281
+ ons.mouseover = function (evnt) {
9282
+ $xeGantt.triggerTaskBarTooltipEvent(evnt, Object.assign({
9283
+ $event: evnt
9284
+ }, ctParams));
9285
+ };
9286
+ ons.mouseleave = function (evnt) {
9287
+ $xeGantt.handleTaskBarTooltipLeaveEvent(evnt, Object.assign({
9288
+ $event: evnt
9289
+ }, ctParams));
9290
+ };
9291
+ }
9235
9292
  return h('div', {
9236
9293
  key: treeConfig ? rowid : $rowIndex,
9237
9294
  attrs: {
@@ -9256,19 +9313,7 @@ var gantt_chart_viewType = 'chart';
9256
9313
  attrs: {
9257
9314
  rowid: rowid
9258
9315
  },
9259
- on: {
9260
- click: function click(evnt) {
9261
- $xeGantt.handleTaskBarClickEvent(evnt, barParams);
9262
- },
9263
- dblclick: function dblclick(evnt) {
9264
- $xeGantt.handleTaskBarDblclickEvent(evnt, barParams);
9265
- },
9266
- mousedown: function mousedown(evnt) {
9267
- if ($xeGantt.handleTaskBarMousedownEvent) {
9268
- $xeGantt.handleTaskBarMousedownEvent(evnt, barParams);
9269
- }
9270
- }
9271
- }
9316
+ on: ons
9272
9317
  }, taskBarSlot ? $xeGantt.callSlot(taskBarSlot, barParams, h) : [showProgress ? h('div', {
9273
9318
  class: 'vxe-gantt-view--chart-progress',
9274
9319
  style: vpStyle
@@ -9757,6 +9802,8 @@ var gantt_footer_viewType = 'footer';
9757
9802
 
9758
9803
  var globalEvents = core_.VxeUI.globalEvents;
9759
9804
  var gantt_view_sourceType = 'gantt';
9805
+ var minuteMs = 1000 * 60;
9806
+ var dayMs = minuteMs * 60 * 24;
9760
9807
  function createInternalData() {
9761
9808
  return {
9762
9809
  xeTable: null,
@@ -9822,43 +9869,17 @@ function updateTodayData($xeGanttView) {
9822
9869
  second: "".concat(yyyy, "_").concat(MM, "_").concat(dd, "_").concat(HH, "_").concat(mm, "_").concat(ss)
9823
9870
  };
9824
9871
  }
9825
- function handleParseColumn($xeGanttView) {
9872
+ function handleColumnHeader($xeGanttView) {
9826
9873
  var $xeGantt = $xeGanttView.$xeGantt;
9827
- var reactData = $xeGanttView.reactData;
9828
- var internalData = $xeGanttView.internalData;
9829
- var ganttProps = $xeGantt;
9830
9874
  var ganttReactData = $xeGantt.reactData;
9831
- var treeConfig = ganttProps.treeConfig;
9832
9875
  var taskScaleList = ganttReactData.taskScaleList;
9833
- var minViewDate = reactData.minViewDate,
9834
- maxViewDate = reactData.maxViewDate;
9835
- var minScale = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().last(taskScaleList);
9876
+ var scaleUnit = $xeGantt.computeScaleUnit;
9877
+ var minScale = $xeGantt.computeMinScale;
9878
+ var weekScale = $xeGantt.computeWeekScale;
9879
+ var scaleDateList = $xeGanttView.computeScaleDateList;
9836
9880
  var fullCols = [];
9837
9881
  var groupCols = [];
9838
- if (minScale && minViewDate && maxViewDate) {
9839
- var minSType = minScale.type;
9840
- var weekScale = taskScaleList.find(function (item) {
9841
- return item.type === 'week';
9842
- });
9843
- var gapTime = 1000 * 60 * 60 * 24;
9844
- switch (minScale.type) {
9845
- case 'hour':
9846
- gapTime = 1000 * 60 * 60;
9847
- break;
9848
- case 'minute':
9849
- gapTime = 1000 * 60;
9850
- break;
9851
- case 'second':
9852
- gapTime = 1000;
9853
- break;
9854
- default:
9855
- {
9856
- break;
9857
- }
9858
- }
9859
- var currTime = minViewDate.getTime();
9860
- var diffDayNum = maxViewDate.getTime() - minViewDate.getTime();
9861
- var countSize = Math.max(5, Math.floor(diffDayNum / gapTime) + 1);
9882
+ if (minScale && scaleUnit && scaleDateList.length) {
9862
9883
  var renderListMaps = {
9863
9884
  year: [],
9864
9885
  quarter: [],
@@ -9882,7 +9903,7 @@ function handleParseColumn($xeGanttView) {
9882
9903
  second: {}
9883
9904
  };
9884
9905
  var handleData = function handleData(type, colMaps, minCol) {
9885
- if (minSType === type) {
9906
+ if (minScale.type === type) {
9886
9907
  return;
9887
9908
  }
9888
9909
  var currCol = colMaps[type];
@@ -9900,8 +9921,8 @@ function handleParseColumn($xeGanttView) {
9900
9921
  currGpCol.children.push(minCol);
9901
9922
  }
9902
9923
  };
9903
- for (var i = 0; i < countSize; i++) {
9904
- var itemDate = new Date(currTime + i * gapTime);
9924
+ for (var i = 0; i < scaleDateList.length; i++) {
9925
+ var itemDate = scaleDateList[i];
9905
9926
  var _XEUtils$toDateString3 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(itemDate, 'yyyy-M-d-H-m-s').split('-'),
9906
9927
  _XEUtils$toDateString4 = _slicedToArray(_XEUtils$toDateString3, 6),
9907
9928
  yyyy = _XEUtils$toDateString4[0],
@@ -9915,6 +9936,7 @@ function handleParseColumn($xeGanttView) {
9915
9936
  var q = Math.ceil((itemDate.getMonth() + 1) / 3);
9916
9937
  var W = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(itemDate, weekScale ? weekScale.startDay : undefined);
9917
9938
  var dateObj = {
9939
+ date: itemDate,
9918
9940
  yy: yyyy,
9919
9941
  M: MM,
9920
9942
  d: dd,
@@ -9973,14 +9995,14 @@ function handleParseColumn($xeGanttView) {
9973
9995
  dateObj: dateObj
9974
9996
  }
9975
9997
  };
9976
- var minCol = colMaps[minSType];
9998
+ var minCol = colMaps[minScale.type];
9977
9999
  if (minScale.level < 19) {
9978
10000
  handleData('year', colMaps, minCol);
9979
10001
  }
9980
10002
  if (minScale.level < 17) {
9981
10003
  handleData('quarter', colMaps, minCol);
9982
10004
  }
9983
- if (minScale.level < 14) {
10005
+ if (minScale.level < 15) {
9984
10006
  handleData('month', colMaps, minCol);
9985
10007
  }
9986
10008
  if (minScale.level < 13) {
@@ -9989,7 +10011,7 @@ function handleParseColumn($xeGanttView) {
9989
10011
  if (minScale.level < 11) {
9990
10012
  handleData('day', colMaps, minCol);
9991
10013
  }
9992
- if (minScale.level < 12) {
10014
+ if (minScale.level < 9) {
9993
10015
  handleData('date', colMaps, minCol);
9994
10016
  }
9995
10017
  if (minScale.level < 7) {
@@ -9998,10 +10020,13 @@ function handleParseColumn($xeGanttView) {
9998
10020
  if (minScale.level < 5) {
9999
10021
  handleData('minute', colMaps, minCol);
10000
10022
  }
10023
+ if (minScale.level < 3) {
10024
+ handleData('second', colMaps, minCol);
10025
+ }
10001
10026
  fullCols.push(minCol);
10002
10027
  }
10003
10028
  taskScaleList.forEach(function (scaleItem) {
10004
- if (scaleItem.type === minSType) {
10029
+ if (scaleItem.type === minScale.type) {
10005
10030
  groupCols.push({
10006
10031
  scaleItem: scaleItem,
10007
10032
  columns: fullCols
@@ -10020,6 +10045,240 @@ function handleParseColumn($xeGanttView) {
10020
10045
  columns: list
10021
10046
  });
10022
10047
  });
10048
+ }
10049
+ return {
10050
+ fullCols: fullCols,
10051
+ groupCols: groupCols
10052
+ };
10053
+ }
10054
+ function createChartRender($xeGanttView, fullCols) {
10055
+ var $xeGantt = $xeGanttView.$xeGantt;
10056
+ var reactData = $xeGanttView.reactData;
10057
+ var minViewDate = reactData.minViewDate;
10058
+ var minScale = $xeGantt.computeMinScale;
10059
+ var scaleUnit = $xeGantt.computeScaleUnit;
10060
+ var weekScale = $xeGantt.computeWeekScale;
10061
+ switch (scaleUnit) {
10062
+ case 'year':
10063
+ {
10064
+ var indexMaps = {};
10065
+ fullCols.forEach(function (_ref, i) {
10066
+ var dateObj = _ref.dateObj;
10067
+ var yyyyMM = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy');
10068
+ indexMaps[yyyyMM] = i;
10069
+ });
10070
+ return function (startValue, endValue) {
10071
+ var startDate = parseStringDate($xeGanttView, startValue);
10072
+ var endDate = parseStringDate($xeGanttView, endValue);
10073
+ var startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy');
10074
+ var startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(startDate, 0, 'first');
10075
+ var endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy');
10076
+ var endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(endDate, 0, 'first');
10077
+ var dateSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / dayMs);
10078
+ var subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
10079
+ var addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
10080
+ var offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
10081
+ return {
10082
+ offsetLeftSize: offsetLeftSize,
10083
+ offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
10084
+ };
10085
+ };
10086
+ }
10087
+ case 'quarter':
10088
+ {
10089
+ var _indexMaps = {};
10090
+ fullCols.forEach(function (_ref2, i) {
10091
+ var dateObj = _ref2.dateObj;
10092
+ var q = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-q');
10093
+ _indexMaps[q] = i;
10094
+ });
10095
+ return function (startValue, endValue) {
10096
+ var startDate = parseStringDate($xeGanttView, startValue);
10097
+ var endDate = parseStringDate($xeGanttView, endValue);
10098
+ var startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-q');
10099
+ var startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(startDate, 0, 'first');
10100
+ var endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-q');
10101
+ var endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(endDate, 0, 'first');
10102
+ var dateSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / dayMs);
10103
+ var subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
10104
+ var addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
10105
+ var offsetLeftSize = (_indexMaps[startStr] || 0) + subtract;
10106
+ return {
10107
+ offsetLeftSize: offsetLeftSize,
10108
+ offsetWidthSize: (_indexMaps[endStr] || 0) - offsetLeftSize + addSize
10109
+ };
10110
+ };
10111
+ }
10112
+ case 'month':
10113
+ {
10114
+ var _indexMaps2 = {};
10115
+ fullCols.forEach(function (_ref3, i) {
10116
+ var dateObj = _ref3.dateObj;
10117
+ var yyyyMM = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-MM');
10118
+ _indexMaps2[yyyyMM] = i;
10119
+ });
10120
+ return function (startValue, endValue) {
10121
+ var startDate = parseStringDate($xeGanttView, startValue);
10122
+ var endDate = parseStringDate($xeGanttView, endValue);
10123
+ var startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-MM');
10124
+ var startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(startDate, 0, 'first');
10125
+ var endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-MM');
10126
+ var endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(endDate, 0, 'first');
10127
+ var dateSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / dayMs);
10128
+ var subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
10129
+ var addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
10130
+ var offsetLeftSize = (_indexMaps2[startStr] || 0) + subtract;
10131
+ return {
10132
+ offsetLeftSize: offsetLeftSize,
10133
+ offsetWidthSize: (_indexMaps2[endStr] || 0) - offsetLeftSize + addSize
10134
+ };
10135
+ };
10136
+ }
10137
+ case 'week':
10138
+ {
10139
+ var _indexMaps3 = {};
10140
+ fullCols.forEach(function (_ref4, i) {
10141
+ var dateObj = _ref4.dateObj;
10142
+ var yyyyW = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-W', {
10143
+ firstDay: weekScale ? weekScale.startDay : undefined
10144
+ });
10145
+ _indexMaps3[yyyyW] = i;
10146
+ });
10147
+ return function (startValue, endValue) {
10148
+ var startDate = parseStringDate($xeGanttView, startValue);
10149
+ var endDate = parseStringDate($xeGanttView, endValue);
10150
+ var startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-W', {
10151
+ firstDay: weekScale ? weekScale.startDay : undefined
10152
+ });
10153
+ var startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(startDate, 0, weekScale ? weekScale.startDay : undefined, weekScale ? weekScale.startDay : undefined);
10154
+ var endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-W', {
10155
+ firstDay: weekScale ? weekScale.startDay : undefined
10156
+ });
10157
+ var endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(endDate, 0, weekScale ? weekScale.startDay : undefined, weekScale ? weekScale.startDay : undefined);
10158
+ var dateSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(endDate, 1, weekScale ? weekScale.startDay : undefined, weekScale ? weekScale.startDay : undefined).getTime() - endFirstDate.getTime()) / dayMs);
10159
+ var subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
10160
+ var addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
10161
+ var offsetLeftSize = (_indexMaps3[startStr] || 0) + subtract;
10162
+ return {
10163
+ offsetLeftSize: offsetLeftSize,
10164
+ offsetWidthSize: (_indexMaps3[endStr] || 0) - offsetLeftSize + addSize
10165
+ };
10166
+ };
10167
+ }
10168
+ case 'day':
10169
+ case 'date':
10170
+ {
10171
+ var _indexMaps4 = {};
10172
+ fullCols.forEach(function (_ref5, i) {
10173
+ var dateObj = _ref5.dateObj;
10174
+ var yyyyMM = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-MM-dd');
10175
+ _indexMaps4[yyyyMM] = i;
10176
+ });
10177
+ return function (startValue, endValue) {
10178
+ var startDate = parseStringDate($xeGanttView, startValue);
10179
+ var endDate = parseStringDate($xeGanttView, endValue);
10180
+ var startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-MM-dd');
10181
+ var startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(startDate, 0, 'first');
10182
+ var endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-MM-dd');
10183
+ var endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(endDate, 0, 'first');
10184
+ var minuteSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / minuteMs);
10185
+ var subtract = (startDate.getTime() - startFirstDate.getTime()) / minuteMs / minuteSize;
10186
+ var addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / minuteMs + 1) / minuteSize;
10187
+ var offsetLeftSize = (_indexMaps4[startStr] || 0) + subtract;
10188
+ return {
10189
+ offsetLeftSize: offsetLeftSize,
10190
+ offsetWidthSize: (_indexMaps4[endStr] || 0) - offsetLeftSize + addSize
10191
+ };
10192
+ };
10193
+ }
10194
+ case 'hour':
10195
+ {
10196
+ var _indexMaps5 = {};
10197
+ fullCols.forEach(function (_ref6, i) {
10198
+ var dateObj = _ref6.dateObj;
10199
+ var yyyyMM = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-MM-dd HH');
10200
+ _indexMaps5[yyyyMM] = i;
10201
+ });
10202
+ return function (startValue, endValue) {
10203
+ var startDate = parseStringDate($xeGanttView, startValue);
10204
+ var endDate = parseStringDate($xeGanttView, endValue);
10205
+ var startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-MM-dd HH');
10206
+ var startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatHours(startDate, 0, 'first');
10207
+ var endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-MM-dd HH');
10208
+ var endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatHours(endDate, 0, 'first');
10209
+ var minuteSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatHours(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / minuteMs);
10210
+ var subtract = (startDate.getTime() - startFirstDate.getTime()) / minuteMs / minuteSize;
10211
+ var addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / minuteMs + 1) / minuteSize;
10212
+ var offsetLeftSize = (_indexMaps5[startStr] || 0) + subtract;
10213
+ return {
10214
+ offsetLeftSize: offsetLeftSize,
10215
+ offsetWidthSize: (_indexMaps5[endStr] || 0) - offsetLeftSize + addSize
10216
+ };
10217
+ };
10218
+ }
10219
+ case 'minute':
10220
+ {
10221
+ var _indexMaps6 = {};
10222
+ fullCols.forEach(function (_ref7, i) {
10223
+ var dateObj = _ref7.dateObj;
10224
+ var yyyyMM = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-MM-dd HH:mm');
10225
+ _indexMaps6[yyyyMM] = i;
10226
+ });
10227
+ return function (startValue, endValue) {
10228
+ var startDate = parseStringDate($xeGanttView, startValue);
10229
+ var endDate = parseStringDate($xeGanttView, endValue);
10230
+ var startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-MM-dd HH:mm');
10231
+ var startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMinutes(startDate, 0, 'first');
10232
+ var endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-MM-dd HH:mm');
10233
+ var endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMinutes(endDate, 0, 'first');
10234
+ var minuteSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMinutes(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / minuteMs);
10235
+ var subtract = (startDate.getTime() - startFirstDate.getTime()) / minuteMs / minuteSize;
10236
+ var addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / minuteMs + 1) / minuteSize;
10237
+ var offsetLeftSize = (_indexMaps6[startStr] || 0) + subtract;
10238
+ return {
10239
+ offsetLeftSize: offsetLeftSize,
10240
+ offsetWidthSize: (_indexMaps6[endStr] || 0) - offsetLeftSize + addSize
10241
+ };
10242
+ };
10243
+ }
10244
+ case 'second':
10245
+ {
10246
+ var gapTime = getStandardGapTime(minScale.type);
10247
+ return function (startValue, endValue) {
10248
+ var startDate = parseStringDate($xeGanttView, startValue);
10249
+ var endDate = parseStringDate($xeGanttView, endValue);
10250
+ var offsetLeftSize = 0;
10251
+ var offsetWidthSize = 0;
10252
+ if (minViewDate) {
10253
+ offsetLeftSize = (startDate.getTime() - minViewDate.getTime()) / gapTime;
10254
+ offsetWidthSize = (endDate.getTime() - startDate.getTime()) / gapTime + 1;
10255
+ }
10256
+ return {
10257
+ offsetLeftSize: offsetLeftSize,
10258
+ offsetWidthSize: offsetWidthSize
10259
+ };
10260
+ };
10261
+ }
10262
+ }
10263
+ return function () {
10264
+ return {
10265
+ offsetLeftSize: 0,
10266
+ offsetWidthSize: 0
10267
+ };
10268
+ };
10269
+ }
10270
+ function handleParseColumn($xeGanttView) {
10271
+ var $xeGantt = $xeGanttView.$xeGantt;
10272
+ var reactData = $xeGanttView.reactData;
10273
+ var internalData = $xeGanttView.internalData;
10274
+ var ganttProps = $xeGantt;
10275
+ var treeConfig = ganttProps.treeConfig;
10276
+ var minViewDate = reactData.minViewDate,
10277
+ maxViewDate = reactData.maxViewDate;
10278
+ var _handleColumnHeader = handleColumnHeader($xeGanttView),
10279
+ fullCols = _handleColumnHeader.fullCols,
10280
+ groupCols = _handleColumnHeader.groupCols;
10281
+ if (minViewDate && maxViewDate) {
10023
10282
  var $xeTable = internalData.xeTable;
10024
10283
  if ($xeTable) {
10025
10284
  var startField = $xeGantt.computeStartField;
@@ -10035,20 +10294,20 @@ function handleParseColumn($xeGanttView) {
10035
10294
  var transform = treeOpts.transform;
10036
10295
  var childrenField = treeOpts.children || treeOpts.childrenField;
10037
10296
  var ctMaps = {};
10297
+ var renderFn = createChartRender($xeGanttView, fullCols);
10038
10298
  var handleParseRender = function handleParseRender(row) {
10039
10299
  var rowid = $xeTable.getRowid(row);
10040
10300
  var startValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, startField);
10041
10301
  var endValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, endField);
10042
10302
  if (startValue && endValue) {
10043
- var startDate = parseStringDate($xeGanttView, startValue);
10044
- var endDate = parseStringDate($xeGanttView, endValue);
10045
- var oLeftSize = Math.floor((startDate.getTime() - minViewDate.getTime()) / gapTime);
10046
- var oWidthSize = Math.floor((endDate.getTime() - startDate.getTime()) / gapTime) + 1;
10303
+ var _renderFn = renderFn(startValue, endValue),
10304
+ offsetLeftSize = _renderFn.offsetLeftSize,
10305
+ offsetWidthSize = _renderFn.offsetWidthSize;
10047
10306
  ctMaps[rowid] = {
10048
10307
  row: row,
10049
10308
  rowid: rowid,
10050
- oLeftSize: oLeftSize,
10051
- oWidthSize: oWidthSize
10309
+ oLeftSize: offsetLeftSize,
10310
+ oWidthSize: offsetWidthSize
10052
10311
  };
10053
10312
  }
10054
10313
  };
@@ -10322,10 +10581,10 @@ function _handleLazyRecalculate($xeGanttView) {
10322
10581
  var rceTimeout = internalData.rceTimeout,
10323
10582
  rceRunTime = internalData.rceRunTime;
10324
10583
  var $xeTable = internalData.xeTable;
10325
- var refreshDelay = 50;
10584
+ var refreshDelay = 30;
10326
10585
  if ($xeTable) {
10327
10586
  var resizeOpts = $xeTable.computeResizeOpts;
10328
- refreshDelay = resizeOpts.refreshDelay || 50;
10587
+ refreshDelay = resizeOpts.refreshDelay || refreshDelay;
10329
10588
  }
10330
10589
  if (rceTimeout) {
10331
10590
  clearTimeout(rceTimeout);
@@ -10727,15 +10986,96 @@ function syncTableScrollTop($xeGanttView, scrollTop) {
10727
10986
  internalData: internalData
10728
10987
  };
10729
10988
  },
10730
- computed: _objectSpread2({}, {}),
10989
+ computed: _objectSpread2(_objectSpread2({}, {}), {}, {
10990
+ computeScaleDateList: function computeScaleDateList() {
10991
+ var $xeGanttView = this;
10992
+ var $xeGantt = $xeGanttView.$xeGantt;
10993
+ var reactData = $xeGanttView.reactData;
10994
+ var minViewDate = reactData.minViewDate,
10995
+ maxViewDate = reactData.maxViewDate;
10996
+ var minScale = $xeGantt.computeMinScale;
10997
+ var dateList = [];
10998
+ if (!minViewDate || !maxViewDate) {
10999
+ return dateList;
11000
+ }
11001
+ var startTime = minViewDate.getTime();
11002
+ var endTime = maxViewDate.getTime();
11003
+ switch (minScale.type) {
11004
+ case 'year':
11005
+ {
11006
+ var currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(minViewDate, 0, 'first');
11007
+ while (currDate <= maxViewDate) {
11008
+ var itemDate = currDate;
11009
+ dateList.push(itemDate);
11010
+ currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(currDate, 1);
11011
+ }
11012
+ break;
11013
+ }
11014
+ case 'quarter':
11015
+ {
11016
+ var _currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(minViewDate, 0, 'first');
11017
+ while (_currDate <= maxViewDate) {
11018
+ var _itemDate = _currDate;
11019
+ dateList.push(_itemDate);
11020
+ _currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(_currDate, 1);
11021
+ }
11022
+ break;
11023
+ }
11024
+ case 'month':
11025
+ {
11026
+ var _currDate2 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(minViewDate, 0, 'first');
11027
+ while (_currDate2 <= maxViewDate) {
11028
+ var _itemDate2 = _currDate2;
11029
+ dateList.push(_itemDate2);
11030
+ _currDate2 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(_currDate2, 1);
11031
+ }
11032
+ break;
11033
+ }
11034
+ case 'week':
11035
+ {
11036
+ var _currDate3 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(minViewDate, 0, minScale.startDay, minScale.startDay);
11037
+ while (_currDate3 <= maxViewDate) {
11038
+ var _itemDate3 = _currDate3;
11039
+ dateList.push(_itemDate3);
11040
+ _currDate3 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(_currDate3, 1);
11041
+ }
11042
+ break;
11043
+ }
11044
+ case 'day':
11045
+ case 'date':
11046
+ case 'hour':
11047
+ case 'minute':
11048
+ case 'second':
11049
+ {
11050
+ var gapTime = getStandardGapTime(minScale.type);
11051
+ var currTime = startTime;
11052
+ while (currTime <= endTime) {
11053
+ var _itemDate4 = new Date(currTime);
11054
+ dateList.push(_itemDate4);
11055
+ currTime += gapTime;
11056
+ }
11057
+ break;
11058
+ }
11059
+ }
11060
+ return dateList;
11061
+ }
11062
+ }),
10731
11063
  methods: {
10732
11064
  //
10733
11065
  // Method
10734
11066
  //
10735
11067
  refreshData: function refreshData() {
10736
11068
  var $xeGanttView = this;
11069
+ var internalData = $xeGanttView.internalData;
10737
11070
  handleUpdateData($xeGanttView);
10738
- return _handleLazyRecalculate($xeGanttView);
11071
+ handleRecalculateStyle($xeGanttView);
11072
+ return $xeGanttView.$nextTick().then(function () {
11073
+ var $xeTable = internalData.xeTable;
11074
+ handleRecalculateStyle($xeGanttView);
11075
+ if ($xeTable) {
11076
+ return $xeTable.recalculate();
11077
+ }
11078
+ });
10739
11079
  },
10740
11080
  updateViewData: function updateViewData() {
10741
11081
  var $xeGanttView = this;
@@ -10749,8 +11089,8 @@ function syncTableScrollTop($xeGanttView, scrollTop) {
10749
11089
  }
10750
11090
  return $xeGanttView.$nextTick();
10751
11091
  },
10752
- connectUpdate: function connectUpdate(_ref) {
10753
- var $table = _ref.$table;
11092
+ connectUpdate: function connectUpdate(_ref8) {
11093
+ var $table = _ref8.$table;
10754
11094
  var $xeGanttView = this;
10755
11095
  var internalData = $xeGanttView.internalData;
10756
11096
  if ($table) {
@@ -11104,6 +11444,8 @@ var external_root_VxeUITable_commonjs_vxe_table_commonjs2_vxe_table_amd_vxe_tabl
11104
11444
 
11105
11445
 
11106
11446
 
11447
+
11448
+
11107
11449
 
11108
11450
 
11109
11451
 
@@ -11172,6 +11514,7 @@ function gantt_createInternalData() {
11172
11514
  return {
11173
11515
  uFoot: false,
11174
11516
  resizeTableWidth: 0
11517
+ // barTipTimeout: undefined
11175
11518
  };
11176
11519
  }
11177
11520
  /* harmony default export */ var gantt = (/* define-vxe-component start */defineVxeComponent({
@@ -11189,6 +11532,7 @@ function gantt_createInternalData() {
11189
11532
  taskViewScaleConfig: Object,
11190
11533
  taskViewConfig: Object,
11191
11534
  taskBarConfig: Object,
11535
+ taskBarTooltipConfig: Object,
11192
11536
  taskSplitConfig: Object,
11193
11537
  taskBarResizeConfig: Object,
11194
11538
  taskBarDragConfig: Object,
@@ -11227,7 +11571,13 @@ function gantt_createInternalData() {
11227
11571
  },
11228
11572
  showLeftView: true,
11229
11573
  showRightView: true,
11230
- taskScaleList: []
11574
+ taskScaleList: [],
11575
+ barTipStore: {
11576
+ row: null,
11577
+ content: '',
11578
+ visible: false,
11579
+ params: null
11580
+ }
11231
11581
  };
11232
11582
  var internalData = gantt_createInternalData();
11233
11583
  return {
@@ -11307,12 +11657,43 @@ function gantt_createInternalData() {
11307
11657
  var props = $xeGantt;
11308
11658
  return Object.assign({}, gantt_getConfig().gantt.taskSplitConfig, props.taskSplitConfig);
11309
11659
  },
11310
- computeTaskScaleConfs: function computeTaskScaleConfs() {
11660
+ computeTaskBarTooltipOpts: function computeTaskBarTooltipOpts() {
11661
+ var $xeGantt = this;
11662
+ var props = $xeGantt;
11663
+ return Object.assign({}, gantt_getConfig().gantt.taskBarTooltipConfig, props.taskBarTooltipConfig);
11664
+ },
11665
+ computeScaleUnit: function computeScaleUnit() {
11666
+ var $xeGantt = this;
11667
+ var minScale = $xeGantt.computeMinScale;
11668
+ return minScale ? minScale.type : 'date';
11669
+ },
11670
+ computeMinScale: function computeMinScale() {
11671
+ var $xeGantt = this;
11672
+ var reactData = $xeGantt.reactData;
11673
+ var taskScaleList = reactData.taskScaleList;
11674
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().last(taskScaleList);
11675
+ },
11676
+ computeWeekScale: function computeWeekScale() {
11677
+ var $xeGantt = this;
11678
+ var reactData = $xeGantt.reactData;
11679
+ var taskScaleList = reactData.taskScaleList;
11680
+ return taskScaleList.find(function (item) {
11681
+ return item.type === 'week';
11682
+ });
11683
+ },
11684
+ computeTaskViewScales: function computeTaskViewScales() {
11311
11685
  var $xeGantt = this;
11312
11686
  var taskViewOpts = $xeGantt.computeTaskViewOpts;
11313
11687
  var scales = taskViewOpts.scales;
11314
11688
  return scales;
11315
11689
  },
11690
+ /**
11691
+ * 已废弃,保留兼容
11692
+ * @deprecated
11693
+ */
11694
+ computeTaskScaleConfs: function computeTaskScaleConfs() {
11695
+ return this.computeTaskViewScales;
11696
+ },
11316
11697
  computeTitleField: function computeTitleField() {
11317
11698
  var $xeGantt = this;
11318
11699
  var taskOpts = $xeGantt.computeTaskOpts;
@@ -11570,9 +11951,10 @@ function gantt_createInternalData() {
11570
11951
  var $xeGantt = this;
11571
11952
  $xeGantt.initProxy();
11572
11953
  },
11573
- computeTaskScaleConfs: function computeTaskScaleConfs() {
11954
+ computeTaskViewScales: function computeTaskViewScales() {
11574
11955
  var $xeGantt = this;
11575
11956
  $xeGantt.handleTaskScaleConfig();
11957
+ $xeGantt.refreshTaskView();
11576
11958
  }
11577
11959
  },
11578
11960
  methods: _objectSpread2(_objectSpread2({}, tableMethods), {}, {
@@ -11586,7 +11968,7 @@ function gantt_createInternalData() {
11586
11968
  handleTaskScaleConfig: function handleTaskScaleConfig() {
11587
11969
  var $xeGantt = this;
11588
11970
  var reactData = $xeGantt.reactData;
11589
- var taskScaleConfs = $xeGantt.computeTaskScaleConfs;
11971
+ var taskScaleConfs = $xeGantt.computeTaskViewScales;
11590
11972
  var taskViewScaleOpts = $xeGantt.computeTaskViewScaleOpts;
11591
11973
  var scaleConfs = [];
11592
11974
  if (taskScaleConfs) {
@@ -12819,6 +13201,27 @@ function gantt_createInternalData() {
12819
13201
  reactData.showRightView = false;
12820
13202
  return $xeGantt.$nextTick();
12821
13203
  },
13204
+ /**
13205
+ * 关闭 bar tooltip
13206
+ */
13207
+ closeTaskBarTooltip: function closeTaskBarTooltip() {
13208
+ var $xeGantt = this;
13209
+ var reactData = $xeGantt.reactData;
13210
+ var barTipStore = reactData.barTipStore;
13211
+ var $tooltip = $xeGantt.$refs.refTooltip;
13212
+ if (barTipStore.visible) {
13213
+ Object.assign(barTipStore, {
13214
+ row: null,
13215
+ content: null,
13216
+ visible: false,
13217
+ params: {}
13218
+ });
13219
+ if ($tooltip && $tooltip.close) {
13220
+ $tooltip.close();
13221
+ }
13222
+ }
13223
+ return $xeGantt.$nextTick();
13224
+ },
12822
13225
  callSlot: function callSlot(slotFunc, params, h) {
12823
13226
  var $xeGantt = this;
12824
13227
  var slots = $xeGantt.$scopedSlots;
@@ -12953,6 +13356,69 @@ function gantt_createInternalData() {
12953
13356
  var $xeGantt = this;
12954
13357
  $xeGantt.dispatchEvent('task-bar-dblclick', params, evnt);
12955
13358
  },
13359
+ triggerTaskBarTooltipEvent: function triggerTaskBarTooltipEvent(evnt, params) {
13360
+ var $xeGantt = this;
13361
+ var reactData = $xeGantt.reactData;
13362
+ var barTipStore = reactData.barTipStore;
13363
+ var taskBarTooltipOpts = $xeGantt.computeTaskBarTooltipOpts;
13364
+ var titleField = $xeGantt.computeTitleField;
13365
+ var contentMethod = taskBarTooltipOpts.contentMethod;
13366
+ var row = params.row;
13367
+ var content = formatText(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, titleField));
13368
+ if (contentMethod) {
13369
+ content = formatText(contentMethod(params));
13370
+ }
13371
+ $xeGantt.handleTargetEnterEvent(barTipStore.row !== row);
13372
+ var tipContent = formatText(content);
13373
+ Object.assign(barTipStore, {
13374
+ row: row,
13375
+ visible: true,
13376
+ content: tipContent,
13377
+ params: params
13378
+ });
13379
+ $xeGantt.$nextTick(function () {
13380
+ var $tooltip = $xeGantt.$refs.refTooltip;
13381
+ if ($tooltip) {
13382
+ if ($tooltip.openByEvent) {
13383
+ $tooltip.openByEvent(evnt, evnt.currentTarget, tipContent);
13384
+ } else if ($tooltip.open) {
13385
+ $tooltip.open(evnt.currentTarget, tipContent);
13386
+ }
13387
+ }
13388
+ });
13389
+ },
13390
+ handleTargetEnterEvent: function handleTargetEnterEvent(isClear) {
13391
+ var $xeGantt = this;
13392
+ var internalData = $xeGantt.internalData;
13393
+ var $tooltip = $xeGantt.$refs.refTooltip;
13394
+ clearTimeout(internalData.barTipTimeout);
13395
+ if (isClear) {
13396
+ $xeGantt.closeTaskBarTooltip();
13397
+ } else {
13398
+ if ($tooltip && $tooltip.setActived) {
13399
+ $tooltip.setActived(true);
13400
+ }
13401
+ }
13402
+ },
13403
+ handleTaskBarTooltipLeaveEvent: function handleTaskBarTooltipLeaveEvent() {
13404
+ var $xeGantt = this;
13405
+ var internalData = $xeGantt.internalData;
13406
+ var taskBarTooltipOpts = $xeGantt.computeTaskBarTooltipOpts;
13407
+ var $tooltip = $xeGantt.$refs.refTooltip;
13408
+ if ($tooltip && $tooltip.setActived) {
13409
+ $tooltip.setActived(false);
13410
+ }
13411
+ if (taskBarTooltipOpts.enterable) {
13412
+ internalData.barTipTimeout = setTimeout(function () {
13413
+ $tooltip = $xeGantt.$refs.refTooltip;
13414
+ if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
13415
+ $xeGantt.closeTaskBarTooltip();
13416
+ }
13417
+ }, taskBarTooltipOpts.leaveDelay);
13418
+ } else {
13419
+ $xeGantt.closeTaskBarTooltip();
13420
+ }
13421
+ },
12956
13422
  handleTaskHeaderContextmenuEvent: function handleTaskHeaderContextmenuEvent(evnt, params) {
12957
13423
  var $xeGantt = this;
12958
13424
  var $xeTable = $xeGantt.$refs.refTable;
@@ -13403,14 +13869,19 @@ function gantt_createInternalData() {
13403
13869
  return childVNs;
13404
13870
  },
13405
13871
  renderLayout: function renderLayout(h) {
13872
+ var VxeUITooltipComponent = core_.VxeUI.getComponent('VxeTooltip');
13406
13873
  var $xeGantt = this;
13874
+ var reactData = $xeGantt.reactData;
13407
13875
  var slots = $xeGantt.$scopedSlots;
13876
+ var barTipStore = reactData.barTipStore;
13408
13877
  var currLayoutConf = $xeGantt.computeCurrLayoutConf;
13409
13878
  var headKeys = currLayoutConf.headKeys,
13410
13879
  bodyKeys = currLayoutConf.bodyKeys,
13411
13880
  footKeys = currLayoutConf.footKeys;
13881
+ var taskBarTooltipOpts = $xeGantt.computeTaskBarTooltipOpts;
13412
13882
  var asideLeftSlot = slots.asideLeft || slots['aside-left'];
13413
13883
  var asideRightSlot = slots.asideRight || slots['aside-right'];
13884
+ var taskBarTooltipSlot = slots.taskBarTooltip || slots['task-bar-tooltip'];
13414
13885
  return [h('div', {
13415
13886
  class: 'vxe-gantt--layout-header-wrapper'
13416
13887
  }, $xeGantt.renderChildLayout(h, headKeys)), h('div', {
@@ -13425,7 +13896,41 @@ function gantt_createInternalData() {
13425
13896
  class: 'vxe-gantt--layout-footer-wrapper'
13426
13897
  }, $xeGantt.renderChildLayout(h, footKeys)), h('div', {
13427
13898
  ref: 'refPopupContainerElem'
13428
- })];
13899
+ }), h('div', {}, [
13900
+ /**
13901
+ * 任务条提示
13902
+ */
13903
+ h(VxeUITooltipComponent, {
13904
+ key: 'gtp',
13905
+ ref: 'refTooltip',
13906
+ props: {
13907
+ theme: taskBarTooltipOpts.theme,
13908
+ enterable: taskBarTooltipOpts.enterable,
13909
+ enterDelay: taskBarTooltipOpts.enterDelay,
13910
+ leaveDelay: taskBarTooltipOpts.leaveDelay,
13911
+ useHTML: taskBarTooltipOpts.useHTML,
13912
+ width: taskBarTooltipOpts.width,
13913
+ height: taskBarTooltipOpts.height,
13914
+ minWidth: taskBarTooltipOpts.minWidth,
13915
+ minHeight: taskBarTooltipOpts.minHeight,
13916
+ maxWidth: taskBarTooltipOpts.maxWidth,
13917
+ maxHeight: taskBarTooltipOpts.maxHeight,
13918
+ isArrow: false
13919
+ },
13920
+ scopedSlots: taskBarTooltipSlot ? {
13921
+ content: function content() {
13922
+ var row = barTipStore.row,
13923
+ tooltipContent = barTipStore.content;
13924
+ if (row) {
13925
+ return h('div', {}, taskBarTooltipSlot(Object.assign({
13926
+ tooltipContent: tooltipContent,
13927
+ $gantt: $xeGantt
13928
+ }, barTipStore.params)));
13929
+ }
13930
+ return gantt_renderEmptyElement($xeGantt);
13931
+ }
13932
+ } : {}
13933
+ })])];
13429
13934
  },
13430
13935
  renderVN: function renderVN(h) {
13431
13936
  var $xeGantt = this;