vxe-gantt 4.9.0 → 4.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/dist/all.esm.js +6382 -6461
- package/dist/style.css +982 -1
- package/dist/style.mini.css +1 -0
- package/es/components.d.ts +6 -0
- package/es/components.js +11 -9
- package/es/gantt/index.d.ts +1613 -0
- package/es/gantt/index.js +17 -12
- package/es/gantt/src/emits.d.ts +2 -0
- package/es/gantt/src/emits.js +23 -20
- package/es/gantt/src/gantt-body.d.ts +5 -0
- package/es/gantt/src/gantt-body.js +266 -259
- package/es/gantt/src/gantt-chart.d.ts +5 -0
- package/es/gantt/src/gantt-chart.js +449 -441
- package/es/gantt/src/gantt-footer.d.ts +4 -0
- package/es/gantt/src/gantt-footer.js +43 -40
- package/es/gantt/src/gantt-header.d.ts +4 -0
- package/es/gantt/src/gantt-header.js +151 -155
- package/es/gantt/src/gantt-view.d.ts +3 -0
- package/es/gantt/src/gantt-view.js +2376 -2441
- package/es/gantt/src/gantt.d.ts +251 -0
- package/es/gantt/src/gantt.js +2655 -2709
- package/es/gantt/src/grid-emits.d.ts +2 -0
- package/es/gantt/src/grid-emits.js +18 -15
- package/es/gantt/src/static.d.ts +34 -0
- package/es/gantt/src/static.js +16 -36
- package/es/gantt/src/table-emits.d.ts +2 -0
- package/es/gantt/src/table-emits.js +126 -119
- package/es/gantt/src/util.d.ts +10 -0
- package/es/gantt/src/util.js +39 -29
- package/es/gantt/style.css +1 -1
- package/es/gantt/style.mini.css +1 -0
- package/es/index.d.ts +3 -0
- package/es/index.esm.js +6 -3
- 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 +5 -2
- 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 +26 -0
- package/es/ui/src/utils.js +58 -51
- package/es/ui/src/vn.d.ts +2 -0
- package/es/ui/src/vn.js +9 -6
- 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 -34
- package/lib/gantt/index.js +45 -31
- package/lib/gantt/src/emits.js +42 -6
- package/lib/gantt/src/gantt-body.js +152 -196
- package/lib/gantt/src/gantt-chart.js +310 -344
- package/lib/gantt/src/gantt-footer.js +48 -39
- package/lib/gantt/src/gantt-header.js +162 -164
- package/lib/gantt/src/gantt-view.js +964 -1256
- package/lib/gantt/src/gantt.js +1177 -1642
- package/lib/gantt/src/grid-emits.js +37 -6
- package/lib/gantt/src/static.js +34 -40
- package/lib/gantt/src/table-emits.js +145 -13
- package/lib/gantt/src/util.js +33 -16
- 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 -19
- package/lib/index.js +37 -0
- package/lib/index.umd.js +2964 -7775
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +982 -1
- package/lib/style.mini.css +1 -0
- package/lib/ui/index.js +36 -27
- package/lib/ui/src/comp.js +23 -6
- package/lib/ui/src/depend.js +28 -11
- package/lib/ui/src/dom.js +74 -81
- package/lib/ui/src/log.js +34 -18
- package/lib/ui/src/utils.js +62 -48
- package/lib/ui/src/vn.js +34 -8
- package/lib/ui/style/index.js +1 -1
- package/lib/vxe-gantt/index.js +35 -19
- 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 -19
- 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/ui/src/utils.ts +4 -3
- package/dist/style.min.css +0 -1
- 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/emits.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/grid-emits.min.js +0 -1
- package/lib/gantt/src/static.min.js +0 -1
- package/lib/gantt/src/table-emits.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
package/es/gantt/index.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { VxeUI } from
|
|
2
|
-
import { checkDependVersion } from
|
|
3
|
-
import VxeGanttComponent from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { VxeUI } from "@vxe-ui/core";
|
|
2
|
+
import { checkDependVersion } from "../ui/src/depend";
|
|
3
|
+
import VxeGanttComponent from "./src/gantt";
|
|
4
|
+
const VxeGantt = Object.assign({}, VxeGanttComponent, {
|
|
5
|
+
install(app) {
|
|
6
|
+
checkDependVersion();
|
|
7
|
+
app.component(VxeGanttComponent.name, VxeGanttComponent);
|
|
8
|
+
}
|
|
9
9
|
});
|
|
10
10
|
if (VxeUI.dynamicApp) {
|
|
11
|
-
|
|
11
|
+
VxeUI.dynamicApp.use(VxeGantt);
|
|
12
12
|
}
|
|
13
13
|
VxeUI.component(VxeGanttComponent);
|
|
14
|
-
export * from
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export * from "./src/static";
|
|
15
|
+
const Gantt = VxeGantt;
|
|
16
|
+
var gantt_default = VxeGantt;
|
|
17
|
+
export {
|
|
18
|
+
Gantt,
|
|
19
|
+
VxeGantt,
|
|
20
|
+
gantt_default as default
|
|
21
|
+
};
|
package/es/gantt/src/emits.js
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { gridEmits } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { gridEmits } from "./grid-emits";
|
|
2
|
+
const ganttEmits = [
|
|
3
|
+
...gridEmits,
|
|
4
|
+
"task-cell-click",
|
|
5
|
+
"task-cell-dblclick",
|
|
6
|
+
"task-bar-mouseenter",
|
|
7
|
+
"task-bar-mouseleave",
|
|
8
|
+
"task-bar-click",
|
|
9
|
+
"task-bar-dblclick",
|
|
10
|
+
"task-view-cell-click",
|
|
11
|
+
"task-view-cell-dblclick",
|
|
12
|
+
"task-move-start",
|
|
13
|
+
"task-move-drag",
|
|
14
|
+
"task-move-end",
|
|
15
|
+
"task-resize-start",
|
|
16
|
+
"task-resize-drag",
|
|
17
|
+
"task-resize-end",
|
|
18
|
+
"task-link-click",
|
|
19
|
+
"task-link-dblclick",
|
|
20
|
+
"task-link-remove"
|
|
21
21
|
];
|
|
22
|
+
export {
|
|
23
|
+
ganttEmits
|
|
24
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
5
|
+
export default _default;
|
|
@@ -1,262 +1,269 @@
|
|
|
1
|
-
import { h, inject, ref, onMounted, onUnmounted } from
|
|
2
|
-
import { defineVxeComponent } from
|
|
3
|
-
import { getCellRestHeight } from
|
|
4
|
-
import { getClass } from
|
|
5
|
-
import XEUtils from
|
|
6
|
-
import GanttViewChartComponent from
|
|
7
|
-
const sourceType =
|
|
8
|
-
const viewType =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
};
|
|
70
|
-
tdVNs.push(h('div', {
|
|
71
|
-
class: 'vxe-gantt-view-cell--row-resizable',
|
|
72
|
-
onMousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
73
|
-
onDblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
76
|
-
const ctParams = {
|
|
77
|
-
$gantt: $xeGantt,
|
|
78
|
-
source: sourceType,
|
|
79
|
-
type: viewType,
|
|
80
|
-
scaleType: scaleUnit,
|
|
81
|
-
dateObj,
|
|
82
|
-
startDateObj,
|
|
83
|
-
endDateObj,
|
|
84
|
-
row,
|
|
85
|
-
column,
|
|
86
|
-
$rowIndex,
|
|
87
|
-
rowIndex,
|
|
88
|
-
_rowIndex
|
|
89
|
-
};
|
|
90
|
-
return h('td', {
|
|
91
|
-
key: cellClassName || cellStyle ? field : $columnIndex,
|
|
92
|
-
class: [
|
|
93
|
-
'vxe-gantt-view--body-column',
|
|
94
|
-
{
|
|
95
|
-
'is--now': showNowLine && todayValue === field
|
|
96
|
-
},
|
|
97
|
-
getClass(cellClassName, ctParams)
|
|
98
|
-
],
|
|
99
|
-
style: cellStyle
|
|
100
|
-
? Object.assign({}, XEUtils.isFunction(cellStyle) ? cellStyle(ctParams) : cellStyle, {
|
|
101
|
-
height: `${cellHeight}px`
|
|
102
|
-
})
|
|
103
|
-
: {
|
|
104
|
-
height: `${cellHeight}px`
|
|
105
|
-
},
|
|
106
|
-
onClick(evnt) {
|
|
107
|
-
$xeGantt.handleTaskCellClickEvent(evnt, { row, column });
|
|
108
|
-
},
|
|
109
|
-
onDblclick(evnt) {
|
|
110
|
-
$xeGantt.handleTaskCellDblclickEvent(evnt, { row, column });
|
|
111
|
-
},
|
|
112
|
-
onContextmenu(evnt) {
|
|
113
|
-
$xeGantt.handleTaskBodyContextmenuEvent(evnt, ctParams);
|
|
114
|
-
}
|
|
115
|
-
}, tdVNs);
|
|
1
|
+
import { h, inject, ref, onMounted, onUnmounted } from "vue";
|
|
2
|
+
import { defineVxeComponent } from "../../ui/src/comp";
|
|
3
|
+
import { getCellRestHeight } from "./util";
|
|
4
|
+
import { getClass } from "../../ui/src/utils";
|
|
5
|
+
import XEUtils from "xe-utils";
|
|
6
|
+
import GanttViewChartComponent from "./gantt-chart";
|
|
7
|
+
const sourceType = "gantt";
|
|
8
|
+
const viewType = "body";
|
|
9
|
+
var gantt_body_default = defineVxeComponent({
|
|
10
|
+
name: "VxeGanttViewBody",
|
|
11
|
+
setup() {
|
|
12
|
+
const $xeGantt = inject("$xeGantt", {});
|
|
13
|
+
const $xeGanttView = inject("$xeGanttView", {});
|
|
14
|
+
const { computeTaskViewOpts, computeScaleUnit } = $xeGantt.getComputeMaps();
|
|
15
|
+
const { reactData, internalData } = $xeGanttView;
|
|
16
|
+
const refElem = ref();
|
|
17
|
+
const refBodyScroll = ref();
|
|
18
|
+
const refBodyTable = ref();
|
|
19
|
+
const refBodyXSpace = ref();
|
|
20
|
+
const refBodyYSpace = ref();
|
|
21
|
+
const renderColumn = ($xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex) => {
|
|
22
|
+
const tableReactData = $xeTable.reactData;
|
|
23
|
+
const { resizeHeightFlag } = tableReactData;
|
|
24
|
+
const tableInternalData = $xeTable.internalData;
|
|
25
|
+
const { fullAllDataRowIdData, visibleColumn } = tableInternalData;
|
|
26
|
+
const { computeCellOpts, computeRowOpts, computeDefaultRowHeight, computeResizableOpts } = $xeTable.getComputeMaps();
|
|
27
|
+
const cellOpts = computeCellOpts.value;
|
|
28
|
+
const rowOpts = computeRowOpts.value;
|
|
29
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
30
|
+
const resizableOpts = computeResizableOpts.value;
|
|
31
|
+
const { isAllRowDrag } = resizableOpts;
|
|
32
|
+
const { headerGroups } = reactData;
|
|
33
|
+
const { todayDateMaps } = internalData;
|
|
34
|
+
const taskViewOpts = computeTaskViewOpts.value;
|
|
35
|
+
const { showNowLine, viewStyle } = taskViewOpts;
|
|
36
|
+
const scaleUnit = computeScaleUnit.value;
|
|
37
|
+
const { scaleItem } = headerGroups[headerGroups.length - 1] || {};
|
|
38
|
+
const { field, dateObj, startDateObj, endDateObj } = column;
|
|
39
|
+
const { cellClassName, cellStyle } = viewStyle || {};
|
|
40
|
+
const todayValue = showNowLine && scaleItem ? todayDateMaps[scaleItem.type] : null;
|
|
41
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
42
|
+
const cellHeight = resizeHeightFlag ? getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
|
|
43
|
+
const tdVNs = [];
|
|
44
|
+
if (isAllRowDrag && rowOpts.resizable) {
|
|
45
|
+
const cellParams = {
|
|
46
|
+
$table: $xeTable,
|
|
47
|
+
$grid: null,
|
|
48
|
+
$gantt: $xeGantt,
|
|
49
|
+
seq: -1,
|
|
50
|
+
rowid,
|
|
51
|
+
row,
|
|
52
|
+
rowIndex,
|
|
53
|
+
$rowIndex,
|
|
54
|
+
_rowIndex,
|
|
55
|
+
column: visibleColumn[0],
|
|
56
|
+
columnIndex: 0,
|
|
57
|
+
$columnIndex: 0,
|
|
58
|
+
_columnIndex: 0,
|
|
59
|
+
fixed: "",
|
|
60
|
+
source: sourceType,
|
|
61
|
+
type: viewType,
|
|
62
|
+
isHidden: false,
|
|
63
|
+
isEdit: false,
|
|
64
|
+
level: -1,
|
|
65
|
+
// 已废弃属性
|
|
66
|
+
visibleData: [],
|
|
67
|
+
data: [],
|
|
68
|
+
items: []
|
|
116
69
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
70
|
+
tdVNs.push(
|
|
71
|
+
h("div", {
|
|
72
|
+
class: "vxe-gantt-view-cell--row-resizable",
|
|
73
|
+
onMousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
74
|
+
onDblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
const ctParams = {
|
|
79
|
+
$gantt: $xeGantt,
|
|
80
|
+
source: sourceType,
|
|
81
|
+
type: viewType,
|
|
82
|
+
scaleType: scaleUnit,
|
|
83
|
+
dateObj,
|
|
84
|
+
startDateObj,
|
|
85
|
+
endDateObj,
|
|
86
|
+
row,
|
|
87
|
+
column,
|
|
88
|
+
$rowIndex,
|
|
89
|
+
rowIndex,
|
|
90
|
+
_rowIndex
|
|
91
|
+
};
|
|
92
|
+
return h("td", {
|
|
93
|
+
key: cellClassName || cellStyle ? field : $columnIndex,
|
|
94
|
+
class: [
|
|
95
|
+
"vxe-gantt-view--body-column",
|
|
96
|
+
{
|
|
97
|
+
"is--now": showNowLine && todayValue === field
|
|
98
|
+
},
|
|
99
|
+
getClass(cellClassName, ctParams)
|
|
100
|
+
],
|
|
101
|
+
style: cellStyle ? Object.assign({}, XEUtils.isFunction(cellStyle) ? cellStyle(ctParams) : cellStyle, {
|
|
102
|
+
height: `${cellHeight}px`
|
|
103
|
+
}) : {
|
|
104
|
+
height: `${cellHeight}px`
|
|
105
|
+
},
|
|
106
|
+
onClick(evnt) {
|
|
107
|
+
$xeGantt.handleTaskCellClickEvent(evnt, { row, column });
|
|
108
|
+
},
|
|
109
|
+
onDblclick(evnt) {
|
|
110
|
+
$xeGantt.handleTaskCellDblclickEvent(evnt, { row, column });
|
|
111
|
+
},
|
|
112
|
+
onContextmenu(evnt) {
|
|
113
|
+
$xeGantt.handleTaskBodyContextmenuEvent(evnt, ctParams);
|
|
114
|
+
}
|
|
115
|
+
}, tdVNs);
|
|
116
|
+
};
|
|
117
|
+
const renderRows = ($xeTable, tableData) => {
|
|
118
|
+
const tableProps = $xeTable.props;
|
|
119
|
+
const { treeConfig, stripe, highlightHoverRow, editConfig } = tableProps;
|
|
120
|
+
const tableReactData = $xeTable.reactData;
|
|
121
|
+
const { treeExpandedFlag, selectRadioRow, pendingRowFlag, isRowGroupStatus } = tableReactData;
|
|
122
|
+
const tableInternalData = $xeTable.internalData;
|
|
123
|
+
const { fullAllDataRowIdData, treeExpandedMaps, pendingRowMaps } = tableInternalData;
|
|
124
|
+
const { computeRadioOpts, computeCheckboxOpts, computeTreeOpts, computeRowOpts } = $xeTable.getComputeMaps();
|
|
125
|
+
const radioOpts = computeRadioOpts.value;
|
|
126
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
127
|
+
const rowOpts = computeRowOpts.value;
|
|
128
|
+
const treeOpts = computeTreeOpts.value;
|
|
129
|
+
const { transform } = treeOpts;
|
|
130
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
131
|
+
const scaleUnit = computeScaleUnit.value;
|
|
132
|
+
const taskViewOpts = computeTaskViewOpts.value;
|
|
133
|
+
const { viewStyle } = taskViewOpts;
|
|
134
|
+
const { rowClassName, rowStyle, cellClassName, cellStyle } = viewStyle || {};
|
|
135
|
+
const { tableColumn, scrollYLoad } = reactData;
|
|
136
|
+
const trVNs = [];
|
|
137
|
+
tableData.forEach((row, $rowIndex) => {
|
|
138
|
+
const rowid = $xeTable.getRowid(row);
|
|
139
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
140
|
+
const trOns = {};
|
|
141
|
+
let rowIndex = $rowIndex;
|
|
142
|
+
let _rowIndex = -1;
|
|
143
|
+
if (rowRest) {
|
|
144
|
+
rowIndex = rowRest.index;
|
|
145
|
+
_rowIndex = rowRest._index;
|
|
146
|
+
}
|
|
147
|
+
let isNewRow = false;
|
|
148
|
+
if (editConfig) {
|
|
149
|
+
isNewRow = $xeTable.isInsertByRow(row);
|
|
150
|
+
}
|
|
151
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
152
|
+
trOns.onMouseenter = (evnt) => {
|
|
153
|
+
$xeTable.triggerHoverEvent(evnt, { row, rowIndex });
|
|
154
|
+
};
|
|
155
|
+
trOns.onMouseleave = () => {
|
|
156
|
+
$xeTable.clearHoverRow();
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
if (rowOpts.drag && !isRowGroupStatus && (!treeConfig || transform)) {
|
|
160
|
+
trOns.onDragstart = $xeTable.handleRowDragDragstartEvent;
|
|
161
|
+
trOns.onDragend = $xeTable.handleRowDragDragendEvent;
|
|
162
|
+
trOns.onDragover = $xeTable.handleRowDragDragoverEvent;
|
|
163
|
+
}
|
|
164
|
+
const rowParams = {
|
|
165
|
+
$gantt: $xeGantt,
|
|
166
|
+
source: sourceType,
|
|
167
|
+
type: viewType,
|
|
168
|
+
scaleType: scaleUnit,
|
|
169
|
+
row,
|
|
170
|
+
rowIndex,
|
|
171
|
+
$rowIndex,
|
|
172
|
+
_rowIndex
|
|
200
173
|
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
174
|
+
trVNs.push(
|
|
175
|
+
h("tr", {
|
|
176
|
+
key: rowClassName || rowStyle || cellClassName || cellStyle ? rowid : $rowIndex,
|
|
177
|
+
class: [
|
|
178
|
+
"vxe-gantt-view--body-row",
|
|
179
|
+
{
|
|
180
|
+
"row--stripe": stripe && (_rowIndex + 1) % 2 === 0,
|
|
181
|
+
"is--new": isNewRow,
|
|
182
|
+
"row--radio": radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
|
|
183
|
+
"row--checked": checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
184
|
+
"row--pending": !!pendingRowFlag && !!pendingRowMaps[rowid]
|
|
185
|
+
},
|
|
186
|
+
getClass(rowClassName, rowParams)
|
|
187
|
+
],
|
|
188
|
+
rowid,
|
|
189
|
+
style: rowStyle ? XEUtils.isFunction(rowStyle) ? rowStyle(rowParams) || void 0 : rowStyle : void 0,
|
|
190
|
+
...trOns
|
|
191
|
+
}, tableColumn.map((column, $columnIndex) => renderColumn($xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex)))
|
|
192
|
+
);
|
|
193
|
+
let isExpandTree = false;
|
|
194
|
+
let rowChildren = [];
|
|
195
|
+
if (treeConfig && !scrollYLoad && !transform) {
|
|
196
|
+
rowChildren = row[childrenField];
|
|
197
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
198
|
+
}
|
|
199
|
+
if (isExpandTree) {
|
|
200
|
+
trVNs.push(...renderRows($xeTable, rowChildren));
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
return trVNs;
|
|
204
|
+
};
|
|
205
|
+
const renderVN = () => {
|
|
206
|
+
const $xeTable = $xeGanttView.internalData.xeTable;
|
|
207
|
+
const { tableData, tableColumn, viewCellWidth } = reactData;
|
|
208
|
+
return h("div", {
|
|
209
|
+
ref: refElem,
|
|
210
|
+
class: "vxe-gantt-view--body-wrapper"
|
|
211
|
+
}, [
|
|
212
|
+
h("div", {
|
|
213
|
+
ref: refBodyScroll,
|
|
214
|
+
class: "vxe-gantt-view--body-inner-wrapper",
|
|
215
|
+
onScroll: $xeGanttView.triggerBodyScrollEvent,
|
|
216
|
+
onContextmenu(evnt) {
|
|
217
|
+
$xeGantt.handleTaskBodyContextmenuEvent(evnt, { source: sourceType, type: viewType, rowIndex: -1, $rowIndex: -1, _rowIndex: -1 });
|
|
218
|
+
}
|
|
219
|
+
}, [
|
|
220
|
+
h("div", {
|
|
221
|
+
ref: refBodyXSpace,
|
|
222
|
+
class: "vxe-body--x-space"
|
|
223
|
+
}),
|
|
224
|
+
h("div", {
|
|
225
|
+
ref: refBodyYSpace,
|
|
226
|
+
class: "vxe-body--y-space"
|
|
227
|
+
}),
|
|
228
|
+
h("table", {
|
|
229
|
+
ref: refBodyTable,
|
|
230
|
+
class: "vxe-gantt-view--body-table"
|
|
231
|
+
}, [
|
|
232
|
+
h("colgroup", {}, tableColumn.map((column, cIndex) => {
|
|
233
|
+
return h("col", {
|
|
234
|
+
key: cIndex,
|
|
235
|
+
style: {
|
|
236
|
+
width: `${viewCellWidth}px`
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
})),
|
|
240
|
+
h("tbody", {}, $xeTable ? renderRows($xeTable, tableData) : [])
|
|
241
|
+
]),
|
|
242
|
+
h(GanttViewChartComponent)
|
|
243
|
+
])
|
|
244
|
+
]);
|
|
245
|
+
};
|
|
246
|
+
onMounted(() => {
|
|
247
|
+
const { elemStore } = internalData;
|
|
248
|
+
const prefix = "main-body-";
|
|
249
|
+
elemStore[`${prefix}wrapper`] = refElem;
|
|
250
|
+
elemStore[`${prefix}scroll`] = refBodyScroll;
|
|
251
|
+
elemStore[`${prefix}table`] = refBodyTable;
|
|
252
|
+
elemStore[`${prefix}xSpace`] = refBodyXSpace;
|
|
253
|
+
elemStore[`${prefix}ySpace`] = refBodyYSpace;
|
|
254
|
+
});
|
|
255
|
+
onUnmounted(() => {
|
|
256
|
+
const { elemStore } = internalData;
|
|
257
|
+
const prefix = "main-body-";
|
|
258
|
+
elemStore[`${prefix}wrapper`] = null;
|
|
259
|
+
elemStore[`${prefix}scroll`] = null;
|
|
260
|
+
elemStore[`${prefix}table`] = null;
|
|
261
|
+
elemStore[`${prefix}xSpace`] = null;
|
|
262
|
+
elemStore[`${prefix}ySpace`] = null;
|
|
263
|
+
});
|
|
264
|
+
return renderVN;
|
|
265
|
+
}
|
|
262
266
|
});
|
|
267
|
+
export {
|
|
268
|
+
gantt_body_default as default
|
|
269
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
5
|
+
export default _default;
|