vxe-gantt 3.9.0 → 3.9.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 (112) hide show
  1. package/es/components.d.ts +6 -0
  2. package/es/components.js +11 -9
  3. package/es/gantt/index.d.ts +1421 -0
  4. package/es/gantt/index.js +27 -22
  5. package/es/gantt/src/gantt-body.d.ts +19 -0
  6. package/es/gantt/src/gantt-body.js +291 -288
  7. package/es/gantt/src/gantt-chart.d.ts +19 -0
  8. package/es/gantt/src/gantt-chart.js +486 -495
  9. package/es/gantt/src/gantt-footer.d.ts +16 -0
  10. package/es/gantt/src/gantt-footer.js +62 -57
  11. package/es/gantt/src/gantt-header.d.ts +16 -0
  12. package/es/gantt/src/gantt-header.js +172 -174
  13. package/es/gantt/src/gantt-view.d.ts +76 -0
  14. package/es/gantt/src/gantt-view.js +2437 -2512
  15. package/es/gantt/src/gantt.d.ts +729 -0
  16. package/es/gantt/src/gantt.js +2815 -2858
  17. package/es/gantt/src/static.d.ts +34 -0
  18. package/es/gantt/src/static.js +16 -36
  19. package/es/gantt/src/util.d.ts +9 -0
  20. package/es/gantt/src/util.js +28 -19
  21. package/es/gantt/style.css +1 -1
  22. package/es/gantt/style.mini.css +1 -0
  23. package/es/index.d.ts +6 -0
  24. package/es/index.esm.js +6 -6
  25. package/es/index.js +6 -0
  26. package/es/ui/index.d.ts +3 -0
  27. package/es/ui/index.js +123 -120
  28. package/es/ui/src/comp.d.ts +2 -0
  29. package/es/ui/src/comp.js +4 -1
  30. package/es/ui/src/depend.d.ts +1 -0
  31. package/es/ui/src/depend.js +14 -12
  32. package/es/ui/src/dom.d.ts +49 -0
  33. package/es/ui/src/dom.js +180 -169
  34. package/es/ui/src/log.d.ts +6 -0
  35. package/es/ui/src/log.js +18 -13
  36. package/es/ui/src/utils.d.ts +21 -0
  37. package/es/ui/src/utils.js +60 -62
  38. package/es/ui/src/vn.d.ts +2 -0
  39. package/es/ui/src/vn.js +12 -9
  40. package/es/vxe-gantt/index.d.ts +3 -0
  41. package/es/vxe-gantt/index.js +6 -3
  42. package/es/vxe-gantt/style.css +1 -1
  43. package/es/vxe-gantt/style.mini.css +1 -0
  44. package/es/vxe-ui/index.d.ts +3 -0
  45. package/es/vxe-ui/index.js +6 -3
  46. package/lib/components.js +39 -35
  47. package/lib/gantt/index.js +50 -36
  48. package/lib/gantt/src/gantt-body.js +240 -245
  49. package/lib/gantt/src/gantt-chart.js +405 -375
  50. package/lib/gantt/src/gantt-footer.js +63 -46
  51. package/lib/gantt/src/gantt-header.js +186 -162
  52. package/lib/gantt/src/gantt-view.js +1554 -1745
  53. package/lib/gantt/src/gantt.js +2455 -2676
  54. package/lib/gantt/src/static.js +34 -40
  55. package/lib/gantt/src/util.js +32 -15
  56. package/lib/gantt/style/index.js +1 -1
  57. package/lib/gantt/style/style.css +1 -1
  58. package/lib/gantt/style/style.mini.css +1 -0
  59. package/lib/index.common.js +35 -23
  60. package/lib/index.js +37 -0
  61. package/lib/index.umd.js +4910 -15882
  62. package/lib/index.umd.min.js +1 -1
  63. package/lib/style.css +989 -1
  64. package/lib/style.mini.css +1 -0
  65. package/lib/ui/index.js +36 -25
  66. package/lib/ui/src/comp.js +22 -7
  67. package/lib/ui/src/depend.js +30 -13
  68. package/lib/ui/src/dom.js +88 -95
  69. package/lib/ui/src/log.js +34 -18
  70. package/lib/ui/src/utils.js +58 -50
  71. package/lib/ui/src/vn.js +35 -9
  72. package/lib/ui/style/index.js +1 -1
  73. package/lib/vxe-gantt/index.js +35 -20
  74. package/lib/vxe-gantt/style/index.js +1 -1
  75. package/lib/vxe-gantt/style/style.css +1 -1
  76. package/lib/vxe-gantt/style/style.mini.css +1 -0
  77. package/lib/vxe-ui/index.js +35 -20
  78. package/lib/vxe-ui/style/index.js +1 -1
  79. package/package.json +7 -4
  80. package/packages/gantt/src/gantt-view.ts +2 -0
  81. package/packages/gantt/src/gantt.ts +4 -0
  82. package/packages/ui/src/utils.ts +3 -12
  83. package/es/gantt/style.min.css +0 -1
  84. package/es/style.css +0 -1
  85. package/es/style.min.css +0 -1
  86. package/es/vxe-gantt/style.min.css +0 -1
  87. package/lib/components.min.js +0 -1
  88. package/lib/gantt/index.min.js +0 -1
  89. package/lib/gantt/src/gantt-body.min.js +0 -1
  90. package/lib/gantt/src/gantt-chart.min.js +0 -1
  91. package/lib/gantt/src/gantt-footer.min.js +0 -1
  92. package/lib/gantt/src/gantt-header.min.js +0 -1
  93. package/lib/gantt/src/gantt-view.min.js +0 -1
  94. package/lib/gantt/src/gantt.min.js +0 -1
  95. package/lib/gantt/src/static.min.js +0 -1
  96. package/lib/gantt/src/util.min.js +0 -1
  97. package/lib/gantt/style/style.min.css +0 -1
  98. package/lib/style.min.css +0 -1
  99. package/lib/ui/index.min.js +0 -1
  100. package/lib/ui/src/comp.min.js +0 -1
  101. package/lib/ui/src/depend.min.js +0 -1
  102. package/lib/ui/src/dom.min.js +0 -1
  103. package/lib/ui/src/log.min.js +0 -1
  104. package/lib/ui/src/utils.min.js +0 -1
  105. package/lib/ui/src/vn.min.js +0 -1
  106. package/lib/vxe-gantt/index.min.js +0 -1
  107. package/lib/vxe-gantt/style/style.min.css +0 -1
  108. package/lib/vxe-ui/index.min.js +0 -1
  109. /package/es/ui/{style.min.css → style.mini.css} +0 -0
  110. /package/es/vxe-ui/{style.min.css → style.mini.css} +0 -0
  111. /package/lib/ui/style/{style.min.css → style.mini.css} +0 -0
  112. /package/lib/vxe-ui/style/{style.min.css → style.mini.css} +0 -0
