vxe-gantt 4.1.18 → 4.1.20

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.
Files changed (49) hide show
  1. package/README.md +20 -3
  2. package/es/gantt/src/emits.js +4 -1
  3. package/es/gantt/src/gantt-body.js +2 -2
  4. package/es/gantt/src/gantt-chart.js +75 -53
  5. package/es/gantt/src/gantt-view.js +19 -9
  6. package/es/gantt/src/gantt.js +79 -39
  7. package/es/gantt/src/util.js +0 -3
  8. package/es/gantt/style.css +16 -2
  9. package/es/gantt/style.min.css +1 -1
  10. package/es/style.css +1 -1
  11. package/es/style.min.css +1 -1
  12. package/es/ui/index.js +2 -1
  13. package/es/ui/src/log.js +1 -1
  14. package/es/vxe-gantt/style.css +16 -2
  15. package/es/vxe-gantt/style.min.css +1 -1
  16. package/lib/gantt/src/emits.js +1 -1
  17. package/lib/gantt/src/emits.min.js +1 -1
  18. package/lib/gantt/src/gantt-body.js +4 -2
  19. package/lib/gantt/src/gantt-body.min.js +1 -1
  20. package/lib/gantt/src/gantt-chart.js +72 -44
  21. package/lib/gantt/src/gantt-chart.min.js +1 -1
  22. package/lib/gantt/src/gantt-view.js +19 -9
  23. package/lib/gantt/src/gantt-view.min.js +1 -1
  24. package/lib/gantt/src/gantt.js +89 -38
  25. package/lib/gantt/src/gantt.min.js +1 -1
  26. package/lib/gantt/src/util.js +0 -4
  27. package/lib/gantt/src/util.min.js +1 -1
  28. package/lib/gantt/style/style.css +16 -2
  29. package/lib/gantt/style/style.min.css +1 -1
  30. package/lib/index.umd.js +184 -93
  31. package/lib/index.umd.min.js +1 -1
  32. package/lib/style.css +1 -1
  33. package/lib/style.min.css +1 -1
  34. package/lib/ui/index.js +2 -1
  35. package/lib/ui/index.min.js +1 -1
  36. package/lib/ui/src/log.js +1 -1
  37. package/lib/ui/src/log.min.js +1 -1
  38. package/lib/vxe-gantt/style/style.css +16 -2
  39. package/lib/vxe-gantt/style/style.min.css +1 -1
  40. package/package.json +3 -3
  41. package/packages/gantt/src/emits.ts +4 -1
  42. package/packages/gantt/src/gantt-body.ts +2 -2
  43. package/packages/gantt/src/gantt-chart.ts +78 -53
  44. package/packages/gantt/src/gantt-view.ts +19 -9
  45. package/packages/gantt/src/gantt.ts +84 -40
  46. package/packages/gantt/src/util.ts +0 -4
  47. package/packages/ui/index.ts +1 -0
  48. package/styles/components/gantt-module/gantt-chart.scss +14 -2
  49. package/styles/theme/base.scss +1 -0
package/lib/index.umd.js CHANGED
@@ -2785,7 +2785,7 @@ const {
2785
2785
  setConfig,
2786
2786
  setIcon
2787
2787
  } = core_.VxeUI;
2788
- core_.VxeUI.ganttVersion = "4.1.18";
2788
+ core_.VxeUI.ganttVersion = "4.1.20";
2789
2789
  const ymdFormat = 'yyyy-MM-dd';
2790
2790
  const ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
