vxe-gantt 4.1.18 → 4.1.19

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 (44) hide show
  1. package/es/gantt/src/emits.js +4 -1
  2. package/es/gantt/src/gantt-chart.js +75 -53
  3. package/es/gantt/src/gantt-view.js +19 -9
  4. package/es/gantt/src/gantt.js +79 -39
  5. package/es/gantt/src/util.js +0 -3
  6. package/es/gantt/style.css +16 -2
  7. package/es/gantt/style.min.css +1 -1
  8. package/es/style.css +1 -1
  9. package/es/style.min.css +1 -1
  10. package/es/ui/index.js +2 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-gantt/style.css +16 -2
  13. package/es/vxe-gantt/style.min.css +1 -1
  14. package/lib/gantt/src/emits.js +1 -1
  15. package/lib/gantt/src/emits.min.js +1 -1
  16. package/lib/gantt/src/gantt-chart.js +72 -44
  17. package/lib/gantt/src/gantt-chart.min.js +1 -1
  18. package/lib/gantt/src/gantt-view.js +19 -9
  19. package/lib/gantt/src/gantt-view.min.js +1 -1
  20. package/lib/gantt/src/gantt.js +89 -38
  21. package/lib/gantt/src/gantt.min.js +1 -1
  22. package/lib/gantt/src/util.js +0 -4
  23. package/lib/gantt/src/util.min.js +1 -1
  24. package/lib/gantt/style/style.css +16 -2
  25. package/lib/gantt/style/style.min.css +1 -1
  26. package/lib/index.umd.js +180 -91
  27. package/lib/index.umd.min.js +1 -1
  28. package/lib/style.css +1 -1
  29. package/lib/style.min.css +1 -1
  30. package/lib/ui/index.js +2 -1
  31. package/lib/ui/index.min.js +1 -1
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/ui/src/log.min.js +1 -1
  34. package/lib/vxe-gantt/style/style.css +16 -2
  35. package/lib/vxe-gantt/style/style.min.css +1 -1
  36. package/package.json +2 -2
  37. package/packages/gantt/src/emits.ts +4 -1
  38. package/packages/gantt/src/gantt-chart.ts +78 -53
  39. package/packages/gantt/src/gantt-view.ts +19 -9
  40. package/packages/gantt/src/gantt.ts +84 -40
  41. package/packages/gantt/src/util.ts +0 -4
  42. package/packages/ui/index.ts +1 -0
  43. package/styles/components/gantt-module/gantt-chart.scss +14 -2
  44. 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.19";
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.19"}`;
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
3855
3869
  }]
3856
- }, $xeTable && isEnableConf(taskLinkOpts) ? $xeGantt.renderGanttTaskLines() : []) : renderEmptyElement($xeGantt), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
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
3875
+ }]
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
  }
@@ -5305,7 +5333,7 @@ const maxYHeight = 5e6;
5305
5333
  bodyTableElem.style.width = `${vmTableWidth}px`;
5306
5334
  }
5307
5335
  reactData.scrollXWidth = viewTableWidth;
5308
- return Promise.all([updateTaskChart(), $xeGantt.handleUpdateTaskLink ? $xeGantt.handleUpdateTaskLink($xeGanttView) : null]);
5336
+ return Promise.all([updateTaskChart(), $xeGantt.handleUpdateTaskLinkStyle ? $xeGantt.handleUpdateTaskLinkStyle($xeGanttView) : null]);
5309
5337
  };