@@ -1,25 +1,45 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var gantt_body_exports = {};
30
+ __export(gantt_body_exports, {
31
+ default: () => gantt_body_default
5
32
  });
6
- exports.default = void 0;
7
- var _comp = require("../../ui/src/comp");
8
- var _util = require("./util");
9
- var _utils = require("../../ui/src/utils");
10
- var _xeUtils = _interopRequireDefault(require("xe-utils"));
11
- var _ganttChart = _interopRequireDefault(require("./gantt-chart"));
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
14
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
16
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
17
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
18
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
19
- var sourceType = 'gantt';
20
- var viewType = 'body';
21
- var _default = exports.default = (0, _comp.defineVxeComponent)({
22
- name: 'VxeGanttViewBody',
33
+ module.exports = __toCommonJS(gantt_body_exports);
34
+ var import_comp = require("../../ui/src/comp");
35
+ var import_util = require("./util");
36
+ var import_utils = require("../../ui/src/utils");
37
+ var import_xe_utils = __toESM(require("xe-utils"));
38
+ var import_gantt_chart = __toESM(require("./gantt-chart"));
39
+ const sourceType = "gantt";
40
+ const viewType = "body";
41
+ var gantt_body_default = (0, import_comp.defineVxeComponent)({
42
+ name: "VxeGanttViewBody",
23
43
  inject: {
24
44
  $xeGantt: {
25
45
  default: null
@@ -28,62 +48,55 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
28
48
  default: null
29
49
  }
30
50
  },
31
- computed: Object.assign({}, {}),
51
+ computed: {
52
+ ...{}
53
+ },
32
54
  methods: {
33
55
  //
34
56
  // Render
35
57
  //
36
- renderColumn: function renderColumn(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex) {
37
- var _vm = this;
38
- var $xeGanttView = _vm.$xeGanttView;
39
- var $xeGantt = _vm.$xeGantt;
40
- var reactData = $xeGanttView.reactData,
41
- internalData = $xeGanttView.internalData;
42
- var tableReactData = $xeTable.getReactData();
43
- var resizeHeightFlag = tableReactData.resizeHeightFlag;
44
- var tableInternalData = $xeTable.getInternalData();
45
- var fullAllDataRowIdData = tableInternalData.fullAllDataRowIdData,
46
- visibleColumn = tableInternalData.visibleColumn;
47
- var cellOpts = $xeTable.computeCellOpts;
48
- var rowOpts = $xeTable.computeRowOpts;
49
- var defaultRowHeight = $xeTable.computeDefaultRowHeight;
50
- var resizableOpts = $xeTable.computeResizableOpts;
51
- var isAllRowDrag = resizableOpts.isAllRowDrag;
52
- var headerGroups = reactData.headerGroups;
53
- var todayDateMaps = internalData.todayDateMaps;
54
- var taskViewOpts = $xeGantt.computeTaskViewOpts;
55
- var showNowLine = taskViewOpts.showNowLine,
56
- viewStyle = taskViewOpts.viewStyle;
57
- var scaleUnit = $xeGantt.computeScaleUnit;
58
- var _ref = headerGroups[headerGroups.length - 1] || {},
59
- scaleItem = _ref.scaleItem;
60
- var field = column.field,
61
- dateObj = column.dateObj,
62
- startDateObj = column.startDateObj,
63
- endDateObj = column.endDateObj;
64
- var _ref2 = viewStyle || {},
65
- cellClassName = _ref2.cellClassName,
66
- cellStyle = _ref2.cellStyle;
67
- var todayValue = showNowLine && scaleItem ? todayDateMaps[scaleItem.type] : null;
68
- var rowRest = fullAllDataRowIdData[rowid] || {};
69
- var cellHeight = resizeHeightFlag ? (0, _util.getCellRestHeight)(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
70
- var tdVNs = [];
58
+ renderColumn(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex) {
59
+ const _vm = this;
60
+ const $xeGanttView = _vm.$xeGanttView;
61
+ const $xeGantt = _vm.$xeGantt;
62
+ const { reactData, internalData } = $xeGanttView;
63
+ const tableReactData = $xeTable.getReactData();
64
+ const { resizeHeightFlag } = tableReactData;
65
+ const tableInternalData = $xeTable.getInternalData();
66
+ const { fullAllDataRowIdData, visibleColumn } = tableInternalData;
67
+ const cellOpts = $xeTable.computeCellOpts;
68
+ const rowOpts = $xeTable.computeRowOpts;
69
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
70
+ const resizableOpts = $xeTable.computeResizableOpts;
71
+ const { isAllRowDrag } = resizableOpts;
72
+ const { headerGroups } = reactData;
73
+ const { todayDateMaps } = internalData;
74
+ const taskViewOpts = $xeGantt.computeTaskViewOpts;
75
+ const { showNowLine, viewStyle } = taskViewOpts;
76
+ const scaleUnit = $xeGantt.computeScaleUnit;
77
+ const { scaleItem } = headerGroups[headerGroups.length - 1] || {};
78
+ const { field, dateObj, startDateObj, endDateObj } = column;
79
+ const { cellClassName, cellStyle } = viewStyle || {};
80
+ const todayValue = showNowLine && scaleItem ? todayDateMaps[scaleItem.type] : null;
81
+ const rowRest = fullAllDataRowIdData[rowid] || {};
82
+ const cellHeight = resizeHeightFlag ? (0, import_util.getCellRestHeight)(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
83
+ const tdVNs = [];
71
84
  if (isAllRowDrag && rowOpts.resizable) {
72
- var cellParams = {
85
+ const cellParams = {
73
86
  $table: $xeTable,
74
87
  $grid: null,
75
88
  $gantt: $xeGantt,
76
89
  seq: -1,
77
- rowid: rowid,
78
- row: row,
79
- rowIndex: rowIndex,
80
- $rowIndex: $rowIndex,
81
- _rowIndex: _rowIndex,
90
+ rowid,
91
+ row,
92
+ rowIndex,
93
+ $rowIndex,
94
+ _rowIndex,
82
95
  column: visibleColumn[0],
83
96
  columnIndex: 0,
84
97
  $columnIndex: 0,
85
98
  _columnIndex: 0,
86
- fixed: '',
99
+ fixed: "",
87
100
  source: sourceType,
88
101
  type: viewType,
89
102
  isHidden: false,
@@ -94,241 +107,223 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
94
107
  data: [],
95
108
  items: []
96
109
  };
97
- tdVNs.push(h('div', {
98
- class: 'vxe-gantt-view-cell--row-resizable',
99
- on: {
100
- mousedown: function mousedown(evnt) {
101
- return $xeTable.handleRowResizeMousedownEvent(evnt, cellParams);
102
- },
103
- dblclick: function dblclick(evnt) {
104
- return $xeTable.handleRowResizeDblclickEvent(evnt, cellParams);
110
+ tdVNs.push(
111
+ h("div", {
112
+ class: "vxe-gantt-view-cell--row-resizable",
113
+ on: {
114
+ mousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
115
+ dblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
105
116
  }
106
- }
107
- }));
117
+ })
118
+ );
108
119
  }
109
- var ctParams = {
120
+ const ctParams = {
110
121
  $gantt: $xeGantt,
111
122
  source: sourceType,
112
123
  type: viewType,
113
124
  scaleType: scaleUnit,
114
- dateObj: dateObj,
115
- startDateObj: startDateObj,
116
- endDateObj: endDateObj,
117
- row: row,
118
- column: column,
119
- $rowIndex: $rowIndex,
120
- rowIndex: rowIndex,
121
- _rowIndex: _rowIndex
125
+ dateObj,
126
+ startDateObj,
127
+ endDateObj,
128
+ row,
129
+ column,
130
+ $rowIndex,
131
+ rowIndex,
132
+ _rowIndex
122
133
  };
123
- return h('td', {
134
+ return h("td", {
124
135
  key: cellClassName || cellStyle ? field : $columnIndex,
125
- class: ['vxe-gantt-view--body-column', {
126
- 'is--now': showNowLine && todayValue === field
127
- }, (0, _utils.getClass)(cellClassName, ctParams)],
128
- style: cellStyle ? Object.assign({}, _xeUtils.default.isFunction(cellStyle) ? cellStyle(ctParams) : cellStyle, {
129
- height: "".concat(cellHeight, "px")
136
+ class: [
137
+ "vxe-gantt-view--body-column",
138
+ {
139
+ "is--now": showNowLine && todayValue === field
140
+ },
141
+ (0, import_utils.getClass)(cellClassName, ctParams)
142
+ ],
143
+ style: cellStyle ? Object.assign({}, import_xe_utils.default.isFunction(cellStyle) ? cellStyle(ctParams) : cellStyle, {
144
+ height: `${cellHeight}px`
130
145
  }) : {
131
- height: "".concat(cellHeight, "px")
146
+ height: `${cellHeight}px`
132
147
  },
133
148
  on: {
134
- click: function click(evnt) {
135
- $xeGantt.handleTaskCellClickEvent(evnt, {
136
- row: row,
137
- column: column
138
- });
149
+ click(evnt) {
150
+ $xeGantt.handleTaskCellClickEvent(evnt, { row, column });
139
151
  },
140
- dblclick: function dblclick(evnt) {
141
- $xeGantt.handleTaskCellDblclickEvent(evnt, {
142
- row: row,
143
- column: column
144
- });
152
+ dblclick(evnt) {
153
+ $xeGantt.handleTaskCellDblclickEvent(evnt, { row, column });
145
154
  },
146
- contextmenu: function contextmenu(evnt) {
155
+ contextmenu(evnt) {
147
156
  $xeGantt.handleTaskBodyContextmenuEvent(evnt, ctParams);
148
157
  }
149
158
  }
150
159
  }, tdVNs);
151
160
  },
152
- renderRows: function renderRows(h, $xeTable, tableData) {
153
- var _vm = this;
154
- var $xeGanttView = _vm.$xeGanttView;
155
- var $xeGantt = _vm.$xeGantt;
156
- var reactData = $xeGanttView.reactData;
157
- var tableProps = $xeTable;
158
- var treeConfig = tableProps.treeConfig,
159
- stripe = tableProps.stripe,
160
- highlightHoverRow = tableProps.highlightHoverRow,
161
- editConfig = tableProps.editConfig;
162
- var tableReactData = $xeTable.getReactData();
163
- var treeExpandedFlag = tableReactData.treeExpandedFlag,
164
- selectRadioRow = tableReactData.selectRadioRow,
165
- pendingRowFlag = tableReactData.pendingRowFlag,
166
- isRowGroupStatus = tableReactData.isRowGroupStatus;
167
- var tableInternalData = $xeTable.getInternalData();
168
- var fullAllDataRowIdData = tableInternalData.fullAllDataRowIdData,
169
- treeExpandedMaps = tableInternalData.treeExpandedMaps,
170
- pendingRowMaps = tableInternalData.pendingRowMaps;
171
- var radioOpts = $xeTable.computeRadioOpts;
172
- var checkboxOpts = $xeTable.computeCheckboxOpts;
173
- var rowOpts = $xeTable.computeRowOpts;
174
- var treeOpts = $xeTable.computeTreeOpts;
175
- var transform = treeOpts.transform;
176
- var childrenField = treeOpts.children || treeOpts.childrenField;
177
- var scaleUnit = $xeGantt.computeScaleUnit;
178
- var taskViewOpts = $xeGantt.computeTaskViewOpts;
179
- var viewStyle = taskViewOpts.viewStyle;
180
- var _ref3 = viewStyle || {},
181
- rowClassName = _ref3.rowClassName,
182
- rowStyle = _ref3.rowStyle,
183
- cellClassName = _ref3.cellClassName,
184
- cellStyle = _ref3.cellStyle;
185
- var tableColumn = reactData.tableColumn,
186
- scrollYLoad = reactData.scrollYLoad;
187
- var trVNs = [];
188
- tableData.forEach(function (row, $rowIndex) {
189
- var rowid = $xeTable.getRowid(row);
190
- var rowRest = fullAllDataRowIdData[rowid] || {};
191
- var trOns = {};
192
- var rowIndex = $rowIndex;
193
- var _rowIndex = -1;
161
+ renderRows(h, $xeTable, tableData) {
162
+ const _vm = this;
163
+ const $xeGanttView = _vm.$xeGanttView;
164
+ const $xeGantt = _vm.$xeGantt;
165
+ const { reactData } = $xeGanttView;
166
+ const tableProps = $xeTable;
167
+ const { treeConfig, stripe, highlightHoverRow, editConfig } = tableProps;
168
+ const tableReactData = $xeTable.getReactData();
169
+ const { treeExpandedFlag, selectRadioRow, pendingRowFlag, isRowGroupStatus } = tableReactData;
170
+ const tableInternalData = $xeTable.getInternalData();
171
+ const { fullAllDataRowIdData, treeExpandedMaps, pendingRowMaps } = tableInternalData;
172
+ const radioOpts = $xeTable.computeRadioOpts;
173
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
174
+ const rowOpts = $xeTable.computeRowOpts;
175
+ const treeOpts = $xeTable.computeTreeOpts;
176
+ const { transform } = treeOpts;
177
+ const childrenField = treeOpts.children || treeOpts.childrenField;
178
+ const scaleUnit = $xeGantt.computeScaleUnit;
179
+ const taskViewOpts = $xeGantt.computeTaskViewOpts;
180
+ const { viewStyle } = taskViewOpts;
181
+ const { rowClassName, rowStyle, cellClassName, cellStyle } = viewStyle || {};
182
+ const { tableColumn, scrollYLoad } = reactData;
183
+ const trVNs = [];
184
+ tableData.forEach((row, $rowIndex) => {
185
+ const rowid = $xeTable.getRowid(row);
186
+ const rowRest = fullAllDataRowIdData[rowid] || {};
187
+ const trOns = {};
188
+ let rowIndex = $rowIndex;
189
+ let _rowIndex = -1;
194
190
  if (rowRest) {
195
191
  rowIndex = rowRest.index;
196
192
  _rowIndex = rowRest._index;
197
193
  }
198
- // 是否新增行
199
- var isNewRow = false;
194
+ let isNewRow = false;
200
195
  if (editConfig) {
201
196
  isNewRow = $xeTable.isInsertByRow(row);
202
197
  }
203
- // 当前行事件
204
198
  if (rowOpts.isHover || highlightHoverRow) {
205
- trOns.mouseenter = function (evnt) {
206
- $xeTable.triggerHoverEvent(evnt, {
207
- row: row,
208
- rowIndex: rowIndex
209
- });
199
+ trOns.mouseenter = (evnt) => {
200
+ $xeTable.triggerHoverEvent(evnt, { row, rowIndex });
210
201
  };
211
- trOns.mouseleave = function () {
202
+ trOns.mouseleave = () => {
212
203
  $xeTable.clearHoverRow();
213
204
  };
214
205
  }
215
- // 拖拽行事件
216
206
  if (rowOpts.drag && !isRowGroupStatus && (!treeConfig || transform)) {
217
207
  trOns.dragstart = $xeTable.handleRowDragDragstartEvent;
218
208
  trOns.dragend = $xeTable.handleRowDragDragendEvent;
219
209
  trOns.dragover = $xeTable.handleRowDragDragoverEvent;
220
210
  }
221
- var rowParams = {
211
+ const rowParams = {
222
212
  $gantt: $xeGantt,
223
213
  source: sourceType,
224
214
  type: viewType,
225
215
  scaleType: scaleUnit,
226
- row: row,
227
- rowIndex: rowIndex,
228
- $rowIndex: $rowIndex,
229
- _rowIndex: _rowIndex
216
+ row,
217
+ rowIndex,
218
+ $rowIndex,
219
+ _rowIndex
230
220
  };
231
- trVNs.push(h('tr', {
232
- key: rowClassName || rowStyle || cellClassName || cellStyle ? rowid : $rowIndex,
233
- class: ['vxe-gantt-view--body-row', {
234
- 'row--stripe': stripe && (_rowIndex + 1) % 2 === 0,
235
- 'is--new': isNewRow,
236
- 'row--radio': radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
237
- 'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
238
- 'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid]
239
- }, (0, _utils.getClass)(rowClassName, rowParams)],
240
- style: rowStyle ? _xeUtils.default.isFunction(rowStyle) ? rowStyle(rowParams) || undefined : rowStyle : undefined,
241
- attrs: {
242
- rowid: rowid
243
- },
244
- on: trOns
245
- }, tableColumn.map(function (column, $columnIndex) {
246
- return _vm.renderColumn(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex);
247
- })));
248
- var isExpandTree = false;
249
- var rowChildren = [];
221
+ trVNs.push(
222
+ h("tr", {
223
+ key: rowClassName || rowStyle || cellClassName || cellStyle ? rowid : $rowIndex,
224
+ class: [
225
+ "vxe-gantt-view--body-row",
226
+ {
227
+ "row--stripe": stripe && (_rowIndex + 1) % 2 === 0,
228
+ "is--new": isNewRow,
229
+ "row--radio": radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
230
+ "row--checked": checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
231
+ "row--pending": !!pendingRowFlag && !!pendingRowMaps[rowid]
232
+ },
233
+ (0, import_utils.getClass)(rowClassName, rowParams)
234
+ ],
235
+ style: rowStyle ? import_xe_utils.default.isFunction(rowStyle) ? rowStyle(rowParams) || void 0 : rowStyle : void 0,
236
+ attrs: {
237
+ rowid
238
+ },
239
+ on: trOns
240
+ }, tableColumn.map((column, $columnIndex) => _vm.renderColumn(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex)))
241
+ );
242
+ let isExpandTree = false;
243
+ let rowChildren = [];
250
244
  if (treeConfig && !scrollYLoad && !transform) {
251
245
  rowChildren = row[childrenField];
252
246
  isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
253
247
  }
254
- // 如果是树形表格
255
248
  if (isExpandTree) {
256
- trVNs.push.apply(trVNs, _toConsumableArray(_vm.renderRows(h, $xeTable, rowChildren)));
249
+ trVNs.push(..._vm.renderRows(h, $xeTable, rowChildren));
257
250
  }
258
251
  });
259
252
  return trVNs;
260
253
  },
261
- renderVN: function renderVN(h) {
262
- var _vm = this;
263
- var $xeGantt = _vm.$xeGantt;
264
- var $xeGanttView = _vm.$xeGanttView;
265
- var reactData = $xeGanttView.reactData;
266
- var $xeTable = $xeGanttView.internalData.xeTable;
267
- var tableData = reactData.tableData,
268
- tableColumn = reactData.tableColumn,
269
- viewCellWidth = reactData.viewCellWidth;
270
- return h('div', {
271
- ref: 'refElem',
272
- class: 'vxe-gantt-view--body-wrapper'
273
- }, [h('div', {
274
- ref: 'refBodyScroll',
275
- class: 'vxe-gantt-view--body-inner-wrapper',
276
- on: {
277
- scroll: $xeGanttView.triggerBodyScrollEvent,
278
- contextmenu: function contextmenu(evnt) {
279
- $xeGantt.handleTaskBodyContextmenuEvent(evnt, {
280
- source: sourceType,
281
- type: viewType,
282
- rowIndex: -1,
283
- $rowIndex: -1,
284
- _rowIndex: -1
285
- });
286
- }
287
- }
288
- }, [h('div', {
289
- ref: 'refBodyXSpace',
290
- class: 'vxe-body--x-space'
291
- }), h('div', {
292
- ref: 'refBodyYSpace',
293
- class: 'vxe-body--y-space'
294
- }), h('table', {
295
- ref: 'refBodyTable',
296
- class: 'vxe-gantt-view--body-table'
297
- }, [h('colgroup', {}, tableColumn.map(function (column, cIndex) {
298
- return h('col', {
299
- key: cIndex,
300
- style: {
301
- width: "".concat(viewCellWidth, "px")
254
+ renderVN(h) {
255
+ const _vm = this;
256
+ const $xeGantt = _vm.$xeGantt;
257
+ const $xeGanttView = _vm.$xeGanttView;
258
+ const { reactData } = $xeGanttView;
259
+ const $xeTable = $xeGanttView.internalData.xeTable;
260
+ const { tableData, tableColumn, viewCellWidth } = reactData;
261
+ return h("div", {
262
+ ref: "refElem",
263
+ class: "vxe-gantt-view--body-wrapper"
264
+ }, [
265
+ h("div", {
266
+ ref: "refBodyScroll",
267
+ class: "vxe-gantt-view--body-inner-wrapper",
268
+ on: {
269
+ scroll: $xeGanttView.triggerBodyScrollEvent,
270
+ contextmenu(evnt) {
271
+ $xeGantt.handleTaskBodyContextmenuEvent(evnt, { source: sourceType, type: viewType, rowIndex: -1, $rowIndex: -1, _rowIndex: -1 });
272
+ }
302
273
  }
303
- });
304
- })), h('tbody', {}, $xeTable ? _vm.renderRows(h, $xeTable, tableData) : [])]), h(_ganttChart.default)])]);
274
+ }, [
275
+ h("div", {
276
+ ref: "refBodyXSpace",
277
+ class: "vxe-body--x-space"
278
+ }),
279
+ h("div", {
280
+ ref: "refBodyYSpace",
281
+ class: "vxe-body--y-space"
282
+ }),
283
+ h("table", {
284
+ ref: "refBodyTable",
285
+ class: "vxe-gantt-view--body-table"
286
+ }, [
287
+ h("colgroup", {}, tableColumn.map((column, cIndex) => {
288
+ return h("col", {
289
+ key: cIndex,
290
+ style: {
291
+ width: `${viewCellWidth}px`
292
+ }
293
+ });
294
+ })),
295
+ h("tbody", {}, $xeTable ? _vm.renderRows(h, $xeTable, tableData) : [])
296
+ ]),
297
+ h(import_gantt_chart.default)
298
+ ])
299
+ ]);
305
300
  }
306
301
  },
307
- mounted: function mounted() {
308
- var _vm = this;
309
- var $xeGanttView = _vm.$xeGanttView;
310
- var internalData = $xeGanttView.internalData;
311
- var elemStore = internalData.elemStore;
312
- var prefix = 'main-body-';
313
- elemStore["".concat(prefix, "wrapper")] = _vm.$refs.refElem;
314
- elemStore["".concat(prefix, "scroll")] = _vm.$refs.refBodyScroll;
315
- elemStore["".concat(prefix, "table")] = _vm.$refs.refBodyTable;
316
- elemStore["".concat(prefix, "xSpace")] = _vm.$refs.refBodyXSpace;
317
- elemStore["".concat(prefix, "ySpace")] = _vm.$refs.refBodyYSpace;
302
+ mounted() {
303
+ const _vm = this;
304
+ const $xeGanttView = _vm.$xeGanttView;
305
+ const { internalData } = $xeGanttView;
306
+ const { elemStore } = internalData;
307
+ const prefix = "main-body-";
308
+ elemStore[`${prefix}wrapper`] = _vm.$refs.refElem;
309
+ elemStore[`${prefix}scroll`] = _vm.$refs.refBodyScroll;
310
+ elemStore[`${prefix}table`] = _vm.$refs.refBodyTable;
311
+ elemStore[`${prefix}xSpace`] = _vm.$refs.refBodyXSpace;
312
+ elemStore[`${prefix}ySpace`] = _vm.$refs.refBodyYSpace;
318
313
  },
319
- destroyed: function destroyed() {
320
- var _vm = this;
321
- var $xeGanttView = _vm.$xeGanttView;
322
- var internalData = $xeGanttView.internalData;
323
- var elemStore = internalData.elemStore;
324
- var prefix = 'main-body-';
325
- elemStore["".concat(prefix, "wrapper")] = null;
326
- elemStore["".concat(prefix, "scroll")] = null;
327
- elemStore["".concat(prefix, "table")] = null;
328
- elemStore["".concat(prefix, "xSpace")] = null;
329
- elemStore["".concat(prefix, "ySpace")] = null;
314
+ destroyed() {
315
+ const _vm = this;
316
+ const $xeGanttView = _vm.$xeGanttView;
317
+ const { internalData } = $xeGanttView;
318
+ const { elemStore } = internalData;
319
+ const prefix = "main-body-";
320
+ elemStore[`${prefix}wrapper`] = null;
321
+ elemStore[`${prefix}scroll`] = null;
322
+ elemStore[`${prefix}table`] = null;
323
+ elemStore[`${prefix}xSpace`] = null;
324
+ elemStore[`${prefix}ySpace`] = null;
330
325
  },
331
- render: function render(h) {
326
+ render(h) {
332
327
  return this.renderVN(h);
333
328
  }
334
- });
329
+ });