2791
2791
  setConfig({
@@ -2831,6 +2831,7 @@ setConfig({
2831
2831
  },
2832
2832
  taskLinkConfig: {
2833
2833
  enabled: true,
2834
+ isHover: true,
2834
2835
  showArrow: true
2835
2836
  },
2836
2837
  taskViewScaleConfig: {
@@ -2894,7 +2895,7 @@ setIcon({
2894
2895
  const {
2895
2896
  log
2896
2897
  } = core_.VxeUI;
2897
- const version = `gantt v${"4.1.18"}`;
2898
+ const version = `gantt v${"4.1.20"}`;
2898
2899
  const warnLog = log.create('warn', version);
2899
2900
  const errLog = log.create('error', version);
2900
2901
  ;// ./packages/ui/src/depend.ts
@@ -3343,7 +3344,7 @@ const tableEmits = ['ready', 'init-rendered', 'data-rendered', 'update:data', 'k
3343
3344
  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'];
3344
3345
  ;// ./packages/gantt/src/emits.ts
3345
3346
 
3346
- 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', 'task-move-start', 'task-move-drag', 'task-move-end', 'task-resize-start', 'task-resize-drag', 'task-resize-end'];
3347
+ 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', 'task-move-start', 'task-move-drag', 'task-move-end', 'task-resize-start', 'task-resize-drag', 'task-resize-end', 'task-link-click', 'task-link-dblclick', 'task-link-remove'];
3347
3348
  ;// ./packages/gantt/src/util.ts
3348
3349
  function getRefElem(refEl) {
3349
3350
  if (refEl) {
@@ -3380,9 +3381,6 @@ function getTaskBarLeft(chartRest, viewCellWidth) {
3380
3381
  function getTaskBarWidth(chartRest, viewCellWidth) {
3381
3382
  return Math.max(1, chartRest ? Math.floor(viewCellWidth * chartRest.oWidthSize) - 1 : 0);
3382
3383
  }
3383
- function getTaskLinkKey(from, to) {
3384
- return `${from}_${to}`;
3385
- }
3386
3384
  const taskTypeMaps = {
3387
3385
  milestone: true
3388
3386
  };
@@ -3575,6 +3573,7 @@ const gantt_chart_viewType = 'chart';
3575
3573
  const $xeGanttView = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeGanttView', {});
3576
3574
  const {
3577
3575
  props: ganttProps,
3576
+ reactData: ganttReactData,
3578
3577
  internalData: ganttInternalData
3579
3578
  } = $xeGantt;
3580
3579
  const {
@@ -3592,12 +3591,9 @@ const gantt_chart_viewType = 'chart';
3592
3591
  } = $xeGantt.getComputeMaps();
3593
3592
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
3594
3593
  const refTaskWrapperElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
3595
- const reflineWrapperElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
3594
+ const refChartBeforeWrapperElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
3595
+ const refChartAfterWrapperElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
3596
3596
  const renderTaskBar = ($xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex) => {
3597
- const tableProps = $xeTable.props;
3598
- const {
3599
- treeConfig
3600
- } = tableProps;
3601
3597
  const tableReactData = $xeTable.reactData;
3602
3598
  const {
3603
3599
  resizeHeightFlag
@@ -3619,6 +3615,10 @@ const gantt_chart_viewType = 'chart';
3619
3615
  const {
3620
3616
  taskBarMilestoneConfig
3621
3617
  } = ganttProps;
3618
+ const {
3619
+ activeLink,
3620
+ activeBarRowid
3621
+ } = ganttReactData;
3622
3622
  const titleField = computeTitleField.value;
3623
3623
  const progressField = computeProgressField.value;
3624
3624
  const typeField = computeTypeField.value;
@@ -3682,21 +3682,9 @@ const gantt_chart_viewType = 'chart';
3682
3682
  rowIndex,
3683
3683
  _rowIndex
3684
3684
  };
3685
- const ons = {
3686
- onClick(evnt) {
3687
- $xeGantt.handleTaskBarClickEvent(evnt, barParams);
3688
- },
3689
- onDblclick(evnt) {
3690
- $xeGantt.handleTaskBarDblclickEvent(evnt, barParams);
3691
- },
3692
- onMousedown(evnt) {
3693
- if ($xeGantt.handleTaskBarMousedownEvent) {
3694
- $xeGantt.handleTaskBarMousedownEvent(evnt, barParams);
3695
- }
3696
- }
3697
- };
3685
+ const ctOns = {};
3698
3686
  if (showTooltip) {
3699
- ons.onMouseover = evnt => {
3687
+ ctOns.onMouseover = evnt => {
3700
3688
  const {
3701
3689
  dragBarRow
3702
3690
  } = ganttInternalData;
@@ -3708,7 +3696,7 @@ const gantt_chart_viewType = 'chart';
3708
3696
  }
3709
3697
  $xeGantt.dispatchEvent('task-bar-mouseenter', ttParams, evnt);
3710
3698
  };
3711
- ons.onMouseleave = evnt => {
3699
+ ctOns.onMouseleave = evnt => {
3712
3700
  const {
3713
3701
  dragBarRow
3714
3702
  } = ganttInternalData;
@@ -3727,12 +3715,15 @@ const gantt_chart_viewType = 'chart';
3727
3715
  isMilestone,
3728
3716
  title,
3729
3717
  vbStyle,
3730
- vpStyle
3718
+ vpStyle,
3719
+ rowid,
3720
+ ctOns
3731
3721
  });
3732
3722
  } else if (taskBarSlot) {
3733
3723
  cbVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3734
3724
  key: 'cbc',
3735
- class: 'vxe-gantt-view--chart-custom-bar-content'
3725
+ class: 'vxe-gantt-view--chart-custom-bar-content-wrapper',
3726
+ ...ctOns
3736
3727
  }, $xeGantt.callSlot(taskBarSlot, barParams)));
3737
3728
  } else {
3738
3729
  if (isMilestone) {
@@ -3747,7 +3738,8 @@ const gantt_chart_viewType = 'chart';
3747
3738
  };
3748
3739
  cbVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3749
3740
  key: 'vcm',
3750
- class: 'vxe-gantt-view--chart-milestone-wrapper'
3741
+ class: 'vxe-gantt-view--chart-milestone-wrapper',
3742
+ ...ctOns
3751
3743
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3752
3744
  class: ['vxe-gantt-view--chart-milestone-icon', iconStatus ? `theme--${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(iconStatus) ? iconStatus(tbmParams) : iconStatus}` : ''],
3753
3745
  style: iconStyle ? Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(iconStyle) ? iconStyle(tbmParams) : iconStyle) : undefined
@@ -3757,18 +3749,22 @@ const gantt_chart_viewType = 'chart';
3757
3749
  class: 'vxe-gantt-view--chart-milestone-content'
3758
3750
  }, title) : renderEmptyElement($xeGantt)]));
3759
3751
  } else {
3760
- cbVNs.push(showProgress ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3752
+ cbVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3753
+ key: 'vbc',
3754
+ class: 'vxe-gantt-view--chart-bar-content-wrapper',
3755
+ ...ctOns
3756
+ }, [showProgress ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3761
3757
  key: 'vcp',
3762
3758
  class: 'vxe-gantt-view--chart-progress',
3763
3759
  style: vpStyle
3764
3760
  }) : renderEmptyElement($xeGantt), showContent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3765
3761
  key: 'vcc',
3766
3762
  class: 'vxe-gantt-view--chart-content'
3767
- }, title) : renderEmptyElement($xeGantt));
3763
+ }, title) : renderEmptyElement($xeGantt)]));
3768
3764
  }
