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

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 (69) hide show
  1. package/README.md +1 -1
  2. package/es/gantt/src/emits.js +5 -1
  3. package/es/gantt/src/gantt-body.js +11 -2
  4. package/es/gantt/src/gantt-chart.js +35 -14
  5. package/es/gantt/src/gantt-header.js +5 -2
  6. package/es/gantt/src/gantt-view.js +5 -1
  7. package/es/gantt/src/gantt.js +84 -32
  8. package/es/gantt/src/grid-props.js +1 -1
  9. package/es/gantt/src/props.js +1 -1
  10. package/es/gantt/src/table-props.js +1 -1
  11. package/es/gantt/style.css +36 -17
  12. package/es/gantt/style.min.css +1 -1
  13. package/es/style.css +1 -1
  14. package/es/style.min.css +1 -1
  15. package/es/ui/index.js +9 -2
  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 -17
  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/gantt/src/emits.js +1 -1
  23. package/lib/gantt/src/emits.min.js +1 -1
  24. package/lib/gantt/src/gantt-body.js +16 -2
  25. package/lib/gantt/src/gantt-body.min.js +1 -1
  26. package/lib/gantt/src/gantt-chart.js +47 -10
  27. package/lib/gantt/src/gantt-chart.min.js +1 -1
  28. package/lib/gantt/src/gantt-header.js +6 -2
  29. package/lib/gantt/src/gantt-header.min.js +1 -1
  30. package/lib/gantt/src/gantt-view.js +6 -2
  31. package/lib/gantt/src/gantt-view.min.js +1 -1
  32. package/lib/gantt/src/gantt.js +101 -35
  33. package/lib/gantt/src/gantt.min.js +1 -1
  34. package/lib/gantt/src/grid-props.js +2 -2
  35. package/lib/gantt/src/grid-props.min.js +1 -1
  36. package/lib/gantt/src/props.js +2 -1
  37. package/lib/gantt/src/props.min.js +1 -1
  38. package/lib/gantt/src/table-props.js +2 -2
  39. package/lib/gantt/src/table-props.min.js +1 -1
  40. package/lib/gantt/style/style.css +36 -17
  41. package/lib/gantt/style/style.min.css +1 -1
  42. package/lib/index.umd.js +214 -73
  43. package/lib/index.umd.min.js +1 -1
  44. package/lib/style.css +1 -1
  45. package/lib/style.min.css +1 -1
  46. package/lib/ui/index.js +13 -3
  47. package/lib/ui/index.min.js +1 -1
  48. package/lib/ui/src/log.js +6 -3
  49. package/lib/ui/src/log.min.js +1 -1
  50. package/lib/ui/src/utils.js +4 -0
  51. package/lib/ui/src/utils.min.js +1 -1
  52. package/lib/vxe-gantt/style/style.css +36 -17
  53. package/lib/vxe-gantt/style/style.min.css +1 -1
  54. package/package.json +4 -4
  55. package/packages/gantt/src/emits.ts +6 -1
  56. package/packages/gantt/src/gantt-body.ts +11 -2
  57. package/packages/gantt/src/gantt-chart.ts +26 -9
  58. package/packages/gantt/src/gantt-header.ts +5 -2
  59. package/packages/gantt/src/gantt-view.ts +5 -1
  60. package/packages/gantt/src/gantt.ts +88 -30
  61. package/packages/gantt/src/grid-props.ts +1 -1
  62. package/packages/gantt/src/props.ts +2 -1
  63. package/packages/gantt/src/table-props.ts +1 -1
  64. package/packages/ui/index.ts +9 -1
  65. package/packages/ui/src/log.ts +3 -1
  66. package/packages/ui/src/utils.ts +4 -0
  67. package/styles/components/gantt-module/gantt-chart.scss +28 -9
  68. package/styles/components/gantt.scss +12 -7
  69. package/styles/theme/base.scss +5 -1
package/lib/index.umd.js CHANGED
@@ -256,7 +256,10 @@ function formatText(value, placeholder) {
256
256
  * 判断值为:'' | null | undefined 时都属于空值
257
257
  */
258
258
  function eqEmptyValue(cellValue) {
259
- return cellValue === '' || XEUtils.eqNull(cellValue);
259
+ return cellValue === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue);
260
+ }
261
+ function getStringValue(cellValue) {
262
+ return eqEmptyValue(cellValue) ? '' : cellValue;
260
263
  }
261
264
  ;// ./packages/ui/src/dom.ts
262
265
 