5310
5338
  const handleRecalculateStyle = () => {
5311
5339
  const el = refElem.value;
@@ -5501,10 +5529,15 @@ const maxYHeight = 5e6;
5501
5529
  if (scrollXSpaceEl) {
5502
5530
  scrollXSpaceEl.style.width = `${scrollXWidth}px`;
5503
5531
  }
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`;
5532
+ const beforeWrapper = getRefElem(elemStore['main-chart-before-wrapper']);
5533
+ const beforeSvgElem = beforeWrapper ? beforeWrapper.firstElementChild : null;
5534
+ if (beforeSvgElem) {
5535
+ beforeSvgElem.style.width = `${scrollXWidth}px`;
5536
+ }
5537
+ const afterWrapper = getRefElem(elemStore['main-chart-after-wrapper']);
5538
+ const afterSvgElem = afterWrapper ? afterWrapper.firstElementChild : null;
5539
+ if (afterSvgElem) {
5540
+ afterSvgElem.style.width = `${scrollXWidth}px`;
5508
5541
  }
5509
5542
  calcScrollbar();
5510
5543
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
@@ -5558,10 +5591,15 @@ const maxYHeight = 5e6;
5558
5591
  if (scrollYSpaceEl) {
5559
5592
  scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
5560
5593
  }
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` : '';
5594
+ const beforeWrapper = getRefElem(elemStore['main-chart-before-wrapper']);
5595
+ const beforeSvgElem = beforeWrapper ? beforeWrapper.firstElementChild : null;
5596
+ if (beforeSvgElem) {
5597
+ beforeSvgElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
5598
+ }
5599
+ const afterWrapper = getRefElem(elemStore['main-chart-after-wrapper']);
5600
+ const afterSvgElem = afterWrapper ? afterWrapper.firstElementChild : null;
5601
+ if (afterSvgElem) {
5602
+ afterSvgElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
5565
5603
  }
5566
5604
  reactData.scrollYTop = scrollYTop;
5567
5605
  reactData.scrollYHeight = scrollYHeight;
@@ -6076,9 +6114,51 @@ function gantt_createInternalData() {
6076
6114
  linkFromKeyMaps: {},
6077
6115
  linkUniqueMaps: {},
6078
6116
  uFoot: false,
6079
- resizeTableWidth: 0
6080
- // barTipTimeout: null
6081
- // dragBarRow: null
6117
+ resizeTableWidth: 0,
6118
+ // barTipTimeout: null,
6119
+ // dragBarRow: null,
6120
+ // dragLineRow: null,
6121
+ dragLinkToStore: {
6122
+ rowid: null,
6123
+ type: 0
6124
+ }
6125
+ };
6126
+ }
6127
+ function createReactData() {
6128
+ return {
6129
+ tableLoading: false,
6130
+ proxyInited: false,
6131
+ isZMax: false,
6132
+ tableLinks: [],
6133
+ tableData: [],
6134
+ filterData: [],
6135
+ formData: {},
6136
+ sortData: [],
6137
+ footerData: [],
6138
+ tZindex: 0,
6139
+ tablePage: {
6140
+ total: 0,
6141
+ pageSize: getConfig().pager?.pageSize || 10,
6142
+ currentPage: 1
6143
+ },
6144
+ showLeftView: true,
6145
+ showRightView: true,
6146
+ taskScaleList: [],
6147
+ barTipStore: {
6148
+ row: null,
6149
+ content: '',
6150
+ visible: false,
6151
+ params: null
6152
+ },
6153
+ dragLinkFromStore: {
6154
+ rowid: null,
6155
+ type: 0
6156
+ },
6157
+ activeBarRowid: null,
6158
+ activeLink: null,
6159
+ isActiveCeLe: false,
6160
+ linkList: [],
6161
+ upLinkFlag: 0
6082
6162
  };
6083
6163
  }
6084
6164
  const viewTypeLevelMaps = {
@@ -6139,34 +6219,7 @@ function getViewTypeLevel(type) {
6139
6219
  const {
6140
6220
  computeSize
6141
6221
  } = 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
- });
6222
+ const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(createReactData());
6170
6223
  const internalData = gantt_createInternalData();
6171
6224
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6172
6225
  const refTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
@@ -6283,6 +6336,15 @@ function getViewTypeLevel(type) {
6283
6336
  } = taskViewOpts;
6284
6337
  return scales;
6285
6338
  });
6339
+ const computeTaskLinkStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6340
+ const {
6341
+ lineType,
6342
+ lineWidth,
6343
+ lineStatus,
6344
+ lineColor
6345
+ } = computeTaskLinkOpts.value;
6346
+ return `${lineType || ''}_${lineWidth || ''}_${lineStatus || ''}_${lineColor || ''}`;
6347
+ });
6286
6348
  const computeTitleField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6287
6349
  const taskOpts = computeTaskOpts.value;