3769
3765
  }
3770
3766
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3771
- key: treeConfig ? rowid : $rowIndex,
3767
+ key: rowid,
3772
3768
  rowid,
3773
3769
  class: ['vxe-gantt-view--chart-row', `is--${gettaskType(typeValue)}`, {
3774
3770
  'is--round': round,
@@ -3781,10 +3777,23 @@ const gantt_chart_viewType = 'chart';
3781
3777
  $xeGantt.handleTaskBarContextmenuEvent(evnt, ctParams);
3782
3778
  }
3783
3779
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3784
- class: [taskBarSlot ? 'vxe-gantt-view--chart-custom-bar' : 'vxe-gantt-view--chart-bar', `is--${gettaskType(typeValue)}`],
3780
+ class: [taskBarSlot ? 'vxe-gantt-view--chart-custom-bar' : 'vxe-gantt-view--chart-bar', `is--${gettaskType(typeValue)}`, {
3781
+ 'is--active': activeBarRowid === rowid,
3782
+ 'active--link': activeLink && (rowid === `${activeLink.from}` || rowid === `${activeLink.to}`)
3783
+ }],
3785
3784
  style: vbStyle,
3786
3785
  rowid,
3787
- ...ons
3786
+ onClick(evnt) {
3787
+ $xeGantt.handleTaskBarClickEvent(evnt, barParams);
3788
+ },
3789
+ onDblclick(evnt) {
3790
+ $xeGantt.handleTaskBarDblclickEvent(evnt, barParams);
3791
+ },
3792
+ onMousedown(evnt) {
3793
+ if ($xeGantt.handleTaskBarMousedownEvent) {
3794
+ $xeGantt.handleTaskBarMousedownEvent(evnt, barParams);
3795
+ }
3796
+ }
3788
3797
  }, cbVNs)]);