@@ -447,13 +450,11 @@ function triggerEvent(targetElem, type) {
447
450
  function isNodeElement(elem) {
448
451
  return elem && elem.nodeType === 1;
449
452
  }
450
- // EXTERNAL MODULE: ./packages/ui/index.ts
451
- var ui = __webpack_require__(2084);
452
453
  ;// ./packages/gantt/src/table-props.ts
453
454
 
454
455
  const {
455
456
  getConfig
456
- } = ui.VxeUI;
457
+ } = core_.VxeUI;
457
458
  const tableProps = {
458
459
  /** 基本属性 */
459
460
  id: [String, Function],
@@ -755,7 +756,7 @@ const tableProps = {
755
756
 
756
757
  const {
757
758
  getConfig: grid_props_getConfig
758
- } = ui.VxeUI;
759
+ } = core_.VxeUI;
759
760
  const gridProps = {
760
761
  ...tableProps,
761
762
  layouts: Array,
@@ -777,7 +778,8 @@ const ganttProps = {
777
778
  layouts: Array,
778
779
  taskConfig: Object,
779
780
  taskViewConfig: Object,
780
- taskBarConfig: Object
781
+ taskBarConfig: Object,
782
+ taskSplitConfig: Object
781
783
  };
782
784
  ;// ./packages/gantt/src/table-emits.ts
783
785
  const tableEmits = ['update:data', 'keydown-start', 'keydown', 'keydown-end', 'paste', 'copy', 'cut', 'current-change', 'current-row-change', 'current-row-disabled', 'current-column-change', 'current-column-disabled', 'radio-change', 'checkbox-change', 'checkbox-all', 'checkbox-range-start', 'checkbox-range-change', 'checkbox-range-end', 'checkbox-range-select', 'cell-click', 'cell-dblclick', 'cell-menu', 'cell-mouseenter', 'cell-mouseleave', 'cell-selected', 'cell-delete-value', 'cell-backspace-value', 'header-cell-click', 'header-cell-dblclick', 'header-cell-menu', 'footer-cell-click', 'footer-cell-dblclick', 'footer-cell-menu', 'clear-merge', 'sort-change', 'clear-sort', 'clear-all-sort', 'filter-change', 'filter-visible', 'clear-filter', 'clear-all-filter', 'resizable-change', 'column-resizable-change', 'row-resizable-change', 'toggle-row-group-expand', 'toggle-row-expand', 'toggle-tree-expand', 'menu-click', 'edit-closed', 'row-dragstart', 'row-dragover', 'row-dragend', 'column-dragstart', 'column-dragover', 'column-dragend', 'enter-append-row', 'edit-actived', 'edit-activated', 'edit-disabled', 'valid-error', 'scroll', 'scroll-boundary', 'custom', 'custom-visible-change', 'custom-visible-all', 'custom-fixed-change', 'change-fnr', 'open-fnr', 'show-fnr', 'hide-fnr', 'fnr-change', 'fnr-find', 'fnr-find-all', 'fnr-replace', 'fnr-replace-all', 'cell-area-copy', 'cell-area-cut', 'cell-area-paste', 'cell-area-merge', 'clear-cell-area-selection', 'clear-cell-area-merge', 'header-cell-area-selection', 'cell-area-selection-invalid', 'cell-area-selection-start', 'cell-area-selection-drag', 'cell-area-selection-end', 'cell-area-extension-start', 'cell-area-extension-drag', 'cell-area-extension-end', 'cell-area-selection-all-start', 'cell-area-selection-all-end', 'cell-area-arrows-start', 'cell-area-arrows-end', 'active-cell-change-start', 'active-cell-change-end'];
@@ -786,12 +788,15 @@ const tableEmits = ['update:data', 'keydown-start', 'keydown', 'keydown-end', 'p
786
788
  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'];
787
789
  ;// ./packages/gantt/src/emits.ts
788
790
 
789
- const ganttEmits = [...gridEmits];
791
+ const ganttEmits = [...gridEmits, 'task-cell-click', 'task-cell-dblclick', 'task-bar-click', 'task-bar-dblclick'];
790
792
  ;// ./packages/ui/src/log.ts
791
793
 
792
- const version = `gantt v${"0.0.3"}`;
793
- const warnLog = core_.log.create('warn', version);
794
- const errLog = core_.log.create('error', version);
794
+ const {
795
+ log
796
+ } = core_.VxeUI;
797
+ const version = `gantt v${"4.0.0-beta.1"}`;
798
+ const warnLog = log.create('warn', version);
799
+ const errLog = log.create('error', version);
795
800
  ;// ./packages/gantt/src/util.ts
796
801
  function getRefElem(refEl) {
797
802
  if (refEl) {
@@ -825,7 +830,8 @@ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
825
830
  const renderVN = () => {
826
831
  const {
827
832
  tableColumn,
828
- headerGroups
833
+ headerGroups,
834
+ viewCellWidth
829
835
  } = reactData;
830
836
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
831
837
  ref: refElem,
@@ -842,7 +848,10 @@ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
842
848
  class: 'vxe-gantt-view--header-table'
843
849
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('colgroup', {}, tableColumn.map((column, cIndex) => {
844
850
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
845
- key: cIndex
851
+ key: cIndex,
852
+ style: {
853
+ width: `${viewCellWidth}px`
854
+ }
846
855
  });
847
856
  })), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {}, headerGroups.map((cols, rIndex) => {
848
857
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
@@ -888,6 +897,11 @@ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
888
897
 
889
898
 
890
899
 
900
+
901
+
902
+ const {
903
+ renderEmptyElement
904
+ } = core_.VxeUI;
891
905
  /* harmony default export */ var gantt_chart = (defineVxeComponent({
892
906
  name: 'VxeGanttViewChart',
893
907
  setup() {
@@ -901,7 +915,9 @@ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
901
915
  refTable
902
916
  } = $xeGantt.getRefMaps();
903
917
  const {
904
- computeProgressField
918
+ computeProgressField,
919
+ computeTitleField,
920
+ computeTaskBarOpts
905
921
  } = $xeGantt.getComputeMaps();
906
922
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
907
923
  const renderVN = () => {
@@ -923,31 +939,61 @@ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
923
939
  const {
924
940
  tableData
925
941
  } = reactData;
942
+ const titleField = computeTitleField.value;
926
943
  const progressField = computeProgressField.value;
944
+ const taskBarOpts = computeTaskBarOpts.value;
945
+ const {
946
+ showProgress,
947
+ showContent,
948
+ contentMethod,
949
+ barStyle
950
+ } = taskBarOpts;
951
+ const {
952
+ round
953
+ } = barStyle || {};
927
954
  const trVNs = [];
928
955
  tableData.forEach((row, rIndex) => {
929
956
  const rowid = $xeTable ? $xeTable.getRowid(row) : '';
930
957
  const rowRest = fullAllDataRowIdData[rowid] || {};
931
958
  const cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
932
- const progressValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, progressField);
959
+ let title = getStringValue(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, titleField));
960
+ const progressValue = showProgress ? Math.min(100, Math.max(0, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, progressField)))) : 0;
961
+ if (contentMethod) {
962
+ title = getStringValue(contentMethod({
963
+ row,
964
+ title
965
+ }));
966
+ }
933
967
  trVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
934
968
  key: rIndex,
935
969
  rowid,
936
- class: 'vxe-gantt-view--chart-row',
970
+ class: ['vxe-gantt-view--chart-row', {
971
+ 'is--round': round
972
+ }],
937
973
  style: {
938
974
  height: `${cellHeight}px`
939
975
  }
940
976
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
941
977
  class: 'vxe-gantt-view--chart-bar',
942
- rowid
943
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
978
+ rowid,
979
+ onClick(evnt) {
980
+ $xeGantt.handleTaskBarClickEvent(evnt, {
981
+ row
982
+ });
983
+ },
984
+ onDblclick(evnt) {
985
+ $xeGantt.handleTaskBarDblclickEvent(evnt, {
986
+ row
987
+ });
988
+ }
989
+ }, [showProgress ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
944
990
  class: 'vxe-gantt-view--chart-progress',
945
- style: progressValue ? {
946
- width: `${progressValue}%`
947
- } : undefined
948
- }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
991
+ style: {
992
+ width: `${progressValue || 0}%`
993
+ }
994
+ }) : renderEmptyElement($xeGantt), showContent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
949
995
  class: 'vxe-gantt-view--chart-content'
950
- })])]));
996
+ }, title) : renderEmptyElement($xeGantt)])]));
951
997
  });
