vxe-gantt 3.0.0-beta.0 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/gantt/src/gantt-body.js +77 -36
- package/es/gantt/src/gantt-chart.js +87 -60
- package/es/gantt/src/gantt-view.js +63 -7
- package/es/gantt/src/gantt.js +27 -7
- package/es/gantt/style.css +37 -11
- package/es/gantt/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +7 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-gantt/style.css +37 -11
- package/es/vxe-gantt/style.min.css +1 -1
- package/lib/gantt/src/gantt-body.js +98 -40
- package/lib/gantt/src/gantt-body.min.js +1 -1
- package/lib/gantt/src/gantt-chart.js +95 -62
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +72 -6
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +27 -7
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/gantt/style/style.css +37 -11
- package/lib/gantt/style/style.min.css +1 -1
- package/lib/index.umd.js +296 -123
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +13 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-gantt/style/style.css +37 -11
- package/lib/vxe-gantt/style/style.min.css +1 -1
- package/package.json +4 -4
- package/packages/gantt/src/gantt-body.ts +85 -39
- package/packages/gantt/src/gantt-chart.ts +99 -66
- package/packages/gantt/src/gantt-view.ts +65 -7
- package/packages/gantt/src/gantt.ts +27 -7
- package/packages/ui/index.ts +9 -1
- package/styles/components/gantt-module/gantt-chart.scss +1 -0
- package/styles/components/gantt.scss +43 -14
|
@@ -20,47 +20,87 @@ export default defineVxeComponent({
|
|
|
20
20
|
//
|
|
21
21
|
// Render
|
|
22
22
|
//
|
|
23
|
-
|
|
23
|
+
renderColumn(h, $xeTable, row, rowid, $rowIndex, column, $columnIndex) {
|
|
24
24
|
const _vm = this;
|
|
25
25
|
const $xeGantt = _vm.$xeGantt;
|
|
26
|
+
const tableInternalData = $xeTable;
|
|
27
|
+
const { fullAllDataRowIdData } = tableInternalData;
|
|
28
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
29
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
30
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
31
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
32
|
+
const cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
33
|
+
return h('td', {
|
|
34
|
+
key: $columnIndex,
|
|
35
|
+
class: 'vxe-gantt-view--body-column',
|
|
36
|
+
style: {
|
|
37
|
+
height: `${cellHeight}px`
|
|
38
|
+
},
|
|
39
|
+
on: {
|
|
40
|
+
click(evnt) {
|
|
41
|
+
$xeGantt.handleTaskCellClickEvent(evnt, { row, column });
|
|
42
|
+
},
|
|
43
|
+
dblclick(evnt) {
|
|
44
|
+
$xeGantt.handleTaskCellDblclickEvent(evnt, { row, column });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
renderRows(h, $xeTable, tableData) {
|
|
50
|
+
const _vm = this;
|
|
26
51
|
const $xeGanttView = _vm.$xeGanttView;
|
|
27
|
-
const $xeTable = $xeGanttView.internalData.xeTable;
|
|
28
|
-
const tableInternalData = ($xeTable ? $xeTable : {});
|
|
29
|
-
const fullAllDataRowIdData = tableInternalData.fullAllDataRowIdData || {};
|
|
30
|
-
let cellOpts = {};
|
|
31
|
-
let rowOpts = {};
|
|
32
|
-
let defaultRowHeight = 0;
|
|
33
|
-
if ($xeTable) {
|
|
34
|
-
cellOpts = $xeTable.computeCellOpts;
|
|
35
|
-
rowOpts = $xeTable.computeRowOpts;
|
|
36
|
-
defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
37
|
-
}
|
|
38
52
|
const { reactData } = $xeGanttView;
|
|
39
|
-
const
|
|
53
|
+
const tableProps = $xeTable;
|
|
54
|
+
const { treeConfig, stripe, highlightHoverRow } = tableProps;
|
|
55
|
+
const tableReactData = $xeTable;
|
|
56
|
+
const { treeExpandedFlag } = tableReactData;
|
|
57
|
+
const tableInternalData = $xeTable;
|
|
58
|
+
const { fullAllDataRowIdData, treeExpandedMaps } = tableInternalData;
|
|
59
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
60
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
61
|
+
const { transform } = treeOpts;
|
|
62
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
63
|
+
const { tableColumn, scrollYLoad } = reactData;
|
|
40
64
|
const trVNs = [];
|
|
41
|
-
tableData.forEach((row,
|
|
42
|
-
const rowid = $xeTable
|
|
65
|
+
tableData.forEach((row, $rowIndex) => {
|
|
66
|
+
const rowid = $xeTable.getRowid(row);
|
|
43
67
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
44
|
-
const
|
|
68
|
+
const trOns = {};
|
|
69
|
+
let rowIndex = $rowIndex;
|
|
70
|
+
let _rowIndex = -1;
|
|
71
|
+
if (rowRest) {
|
|
72
|
+
rowIndex = rowRest.index;
|
|
73
|
+
_rowIndex = rowRest._index;
|
|
74
|
+
}
|
|
75
|
+
// 当前行事件
|
|
76
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
77
|
+
trOns.mouseenter = (evnt) => {
|
|
78
|
+
$xeTable.triggerHoverEvent(evnt, { row, rowIndex });
|
|
79
|
+
};
|
|
80
|
+
trOns.mouseleave = () => {
|
|
81
|
+
$xeTable.clearHoverRow();
|
|
82
|
+
};
|
|
83
|
+
}
|
|
45
84
|
trVNs.push(h('tr', {
|
|
46
|
-
key:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
85
|
+
key: treeConfig ? rowid : $rowIndex,
|
|
86
|
+
class: ['vxe-gantt-view--body-row', {
|
|
87
|
+
'row--stripe': stripe && (_rowIndex + 1) % 2 === 0
|
|
88
|
+
}],
|
|
89
|
+
attrs: {
|
|
90
|
+
rowid
|
|
91
|
+
},
|
|
92
|
+
on: trOns
|
|
93
|
+
}, tableColumn.map((column, $columnIndex) => _vm.renderColumn(h, $xeTable, row, rowid, $rowIndex, column, $columnIndex))));
|
|
94
|
+
let isExpandTree = false;
|
|
95
|
+
let rowChildren = [];
|
|
96
|
+
if (treeConfig && !scrollYLoad && !transform) {
|
|
97
|
+
rowChildren = row[childrenField];
|
|
98
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
99
|
+
}
|
|
100
|
+
// 如果是树形表格
|
|
101
|
+
if (isExpandTree) {
|
|
102
|
+
trVNs.push(..._vm.renderRows(h, $xeTable, rowChildren));
|
|
103
|
+
}
|
|
64
104
|
});
|
|
65
105
|
return trVNs;
|
|
66
106
|
},
|
|
@@ -68,7 +108,8 @@ export default defineVxeComponent({
|
|
|
68
108
|
const _vm = this;
|
|
69
109
|
const $xeGanttView = _vm.$xeGanttView;
|
|
70
110
|
const { reactData } = $xeGanttView;
|
|
71
|
-
const
|
|
111
|
+
const $xeTable = $xeGanttView.internalData.xeTable;
|
|
112
|
+
const { tableData, tableColumn, viewCellWidth } = reactData;
|
|
72
113
|
return h('div', {
|
|
73
114
|
ref: 'refElem',
|
|
74
115
|
class: 'vxe-gantt-view--body-wrapper'
|
|
@@ -100,7 +141,7 @@ export default defineVxeComponent({
|
|
|
100
141
|
}
|
|
101
142
|
});
|
|
102
143
|
})),
|
|
103
|
-
h('tbody', {}, _vm.renderRows(h))
|
|
144
|
+
h('tbody', {}, $xeTable ? _vm.renderRows(h, $xeTable, tableData) : [])
|
|
104
145
|
]),
|
|
105
146
|
h(GanttViewChartComponent)
|
|
106
147
|
])
|
|
@@ -23,84 +23,111 @@ export default defineVxeComponent({
|
|
|
23
23
|
//
|
|
24
24
|
// Render
|
|
25
25
|
//
|
|
26
|
-
|
|
26
|
+
renderTaskBar(h, $xeTable, row, rowid, $rowIndex) {
|
|
27
27
|
const _vm = this;
|
|
28
28
|
const $xeGantt = _vm.$xeGantt;
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const tableInternalData =
|
|
32
|
-
const fullAllDataRowIdData = tableInternalData
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if ($xeTable) {
|
|
37
|
-
cellOpts = $xeTable.computeCellOpts;
|
|
38
|
-
rowOpts = $xeTable.computeRowOpts;
|
|
39
|
-
defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
40
|
-
}
|
|
41
|
-
const { reactData } = $xeGanttView;
|
|
42
|
-
const { tableData } = reactData;
|
|
29
|
+
const tableProps = $xeTable;
|
|
30
|
+
const { treeConfig } = tableProps;
|
|
31
|
+
const tableInternalData = $xeTable;
|
|
32
|
+
const { fullAllDataRowIdData } = tableInternalData;
|
|
33
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
34
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
35
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
43
36
|
const titleField = $xeGantt.computeTitleField;
|
|
44
37
|
const progressField = $xeGantt.computeProgressField;
|
|
45
38
|
const taskBarOpts = $xeGantt.computeTaskBarOpts;
|
|
46
39
|
const { showProgress, showContent, contentMethod, barStyle } = taskBarOpts;
|
|
47
40
|
const { round } = barStyle || {};
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
42
|
+
const cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
43
|
+
let title = getStringValue(XEUtils.get(row, titleField));
|
|
44
|
+
const progressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(row, progressField)))) : 0;
|
|
45
|
+
if (contentMethod) {
|
|
46
|
+
title = getStringValue(contentMethod({ row, title }));
|
|
47
|
+
}
|
|
48
|
+
return h('div', {
|
|
49
|
+
key: treeConfig ? rowid : $rowIndex,
|
|
50
|
+
attrs: {
|
|
51
|
+
rowid
|
|
52
|
+
},
|
|
53
|
+
class: ['vxe-gantt-view--chart-row', {
|
|
54
|
+
'is--round': round
|
|
55
|
+
}],
|
|
56
|
+
style: {
|
|
57
|
+
height: `${cellHeight}px`
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
}, [
|
|
60
|
+
h('div', {
|
|
61
|
+
class: 'vxe-gantt-view--chart-bar',
|
|
60
62
|
attrs: {
|
|
61
63
|
rowid
|
|
62
64
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
on: {
|
|
66
|
+
click(evnt) {
|
|
67
|
+
$xeGantt.handleTaskBarClickEvent(evnt, { row });
|
|
68
|
+
},
|
|
69
|
+
dblclick(evnt) {
|
|
70
|
+
$xeGantt.handleTaskBarDblclickEvent(evnt, { row });
|
|
71
|
+
}
|
|
68
72
|
}
|
|
69
73
|
}, [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
on: {
|
|
76
|
-
click(evnt) {
|
|
77
|
-
$xeGantt.handleTaskBarClickEvent(evnt, { row });
|
|
78
|
-
},
|
|
79
|
-
dblclick(evnt) {
|
|
80
|
-
$xeGantt.handleTaskBarDblclickEvent(evnt, { row });
|
|
74
|
+
showProgress
|
|
75
|
+
? h('div', {
|
|
76
|
+
class: 'vxe-gantt-view--chart-progress',
|
|
77
|
+
style: {
|
|
78
|
+
width: `${progressValue || 0}%`
|
|
81
79
|
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
80
|
+
})
|
|
81
|
+
: renderEmptyElement($xeGantt),
|
|
82
|
+
showContent
|
|
83
|
+
? h('div', {
|
|
84
|
+
class: 'vxe-gantt-view--chart-content'
|
|
85
|
+
}, title)
|
|
86
|
+
: renderEmptyElement($xeGantt)
|
|
87
|
+
])
|
|
88
|
+
]);
|
|
89
|
+
},
|
|
90
|
+
renderRows(h, $xeTable, tableData) {
|
|
91
|
+
const _vm = this;
|
|
92
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
93
|
+
const { reactData } = $xeGanttView;
|
|
94
|
+
const tableProps = $xeTable;
|
|
95
|
+
const { treeConfig } = tableProps;
|
|
96
|
+
const tableReactData = $xeTable;
|
|
97
|
+
const { treeExpandedFlag } = tableReactData;
|
|
98
|
+
const tableInternalData = $xeTable;
|
|
99
|
+
const { treeExpandedMaps } = tableInternalData;
|
|
100
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
101
|
+
const { transform } = treeOpts;
|
|
102
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
103
|
+
const { scrollYLoad } = reactData;
|
|
104
|
+
const trVNs = [];
|
|
105
|
+
tableData.forEach((row, $rowIndex) => {
|
|
106
|
+
const rowid = $xeTable ? $xeTable.getRowid(row) : '';
|
|
107
|
+
trVNs.push(_vm.renderTaskBar(h, $xeTable, row, rowid, $rowIndex));
|
|
108
|
+
let isExpandTree = false;
|
|
109
|
+
let rowChildren = [];
|
|
110
|
+
if (treeConfig && !scrollYLoad && !transform) {
|
|
111
|
+
rowChildren = row[childrenField];
|
|
112
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
113
|
+
}
|
|
114
|
+
// 如果是树形表格
|
|
115
|
+
if (isExpandTree) {
|
|
116
|
+
trVNs.push(..._vm.renderRows(h, $xeTable, rowChildren));
|
|
117
|
+
}
|
|
99
118
|
});
|
|
119
|
+
return trVNs;
|
|
120
|
+
},
|
|
121
|
+
renderVN(h) {
|
|
122
|
+
const _vm = this;
|
|
123
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
124
|
+
const { reactData } = $xeGanttView;
|
|
125
|
+
const $xeTable = $xeGanttView.internalData.xeTable;
|
|
126
|
+
const { tableData } = reactData;
|
|
100
127
|
return h('div', {
|
|
101
128
|
ref: 'refElem',
|
|
102
129
|
class: 'vxe-gantt-view--chart-wrapper'
|
|
103
|
-
},
|
|
130
|
+
}, $xeTable ? _vm.renderRows(h, $xeTable, tableData) : []);
|
|
104
131
|
}
|
|
105
132
|
},
|
|
106
133
|
mounted() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
2
2
|
import { VxeUI } from '@vxe-ui/core';
|
|
3
|
-
import { setScrollTop, setScrollLeft } from '../../ui/src/dom';
|
|
3
|
+
import { setScrollTop, setScrollLeft, removeClass, addClass } from '../../ui/src/dom';
|
|
4
4
|
import { getRefElem } from './util';
|
|
5
5
|
import XEUtils from 'xe-utils';
|
|
6
6
|
import GanttViewHeaderComponent from './gantt-header';
|
|
@@ -41,6 +41,8 @@ function handleParseColumn($xeGanttView) {
|
|
|
41
41
|
const $xeGantt = $xeGanttView.$xeGantt;
|
|
42
42
|
const reactData = $xeGanttView.reactData;
|
|
43
43
|
const internalData = $xeGanttView.internalData;
|
|
44
|
+
const ganttProps = $xeGantt;
|
|
45
|
+
const { treeConfig } = ganttProps;
|
|
44
46
|
const { minViewDate, maxViewDate } = reactData;
|
|
45
47
|
const taskViewOpts = $xeGantt.computeTaskViewOpts;
|
|
46
48
|
const fullCols = [];
|
|
@@ -93,9 +95,12 @@ function handleParseColumn($xeGanttView) {
|
|
|
93
95
|
const startField = $xeGantt.computeStartField;
|
|
94
96
|
const endField = $xeGantt.computeEndField;
|
|
95
97
|
const tableInternalData = $xeTable;
|
|
96
|
-
const { afterFullData } = tableInternalData;
|
|
98
|
+
const { afterFullData, afterTreeFullData } = tableInternalData;
|
|
99
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
100
|
+
const { transform } = treeOpts;
|
|
101
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
97
102
|
const ctMaps = {};
|
|
98
|
-
|
|
103
|
+
const handleParseRender = (row) => {
|
|
99
104
|
const rowid = $xeTable.getRowid(row);
|
|
100
105
|
const startValue = XEUtils.get(row, startField);
|
|
101
106
|
const endValue = XEUtils.get(row, endField);
|
|
@@ -111,7 +116,13 @@ function handleParseColumn($xeGanttView) {
|
|
|
111
116
|
oWidthSize
|
|
112
117
|
};
|
|
113
118
|
}
|
|
114
|
-
}
|
|
119
|
+
};
|
|
120
|
+
if (treeConfig) {
|
|
121
|
+
XEUtils.eachTree(afterTreeFullData, handleParseRender, { children: transform ? treeOpts.mapChildrenField : childrenField });
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
afterFullData.forEach(handleParseRender);
|
|
125
|
+
}
|
|
115
126
|
internalData.chartMaps = ctMaps;
|
|
116
127
|
}
|
|
117
128
|
}
|
|
@@ -125,6 +136,8 @@ function handleUpdateData($xeGanttView) {
|
|
|
125
136
|
const $xeGantt = $xeGanttView.$xeGantt;
|
|
126
137
|
const reactData = $xeGanttView.reactData;
|
|
127
138
|
const internalData = $xeGanttView.internalData;
|
|
139
|
+
const ganttProps = $xeGantt;
|
|
140
|
+
const { treeConfig } = ganttProps;
|
|
128
141
|
const $xeTable = internalData.xeTable;
|
|
129
142
|
const sdMaps = {};
|
|
130
143
|
const edMaps = {};
|
|
@@ -134,8 +147,11 @@ function handleUpdateData($xeGanttView) {
|
|
|
134
147
|
const startField = $xeGantt.computeStartField;
|
|
135
148
|
const endField = $xeGantt.computeEndField;
|
|
136
149
|
const tableInternalData = $xeTable;
|
|
137
|
-
const { afterFullData } = tableInternalData;
|
|
138
|
-
|
|
150
|
+
const { afterFullData, afterTreeFullData } = tableInternalData;
|
|
151
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
152
|
+
const { transform } = treeOpts;
|
|
153
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
154
|
+
const handleMinMaxData = (row) => {
|
|
139
155
|
const startValue = XEUtils.get(row, startField);
|
|
140
156
|
const endValue = XEUtils.get(row, endField);
|
|
141
157
|
if (startValue && endValue) {
|
|
@@ -148,7 +164,13 @@ function handleUpdateData($xeGanttView) {
|
|
|
148
164
|
maxDate = endDate;
|
|
149
165
|
}
|
|
150
166
|
}
|
|
151
|
-
}
|
|
167
|
+
};
|
|
168
|
+
if (treeConfig) {
|
|
169
|
+
XEUtils.eachTree(afterTreeFullData, handleMinMaxData, { children: transform ? treeOpts.mapChildrenField : childrenField });
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
afterFullData.forEach(handleMinMaxData);
|
|
173
|
+
}
|
|
152
174
|
}
|
|
153
175
|
reactData.minViewDate = minDate;
|
|
154
176
|
reactData.maxViewDate = maxDate;
|
|
@@ -303,6 +325,7 @@ function updateStyle($xeGanttView) {
|
|
|
303
325
|
function handleLazyRecalculate($xeGanttView) {
|
|
304
326
|
calcScrollbar($xeGanttView);
|
|
305
327
|
updateStyle($xeGanttView);
|
|
328
|
+
updateChart($xeGanttView);
|
|
306
329
|
return $xeGanttView.$nextTick();
|
|
307
330
|
}
|
|
308
331
|
function updateScrollXSpace($xeGanttView) {
|
|
@@ -547,6 +570,39 @@ export default defineVxeComponent({
|
|
|
547
570
|
const $xeGanttView = this;
|
|
548
571
|
return handleLazyRecalculate($xeGanttView);
|
|
549
572
|
},
|
|
573
|
+
handleUpdateCurrentRow(row) {
|
|
574
|
+
const $xeGanttView = this;
|
|
575
|
+
const internalData = $xeGanttView.internalData;
|
|
576
|
+
const $xeTable = internalData.xeTable;
|
|
577
|
+
const el = $xeGanttView.$refs.refElem;
|
|
578
|
+
if ($xeTable && el) {
|
|
579
|
+
if (row) {
|
|
580
|
+
const tableProps = $xeTable;
|
|
581
|
+
const { highlightCurrentRow } = tableProps;
|
|
582
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
583
|
+
if (rowOpts.isCurrent || highlightCurrentRow) {
|
|
584
|
+
XEUtils.arrayEach(el.querySelectorAll(`[rowid="${$xeTable.getRowid(row)}"]`), elem => addClass(elem, 'row--current'));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
XEUtils.arrayEach(el.querySelectorAll('.row--current'), elem => removeClass(elem, 'row--current'));
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
handleUpdateHoverRow(row) {
|
|
593
|
+
const $xeGanttView = this;
|
|
594
|
+
const internalData = $xeGanttView.internalData;
|
|
595
|
+
const $xeTable = internalData.xeTable;
|
|
596
|
+
const el = $xeGanttView.$refs.refElem;
|
|
597
|
+
if ($xeTable && el) {
|
|
598
|
+
if (row) {
|
|
599
|
+
XEUtils.arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${$xeTable.getRowid(row)}"]`), elem => addClass(elem, 'row--hover'));
|
|
600
|
+
}
|
|
601
|
+
else {
|
|
602
|
+
XEUtils.arrayEach(el.querySelectorAll('.vxe-body--row.row--hover'), elem => removeClass(elem, 'row--hover'));
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
},
|
|
550
606
|
triggerHeaderScrollEvent(evnt) {
|
|
551
607
|
const $xeGanttView = this;
|
|
552
608
|
const internalData = $xeGanttView.internalData;
|
package/es/gantt/src/gantt.js
CHANGED
|
@@ -234,7 +234,12 @@ export default {
|
|
|
234
234
|
const proxyOpts = $xeGantt.computeProxyOpts;
|
|
235
235
|
const pagerOpts = $xeGantt.computePagerOpts;
|
|
236
236
|
const isLoading = $xeGantt.computeIsLoading;
|
|
237
|
-
const tProps = Object.assign({}, tableExtendProps
|
|
237
|
+
const tProps = Object.assign({}, tableExtendProps, {
|
|
238
|
+
showOverflow: true,
|
|
239
|
+
showHeaderOverflow: true,
|
|
240
|
+
showFooterOverflow: true,
|
|
241
|
+
showFooter: false
|
|
242
|
+
});
|
|
238
243
|
if (isZMax) {
|
|
239
244
|
if (tableExtendProps.maxHeight) {
|
|
240
245
|
tProps.maxHeight = '100%';
|
|
@@ -1368,6 +1373,21 @@ export default {
|
|
|
1368
1373
|
},
|
|
1369
1374
|
handleTaskCellClickEvent(evnt, params) {
|
|
1370
1375
|
const $xeGantt = this;
|
|
1376
|
+
const $xeTable = $xeGantt.$refs.refTable;
|
|
1377
|
+
if ($xeTable) {
|
|
1378
|
+
const tableProps = $xeTable;
|
|
1379
|
+
const { highlightCurrentRow } = tableProps;
|
|
1380
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
1381
|
+
const { row } = params;
|
|
1382
|
+
// 如果是当前行
|
|
1383
|
+
if (rowOpts.isCurrent || highlightCurrentRow) {
|
|
1384
|
+
$xeTable.triggerCurrentRowEvent(evnt, Object.assign({
|
|
1385
|
+
$table: $xeTable,
|
|
1386
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
1387
|
+
$rowIndex: $xeTable.getVMRowIndex(row)
|
|
1388
|
+
}, params));
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1371
1391
|
$xeGantt.dispatchEvent('task-cell-click', params, evnt);
|
|
1372
1392
|
},
|
|
1373
1393
|
handleTaskCellDblclickEvent(evnt, params) {
|
|
@@ -1560,9 +1580,8 @@ export default {
|
|
|
1560
1580
|
const slots = $xeGantt.$scopedSlots;
|
|
1561
1581
|
const { toolbarConfig } = props;
|
|
1562
1582
|
const toolbarSlot = slots.toolbar;
|
|
1563
|
-
const hasToolbar = !!(toolbarSlot || isEnableConf(toolbarConfig) || toolbar);
|
|
1564
1583
|
const toolbarOpts = $xeGantt.computeToolbarOpts;
|
|
1565
|
-
if (
|
|
1584
|
+
if ((toolbarConfig && isEnableConf(toolbarOpts)) || toolbarSlot) {
|
|
1566
1585
|
return h('div', {
|
|
1567
1586
|
key: 'toolbar',
|
|
1568
1587
|
ref: 'refToolbarWrapper',
|
|
@@ -1695,18 +1714,19 @@ export default {
|
|
|
1695
1714
|
if (!enabled) {
|
|
1696
1715
|
return renderEmptyElement($xeGantt);
|
|
1697
1716
|
}
|
|
1717
|
+
const isResize = resize && showLeftView && showRightView;
|
|
1698
1718
|
const ons = {};
|
|
1699
|
-
if (
|
|
1719
|
+
if (isResize) {
|
|
1700
1720
|
ons.mousedown = $xeGantt.dragSplitEvent;
|
|
1701
1721
|
}
|
|
1702
1722
|
return h('div', {
|
|
1703
1723
|
class: ['vxe-gantt--view-split-bar', {
|
|
1704
|
-
'is--resize':
|
|
1705
|
-
on: ons
|
|
1724
|
+
'is--resize': isResize
|
|
1706
1725
|
}]
|
|
1707
1726
|
}, [
|
|
1708
1727
|
h('div', {
|
|
1709
|
-
class: 'vxe-gantt--view-split-bar-handle'
|
|
1728
|
+
class: 'vxe-gantt--view-split-bar-handle',
|
|
1729
|
+
on: ons
|
|
1710
1730
|
}),
|
|
1711
1731
|
showCollapseTableButton || showCollapseTaskButton
|
|
1712
1732
|
? h('div', {
|
package/es/gantt/style.css
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
width: 100%;
|
|
41
41
|
height: 100%;
|
|
42
42
|
background-color: rgba(0, 0, 0, 0.1);
|
|
43
|
+
pointer-events: none;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
.vxe-gantt-view--chart-progress {
|
|
@@ -188,9 +189,6 @@
|
|
|
188
189
|
border: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
189
190
|
}
|
|
190
191
|
|
|
191
|
-
.vxe-gantt.border--default .vxe-gantt-view--header-wrapper, .vxe-gantt.border--full .vxe-gantt-view--header-wrapper, .vxe-gantt.border--outer .vxe-gantt-view--header-wrapper {
|
|
192
|
-
background-color: var(--vxe-ui-table-header-background-color);
|
|
193
|
-
}
|
|
194
192
|
.vxe-gantt.border--full .vxe-gantt-view--header-column,
|
|
195
193
|
.vxe-gantt.border--full .vxe-gantt-view--body-column,
|
|
196
194
|
.vxe-gantt.border--full .vxe-gantt-view--footer-column {
|
|
@@ -271,6 +269,22 @@
|
|
|
271
269
|
width: calc(100% + var(--vxe-ui-table-border-width));
|
|
272
270
|
border-left: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
273
271
|
}
|
|
272
|
+
.vxe-gantt.border--default .vxe-gantt-view--header-column,
|
|
273
|
+
.vxe-gantt.border--default .vxe-gantt-view--body-column,
|
|
274
|
+
.vxe-gantt.border--default .vxe-gantt-view--footer-column, .vxe-gantt.border--inner .vxe-gantt-view--header-column,
|
|
275
|
+
.vxe-gantt.border--inner .vxe-gantt-view--body-column,
|
|
276
|
+
.vxe-gantt.border--inner .vxe-gantt-view--footer-column {
|
|
277
|
+
background-image: linear-gradient(var(--vxe-ui-table-border-color), var(--vxe-ui-table-border-color));
|
|
278
|
+
background-repeat: no-repeat;
|
|
279
|
+
background-size: 100% var(--vxe-ui-table-border-width);
|
|
280
|
+
background-position: right bottom;
|
|
281
|
+
}
|
|
282
|
+
.vxe-gantt.border--inner .vxe-gantt--border-line {
|
|
283
|
+
border-width: 0 0 1px 0;
|
|
284
|
+
}
|
|
285
|
+
.vxe-gantt.border--none .vxe-gantt--border-line {
|
|
286
|
+
display: none;
|
|
287
|
+
}
|
|
274
288
|
|
|
275
289
|
/*分割条*/
|
|
276
290
|
.vxe-gantt--view-split-bar {
|
|
@@ -547,10 +561,6 @@
|
|
|
547
561
|
float: left;
|
|
548
562
|
}
|
|
549
563
|
|
|
550
|
-
.vxe-gantt-view--header-table {
|
|
551
|
-
height: 100%;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
564
|
.vxe-gantt-view--header-table,
|
|
555
565
|
.vxe-gantt-view--body-table {
|
|
556
566
|
border: 0;
|
|
@@ -563,6 +573,10 @@
|
|
|
563
573
|
width: var(--vxe-ui-gantt-view-default-cell-width);
|
|
564
574
|
}
|
|
565
575
|
|
|
576
|
+
.vxe-gantt-view--header-wrapper {
|
|
577
|
+
background-color: var(--vxe-ui-table-header-background-color);
|
|
578
|
+
}
|
|
579
|
+
|
|
566
580
|
.vxe-gantt-view--header-wrapper,
|
|
567
581
|
.vxe-gantt-view--body-wrapper {
|
|
568
582
|
overflow: hidden;
|
|
@@ -593,10 +607,6 @@
|
|
|
593
607
|
font-size: 1em;
|
|
594
608
|
}
|
|
595
609
|
|
|
596
|
-
.vxe-gantt-view--body-column {
|
|
597
|
-
height: 48px;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
610
|
.vxe-gantt-view--header-column,
|
|
601
611
|
.vxe-gantt-view--body-column,
|
|
602
612
|
.vxe-gantt-view--footer-column {
|
|
@@ -606,6 +616,22 @@
|
|
|
606
616
|
white-space: nowrap;
|
|
607
617
|
}
|
|
608
618
|
|
|
619
|
+
.vxe-gantt-view--body-row.row--stripe {
|
|
620
|
+
background-color: var(--vxe-ui-table-row-striped-background-color);
|
|
621
|
+
}
|
|
622
|
+
.vxe-gantt-view--body-row.row--current {
|
|
623
|
+
background-color: var(--vxe-ui-table-row-current-background-color);
|
|
624
|
+
}
|
|
625
|
+
.vxe-gantt-view--body-row.row--hover {
|
|
626
|
+
background-color: var(--vxe-ui-table-row-hover-background-color);
|
|
627
|
+
}
|
|
628
|
+
.vxe-gantt-view--body-row.row--hover.row--stripe {
|
|
629
|
+
background-color: var(--vxe-ui-table-row-hover-striped-background-color);
|
|
630
|
+
}
|
|
631
|
+
.vxe-gantt-view--body-row.row--hover.row--current {
|
|
632
|
+
background-color: var(--vxe-ui-table-row-hover-current-background-color);
|
|
633
|
+
}
|
|
634
|
+
|
|
609
635
|
.vxe-gantt-view.mode--day .vxe-gantt-view--header-column {
|
|
610
636
|
height: 50%;
|
|
611
637
|
}
|