3789
3798
  };
3790
3799
  const renderTaskRows = ($xeTable, tableData) => {
@@ -3838,25 +3847,42 @@ const gantt_chart_viewType = 'chart';
3838
3847
  };
3839
3848
  const renderVN = () => {
3840
3849
  const $xeTable = ganttViewInternalData.xeTable;
3850
+ const {
3851
+ dragLinkFromStore
3852
+ } = ganttReactData;
3841
3853
  const {
3842
3854
  tableData
3843
3855
  } = ganttViewReactData;
3844
3856
  const taskLinkOpts = computeTaskLinkOpts.value;
3857
+ const taskBarOpts = computeTaskBarOpts.value;
3845
3858
  const {
3846
- showArrow
3859
+ isCurrent,
3860
+ isHover
3847
3861
  } = taskLinkOpts;
3862
+ const {
3863
+ linkCreatable
3864
+ } = taskBarOpts;
3848
3865
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3849
3866
  ref: refElem,
3850
- class: 'vxe-gantt-view--chart-wrapper'
3851
- }, [$xeGantt.renderGanttTaskLines ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3852
- ref: reflineWrapperElem,
3853
- class: ['vxe-gantt-view--chart-line-wrapper', {
3854
- 'show-arrow': showArrow
3867
+ class: ['vxe-gantt-view--chart-wrapper', {
3868
+ 'is--cl-drag': dragLinkFromStore.rowid
3869
+ }]
3870
+ }, [$xeGantt.renderGanttTaskChartBefores ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3871
+ ref: refChartBeforeWrapperElem,
3872
+ class: ['vxe-gantt-view--chart-before-wrapper', {
3873
+ 'link--current': isCurrent,
3874
+ 'link--hover': isHover
3855
3875
  }]
3856
- }, $xeTable && isEnableConf(taskLinkOpts) ? $xeGantt.renderGanttTaskLines() : []) : renderEmptyElement($xeGantt), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3876
+ }, $xeTable && isEnableConf(taskLinkOpts) ? $xeGantt.renderGanttTaskChartBefores() : []) : renderEmptyElement($xeGantt), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3857
3877
  ref: refTaskWrapperElem,
3858
- class: 'vxe-gantt-view--chart-task-wrapper'
3859
- }, $xeTable ? renderTaskRows($xeTable, tableData) : [])]);
3878
+ class: ['vxe-gantt-view--chart-task-wrapper', {
3879
+ 'link--current': isCurrent,
3880
+ 'link--create': linkCreatable
3881
+ }]
3882
+ }, $xeTable ? renderTaskRows($xeTable, tableData) : []), $xeGantt.renderGanttTaskChartAfters ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3883
+ ref: refChartAfterWrapperElem,
3884
+ class: 'vxe-gantt-view--chart-after-wrapper'
3885
+ }, $xeTable && isEnableConf(taskLinkOpts) ? $xeGantt.renderGanttTaskChartAfters() : []) : renderEmptyElement($xeGantt)]);
3860
3886
  };
3861
3887
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
3862
3888
  const {
@@ -3864,7 +3890,8 @@ const gantt_chart_viewType = 'chart';
3864
3890
  } = ganttViewInternalData;
3865
3891
  const prefix = 'main-chart-';
3866
3892
  elemStore[`${prefix}task-wrapper`] = refTaskWrapperElem;
3867
- elemStore[`${prefix}line-wrapper`] = reflineWrapperElem;
3893
+ elemStore[`${prefix}before-wrapper`] = refChartBeforeWrapperElem;
3894
+ elemStore[`${prefix}after-wrapper`] = refChartAfterWrapperElem;
3868
3895
  });
