vxe-gantt 4.0.0-beta.0 → 4.0.0-beta.2

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 (80) hide show
  1. package/README.md +1 -1
  2. package/es/components.js +3 -2
  3. package/es/gantt/src/emits.js +5 -1
  4. package/es/gantt/src/gantt-body.js +14 -5
  5. package/es/gantt/src/gantt-chart.js +38 -17
  6. package/es/gantt/src/gantt-header.js +20 -3
  7. package/es/gantt/src/gantt-view.js +5 -1
  8. package/es/gantt/src/gantt.js +91 -36
  9. package/es/gantt/src/util.js +6 -0
  10. package/es/gantt/style.css +36 -25
  11. package/es/gantt/style.min.css +1 -1
  12. package/es/index.esm.js +2 -2
  13. package/es/style.css +1 -1
  14. package/es/style.min.css +1 -1
  15. package/es/ui/index.js +9 -3
  16. package/es/ui/src/log.js +3 -2
  17. package/es/ui/src/utils.js +3 -0
  18. package/es/vxe-gantt/style.css +36 -25
  19. package/es/vxe-gantt/style.min.css +1 -1
  20. package/helper/vetur/attributes.json +1 -1
  21. package/helper/vetur/tags.json +1 -1
  22. package/lib/components.js +14 -15
  23. package/lib/components.min.js +1 -1
  24. package/lib/gantt/src/emits.js +1 -1
  25. package/lib/gantt/src/emits.min.js +1 -1
  26. package/lib/gantt/src/gantt-body.js +19 -7
  27. package/lib/gantt/src/gantt-body.min.js +1 -1
  28. package/lib/gantt/src/gantt-chart.js +50 -15
  29. package/lib/gantt/src/gantt-chart.min.js +1 -1
  30. package/lib/gantt/src/gantt-header.js +24 -3
  31. package/lib/gantt/src/gantt-header.min.js +1 -1
  32. package/lib/gantt/src/gantt-view.js +6 -2
  33. package/lib/gantt/src/gantt-view.min.js +1 -1
  34. package/lib/gantt/src/gantt.js +122 -40
  35. package/lib/gantt/src/gantt.min.js +1 -1
  36. package/lib/gantt/src/util.js +7 -0
  37. package/lib/gantt/src/util.min.js +1 -1
  38. package/lib/gantt/style/style.css +36 -25
  39. package/lib/gantt/style/style.min.css +1 -1
  40. package/lib/index.common.js +5 -5
  41. package/lib/index.umd.js +25388 -6143
  42. package/lib/index.umd.min.js +1 -1
  43. package/lib/style.css +1 -1
  44. package/lib/style.min.css +1 -1
  45. package/lib/ui/index.js +13 -15
  46. package/lib/ui/index.min.js +1 -1
  47. package/lib/ui/src/log.js +6 -3
  48. package/lib/ui/src/log.min.js +1 -1
  49. package/lib/ui/src/utils.js +4 -0
  50. package/lib/ui/src/utils.min.js +1 -1
  51. package/lib/vxe-gantt/style/style.css +36 -25
  52. package/lib/vxe-gantt/style/style.min.css +1 -1
  53. package/package.json +4 -4
  54. package/packages/components.ts +6 -3
  55. package/packages/gantt/src/emits.ts +6 -1
  56. package/packages/gantt/src/gantt-body.ts +15 -6
  57. package/packages/gantt/src/gantt-chart.ts +31 -14
  58. package/packages/gantt/src/gantt-header.ts +24 -3
  59. package/packages/gantt/src/gantt-view.ts +6 -1
  60. package/packages/gantt/src/gantt.ts +133 -39
  61. package/packages/gantt/src/util.ts +7 -0
  62. package/packages/index.ts +2 -2
  63. package/packages/ui/index.ts +9 -3
  64. package/packages/ui/src/log.ts +3 -1
  65. package/packages/ui/src/utils.ts +4 -0
  66. package/styles/components/gantt-module/gantt-chart.scss +28 -9
  67. package/styles/components/gantt.scss +12 -13
  68. package/styles/theme/base.scss +5 -1
  69. package/es/gantt/src/grid-props.js +0 -7
  70. package/es/gantt/src/props.js +0 -2
  71. package/es/gantt/src/table-props.js +0 -298
  72. package/lib/gantt/src/grid-props.js +0 -24
  73. package/lib/gantt/src/grid-props.min.js +0 -1
  74. package/lib/gantt/src/props.js +0 -13
  75. package/lib/gantt/src/props.min.js +0 -1
  76. package/lib/gantt/src/table-props.js +0 -306
  77. package/lib/gantt/src/table-props.min.js +0 -1
  78. package/packages/gantt/src/grid-props.ts +0 -23
  79. package/packages/gantt/src/props.ts +0 -13
  80. package/packages/gantt/src/table-props.ts +0 -304
