vxe-gantt 4.0.27 → 4.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
@@ -2780,7 +2780,7 @@ var core_ = __webpack_require__(4345);
2780
2780
  const {
2781
2781
  log
2782
2782
  } = core_.VxeUI;
2783
- const version = `gantt v${"4.0.27"}`;
2783
+ const version = `gantt v${"4.1.1"}`;
2784
2784
  const warnLog = log.create('warn', version);
2785
2785
  const errLog = log.create('error', version);
2786
2786
  ;// ./packages/ui/index.ts
@@ -2791,7 +2791,7 @@ const {
2791
2791
  setIcon,
2792
2792
  checkVersion
2793
2793
  } = core_.VxeUI;
2794
- core_.VxeUI.ganttVersion = "4.0.27";
2794
+ core_.VxeUI.ganttVersion = "4.1.1";
2795
2795
  setConfig({
2796
2796
  gantt: {
2797
2797
  // size: null,
@@ -2830,6 +2830,9 @@ setConfig({
2830
2830
  // beforeSave: null,
2831
2831
  // afterSave: null
2832
2832
  },
2833
+ taskBarTooltipConfig: {
2834
+ enterable: true
2835
+ },
2833
2836
  taskViewScaleConfig: {
2834
2837
  week: {
2835
2838
  startDay: 1
@@ -2871,6 +2874,8 @@ var es_array_push = __webpack_require__(4114);
2871
2874
  var es_iterator_constructor = __webpack_require__(8111);
2872
2875
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.filter.js
2873
2876
  var es_iterator_filter = __webpack_require__(2489);
2877
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.find.js
2878
+ var es_iterator_find = __webpack_require__(116);
2874
2879
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.for-each.js
2875
2880
  var es_iterator_for_each = __webpack_require__(7588);
2876
2881
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.map.js
@@ -3077,7 +3082,7 @@ function getFuncText(content, args) {
3077
3082
  return '';
3078
3083
  }
3079
3084
  function formatText(value, placeholder) {
3080
- return '' + (isEmptyValue(value) ? placeholder ? VxeUI.getConfig().emptyCell : '' : value);
3085
+ return '' + (isEmptyValue(value) ? placeholder ? core_.VxeUI.getConfig().emptyCell : '' : value);
3081
3086
  }
3082
3087
  /**
3083
3088
  * 判断值为:'' | null | undefined 时都属于空值
@@ -3295,9 +3300,7 @@ const tableEmits = ['update:data', 'keydown-start', 'keydown', 'keydown-end', 'p
3295
3300
  const gridEmits = [...tableEmits, 'page-change', 'form-submit', 'form-submit-invalid', 'form-reset', 'form-collapse', 'form-toggle-collapse', 'proxy-query', 'proxy-delete', 'proxy-save', 'toolbar-button-click', 'toolbar-tool-click', 'zoom'];
3296
3301
  ;// ./packages/gantt/src/emits.ts
3297
3302
 
3298
- const ganttEmits = [...gridEmits, 'task-cell-click', 'task-cell-dblclick', 'task-bar-click', 'task-bar-dblclick', 'task-view-cell-click', 'task-view-cell-dblclick'];
3299
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.find.js
3300
- var es_iterator_find = __webpack_require__(116);
3303
+ const ganttEmits = [...gridEmits, 'task-cell-click', 'task-cell-dblclick', 'task-bar-mouseenter', 'task-bar-mouseleave', 'task-bar-click', 'task-bar-dblclick', 'task-view-cell-click', 'task-view-cell-dblclick'];
3301
3304
  ;// ./packages/gantt/src/util.ts
3302
3305
  function getRefElem(refEl) {
3303
3306
  if (refEl) {
@@ -3317,6 +3320,17 @@ function getCalcHeight(height) {
3317
3320
  function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
3318
3321
  return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
3319
3322
  }
3323
+ function getStandardGapTime(type) {
3324
+ switch (type) {
3325
+ case 'hour':
3326
+ return 1000 * 60 * 60;
3327
+ case 'minute':
3328
+ return 1000 * 60;
3329
+ case 'second':
3330
+ return 1000;
3331
+ }
3332
+ return 1000 * 60 * 60 * 24;
3333
+ }
3320
3334
  ;// ./packages/gantt/src/gantt-header.ts
3321
3335
 
3322
3336
 
@@ -3384,12 +3398,14 @@ const viewType = 'header';
3384
3398
  }, $rowIndex) => {
3385
3399
  const {
3386
3400
  type,
3401
+ titleFormat,
3387
3402
  titleMethod,
3388
3403
  headerCellStyle,
3389
3404
  slots
3390
3405
  } = scaleItem;
3391
3406
  const titleSlot = slots ? slots.title : null;
3392
- const todayValue = showNowLine && $rowIndex === headerGroups.length - 1 ? todayDateMaps[type] : null;
3407
+ const isLast = $rowIndex === headerGroups.length - 1;
3408
+ const todayValue = isLast && showNowLine ? todayDateMaps[type] : null;
3393
3409
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
3394
3410
  key: $rowIndex
3395
3411
  }, columns.map((column, cIndex) => {
@@ -3399,11 +3415,17 @@ const viewType = 'header';
3399
3415
  dateObj
3400
3416
  } = column;
3401
3417
  let label = `${column.title}`;
3402
- if ($rowIndex < headerGroups.length - 1) {
3403
- if (scaleItem.type === 'day') {
3404
- label = getI18n(`vxe.gantt.dayss.w${dateObj.e}`);
3418
+ if (scaleItem.type === 'day') {
3419
+ label = getI18n(`vxe.gantt.dayss.w${dateObj.e}`);
3420
+ } else {
3421
+ if ($rowIndex) {
3422
+ label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj);
3405
3423
  } else {
3406
- label = getI18n(`vxe.gantt.${!$rowIndex && headerGroups.length > 1 ? 'tFullFormat' : 'tSimpleFormat'}.${type}`, dateObj);
3424
+ if (isLast && scaleItem.type === 'week') {
3425
+ label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj);
3426
+ } else {
3427
+ label = getI18n(`vxe.gantt.tFullFormat.${type}`, dateObj);
3428
+ }
3407
3429
  }
3408
3430
  }
3409
3431
  let cellVNs = label;
@@ -3420,6 +3442,8 @@ const viewType = 'header';
3420
3442
  cellVNs = $xeGantt.callSlot(titleSlot, ctParams);
3421
3443
  } else if (titleMethod) {
3422
3444
  cellVNs = `${titleMethod(ctParams)}`;
3445
+ } else if (titleFormat) {
3446
+ cellVNs = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, titleFormat);
3423
3447
  }
3424
3448
  let cellStys = {};
3425
3449
  if (headerCellStyle) {
@@ -3532,7 +3556,8 @@ const gantt_chart_viewType = 'chart';
3532
3556
  showContent,
3533
3557
  contentMethod,
3534
3558
  barStyle,
3535
- drag
3559
+ drag,
3560
+ showTooltip
3536
3561
  } = taskBarOpts;
3537
3562
  const isBarRowStyle = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(barStyle);
3538
3563
  const barStyObj = (barStyle ? isBarRowStyle ? barStyle(barParams) : barStyle : {}) || {};
@@ -3573,8 +3598,38 @@ const gantt_chart_viewType = 'chart';
3573
3598
  row,
3574
3599
  $rowIndex,
3575
3600
  rowIndex,
3576
- _rowIndex
3601
+ _rowIndex,
3602
+ $gantt: $xeGantt
3577
3603
  };
3604
+ const ons = {
3605
+ onClick(evnt) {
3606
+ $xeGantt.handleTaskBarClickEvent(evnt, barParams);
3607
+ },
3608
+ onDblclick(evnt) {
3609
+ $xeGantt.handleTaskBarDblclickEvent(evnt, barParams);
3610
+ },
3611
+ onMousedown(evnt) {
3612
+ if ($xeGantt.handleTaskBarMousedownEvent) {
3613
+ $xeGantt.handleTaskBarMousedownEvent(evnt, barParams);
3614
+ }
3615
+ }
3616
+ };
3617
+ if (showTooltip) {
3618
+ ons.onMouseover = evnt => {
3619
+ const ttParams = Object.assign({
3620
+ $event: evnt
3621
+ }, ctParams);
3622
+ $xeGantt.triggerTaskBarTooltipEvent(evnt, ttParams);
3623
+ $xeGantt.dispatchEvent('task-bar-mouseenter', ttParams, evnt);
3624
+ };
3625
+ ons.onMouseleave = evnt => {
3626
+ const ttParams = Object.assign({
3627
+ $event: evnt
3628
+ }, ctParams);
3629
+ $xeGantt.handleTaskBarTooltipLeaveEvent(evnt, ttParams);
3630
+ $xeGantt.dispatchEvent('task-bar-mouseleave', ttParams, evnt);
3631
+ };
3632
+ }
3578
3633
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3579
3634
  key: treeConfig ? rowid : $rowIndex,
3580
3635
  rowid,
@@ -3593,17 +3648,7 @@ const gantt_chart_viewType = 'chart';
3593
3648
  class: taskBarSlot ? 'vxe-gantt-view--chart-custom-bar' : 'vxe-gantt-view--chart-bar',
3594
3649
  style: vbStyle,
3595
3650
  rowid,
3596
- onClick(evnt) {
3597
- $xeGantt.handleTaskBarClickEvent(evnt, barParams);
3598
- },
3599
- onDblclick(evnt) {
3600
- $xeGantt.handleTaskBarDblclickEvent(evnt, barParams);
3601
- },
3602
- onMousedown(evnt) {
3603
- if ($xeGantt.handleTaskBarMousedownEvent) {
3604
- $xeGantt.handleTaskBarMousedownEvent(evnt, barParams);
3605
- }
3606
- }
3651
+ ...ons
3607
3652
  }, taskBarSlot ? $xeGantt.callSlot(taskBarSlot, barParams) : [showProgress ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3608
3653
  class: 'vxe-gantt-view--chart-progress',
3609
3654
  style: vpStyle
@@ -4087,6 +4132,8 @@ const {
4087
4132
  globalEvents
4088
4133
  } = core_.VxeUI;
4089
4134
  const gantt_view_sourceType = 'gantt';
4135
+ const minuteMs = 1000 * 60;
4136
+ const dayMs = minuteMs * 60 * 24;
4090
4137
  function createInternalData() {
4091
4138
  return {
4092
4139
  xeTable: null,
@@ -4124,7 +4171,10 @@ const maxYHeight = 5e6;
4124
4171
  computeEndField,
4125
4172
  computeScrollbarOpts,
4126
4173
  computeScrollbarXToTop,
4127
- computeScrollbarYToLeft
4174
+ computeScrollbarYToLeft,
4175
+ computeScaleUnit,
4176
+ computeWeekScale,
4177
+ computeMinScale
4128
4178
  } = $xeGantt.getComputeMaps();
4129
4179
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
4130
4180
  const refScrollXVirtualElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
@@ -4174,7 +4224,80 @@ const maxYHeight = 5e6;
4174
4224
  const refMaps = {
4175
4225
  refElem
4176
4226
  };
4177
- const computeMaps = {};
4227
+ const computeScaleDateList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
4228
+ const {
4229
+ minViewDate,
4230
+ maxViewDate
4231
+ } = reactData;
4232
+ const minScale = computeMinScale.value;
4233
+ const dateList = [];
4234
+ if (!minViewDate || !maxViewDate) {
4235
+ return dateList;
4236
+ }
4237
+ const startTime = minViewDate.getTime();
4238
+ const endTime = maxViewDate.getTime();
4239
+ switch (minScale.type) {
4240
+ case 'year':
4241
+ {
4242
+ let currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(minViewDate, 0, 'first');
4243
+ while (currDate <= maxViewDate) {
4244
+ const itemDate = currDate;
4245
+ dateList.push(itemDate);
4246
+ currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(currDate, 1);
4247
+ }
4248
+ break;
4249
+ }
4250
+ case 'quarter':
4251
+ {
4252
+ let currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(minViewDate, 0, 'first');
4253
+ while (currDate <= maxViewDate) {
4254
+ const itemDate = currDate;
4255
+ dateList.push(itemDate);
4256
+ currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(currDate, 1);
4257
+ }
4258
+ break;
4259
+ }
4260
+ case 'month':
4261
+ {
4262
+ let currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(minViewDate, 0, 'first');
4263
+ while (currDate <= maxViewDate) {
4264
+ const itemDate = currDate;
4265
+ dateList.push(itemDate);
4266
+ currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(currDate, 1);
4267
+ }
4268
+ break;
4269
+ }
4270
+ case 'week':
4271
+ {
4272
+ let currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(minViewDate, 0, minScale.startDay, minScale.startDay);
4273
+ while (currDate <= maxViewDate) {
4274
+ const itemDate = currDate;
4275
+ dateList.push(itemDate);
4276
+ currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(currDate, 1);
4277
+ }
4278
+ break;
4279
+ }
4280
+ case 'day':
4281
+ case 'date':
4282
+ case 'hour':
4283
+ case 'minute':
4284
+ case 'second':
4285
+ {
4286
+ const gapTime = getStandardGapTime(minScale.type);
4287
+ let currTime = startTime;
4288
+ while (currTime <= endTime) {
4289
+ const itemDate = new Date(currTime);
4290
+ dateList.push(itemDate);
4291
+ currTime += gapTime;
4292
+ }
4293
+ break;
4294
+ }
4295
+ }
4296
+ return dateList;
4297
+ });
4298
+ const computeMaps = {
4299
+ computeScaleDateList
4300
+ };
4178
4301
  const $xeGanttView = {
4179
4302
  xID,
4180
4303
  props,
@@ -4215,44 +4338,18 @@ const maxYHeight = 5e6;
4215
4338
  second: `${yyyy}_${MM}_${dd}_${HH}_${mm}_${ss}`
4216
4339
  };
4217
4340
  };
4218
- const handleParseColumn = () => {
4219
- const ganttProps = $xeGantt.props;
4341
+ const handleColumnHeader = () => {
4220
4342
  const ganttReactData = $xeGantt.reactData;
4221
- const {
4222
- treeConfig
4223
- } = ganttProps;
4224
4343
  const {
4225
4344
  taskScaleList
4226
4345
  } = ganttReactData;
4227
- const {
4228
- minViewDate,
4229
- maxViewDate
4230
- } = reactData;
4231
- const minScale = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().last(taskScaleList);
4346
+ const scaleUnit = computeScaleUnit.value;
4347
+ const minScale = computeMinScale.value;
4348
+ const weekScale = computeWeekScale.value;
4349
+ const scaleDateList = computeScaleDateList.value;
4232
4350
  const fullCols = [];
4233
4351
  const groupCols = [];
4234
- if (minScale && minViewDate && maxViewDate) {
4235
- const minSType = minScale.type;
4236
- const weekScale = taskScaleList.find(item => item.type === 'week');
4237
- let gapTime = 1000 * 60 * 60 * 24;
4238
- switch (minScale.type) {
4239
- case 'hour':
4240
- gapTime = 1000 * 60 * 60;
4241
- break;
4242
- case 'minute':
4243
- gapTime = 1000 * 60;
4244
- break;
4245
- case 'second':
4246
- gapTime = 1000;
4247
- break;
4248
- default:
4249
- {
4250
- break;
4251
- }
4252
- }
4253
- const currTime = minViewDate.getTime();
4254
- const diffDayNum = maxViewDate.getTime() - minViewDate.getTime();
4255
- const countSize = Math.max(5, Math.floor(diffDayNum / gapTime) + 1);
4352
+ if (minScale && scaleUnit && scaleDateList.length) {
4256
4353
  const renderListMaps = {
4257
4354
  year: [],
4258
4355
  quarter: [],
@@ -4276,7 +4373,7 @@ const maxYHeight = 5e6;
4276
4373
  second: {}
4277
4374
  };
4278
4375
  const handleData = (type, colMaps, minCol) => {
4279
- if (minSType === type) {
4376
+ if (minScale.type === type) {
4280
4377
  return;
4281
4378
  }
4282
4379
  const currCol = colMaps[type];
@@ -4294,14 +4391,15 @@ const maxYHeight = 5e6;
4294
4391
  currGpCol.children.push(minCol);
4295
4392
  }
4296
4393
  };
4297
- for (let i = 0; i < countSize; i++) {
4298
- const itemDate = new Date(currTime + i * gapTime);
4394
+ for (let i = 0; i < scaleDateList.length; i++) {
4395
+ const itemDate = scaleDateList[i];
4299
4396
  const [yyyy, MM, dd, HH, mm, ss] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(itemDate, 'yyyy-M-d-H-m-s').split('-');
4300
4397
  const e = itemDate.getDay();
4301
4398
  const E = e + 1;
4302
4399
  const q = Math.ceil((itemDate.getMonth() + 1) / 3);
4303
4400
  const W = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(itemDate, weekScale ? weekScale.startDay : undefined);
4304
4401
  const dateObj = {
4402
+ date: itemDate,
4305
4403
  yy: yyyy,
4306
4404
  M: MM,
4307
4405
  d: dd,
@@ -4360,14 +4458,14 @@ const maxYHeight = 5e6;
4360
4458
  dateObj
4361
4459
  }
4362
4460
  };
4363
- const minCol = colMaps[minSType];
4461
+ const minCol = colMaps[minScale.type];
4364
4462
  if (minScale.level < 19) {
4365
4463
  handleData('year', colMaps, minCol);
4366
4464
  }
4367
4465
  if (minScale.level < 17) {
4368
4466
  handleData('quarter', colMaps, minCol);
4369
4467
  }
4370
- if (minScale.level < 14) {
4468
+ if (minScale.level < 15) {
4371
4469
  handleData('month', colMaps, minCol);
4372
4470
  }
4373
4471
  if (minScale.level < 13) {
@@ -4376,7 +4474,7 @@ const maxYHeight = 5e6;
4376
4474
  if (minScale.level < 11) {
4377
4475
  handleData('day', colMaps, minCol);
4378
4476
  }
4379
- if (minScale.level < 12) {
4477
+ if (minScale.level < 9) {
4380
4478
  handleData('date', colMaps, minCol);
4381
4479
  }
4382
4480
  if (minScale.level < 7) {
@@ -4385,10 +4483,13 @@ const maxYHeight = 5e6;
4385
4483
  if (minScale.level < 5) {
4386
4484
  handleData('minute', colMaps, minCol);
4387
4485
  }
4486
+ if (minScale.level < 3) {
4487
+ handleData('second', colMaps, minCol);
4488
+ }
4388
4489
  fullCols.push(minCol);
4389
4490
  }
4390
4491
  taskScaleList.forEach(scaleItem => {
4391
- if (scaleItem.type === minSType) {
4492
+ if (scaleItem.type === minScale.type) {
4392
4493
  groupCols.push({
4393
4494
  scaleItem,
4394
4495
  columns: fullCols
@@ -4407,6 +4508,249 @@ const maxYHeight = 5e6;
4407
4508
  columns: list
4408
4509
  });
4409
4510
  });
4511
+ }
4512
+ return {
4513
+ fullCols,
4514
+ groupCols
4515
+ };
4516
+ };
4517
+ const createChartRender = fullCols => {
4518
+ const {
4519
+ minViewDate
4520
+ } = reactData;
4521
+ const minScale = computeMinScale.value;
4522
+ const scaleUnit = computeScaleUnit.value;
4523
+ const weekScale = computeWeekScale.value;
4524
+ switch (scaleUnit) {
4525
+ case 'year':
4526
+ {
4527
+ const indexMaps = {};
4528
+ fullCols.forEach(({
4529
+ dateObj
4530
+ }, i) => {
4531
+ const yyyyMM = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy');
4532
+ indexMaps[yyyyMM] = i;
4533
+ });
4534
+ return (startValue, endValue) => {
4535
+ const startDate = parseStringDate(startValue);
4536
+ const endDate = parseStringDate(endValue);
4537
+ const startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy');
4538
+ const startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(startDate, 0, 'first');
4539
+ const endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy');
4540
+ const endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(endDate, 0, 'first');
4541
+ const dateSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / dayMs);
4542
+ const subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
4543
+ const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
4544
+ const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
4545
+ return {
4546
+ offsetLeftSize,
4547
+ offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
4548
+ };
4549
+ };
4550
+ }
4551
+ case 'quarter':
4552
+ {
4553
+ const indexMaps = {};
4554
+ fullCols.forEach(({
4555
+ dateObj
4556
+ }, i) => {
4557
+ const q = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-q');
4558
+ indexMaps[q] = i;
4559
+ });
4560
+ return (startValue, endValue) => {
4561
+ const startDate = parseStringDate(startValue);
4562
+ const endDate = parseStringDate(endValue);
4563
+ const startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-q');
4564
+ const startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(startDate, 0, 'first');
4565
+ const endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-q');
4566
+ const endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(endDate, 0, 'first');
4567
+ const dateSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / dayMs);
4568
+ const subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
4569
+ const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
4570
+ const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
4571
+ return {
4572
+ offsetLeftSize,
4573
+ offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
4574
+ };
4575
+ };
4576
+ }
4577
+ case 'month':
4578
+ {
4579
+ const indexMaps = {};
4580
+ fullCols.forEach(({
4581
+ dateObj
4582
+ }, i) => {
4583
+ const yyyyMM = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-MM');
4584
+ indexMaps[yyyyMM] = i;
4585
+ });
4586
+ return (startValue, endValue) => {
4587
+ const startDate = parseStringDate(startValue);
4588
+ const endDate = parseStringDate(endValue);
4589
+ const startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-MM');
4590
+ const startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(startDate, 0, 'first');
4591
+ const endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-MM');
4592
+ const endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(endDate, 0, 'first');
4593
+ const dateSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / dayMs);
4594
+ const subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
4595
+ const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
4596
+ const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
4597
+ return {
4598
+ offsetLeftSize,
4599
+ offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
4600
+ };
4601
+ };
4602
+ }
4603
+ case 'week':
4604
+ {
4605
+ const indexMaps = {};
4606
+ fullCols.forEach(({
4607
+ dateObj
4608
+ }, i) => {
4609
+ const yyyyW = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-W', {
4610
+ firstDay: weekScale ? weekScale.startDay : undefined
4611
+ });
4612
+ indexMaps[yyyyW] = i;
4613
+ });
4614
+ return (startValue, endValue) => {
4615
+ const startDate = parseStringDate(startValue);
4616
+ const endDate = parseStringDate(endValue);
4617
+ const startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-W', {
4618
+ firstDay: weekScale ? weekScale.startDay : undefined
4619
+ });
4620
+ const 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);
4621
+ const endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-W', {
4622
+ firstDay: weekScale ? weekScale.startDay : undefined
4623
+ });
4624
+ const 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);
4625
+ const 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);
4626
+ const subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
4627
+ const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / dayMs + 1) / dateSize;
4628
+ const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
4629
+ return {
4630
+ offsetLeftSize,
4631
+ offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
4632
+ };
4633
+ };
4634
+ }
4635
+ case 'day':
4636
+ case 'date':
4637
+ {
4638
+ const indexMaps = {};
4639
+ fullCols.forEach(({
4640
+ dateObj
4641
+ }, i) => {
4642
+ const yyyyMM = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-MM-dd');
4643
+ indexMaps[yyyyMM] = i;
4644
+ });
4645
+ return (startValue, endValue) => {
4646
+ const startDate = parseStringDate(startValue);
4647
+ const endDate = parseStringDate(endValue);
4648
+ const startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-MM-dd');
4649
+ const startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(startDate, 0, 'first');
4650
+ const endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-MM-dd');
4651
+ const endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(endDate, 0, 'first');
4652
+ const minuteSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / minuteMs);
4653
+ const subtract = (startDate.getTime() - startFirstDate.getTime()) / minuteMs / minuteSize;
4654
+ const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / minuteMs + 1) / minuteSize;
4655
+ const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
4656
+ return {
4657
+ offsetLeftSize,
4658
+ offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
4659
+ };
4660
+ };
4661
+ }
4662
+ case 'hour':
4663
+ {
4664
+ const indexMaps = {};
4665
+ fullCols.forEach(({
4666
+ dateObj
4667
+ }, i) => {
4668
+ const yyyyMM = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-MM-dd HH');
4669
+ indexMaps[yyyyMM] = i;
4670
+ });
4671
+ return (startValue, endValue) => {
4672
+ const startDate = parseStringDate(startValue);
4673
+ const endDate = parseStringDate(endValue);
4674
+ const startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-MM-dd HH');
4675
+ const startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatHours(startDate, 0, 'first');
4676
+ const endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-MM-dd HH');
4677
+ const endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatHours(endDate, 0, 'first');
4678
+ const minuteSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatHours(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / minuteMs);
4679
+ const subtract = (startDate.getTime() - startFirstDate.getTime()) / minuteMs / minuteSize;
4680
+ const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / minuteMs + 1) / minuteSize;
4681
+ const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
4682
+ return {
4683
+ offsetLeftSize,
4684
+ offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
4685
+ };
4686
+ };
4687
+ }
4688
+ case 'minute':
4689
+ {
4690
+ const indexMaps = {};
4691
+ fullCols.forEach(({
4692
+ dateObj
4693
+ }, i) => {
4694
+ const yyyyMM = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateObj.date, 'yyyy-MM-dd HH:mm');
4695
+ indexMaps[yyyyMM] = i;
4696
+ });
4697
+ return (startValue, endValue) => {
4698
+ const startDate = parseStringDate(startValue);
4699
+ const endDate = parseStringDate(endValue);
4700
+ const startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-MM-dd HH:mm');
4701
+ const startFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMinutes(startDate, 0, 'first');
4702
+ const endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-MM-dd HH:mm');
4703
+ const endFirstDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMinutes(endDate, 0, 'first');
4704
+ const minuteSize = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMinutes(endDate, 1, 'first').getTime() - endFirstDate.getTime()) / minuteMs);
4705
+ const subtract = (startDate.getTime() - startFirstDate.getTime()) / minuteMs / minuteSize;
4706
+ const addSize = Math.max(0, (endDate.getTime() - endFirstDate.getTime()) / minuteMs + 1) / minuteSize;
4707
+ const offsetLeftSize = (indexMaps[startStr] || 0) + subtract;
4708
+ return {
4709
+ offsetLeftSize,
4710
+ offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + addSize
4711
+ };
4712
+ };
4713
+ }
4714
+ case 'second':
4715
+ {
4716
+ const gapTime = getStandardGapTime(minScale.type);
4717
+ return (startValue, endValue) => {
4718
+ const startDate = parseStringDate(startValue);
4719
+ const endDate = parseStringDate(endValue);
4720
+ let offsetLeftSize = 0;
4721
+ let offsetWidthSize = 0;
4722
+ if (minViewDate) {
4723
+ offsetLeftSize = (startDate.getTime() - minViewDate.getTime()) / gapTime;
4724
+ offsetWidthSize = (endDate.getTime() - startDate.getTime()) / gapTime + 1;
4725
+ }
4726
+ return {
4727
+ offsetLeftSize,
4728
+ offsetWidthSize
4729
+ };
4730
+ };
4731
+ }
4732
+ }
4733
+ return () => {
4734
+ return {
4735
+ offsetLeftSize: 0,
4736
+ offsetWidthSize: 0
4737
+ };
4738
+ };
4739
+ };
4740
+ const handleParseColumn = () => {
4741
+ const ganttProps = $xeGantt.props;
4742
+ const {
4743
+ treeConfig
4744
+ } = ganttProps;
4745
+ const {
4746
+ minViewDate,
4747
+ maxViewDate
4748
+ } = reactData;
4749
+ const {
4750
+ fullCols,
4751
+ groupCols
4752
+ } = handleColumnHeader();
4753
+ if (minViewDate && maxViewDate && fullCols.length) {
4410
4754
  const $xeTable = internalData.xeTable;
4411
4755
  if ($xeTable) {
4412
4756
  const startField = computeStartField.value;
@@ -4432,20 +4776,21 @@ const maxYHeight = 5e6;
4432
4776
  } = treeOpts;
4433
4777
  const childrenField = treeOpts.children || treeOpts.childrenField;
4434
4778
  const ctMaps = {};
4779
+ const renderFn = createChartRender(fullCols);
4435
4780
  const handleParseRender = row => {
4436
4781
  const rowid = $xeTable.getRowid(row);
4437
4782
  const startValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, startField);
4438
4783
  const endValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, endField);
4439
4784
  if (startValue && endValue) {
4440
- const startDate = parseStringDate(startValue);
4441
- const endDate = parseStringDate(endValue);
4442
- const oLeftSize = Math.floor((startDate.getTime() - minViewDate.getTime()) / gapTime);
4443
- const oWidthSize = Math.floor((endDate.getTime() - startDate.getTime()) / gapTime) + 1;
4785
+ const {
4786
+ offsetLeftSize,
4787
+ offsetWidthSize
4788
+ } = renderFn(startValue, endValue);
4444
4789
  ctMaps[rowid] = {
4445
4790
  row,
4446
4791
  rowid,
4447
- oLeftSize,
4448
- oWidthSize
4792
+ oLeftSize: offsetLeftSize,
4793
+ oWidthSize: offsetWidthSize
4449
4794
  };
4450
4795
  }
4451
4796
  };
@@ -4734,13 +5079,13 @@ const maxYHeight = 5e6;
4734
5079
  rceRunTime
4735
5080
  } = internalData;
4736
5081
  const $xeTable = internalData.xeTable;
4737
- let refreshDelay = 50;
5082
+ let refreshDelay = 30;
4738
5083
  if ($xeTable) {
4739
5084
  const {
4740
5085
  computeResizeOpts
4741
5086
  } = $xeTable.getComputeMaps();
4742
5087
  const resizeOpts = computeResizeOpts.value;
4743
- refreshDelay = resizeOpts.refreshDelay || 50;
5088
+ refreshDelay = resizeOpts.refreshDelay || refreshDelay;
4744
5089
  }
4745
5090
  if (rceTimeout) {
4746
5091
  clearTimeout(rceTimeout);
@@ -5091,7 +5436,14 @@ const maxYHeight = 5e6;
5091
5436
  const ganttViewMethods = {
5092
5437
  refreshData() {
5093
5438
  handleUpdateData();
5094
- return handleLazyRecalculate();
5439
+ handleRecalculateStyle();
5440
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
5441
+ const $xeTable = internalData.xeTable;
5442
+ handleRecalculateStyle();
5443
+ if ($xeTable) {
5444
+ return $xeTable.recalculate();
5445
+ }
5446
+ });
5095
5447
  },
5096
5448
  updateViewData() {
5097
5449
  const $xeTable = internalData.xeTable;
@@ -5443,6 +5795,7 @@ var external_root_VxeUITable_commonjs_vxe_table_commonjs2_vxe_table_amd_vxe_tabl
5443
5795
 
5444
5796
 
5445
5797
 
5798
+
5446
5799
  const {
5447
5800
  getConfig,
5448
5801
  getIcon,
@@ -5463,6 +5816,7 @@ function gantt_createInternalData() {
5463
5816
  return {
5464
5817
  uFoot: false,
5465
5818
  resizeTableWidth: 0
5819
+ // barTipTimeout: undefined
5466
5820
  };
5467
5821
  }
5468
5822
  const viewTypeLevelMaps = {
@@ -5495,6 +5849,7 @@ function getViewTypeLevel(type) {
5495
5849
  taskViewScaleConfig: Object,
5496
5850
  taskViewConfig: Object,
5497
5851
  taskBarConfig: Object,
5852
+ taskBarTooltipConfig: Object,
5498
5853
  taskSplitConfig: Object,
5499
5854
  taskBarResizeConfig: Object,
5500
5855
  taskBarDragConfig: Object,
@@ -5515,6 +5870,7 @@ function getViewTypeLevel(type) {
5515
5870
  const VxeUIPagerComponent = core_.VxeUI.getComponent('VxePager');
5516
5871
  const VxeTableComponent = core_.VxeUI.getComponent('VxeTable');
5517
5872
  const VxeToolbarComponent = core_.VxeUI.getComponent('VxeToolbar');
5873
+ const VxeUITooltipComponent = core_.VxeUI.getComponent('VxeTooltip');
5518
5874
  const {
5519
5875
  computeSize
5520
5876
  } = useFns.useSize(props);
@@ -5535,7 +5891,13 @@ function getViewTypeLevel(type) {
5535
5891
  },
5536
5892
  showLeftView: true,
5537
5893
  showRightView: true,
5538
- taskScaleList: []
5894
+ taskScaleList: [],
5895
+ barTipStore: {
5896
+ row: null,
5897
+ content: '',
5898
+ visible: false,
5899
+ params: null
5900
+ }
5539
5901
  });
5540
5902
  const internalData = gantt_createInternalData();
5541
5903
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
@@ -5554,6 +5916,7 @@ function getViewTypeLevel(type) {
5554
5916
  const refPagerWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
5555
5917
  const refTableWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
5556
5918
  const refGanttWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
5919
+ const refTooltip = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
5557
5920
  const refResizableSplitTip = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
5558
5921
  const extendTableMethods = methodKeys => {
5559
5922
  const funcs = {};
@@ -5620,7 +5983,26 @@ function getViewTypeLevel(type) {
5620
5983
  const computeTaskSplitOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
5621
5984
  return Object.assign({}, getConfig().gantt.taskSplitConfig, props.taskSplitConfig);
5622
5985
  });
5623
- const computeTaskScaleConfs = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
5986
+ const computeTaskBarTooltipOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
5987
+ return Object.assign({}, getConfig().gantt.taskBarTooltipConfig, props.taskBarTooltipConfig);
5988
+ });
5989
+ const computeScaleUnit = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
5990
+ const minScale = computeMinScale.value;
5991
+ return minScale ? minScale.type : 'date';
5992
+ });
5993
+ const computeMinScale = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
5994
+ const {
5995
+ taskScaleList
5996
+ } = reactData;
5997
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().last(taskScaleList);
5998
+ });
5999
+ const computeWeekScale = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6000
+ const {
6001
+ taskScaleList
6002
+ } = reactData;
6003
+ return taskScaleList.find(item => item.type === 'week');
6004
+ });
6005
+ const computeTaskViewScales = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
5624
6006
  const taskViewOpts = computeTaskViewOpts.value;
5625
6007
  const {
5626
6008
  scales
@@ -5880,7 +6262,11 @@ function getViewTypeLevel(type) {
5880
6262
  computeTaskBarDragOpts,
5881
6263
  computeTaskBarResizeOpts,
5882
6264
  computeTaskSplitOpts,
5883
- computeTaskScaleConfs,
6265
+ computeTaskBarTooltipOpts,
6266
+ computeTaskViewScales,
6267
+ computeScaleUnit,
6268
+ computeMinScale,
6269
+ computeWeekScale,
5884
6270
  computeTitleField,
5885
6271
  computeStartField,
5886
6272
  computeEndField,
@@ -5889,6 +6275,7 @@ function getViewTypeLevel(type) {
5889
6275
  computeScrollbarXToTop,
5890
6276
  computeScrollbarYToLeft
5891
6277
  };
6278
+ computeMaps.computeTaskScaleConfs = computeTaskViewScales;
5892
6279
  const $xeGantt = {
5893
6280
  xID,
5894
6281
  props: props,
@@ -5899,7 +6286,7 @@ function getViewTypeLevel(type) {
5899
6286
  getComputeMaps: () => computeMaps
5900
6287
  };
5901
6288
  const handleTaskScaleConfig = () => {
5902
- const taskScaleConfs = computeTaskScaleConfs.value;
6289
+ const taskScaleConfs = computeTaskViewScales.value;
5903
6290
  const taskViewScaleOpts = computeTaskViewScaleOpts.value;
5904
6291
  const scaleConfs = [];
5905
6292
  if (taskScaleConfs) {
@@ -6436,6 +6823,17 @@ function getViewTypeLevel(type) {
6436
6823
  $gantt: $xeGantt
6437
6824
  }, params));
6438
6825
  };
6826
+ const handleTargetEnterEvent = isClear => {
6827
+ const $tooltip = refTooltip.value;
6828
+ clearTimeout(internalData.barTipTimeout);
6829
+ if (isClear) {
6830
+ $xeGantt.closeTaskBarTooltip();
6831
+ } else {
6832
+ if ($tooltip && $tooltip.setActived) {
6833
+ $tooltip.setActived(true);
6834
+ }
6835
+ }
6836
+ };
6439
6837
  const ganttMethods = {
6440
6838
  dispatchEvent,
6441
6839
  getEl() {
@@ -7171,6 +7569,27 @@ function getViewTypeLevel(type) {
7171
7569
  hideTaskView() {
7172
7570
  reactData.showRightView = false;
7173
7571
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
7572
+ },
7573
+ /**
7574
+ * 关闭 bar tooltip
7575
+ */
7576
+ closeTaskBarTooltip() {
7577
+ const {
7578
+ barTipStore
7579
+ } = reactData;
7580
+ const $tooltip = refTooltip.value;
7581
+ if (barTipStore.visible) {
7582
+ Object.assign(barTipStore, {
7583
+ row: null,
7584
+ content: null,
7585
+ visible: false,
7586
+ params: {}
7587
+ });
7588
+ if ($tooltip && $tooltip.close) {
7589
+ $tooltip.close();
7590
+ }
7591
+ }
7592
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
7174
7593
  }
7175
7594
  };
7176
7595
  const ganttPrivateMethods = {
@@ -7316,6 +7735,58 @@ function getViewTypeLevel(type) {
7316
7735
  handleTaskBarDblclickEvent(evnt, params) {
7317
7736
  $xeGantt.dispatchEvent('task-bar-dblclick', params, evnt);
7318
7737
  },
7738
+ triggerTaskBarTooltipEvent(evnt, params) {
7739
+ const {
7740
+ barTipStore
7741
+ } = reactData;
7742
+ const taskBarTooltipOpts = computeTaskBarTooltipOpts.value;
7743
+ const titleField = computeTitleField.value;
7744
+ const {
7745
+ contentMethod
7746
+ } = taskBarTooltipOpts;
7747
+ const {
7748
+ row
7749
+ } = params;
7750
+ let content = formatText(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, titleField));
7751
+ if (contentMethod) {
7752
+ content = formatText(contentMethod(params));
7753
+ }
7754
+ handleTargetEnterEvent(barTipStore.row !== row);
7755
+ const tipContent = formatText(content);
7756
+ Object.assign(barTipStore, {
7757
+ row,
7758
+ visible: true,
7759
+ content: tipContent,
7760
+ params
7761
+ });
7762
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
7763
+ const $tooltip = refTooltip.value;
7764
+ if ($tooltip) {
7765
+ if ($tooltip.openByEvent) {
7766
+ $tooltip.openByEvent(evnt, evnt.currentTarget, tipContent);
7767
+ } else if ($tooltip.open) {
7768
+ $tooltip.open(evnt.currentTarget, tipContent);
7769
+ }
7770
+ }
7771
+ });
7772
+ },
7773
+ handleTaskBarTooltipLeaveEvent() {
7774
+ const taskBarTooltipOpts = computeTaskBarTooltipOpts.value;
7775
+ let $tooltip = refTooltip.value;
7776
+ if ($tooltip && $tooltip.setActived) {
7777
+ $tooltip.setActived(false);
7778
+ }
7779
+ if (taskBarTooltipOpts.enterable) {
7780
+ internalData.barTipTimeout = setTimeout(() => {
7781
+ $tooltip = refTooltip.value;
7782
+ if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
7783
+ $xeGantt.closeTaskBarTooltip();
7784
+ }
7785
+ }, taskBarTooltipOpts.leaveDelay);
7786
+ } else {
7787
+ $xeGantt.closeTaskBarTooltip();
7788
+ }
7789
+ },
7319
7790
  handleTaskHeaderContextmenuEvent(evnt, params) {
7320
7791
  const $xeTable = refTable.value;
7321
7792
  if ($xeTable) {
@@ -7769,14 +8240,19 @@ function getViewTypeLevel(type) {
7769
8240
  return childVNs;
7770
8241
  };
7771
8242
  const renderLayout = () => {
8243
+ const {
8244
+ barTipStore
8245
+ } = reactData;
7772
8246
  const currLayoutConf = computeCurrLayoutConf.value;
7773
8247
  const {
7774
8248
  headKeys,
7775
8249
  bodyKeys,
7776
8250
  footKeys
7777
8251
  } = currLayoutConf;
8252
+ const taskBarTooltipOpts = computeTaskBarTooltipOpts.value;
7778
8253
  const asideLeftSlot = slots.asideLeft || slots['aside-left'];
7779
8254
  const asideRightSlot = slots.asideRight || slots['aside-right'];
8255
+ const taskBarTooltipSlot = slots.taskBarTooltip || slots['task-bar-tooltip'];
7780
8256
  return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7781
8257
  class: 'vxe-gantt--layout-header-wrapper'
7782
8258
  }, renderChildLayout(headKeys)), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
@@ -7791,7 +8267,40 @@ function getViewTypeLevel(type) {
7791
8267
  class: 'vxe-gantt--layout-footer-wrapper'
7792
8268
  }, renderChildLayout(footKeys)), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7793
8269
  ref: refPopupContainerElem
7794
- })];
8270
+ }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {}, [
8271
+ /**
8272
+ * 任务条提示
8273
+ */
8274
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUITooltipComponent, {
8275
+ key: 'gtp',
8276
+ ref: refTooltip,
8277
+ theme: taskBarTooltipOpts.theme,
8278
+ enterable: taskBarTooltipOpts.enterable,
8279
+ enterDelay: taskBarTooltipOpts.enterDelay,
8280
+ leaveDelay: taskBarTooltipOpts.leaveDelay,
8281
+ useHTML: taskBarTooltipOpts.useHTML,
8282
+ width: taskBarTooltipOpts.width,
8283
+ height: taskBarTooltipOpts.height,
8284
+ minWidth: taskBarTooltipOpts.minWidth,
8285
+ minHeight: taskBarTooltipOpts.minHeight,
8286
+ maxWidth: taskBarTooltipOpts.maxWidth,
8287
+ maxHeight: taskBarTooltipOpts.maxHeight,
8288
+ isArrow: false
8289
+ }, taskBarTooltipSlot ? {
8290
+ content: () => {
8291
+ const {
8292
+ row,
8293
+ content: tooltipContent
8294
+ } = barTipStore;
8295
+ if (row) {
8296
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {}, taskBarTooltipSlot(Object.assign({
8297
+ tooltipContent,
8298
+ $gantt: $xeGantt
8299
+ }, barTipStore.params)));
8300
+ }
8301
+ return gantt_renderEmptyElement($xeGantt);
8302
+ }
8303
+ } : {})])];
7795
8304
  };
7796
8305
  const renderVN = () => {
7797
8306
  const {
@@ -7842,8 +8351,9 @@ function getViewTypeLevel(type) {
7842
8351
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.proxyConfig, () => {
7843
8352
  initProxy();
7844
8353
  });
7845
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeTaskScaleConfs, () => {
8354
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeTaskViewScales, () => {
7846
8355
  handleTaskScaleConfig();
8356
+ $xeGantt.refreshTaskView();
7847
8357
  });
7848
8358
  hooks.forEach(options => {
7849
8359
  const {