3869
3896
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
3870
3897
  const {
@@ -3872,7 +3899,8 @@ const gantt_chart_viewType = 'chart';
3872
3899
  } = ganttViewInternalData;
3873
3900
  const prefix = 'main-chart-';
3874
3901
  elemStore[`${prefix}task-wrapper`] = null;
3875
- elemStore[`${prefix}line-wrapper`] = null;
3902
+ elemStore[`${prefix}before-wrapper`] = null;
3903
+ elemStore[`${prefix}after-wrapper`] = null;
3876
3904
  });
3877
3905
  return renderVN;
3878
3906
  }
@@ -4071,7 +4099,9 @@ const gantt_body_viewType = 'body';
4071
4099
  } = taskViewOpts;
4072
4100
  const {
4073
4101
  rowClassName,
4074
- rowStyle
4102
+ rowStyle,
4103
+ cellClassName,
4104
+ cellStyle
4075
4105
  } = viewStyle || {};
4076
4106
  const {
4077
4107
  tableColumn,
@@ -4122,7 +4152,7 @@ const gantt_body_viewType = 'body';
4122
4152
  _rowIndex
4123
4153
  };
4124
4154
  trVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
4125
- key: treeConfig ? rowid : $rowIndex,
4155
+ key: rowClassName || rowStyle || cellClassName || cellStyle ? rowid : $rowIndex,
4126
4156
  class: ['vxe-gantt-view--body-row', {
4127
4157
  'row--stripe': stripe && (_rowIndex + 1) % 2 === 0,
4128
4158
  'is--new': isNewRow,
@@ -5305,7 +5335,7 @@ const maxYHeight = 5e6;
5305
5335
  bodyTableElem.style.width = `${vmTableWidth}px`;
5306
5336
  }
5307
5337
  reactData.scrollXWidth = viewTableWidth;
5308
- return Promise.all([updateTaskChart(), $xeGantt.handleUpdateTaskLink ? $xeGantt.handleUpdateTaskLink($xeGanttView) : null]);
5338
+ return Promise.all([updateTaskChart(), $xeGantt.handleUpdateTaskLinkStyle ? $xeGantt.handleUpdateTaskLinkStyle($xeGanttView) : null]);
5309
5339
  };