package/README.md CHANGED
@@ -58,7 +58,7 @@
58
58
  版本:[vue](https://www.npmjs.com/package/vue) 3.x
59
59
 
60
60
  ```shell
61
- npm install vxe-gantt
61
+ npm install vxe-pc-ui vxe-table vxe-gantt
62
62
  ```
63
63
 
64
64
  Get on [unpkg](https://unpkg.com/vxe-gantt/) and [cdnjs](https://cdn.jsdelivr.net/npm/vxe-gantt/)
package/es/components.js CHANGED
@@ -1,5 +1,6 @@
1
- import { setConfig } from '@vxe-ui/core';
1
+ import VxeUI from './ui';
2
2
  import VxeGantt from './gantt';
3
+ const { setConfig } = VxeUI;
3
4
  const components = [
4
5
  VxeGantt
5
6
  ];
@@ -7,6 +8,6 @@ export function install(app, options) {
7
8
  setConfig(options);
8
9
  components.forEach(component => app.use(component));
9
10
  }
10
- export * from './ui';
11
+ export { VxeUI };
11
12
  // Components
12
13
  export * from './gantt';
@@ -1,4 +1,8 @@
1
1
  import { gridEmits } from './grid-emits';
2
2
  export const ganttEmits = [
3
- ...gridEmits
3
+ ...gridEmits,
4
+ 'task-cell-click',
5
+ 'task-cell-dblclick',
6
+ 'task-bar-click',
7
+ 'task-bar-dblclick'
4
8
  ];
@@ -8,15 +8,15 @@ export default defineVxeComponent({
8
8
  const $xeGantt = inject('$xeGantt', {});
9
9
  const $xeGanttView = inject('$xeGanttView', {});
10
10
  const { reactData, internalData } = $xeGanttView;
11
- const { refTable } = $xeGantt.getRefMaps();
12
11
  const refElem = ref();
13
12
  const refBodyScroll = ref();
14
13
  const refBodyTable = ref();
15
14
  const refBodyXSpace = ref();
16
15
  const refBodyYSpace = ref();
17
16
  const renderRows = () => {
18
- const $xeTable = refTable.value;
19
- const fullAllDataRowIdData = $xeTable ? $xeTable.internalData.fullAllDataRowIdData : {};
17
+ const $xeTable = $xeGanttView.internalData.xeTable;
18
+ const tableInternalData = $xeTable ? $xeTable.internalData : {};
19
+ const fullAllDataRowIdData = tableInternalData.fullAllDataRowIdData || {};
20
20
  let cellOpts = {};
21
21
  let rowOpts = {};
22
22
  let defaultRowHeight = 0;
@@ -40,6 +40,12 @@ export default defineVxeComponent({
40
40
  class: 'vxe-gantt-view--body-column',
41
41
  style: {
42
42
  height: `${cellHeight}px`
43
+ },
44
+ onClick(evnt) {
45
+ $xeGantt.handleTaskCellClickEvent(evnt, { row });
46
+ },
47
+ onDblclick(evnt) {
48
+ $xeGantt.handleTaskCellDblclickEvent(evnt, { row });
43
49
  }
44
50
  });
45
51
  })));
@@ -47,7 +53,7 @@ export default defineVxeComponent({
47
53
  return trVNs;
48
54
  };
49
55
  const renderVN = () => {
50
- const { tableColumn } = reactData;
56
+ const { tableColumn, viewCellWidth } = reactData;
51
57
  return h('div', {
52
58
  ref: refElem,
53
59
  class: 'vxe-gantt-view--body-wrapper'
@@ -71,7 +77,10 @@ export default defineVxeComponent({
71
77
  }, [
72
78
  h('colgroup', {}, tableColumn.map((column, cIndex) => {
73
79
  return h('col', {
74
- key: cIndex
80
+ key: cIndex,
81
+ style: {
82
+ width: `${viewCellWidth}px`
83
+ }
75
84
  });
76
85
  })),
77
86
  h('tbody', {}, renderRows())
@@ -1,19 +1,22 @@
1
1
  import { h, inject, ref, onMounted, onUnmounted } from 'vue';
2
2
  import { defineVxeComponent } from '../../ui/src/comp';
3
+ import { VxeUI } from '@vxe-ui/core';
3
4
  import XEUtils from 'xe-utils';
4
5
  import { getCellRestHeight } from './util';
6
+ import { getStringValue } from '../../ui/src/utils';
7
+ const { renderEmptyElement } = VxeUI;
5
8
  export default defineVxeComponent({
6
9
  name: 'VxeGanttViewChart',
7
10
  setup() {
8
11
  const $xeGantt = inject('$xeGantt', {});
9
12
  const $xeGanttView = inject('$xeGanttView', {});
10
13
  const { reactData, internalData } = $xeGanttView;
11
- const { refTable } = $xeGantt.getRefMaps();
12
- const { computeProgressField } = $xeGantt.getComputeMaps();
14
+ const { computeProgressField, computeTitleField, computeTaskBarOpts } = $xeGantt.getComputeMaps();
13
15
  const refElem = ref();
14
16
  const renderVN = () => {
15
- const $xeTable = refTable.value;
16
- const fullAllDataRowIdData = $xeTable ? $xeTable.internalData.fullAllDataRowIdData : {};
17
+ const $xeTable = $xeGanttView.internalData.xeTable;
18
+ const tableInternalData = $xeTable ? $xeTable.internalData : {};
19
+ const fullAllDataRowIdData = tableInternalData.fullAllDataRowIdData || {};
17
20
  let cellOpts = {};
18
21
  let rowOpts = {};
19
22
  let defaultRowHeight = 0;
@@ -24,36 +27,54 @@ export default defineVxeComponent({
24
27
  defaultRowHeight = computeDefaultRowHeight.value;
25
28
  }
26
29
  const { tableData } = reactData;
30
+ const titleField = computeTitleField.value;
27
31
  const progressField = computeProgressField.value;
32
+ const taskBarOpts = computeTaskBarOpts.value;
33
+ const { showProgress, showContent, contentMethod, barStyle } = taskBarOpts;
34
+ const { round } = barStyle || {};
28
35
  const trVNs = [];
29
36
  tableData.forEach((row, rIndex) => {
30
37
  const rowid = $xeTable ? $xeTable.getRowid(row) : '';
31
38
  const rowRest = fullAllDataRowIdData[rowid] || {};
32
39
  const cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
33
- const progressValue = XEUtils.get(row, progressField);
40
+ let title = getStringValue(XEUtils.get(row, titleField));
41
+ const progressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(row, progressField)))) : 0;
42
+ if (contentMethod) {
43
+ title = getStringValue(contentMethod({ row, title }));
44
+ }
34
45
  trVNs.push(h('div', {
35
46
  key: rIndex,
36
47
  rowid,
37
- class: 'vxe-gantt-view--chart-row',
48
+ class: ['vxe-gantt-view--chart-row', {
49
+ 'is--round': round
50
+ }],
38
51
  style: {
39
52
  height: `${cellHeight}px`
40
53
  }
41
54
  }, [
42
55
  h('div', {
43
56
  class: 'vxe-gantt-view--chart-bar',
44
- rowid
57
+ rowid,
58
+ onClick(evnt) {
59
+ $xeGantt.handleTaskBarClickEvent(evnt, { row });
60
+ },
61
+ onDblclick(evnt) {
62
+ $xeGantt.handleTaskBarDblclickEvent(evnt, { row });
63
+ }
45
64
  }, [
46
- h('div', {
47
- class: 'vxe-gantt-view--chart-progress',
48
- style: progressValue
49
- ? {
50
- width: `${progressValue}%`
65
+ showProgress
66
+ ? h('div', {
67
+ class: 'vxe-gantt-view--chart-progress',
68
+ style: {
69
+ width: `${progressValue || 0}%`
51
70
  }
52
- : undefined
53
- }),
54
- h('div', {
55
- class: 'vxe-gantt-view--chart-content'
56
- })
71
+ })
72
+ : renderEmptyElement($xeGantt),
73
+ showContent
74
+ ? h('div', {
75
+ class: 'vxe-gantt-view--chart-content'
76
+ }, title)
77
+ : renderEmptyElement($xeGantt)
57
78
  ])
58
79
  ]));
59
80
  });
@@ -1,5 +1,6 @@
1
1
  import { h, inject, ref, onMounted, onUnmounted } from 'vue';
2
2
  import { defineVxeComponent } from '../../ui/src/comp';
3
+ import { getCellHeight } from './util';
3
4
  export default defineVxeComponent({
4
5
  name: 'VxeGanttView',
5
6
  setup() {
@@ -10,7 +11,17 @@ export default defineVxeComponent({
10
11
  const refHeaderTable = ref();
11
12
  const refHeaderXSpace = ref();
12
13
  const renderVN = () => {
13
- const { tableColumn, headerGroups } = reactData;
14
+ const $xeTable = $xeGanttView.internalData.xeTable;
15
+ const { tableColumn, headerGroups, viewCellWidth } = reactData;
16
+ let defaultRowHeight = 0;
17
+ let headerCellOpts = {};
18
+ let currCellHeight = 0;
19
+ if ($xeTable) {
20
+ const { computeDefaultRowHeight, computeHeaderCellOpts } = $xeTable.getComputeMaps();
21
+ defaultRowHeight = computeDefaultRowHeight.value;
22
+ headerCellOpts = computeHeaderCellOpts.value;
23
+ currCellHeight = getCellHeight(headerCellOpts.height) || defaultRowHeight;
24
+ }
14
25
  return h('div', {
15
26
  ref: refElem,
16
27
  class: 'vxe-gantt-view--header-wrapper'
@@ -26,11 +37,17 @@ export default defineVxeComponent({
26
37
  }),
27
38
  h('table', {
28
39
  ref: refHeaderTable,
29
- class: 'vxe-gantt-view--header-table'
40
+ class: 'vxe-gantt-view--header-table',
41
+ style: {
42
+ height: `${currCellHeight}px`
43
+ }
30
44
  }, [
31
45
  h('colgroup', {}, tableColumn.map((column, cIndex) => {
32
46
  return h('col', {
33
- key: cIndex
47
+ key: cIndex,
48
+ style: {
49
+ width: `${viewCellWidth}px`
50
+ }
34
51
  });
35
52
  })),
36
53
  h('thead', {}, headerGroups.map((cols, rIndex) => {
@@ -1,7 +1,7 @@
1
1
  import { h, ref, reactive, nextTick, inject, watch, provide, onMounted, onUnmounted } from 'vue';
2
2
  import { defineVxeComponent } from '../../ui/src/comp';
3
3
  import { setScrollTop, setScrollLeft } from '../../ui/src/dom';
4
- import { VxeUI } from '../../ui';
4
+ import { VxeUI } from '@vxe-ui/core';
5
5
  import { getRefElem } from './util';
6
6
  import XEUtils from 'xe-utils';
7
7
  import GanttViewHeaderComponent from './gantt-header';
@@ -487,6 +487,10 @@ export default defineVxeComponent({
487
487
  checkLastSyncScroll(isRollX, isRollY);
488
488
  };
489
489
  const ganttViewMethods = {
490
+ refreshData() {
491
+ handleUpdateData();
492
+ return handleLazyRecalculate();
493
+ },
490
494
  updateViewData() {
491
495
  const $xeTable = internalData.xeTable;
492
496
  if ($xeTable) {
@@ -3,16 +3,17 @@ import { defineVxeComponent } from '../../ui/src/comp';
3
3
  import XEUtils from 'xe-utils';
4
4
  import { getLastZIndex, nextZIndex, isEnableConf } from '../../ui/src/utils';
5
5
  import { getOffsetHeight, getPaddingTopBottomSize, getDomNode, toCssUnit, addClass, removeClass } from '../../ui/src/dom';
6
- import { VxeUI } from '../../ui';
7
- import { ganttProps } from './props';
6
+ import { VxeUI } from '@vxe-ui/core';
8
7
  import { ganttEmits } from './emits';
9
8
  import { tableEmits } from './table-emits';
10
- import { tableProps } from './table-props';
11
9
  import { warnLog, errLog } from '../../ui/src/log';
12
10
  import GanttViewComponent from './gantt-view';
11
+ import { VxeTable as VxeTableComponent } from 'vxe-table';
13
12
  const { getConfig, getIcon, getI18n, commands, hooks, useFns, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement, getSlotVNs } = VxeUI;
13
+ const tableProps = VxeTableComponent.props;
14
14
  const tableComponentPropKeys = Object.keys(tableProps);
15
15
  const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
16
+ const defaultLayouts = [['Form'], ['Toolbar', 'Top', 'Gantt', 'Bottom', 'Pager']];
16
17
  function createInternalData() {
17
18
  return {
18
19
  resizeTableWidth: 0
@@ -20,7 +21,10 @@ function createInternalData() {
20
21
  }
21
22
  export default defineVxeComponent({
22
23
  name: 'VxeGantt',
23
- props: ganttProps,
24
+ props: Object.assign(Object.assign({}, tableProps), { columns: Array, pagerConfig: Object, proxyConfig: Object, toolbarConfig: Object, formConfig: Object, zoomConfig: Object, layouts: Array, taskConfig: Object, taskViewConfig: Object, taskBarConfig: Object, taskSplitConfig: Object, size: {
25
+ type: String,
26
+ default: () => getConfig().gantt.size || getConfig().size
27
+ } }),
24
28
  emits: ganttEmits,
25
29
  setup(props, context) {
26
30
  var _a;
@@ -31,7 +35,6 @@ export default defineVxeComponent({
31
35
  const VxeUIPagerComponent = VxeUI.getComponent('VxePager');
32
36
  const VxeTableComponent = VxeUI.getComponent('VxeTable');
33
37
  const VxeToolbarComponent = VxeUI.getComponent('VxeToolbar');
34
- const defaultLayouts = [['Form'], ['Toolbar', 'Top', 'Gantt', 'Bottom', 'Pager']];
35
38
  const { computeSize } = useFns.useSize(props);
36
39
  const reactData = reactive({
37
40
  tableLoading: false,
@@ -119,17 +122,20 @@ export default defineVxeComponent({
119
122
  const computeTaskBarOpts = computed(() => {
120
123
  return Object.assign({}, getConfig().gantt.taskBarConfig, props.taskBarConfig);
121
124
  });
125
+ const computeTaskSplitOpts = computed(() => {
126
+ return Object.assign({}, getConfig().gantt.taskSplitConfig, props.taskSplitConfig);
127
+ });
122
128
  const computeTitleField = computed(() => {
123
129
  const taskOpts = computeTaskOpts.value;
124
130
  return taskOpts.titleField || 'title';
125
131
  });
126
132
  const computeStartField = computed(() => {
127
133
  const taskOpts = computeTaskOpts.value;
128
- return taskOpts.startField || 'startDate';
134
+ return taskOpts.startField || 'start';
129
135
  });
130
136
  const computeEndField = computed(() => {
131
137
  const taskOpts = computeTaskOpts.value;
132
- return taskOpts.endField || 'endDate';
138
+ return taskOpts.endField || 'end';
133
139
  });
134
140
  const computeProgressField = computed(() => {
135
141
  const taskOpts = computeTaskOpts.value;
@@ -149,6 +155,10 @@ export default defineVxeComponent({
149
155
  const computeStyles = computed(() => {
150
156
  const { height, maxHeight } = props;
151
157
  const { isZMax, tZindex } = reactData;
158
+ const taskViewOpts = computeTaskViewOpts.value;
159
+ const { tableStyle } = taskViewOpts;
160
+ const taskBarOpts = computeTaskBarOpts.value;
161
+ const { barStyle } = taskBarOpts;
152
162
  const stys = {};
153
163
  if (isZMax) {
154
164
  stys.zIndex = tZindex;
@@ -161,6 +171,21 @@ export default defineVxeComponent({
161
171
  stys.maxHeight = maxHeight === 'auto' || maxHeight === '100%' ? '100%' : toCssUnit(maxHeight);
162
172
  }
163
173
  }
174
+ if (barStyle) {
175
+ const { bgColor, completedBgColor } = barStyle;
176
+ if (bgColor) {
177
+ stys['--vxe-ui-gantt-view-task-bar-background-color'] = bgColor;
178
+ }
179
+ if (completedBgColor) {
180
+ stys['--vxe-ui-gantt-view-task-bar-completed-background-color'] = completedBgColor;
181
+ }
182
+ }
183
+ if (tableStyle) {
184
+ const { width: defTbWidth } = tableStyle;
185
+ if (defTbWidth) {
186
+ stys['--vxe-ui-gantt-view-table-default-width'] = toCssUnit(defTbWidth);
187
+ }
188
+ }
164
189
  return stys;
165
190
  });
166
191
  const computeTableExtendProps = computed(() => {
@@ -279,6 +304,7 @@ export default defineVxeComponent({
279
304
  computeTaskOpts,
280
305
  computeTaskViewOpts,
281
306
  computeTaskBarOpts,
307
+ computeTaskSplitOpts,
282
308
  computeTitleField,
283
309
  computeStartField,
284
310
  computeEndField,
@@ -1194,7 +1220,7 @@ export default defineVxeComponent({
1194
1220
  };
1195
1221
  }
1196
1222
  return null;
1197
- }
1223
+ },
1198
1224
  // setProxyInfo (options) {
1199
1225
  // if (props.proxyConfig && options) {
1200
1226
  // const { pager, form } = options
@@ -1212,7 +1238,14 @@ export default defineVxeComponent({
1212
1238
  // }
1213
1239
  // }
1214
1240
  // return nextTick()
1215
- // }
1241
+ // },
1242
+ refreshTaskView() {
1243
+ const $ganttView = refGanttView.value;
1244
+ if ($ganttView) {
1245
+ return $ganttView.refreshData();
1246
+ }
1247
+ return nextTick();
1248
+ }
1216
1249
  };
1217
1250
  const ganttPrivateMethods = {
1218
1251
  extendTableMethods,
@@ -1272,6 +1305,18 @@ export default defineVxeComponent({
1272
1305
  triggerZoomEvent(evnt) {
1273
1306
  $xeGantt.zoom();
1274
1307
  $xeGantt.dispatchEvent('zoom', { type: reactData.isZMax ? 'max' : 'revert' }, evnt);
1308
+ },
1309
+ handleTaskCellClickEvent(evnt, params) {
1310
+ $xeGantt.dispatchEvent('task-cell-click', params, evnt);
1311
+ },
1312
+ handleTaskCellDblclickEvent(evnt, params) {
1313
+ $xeGantt.dispatchEvent('task-cell-dblclick', params, evnt);
1314
+ },
1315
+ handleTaskBarClickEvent(evnt, params) {
1316
+ $xeGantt.dispatchEvent('task-bar-click', params, evnt);
1317
+ },
1318
+ handleTaskBarDblclickEvent(evnt, params) {
1319
+ $xeGantt.dispatchEvent('task-bar-dblclick', params, evnt);
1275
1320
  }
1276
1321
  };
1277
1322
  Object.assign($xeGantt, ganttExtendTableMethods, ganttMethods, ganttPrivateMethods, {
@@ -1524,37 +1569,47 @@ export default defineVxeComponent({
1524
1569
  };
1525
1570
  const renderSplitBar = () => {
1526
1571
  const { showLeftView, showRightView } = reactData;
1572
+ const taskSplitOpts = computeTaskSplitOpts.value;
1573
+ const { enabled, resize, showCollapseTableButton, showCollapseTaskButton } = taskSplitOpts;
1574
+ if (!enabled) {
1575
+ return renderEmptyElement($xeGantt);
1576
+ }
1577
+ const ons = {};
1578
+ if (resize) {
1579
+ ons.onMousedown = dragSplitEvent;
1580
+ }
1527
1581
  return h('div', {
1528
- class: 'vxe-gantt--view-split-bar'
1582
+ class: ['vxe-gantt--view-split-bar', Object.assign({ 'is--resize': resize }, ons)]
1529
1583
  }, [
1530
1584
  h('div', {
1531
- class: 'vxe-gantt--view-split-bar-handle',
1532
- onMousedown: dragSplitEvent
1585
+ class: 'vxe-gantt--view-split-bar-handle'
1533
1586
  }),
1534
- h('div', {
1535
- class: 'vxe-gantt--view-split-bar-btn-wrapper'
1536
- }, [
1537
- showRightView
1538
- ? h('div', {
1539
- class: 'vxe-gantt--view-split-bar-left-btn',
1540
- onClick: handleSplitLeftViewEvent
1541
- }, [
1542
- h('i', {
1543
- class: showLeftView ? getIcon().GANTT_VIEW_LEFT_OPEN : getIcon().GANTT_VIEW_LEFT_CLOSE
1544
- })
1545
- ])
1546
- : renderEmptyElement($xeGantt),
1547
- showLeftView
1548
- ? h('div', {
1549
- class: 'vxe-gantt--view-split-bar-right-btn',
1550
- onClick: handleSplitRightViewEvent
1551
- }, [
1552
- h('i', {
1553
- class: showRightView ? getIcon().GANTT_VIEW_RIGHT_OPEN : getIcon().GANTT_VIEW_RIGHT_CLOSE
1554
- })
1555
- ])
1556
- : renderEmptyElement($xeGantt)
1557
- ])
1587
+ showCollapseTableButton || showCollapseTaskButton
1588
+ ? h('div', {
1589
+ class: 'vxe-gantt--view-split-bar-btn-wrapper'
1590
+ }, [
1591
+ showCollapseTableButton && showRightView
1592
+ ? h('div', {
1593
+ class: 'vxe-gantt--view-split-bar-left-btn',
1594
+ onClick: handleSplitLeftViewEvent
1595
+ }, [
1596
+ h('i', {
1597
+ class: showLeftView ? getIcon().GANTT_VIEW_LEFT_OPEN : getIcon().GANTT_VIEW_LEFT_CLOSE
1598
+ })
1599
+ ])
1600
+ : renderEmptyElement($xeGantt),
1601
+ showCollapseTaskButton && showLeftView
1602
+ ? h('div', {
1603
+ class: 'vxe-gantt--view-split-bar-right-btn',
1604
+ onClick: handleSplitRightViewEvent
1605
+ }, [
1606
+ h('i', {
1607
+ class: showRightView ? getIcon().GANTT_VIEW_RIGHT_OPEN : getIcon().GANTT_VIEW_RIGHT_CLOSE
1608
+ })
1609
+ ])
1610
+ : renderEmptyElement($xeGantt)
1611
+ ])
1612
+ : renderEmptyElement($xeGantt)
1558
1613
  ]);
1559
1614
  };
1560
1615
  const renderChildLayout = (layoutKeys) => {
@@ -7,6 +7,12 @@ export function getRefElem(refEl) {
7
7
  }
8
8
  return null;
9
9
  }
10
+ export function getCellHeight(height) {
11
+ if (height === 'unset') {
12
+ return 0;
13
+ }
14
+ return height || 0;
15
+ }
10
16
  export function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
11
17
  return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
12
18
  }
@@ -9,19 +9,27 @@
9
9
  .vxe-gantt-view--chart-row {
10
10
  position: relative;
11
11
  }
12
+ .vxe-gantt-view--chart-row.is--round > .vxe-gantt-view--chart-bar {
13
+ border-radius: var(--vxe-ui-gantt-view-task-bar-border-radius);
14
+ }
15
+ .vxe-gantt-view--chart-row.is--round > .vxe-gantt-view--chart-bar:hover::after {
16
+ border-radius: var(--vxe-ui-gantt-view-task-bar-border-radius);
17
+ }
18
+ .vxe-gantt-view--chart-row.is--round > .vxe-gantt-view--chart-bar > .vxe-gantt-view--chart-progress {
19
+ border-radius: var(--vxe-ui-gantt-view-task-bar-border-radius) 0 0 var(--vxe-ui-gantt-view-task-bar-border-radius);
20
+ }
12
21
 
13
22
  .vxe-gantt-view--chart-bar {
14
23
  display: flex;
15
24
  flex-direction: row;
25
+ align-items: center;
16
26
  position: absolute;
17
- width: 100px;
18
27
  top: 50%;
19
28
  left: 0;
20
29
  color: #ffffff;
21
30
  transform: translateY(-50%);
22
- border-radius: var(--vxe-ui-base-border-radius);
23
31
  height: var(--vxe-ui-gantt-view-chart-bar-height);
24
- background-color: var(--vxe-ui-font-primary-lighten-color);
32
+ background-color: var(--vxe-ui-gantt-view-task-bar-background-color);
25
33
  pointer-events: all;
26
34
  }
27
35
  .vxe-gantt-view--chart-bar:hover::after {
@@ -32,20 +40,27 @@
32
40
  width: 100%;
33
41
  height: 100%;
34
42
  background-color: rgba(0, 0, 0, 0.1);
35
- border-radius: var(--vxe-ui-base-border-radius);
36
43
  }
37
44
 
38
45
  .vxe-gantt-view--chart-progress {
39
46
  flex-shrink: 0;
40
- width: 40px;
47
+ width: 0;
48
+ height: 100%;
41
49
  text-align: left;
42
- border-radius: var(--vxe-ui-base-border-radius) 0 0 var(--vxe-ui-base-border-radius);
43
- background-color: var(--vxe-ui-font-primary-color);
50
+ background-color: var(--vxe-ui-gantt-view-task-bar-completed-background-color);
51
+ overflow: hidden;
52
+ text-overflow: ellipsis;
53
+ white-space: nowrap;
44
54
  }
45
55
 
46
56
  .vxe-gantt-view--chart-content {
47
- flex-grow: 1;
48
- text-align: right;
57
+ position: absolute;
58
+ width: 100%;
59
+ overflow: hidden;
60
+ text-overflow: ellipsis;
61
+ white-space: nowrap;
62
+ font-size: 0.9em;
63
+ padding: 0 0.6em;
49
64
  }
50
65
 
51
66
  .vxe-gantt {
@@ -121,17 +136,19 @@
121
136
  }
122
137
  .vxe-gantt .vxe-gantt--view-split-bar {
123
138
  flex-shrink: 0;
124
- cursor: col-resize;
125
139
  width: var(--vxe-ui-gantt-view-split-bar-width);
126
140
  background-color: var(--vxe-ui-gantt-view-split-bar-background-color);
127
141
  }
142
+ .vxe-gantt .vxe-gantt--view-split-bar.is--resize {
143
+ cursor: col-resize;
144
+ }
128
145
  .vxe-gantt.show--left .vxe-gantt--table-wrapper {
129
146
  display: block;
130
147
  }
131
148
  .vxe-gantt.show--left.show--right .vxe-gantt--table-wrapper {
132
149
  flex-grow: unset;
133
150
  flex-shrink: 0;
134
- width: 30%;
151
+ width: var(--vxe-ui-gantt-view-table-default-width);
135
152
  }
136
153
  .vxe-gantt.show--right .vxe-gantt--view-wrapper {
137
154
  display: block;
@@ -281,6 +298,12 @@
281
298
  z-index: 15;
282
299
  pointer-events: none;
283
300
  }
301
+ .vxe-gantt--view-split-bar-btn-wrapper > div {
302
+ margin-top: 1em;
303
+ }
304
+ .vxe-gantt--view-split-bar-btn-wrapper > div:first-child {
305
+ margin-top: 0;
306
+ }
284
307
 
285
308
  .vxe-gantt--view-split-bar-left-btn,
286
309
  .vxe-gantt--view-split-bar-right-btn {
@@ -311,10 +334,6 @@
311
334
  transform: scale(0.9);
312
335
  }
313
336
 
314
- .vxe-gantt--view-split-bar-right-btn {
315
- margin-top: 1em;
316
- }
317
-
318
337
  .vxe-gantt--resizable-split-tip {
319
338
  display: none;
320
339
  position: absolute;
@@ -505,7 +524,7 @@
505
524
  }
506
525
 
507
526
  .vxe-gantt-view--column-info {
508
- width: var(--vxe-ui-gantt-view-column-width);
527
+ width: var(--vxe-ui-gantt-view-default-cell-width);
509
528
  }
510
529
 
511
530
  .vxe-gantt-view {
@@ -522,10 +541,6 @@
522
541
  float: left;
523
542
  }
524
543
 
525
- .vxe-gantt-view--header-table {
526
- height: 100%;
527
- }
528
-
529
544
  .vxe-gantt-view--header-table,
530
545
  .vxe-gantt-view--body-table {
531
546
  border: 0;
@@ -535,7 +550,7 @@
535
550
  }
536
551
  .vxe-gantt-view--header-table col,
537
552
  .vxe-gantt-view--body-table col {
538
- width: var(--vxe-ui-gantt-view-column-width);
553
+ width: var(--vxe-ui-gantt-view-default-cell-width);
539
554
  }
540
555
 
541
556
  .vxe-gantt-view--header-wrapper,
@@ -568,10 +583,6 @@
568
583
  font-size: 1em;
569
584
  }
570
585
 
571
- .vxe-gantt-view--body-column {
572
- height: 48px;
573
- }
574
-
575
586
  .vxe-gantt-view--header-column,
576
587
  .vxe-gantt-view--body-column,
577
588
  .vxe-gantt-view--footer-column {