952
998
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
953
999
  ref: refElem,
@@ -1030,6 +1076,16 @@ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
1030
1076
  class: 'vxe-gantt-view--body-column',
1031
1077
  style: {
1032
1078
  height: `${cellHeight}px`
1079
+ },
1080
+ onClick(evnt) {
1081
+ $xeGantt.handleTaskCellClickEvent(evnt, {
1082
+ row
1083
+ });
1084
+ },
1085
+ onDblclick(evnt) {
1086
+ $xeGantt.handleTaskCellDblclickEvent(evnt, {
1087
+ row
1088
+ });
1033
1089
  }
1034
1090
  });
1035
1091
  })));
@@ -1038,7 +1094,8 @@ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
1038
1094
  };
1039
1095
  const renderVN = () => {
1040
1096
  const {
1041
- tableColumn
1097
+ tableColumn,
1098
+ viewCellWidth
1042
1099
  } = reactData;
1043
1100
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
1044
1101
  ref: refElem,
@@ -1058,7 +1115,10 @@ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
1058
1115
  class: 'vxe-gantt-view--body-table'
1059
1116
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('colgroup', {}, tableColumn.map((column, cIndex) => {
1060
1117
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
1061
- key: cIndex
1118
+ key: cIndex,
1119
+ style: {
1120
+ width: `${viewCellWidth}px`
1121
+ }
1062
1122
  });
1063
1123
  })), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tbody', {}, renderRows())]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(gantt_chart)])]);