5310
5340
  const handleRecalculateStyle = () => {
5311
5341
  const el = refElem.value;
@@ -5501,10 +5531,15 @@ const maxYHeight = 5e6;
5501
5531
  if (scrollXSpaceEl) {
5502
5532
  scrollXSpaceEl.style.width = `${scrollXWidth}px`;
5503
5533
  }
5504
- const lineWrapper = getRefElem(elemStore['main-chart-line-wrapper']);
5505
- const svgElem = lineWrapper ? lineWrapper.firstElementChild : null;
5506
- if (svgElem) {
5507
- svgElem.style.width = `${scrollXWidth}px`;
5534
+ const beforeWrapper = getRefElem(elemStore['main-chart-before-wrapper']);
5535
+ const beforeSvgElem = beforeWrapper ? beforeWrapper.firstElementChild : null;
5536
+ if (beforeSvgElem) {
5537
+ beforeSvgElem.style.width = `${scrollXWidth}px`;
5538
+ }
5539
+ const afterWrapper = getRefElem(elemStore['main-chart-after-wrapper']);
5540
+ const afterSvgElem = afterWrapper ? afterWrapper.firstElementChild : null;
5541
+ if (afterSvgElem) {
5542
+ afterSvgElem.style.width = `${scrollXWidth}px`;
5508
5543
  }
5509
5544
  calcScrollbar();
5510
5545
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
@@ -5558,10 +5593,15 @@ const maxYHeight = 5e6;
5558
5593
  if (scrollYSpaceEl) {
5559
5594
  scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
5560
5595
  }
5561
- const lineWrapper = getRefElem(elemStore['main-chart-line-wrapper']);
5562
- const svgElem = lineWrapper ? lineWrapper.firstElementChild : null;
5563
- if (svgElem) {
5564
- svgElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
5596
+ const beforeWrapper = getRefElem(elemStore['main-chart-before-wrapper']);
5597
+ const beforeSvgElem = beforeWrapper ? beforeWrapper.firstElementChild : null;
5598
+ if (beforeSvgElem) {
5599
+ beforeSvgElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
5600
+ }
5601
+ const afterWrapper = getRefElem(elemStore['main-chart-after-wrapper']);
5602
+ const afterSvgElem = afterWrapper ? afterWrapper.firstElementChild : null;
5603
+ if (afterSvgElem) {
5604
+ afterSvgElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
5565
5605
  }
5566
5606
  reactData.scrollYTop = scrollYTop;
5567
5607
  reactData.scrollYHeight = scrollYHeight;
@@ -6076,9 +6116,51 @@ function gantt_createInternalData() {
6076
6116
  linkFromKeyMaps: {},
6077
6117
  linkUniqueMaps: {},
6078
6118
  uFoot: false,
6079
- resizeTableWidth: 0
6080
- // barTipTimeout: null
6081
- // dragBarRow: null
6119
+ resizeTableWidth: 0,
6120
+ // barTipTimeout: null,
6121
+ // dragBarRow: null,
6122
+ // dragLineRow: null,
6123
+ dragLinkToStore: {
6124
+ rowid: null,
6125
+ type: 0
6126
+ }
6127
+ };
6128
+ }
6129
+ function createReactData() {
6130
+ return {
6131
+ tableLoading: false,
6132
+ proxyInited: false,
6133
+ isZMax: false,
6134
+ tableLinks: [],
6135
+ tableData: [],
6136
+ filterData: [],
6137
+ formData: {},
6138
+ sortData: [],
6139
+ footerData: [],
6140
+ tZindex: 0,
6141
+ tablePage: {
6142
+ total: 0,
6143
+ pageSize: getConfig().pager?.pageSize || 10,
6144
+ currentPage: 1
6145
+ },
6146
+ showLeftView: true,
6147
+ showRightView: true,
6148
+ taskScaleList: [],
6149
+ barTipStore: {
6150
+ row: null,
6151
+ content: '',
6152
+ visible: false,
6153
+ params: null
6154
+ },
6155
+ dragLinkFromStore: {
6156
+ rowid: null,
6157
+ type: 0
6158
+ },
6159
+ activeBarRowid: null,
6160
+ activeLink: null,
6161
+ isActiveCeLe: false,
6162
+ linkList: [],
6163
+ upLinkFlag: 0
6082
6164
  };
6083
6165
  }
6084
6166
  const viewTypeLevelMaps = {
@@ -6139,34 +6221,7 @@ function getViewTypeLevel(type) {
6139
6221
  const {
6140
6222
  computeSize
6141
6223
  } = useFns.useSize(props);
6142
- const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
6143
- tableLoading: false,
6144
- proxyInited: false,
6145
- isZMax: false,
6146
- tableLinks: [],
6147
- tableData: [],
6148
- filterData: [],
6149
- formData: {},
6150
- sortData: [],
6151
- footerData: [],
6152
- tZindex: 0,
6153
- tablePage: {
6154
- total: 0,
6155
- pageSize: getConfig().pager?.pageSize || 10,
6156
- currentPage: 1
6157
- },
6158
- showLeftView: true,
6159
- showRightView: true,
6160
- taskScaleList: [],
6161
- barTipStore: {
6162
- row: null,
6163
- content: '',
6164
- visible: false,
6165
- params: null
6166
- },
6167
- linkList: [],
6168
- upLinkFlag: 0
6169
- });
6224
+ const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(createReactData());
6170
6225
  const internalData = gantt_createInternalData();
6171
6226
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6172
6227
  const refTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
@@ -6283,6 +6338,15 @@ function getViewTypeLevel(type) {
6283
6338
  } = taskViewOpts;
6284
6339
  return scales;
6285
6340
  });
6341
+ const computeTaskLinkStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6342
+ const {
6343
+ lineType,
6344
+ lineWidth,
6345
+ lineStatus,
6346
+ lineColor
6347
+ } = computeTaskLinkOpts.value;
6348
+ return `${lineType || ''}_${lineWidth || ''}_${lineStatus || ''}_${lineColor || ''}`;
6349
+ });
6286
6350
  const computeTitleField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6287
6351
  const taskOpts = computeTaskOpts.value;
