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,515 +1,506 @@
|
|
|
1
|
-
import { defineVxeComponent } from
|
|
2
|
-
import { VxeUI } from
|
|
3
|
-
import XEUtils from
|
|
4
|
-
import { getCellRestHeight, hasMilestoneTask, getTaskType, hasSubviewTask } from
|
|
5
|
-
import { getStringValue, isEnableConf, hasEnableConf } from
|
|
1
|
+
import { defineVxeComponent } from "../../ui/src/comp";
|
|
2
|
+
import { VxeUI } from "@vxe-ui/core";
|
|
3
|
+
import XEUtils from "xe-utils";
|
|
4
|
+
import { getCellRestHeight, hasMilestoneTask, getTaskType, hasSubviewTask } from "./util";
|
|
5
|
+
import { getStringValue, isEnableConf, hasEnableConf } from "../../ui/src/utils";
|
|
6
6
|
const { getIcon, renderEmptyElement } = VxeUI;
|
|
7
|
-
const sourceType =
|
|
8
|
-
const viewType =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
$xeGanttView: {
|
|
16
|
-
default: null
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
props: {},
|
|
20
|
-
data() {
|
|
21
|
-
return {};
|
|
7
|
+
const sourceType = "gantt";
|
|
8
|
+
const viewType = "chart";
|
|
9
|
+
var gantt_chart_default = defineVxeComponent({
|
|
10
|
+
name: "VxeGanttViewChart",
|
|
11
|
+
inject: {
|
|
12
|
+
$xeGantt: {
|
|
13
|
+
default: null
|
|
22
14
|
},
|
|
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
|
-
|
|
15
|
+
$xeGanttView: {
|
|
16
|
+
default: null
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
props: {},
|
|
20
|
+
data() {
|
|
21
|
+
return {};
|
|
22
|
+
},
|
|
23
|
+
computed: {
|
|
24
|
+
...{}
|
|
25
|
+
},
|
|
26
|
+
methods: {
|
|
27
|
+
//
|
|
28
|
+
// Render
|
|
29
|
+
//
|
|
30
|
+
renderTaskBar(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, rowChildren, isExpandTree) {
|
|
31
|
+
const _vm = this;
|
|
32
|
+
const $xeGantt = _vm.$xeGantt;
|
|
33
|
+
const tableReactData = $xeTable.getReactData();
|
|
34
|
+
const { resizeHeightFlag, pendingRowFlag } = tableReactData;
|
|
35
|
+
const tableInternalData = $xeTable.getInternalData();
|
|
36
|
+
const { fullAllDataRowIdData, pendingRowMaps } = tableInternalData;
|
|
37
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
38
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
39
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
40
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
41
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
42
|
+
const ganttProps = $xeGantt;
|
|
43
|
+
const ganttReactData = $xeGantt.reactData;
|
|
44
|
+
const ganttInternalData = $xeGantt.internalData;
|
|
45
|
+
const ganttSlots = $xeGantt.$scopedSlots;
|
|
46
|
+
const taskBarSlot = ganttSlots.taskBar || ganttSlots["task-bar"];
|
|
47
|
+
const taskBarOverviewSlot = ganttSlots.taskBarOverview || ganttSlots["task-bar-overview"];
|
|
48
|
+
const { treeConfig, taskBarMilestoneConfig, taskBarSubviewConfig } = ganttProps;
|
|
49
|
+
const { activeLink, activeBarRowid, criticalPathFlag } = ganttReactData;
|
|
50
|
+
const { criticalRowMaps } = ganttInternalData;
|
|
51
|
+
const titleField = $xeGantt.computeTitleField;
|
|
52
|
+
const progressField = $xeGantt.computeProgressField;
|
|
53
|
+
const typeField = $xeGantt.computeTypeField;
|
|
54
|
+
const taskBarOpts = $xeGantt.computeTaskBarOpts;
|
|
55
|
+
const taskBarMilestoneOpts = $xeGantt.computeTaskBarMilestoneOpts;
|
|
56
|
+
const taskBarSubviewOpts = $xeGantt.computeTaskBarSubviewOpts;
|
|
57
|
+
const { showOverview, barStyle: subBarStyle } = taskBarSubviewOpts;
|
|
58
|
+
const scaleUnit = $xeGantt.computeScaleUnit;
|
|
59
|
+
const barParams = {
|
|
60
|
+
$gantt: $xeGantt,
|
|
61
|
+
source: sourceType,
|
|
62
|
+
type: viewType,
|
|
63
|
+
scaleType: scaleUnit,
|
|
64
|
+
row,
|
|
65
|
+
$rowIndex,
|
|
66
|
+
rowIndex,
|
|
67
|
+
_rowIndex
|
|
68
|
+
};
|
|
69
|
+
const { showProgress, showCriticalPath, showContent, contentMethod, barStyle, moveable, showTooltip } = taskBarOpts;
|
|
70
|
+
const isBarRowStyle = XEUtils.isFunction(barStyle);
|
|
71
|
+
const barStyObj = (barStyle ? isBarRowStyle ? barStyle(barParams) : barStyle : {}) || {};
|
|
72
|
+
const barRound = barStyObj.round;
|
|
73
|
+
const barBgColor = barStyObj.bgColor;
|
|
74
|
+
const barCompletedBgColor = barStyObj.completedBgColor;
|
|
75
|
+
const barHtmlStyle = barStyObj.style;
|
|
76
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
77
|
+
const cellHeight = resizeHeightFlag ? getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
|
|
78
|
+
let title = getStringValue(XEUtils.get(row, titleField));
|
|
79
|
+
const progressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(row, progressField)))) : 0;
|
|
80
|
+
const renderTaskType = getTaskType(XEUtils.get(row, typeField));
|
|
81
|
+
const isMilestone = !!(hasEnableConf(taskBarMilestoneConfig, taskBarMilestoneOpts) && hasMilestoneTask(renderTaskType));
|
|
82
|
+
const ctParams = { ...barParams };
|
|
83
|
+
const vbStyle = {};
|
|
84
|
+
const vpStyle = {
|
|
85
|
+
width: `${progressValue || 0}%`
|
|
86
|
+
};
|
|
87
|
+
if (!isMilestone) {
|
|
88
|
+
if (isBarRowStyle) {
|
|
89
|
+
if (barBgColor) {
|
|
90
|
+
vbStyle["--vxe-ui-gantt-view-task-bar-background-color"] = barBgColor;
|
|
91
|
+
}
|
|
92
|
+
if (barCompletedBgColor) {
|
|
93
|
+
vbStyle["--vxe-ui-gantt-view-task-bar-completed-background-color"] = barCompletedBgColor;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (barHtmlStyle) {
|
|
98
|
+
XEUtils.assign(vbStyle, barHtmlStyle);
|
|
99
|
+
}
|
|
100
|
+
let cbVNs = [];
|
|
101
|
+
if ($xeGantt.renderGanttTaskBarContent) {
|
|
102
|
+
cbVNs = $xeGantt.renderGanttTaskBarContent(h, ctParams, {
|
|
103
|
+
$gantt: $xeGantt,
|
|
104
|
+
$table: $xeTable,
|
|
105
|
+
rowid
|
|
106
|
+
});
|
|
107
|
+
} else {
|
|
108
|
+
const isSubview = !!(hasEnableConf(taskBarSubviewConfig, taskBarSubviewOpts) && hasSubviewTask(renderTaskType));
|
|
109
|
+
if (contentMethod) {
|
|
110
|
+
title = getStringValue(contentMethod({ row, title, scaleType: scaleUnit }));
|
|
111
|
+
}
|
|
112
|
+
const ctOns = {};
|
|
113
|
+
if (showTooltip) {
|
|
114
|
+
ctOns.mouseover = (evnt) => {
|
|
115
|
+
const { dragBarRow } = ganttInternalData;
|
|
116
|
+
const ttParams = Object.assign({ $event: evnt }, ctParams);
|
|
117
|
+
if (!dragBarRow) {
|
|
118
|
+
$xeGantt.triggerTaskBarTooltipEvent(evnt, ttParams);
|
|
119
|
+
}
|
|
120
|
+
$xeGantt.dispatchEvent("task-bar-mouseenter", ttParams, evnt);
|
|
121
|
+
};
|
|
122
|
+
ctOns.mouseleave = (evnt) => {
|
|
123
|
+
const { dragBarRow } = ganttInternalData;
|
|
124
|
+
const ttParams = Object.assign({ $event: evnt }, ctParams);
|
|
125
|
+
if (!dragBarRow) {
|
|
126
|
+
$xeGantt.handleTaskBarTooltipLeaveEvent(evnt, ttParams);
|
|
127
|
+
}
|
|
128
|
+
$xeGantt.dispatchEvent("task-bar-mouseleave", ttParams, evnt);
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (isSubview && treeConfig && rowChildren && rowChildren.length) {
|
|
132
|
+
if (isExpandTree) {
|
|
133
|
+
if (showOverview) {
|
|
134
|
+
cbVNs.push(
|
|
135
|
+
h("div", {
|
|
136
|
+
key: "vcso",
|
|
137
|
+
class: "vxe-gantt-view--chart-subview-wrapper is--overview"
|
|
138
|
+
}, [
|
|
139
|
+
h("div", {
|
|
140
|
+
key: rowid,
|
|
141
|
+
attrs: {
|
|
142
|
+
rowid
|
|
143
|
+
},
|
|
144
|
+
class: ["vxe-gantt-view--chart-subview-row", {
|
|
145
|
+
"is--progress": showProgress,
|
|
146
|
+
"is--round": barRound,
|
|
147
|
+
"is--move": moveable
|
|
148
|
+
}]
|
|
149
|
+
}, [
|
|
150
|
+
h("div", {
|
|
151
|
+
attrs: {
|
|
152
|
+
rowid
|
|
153
|
+
},
|
|
154
|
+
class: [taskBarOverviewSlot ? "vxe-gantt-view--chart-subview-custom-bar" : "vxe-gantt-view--chart-subview-bar", `is--${renderTaskType}`]
|
|
155
|
+
}, [
|
|
156
|
+
taskBarOverviewSlot ? h("div", {
|
|
157
|
+
key: "cbc",
|
|
158
|
+
class: "vxe-gantt-view--chart-subview-custom-bar-content-wrapper"
|
|
159
|
+
}, $xeGantt.callSlot(taskBarOverviewSlot, barParams, h)) : h("div", {
|
|
160
|
+
class: "vxe-gantt-view--chart-subview-bar-content-wrapper"
|
|
161
|
+
}, [
|
|
162
|
+
showContent ? h("div", {
|
|
163
|
+
class: "vxe-gantt-view--chart-content"
|
|
164
|
+
}, title) : renderEmptyElement($xeGantt)
|
|
165
|
+
])
|
|
166
|
+
])
|
|
167
|
+
])
|
|
168
|
+
])
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
const cbcVNs = [];
|
|
173
|
+
XEUtils.eachTree(rowChildren, (childRow) => {
|
|
174
|
+
const childBarParams = {
|
|
58
175
|
$gantt: $xeGantt,
|
|
59
176
|
source: sourceType,
|
|
60
177
|
type: viewType,
|
|
61
178
|
scaleType: scaleUnit,
|
|
62
|
-
row,
|
|
63
|
-
$rowIndex,
|
|
64
|
-
rowIndex,
|
|
65
|
-
_rowIndex
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (barHtmlStyle) {
|
|
96
|
-
XEUtils.assign(vbStyle, barHtmlStyle);
|
|
97
|
-
}
|
|
98
|
-
let cbVNs = [];
|
|
99
|
-
if ($xeGantt.renderGanttTaskBarContent) {
|
|
100
|
-
cbVNs = $xeGantt.renderGanttTaskBarContent(h, ctParams, {
|
|
101
|
-
$gantt: $xeGantt,
|
|
102
|
-
$table: $xeTable,
|
|
103
|
-
rowid
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
const isSubview = !!(hasEnableConf(taskBarSubviewConfig, taskBarSubviewOpts) && hasSubviewTask(renderTaskType));
|
|
108
|
-
if (contentMethod) {
|
|
109
|
-
title = getStringValue(contentMethod({ row, title, scaleType: scaleUnit }));
|
|
110
|
-
}
|
|
111
|
-
const ctOns = {};
|
|
112
|
-
if (showTooltip) {
|
|
113
|
-
ctOns.mouseover = (evnt) => {
|
|
114
|
-
const { dragBarRow } = ganttInternalData;
|
|
115
|
-
const ttParams = Object.assign({ $event: evnt }, ctParams);
|
|
116
|
-
if (!dragBarRow) {
|
|
117
|
-
$xeGantt.triggerTaskBarTooltipEvent(evnt, ttParams);
|
|
118
|
-
}
|
|
119
|
-
$xeGantt.dispatchEvent('task-bar-mouseenter', ttParams, evnt);
|
|
120
|
-
};
|
|
121
|
-
ctOns.mouseleave = (evnt) => {
|
|
122
|
-
const { dragBarRow } = ganttInternalData;
|
|
123
|
-
const ttParams = Object.assign({ $event: evnt }, ctParams);
|
|
124
|
-
if (!dragBarRow) {
|
|
125
|
-
$xeGantt.handleTaskBarTooltipLeaveEvent(evnt, ttParams);
|
|
126
|
-
}
|
|
127
|
-
$xeGantt.dispatchEvent('task-bar-mouseleave', ttParams, evnt);
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
if (isSubview && treeConfig && rowChildren && rowChildren.length) {
|
|
131
|
-
if (isExpandTree) {
|
|
132
|
-
if (showOverview) {
|
|
133
|
-
cbVNs.push(h('div', {
|
|
134
|
-
key: 'vcso',
|
|
135
|
-
class: 'vxe-gantt-view--chart-subview-wrapper is--overview'
|
|
136
|
-
}, [
|
|
137
|
-
h('div', {
|
|
138
|
-
key: rowid,
|
|
139
|
-
attrs: {
|
|
140
|
-
rowid: rowid
|
|
141
|
-
},
|
|
142
|
-
class: ['vxe-gantt-view--chart-subview-row', {
|
|
143
|
-
'is--progress': showProgress,
|
|
144
|
-
'is--round': barRound,
|
|
145
|
-
'is--move': moveable
|
|
146
|
-
}]
|
|
147
|
-
}, [
|
|
148
|
-
h('div', {
|
|
149
|
-
attrs: {
|
|
150
|
-
rowid: rowid
|
|
151
|
-
},
|
|
152
|
-
class: [taskBarOverviewSlot ? 'vxe-gantt-view--chart-subview-custom-bar' : 'vxe-gantt-view--chart-subview-bar', `is--${renderTaskType}`]
|
|
153
|
-
}, [
|
|
154
|
-
taskBarOverviewSlot
|
|
155
|
-
? h('div', {
|
|
156
|
-
key: 'cbc',
|
|
157
|
-
class: 'vxe-gantt-view--chart-subview-custom-bar-content-wrapper'
|
|
158
|
-
}, $xeGantt.callSlot(taskBarOverviewSlot, barParams, h))
|
|
159
|
-
: h('div', {
|
|
160
|
-
class: 'vxe-gantt-view--chart-subview-bar-content-wrapper'
|
|
161
|
-
}, [
|
|
162
|
-
showContent
|
|
163
|
-
? h('div', {
|
|
164
|
-
class: 'vxe-gantt-view--chart-content'
|
|
165
|
-
}, title)
|
|
166
|
-
: renderEmptyElement($xeGantt)
|
|
167
|
-
])
|
|
168
|
-
])
|
|
169
|
-
])
|
|
170
|
-
]));
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
const cbcVNs = [];
|
|
175
|
-
XEUtils.eachTree(rowChildren, childRow => {
|
|
176
|
-
const childBarParams = {
|
|
177
|
-
$gantt: $xeGantt,
|
|
178
|
-
source: sourceType,
|
|
179
|
-
type: viewType,
|
|
180
|
-
scaleType: scaleUnit,
|
|
181
|
-
row: childRow,
|
|
182
|
-
$rowIndex: $xeTable.getRowIndex(childRow),
|
|
183
|
-
rowIndex: $xeTable.getVMRowIndex(childRow),
|
|
184
|
-
_rowIndex: $xeTable.getVTRowIndex(childRow)
|
|
185
|
-
};
|
|
186
|
-
const isChildBarRowStyle = XEUtils.isFunction(subBarStyle);
|
|
187
|
-
const childBarStyObj = XEUtils.assign({}, (barStyle ? (isBarRowStyle ? barStyle(childBarParams) : barStyle) : {}) || {}, (subBarStyle ? (isChildBarRowStyle ? subBarStyle(childBarParams) : subBarStyle) : {}) || {});
|
|
188
|
-
const childRound = childBarStyObj.round;
|
|
189
|
-
const childBgColor = childBarStyObj.bgColor;
|
|
190
|
-
const childCompletedBgColor = childBarStyObj.completedBgColor;
|
|
191
|
-
const childBarHtmlStyle = childBarStyObj.style;
|
|
192
|
-
const childRowid = $xeTable.getRowid(childRow);
|
|
193
|
-
let childTitle = getStringValue(XEUtils.get(childRow, titleField));
|
|
194
|
-
const childProgressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(childRow, progressField)))) : 0;
|
|
195
|
-
const childRenderTaskType = getTaskType(XEUtils.get(childRow, typeField));
|
|
196
|
-
const isChildMilestone = !!(hasEnableConf(taskBarMilestoneConfig, taskBarMilestoneOpts) && hasMilestoneTask(childRenderTaskType));
|
|
197
|
-
const isChildSubview = !!(hasEnableConf(taskBarSubviewConfig, taskBarSubviewOpts) && hasSubviewTask(childRenderTaskType));
|
|
198
|
-
if (isChildSubview) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
const childVbStyle = {};
|
|
202
|
-
const childVpStyle = {
|
|
203
|
-
width: `${childProgressValue || 0}%`
|
|
204
|
-
};
|
|
205
|
-
if (!isChildMilestone) {
|
|
206
|
-
if (childBgColor) {
|
|
207
|
-
childVbStyle['--vxe-ui-gantt-view-task-bar-background-color'] = childBgColor;
|
|
208
|
-
}
|
|
209
|
-
if (childCompletedBgColor) {
|
|
210
|
-
childVpStyle['--vxe-ui-gantt-view-task-bar-completed-background-color'] = childCompletedBgColor;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
// 已废弃
|
|
214
|
-
if (childBarStyObj.top) {
|
|
215
|
-
childVbStyle.top = childBarStyObj.top;
|
|
216
|
-
}
|
|
217
|
-
// 已废弃
|
|
218
|
-
if (childBarHtmlStyle) {
|
|
219
|
-
XEUtils.assign(childVbStyle, childBarHtmlStyle);
|
|
220
|
-
}
|
|
221
|
-
const childCtParams = Object.assign({}, childBarParams);
|
|
222
|
-
if (contentMethod) {
|
|
223
|
-
childTitle = getStringValue(contentMethod({ row: childRow, title: childTitle, scaleType: scaleUnit }));
|
|
224
|
-
}
|
|
225
|
-
cbcVNs.push(h('div', {
|
|
226
|
-
key: childRowid,
|
|
227
|
-
attrs: {
|
|
228
|
-
rowid: childRowid
|
|
229
|
-
},
|
|
230
|
-
class: ['vxe-gantt-view--chart-subview-row', `is--${childRenderTaskType}`, {
|
|
231
|
-
'is--progress': showProgress,
|
|
232
|
-
'is--critical': showCriticalPath && criticalPathFlag && criticalRowMaps.has(childRowid),
|
|
233
|
-
'is--round': childRound,
|
|
234
|
-
'is--move': moveable,
|
|
235
|
-
'row--pending': !!pendingRowFlag && !!pendingRowMaps[childRowid]
|
|
236
|
-
}]
|
|
237
|
-
}, [
|
|
238
|
-
h('div', {
|
|
239
|
-
attrs: {
|
|
240
|
-
rowid: childRowid
|
|
241
|
-
},
|
|
242
|
-
class: [taskBarSlot ? 'vxe-gantt-view--chart-subview-custom-bar' : 'vxe-gantt-view--chart-subview-bar', `is--${childRenderTaskType}`],
|
|
243
|
-
style: childVbStyle,
|
|
244
|
-
on: {
|
|
245
|
-
click(evnt) {
|
|
246
|
-
evnt.stopPropagation();
|
|
247
|
-
$xeGantt.handleTaskBarClickEvent(evnt, childCtParams);
|
|
248
|
-
},
|
|
249
|
-
dblclick(evnt) {
|
|
250
|
-
evnt.stopPropagation();
|
|
251
|
-
$xeGantt.handleTaskBarDblclickEvent(evnt, childCtParams);
|
|
252
|
-
},
|
|
253
|
-
mousedown(evnt) {
|
|
254
|
-
evnt.stopPropagation();
|
|
255
|
-
if ($xeGantt.handleTaskBarModnEvent) {
|
|
256
|
-
$xeGantt.handleTaskBarModnEvent(evnt, childCtParams);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}, [
|
|
261
|
-
taskBarSlot
|
|
262
|
-
? h('div', {
|
|
263
|
-
key: 'cbc',
|
|
264
|
-
class: 'vxe-gantt-view--chart-subview-custom-bar-content-wrapper',
|
|
265
|
-
on: ctOns
|
|
266
|
-
}, $xeGantt.callSlot(taskBarSlot, childCtParams, h))
|
|
267
|
-
: h('div', {
|
|
268
|
-
class: 'vxe-gantt-view--chart-subview-bar-content-wrapper',
|
|
269
|
-
on: ctOns
|
|
270
|
-
}, [
|
|
271
|
-
showProgress
|
|
272
|
-
? h('div', {
|
|
273
|
-
class: 'vxe-gantt-view--chart-progress',
|
|
274
|
-
style: childVpStyle
|
|
275
|
-
})
|
|
276
|
-
: renderEmptyElement($xeGantt),
|
|
277
|
-
showContent
|
|
278
|
-
? h('div', {
|
|
279
|
-
class: 'vxe-gantt-view--chart-content'
|
|
280
|
-
}, childTitle)
|
|
281
|
-
: renderEmptyElement($xeGantt)
|
|
282
|
-
])
|
|
283
|
-
])
|
|
284
|
-
]));
|
|
285
|
-
}, { children: childrenField });
|
|
286
|
-
cbVNs.push(h('div', {
|
|
287
|
-
key: 'vcsc',
|
|
288
|
-
class: 'vxe-gantt-view--chart-subview-wrapper is--inline'
|
|
289
|
-
}, cbcVNs));
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
if (taskBarSlot) {
|
|
294
|
-
cbVNs.push(h('div', {
|
|
295
|
-
key: 'cbc',
|
|
296
|
-
class: 'vxe-gantt-view--chart-custom-bar-content-wrapper',
|
|
297
|
-
on: ctOns
|
|
298
|
-
}, $xeGantt.callSlot(taskBarSlot, barParams, h)));
|
|
299
|
-
}
|
|
300
|
-
else if (isMilestone) {
|
|
301
|
-
const { icon, iconStatus, iconStyle } = taskBarMilestoneOpts;
|
|
302
|
-
const tbmParams = { $gantt: $xeGantt, row };
|
|
303
|
-
cbVNs.push(h('div', {
|
|
304
|
-
key: 'vcm',
|
|
305
|
-
class: 'vxe-gantt-view--chart-milestone-wrapper',
|
|
306
|
-
on: ctOns
|
|
307
|
-
}, [
|
|
308
|
-
h('div', {
|
|
309
|
-
class: ['vxe-gantt-view--chart-milestone-icon', iconStatus ? `theme--${XEUtils.isFunction(iconStatus) ? iconStatus(tbmParams) : iconStatus}` : ''],
|
|
310
|
-
style: iconStyle ? Object.assign({}, XEUtils.isFunction(iconStyle) ? iconStyle(tbmParams) : iconStyle) : undefined
|
|
311
|
-
}, [
|
|
312
|
-
h('i', {
|
|
313
|
-
class: (icon ? (XEUtils.isFunction(icon) ? icon(tbmParams) : icon) : '') || getIcon().GANTT_VIEW_TASK_MILESTONE
|
|
314
|
-
})
|
|
315
|
-
]),
|
|
316
|
-
showContent
|
|
317
|
-
? h('div', {
|
|
318
|
-
class: 'vxe-gantt-view--chart-milestone-content'
|
|
319
|
-
}, title)
|
|
320
|
-
: renderEmptyElement($xeGantt)
|
|
321
|
-
]));
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
cbVNs.push(h('div', {
|
|
325
|
-
key: 'vbc',
|
|
326
|
-
class: 'vxe-gantt-view--chart-bar-content-wrapper',
|
|
327
|
-
on: ctOns
|
|
328
|
-
}, [
|
|
329
|
-
showProgress
|
|
330
|
-
? h('div', {
|
|
331
|
-
class: 'vxe-gantt-view--chart-progress',
|
|
332
|
-
style: vpStyle
|
|
333
|
-
})
|
|
334
|
-
: renderEmptyElement($xeGantt),
|
|
335
|
-
showContent
|
|
336
|
-
? h('div', {
|
|
337
|
-
class: 'vxe-gantt-view--chart-content'
|
|
338
|
-
}, title)
|
|
339
|
-
: renderEmptyElement($xeGantt)
|
|
340
|
-
]));
|
|
341
|
-
}
|
|
179
|
+
row: childRow,
|
|
180
|
+
$rowIndex: $xeTable.getRowIndex(childRow),
|
|
181
|
+
rowIndex: $xeTable.getVMRowIndex(childRow),
|
|
182
|
+
_rowIndex: $xeTable.getVTRowIndex(childRow)
|
|
183
|
+
};
|
|
184
|
+
const isChildBarRowStyle = XEUtils.isFunction(subBarStyle);
|
|
185
|
+
const childBarStyObj = XEUtils.assign(
|
|
186
|
+
{},
|
|
187
|
+
(barStyle ? isBarRowStyle ? barStyle(childBarParams) : barStyle : {}) || {},
|
|
188
|
+
(subBarStyle ? isChildBarRowStyle ? subBarStyle(childBarParams) : subBarStyle : {}) || {}
|
|
189
|
+
);
|
|
190
|
+
const childRound = childBarStyObj.round;
|
|
191
|
+
const childBgColor = childBarStyObj.bgColor;
|
|
192
|
+
const childCompletedBgColor = childBarStyObj.completedBgColor;
|
|
193
|
+
const childBarHtmlStyle = childBarStyObj.style;
|
|
194
|
+
const childRowid = $xeTable.getRowid(childRow);
|
|
195
|
+
let childTitle = getStringValue(XEUtils.get(childRow, titleField));
|
|
196
|
+
const childProgressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(childRow, progressField)))) : 0;
|
|
197
|
+
const childRenderTaskType = getTaskType(XEUtils.get(childRow, typeField));
|
|
198
|
+
const isChildMilestone = !!(hasEnableConf(taskBarMilestoneConfig, taskBarMilestoneOpts) && hasMilestoneTask(childRenderTaskType));
|
|
199
|
+
const isChildSubview = !!(hasEnableConf(taskBarSubviewConfig, taskBarSubviewOpts) && hasSubviewTask(childRenderTaskType));
|
|
200
|
+
if (isChildSubview) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const childVbStyle = {};
|
|
204
|
+
const childVpStyle = {
|
|
205
|
+
width: `${childProgressValue || 0}%`
|
|
206
|
+
};
|
|
207
|
+
if (!isChildMilestone) {
|
|
208
|
+
if (childBgColor) {
|
|
209
|
+
childVbStyle["--vxe-ui-gantt-view-task-bar-background-color"] = childBgColor;
|
|
342
210
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
key: rowid,
|
|
346
|
-
attrs: {
|
|
347
|
-
rowid
|
|
348
|
-
},
|
|
349
|
-
class: ['vxe-gantt-view--chart-row', `is--${renderTaskType}`, {
|
|
350
|
-
'is--progress': showProgress,
|
|
351
|
-
'is--critical': showCriticalPath && criticalPathFlag && criticalRowMaps.has(rowid),
|
|
352
|
-
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
|
|
353
|
-
'is--round': barRound,
|
|
354
|
-
'is--move': moveable
|
|
355
|
-
}],
|
|
356
|
-
style: {
|
|
357
|
-
height: `${cellHeight}px`
|
|
358
|
-
},
|
|
359
|
-
on: {
|
|
360
|
-
onDragstart(evnt) {
|
|
361
|
-
if (ganttInternalData.dragBarRow) {
|
|
362
|
-
evnt.preventDefault();
|
|
363
|
-
}
|
|
364
|
-
},
|
|
365
|
-
contextmenu(evnt) {
|
|
366
|
-
$xeGantt.handleTaskBarContextmenuEvent(evnt, ctParams);
|
|
367
|
-
}
|
|
211
|
+
if (childCompletedBgColor) {
|
|
212
|
+
childVpStyle["--vxe-ui-gantt-view-task-bar-completed-background-color"] = childCompletedBgColor;
|
|
368
213
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
214
|
+
}
|
|
215
|
+
if (childBarStyObj.top) {
|
|
216
|
+
childVbStyle.top = childBarStyObj.top;
|
|
217
|
+
}
|
|
218
|
+
if (childBarHtmlStyle) {
|
|
219
|
+
XEUtils.assign(childVbStyle, childBarHtmlStyle);
|
|
220
|
+
}
|
|
221
|
+
const childCtParams = { ...childBarParams };
|
|
222
|
+
if (contentMethod) {
|
|
223
|
+
childTitle = getStringValue(contentMethod({ row: childRow, title: childTitle, scaleType: scaleUnit }));
|
|
224
|
+
}
|
|
225
|
+
cbcVNs.push(
|
|
226
|
+
h("div", {
|
|
227
|
+
key: childRowid,
|
|
228
|
+
attrs: {
|
|
229
|
+
rowid: childRowid
|
|
230
|
+
},
|
|
231
|
+
class: ["vxe-gantt-view--chart-subview-row", `is--${childRenderTaskType}`, {
|
|
232
|
+
"is--progress": showProgress,
|
|
233
|
+
"is--critical": showCriticalPath && criticalPathFlag && criticalRowMaps.has(childRowid),
|
|
234
|
+
"is--round": childRound,
|
|
235
|
+
"is--move": moveable,
|
|
236
|
+
"row--pending": !!pendingRowFlag && !!pendingRowMaps[childRowid]
|
|
237
|
+
}]
|
|
238
|
+
}, [
|
|
239
|
+
h("div", {
|
|
376
240
|
attrs: {
|
|
377
|
-
|
|
241
|
+
rowid: childRowid
|
|
378
242
|
},
|
|
243
|
+
class: [taskBarSlot ? "vxe-gantt-view--chart-subview-custom-bar" : "vxe-gantt-view--chart-subview-bar", `is--${childRenderTaskType}`],
|
|
244
|
+
style: childVbStyle,
|
|
379
245
|
on: {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
246
|
+
click(evnt) {
|
|
247
|
+
evnt.stopPropagation();
|
|
248
|
+
$xeGantt.handleTaskBarClickEvent(evnt, childCtParams);
|
|
249
|
+
},
|
|
250
|
+
dblclick(evnt) {
|
|
251
|
+
evnt.stopPropagation();
|
|
252
|
+
$xeGantt.handleTaskBarDblclickEvent(evnt, childCtParams);
|
|
253
|
+
},
|
|
254
|
+
mousedown(evnt) {
|
|
255
|
+
evnt.stopPropagation();
|
|
256
|
+
if ($xeGantt.handleTaskBarModnEvent) {
|
|
257
|
+
$xeGantt.handleTaskBarModnEvent(evnt, childCtParams);
|
|
390
258
|
}
|
|
259
|
+
}
|
|
391
260
|
}
|
|
392
|
-
|
|
393
|
-
|
|
261
|
+
}, [
|
|
262
|
+
taskBarSlot ? h("div", {
|
|
263
|
+
key: "cbc",
|
|
264
|
+
class: "vxe-gantt-view--chart-subview-custom-bar-content-wrapper",
|
|
265
|
+
on: ctOns
|
|
266
|
+
}, $xeGantt.callSlot(taskBarSlot, childCtParams, h)) : h("div", {
|
|
267
|
+
class: "vxe-gantt-view--chart-subview-bar-content-wrapper",
|
|
268
|
+
on: ctOns
|
|
269
|
+
}, [
|
|
270
|
+
showProgress ? h("div", {
|
|
271
|
+
class: "vxe-gantt-view--chart-progress",
|
|
272
|
+
style: childVpStyle
|
|
273
|
+
}) : renderEmptyElement($xeGantt),
|
|
274
|
+
showContent ? h("div", {
|
|
275
|
+
class: "vxe-gantt-view--chart-content"
|
|
276
|
+
}, childTitle) : renderEmptyElement($xeGantt)
|
|
277
|
+
])
|
|
278
|
+
])
|
|
279
|
+
])
|
|
280
|
+
);
|
|
281
|
+
}, { children: childrenField });
|
|
282
|
+
cbVNs.push(
|
|
283
|
+
h("div", {
|
|
284
|
+
key: "vcsc",
|
|
285
|
+
class: "vxe-gantt-view--chart-subview-wrapper is--inline"
|
|
286
|
+
}, cbcVNs)
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
} else {
|
|
290
|
+
if (taskBarSlot) {
|
|
291
|
+
cbVNs.push(
|
|
292
|
+
h("div", {
|
|
293
|
+
key: "cbc",
|
|
294
|
+
class: "vxe-gantt-view--chart-custom-bar-content-wrapper",
|
|
295
|
+
on: ctOns
|
|
296
|
+
}, $xeGantt.callSlot(taskBarSlot, barParams, h))
|
|
297
|
+
);
|
|
298
|
+
} else if (isMilestone) {
|
|
299
|
+
const { icon, iconStatus, iconStyle } = taskBarMilestoneOpts;
|
|
300
|
+
const tbmParams = { $gantt: $xeGantt, row };
|
|
301
|
+
cbVNs.push(
|
|
302
|
+
h("div", {
|
|
303
|
+
key: "vcm",
|
|
304
|
+
class: "vxe-gantt-view--chart-milestone-wrapper",
|
|
305
|
+
on: ctOns
|
|
306
|
+
}, [
|
|
307
|
+
h("div", {
|
|
308
|
+
class: ["vxe-gantt-view--chart-milestone-icon", iconStatus ? `theme--${XEUtils.isFunction(iconStatus) ? iconStatus(tbmParams) : iconStatus}` : ""],
|
|
309
|
+
style: iconStyle ? Object.assign({}, XEUtils.isFunction(iconStyle) ? iconStyle(tbmParams) : iconStyle) : void 0
|
|
310
|
+
}, [
|
|
311
|
+
h("i", {
|
|
312
|
+
class: (icon ? XEUtils.isFunction(icon) ? icon(tbmParams) : icon : "") || getIcon().GANTT_VIEW_TASK_MILESTONE
|
|
313
|
+
})
|
|
314
|
+
]),
|
|
315
|
+
showContent ? h("div", {
|
|
316
|
+
class: "vxe-gantt-view--chart-milestone-content"
|
|
317
|
+
}, title) : renderEmptyElement($xeGantt)
|
|
318
|
+
])
|
|
319
|
+
);
|
|
320
|
+
} else {
|
|
321
|
+
cbVNs.push(
|
|
322
|
+
h("div", {
|
|
323
|
+
key: "vbc",
|
|
324
|
+
class: "vxe-gantt-view--chart-bar-content-wrapper",
|
|
325
|
+
on: ctOns
|
|
326
|
+
}, [
|
|
327
|
+
showProgress ? h("div", {
|
|
328
|
+
class: "vxe-gantt-view--chart-progress",
|
|
329
|
+
style: vpStyle
|
|
330
|
+
}) : renderEmptyElement($xeGantt),
|
|
331
|
+
showContent ? h("div", {
|
|
332
|
+
class: "vxe-gantt-view--chart-content"
|
|
333
|
+
}, title) : renderEmptyElement($xeGantt)
|
|
334
|
+
])
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return h("div", {
|
|
340
|
+
key: rowid,
|
|
341
|
+
attrs: {
|
|
342
|
+
rowid
|
|
394
343
|
},
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
const { fullAllDataRowIdData, treeExpandedMaps } = tableInternalData;
|
|
405
|
-
const treeOpts = $xeTable.computeTreeOpts;
|
|
406
|
-
const { transform } = treeOpts;
|
|
407
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
408
|
-
const { scrollYLoad } = ganttViewReactData;
|
|
409
|
-
const trVNs = [];
|
|
410
|
-
tableData.forEach((row, $rowIndex) => {
|
|
411
|
-
const rowid = $xeTable.getRowid(row);
|
|
412
|
-
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
413
|
-
let rowIndex = $rowIndex;
|
|
414
|
-
let _rowIndex = -1;
|
|
415
|
-
if (rowRest) {
|
|
416
|
-
rowIndex = rowRest.index;
|
|
417
|
-
_rowIndex = rowRest._index;
|
|
418
|
-
}
|
|
419
|
-
let isExpandTree = false;
|
|
420
|
-
let rowChildren = [];
|
|
421
|
-
if (treeConfig) {
|
|
422
|
-
rowChildren = row[childrenField];
|
|
423
|
-
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
424
|
-
}
|
|
425
|
-
trVNs.push(_vm.renderTaskBar(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, rowChildren, isExpandTree));
|
|
426
|
-
// 如果是树形表格
|
|
427
|
-
if (treeConfig && isExpandTree && !scrollYLoad && !transform) {
|
|
428
|
-
trVNs.push(..._vm.renderTaskRows(h, $xeTable, rowChildren));
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
return trVNs;
|
|
344
|
+
class: ["vxe-gantt-view--chart-row", `is--${renderTaskType}`, {
|
|
345
|
+
"is--progress": showProgress,
|
|
346
|
+
"is--critical": showCriticalPath && criticalPathFlag && criticalRowMaps.has(rowid),
|
|
347
|
+
"row--pending": !!pendingRowFlag && !!pendingRowMaps[rowid],
|
|
348
|
+
"is--round": barRound,
|
|
349
|
+
"is--move": moveable
|
|
350
|
+
}],
|
|
351
|
+
style: {
|
|
352
|
+
height: `${cellHeight}px`
|
|
432
353
|
},
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
const { dragLinkFromStore } = ganttReactData;
|
|
443
|
-
const { tableData } = ganttViewReactData;
|
|
444
|
-
const taskLinkOpts = $xeGantt.computeTaskLinkOpts;
|
|
445
|
-
const taskBarOpts = $xeGantt.computeTaskBarOpts;
|
|
446
|
-
const nowLineLeft = $xeGanttView.computeNowLineLeft;
|
|
447
|
-
const { isCurrent, isHover } = taskLinkOpts;
|
|
448
|
-
const { linkCreatable } = taskBarOpts;
|
|
449
|
-
const taskNowLineSlot = ganttSlots.taskNowLine || ganttSlots['task-now-line'];
|
|
450
|
-
return h('div', {
|
|
451
|
-
ref: 'refElem',
|
|
452
|
-
class: ['vxe-gantt-view--chart-wrapper', {
|
|
453
|
-
'is--cl-drag': dragLinkFromStore.rowid
|
|
454
|
-
}]
|
|
455
|
-
}, [
|
|
456
|
-
nowLineLeft > 0
|
|
457
|
-
? h('div', {
|
|
458
|
-
ref: 'refNowLineElem',
|
|
459
|
-
class: 'vxe-gantt-view--chart-now-line',
|
|
460
|
-
style: {
|
|
461
|
-
left: nowLineLeft + 'px'
|
|
462
|
-
}
|
|
463
|
-
}, taskNowLineSlot ? taskNowLineSlot({}) : [])
|
|
464
|
-
: renderEmptyElement($xeGantt),
|
|
465
|
-
$xeGantt.renderGanttTaskChartBefores
|
|
466
|
-
? h('div', {
|
|
467
|
-
ref: 'refChartBeforeWrapperElem',
|
|
468
|
-
class: ['vxe-gantt-view--chart-before-wrapper', {
|
|
469
|
-
'link--current': isCurrent,
|
|
470
|
-
'link--hover': isHover
|
|
471
|
-
}]
|
|
472
|
-
}, $xeTable && isEnableConf(taskLinkOpts) ? $xeGantt.renderGanttTaskChartBefores(h) : [])
|
|
473
|
-
: renderEmptyElement($xeGantt),
|
|
474
|
-
h('div', {
|
|
475
|
-
ref: 'refTaskWrapperElem',
|
|
476
|
-
class: ['vxe-gantt-view--chart-task-wrapper', {
|
|
477
|
-
'link--current': isCurrent,
|
|
478
|
-
'link--create': linkCreatable
|
|
479
|
-
}]
|
|
480
|
-
}, $xeTable ? _vm.renderTaskRows(h, $xeTable, tableData) : []),
|
|
481
|
-
$xeGantt.renderGanttTaskChartAfters
|
|
482
|
-
? h('div', {
|
|
483
|
-
ref: 'refChartAfterWrapperElem',
|
|
484
|
-
class: 'vxe-gantt-view--chart-after-wrapper'
|
|
485
|
-
}, $xeTable && isEnableConf(taskLinkOpts) ? $xeGantt.renderGanttTaskChartAfters(h) : [])
|
|
486
|
-
: renderEmptyElement($xeGantt)
|
|
487
|
-
]);
|
|
354
|
+
on: {
|
|
355
|
+
onDragstart(evnt) {
|
|
356
|
+
if (ganttInternalData.dragBarRow) {
|
|
357
|
+
evnt.preventDefault();
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
contextmenu(evnt) {
|
|
361
|
+
$xeGantt.handleTaskBarContextmenuEvent(evnt, ctParams);
|
|
362
|
+
}
|
|
488
363
|
}
|
|
364
|
+
}, [
|
|
365
|
+
h("div", {
|
|
366
|
+
class: [taskBarSlot ? "vxe-gantt-view--chart-custom-bar" : "vxe-gantt-view--chart-bar", `is--${renderTaskType}`, {
|
|
367
|
+
"is--active": activeBarRowid === rowid,
|
|
368
|
+
"active--link": activeLink && (rowid === `${activeLink.from}` || rowid === `${activeLink.to}`)
|
|
369
|
+
}],
|
|
370
|
+
style: vbStyle,
|
|
371
|
+
attrs: {
|
|
372
|
+
rowid
|
|
373
|
+
},
|
|
374
|
+
on: {
|
|
375
|
+
click(evnt) {
|
|
376
|
+
$xeGantt.handleTaskBarClickEvent(evnt, barParams);
|
|
377
|
+
},
|
|
378
|
+
dblclick(evnt) {
|
|
379
|
+
$xeGantt.handleTaskBarDblclickEvent(evnt, barParams);
|
|
380
|
+
},
|
|
381
|
+
mousedown(evnt) {
|
|
382
|
+
if ($xeGantt.handleTaskBarModnEvent) {
|
|
383
|
+
$xeGantt.handleTaskBarModnEvent(evnt, barParams);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}, cbVNs)
|
|
388
|
+
]);
|
|
489
389
|
},
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
390
|
+
renderTaskRows(h, $xeTable, tableData) {
|
|
391
|
+
const _vm = this;
|
|
392
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
393
|
+
const ganttViewReactData = $xeGanttView.reactData;
|
|
394
|
+
const tableProps = $xeTable;
|
|
395
|
+
const { treeConfig } = tableProps;
|
|
396
|
+
const tableReactData = $xeTable.getReactData();
|
|
397
|
+
const { treeExpandedFlag } = tableReactData;
|
|
398
|
+
const tableInternalData = $xeTable.getInternalData();
|
|
399
|
+
const { fullAllDataRowIdData, treeExpandedMaps } = tableInternalData;
|
|
400
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
401
|
+
const { transform } = treeOpts;
|
|
402
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
403
|
+
const { scrollYLoad } = ganttViewReactData;
|
|
404
|
+
const trVNs = [];
|
|
405
|
+
tableData.forEach((row, $rowIndex) => {
|
|
406
|
+
const rowid = $xeTable.getRowid(row);
|
|
407
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
408
|
+
let rowIndex = $rowIndex;
|
|
409
|
+
let _rowIndex = -1;
|
|
410
|
+
if (rowRest) {
|
|
411
|
+
rowIndex = rowRest.index;
|
|
412
|
+
_rowIndex = rowRest._index;
|
|
413
|
+
}
|
|
414
|
+
let isExpandTree = false;
|
|
415
|
+
let rowChildren = [];
|
|
416
|
+
if (treeConfig) {
|
|
417
|
+
rowChildren = row[childrenField];
|
|
418
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
419
|
+
}
|
|
420
|
+
trVNs.push(_vm.renderTaskBar(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, rowChildren, isExpandTree));
|
|
421
|
+
if (treeConfig && isExpandTree && !scrollYLoad && !transform) {
|
|
422
|
+
trVNs.push(..._vm.renderTaskRows(h, $xeTable, rowChildren));
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
return trVNs;
|
|
511
426
|
},
|
|
512
|
-
|
|
513
|
-
|
|
427
|
+
renderVN(h) {
|
|
428
|
+
const _vm = this;
|
|
429
|
+
const $xeGantt = _vm.$xeGantt;
|
|
430
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
431
|
+
const ganttReactData = $xeGantt.reactData;
|
|
432
|
+
const ganttViewInternalData = $xeGanttView.internalData;
|
|
433
|
+
const ganttViewReactData = $xeGanttView.reactData;
|
|
434
|
+
const $xeTable = ganttViewInternalData.xeTable;
|
|
435
|
+
const ganttSlots = $xeGantt.$scopedSlots;
|
|
436
|
+
const { dragLinkFromStore } = ganttReactData;
|
|
437
|
+
const { tableData } = ganttViewReactData;
|
|
438
|
+
const taskLinkOpts = $xeGantt.computeTaskLinkOpts;
|
|
439
|
+
const taskBarOpts = $xeGantt.computeTaskBarOpts;
|
|
440
|
+
const nowLineLeft = $xeGanttView.computeNowLineLeft;
|
|
441
|
+
const { isCurrent, isHover } = taskLinkOpts;
|
|
442
|
+
const { linkCreatable } = taskBarOpts;
|
|
443
|
+
const taskNowLineSlot = ganttSlots.taskNowLine || ganttSlots["task-now-line"];
|
|
444
|
+
return h("div", {
|
|
445
|
+
ref: "refElem",
|
|
446
|
+
class: ["vxe-gantt-view--chart-wrapper", {
|
|
447
|
+
"is--cl-drag": dragLinkFromStore.rowid
|
|
448
|
+
}]
|
|
449
|
+
}, [
|
|
450
|
+
nowLineLeft > 0 ? h("div", {
|
|
451
|
+
ref: "refNowLineElem",
|
|
452
|
+
class: "vxe-gantt-view--chart-now-line",
|
|
453
|
+
style: {
|
|
454
|
+
left: nowLineLeft + "px"
|
|
455
|
+
}
|
|
456
|
+
}, taskNowLineSlot ? taskNowLineSlot({}) : []) : renderEmptyElement($xeGantt),
|
|
457
|
+
$xeGantt.renderGanttTaskChartBefores ? h("div", {
|
|
458
|
+
ref: "refChartBeforeWrapperElem",
|
|
459
|
+
class: ["vxe-gantt-view--chart-before-wrapper", {
|
|
460
|
+
"link--current": isCurrent,
|
|
461
|
+
"link--hover": isHover
|
|
462
|
+
}]
|
|
463
|
+
}, $xeTable && isEnableConf(taskLinkOpts) ? $xeGantt.renderGanttTaskChartBefores(h) : []) : renderEmptyElement($xeGantt),
|
|
464
|
+
h("div", {
|
|
465
|
+
ref: "refTaskWrapperElem",
|
|
466
|
+
class: ["vxe-gantt-view--chart-task-wrapper", {
|
|
467
|
+
"link--current": isCurrent,
|
|
468
|
+
"link--create": linkCreatable
|
|
469
|
+
}]
|
|
470
|
+
}, $xeTable ? _vm.renderTaskRows(h, $xeTable, tableData) : []),
|
|
471
|
+
$xeGantt.renderGanttTaskChartAfters ? h("div", {
|
|
472
|
+
ref: "refChartAfterWrapperElem",
|
|
473
|
+
class: "vxe-gantt-view--chart-after-wrapper"
|
|
474
|
+
}, $xeTable && isEnableConf(taskLinkOpts) ? $xeGantt.renderGanttTaskChartAfters(h) : []) : renderEmptyElement($xeGantt)
|
|
475
|
+
]);
|
|
514
476
|
}
|
|
477
|
+
},
|
|
478
|
+
mounted() {
|
|
479
|
+
const _vm = this;
|
|
480
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
481
|
+
const ganttViewInternalData = $xeGanttView.internalData;
|
|
482
|
+
const { elemStore } = ganttViewInternalData;
|
|
483
|
+
const prefix = "main-chart-";
|
|
484
|
+
elemStore[`${prefix}now-line`] = _vm.$refs.refNowLineElem;
|
|
485
|
+
elemStore[`${prefix}task-wrapper`] = _vm.$refs.refTaskWrapperElem;
|
|
486
|
+
elemStore[`${prefix}before-wrapper`] = _vm.$refs.refChartBeforeWrapperElem;
|
|
487
|
+
elemStore[`${prefix}after-wrapper`] = _vm.$refs.refChartAfterWrapperElem;
|
|
488
|
+
},
|
|
489
|
+
destroyed() {
|
|
490
|
+
const _vm = this;
|
|
491
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
492
|
+
const ganttViewInternalData = $xeGanttView.internalData;
|
|
493
|
+
const { elemStore } = ganttViewInternalData;
|
|
494
|
+
const prefix = "main-chart-";
|
|
495
|
+
elemStore[`${prefix}now-line`] = null;
|
|
496
|
+
elemStore[`${prefix}task-wrapper`] = null;
|
|
497
|
+
elemStore[`${prefix}before-wrapper`] = null;
|
|
498
|
+
elemStore[`${prefix}after-wrapper`] = null;
|
|
499
|
+
},
|
|
500
|
+
render(h) {
|
|
501
|
+
return this.renderVN(h);
|
|
502
|
+
}
|
|
515
503
|
});
|
|
504
|
+
export {
|
|
505
|
+
gantt_chart_default as default
|
|
506
|
+
};
|