1064
1124
  };
@@ -1101,7 +1161,7 @@ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
1101
1161
 
1102
1162
  const {
1103
1163
  globalEvents
1104
- } = ui.VxeUI;
1164
+ } = core_.VxeUI;
1105
1165
  function createInternalData() {
1106
1166
  return {
1107
1167
  xeTable: null,
@@ -1622,6 +1682,10 @@ const maxXWidth = 5e6;
1622
1682
  checkLastSyncScroll(isRollX, isRollY);
1623
1683
  };
1624
1684
  const ganttViewMethods = {
1685
+ refreshData() {
1686
+ handleUpdateData();
1687
+ return handleLazyRecalculate();
1688
+ },
1625
1689
  updateViewData() {
1626
1690
  const $xeTable = internalData.xeTable;
1627
1691
  if ($xeTable) {
@@ -1922,9 +1986,9 @@ const {
1922
1986
  createEvent,
1923
1987
  globalEvents: gantt_globalEvents,
1924
1988
  GLOBAL_EVENT_KEYS,
1925
- renderEmptyElement,
1989
+ renderEmptyElement: gantt_renderEmptyElement,
1926
1990
  getSlotVNs
1927
- } = ui.VxeUI;
1991
+ } = core_.VxeUI;
1928
1992
  const tableComponentPropKeys = Object.keys(tableProps);
1929
1993
  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'];
1930
1994
  function gantt_createInternalData() {
@@ -1943,10 +2007,10 @@ function gantt_createInternalData() {
1943
2007
  } = context;
1944
2008
  const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
1945
2009
  // 使用已安装的组件,如果未安装则不渲染
1946
- const VxeUIFormComponent = ui.VxeUI.getComponent('VxeForm');
1947
- const VxeUIPagerComponent = ui.VxeUI.getComponent('VxePager');
1948
- const VxeTableComponent = ui.VxeUI.getComponent('VxeTable');
1949
- const VxeToolbarComponent = ui.VxeUI.getComponent('VxeToolbar');
2010
+ const VxeUIFormComponent = core_.VxeUI.getComponent('VxeForm');
2011
+ const VxeUIPagerComponent = core_.VxeUI.getComponent('VxePager');
2012
+ const VxeTableComponent = core_.VxeUI.getComponent('VxeTable');
2013
+ const VxeToolbarComponent = core_.VxeUI.getComponent('VxeToolbar');
1950
2014
  const defaultLayouts = [['Form'], ['Toolbar', 'Top', 'Gantt', 'Bottom', 'Pager']];
1951
2015
  const {
1952
2016
  computeSize
@@ -2037,17 +2101,20 @@ function gantt_createInternalData() {
2037
2101
  const computeTaskBarOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
2038
2102
  return Object.assign({}, gantt_getConfig().gantt.taskBarConfig, props.taskBarConfig);
2039
2103
  });
2104
+ const computeTaskSplitOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
2105
+ return Object.assign({}, gantt_getConfig().gantt.taskSplitConfig, props.taskSplitConfig);
2106
+ });
2040
2107
  const computeTitleField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
2041
2108
  const taskOpts = computeTaskOpts.value;
2042
2109
  return taskOpts.titleField || 'title';
2043
2110
  });
2044
2111
  const computeStartField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
2045
2112
  const taskOpts = computeTaskOpts.value;
2046
- return taskOpts.startField || 'startDate';
2113
+ return taskOpts.startField || 'start';
2047
2114
  });