6288
6352
  return taskOpts.titleField || 'title';
@@ -8000,12 +8064,26 @@ function getViewTypeLevel(type) {
8000
8064
  $xeTable.handleToggleCheckRowEvent(evnt, params);
8001
8065
  }
8002
8066
  }
8067
+ reactData.isActiveCeLe = false;
8068
+ reactData.activeBarRowid = null;
8069
+ reactData.activeLink = null;
8003
8070
  $xeGantt.dispatchEvent('task-cell-click', params, evnt);
8004
8071
  },
8005
8072
  handleTaskCellDblclickEvent(evnt, params) {
8006
8073
  $xeGantt.dispatchEvent('task-cell-dblclick', params, evnt);
8007
8074
  },
8008
8075
  handleTaskBarClickEvent(evnt, params) {
8076
+ const $xeTable = refTable.value;
8077
+ const taskBarOpts = computeTaskBarOpts.value;
8078
+ const {
8079
+ linkCreatable
8080
+ } = taskBarOpts;
8081
+ const {
8082
+ row
8083
+ } = params;
8084
+ reactData.isActiveCeLe = !!linkCreatable;
8085
+ reactData.activeBarRowid = $xeTable ? $xeTable.getRowid(row) : row;
8086
+ reactData.activeLink = null;
8009
8087
  $xeGantt.dispatchEvent('task-bar-click', params, evnt);
8010
8088
  },
8011
8089
  handleTaskBarDblclickEvent(evnt, params) {
@@ -8013,12 +8091,17 @@ function getViewTypeLevel(type) {
8013
8091
  },
8014
8092
  triggerTaskBarTooltipEvent(evnt, params) {
8015
8093
  const {
8016
- barTipStore
8094
+ barTipStore,
8095
+ activeLink
8017
8096
  } = reactData;
8018
8097
  const {
8019
- dragBarRow
8098
+ dragBarRow,
8099
+ dragLineRow
8020
8100
  } = internalData;
8021
- if (dragBarRow) {
8101
+ if (dragBarRow || dragLineRow) {
8102
+ return;
8103
+ }
8104
+ if (activeLink) {
8022
8105
  return;
8023
8106
  }
8024
8107
  const taskBarTooltipOpts = computeTaskBarTooltipOpts.value;
@@ -8640,6 +8723,11 @@ function getViewTypeLevel(type) {
8640
8723
  handleTaskScaleConfig();
8641
8724
  $xeGantt.refreshTaskView();
8642
8725
  });
8726
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeTaskLinkStyle, () => {
8727
+ if ($xeGantt.handleUpdateTaskLinkData) {
8728
+ $xeGantt.handleUpdateTaskLinkData();
8729
+ }
8730
+ });
8643
8731
  hooks.forEach(options => {
8644
8732
  const {
8645
8733
  setupGantt
@@ -8651,15 +8739,15 @@ function getViewTypeLevel(type) {
8651
8739
  }
8652
8740
  }
8653
8741
  });
8654
- if ($xeGantt.handleTaskUpdateLinks) {
8742
+ if ($xeGantt.handleTaskLoadLinks) {
8655
8743
  if (props.links) {
8656
- $xeGantt.handleTaskUpdateLinks(props.links);
8744
+ $xeGantt.handleTaskLoadLinks(props.links);
8657
8745
  }
8658
8746
  }
8659
8747
  handleTaskScaleConfig();
8660
8748
  initPages();
8661
8749
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
8662
- if (!$xeGantt.handleUpdateTaskLink) {
8750
+ if (!$xeGantt.handleUpdateTaskLinkData) {
8663
8751
  if (props.links) {
8664
8752
  warnLog('vxe.error.notProp', ['links']);
8665
8753
  }
@@ -8714,6 +8802,9 @@ function getViewTypeLevel(type) {
8714
8802
  initGanttView();
8715
8803
  gantt_globalEvents.on($xeGantt, 'keydown', handleGlobalKeydownEvent);
8716
8804
  });
8805
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
8806
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(reactData, createReactData());
8807
+ });
8717
8808
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
8718
8809
  gantt_globalEvents.off($xeGantt, 'keydown');
8719
8810
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, gantt_createInternalData());