vxe-gantt 4.6.9 → 4.7.0

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/dist/all.esm.js CHANGED
@@ -6,7 +6,7 @@ import DomZIndex from 'dom-zindex';
6
6
  import { VxeTable } from 'vxe-table';
7
7
 
8
8
  const { setConfig: setConfig$1, setIcon } = VxeUI;
9
- VxeUI.ganttVersion = "4.6.9";
9
+ VxeUI.ganttVersion = "4.7.0";
10
10
  const ymdFormat = 'yyyy-MM-dd';
11
11
  const ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
12
12
  setConfig$1({
@@ -115,7 +115,7 @@ setIcon({
115
115
  });
116
116
 
117
117
  const { log } = VxeUI;
118
- const ganttVersion = `gantt v${"4.6.9"}`;
118
+ const ganttVersion = `gantt v${"4.7.0"}`;
119
119
  function createComponentLog(name) {
120
120
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
121
121
  const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
@@ -628,17 +628,7 @@ var GanttViewChartComponent = defineVxeComponent({
628
628
  const taskBarSubviewOpts = computeTaskBarSubviewOpts.value;
629
629
  const { showOverview, barStyle: subBarStyle } = taskBarSubviewOpts;
630
630
  const scaleUnit = computeScaleUnit.value;
631
- const barParams = { $gantt: $xeGantt, row, scaleType: scaleUnit };
632
- const { showProgress, showContent, contentMethod, barStyle, moveable, showTooltip } = taskBarOpts;
633
- const isBarRowStyle = XEUtils.isFunction(barStyle);
634
- const barStyObj = (barStyle ? (isBarRowStyle ? barStyle(barParams) || undefined : barStyle) : {}) || {};
635
- const { round } = barStyObj;
636
- const rowRest = fullAllDataRowIdData[rowid] || {};
637
- const cellHeight = resizeHeightFlag ? getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
638
- let title = getStringValue(XEUtils.get(row, titleField));
639
- const progressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(row, progressField)))) : 0;
640
- const renderTaskType = getTaskType(XEUtils.get(row, typeField));
641
- const ctParams = {
631
+ const barParams = {
642
632
  $gantt: $xeGantt,
643
633
  source: sourceType$3,
644
634
  type: viewType$2,
@@ -648,18 +638,31 @@ var GanttViewChartComponent = defineVxeComponent({
648
638
  rowIndex,
649
639
  _rowIndex
650
640
  };
641
+ const { showProgress, showContent, contentMethod, barStyle, moveable, showTooltip } = taskBarOpts;
642
+ const isBarRowStyle = XEUtils.isFunction(barStyle);
643
+ const barStyObj = (barStyle ? (isBarRowStyle ? barStyle(barParams) || undefined : barStyle) : {}) || {};
644
+ const barRound = barStyObj.round;
645
+ const barBgColor = barStyObj.bgColor;
646
+ const barCompletedBgColor = barStyObj.completedBgColor;
647
+ const barHtmlStyle = barStyObj.style;
648
+ const rowRest = fullAllDataRowIdData[rowid] || {};
649
+ const cellHeight = resizeHeightFlag ? getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
650
+ let title = getStringValue(XEUtils.get(row, titleField));
651
+ const progressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(row, progressField)))) : 0;
652
+ const renderTaskType = getTaskType(XEUtils.get(row, typeField));
653
+ const ctParams = Object.assign({}, barParams);
651
654
  const vbStyle = {};
652
655
  const vpStyle = {
653
656
  width: `${progressValue || 0}%`
654
657
  };
655
- if (isBarRowStyle) {
656
- const { bgColor, completedBgColor } = barStyObj;
657
- if (bgColor) {
658
- vbStyle.backgroundColor = XEUtils.isFunction(bgColor) ? bgColor(ctParams) : bgColor;
659
- }
660
- if (completedBgColor) {
661
- vpStyle.backgroundColor = completedBgColor;
662
- }
658
+ if (barBgColor) {
659
+ vbStyle.backgroundColor = barBgColor;
660
+ }
661
+ if (barCompletedBgColor) {
662
+ vpStyle.backgroundColor = barCompletedBgColor;
663
+ }
664
+ if (barHtmlStyle) {
665
+ XEUtils.assign(vbStyle, barHtmlStyle);
663
666
  }
664
667
  let cbVNs = [];
665
668
  if ($xeGantt.renderGanttTaskBarContent) {
@@ -706,7 +709,7 @@ var GanttViewChartComponent = defineVxeComponent({
706
709
  rowid: rowid,
707
710
  class: ['vxe-gantt-view--chart-subview-row', {
708
711
  'is--progress': showProgress,
709
- 'is--round': round,
712
+ 'is--round': barRound,
710
713
  'is--move': moveable
711
714
  }]
712
715
  }, [
@@ -736,9 +739,21 @@ var GanttViewChartComponent = defineVxeComponent({
736
739
  else {
737
740
  const cbcVNs = [];
738
741
  XEUtils.eachTree(rowChildren, childRow => {
739
- const childBarParams = { $gantt: $xeGantt, row: childRow, scaleType: scaleUnit };
740
- const childBarStyObj = (barStyle ? (isBarRowStyle ? barStyle(childBarParams) : barStyle) : {}) || {};
741
- const { round } = childBarStyObj;
742
+ const childBarParams = {
743
+ $gantt: $xeGantt,
744
+ source: sourceType$3,
745
+ type: viewType$2,
746
+ scaleType: scaleUnit,
747
+ row: childRow,
748
+ $rowIndex: $xeTable.getRowIndex(childRow),
749
+ rowIndex: $xeTable.getVMRowIndex(childRow),
750
+ _rowIndex: $xeTable.getVTRowIndex(childRow)
751
+ };
752
+ const childBarStyObj = XEUtils.assign({}, (barStyle ? (XEUtils.isFunction(barStyle) ? barStyle(childBarParams) : barStyle) : {}) || {}, (subBarStyle ? (XEUtils.isFunction(subBarStyle) ? subBarStyle(childBarParams) : subBarStyle) : {}) || {});
753
+ const childRound = childBarStyObj.round;
754
+ const childBgColor = childBarStyObj.bgColor;
755
+ const childCompletedBgColor = childBarStyObj.completedBgColor;
756
+ const childBarHtmlStyle = childBarStyObj.style;
742
757
  const childRowid = $xeTable.getRowid(childRow);
743
758
  let childTitle = getStringValue(XEUtils.get(childRow, titleField));
744
759
  const childProgressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(childRow, progressField)))) : 0;
@@ -747,21 +762,25 @@ var GanttViewChartComponent = defineVxeComponent({
747
762
  if (isChildSubview) {
748
763
  return;
749
764
  }
765
+ const childVbStyle = {};
750
766
  const childVpStyle = {
751
767
  width: `${childProgressValue || 0}%`
752
768
  };
753
- if (isBarRowStyle) {
754
- const { bgColor, completedBgColor } = childBarStyObj;
755
- if (completedBgColor) {
756
- childVpStyle.backgroundColor = completedBgColor;
757
- }
769
+ if (childBgColor) {
770
+ childVbStyle.backgroundColor = childBgColor;
758
771
  }
759
- const childCtParams = XEUtils.assign({}, ctParams, {
760
- row: childRow,
761
- rowIndex: $xeTable.getRowIndex(childRow),
762
- $rowIndex: $xeTable.getVMRowIndex(childRow),
763
- _rowIndex: $xeTable.getVTRowIndex(childRow)
764
- });
772
+ if (childCompletedBgColor) {
773
+ childVpStyle.backgroundColor = childCompletedBgColor;
774
+ }
775
+ // 已废弃
776
+ if (childBarStyObj.top) {
777
+ childVbStyle.top = childBarStyObj.top;
778
+ }
779
+ // 已废弃
780
+ if (childBarHtmlStyle) {
781
+ XEUtils.assign(childVbStyle, childBarHtmlStyle);
782
+ }
783
+ const childCtParams = Object.assign({}, childBarParams);
765
784
  if (contentMethod) {
766
785
  childTitle = getStringValue(contentMethod({ row: childRow, title: childTitle, scaleType: scaleUnit }));
767
786
  }
@@ -770,7 +789,7 @@ var GanttViewChartComponent = defineVxeComponent({
770
789
  rowid: childRowid,
771
790
  class: ['vxe-gantt-view--chart-subview-row', `is--${childRenderTaskType}`, {
772
791
  'is--progress': showProgress,
773
- 'is--round': round,
792
+ 'is--round': childRound,
774
793
  'is--move': moveable,
775
794
  'row--pending': !!pendingRowFlag && !!pendingRowMaps[childRowid]
776
795
  }]
@@ -778,7 +797,7 @@ var GanttViewChartComponent = defineVxeComponent({
778
797
  h('div', {
779
798
  rowid: childRowid,
780
799
  class: [taskBarSlot ? 'vxe-gantt-view--chart-subview-custom-bar' : 'vxe-gantt-view--chart-subview-bar', `is--${childRenderTaskType}`],
781
- style: subBarStyle ? (XEUtils.isFunction(subBarStyle) ? subBarStyle(childCtParams) : subBarStyle) : undefined,
800
+ style: childVbStyle,
782
801
  onClick(evnt) {
783
802
  evnt.stopPropagation();
784
803
  $xeGantt.handleTaskBarClickEvent(evnt, childCtParams);
@@ -864,7 +883,7 @@ var GanttViewChartComponent = defineVxeComponent({
864
883
  class: ['vxe-gantt-view--chart-row', `is--${renderTaskType}`, {
865
884
  'is--progress': showProgress,
866
885
  'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
867
- 'is--round': round,
886
+ 'is--round': barRound,
868
887
  'is--move': moveable
869
888
  }],
870
889
  style: {
@@ -1511,11 +1530,13 @@ var GanttViewComponent = defineVxeComponent({
1511
1530
  let nlLeft = 0;
1512
1531
  if (showNowLine && minScale && minViewDate && maxViewDate && nowTime >= minViewDate.getTime() && nowTime <= maxViewDate.getTime()) {
1513
1532
  const todayValue = todayDateMaps[minScale.type];
1533
+ const todayDate = XEUtils.toStringDate(todayValue);
1514
1534
  let currCol = null;
1515
1535
  let nextCol = null;
1516
1536
  for (let i = 0; i < visibleColumn.length; i++) {
1517
1537
  const column = visibleColumn[i];
1518
- if (column.field === todayValue) {
1538
+ const { startDateObj, endDateObj } = column;
1539
+ if (startDateObj.date <= todayDate && endDateObj.date >= todayDate) {
1519
1540
  currCol = column;
1520
1541
  nlLeft = i * viewCellWidth;
1521
1542
  nextCol = visibleColumn[i + 1];
@@ -2575,7 +2596,7 @@ var GanttViewComponent = defineVxeComponent({
2575
2596
  reactData.scrollXWidth = viewTableWidth;
2576
2597
  return Promise.all([
2577
2598
  updateTaskChartStyle(),
2578
- $xeGantt.handleUpdateTaskLinkStyle ? $xeGantt.handleUpdateTaskLinkStyle($xeGanttView) : null
2599
+ $xeGantt.handleUpTaskLinkStyle ? $xeGantt.handleUpTaskLinkStyle($xeGanttView) : null
2579
2600
  ]);
2580
2601
  };
2581
2602
  const handleRecalculateStyle = () => {
@@ -3587,7 +3608,7 @@ var VxeGanttComponent = defineVxeComponent({
3587
3608
  stys['--vxe-ui-gantt-view-task-now-line-background-color'] = nlbgColor;
3588
3609
  }
3589
3610
  if (nlWidth) {
3590
- stys['--vxe-ui-gantt-view-task-now-line-width'] = nlWidth;
3611
+ stys['--vxe-ui-gantt-view-task-now-line-width'] = toCssUnit(nlWidth);
3591
3612
  }
3592
3613
  if (viewStyle) {
3593
3614
  const { cellWidth } = viewStyle;
@@ -5791,8 +5812,8 @@ var VxeGanttComponent = defineVxeComponent({
5791
5812
  $xeGantt.refreshTaskView();
5792
5813
  });
5793
5814
  watch(computeTaskLinkStyle, () => {
5794
- if ($xeGantt.handleUpdateTaskLinkData) {
5795
- $xeGantt.handleUpdateTaskLinkData();
5815
+ if ($xeGantt.handleUpTaskLinkData) {
5816
+ $xeGantt.handleUpTaskLinkData();
5796
5817
  }
5797
5818
  });
5798
5819
  hooks.forEach((options) => {
@@ -5812,7 +5833,17 @@ var VxeGanttComponent = defineVxeComponent({
5812
5833
  handleTaskScaleConfig();
5813
5834
  initPages();
5814
5835
  onMounted(() => {
5815
- if (!$xeGantt.handleUpdateTaskLinkData) {
5836
+ const taskBarSubviewOpts = computeTaskBarSubviewOpts.value;
5837
+ const { barStyle } = taskBarSubviewOpts;
5838
+ if (barStyle) {
5839
+ if (barStyle.top) {
5840
+ warnLog('vxe.error.delProp', ['task-bar-subview-config.barStyle.top', 'task-bar-subview-config.barStyle.style.top']);
5841
+ }
5842
+ if (barStyle.backgroundColor) {
5843
+ warnLog('vxe.error.delProp', ['task-bar-subview-config.barStyle.backgroundColor', 'task-bar-subview-config.barStyle.style.backgroundColor']);
5844
+ }
5845
+ }
5846
+ if (!$xeGantt.handleUpTaskLinkData) {
5816
5847
  if (props.links) {
5817
5848
  warnLog('vxe.error.notProp', ['links']);
5818
5849
  }
@@ -46,17 +46,7 @@ export default defineVxeComponent({
46
46
  const taskBarSubviewOpts = computeTaskBarSubviewOpts.value;
47
47
  const { showOverview, barStyle: subBarStyle } = taskBarSubviewOpts;
48
48
  const scaleUnit = computeScaleUnit.value;
49
- const barParams = { $gantt: $xeGantt, row, scaleType: scaleUnit };
50
- const { showProgress, showContent, contentMethod, barStyle, moveable, showTooltip } = taskBarOpts;
51
- const isBarRowStyle = XEUtils.isFunction(barStyle);
52
- const barStyObj = (barStyle ? (isBarRowStyle ? barStyle(barParams) || undefined : barStyle) : {}) || {};
53
- const { round } = barStyObj;
54
- const rowRest = fullAllDataRowIdData[rowid] || {};
55
- const cellHeight = resizeHeightFlag ? getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
56
- let title = getStringValue(XEUtils.get(row, titleField));
57
- const progressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(row, progressField)))) : 0;
58
- const renderTaskType = getTaskType(XEUtils.get(row, typeField));
59
- const ctParams = {
49
+ const barParams = {
60
50
  $gantt: $xeGantt,
61
51
  source: sourceType,
62
52
  type: viewType,
@@ -66,18 +56,31 @@ export default defineVxeComponent({
66
56
  rowIndex,
67
57
  _rowIndex
68
58
  };
59
+ const { showProgress, showContent, contentMethod, barStyle, moveable, showTooltip } = taskBarOpts;
60
+ const isBarRowStyle = XEUtils.isFunction(barStyle);
61
+ const barStyObj = (barStyle ? (isBarRowStyle ? barStyle(barParams) || undefined : barStyle) : {}) || {};
62
+ const barRound = barStyObj.round;
63
+ const barBgColor = barStyObj.bgColor;
64
+ const barCompletedBgColor = barStyObj.completedBgColor;
65
+ const barHtmlStyle = barStyObj.style;
66
+ const rowRest = fullAllDataRowIdData[rowid] || {};
67
+ const cellHeight = resizeHeightFlag ? getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
68
+ let title = getStringValue(XEUtils.get(row, titleField));
69
+ const progressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(row, progressField)))) : 0;
70
+ const renderTaskType = getTaskType(XEUtils.get(row, typeField));
71
+ const ctParams = Object.assign({}, barParams);
69
72
  const vbStyle = {};
70
73
  const vpStyle = {
71
74
  width: `${progressValue || 0}%`
72
75
  };
73
- if (isBarRowStyle) {
74
- const { bgColor, completedBgColor } = barStyObj;
75
- if (bgColor) {
76
- vbStyle.backgroundColor = XEUtils.isFunction(bgColor) ? bgColor(ctParams) : bgColor;
77
- }
78
- if (completedBgColor) {
79
- vpStyle.backgroundColor = completedBgColor;
80
- }
76
+ if (barBgColor) {
77
+ vbStyle.backgroundColor = barBgColor;
78
+ }
79
+ if (barCompletedBgColor) {
80
+ vpStyle.backgroundColor = barCompletedBgColor;
81
+ }
82
+ if (barHtmlStyle) {
83
+ XEUtils.assign(vbStyle, barHtmlStyle);
81
84
  }
82
85
  let cbVNs = [];
83
86
  if ($xeGantt.renderGanttTaskBarContent) {
@@ -124,7 +127,7 @@ export default defineVxeComponent({
124
127
  rowid: rowid,
125
128
  class: ['vxe-gantt-view--chart-subview-row', {
126
129
  'is--progress': showProgress,
127
- 'is--round': round,
130
+ 'is--round': barRound,
128
131
  'is--move': moveable
129
132
  }]
130
133
  }, [
@@ -154,9 +157,21 @@ export default defineVxeComponent({
154
157
  else {
155
158
  const cbcVNs = [];
156
159
  XEUtils.eachTree(rowChildren, childRow => {
157
- const childBarParams = { $gantt: $xeGantt, row: childRow, scaleType: scaleUnit };
158
- const childBarStyObj = (barStyle ? (isBarRowStyle ? barStyle(childBarParams) : barStyle) : {}) || {};
159
- const { round } = childBarStyObj;
160
+ const childBarParams = {
161
+ $gantt: $xeGantt,
162
+ source: sourceType,
163
+ type: viewType,
164
+ scaleType: scaleUnit,
165
+ row: childRow,
166
+ $rowIndex: $xeTable.getRowIndex(childRow),
167
+ rowIndex: $xeTable.getVMRowIndex(childRow),
168
+ _rowIndex: $xeTable.getVTRowIndex(childRow)
169
+ };
170
+ const childBarStyObj = XEUtils.assign({}, (barStyle ? (XEUtils.isFunction(barStyle) ? barStyle(childBarParams) : barStyle) : {}) || {}, (subBarStyle ? (XEUtils.isFunction(subBarStyle) ? subBarStyle(childBarParams) : subBarStyle) : {}) || {});
171
+ const childRound = childBarStyObj.round;
172
+ const childBgColor = childBarStyObj.bgColor;
173
+ const childCompletedBgColor = childBarStyObj.completedBgColor;
174
+ const childBarHtmlStyle = childBarStyObj.style;
160
175
  const childRowid = $xeTable.getRowid(childRow);
161
176
  let childTitle = getStringValue(XEUtils.get(childRow, titleField));
162
177
  const childProgressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(childRow, progressField)))) : 0;
@@ -169,21 +184,21 @@ export default defineVxeComponent({
169
184
  const childVpStyle = {
170
185
  width: `${childProgressValue || 0}%`
171
186
  };
172
- if (isBarRowStyle) {
173
- const { bgColor, completedBgColor } = childBarStyObj;
174
- if (bgColor) {
175
- childVbStyle.backgroundColor = bgColor;
176
- }
177
- if (completedBgColor) {
178
- childVpStyle.backgroundColor = completedBgColor;
179
- }
187
+ if (childBgColor) {
188
+ childVbStyle.backgroundColor = childBgColor;
180
189
  }
181
- const childCtParams = XEUtils.assign({}, ctParams, {
182
- row: childRow,
183
- rowIndex: $xeTable.getRowIndex(childRow),
184
- $rowIndex: $xeTable.getVMRowIndex(childRow),
185
- _rowIndex: $xeTable.getVTRowIndex(childRow)
186
- });
190
+ if (childCompletedBgColor) {
191
+ childVpStyle.backgroundColor = childCompletedBgColor;
192
+ }
193
+ // 已废弃
194
+ if (childBarStyObj.top) {
195
+ childVbStyle.top = childBarStyObj.top;
196
+ }
197
+ // 已废弃
198
+ if (childBarHtmlStyle) {
199
+ XEUtils.assign(childVbStyle, childBarHtmlStyle);
200
+ }
201
+ const childCtParams = Object.assign({}, childBarParams);
187
202
  if (contentMethod) {
188
203
  childTitle = getStringValue(contentMethod({ row: childRow, title: childTitle, scaleType: scaleUnit }));
189
204
  }
@@ -192,7 +207,7 @@ export default defineVxeComponent({
192
207
  rowid: childRowid,
193
208
  class: ['vxe-gantt-view--chart-subview-row', `is--${childRenderTaskType}`, {
194
209
  'is--progress': showProgress,
195
- 'is--round': round,
210
+ 'is--round': childRound,
196
211
  'is--move': moveable,
197
212
  'row--pending': !!pendingRowFlag && !!pendingRowMaps[childRowid]
198
213
  }]
@@ -200,7 +215,7 @@ export default defineVxeComponent({
200
215
  h('div', {
201
216
  rowid: childRowid,
202
217
  class: [taskBarSlot ? 'vxe-gantt-view--chart-subview-custom-bar' : 'vxe-gantt-view--chart-subview-bar', `is--${childRenderTaskType}`],
203
- style: subBarStyle ? (XEUtils.isFunction(subBarStyle) ? subBarStyle(childCtParams) : subBarStyle) : undefined,
218
+ style: childVbStyle,
204
219
  onClick(evnt) {
205
220
  evnt.stopPropagation();
206
221
  $xeGantt.handleTaskBarClickEvent(evnt, childCtParams);
@@ -286,7 +301,7 @@ export default defineVxeComponent({
286
301
  class: ['vxe-gantt-view--chart-row', `is--${renderTaskType}`, {
287
302
  'is--progress': showProgress,
288
303
  'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
289
- 'is--round': round,
304
+ 'is--round': barRound,
290
305
  'is--move': moveable
291
306
  }],
292
307
  style: {
@@ -215,11 +215,13 @@ export default defineVxeComponent({
215
215
  let nlLeft = 0;
216
216
  if (showNowLine && minScale && minViewDate && maxViewDate && nowTime >= minViewDate.getTime() && nowTime <= maxViewDate.getTime()) {
217
217
  const todayValue = todayDateMaps[minScale.type];
218
+ const todayDate = XEUtils.toStringDate(todayValue);
218
219
  let currCol = null;
219
220
  let nextCol = null;
220
221
  for (let i = 0; i < visibleColumn.length; i++) {
221
222
  const column = visibleColumn[i];
222
- if (column.field === todayValue) {
223
+ const { startDateObj, endDateObj } = column;
224
+ if (startDateObj.date <= todayDate && endDateObj.date >= todayDate) {
223
225
  currCol = column;
224
226
  nlLeft = i * viewCellWidth;
225
227
  nextCol = visibleColumn[i + 1];
@@ -1279,7 +1281,7 @@ export default defineVxeComponent({
1279
1281
  reactData.scrollXWidth = viewTableWidth;
1280
1282
  return Promise.all([
1281
1283
  updateTaskChartStyle(),
1282
- $xeGantt.handleUpdateTaskLinkStyle ? $xeGantt.handleUpdateTaskLinkStyle($xeGanttView) : null
1284
+ $xeGantt.handleUpTaskLinkStyle ? $xeGantt.handleUpTaskLinkStyle($xeGanttView) : null
1283
1285
  ]);
1284
1286
  };
1285
1287
  const handleRecalculateStyle = () => {
@@ -320,7 +320,7 @@ export default defineVxeComponent({
320
320
  stys['--vxe-ui-gantt-view-task-now-line-background-color'] = nlbgColor;
321
321
  }
322
322
  if (nlWidth) {
323
- stys['--vxe-ui-gantt-view-task-now-line-width'] = nlWidth;
323
+ stys['--vxe-ui-gantt-view-task-now-line-width'] = toCssUnit(nlWidth);
324
324
  }
325
325
  if (viewStyle) {
326
326
  const { cellWidth } = viewStyle;
@@ -2524,8 +2524,8 @@ export default defineVxeComponent({
2524
2524
  $xeGantt.refreshTaskView();
2525
2525
  });
2526
2526
  watch(computeTaskLinkStyle, () => {
2527
- if ($xeGantt.handleUpdateTaskLinkData) {
2528
- $xeGantt.handleUpdateTaskLinkData();
2527
+ if ($xeGantt.handleUpTaskLinkData) {
2528
+ $xeGantt.handleUpTaskLinkData();
2529
2529
  }
2530
2530
  });
2531
2531
  hooks.forEach((options) => {
@@ -2545,7 +2545,17 @@ export default defineVxeComponent({
2545
2545
  handleTaskScaleConfig();
2546
2546
  initPages();
2547
2547
  onMounted(() => {
2548
- if (!$xeGantt.handleUpdateTaskLinkData) {
2548
+ const taskBarSubviewOpts = computeTaskBarSubviewOpts.value;
2549
+ const { barStyle } = taskBarSubviewOpts;
2550
+ if (barStyle) {
2551
+ if (barStyle.top) {
2552
+ warnLog('vxe.error.delProp', ['task-bar-subview-config.barStyle.top', 'task-bar-subview-config.barStyle.style.top']);
2553
+ }
2554
+ if (barStyle.backgroundColor) {
2555
+ warnLog('vxe.error.delProp', ['task-bar-subview-config.barStyle.backgroundColor', 'task-bar-subview-config.barStyle.style.backgroundColor']);
2556
+ }
2557
+ }
2558
+ if (!$xeGantt.handleUpTaskLinkData) {
2549
2559
  if (props.links) {
2550
2560
  warnLog('vxe.error.notProp', ['links']);
2551
2561
  }
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { setConfig, setIcon } = VxeUI;
3
- VxeUI.ganttVersion = "4.6.9";
3
+ VxeUI.ganttVersion = "4.7.0";
4
4
  const ymdFormat = 'yyyy-MM-dd';
5
5
  const ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
6
6
  setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const ganttVersion = `gantt v${"4.6.9"}`;
3
+ const ganttVersion = `gantt v${"4.7.0"}`;
4
4
  export function createComponentLog(name) {
5
5
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
6
6
  const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
@@ -23,6 +23,12 @@ export function nextZIndex() {
23
23
  export function getLastZIndex() {
24
24
  return DomZIndex.getCurrent();
25
25
  }
26
+ export function getGlobalDefaultConfig(value, globalValue) {
27
+ if (XEUtils.eqNull(value)) {
28
+ return globalValue;
29
+ }
30
+ return value;
31
+ }
26
32
  export function hasChildrenList(item) {
27
33
  return item && item.children && item.children.length > 0;
28
34
  }
@@ -99,8 +99,13 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
99
99
  const scaleUnit = computeScaleUnit.value;
100
100
  const barParams = {
101
101
  $gantt: $xeGantt,
102
+ source: sourceType,
103
+ type: viewType,
104
+ scaleType: scaleUnit,
102
105
  row,
103
- scaleType: scaleUnit
106
+ $rowIndex,
107
+ rowIndex,
108
+ _rowIndex
104
109
  };
105
110
  const {
106
111
  showProgress,
@@ -112,39 +117,28 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
112
117
  } = taskBarOpts;
113
118
  const isBarRowStyle = _xeUtils.default.isFunction(barStyle);
114
119
  const barStyObj = (barStyle ? isBarRowStyle ? barStyle(barParams) || undefined : barStyle : {}) || {};
115
- const {
116
- round
117
- } = barStyObj;
120
+ const barRound = barStyObj.round;
121
+ const barBgColor = barStyObj.bgColor;
122
+ const barCompletedBgColor = barStyObj.completedBgColor;
123
+ const barHtmlStyle = barStyObj.style;
118
124
  const rowRest = fullAllDataRowIdData[rowid] || {};
119
125
  const cellHeight = resizeHeightFlag ? (0, _util.getCellRestHeight)(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
120
126
  let title = (0, _utils.getStringValue)(_xeUtils.default.get(row, titleField));
121
127
  const progressValue = showProgress ? Math.min(100, Math.max(0, _xeUtils.default.toNumber(_xeUtils.default.get(row, progressField)))) : 0;
122
128
  const renderTaskType = (0, _util.getTaskType)(_xeUtils.default.get(row, typeField));
123
- const ctParams = {
124
- $gantt: $xeGantt,
125
- source: sourceType,
126
- type: viewType,
127
- scaleType: scaleUnit,
128
- row,
129
- $rowIndex,
130
- rowIndex,
131
- _rowIndex
132
- };
129
+ const ctParams = Object.assign({}, barParams);
133
130
  const vbStyle = {};
134
131
  const vpStyle = {
135
132
  width: `${progressValue || 0}%`
136
133
  };
137
- if (isBarRowStyle) {
138
- const {
139
- bgColor,
140
- completedBgColor
141
- } = barStyObj;
142
- if (bgColor) {
143
- vbStyle.backgroundColor = _xeUtils.default.isFunction(bgColor) ? bgColor(ctParams) : bgColor;
144
- }
145
- if (completedBgColor) {
146
- vpStyle.backgroundColor = completedBgColor;
147
- }
134
+ if (barBgColor) {
135
+ vbStyle.backgroundColor = barBgColor;
136
+ }
137
+ if (barCompletedBgColor) {
138
+ vpStyle.backgroundColor = barCompletedBgColor;
139
+ }
140
+ if (barHtmlStyle) {
141
+ _xeUtils.default.assign(vbStyle, barHtmlStyle);
148
142
  }
149
143
  let cbVNs = [];
150
144
  if ($xeGantt.renderGanttTaskBarContent) {
@@ -201,7 +195,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
201
195
  rowid: rowid,
202
196
  class: ['vxe-gantt-view--chart-subview-row', {
203
197
  'is--progress': showProgress,
204
- 'is--round': round,
198
+ 'is--round': barRound,
205
199
  'is--move': moveable
206
200
  }]
207
201
  }, [(0, _vue.h)('div', {
@@ -221,13 +215,19 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
221
215
  _xeUtils.default.eachTree(rowChildren, childRow => {
222
216
  const childBarParams = {
223
217
  $gantt: $xeGantt,
218
+ source: sourceType,
219
+ type: viewType,
220
+ scaleType: scaleUnit,
224
221
  row: childRow,
225
- scaleType: scaleUnit
222
+ $rowIndex: $xeTable.getRowIndex(childRow),
223
+ rowIndex: $xeTable.getVMRowIndex(childRow),
224
+ _rowIndex: $xeTable.getVTRowIndex(childRow)
226
225
  };
227
- const childBarStyObj = (barStyle ? isBarRowStyle ? barStyle(childBarParams) : barStyle : {}) || {};
228
- const {
229
- round
230
- } = childBarStyObj;
226
+ const childBarStyObj = _xeUtils.default.assign({}, (barStyle ? _xeUtils.default.isFunction(barStyle) ? barStyle(childBarParams) : barStyle : {}) || {}, (subBarStyle ? _xeUtils.default.isFunction(subBarStyle) ? subBarStyle(childBarParams) : subBarStyle : {}) || {});
227
+ const childRound = childBarStyObj.round;
228
+ const childBgColor = childBarStyObj.bgColor;
229
+ const childCompletedBgColor = childBarStyObj.completedBgColor;
230
+ const childBarHtmlStyle = childBarStyObj.style;
231
231
  const childRowid = $xeTable.getRowid(childRow);
232
232
  let childTitle = (0, _utils.getStringValue)(_xeUtils.default.get(childRow, titleField));
233
233
  const childProgressValue = showProgress ? Math.min(100, Math.max(0, _xeUtils.default.toNumber(_xeUtils.default.get(childRow, progressField)))) : 0;
@@ -240,24 +240,21 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
240
240
  const childVpStyle = {
241
241
  width: `${childProgressValue || 0}%`
242
242
  };
243
- if (isBarRowStyle) {
244
- const {
245
- bgColor,
246
- completedBgColor
247
- } = childBarStyObj;
248
- if (bgColor) {
249
- childVbStyle.backgroundColor = bgColor;
250
- }
251
- if (completedBgColor) {
252
- childVpStyle.backgroundColor = completedBgColor;
253
- }
243
+ if (childBgColor) {
244
+ childVbStyle.backgroundColor = childBgColor;
254
245
  }
255
- const childCtParams = _xeUtils.default.assign({}, ctParams, {
256
- row: childRow,
257
- rowIndex: $xeTable.getRowIndex(childRow),
258
- $rowIndex: $xeTable.getVMRowIndex(childRow),
259
- _rowIndex: $xeTable.getVTRowIndex(childRow)
260
- });
246
+ if (childCompletedBgColor) {
247
+ childVpStyle.backgroundColor = childCompletedBgColor;
248
+ }
249
+ // 已废弃
250
+ if (childBarStyObj.top) {
251
+ childVbStyle.top = childBarStyObj.top;
252
+ }
253
+ // 已废弃
254
+ if (childBarHtmlStyle) {
255
+ _xeUtils.default.assign(childVbStyle, childBarHtmlStyle);
256
+ }
257
+ const childCtParams = Object.assign({}, childBarParams);
261
258
  if (contentMethod) {
262
259
  childTitle = (0, _utils.getStringValue)(contentMethod({
263
260
  row: childRow,
@@ -270,14 +267,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
270
267
  rowid: childRowid,
271
268
  class: ['vxe-gantt-view--chart-subview-row', `is--${childRenderTaskType}`, {
272
269
  'is--progress': showProgress,
273
- 'is--round': round,
270
+ 'is--round': childRound,
274
271
  'is--move': moveable,
275
272
  'row--pending': !!pendingRowFlag && !!pendingRowMaps[childRowid]
276
273
  }]
277
274
  }, [(0, _vue.h)('div', {
278
275
  rowid: childRowid,
279
276
  class: [taskBarSlot ? 'vxe-gantt-view--chart-subview-custom-bar' : 'vxe-gantt-view--chart-subview-bar', `is--${childRenderTaskType}`],
280
- style: subBarStyle ? _xeUtils.default.isFunction(subBarStyle) ? subBarStyle(childCtParams) : subBarStyle : undefined,
277
+ style: childVbStyle,
281
278
  onClick(evnt) {
282
279
  evnt.stopPropagation();
283
280
  $xeGantt.handleTaskBarClickEvent(evnt, childCtParams);
@@ -357,7 +354,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
357
354
  class: ['vxe-gantt-view--chart-row', `is--${renderTaskType}`, {
358
355
  'is--progress': showProgress,
359
356
  'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
360
- 'is--round': round,
357
+ 'is--round': barRound,
361
358
  'is--move': moveable
362
359
  }],
363
360
  style: {