2048
2115
  const computeEndField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
2049
2116
  const taskOpts = computeTaskOpts.value;
2050
- return taskOpts.endField || 'endDate';
2117
+ return taskOpts.endField || 'end';
2051
2118
  });
2052
2119
  const computeProgressField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
2053
2120
  const taskOpts = computeTaskOpts.value;
@@ -2073,6 +2140,14 @@ function gantt_createInternalData() {
2073
2140
  isZMax,
2074
2141
  tZindex
2075
2142
  } = reactData;
2143
+ const taskViewOpts = computeTaskViewOpts.value;
2144
+ const {
2145
+ tableStyle
2146
+ } = taskViewOpts;
2147
+ const taskBarOpts = computeTaskBarOpts.value;
2148
+ const {
2149
+ barStyle
2150
+ } = taskBarOpts;
2076
2151
  const stys = {};
2077
2152
  if (isZMax) {
2078
2153
  stys.zIndex = tZindex;
@@ -2084,6 +2159,26 @@ function gantt_createInternalData() {
2084
2159
  stys.maxHeight = maxHeight === 'auto' || maxHeight === '100%' ? '100%' : toCssUnit(maxHeight);
2085
2160
  }
2086
2161
  }
2162
+ if (barStyle) {
2163
+ const {
2164
+ bgColor,
2165
+ completedBgColor
2166
+ } = barStyle;
2167
+ if (bgColor) {
2168
+ stys['--vxe-ui-gantt-view-task-bar-background-color'] = bgColor;
2169
+ }
2170
+ if (completedBgColor) {
2171
+ stys['--vxe-ui-gantt-view-task-bar-completed-background-color'] = completedBgColor;
2172
+ }
2173
+ }
2174
+ if (tableStyle) {
2175
+ const {
2176
+ width: defTbWidth
2177
+ } = tableStyle;
2178
+ if (defTbWidth) {
2179
+ stys['--vxe-ui-gantt-view-table-default-width'] = toCssUnit(defTbWidth);
2180
+ }
2181
+ }
2087
2182
  return stys;
2088
2183
  });
2089
2184
  const computeTableExtendProps = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
