vxe-gantt 4.1.17 → 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 +49 -20
  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 +49 -24
  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 +210 -106
  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 +3 -3
  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 +51 -20
  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.17";
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.17"}`;
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
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
  }
@@ -4580,15 +4608,8 @@ const maxYHeight = 5e6;
4580
4608
  const q = Math.ceil((itemDate.getMonth() + 1) / 3);
4581
4609
  const W = `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(itemDate, weekScale ? weekScale.startDay : undefined)}`;
4582
4610
  const WW = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().padStart(W, 2, '0');
4583
- let wYear = yyyy;
4584
- // 周维度,由于年份和第几周是冲突的行为,所以需要特殊处理,判断是否跨年,例如
4585
- // '2024-12-31' 'yyyy-MM-dd W' >> '2024-12-31 1'
4586
- // '2025-01-01' 'yyyy-MM-dd W' >> '2025-01-01 1'
4587
- if (W === '1' && MM === '12') {
4588
- wYear = `${Number(yyyy) + 1}`;
4589
- if (isMinWeek) {
4590
- yyyy = wYear;
4591
- }
4611
+ if (isMinWeek && checkWeekOfsetYear(W, M)) {
4612
+ yyyy = `${Number(yyyy) + 1}`;
4592
4613
  }
4593
4614
  const dateObj = {
4594
4615
  date: itemDate,
@@ -4713,6 +4734,30 @@ const maxYHeight = 5e6;
4713
4734
  groupCols
4714
4735
  };
4715
4736
  };
4737
+ /**
4738
+ * 判断周的年份是否跨年
4739
+ */
4740
+ const checkWeekOfsetYear = (W, M) => {
4741
+ return `${W}` === '1' && `${M}` === '12';
4742
+ };
4743
+ /**
4744
+ * 周维度,由于年份和第几周是冲突的行为,所以需要特殊处理,判断是否跨年,例如
4745
+ * '2024-12-31' 'yyyy-MM-dd W' >> '2024-12-31 1'
4746
+ * '2025-01-01' 'yyyy-MM-dd W' >> '2025-01-01 1'
4747
+ */
4748
+ const parseWeekObj = (date, firstDay) => {
4749
+ const currDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(date);
4750
+ let yyyy = currDate.getFullYear();
4751
+ const month = currDate.getMonth();
4752
+ const weekNum = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(currDate, firstDay);
4753
+ if (checkWeekOfsetYear(weekNum, month + 1)) {
4754
+ yyyy++;
4755
+ }
4756
+ return {
4757
+ yyyy,
4758
+ W: weekNum
4759
+ };
4760
+ };
4716
4761
  const createChartRender = fullCols => {
4717
4762
  const {
4718
4763
  minViewDate
@@ -4811,13 +4856,11 @@ const maxYHeight = 5e6;
4811
4856
  return (startValue, endValue) => {
4812
4857
  const startDate = parseStringDate(startValue);
4813
4858
  const endDate = parseStringDate(endValue);
4814
- const startStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(startDate, 'yyyy-W', {
4815
- firstDay: weekScale ? weekScale.startDay : undefined
4816
- });
4859
+ const startWeekObj = parseWeekObj(startDate, weekScale ? weekScale.startDay : undefined);
4860
+ const startStr = `${startWeekObj.yyyy}-${startWeekObj.W}`;
4817
4861
  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);
4818
- const endStr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(endDate, 'yyyy-W', {
4819
- firstDay: weekScale ? weekScale.startDay : undefined
4820
- });
4862
+ const endWeekObj = parseWeekObj(endDate, weekScale ? weekScale.startDay : undefined);
4863
+ const endStr = `${endWeekObj.yyyy}-${endWeekObj.W}`;
4821
4864
  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);
4822
4865
  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);
4823
4866
  const subtract = (startDate.getTime() - startFirstDate.getTime()) / dayMs / dateSize;
@@ -5290,7 +5333,7 @@ const maxYHeight = 5e6;
5290
5333
  bodyTableElem.style.width = `${vmTableWidth}px`;
5291
5334
  }
5292
5335
  reactData.scrollXWidth = viewTableWidth;
5293
- return Promise.all([updateTaskChart(), $xeGantt.handleUpdateTaskLink ? $xeGantt.handleUpdateTaskLink($xeGanttView) : null]);
5336
+ return Promise.all([updateTaskChart(), $xeGantt.handleUpdateTaskLinkStyle ? $xeGantt.handleUpdateTaskLinkStyle($xeGanttView) : null]);
5294
5337
  };
5295
5338
  const handleRecalculateStyle = () => {
5296
5339
  const el = refElem.value;
@@ -5486,10 +5529,15 @@ const maxYHeight = 5e6;
5486
5529
  if (scrollXSpaceEl) {
5487
5530
  scrollXSpaceEl.style.width = `${scrollXWidth}px`;
5488
5531
  }
5489
- const lineWrapper = getRefElem(elemStore['main-chart-line-wrapper']);
5490
- const svgElem = lineWrapper ? lineWrapper.firstElementChild : null;
5491
- if (svgElem) {
5492
- 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`;
5493
5541
  }
5494
5542
  calcScrollbar();
5495
5543
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
@@ -5543,10 +5591,15 @@ const maxYHeight = 5e6;
5543
5591
  if (scrollYSpaceEl) {
5544
5592
  scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
5545
5593
  }
5546
- const lineWrapper = getRefElem(elemStore['main-chart-line-wrapper']);
5547
- const svgElem = lineWrapper ? lineWrapper.firstElementChild : null;
5548
- if (svgElem) {
5549
- 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` : '';
5550
5603
  }
5551
5604
  reactData.scrollYTop = scrollYTop;
5552
5605
  reactData.scrollYHeight = scrollYHeight;
@@ -6061,9 +6114,51 @@ function gantt_createInternalData() {
6061
6114
  linkFromKeyMaps: {},
6062
6115
  linkUniqueMaps: {},
6063
6116
  uFoot: false,
6064
- resizeTableWidth: 0
6065
- // barTipTimeout: null
6066
- // 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
6067
6162
  };
6068
6163
  }
