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.
- package/es/components.d.ts +6 -0
- package/es/components.js +11 -9
- package/es/gantt/index.d.ts +1421 -0
- package/es/gantt/index.js +27 -22
- package/es/gantt/src/gantt-body.d.ts +19 -0
- package/es/gantt/src/gantt-body.js +291 -288
- package/es/gantt/src/gantt-chart.d.ts +19 -0
- package/es/gantt/src/gantt-chart.js +486 -495
- package/es/gantt/src/gantt-footer.d.ts +16 -0
- package/es/gantt/src/gantt-footer.js +62 -57
- package/es/gantt/src/gantt-header.d.ts +16 -0
- package/es/gantt/src/gantt-header.js +172 -174
- package/es/gantt/src/gantt-view.d.ts +76 -0
- package/es/gantt/src/gantt-view.js +2437 -2512
- package/es/gantt/src/gantt.d.ts +729 -0
- package/es/gantt/src/gantt.js +2815 -2858
- package/es/gantt/src/static.d.ts +34 -0
- package/es/gantt/src/static.js +16 -36
- package/es/gantt/src/util.d.ts +9 -0
- package/es/gantt/src/util.js +28 -19
- package/es/gantt/style.css +1 -1
- package/es/gantt/style.mini.css +1 -0
- package/es/index.d.ts +6 -0
- package/es/index.esm.js +6 -6
- package/es/index.js +6 -0
- package/es/ui/index.d.ts +3 -0
- package/es/ui/index.js +123 -120
- package/es/ui/src/comp.d.ts +2 -0
- package/es/ui/src/comp.js +4 -1
- package/es/ui/src/depend.d.ts +1 -0
- package/es/ui/src/depend.js +14 -12
- package/es/ui/src/dom.d.ts +49 -0
- package/es/ui/src/dom.js +180 -169
- package/es/ui/src/log.d.ts +6 -0
- package/es/ui/src/log.js +18 -13
- package/es/ui/src/utils.d.ts +21 -0
- package/es/ui/src/utils.js +60 -62
- package/es/ui/src/vn.d.ts +2 -0
- package/es/ui/src/vn.js +12 -9
- package/es/vxe-gantt/index.d.ts +3 -0
- package/es/vxe-gantt/index.js +6 -3
- package/es/vxe-gantt/style.css +1 -1
- package/es/vxe-gantt/style.mini.css +1 -0
- package/es/vxe-ui/index.d.ts +3 -0
- package/es/vxe-ui/index.js +6 -3
- package/lib/components.js +39 -35
- package/lib/gantt/index.js +50 -36
- package/lib/gantt/src/gantt-body.js +240 -245
- package/lib/gantt/src/gantt-chart.js +405 -375
- package/lib/gantt/src/gantt-footer.js +63 -46
- package/lib/gantt/src/gantt-header.js +186 -162
- package/lib/gantt/src/gantt-view.js +1554 -1745
- package/lib/gantt/src/gantt.js +2455 -2676
- package/lib/gantt/src/static.js +34 -40
- package/lib/gantt/src/util.js +32 -15
- package/lib/gantt/style/index.js +1 -1
- package/lib/gantt/style/style.css +1 -1
- package/lib/gantt/style/style.mini.css +1 -0
- package/lib/index.common.js +35 -23
- package/lib/index.js +37 -0
- package/lib/index.umd.js +4910 -15882
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +989 -1
- package/lib/style.mini.css +1 -0
- package/lib/ui/index.js +36 -25
- package/lib/ui/src/comp.js +22 -7
- package/lib/ui/src/depend.js +30 -13
- package/lib/ui/src/dom.js +88 -95
- package/lib/ui/src/log.js +34 -18
- package/lib/ui/src/utils.js +58 -50
- package/lib/ui/src/vn.js +35 -9
- package/lib/ui/style/index.js +1 -1
- package/lib/vxe-gantt/index.js +35 -20
- package/lib/vxe-gantt/style/index.js +1 -1
- package/lib/vxe-gantt/style/style.css +1 -1
- package/lib/vxe-gantt/style/style.mini.css +1 -0
- package/lib/vxe-ui/index.js +35 -20
- package/lib/vxe-ui/style/index.js +1 -1
- package/package.json +7 -4
- package/packages/gantt/src/gantt-view.ts +2 -0
- package/packages/gantt/src/gantt.ts +4 -0
- package/packages/ui/src/utils.ts +3 -12
- package/es/gantt/style.min.css +0 -1
- package/es/style.css +0 -1
- package/es/style.min.css +0 -1
- package/es/vxe-gantt/style.min.css +0 -1
- package/lib/components.min.js +0 -1
- package/lib/gantt/index.min.js +0 -1
- package/lib/gantt/src/gantt-body.min.js +0 -1
- package/lib/gantt/src/gantt-chart.min.js +0 -1
- package/lib/gantt/src/gantt-footer.min.js +0 -1
- package/lib/gantt/src/gantt-header.min.js +0 -1
- package/lib/gantt/src/gantt-view.min.js +0 -1
- package/lib/gantt/src/gantt.min.js +0 -1
- package/lib/gantt/src/static.min.js +0 -1
- package/lib/gantt/src/util.min.js +0 -1
- package/lib/gantt/style/style.min.css +0 -1
- package/lib/style.min.css +0 -1
- package/lib/ui/index.min.js +0 -1
- package/lib/ui/src/comp.min.js +0 -1
- package/lib/ui/src/depend.min.js +0 -1
- package/lib/ui/src/dom.min.js +0 -1
- package/lib/ui/src/log.min.js +0 -1
- package/lib/ui/src/utils.min.js +0 -1
- package/lib/ui/src/vn.min.js +0 -1
- package/lib/vxe-gantt/index.min.js +0 -1
- package/lib/vxe-gantt/style/style.min.css +0 -1
- package/lib/vxe-ui/index.min.js +0 -1
- /package/es/ui/{style.min.css → style.mini.css} +0 -0
- /package/es/vxe-ui/{style.min.css → style.mini.css} +0 -0
- /package/lib/ui/style/{style.min.css → style.mini.css} +0 -0
- /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
|
|
4
|
-
|
|
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
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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:
|
|
51
|
+
computed: {
|
|
52
|
+
...{}
|
|
53
|
+
},
|
|
32
54
|
methods: {
|
|
33
55
|
//
|
|
34
56
|
// Render
|
|
35
57
|
//
|
|
36
|
-
renderColumn
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
85
|
+
const cellParams = {
|
|
73
86
|
$table: $xeTable,
|
|
74
87
|
$grid: null,
|
|
75
88
|
$gantt: $xeGantt,
|
|
76
89
|
seq: -1,
|
|
77
|
-
rowid
|
|
78
|
-
row
|
|
79
|
-
rowIndex
|
|
80
|
-
$rowIndex
|
|
81
|
-
_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(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
120
|
+
const ctParams = {
|
|
110
121
|
$gantt: $xeGantt,
|
|
111
122
|
source: sourceType,
|
|
112
123
|
type: viewType,
|
|
113
124
|
scaleType: scaleUnit,
|
|
114
|
-
dateObj
|
|
115
|
-
startDateObj
|
|
116
|
-
endDateObj
|
|
117
|
-
row
|
|
118
|
-
column
|
|
119
|
-
$rowIndex
|
|
120
|
-
rowIndex
|
|
121
|
-
_rowIndex
|
|
125
|
+
dateObj,
|
|
126
|
+
startDateObj,
|
|
127
|
+
endDateObj,
|
|
128
|
+
row,
|
|
129
|
+
column,
|
|
130
|
+
$rowIndex,
|
|
131
|
+
rowIndex,
|
|
132
|
+
_rowIndex
|
|
122
133
|
};
|
|
123
|
-
return h(
|
|
134
|
+
return h("td", {
|
|
124
135
|
key: cellClassName || cellStyle ? field : $columnIndex,
|
|
125
|
-
class: [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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:
|
|
146
|
+
height: `${cellHeight}px`
|
|
132
147
|
},
|
|
133
148
|
on: {
|
|
134
|
-
click
|
|
135
|
-
$xeGantt.handleTaskCellClickEvent(evnt, {
|
|
136
|
-
row: row,
|
|
137
|
-
column: column
|
|
138
|
-
});
|
|
149
|
+
click(evnt) {
|
|
150
|
+
$xeGantt.handleTaskCellClickEvent(evnt, { row, column });
|
|
139
151
|
},
|
|
140
|
-
dblclick
|
|
141
|
-
$xeGantt.handleTaskCellDblclickEvent(evnt, {
|
|
142
|
-
row: row,
|
|
143
|
-
column: column
|
|
144
|
-
});
|
|
152
|
+
dblclick(evnt) {
|
|
153
|
+
$xeGantt.handleTaskCellDblclickEvent(evnt, { row, column });
|
|
145
154
|
},
|
|
146
|
-
contextmenu
|
|
155
|
+
contextmenu(evnt) {
|
|
147
156
|
$xeGantt.handleTaskBodyContextmenuEvent(evnt, ctParams);
|
|
148
157
|
}
|
|
149
158
|
}
|
|
150
159
|
}, tdVNs);
|
|
151
160
|
},
|
|
152
|
-
renderRows
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
211
|
+
const rowParams = {
|
|
222
212
|
$gantt: $xeGantt,
|
|
223
213
|
source: sourceType,
|
|
224
214
|
type: viewType,
|
|
225
215
|
scaleType: scaleUnit,
|
|
226
|
-
row
|
|
227
|
-
rowIndex
|
|
228
|
-
$rowIndex
|
|
229
|
-
_rowIndex
|
|
216
|
+
row,
|
|
217
|
+
rowIndex,
|
|
218
|
+
$rowIndex,
|
|
219
|
+
_rowIndex
|
|
230
220
|
};
|
|
231
|
-
trVNs.push(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
|
249
|
+
trVNs.push(..._vm.renderRows(h, $xeTable, rowChildren));
|
|
257
250
|
}
|
|
258
251
|
});
|
|
259
252
|
return trVNs;
|
|
260
253
|
},
|
|
261
|
-
renderVN
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
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
|
-
|
|
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
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
elemStore[
|
|
314
|
-
elemStore[
|
|
315
|
-
elemStore[
|
|
316
|
-
elemStore[
|
|
317
|
-
elemStore[
|
|
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
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
elemStore[
|
|
326
|
-
elemStore[
|
|
327
|
-
elemStore[
|
|
328
|
-
elemStore[
|
|
329
|
-
elemStore[
|
|
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
|
|
326
|
+
render(h) {
|
|
332
327
|
return this.renderVN(h);
|
|
333
328
|
}
|
|
334
|
-
});
|
|
329
|
+
});
|