6288
6350
  return taskOpts.titleField || 'title';
@@ -8000,12 +8062,26 @@ function getViewTypeLevel(type) {
8000
8062
  $xeTable.handleToggleCheckRowEvent(evnt, params);
8001
8063
  }
8002
8064
  }
8065
+ reactData.isActiveCeLe = false;
8066
+ reactData.activeBarRowid = null;
8067
+ reactData.activeLink = null;
8003
8068
  $xeGantt.dispatchEvent('task-cell-click', params, evnt);
8004
8069
  },
8005
8070
  handleTaskCellDblclickEvent(evnt, params) {
8006
8071
  $xeGantt.dispatchEvent('task-cell-dblclick', params, evnt);
8007
8072
  },
8008
8073
  handleTaskBarClickEvent(evnt, params) {
8074
+ const $xeTable = refTable.value;
8075
+ const taskBarOpts = computeTaskBarOpts.value;
8076
+ const {
8077
+ linkCreatable
8078
+ } = taskBarOpts;
8079
+ const {
8080
+ row
8081
+ } = params;
8082
+ reactData.isActiveCeLe = !!linkCreatable;
8083
+ reactData.activeBarRowid = $xeTable ? $xeTable.getRowid(row) : row;
8084
+ reactData.activeLink = null;
8009
8085
  $xeGantt.dispatchEvent('task-bar-click', params, evnt);
8010
8086
  },
8011
8087
  handleTaskBarDblclickEvent(evnt, params) {
@@ -8013,12 +8089,17 @@ function getViewTypeLevel(type) {
8013
8089
  },
8014
8090
  triggerTaskBarTooltipEvent(evnt, params) {
8015
8091
  const {
8016
- barTipStore
8092
+ barTipStore,
8093
+ activeLink
8017
8094
  } = reactData;
8018
8095
  const {
8019
- dragBarRow
8096
+ dragBarRow,
8097
+ dragLineRow
8020
8098
  } = internalData;
8021
- if (dragBarRow) {
8099
+ if (dragBarRow || dragLineRow) {
8100
+ return;
8101
+ }
8102
+ if (activeLink) {
8022
8103
  return;
8023
8104
  }
8024
8105
  const taskBarTooltipOpts = computeTaskBarTooltipOpts.value;
@@ -8640,6 +8721,11 @@ function getViewTypeLevel(type) {
8640
8721
  handleTaskScaleConfig();
8641
8722
  $xeGantt.refreshTaskView();
8642
8723
  });
8724
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeTaskLinkStyle, () => {
8725
+ if ($xeGantt.handleUpdateTaskLinkData) {
8726
+ $xeGantt.handleUpdateTaskLinkData();
8727
+ }
8728
+ });
8643
8729
  hooks.forEach(options => {
8644
8730
  const {
8645
8731
  setupGantt
@@ -8651,15 +8737,15 @@ function getViewTypeLevel(type) {
8651
8737
  }
8652
8738
  }
8653
8739
  });
8654
- if ($xeGantt.handleTaskUpdateLinks) {
8740
+ if ($xeGantt.handleTaskLoadLinks) {
8655
8741
  if (props.links) {
8656
- $xeGantt.handleTaskUpdateLinks(props.links);
8742
+ $xeGantt.handleTaskLoadLinks(props.links);
8657
8743
  }
8658
8744
  }
8659
8745
  handleTaskScaleConfig();
8660
8746
  initPages();
8661
8747
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
8662
- if (!$xeGantt.handleUpdateTaskLink) {
8748
+ if (!$xeGantt.handleUpdateTaskLinkData) {
8663
8749
  if (props.links) {
8664
8750
  warnLog('vxe.error.notProp', ['links']);
8665
8751
  }
@@ -8714,6 +8800,9 @@ function getViewTypeLevel(type) {
8714
8800
  initGanttView();
8715
8801
  gantt_globalEvents.on($xeGantt, 'keydown', handleGlobalKeydownEvent);
8716
8802
  });
8803
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
8804
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(reactData, createReactData());
8805
+ });
8717
8806
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
8718
8807
  gantt_globalEvents.off($xeGantt, 'keydown');
8719
8808
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, gantt_createInternalData());