6069
6164
  const viewTypeLevelMaps = {
@@ -6124,34 +6219,7 @@ function getViewTypeLevel(type) {
6124
6219
  const {
6125
6220
  computeSize
6126
6221
  } = useFns.useSize(props);
6127
- const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
6128
- tableLoading: false,
6129
- proxyInited: false,
6130
- isZMax: false,
6131
- tableLinks: [],
6132
- tableData: [],
6133
- filterData: [],
6134
- formData: {},
6135
- sortData: [],
6136
- footerData: [],
6137
- tZindex: 0,
6138
- tablePage: {
6139
- total: 0,
6140
- pageSize: getConfig().pager?.pageSize || 10,
6141
- currentPage: 1
6142
- },
6143
- showLeftView: true,
6144
- showRightView: true,
6145
- taskScaleList: [],
6146
- barTipStore: {
6147
- row: null,
6148
- content: '',
6149
- visible: false,
6150
- params: null
6151
- },
6152
- linkList: [],
6153
- upLinkFlag: 0
6154
- });
6222
+ const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(createReactData());
6155
6223
  const internalData = gantt_createInternalData();
6156
6224
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
6157
6225
  const refTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
@@ -6268,6 +6336,15 @@ function getViewTypeLevel(type) {
6268
6336
  } = taskViewOpts;
6269
6337
  return scales;
6270
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
+ });
6271
6348
  const computeTitleField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
6272
6349
  const taskOpts = computeTaskOpts.value;
6273
6350
  return taskOpts.titleField || 'title';
@@ -7985,12 +8062,26 @@ function getViewTypeLevel(type) {
7985
8062
  $xeTable.handleToggleCheckRowEvent(evnt, params);
7986
8063
  }
7987
8064
  }
8065
+ reactData.isActiveCeLe = false;
8066
+ reactData.activeBarRowid = null;
8067
+ reactData.activeLink = null;
7988
8068
  $xeGantt.dispatchEvent('task-cell-click', params, evnt);
7989
8069
  },
7990
8070
  handleTaskCellDblclickEvent(evnt, params) {
7991
8071
  $xeGantt.dispatchEvent('task-cell-dblclick', params, evnt);
7992
8072
  },
7993
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;
7994
8085
  $xeGantt.dispatchEvent('task-bar-click', params, evnt);
7995
8086
  },
7996
8087
  handleTaskBarDblclickEvent(evnt, params) {
@@ -7998,12 +8089,17 @@ function getViewTypeLevel(type) {
7998
8089
  },
7999
8090
  triggerTaskBarTooltipEvent(evnt, params) {
8000
8091
  const {
8001
- barTipStore
8092
+ barTipStore,
8093
+ activeLink
8002
8094
  } = reactData;
8003
8095
  const {
8004
- dragBarRow
8096
+ dragBarRow,
8097
+ dragLineRow
8005
8098
  } = internalData;
8006
- if (dragBarRow) {
8099
+ if (dragBarRow || dragLineRow) {
8100
+ return;
8101
+ }
8102
+ if (activeLink) {
8007
8103
  return;
8008
8104
  }
8009
8105
  const taskBarTooltipOpts = computeTaskBarTooltipOpts.value;
@@ -8625,6 +8721,11 @@ function getViewTypeLevel(type) {
8625
8721
  handleTaskScaleConfig();
8626
8722
  $xeGantt.refreshTaskView();
8627
8723
  });
8724
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeTaskLinkStyle, () => {
8725
+ if ($xeGantt.handleUpdateTaskLinkData) {
8726
+ $xeGantt.handleUpdateTaskLinkData();
8727
+ }
8728
+ });
8628
8729
  hooks.forEach(options => {
8629
8730
  const {
8630
8731
  setupGantt
@@ -8636,15 +8737,15 @@ function getViewTypeLevel(type) {
8636
8737
  }
8637
8738
  }
8638
8739
  });
8639
- if ($xeGantt.handleTaskUpdateLinks) {
8740
+ if ($xeGantt.handleTaskLoadLinks) {
8640
8741
  if (props.links) {
8641
- $xeGantt.handleTaskUpdateLinks(props.links);
8742
+ $xeGantt.handleTaskLoadLinks(props.links);
8642
8743
  }
8643
8744
  }
8644
8745
  handleTaskScaleConfig();
8645
8746
  initPages();
8646
8747
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
8647
- if (!$xeGantt.handleUpdateTaskLink) {
8748
+ if (!$xeGantt.handleUpdateTaskLinkData) {
8648
8749
  if (props.links) {
8649
8750
  warnLog('vxe.error.notProp', ['links']);
8650
8751
  }
@@ -8699,6 +8800,9 @@ function getViewTypeLevel(type) {
8699
8800
  initGanttView();
8700
8801
  gantt_globalEvents.on($xeGantt, 'keydown', handleGlobalKeydownEvent);
8701
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
+ });
8702
8806
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
8703
8807
  gantt_globalEvents.off($xeGantt, 'keydown');
8704
8808
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, gantt_createInternalData());