@@ -2222,6 +2317,7 @@ function gantt_createInternalData() {
2222
2317
  computeTaskOpts,
2223
2318
  computeTaskViewOpts,
2224
2319
  computeTaskBarOpts,
2320
+ computeTaskSplitOpts,
2225
2321
  computeTitleField,
2226
2322
  computeStartField,
2227
2323
  computeEndField,
@@ -2311,8 +2407,8 @@ function gantt_createInternalData() {
2311
2407
  $xeGantt.clearCheckboxRow();
2312
2408
  } else {
2313
2409
  if (isActiveMsg) {
2314
- if (ui.VxeUI.modal) {
2315
- ui.VxeUI.modal.message({
2410
+ if (core_.VxeUI.modal) {
2411
+ core_.VxeUI.modal.message({
2316
2412
  id: code,
2317
2413
  content: getI18n('vxe.grid.selectOneRecord'),
2318
2414
  status: 'warning'
@@ -2342,8 +2438,8 @@ function gantt_createInternalData() {
2342
2438
  const selectRecords = $xeGantt.getCheckboxRecords();
2343
2439
  if (isActiveMsg) {
2344
2440
  if (selectRecords.length) {
2345
- if (ui.VxeUI.modal) {
2346
- return ui.VxeUI.modal.confirm({
2441
+ if (core_.VxeUI.modal) {
2442
+ return core_.VxeUI.modal.confirm({
2347
2443
  id: `cfm_${code}`,
2348
2444
  content: getI18n(alertKey),
2349
2445
  escClosable: true
@@ -2354,8 +2450,8 @@ function gantt_createInternalData() {
2354
2450
  });
2355
2451
  }
2356
2452
  } else {
2357
- if (ui.VxeUI.modal) {
2358
- ui.VxeUI.modal.message({
2453
+ if (core_.VxeUI.modal) {
2454
+ core_.VxeUI.modal.message({
2359
2455
  id: `msg_${code}`,
2360
2456
  content: getI18n('vxe.grid.selectOneRecord'),
2361
2457
  status: 'warning'
@@ -2999,8 +3095,8 @@ function gantt_createInternalData() {
2999
3095
  reactData.tableLoading = false;
3000
3096
  $xeTable.setPendingRow(removeRecords, false);
3001
3097
  if (isRespMsg) {
3002
- if (ui.VxeUI.modal) {
3003
- ui.VxeUI.modal.message({
3098
+ if (core_.VxeUI.modal) {
3099
+ core_.VxeUI.modal.message({
3004
3100
  content: getRespMsg(rest, 'vxe.grid.delSuccess'),
3005
3101
  status: 'success'
3006
3102
  });
@@ -3023,8 +3119,8 @@ function gantt_createInternalData() {
3023
3119
  }).catch(rest => {
3024
3120
  reactData.tableLoading = false;
3025
3121
  if (isRespMsg) {
3026
- if (ui.VxeUI.modal) {
3027
- ui.VxeUI.modal.message({
3122
+ if (core_.VxeUI.modal) {
3123
+ core_.VxeUI.modal.message({
3028
3124
  id: code,
3029
3125
  content: getRespMsg(rest, 'vxe.grid.operError'),
3030
3126
  status: 'error'
@@ -3044,8 +3140,8 @@ function gantt_createInternalData() {
3044
3140
  });
3045
3141
  } else {
3046
3142
  if (isActiveMsg) {
3047
- if (ui.VxeUI.modal) {
3048
- ui.VxeUI.modal.message({
3143
+ if (core_.VxeUI.modal) {
3144
+ core_.VxeUI.modal.message({
3049
3145
  id: code,
3050
3146
  content: getI18n('vxe.grid.selectOneRecord'),
3051
3147
  status: 'warning'
@@ -3105,8 +3201,8 @@ function gantt_createInternalData() {
3105
3201
  reactData.tableLoading = false;
3106
3202
  $xeTable.clearPendingRow();
3107
3203
  if (isRespMsg) {
3108
- if (ui.VxeUI.modal) {
3109
- ui.VxeUI.modal.message({
3204
+ if (core_.VxeUI.modal) {
3205
+ core_.VxeUI.modal.message({
3110
3206
  content: getRespMsg(rest, 'vxe.grid.saveSuccess'),
3111
3207
  status: 'success'
3112
3208
  });
@@ -3129,8 +3225,8 @@ function gantt_createInternalData() {
3129
3225
  }).catch(rest => {
3130
3226
  reactData.tableLoading = false;
3131
3227
  if (isRespMsg) {
3132
- if (ui.VxeUI.modal) {
3133
- ui.VxeUI.modal.message({
3228
+ if (core_.VxeUI.modal) {
3229
+ core_.VxeUI.modal.message({
3134
3230
  id: code,
3135
3231
  content: getRespMsg(rest, 'vxe.grid.operError'),
3136
3232
  status: 'error'
@@ -3149,8 +3245,8 @@ function gantt_createInternalData() {
3149
3245
  });
3150
3246
  } else {
3151
3247
  if (isActiveMsg) {
3152
- if (ui.VxeUI.modal) {
3153
- ui.VxeUI.modal.message({
3248
+ if (core_.VxeUI.modal) {
3249
+ core_.VxeUI.modal.message({
3154
3250
  id: code,
3155
3251
  content: getI18n('vxe.grid.dataUnchanged'),
3156
3252
  status: 'info'
@@ -3319,7 +3415,7 @@ function gantt_createInternalData() {
3319
3415
  };
3320
3416
  }
3321
3417
  return null;
3322
- }
3418
+ },
3323
3419
  // setProxyInfo (options) {
3324
3420
  // if (props.proxyConfig && options) {
3325
3421
  // const { pager, form } = options
@@ -3337,7 +3433,14 @@ function gantt_createInternalData() {
3337
3433
  // }
3338
3434
  // }
3339
3435
  // return nextTick()
3340
- // }
3436
+ // },
3437
+ refreshTaskView() {
3438
+ const $ganttView = refGanttView.value;
3439
+ if ($ganttView) {
3440
+ return $ganttView.refreshData();
3441
+ }
3442
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
3443
+ }
3341
3444
  };
3342
3445
  const ganttPrivateMethods = {
3343
3446
  extendTableMethods,
@@ -3412,6 +3515,18 @@ function gantt_createInternalData() {
3412
3515
  $xeGantt.dispatchEvent('zoom', {
3413
3516
  type: reactData.isZMax ? 'max' : 'revert'
3414
3517
  }, evnt);
3518
+ },
3519
+ handleTaskCellClickEvent(evnt, params) {
3520
+ $xeGantt.dispatchEvent('task-cell-click', params, evnt);
3521
+ },
3522
+ handleTaskCellDblclickEvent(evnt, params) {
3523
+ $xeGantt.dispatchEvent('task-cell-dblclick', params, evnt);
3524
+ },
3525
+ handleTaskBarClickEvent(evnt, params) {
3526
+ $xeGantt.dispatchEvent('task-bar-click', params, evnt);
3527
+ },
3528
+ handleTaskBarDblclickEvent(evnt, params) {
3529
+ $xeGantt.dispatchEvent('task-bar-dblclick', params, evnt);
3415
3530
  }
3416
3531
  };
3417
3532
  Object.assign($xeGantt, ganttExtendTableMethods, ganttMethods, ganttPrivateMethods, {
@@ -3505,7 +3620,7 @@ function gantt_createInternalData() {
3505
3620
  class: 'vxe-gantt--form-wrapper'
3506
3621
  }, slotVNs);
3507
3622
  }
3508
- return renderEmptyElement($xeGantt);
3623
+ return gantt_renderEmptyElement($xeGantt);
3509
3624
  };
3510
3625
  /**
3511
3626
  * 渲染工具栏
@@ -3563,7 +3678,7 @@ function gantt_createInternalData() {
3563
3678
  class: 'vxe-gantt--toolbar-wrapper'
3564
3679
  }, slotVNs);
3565
3680
  }
3566
- return renderEmptyElement($xeGantt);
3681
+ return gantt_renderEmptyElement($xeGantt);
3567
3682
  };
3568
3683
  /**
3569
3684
  * 渲染表格顶部区域
@@ -3580,7 +3695,7 @@ function gantt_createInternalData() {
3580
3695
  $gantt: $xeGantt
3581
3696
  }));
3582
3697
  }
3583
- return renderEmptyElement($xeGantt);
3698
+ return gantt_renderEmptyElement($xeGantt);
3584
3699
  };
3585
3700
  const renderTableLeft = () => {
3586
3701
  const leftSlot = slots.left;
@@ -3592,7 +3707,7 @@ function gantt_createInternalData() {
3592
3707
  $gantt: $xeGantt
3593
3708
  }));
3594
3709
  }
3595
- return renderEmptyElement($xeGantt);
3710
+ return gantt_renderEmptyElement($xeGantt);
3596
3711
  };
3597
3712
  const renderTableRight = () => {
3598
3713
  const rightSlot = slots.right;
@@ -3604,7 +3719,7 @@ function gantt_createInternalData() {
3604
3719
  $gantt: $xeGantt
3605
3720
  }));
3606
3721
  }
3607
- return renderEmptyElement($xeGantt);
3722
+ return gantt_renderEmptyElement($xeGantt);
3608
3723
  };
3609
3724
  /**
3610
3725
  * 渲染表格
@@ -3666,7 +3781,7 @@ function gantt_createInternalData() {
3666
3781
  $gantt: $xeGantt
3667
3782
  }));
3668
3783
  }
3669
- return renderEmptyElement($xeGantt);
3784
+ return gantt_renderEmptyElement($xeGantt);
3670
3785
  };
3671
3786
  /**
3672
3787
  * 渲染分页
@@ -3692,9 +3807,9 @@ function gantt_createInternalData() {
3692
3807
  ...pagerOpts,
3693
3808
  ...(proxyConfig && isEnableConf(proxyOpts) ? reactData.tablePage : {}),
3694
3809
  onPageChange: pageChangeEvent
3695
- }, getConfigSlot(pagerOpts.slots)) : renderEmptyElement($xeGantt)]);
3810
+ }, getConfigSlot(pagerOpts.slots)) : gantt_renderEmptyElement($xeGantt)]);
3696
3811
  }
3697
- return renderEmptyElement($xeGantt);
3812
+ return gantt_renderEmptyElement($xeGantt);
3698
3813
  };
3699
3814
  /**
3700
3815
  * 渲染任务视图
@@ -3712,24 +3827,40 @@ function gantt_createInternalData() {
3712
3827
  showLeftView,
3713
3828
  showRightView
3714
3829
  } = reactData;
3830
+ const taskSplitOpts = computeTaskSplitOpts.value;
3831
+ const {
3832
+ enabled,
3833
+ resize,
3834
+ showCollapseTableButton,
3835
+ showCollapseTaskButton
3836
+ } = taskSplitOpts;
3837
+ if (!enabled) {
3838
+ return gantt_renderEmptyElement($xeGantt);
3839
+ }
3840
+ const ons = {};
3841
+ if (resize) {
3842
+ ons.onMousedown = dragSplitEvent;
3843
+ }
3715
3844
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3716
- class: 'vxe-gantt--view-split-bar'
3845
+ class: ['vxe-gantt--view-split-bar', {
3846
+ 'is--resize': resize,
3847
+ ...ons
3848
+ }]
3717
3849
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3718
- class: 'vxe-gantt--view-split-bar-handle',
3719
- onMousedown: dragSplitEvent
3720
- }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3850
+ class: 'vxe-gantt--view-split-bar-handle'
3851
+ }), showCollapseTableButton || showCollapseTaskButton ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3721
3852
  class: 'vxe-gantt--view-split-bar-btn-wrapper'
3722
- }, [showRightView ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3853
+ }, [showCollapseTableButton && showRightView ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3723
3854
  class: 'vxe-gantt--view-split-bar-left-btn',
3724
3855
  onClick: handleSplitLeftViewEvent
3725
3856
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
3726
3857
  class: showLeftView ? getIcon().GANTT_VIEW_LEFT_OPEN : getIcon().GANTT_VIEW_LEFT_CLOSE
3727
- })]) : renderEmptyElement($xeGantt), showLeftView ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3858
+ })]) : gantt_renderEmptyElement($xeGantt), showCollapseTaskButton && showLeftView ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3728
3859
  class: 'vxe-gantt--view-split-bar-right-btn',
3729
3860
  onClick: handleSplitRightViewEvent
3730
3861
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
3731
3862
  class: showRightView ? getIcon().GANTT_VIEW_RIGHT_OPEN : getIcon().GANTT_VIEW_RIGHT_CLOSE
3732
- })]) : renderEmptyElement($xeGantt)])]);
3863
+ })]) : gantt_renderEmptyElement($xeGantt)]) : gantt_renderEmptyElement($xeGantt)]);
3733
3864
  };
3734
3865
  const renderChildLayout = layoutKeys => {
3735
3866
  const childVNs = [];
@@ -3788,11 +3919,11 @@ function gantt_createInternalData() {
3788
3919
  class: 'vxe-gantt--layout-body-wrapper'
3789
3920
  }, [asideLeftSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3790
3921
  class: 'vxe-gantt--layout-aside-left-wrapper'
3791
- }, asideLeftSlot({})) : renderEmptyElement($xeGantt), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3922
+ }, asideLeftSlot({})) : gantt_renderEmptyElement($xeGantt), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3792
3923
  class: 'vxe-gantt--layout-body-content-wrapper'
3793
3924
  }, renderChildLayout(bodyKeys)), asideRightSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3794
3925
  class: 'vxe-gantt--layout-aside-right-wrapper'
3795
- }, asideRightSlot({})) : renderEmptyElement($xeGantt)]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3926
+ }, asideRightSlot({})) : gantt_renderEmptyElement($xeGantt)]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3796
3927
  class: 'vxe-gantt--layout-footer-wrapper'
3797
3928
  }, renderChildLayout(footKeys)), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
3798
3929
  class: 'vxe-gantt--border-line'
@@ -4441,8 +4572,12 @@ __webpack_require__.r(__webpack_exports__);
4441
4572
  /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
4442
4573
  /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
4443
4574
 
4444
- _vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__.VxeUI.ganttVersion = "0.0.3";
4445
- (0,_vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__.setConfig)({
4575
+ const {
4576
+ setConfig,
4577
+ setIcon
4578
+ } = _vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__.VxeUI;
4579
+ _vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__.VxeUI.ganttVersion = "4.0.0-beta.1";
4580
+ setConfig({
4446
4581
  gantt: {
4447
4582
  // size: null,
4448
4583
  // zoomConfig: {
@@ -4479,11 +4614,17 @@ _vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__.VxeUI.ganttVersion = "0.0.3";
4479
4614
  // afterDelete: null,
4480
4615
  // beforeSave: null,
4481
4616
  // afterSave: null
4617
+ },
4618
+ taskSplitConfig: {
4619
+ enabled: true,
4620
+ resize: true,
4621
+ showCollapseTableButton: true,
4622
+ showCollapseTaskButton: true
4482
4623
  }
4483
4624
  }
4484
4625
  });
4485
4626
  const iconPrefix = 'vxe-icon-';
4486
- (0,_vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__.setIcon)({
4627
+ setIcon({
4487
4628
  // gantt
4488
4629
  GANTT_VIEW_LEFT_OPEN: iconPrefix + 'arrow-left',
4489
4630
  GANTT_VIEW_LEFT_CLOSE: iconPrefix + 'arrow-right',