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,44 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty
|
|
4
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var gantt_view_exports = {};
|
|
30
|
+
__export(gantt_view_exports, {
|
|
31
|
+
default: () => gantt_view_default,
|
|
32
|
+
handleCriticalPath: () => handleCriticalPath
|
|
5
33
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
25
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
26
|
-
var getConfig = _core.VxeUI.getConfig,
|
|
27
|
-
domUtils = _core.VxeUI.domUtils,
|
|
28
|
-
globalResize = _core.VxeUI.globalResize,
|
|
29
|
-
globalEvents = _core.VxeUI.globalEvents,
|
|
30
|
-
renderEmptyElement = _core.VxeUI.renderEmptyElement;
|
|
31
|
-
var FinishToStart = _static.VxeGanttDependencyType.FinishToStart,
|
|
32
|
-
StartToFinish = _static.VxeGanttDependencyType.StartToFinish,
|
|
33
|
-
StartToStart = _static.VxeGanttDependencyType.StartToStart,
|
|
34
|
-
FinishToFinish = _static.VxeGanttDependencyType.FinishToFinish;
|
|
35
|
-
var sourceType = 'gantt';
|
|
36
|
-
var secondMs = 1000;
|
|
37
|
-
var minuteMs = 1000 * 60;
|
|
38
|
-
var hourMs = 1000 * 60 * 60;
|
|
39
|
-
var dayMs = hourMs * 24;
|
|
34
|
+
module.exports = __toCommonJS(gantt_view_exports);
|
|
35
|
+
var import_comp = require("../../ui/src/comp");
|
|
36
|
+
var import_core = require("@vxe-ui/core");
|
|
37
|
+
var import_utils = require("../../ui/src/utils");
|
|
38
|
+
var import_dom = require("../../ui/src/dom");
|
|
39
|
+
var import_util = require("./util");
|
|
40
|
+
var import_static = require("./static");
|
|
41
|
+
var import_xe_utils = __toESM(require("xe-utils"));
|
|
42
|
+
var import_gantt_header = __toESM(require("./gantt-header"));
|
|
43
|
+
var import_gantt_body = __toESM(require("./gantt-body"));
|
|
44
|
+
var import_gantt_footer = __toESM(require("./gantt-footer"));
|
|
45
|
+
const { getConfig, domUtils, globalResize, globalEvents, renderEmptyElement } = import_core.VxeUI;
|
|
46
|
+
const { FinishToStart, StartToFinish, StartToStart, FinishToFinish } = import_static.VxeGanttDependencyType;
|
|
47
|
+
const sourceType = "gantt";
|
|
48
|
+
const secondMs = 1e3;
|
|
49
|
+
const minuteMs = 1e3 * 60;
|
|
50
|
+
const hourMs = 1e3 * 60 * 60;
|
|
51
|
+
const dayMs = hourMs * 24;
|
|
40
52
|
function getTaskLinkKey(from, to, type) {
|
|
41
|
-
return from +
|
|
53
|
+
return from + "_" + to + "_" + (type || 0);
|
|
42
54
|
}
|
|
43
55
|
function createInternalData() {
|
|
44
56
|
return {
|
|
@@ -125,71 +137,60 @@ function createReactData() {
|
|
|
125
137
|
viewCellWidth: 40
|
|
126
138
|
};
|
|
127
139
|
}
|
|
128
|
-
|
|
129
|
-
// const maxXWidth = 5e6
|
|
140
|
+
const maxYHeight = 5e6;
|
|
130
141
|
function parseStringDate($xeGanttView, dateValue) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return
|
|
142
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
143
|
+
const dateFormat = $xeGantt.computeDateFormat;
|
|
144
|
+
return import_xe_utils.default.toStringDate(dateValue, dateFormat || null);
|
|
134
145
|
}
|
|
135
146
|
function updateTodayData($xeGanttView) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
148
|
+
const internalData = $xeGanttView.internalData;
|
|
149
|
+
const ganttReactData = $xeGantt.reactData;
|
|
150
|
+
const { taskScaleList } = ganttReactData;
|
|
151
|
+
const minScale = $xeGantt.computeMinScale;
|
|
141
152
|
if (minScale) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
M = _XEUtils$toDateString2[1],
|
|
151
|
-
MM = _XEUtils$toDateString2[2],
|
|
152
|
-
dd = _XEUtils$toDateString2[3],
|
|
153
|
-
HH = _XEUtils$toDateString2[4],
|
|
154
|
-
mm = _XEUtils$toDateString2[5],
|
|
155
|
-
ss = _XEUtils$toDateString2[6];
|
|
156
|
-
var e = itemDate.getDay();
|
|
157
|
-
var E = e + 1;
|
|
158
|
-
var q = Math.ceil((itemDate.getMonth() + 1) / 3);
|
|
159
|
-
var W = "".concat(_xeUtils.default.getYearWeek(itemDate, weekScale ? weekScale.startDay : undefined));
|
|
153
|
+
const weekScale = taskScaleList.find((item) => item.type === "week");
|
|
154
|
+
const isMinWeek = minScale.type === "week";
|
|
155
|
+
const itemDate = /* @__PURE__ */ new Date();
|
|
156
|
+
let [yyyy, M, MM, dd, HH, mm, ss] = import_xe_utils.default.toDateString(itemDate, "yyyy-M-MM-dd-HH-mm-ss").split("-");
|
|
157
|
+
const e = itemDate.getDay();
|
|
158
|
+
const E = e + 1;
|
|
159
|
+
const q = Math.ceil((itemDate.getMonth() + 1) / 3);
|
|
160
|
+
const W = `${import_xe_utils.default.getYearWeek(itemDate, weekScale ? weekScale.startDay : void 0)}`;
|
|
160
161
|
if (isMinWeek && checkWeekOfsetYear(W, M)) {
|
|
161
|
-
yyyy =
|
|
162
|
-
M =
|
|
163
|
-
MM =
|
|
162
|
+
yyyy = `${Number(yyyy) + 1}`;
|
|
163
|
+
M = "1";
|
|
164
|
+
MM = "0" + M;
|
|
164
165
|
}
|
|
165
166
|
ganttReactData.nowTime = itemDate.getTime();
|
|
166
167
|
internalData.todayDateMaps = {
|
|
167
168
|
year: yyyy,
|
|
168
|
-
quarter:
|
|
169
|
-
month:
|
|
170
|
-
week:
|
|
171
|
-
day:
|
|
172
|
-
date:
|
|
173
|
-
hour:
|
|
174
|
-
minute:
|
|
175
|
-
second:
|
|
169
|
+
quarter: `${yyyy}_q${q}`,
|
|
170
|
+
month: `${yyyy}_${MM}`,
|
|
171
|
+
week: `${yyyy}_W${W}`,
|
|
172
|
+
day: `${yyyy}_${MM}_${dd}_E${E}`,
|
|
173
|
+
date: `${yyyy}_${MM}_${dd}`,
|
|
174
|
+
hour: `${yyyy}_${MM}_${dd}_${HH}`,
|
|
175
|
+
minute: `${yyyy}_${MM}_${dd}_${HH}_${mm}`,
|
|
176
|
+
second: `${yyyy}_${MM}_${dd}_${HH}_${mm}_${ss}`
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
179
|
}
|
|
179
180
|
function handleColumnHeader($xeGanttView) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
181
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
182
|
+
const ganttReactData = $xeGantt.reactData;
|
|
183
|
+
const { taskScaleList } = ganttReactData;
|
|
184
|
+
const scaleUnit = $xeGantt.computeScaleUnit;
|
|
185
|
+
const minScale = $xeGantt.computeMinScale;
|
|
186
|
+
const weekScale = $xeGantt.computeWeekScale;
|
|
187
|
+
const scaleDateList = $xeGanttView.computeScaleDateList;
|
|
188
|
+
const scaleStep = $xeGantt.computeScaleStep;
|
|
189
|
+
const weekStartDay = weekScale ? weekScale.startDay : void 0;
|
|
190
|
+
const fullCols = [];
|
|
191
|
+
const groupCols = [];
|
|
191
192
|
if (minScale && scaleUnit && scaleDateList.length) {
|
|
192
|
-
|
|
193
|
+
const renderListMaps = {
|
|
193
194
|
year: [],
|
|
194
195
|
quarter: [],
|
|
195
196
|
month: [],
|
|
@@ -200,7 +201,7 @@ function handleColumnHeader($xeGanttView) {
|
|
|
200
201
|
minute: [],
|
|
201
202
|
second: []
|
|
202
203
|
};
|
|
203
|
-
|
|
204
|
+
const tempTypeMaps = {
|
|
204
205
|
year: {},
|
|
205
206
|
quarter: {},
|
|
206
207
|
month: {},
|
|
@@ -211,14 +212,14 @@ function handleColumnHeader($xeGanttView) {
|
|
|
211
212
|
minute: {},
|
|
212
213
|
second: {}
|
|
213
214
|
};
|
|
214
|
-
|
|
215
|
-
|
|
215
|
+
const isMinWeek = minScale.type === "week";
|
|
216
|
+
const handleData = (type, colMaps, minCol) => {
|
|
216
217
|
if (minScale.type === type) {
|
|
217
218
|
return;
|
|
218
219
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
const currCol = colMaps[type];
|
|
221
|
+
const currKey = `${currCol.field}`;
|
|
222
|
+
let currGpCol = tempTypeMaps[type][currKey];
|
|
222
223
|
if (!currGpCol) {
|
|
223
224
|
currGpCol = currCol;
|
|
224
225
|
tempTypeMaps[type][currKey] = currGpCol;
|
|
@@ -231,605 +232,526 @@ function handleColumnHeader($xeGanttView) {
|
|
|
231
232
|
currGpCol.children.push(minCol);
|
|
232
233
|
}
|
|
233
234
|
};
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
d = _XEUtils$toDateString4[4],
|
|
242
|
-
dd = _XEUtils$toDateString4[5],
|
|
243
|
-
H = _XEUtils$toDateString4[6],
|
|
244
|
-
HH = _XEUtils$toDateString4[7],
|
|
245
|
-
m = _XEUtils$toDateString4[8],
|
|
246
|
-
mm = _XEUtils$toDateString4[9],
|
|
247
|
-
s = _XEUtils$toDateString4[10],
|
|
248
|
-
ss = _XEUtils$toDateString4[11];
|
|
249
|
-
var e = date.getDay();
|
|
250
|
-
var E = e + 1;
|
|
251
|
-
var q = Math.ceil((date.getMonth() + 1) / 3);
|
|
252
|
-
var W = "".concat(_xeUtils.default.getYearWeek(date, weekScale ? weekScale.startDay : undefined));
|
|
253
|
-
var WW = _xeUtils.default.padStart(W, 2, '0');
|
|
235
|
+
const createDateObj = (date) => {
|
|
236
|
+
let [yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss] = import_xe_utils.default.toDateString(date, "yy-yyyy-M-MM-d-dd-H-HH-m-mm-s-ss").split("-");
|
|
237
|
+
const e = date.getDay();
|
|
238
|
+
const E = e + 1;
|
|
239
|
+
const q = Math.ceil((date.getMonth() + 1) / 3);
|
|
240
|
+
const W = `${import_xe_utils.default.getYearWeek(date, weekScale ? weekScale.startDay : void 0)}`;
|
|
241
|
+
const WW = import_xe_utils.default.padStart(W, 2, "0");
|
|
254
242
|
if (isMinWeek && checkWeekOfsetYear(W, M)) {
|
|
255
|
-
yyyy =
|
|
256
|
-
M =
|
|
257
|
-
MM =
|
|
258
|
-
}
|
|
259
|
-
return {
|
|
260
|
-
date: date,
|
|
261
|
-
yy: yy,
|
|
262
|
-
yyyy: yyyy,
|
|
263
|
-
M: M,
|
|
264
|
-
MM: MM,
|
|
265
|
-
d: d,
|
|
266
|
-
dd: dd,
|
|
267
|
-
H: H,
|
|
268
|
-
HH: HH,
|
|
269
|
-
m: m,
|
|
270
|
-
mm: mm,
|
|
271
|
-
s: s,
|
|
272
|
-
ss: ss,
|
|
273
|
-
q: q,
|
|
274
|
-
W: W,
|
|
275
|
-
WW: WW,
|
|
276
|
-
E: E,
|
|
277
|
-
e: e
|
|
278
|
-
};
|
|
243
|
+
yyyy = `${Number(yyyy) + 1}`;
|
|
244
|
+
M = "1";
|
|
245
|
+
MM = "0" + M;
|
|
246
|
+
}
|
|
247
|
+
return { date, yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss, q, W, WW, E, e };
|
|
279
248
|
};
|
|
280
|
-
for (
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
HH = dateObj.HH,
|
|
287
|
-
mm = dateObj.mm,
|
|
288
|
-
ss = dateObj.ss,
|
|
289
|
-
q = dateObj.q,
|
|
290
|
-
W = dateObj.W,
|
|
291
|
-
E = dateObj.E;
|
|
292
|
-
var startDateObj = dateObj;
|
|
293
|
-
var colMaps = {
|
|
249
|
+
for (let i = 0; i < scaleDateList.length; i++) {
|
|
250
|
+
const itemDate = scaleDateList[i];
|
|
251
|
+
const dateObj = createDateObj(itemDate);
|
|
252
|
+
const { yyyy, MM, dd, HH, mm, ss, q, W, E } = dateObj;
|
|
253
|
+
const startDateObj = dateObj;
|
|
254
|
+
const colMaps = {
|
|
294
255
|
year: {
|
|
295
256
|
field: yyyy,
|
|
296
257
|
title: yyyy,
|
|
297
|
-
dateObj
|
|
298
|
-
startDateObj
|
|
299
|
-
endDateObj: scaleStep > 1 ? createDateObj(
|
|
258
|
+
dateObj,
|
|
259
|
+
startDateObj,
|
|
260
|
+
endDateObj: scaleStep > 1 ? createDateObj(import_xe_utils.default.getWhatYear(itemDate, scaleStep - 1)) : startDateObj
|
|
300
261
|
},
|
|
301
262
|
quarter: {
|
|
302
|
-
field:
|
|
303
|
-
title:
|
|
304
|
-
dateObj
|
|
305
|
-
startDateObj
|
|
306
|
-
endDateObj: scaleStep > 1 ? createDateObj(
|
|
263
|
+
field: `${yyyy}_q${q}`,
|
|
264
|
+
title: `${q}`,
|
|
265
|
+
dateObj,
|
|
266
|
+
startDateObj,
|
|
267
|
+
endDateObj: scaleStep > 1 ? createDateObj(import_xe_utils.default.getWhatQuarter(itemDate, scaleStep - 1)) : startDateObj
|
|
307
268
|
},
|
|
308
269
|
month: {
|
|
309
|
-
field:
|
|
270
|
+
field: `${yyyy}_${MM}`,
|
|
310
271
|
title: MM,
|
|
311
|
-
dateObj
|
|
312
|
-
startDateObj
|
|
313
|
-
endDateObj: scaleStep > 1 ? createDateObj(
|
|
272
|
+
dateObj,
|
|
273
|
+
startDateObj,
|
|
274
|
+
endDateObj: scaleStep > 1 ? createDateObj(import_xe_utils.default.getWhatMonth(itemDate, scaleStep - 1)) : startDateObj
|
|
314
275
|
},
|
|
315
276
|
week: {
|
|
316
|
-
field:
|
|
317
|
-
title:
|
|
318
|
-
dateObj
|
|
319
|
-
startDateObj
|
|
320
|
-
endDateObj: scaleStep > 1 ? createDateObj(
|
|
277
|
+
field: `${yyyy}_W${W}`,
|
|
278
|
+
title: `${W}`,
|
|
279
|
+
dateObj,
|
|
280
|
+
startDateObj,
|
|
281
|
+
endDateObj: scaleStep > 1 ? createDateObj(import_xe_utils.default.getWhatWeek(itemDate, scaleStep - 1, weekStartDay, weekStartDay)) : startDateObj
|
|
321
282
|
},
|
|
322
283
|
day: {
|
|
323
|
-
field:
|
|
324
|
-
title:
|
|
325
|
-
dateObj
|
|
326
|
-
startDateObj
|
|
327
|
-
endDateObj: scaleStep > 1 ? createDateObj(
|
|
284
|
+
field: `${yyyy}_${MM}_${dd}_E${E}`,
|
|
285
|
+
title: `${E}`,
|
|
286
|
+
dateObj,
|
|
287
|
+
startDateObj,
|
|
288
|
+
endDateObj: scaleStep > 1 ? createDateObj(import_xe_utils.default.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
|
|
328
289
|
},
|
|
329
290
|
date: {
|
|
330
|
-
field:
|
|
291
|
+
field: `${yyyy}_${MM}_${dd}`,
|
|
331
292
|
title: dd,
|
|
332
|
-
dateObj
|
|
333
|
-
startDateObj
|
|
334
|
-
endDateObj: scaleStep > 1 ? createDateObj(
|
|
293
|
+
dateObj,
|
|
294
|
+
startDateObj,
|
|
295
|
+
endDateObj: scaleStep > 1 ? createDateObj(import_xe_utils.default.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
|
|
335
296
|
},
|
|
336
297
|
hour: {
|
|
337
|
-
field:
|
|
298
|
+
field: `${yyyy}_${MM}_${dd}_${HH}`,
|
|
338
299
|
title: HH,
|
|
339
|
-
dateObj
|
|
340
|
-
startDateObj
|
|
341
|
-
endDateObj: scaleStep > 1 ? createDateObj(
|
|
300
|
+
dateObj,
|
|
301
|
+
startDateObj,
|
|
302
|
+
endDateObj: scaleStep > 1 ? createDateObj(import_xe_utils.default.getWhatHours(itemDate, scaleStep - 1)) : startDateObj
|
|
342
303
|
},
|
|
343
304
|
minute: {
|
|
344
|
-
field:
|
|
305
|
+
field: `${yyyy}_${MM}_${dd}_${HH}_${mm}`,
|
|
345
306
|
title: mm,
|
|
346
|
-
dateObj
|
|
347
|
-
startDateObj
|
|
348
|
-
endDateObj: scaleStep > 1 ? createDateObj(
|
|
307
|
+
dateObj,
|
|
308
|
+
startDateObj,
|
|
309
|
+
endDateObj: scaleStep > 1 ? createDateObj(import_xe_utils.default.getWhatMinutes(itemDate, scaleStep - 1)) : startDateObj
|
|
349
310
|
},
|
|
350
311
|
second: {
|
|
351
|
-
field:
|
|
312
|
+
field: `${yyyy}_${MM}_${dd}_${HH}_${mm}_${ss}`,
|
|
352
313
|
title: ss,
|
|
353
|
-
dateObj
|
|
354
|
-
startDateObj
|
|
355
|
-
endDateObj: scaleStep > 1 ? createDateObj(
|
|
314
|
+
dateObj,
|
|
315
|
+
startDateObj,
|
|
316
|
+
endDateObj: scaleStep > 1 ? createDateObj(import_xe_utils.default.getWhatSeconds(itemDate, scaleStep - 1)) : startDateObj
|
|
356
317
|
}
|
|
357
318
|
};
|
|
358
|
-
|
|
319
|
+
const minCol = colMaps[minScale.type];
|
|
359
320
|
if (minScale.level < 19) {
|
|
360
|
-
handleData(
|
|
321
|
+
handleData("year", colMaps, minCol);
|
|
361
322
|
}
|
|
362
323
|
if (minScale.level < 17) {
|
|
363
|
-
handleData(
|
|
324
|
+
handleData("quarter", colMaps, minCol);
|
|
364
325
|
}
|
|
365
326
|
if (minScale.level < 15) {
|
|
366
|
-
handleData(
|
|
327
|
+
handleData("month", colMaps, minCol);
|
|
367
328
|
}
|
|
368
329
|
if (minScale.level < 13) {
|
|
369
|
-
handleData(
|
|
330
|
+
handleData("week", colMaps, minCol);
|
|
370
331
|
}
|
|
371
332
|
if (minScale.level < 11) {
|
|
372
|
-
handleData(
|
|
333
|
+
handleData("day", colMaps, minCol);
|
|
373
334
|
}
|
|
374
335
|
if (minScale.level < 9) {
|
|
375
|
-
handleData(
|
|
336
|
+
handleData("date", colMaps, minCol);
|
|
376
337
|
}
|
|
377
338
|
if (minScale.level < 7) {
|
|
378
|
-
handleData(
|
|
339
|
+
handleData("hour", colMaps, minCol);
|
|
379
340
|
}
|
|
380
341
|
if (minScale.level < 5) {
|
|
381
|
-
handleData(
|
|
342
|
+
handleData("minute", colMaps, minCol);
|
|
382
343
|
}
|
|
383
344
|
if (minScale.level < 3) {
|
|
384
|
-
handleData(
|
|
345
|
+
handleData("second", colMaps, minCol);
|
|
385
346
|
}
|
|
386
347
|
fullCols.push(minCol);
|
|
387
348
|
}
|
|
388
|
-
taskScaleList.forEach(
|
|
349
|
+
taskScaleList.forEach((scaleItem) => {
|
|
389
350
|
if (scaleItem.type === minScale.type) {
|
|
390
351
|
groupCols.push({
|
|
391
|
-
scaleItem
|
|
352
|
+
scaleItem,
|
|
392
353
|
columns: fullCols
|
|
393
354
|
});
|
|
394
355
|
return;
|
|
395
356
|
}
|
|
396
|
-
|
|
357
|
+
const list = renderListMaps[scaleItem.type] || [];
|
|
397
358
|
if (list) {
|
|
398
|
-
list.forEach(
|
|
359
|
+
list.forEach((item) => {
|
|
399
360
|
item.childCount = item.children ? item.children.length : 0;
|
|
400
|
-
item.children =
|
|
361
|
+
item.children = void 0;
|
|
401
362
|
});
|
|
402
363
|
}
|
|
403
364
|
groupCols.push({
|
|
404
|
-
scaleItem
|
|
365
|
+
scaleItem,
|
|
405
366
|
columns: list
|
|
406
367
|
});
|
|
407
368
|
});
|
|
408
369
|
}
|
|
409
370
|
return {
|
|
410
|
-
fullCols
|
|
411
|
-
groupCols
|
|
371
|
+
fullCols,
|
|
372
|
+
groupCols
|
|
412
373
|
};
|
|
413
374
|
}
|
|
414
|
-
/**
|
|
415
|
-
* 判断周的年份是否跨年
|
|
416
|
-
*/
|
|
417
375
|
function checkWeekOfsetYear(W, M) {
|
|
418
|
-
return
|
|
376
|
+
return `${W}` === "1" && `${M}` === "12";
|
|
419
377
|
}
|
|
420
|
-
/**
|
|
421
|
-
* 周维度,由于年份和第几周是冲突的行为,所以需要特殊处理,判断是否跨年,例如
|
|
422
|
-
* '2024-12-31' 'yyyy-MM-dd W' >> '2024-12-31 1'
|
|
423
|
-
* '2025-01-01' 'yyyy-MM-dd W' >> '2025-01-01 1'
|
|
424
|
-
*/
|
|
425
378
|
function parseWeekObj(date, firstDay) {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
379
|
+
const currDate = import_xe_utils.default.toStringDate(date);
|
|
380
|
+
let yyyy = currDate.getFullYear();
|
|
381
|
+
const month = currDate.getMonth();
|
|
382
|
+
const weekNum = import_xe_utils.default.getYearWeek(currDate, firstDay);
|
|
430
383
|
if (checkWeekOfsetYear(weekNum, month + 1)) {
|
|
431
384
|
yyyy++;
|
|
432
385
|
}
|
|
433
386
|
return {
|
|
434
|
-
yyyy
|
|
387
|
+
yyyy,
|
|
435
388
|
W: weekNum
|
|
436
389
|
};
|
|
437
390
|
}
|
|
438
391
|
function createChartRender($xeGanttView, fullCols) {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
392
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
393
|
+
const minScale = $xeGantt.computeMinScale;
|
|
394
|
+
const scaleStep = $xeGantt.computeScaleStep;
|
|
395
|
+
const scaleUnit = $xeGantt.computeScaleUnit;
|
|
396
|
+
const weekScale = $xeGantt.computeWeekScale;
|
|
397
|
+
const dateFormat = $xeGantt.computeDateFormat;
|
|
445
398
|
if (minScale) {
|
|
446
|
-
|
|
399
|
+
const currRatio = scaleStep > 1 ? 1 / scaleStep : 0;
|
|
447
400
|
switch (scaleUnit) {
|
|
448
|
-
case
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
indexMaps[_currStr] = i + (scaleStep - currStep) * currRatio;
|
|
462
|
-
currStep--;
|
|
463
|
-
}
|
|
401
|
+
case "year": {
|
|
402
|
+
const showActualProgress = /M|d|H|m|s|S/.test(dateFormat);
|
|
403
|
+
const renderFormat = "yyyy";
|
|
404
|
+
const indexMaps = {};
|
|
405
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
406
|
+
const currStr = import_xe_utils.default.toDateString(dateObj.date, "yyyy");
|
|
407
|
+
indexMaps[currStr] = i;
|
|
408
|
+
if (currRatio) {
|
|
409
|
+
let currStep = scaleStep - 1;
|
|
410
|
+
while (currStep) {
|
|
411
|
+
const currStr2 = import_xe_utils.default.toDateString(import_xe_utils.default.getWhatYear(dateObj.date, scaleStep - currStep), renderFormat);
|
|
412
|
+
indexMaps[currStr2] = i + (scaleStep - currStep) * currRatio;
|
|
413
|
+
currStep--;
|
|
464
414
|
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
endSubtractSize *= currRatio;
|
|
487
|
-
}
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
return (startValue, endValue) => {
|
|
418
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
419
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
420
|
+
const startStr = import_xe_utils.default.toDateString(startValDate, renderFormat);
|
|
421
|
+
const startDate = showActualProgress ? startValDate : import_xe_utils.default.getWhatYear(startValDate, 0, "first");
|
|
422
|
+
const startFirstDate = import_xe_utils.default.getWhatYear(startValDate, 0, "first");
|
|
423
|
+
const endStr = import_xe_utils.default.toDateString(endValDate, renderFormat);
|
|
424
|
+
const endDate = showActualProgress ? endValDate : import_xe_utils.default.getWhatYear(endValDate, 0, "last");
|
|
425
|
+
const endFirstDate = import_xe_utils.default.getWhatYear(endDate, 0, "first");
|
|
426
|
+
let startSubtractSize = 0;
|
|
427
|
+
let endSubtractSize = 1;
|
|
428
|
+
if (showActualProgress) {
|
|
429
|
+
const syDaySize = import_xe_utils.default.getDayOfYear(startDate, 0);
|
|
430
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / syDaySize;
|
|
431
|
+
const eyDaySize = import_xe_utils.default.getDayOfYear(endDate, 0);
|
|
432
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / eyDaySize;
|
|
433
|
+
if (currRatio) {
|
|
434
|
+
startSubtractSize *= currRatio;
|
|
435
|
+
endSubtractSize *= currRatio;
|
|
488
436
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
437
|
+
}
|
|
438
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
439
|
+
return {
|
|
440
|
+
offsetLeftSize,
|
|
441
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
494
442
|
};
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
currStep--;
|
|
511
|
-
}
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
case "quarter": {
|
|
446
|
+
const showActualProgress = /M|d|H|m|ss|S/.test(dateFormat);
|
|
447
|
+
const renderFormat = "yyyy-q";
|
|
448
|
+
const indexMaps = {};
|
|
449
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
450
|
+
const currStr = import_xe_utils.default.toDateString(dateObj.date, renderFormat);
|
|
451
|
+
indexMaps[currStr] = i;
|
|
452
|
+
if (currRatio) {
|
|
453
|
+
let currStep = scaleStep - 1;
|
|
454
|
+
while (currStep) {
|
|
455
|
+
const currStr2 = import_xe_utils.default.toDateString(import_xe_utils.default.getWhatQuarter(dateObj.date, scaleStep - currStep), renderFormat);
|
|
456
|
+
indexMaps[currStr2] = i + (scaleStep - currStep) * currRatio;
|
|
457
|
+
currStep--;
|
|
512
458
|
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
endSubtractSize *= currRatio;
|
|
535
|
-
}
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
return (startValue, endValue) => {
|
|
462
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
463
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
464
|
+
const startStr = import_xe_utils.default.toDateString(startValDate, renderFormat);
|
|
465
|
+
const startDate = showActualProgress ? startValDate : import_xe_utils.default.getWhatQuarter(startValDate, 0, "first");
|
|
466
|
+
const startFirstDate = import_xe_utils.default.getWhatQuarter(startValDate, 0, "first");
|
|
467
|
+
const endStr = import_xe_utils.default.toDateString(endValDate, renderFormat);
|
|
468
|
+
const endDate = showActualProgress ? endValDate : import_xe_utils.default.getWhatQuarter(endValDate, 0, "last");
|
|
469
|
+
const endFirstDate = import_xe_utils.default.getWhatQuarter(endDate, 0, "first");
|
|
470
|
+
let startSubtractSize = 0;
|
|
471
|
+
let endSubtractSize = 1;
|
|
472
|
+
if (showActualProgress) {
|
|
473
|
+
const sqDaySize = import_xe_utils.default.getDayOfQuarter(startDate, 0);
|
|
474
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / sqDaySize;
|
|
475
|
+
const eqDaySize = import_xe_utils.default.getDayOfQuarter(endDate, 0);
|
|
476
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / eqDaySize;
|
|
477
|
+
if (currRatio) {
|
|
478
|
+
startSubtractSize *= currRatio;
|
|
479
|
+
endSubtractSize *= currRatio;
|
|
536
480
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
481
|
+
}
|
|
482
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
483
|
+
return {
|
|
484
|
+
offsetLeftSize,
|
|
485
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
542
486
|
};
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
currStep--;
|
|
559
|
-
}
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
case "month": {
|
|
490
|
+
const renderFormat = "yyyy-MM";
|
|
491
|
+
const showActualProgress = /d|H|m|ss|S/.test(dateFormat);
|
|
492
|
+
const indexMaps = {};
|
|
493
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
494
|
+
const currStr = import_xe_utils.default.toDateString(dateObj.date, renderFormat);
|
|
495
|
+
indexMaps[currStr] = i;
|
|
496
|
+
if (currRatio) {
|
|
497
|
+
let currStep = scaleStep - 1;
|
|
498
|
+
while (currStep) {
|
|
499
|
+
const currStr2 = import_xe_utils.default.toDateString(import_xe_utils.default.getWhatMonth(dateObj.date, scaleStep - currStep), renderFormat);
|
|
500
|
+
indexMaps[currStr2] = i + (scaleStep - currStep) * currRatio;
|
|
501
|
+
currStep--;
|
|
560
502
|
}
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
endSubtractSize *= currRatio;
|
|
583
|
-
}
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
return (startValue, endValue) => {
|
|
506
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
507
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
508
|
+
const startStr = import_xe_utils.default.toDateString(startValDate, renderFormat);
|
|
509
|
+
const startDate = showActualProgress ? startValDate : import_xe_utils.default.getWhatMonth(startValDate, 0, "first");
|
|
510
|
+
const startFirstDate = import_xe_utils.default.getWhatMonth(startValDate, 0, "first");
|
|
511
|
+
const endStr = import_xe_utils.default.toDateString(endValDate, renderFormat);
|
|
512
|
+
const endDate = showActualProgress ? endValDate : import_xe_utils.default.getWhatMonth(endValDate, 0, "last");
|
|
513
|
+
const endFirstDate = import_xe_utils.default.getWhatMonth(endDate, 0, "first");
|
|
514
|
+
let startSubtractSize = 0;
|
|
515
|
+
let endSubtractSize = 1;
|
|
516
|
+
if (showActualProgress) {
|
|
517
|
+
const smDaySize = import_xe_utils.default.getDayOfMonth(startDate, 0);
|
|
518
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / smDaySize;
|
|
519
|
+
const emDaySize = import_xe_utils.default.getDayOfMonth(endDate, 0);
|
|
520
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / emDaySize;
|
|
521
|
+
if (currRatio) {
|
|
522
|
+
startSubtractSize *= currRatio;
|
|
523
|
+
endSubtractSize *= currRatio;
|
|
584
524
|
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
525
|
+
}
|
|
526
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
527
|
+
return {
|
|
528
|
+
offsetLeftSize,
|
|
529
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
590
530
|
};
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
M = _XEUtils$toDateString6[1];
|
|
609
|
-
var W = "".concat(_xeUtils.default.getYearWeek(offsetDate, weekScale ? weekScale.startDay : undefined));
|
|
610
|
-
if (checkWeekOfsetYear(W, M)) {
|
|
611
|
-
yyyy = "".concat(Number(yyyy) + 1);
|
|
612
|
-
}
|
|
613
|
-
var _currStr4 = "".concat(yyyy, "-").concat(W);
|
|
614
|
-
_indexMaps3[_currStr4] = i + (scaleStep - currStep) * currRatio;
|
|
615
|
-
currStep--;
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
case "week": {
|
|
534
|
+
const weekStartDay = weekScale ? weekScale.startDay : void 0;
|
|
535
|
+
const showActualProgress = /d|H|m|s|S/.test(dateFormat);
|
|
536
|
+
const indexMaps = {};
|
|
537
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
538
|
+
const currStr = `${dateObj.yyyy}-${dateObj.W}`;
|
|
539
|
+
indexMaps[currStr] = i;
|
|
540
|
+
if (currRatio) {
|
|
541
|
+
let currStep = scaleStep - 1;
|
|
542
|
+
while (currStep) {
|
|
543
|
+
const offsetDate = import_xe_utils.default.getWhatWeek(dateObj.date, scaleStep - currStep, weekStartDay, weekStartDay);
|
|
544
|
+
let [yyyy, M] = import_xe_utils.default.toDateString(offsetDate, "yyyy-M-MM-dd-HH-mm-ss").split("-");
|
|
545
|
+
const W = `${import_xe_utils.default.getYearWeek(offsetDate, weekScale ? weekScale.startDay : void 0)}`;
|
|
546
|
+
if (checkWeekOfsetYear(W, M)) {
|
|
547
|
+
yyyy = `${Number(yyyy) + 1}`;
|
|
616
548
|
}
|
|
549
|
+
const currStr2 = `${yyyy}-${W}`;
|
|
550
|
+
indexMaps[currStr2] = i + (scaleStep - currStep) * currRatio;
|
|
551
|
+
currStep--;
|
|
617
552
|
}
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
endSubtractSize *= currRatio;
|
|
640
|
-
}
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
return (startValue, endValue) => {
|
|
556
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
557
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
558
|
+
const startDate = showActualProgress ? startValDate : import_xe_utils.default.getWhatWeek(startValDate, 0, "first", weekStartDay);
|
|
559
|
+
const startWeekObj = parseWeekObj(startDate, weekStartDay);
|
|
560
|
+
const startStr = `${startWeekObj.yyyy}-${startWeekObj.W}`;
|
|
561
|
+
const startFirstDate = import_xe_utils.default.getWhatWeek(startDate, 0, "first", weekStartDay);
|
|
562
|
+
const endDate = showActualProgress ? endValDate : import_xe_utils.default.getWhatWeek(endValDate, 0, "first", weekStartDay);
|
|
563
|
+
const endWeekObj = parseWeekObj(endDate, weekStartDay);
|
|
564
|
+
const endStr = `${endWeekObj.yyyy}-${endWeekObj.W}`;
|
|
565
|
+
const endFirstDate = import_xe_utils.default.getWhatWeek(endDate, 0, "first", weekStartDay);
|
|
566
|
+
let startSubtractSize = 0;
|
|
567
|
+
let endSubtractSize = 1;
|
|
568
|
+
if (showActualProgress) {
|
|
569
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs / 7;
|
|
570
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs / 7;
|
|
571
|
+
if (currRatio) {
|
|
572
|
+
startSubtractSize *= currRatio;
|
|
573
|
+
endSubtractSize *= currRatio;
|
|
641
574
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
575
|
+
}
|
|
576
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
577
|
+
return {
|
|
578
|
+
offsetLeftSize,
|
|
579
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
647
580
|
};
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
case
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
currStep--;
|
|
665
|
-
}
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
case "day":
|
|
584
|
+
case "date": {
|
|
585
|
+
const renderFormat = "yyyy-MM-dd";
|
|
586
|
+
const showActualProgress = /H|m|s|S/.test(dateFormat);
|
|
587
|
+
const indexMaps = {};
|
|
588
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
589
|
+
const currStr = import_xe_utils.default.toDateString(dateObj.date, renderFormat);
|
|
590
|
+
indexMaps[currStr] = i;
|
|
591
|
+
if (currRatio) {
|
|
592
|
+
let currStep = scaleStep - 1;
|
|
593
|
+
while (currStep) {
|
|
594
|
+
const currStr2 = import_xe_utils.default.toDateString(import_xe_utils.default.getWhatDay(dateObj.date, scaleStep - currStep), renderFormat);
|
|
595
|
+
indexMaps[currStr2] = i + (scaleStep - currStep) * currRatio;
|
|
596
|
+
currStep--;
|
|
666
597
|
}
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
return (startValue, endValue) => {
|
|
601
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
602
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
603
|
+
const startStr = import_xe_utils.default.toDateString(startValDate, renderFormat);
|
|
604
|
+
const startDate = showActualProgress ? startValDate : import_xe_utils.default.getWhatDay(startValDate, 0, "first");
|
|
605
|
+
const startFirstDate = import_xe_utils.default.getWhatDay(startDate, 0, "first");
|
|
606
|
+
const endStr = import_xe_utils.default.toDateString(endValDate, renderFormat);
|
|
607
|
+
const endDate = showActualProgress ? endValDate : import_xe_utils.default.getWhatDay(endValDate, 0, "last");
|
|
608
|
+
const endFirstDate = import_xe_utils.default.getWhatDay(endDate, 0, "first");
|
|
609
|
+
let startSubtractSize = 0;
|
|
610
|
+
let endSubtractSize = 1;
|
|
611
|
+
if (showActualProgress) {
|
|
612
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / dayMs;
|
|
613
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / dayMs;
|
|
614
|
+
if (currRatio) {
|
|
615
|
+
startSubtractSize *= currRatio;
|
|
616
|
+
endSubtractSize *= currRatio;
|
|
687
617
|
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
618
|
+
}
|
|
619
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
620
|
+
return {
|
|
621
|
+
offsetLeftSize,
|
|
622
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
693
623
|
};
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
currStep--;
|
|
710
|
-
}
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
case "hour": {
|
|
627
|
+
const renderFormat = "yyyy-MM-dd HH";
|
|
628
|
+
const showActualProgress = /m|ss|S/.test(dateFormat);
|
|
629
|
+
const indexMaps = {};
|
|
630
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
631
|
+
const currStr = import_xe_utils.default.toDateString(dateObj.date, renderFormat);
|
|
632
|
+
indexMaps[currStr] = i;
|
|
633
|
+
if (currRatio) {
|
|
634
|
+
let currStep = scaleStep - 1;
|
|
635
|
+
while (currStep) {
|
|
636
|
+
const currStr2 = import_xe_utils.default.toDateString(import_xe_utils.default.getWhatHours(dateObj.date, scaleStep - currStep), renderFormat);
|
|
637
|
+
indexMaps[currStr2] = i + (scaleStep - currStep) * currRatio;
|
|
638
|
+
currStep--;
|
|
711
639
|
}
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
}
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
return (startValue, endValue) => {
|
|
643
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
644
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
645
|
+
const startStr = import_xe_utils.default.toDateString(startValDate, renderFormat);
|
|
646
|
+
const startDate = showActualProgress ? startValDate : import_xe_utils.default.getWhatHours(startValDate, 0, "first");
|
|
647
|
+
const startFirstDate = import_xe_utils.default.getWhatHours(startDate, 0, "first");
|
|
648
|
+
const endStr = import_xe_utils.default.toDateString(endValDate, renderFormat);
|
|
649
|
+
const endDate = showActualProgress ? endValDate : import_xe_utils.default.getWhatHours(endValDate, 0, "last");
|
|
650
|
+
const endFirstDate = import_xe_utils.default.getWhatHours(endDate, 0, "first");
|
|
651
|
+
let startSubtractSize = 0;
|
|
652
|
+
let endSubtractSize = 1;
|
|
653
|
+
if (showActualProgress) {
|
|
654
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / hourMs;
|
|
655
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / hourMs;
|
|
656
|
+
if (currRatio) {
|
|
657
|
+
startSubtractSize *= currRatio;
|
|
658
|
+
endSubtractSize *= currRatio;
|
|
732
659
|
}
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
660
|
+
}
|
|
661
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
662
|
+
return {
|
|
663
|
+
offsetLeftSize,
|
|
664
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
738
665
|
};
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
currStep--;
|
|
755
|
-
}
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
case "minute": {
|
|
669
|
+
const renderFormat = "yyyy-MM-dd HH:mm";
|
|
670
|
+
const showActualProgress = /s|S/.test(dateFormat);
|
|
671
|
+
const indexMaps = {};
|
|
672
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
673
|
+
const currStr = import_xe_utils.default.toDateString(dateObj.date, renderFormat);
|
|
674
|
+
indexMaps[currStr] = i;
|
|
675
|
+
if (currRatio) {
|
|
676
|
+
let currStep = scaleStep - 1;
|
|
677
|
+
while (currStep) {
|
|
678
|
+
const currStr2 = import_xe_utils.default.toDateString(import_xe_utils.default.getWhatMinutes(dateObj.date, scaleStep - currStep), renderFormat);
|
|
679
|
+
indexMaps[currStr2] = i + (scaleStep - currStep) * currRatio;
|
|
680
|
+
currStep--;
|
|
756
681
|
}
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
}
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
return (startValue, endValue) => {
|
|
685
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
686
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
687
|
+
const startStr = import_xe_utils.default.toDateString(startValDate, renderFormat);
|
|
688
|
+
const startDate = showActualProgress ? startValDate : import_xe_utils.default.getWhatMinutes(startValDate, 0, "first");
|
|
689
|
+
const startFirstDate = import_xe_utils.default.getWhatMinutes(startDate, 0, "first");
|
|
690
|
+
const endStr = import_xe_utils.default.toDateString(endValDate, renderFormat);
|
|
691
|
+
const endDate = showActualProgress ? endValDate : import_xe_utils.default.getWhatMinutes(endValDate, 0, "last");
|
|
692
|
+
const endFirstDate = import_xe_utils.default.getWhatMinutes(endDate, 0, "first");
|
|
693
|
+
let startSubtractSize = 0;
|
|
694
|
+
let endSubtractSize = 1;
|
|
695
|
+
if (showActualProgress) {
|
|
696
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / minuteMs;
|
|
697
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / minuteMs;
|
|
698
|
+
if (currRatio) {
|
|
699
|
+
startSubtractSize *= currRatio;
|
|
700
|
+
endSubtractSize *= currRatio;
|
|
777
701
|
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
702
|
+
}
|
|
703
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
704
|
+
return {
|
|
705
|
+
offsetLeftSize,
|
|
706
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
783
707
|
};
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
currStep--;
|
|
800
|
-
}
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
case "second": {
|
|
711
|
+
const renderFormat = "yyyy-MM-dd HH:mm:ss";
|
|
712
|
+
const showActualProgress = /S/.test(dateFormat);
|
|
713
|
+
const indexMaps = {};
|
|
714
|
+
fullCols.forEach(({ dateObj }, i) => {
|
|
715
|
+
const yyyyMM = import_xe_utils.default.toDateString(dateObj.date, renderFormat);
|
|
716
|
+
indexMaps[yyyyMM] = i;
|
|
717
|
+
if (currRatio) {
|
|
718
|
+
let currStep = scaleStep - 1;
|
|
719
|
+
while (currStep) {
|
|
720
|
+
const yyyyMM2 = import_xe_utils.default.toDateString(import_xe_utils.default.getWhatSeconds(dateObj.date, scaleStep - currStep), renderFormat);
|
|
721
|
+
indexMaps[yyyyMM2] = i + (scaleStep - currStep) * currRatio;
|
|
722
|
+
currStep--;
|
|
801
723
|
}
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
}
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
return (startValue, endValue) => {
|
|
727
|
+
const startValDate = parseStringDate($xeGanttView, startValue);
|
|
728
|
+
const endValDate = parseStringDate($xeGanttView, endValue);
|
|
729
|
+
const startStr = import_xe_utils.default.toDateString(startValDate, renderFormat);
|
|
730
|
+
const startDate = showActualProgress ? startValDate : import_xe_utils.default.getWhatSeconds(startValDate, 0, "first");
|
|
731
|
+
const startFirstDate = import_xe_utils.default.getWhatSeconds(startDate, 0, "first");
|
|
732
|
+
const endStr = import_xe_utils.default.toDateString(endValDate, renderFormat);
|
|
733
|
+
const endDate = showActualProgress ? endValDate : import_xe_utils.default.getWhatSeconds(endValDate, 0, "last");
|
|
734
|
+
const endFirstDate = import_xe_utils.default.getWhatSeconds(endDate, 0, "first");
|
|
735
|
+
let startSubtractSize = 0;
|
|
736
|
+
let endSubtractSize = 1;
|
|
737
|
+
if (showActualProgress) {
|
|
738
|
+
startSubtractSize = (startDate.getTime() - startFirstDate.getTime()) / secondMs;
|
|
739
|
+
endSubtractSize = (endDate.getTime() - endFirstDate.getTime()) / secondMs;
|
|
740
|
+
if (currRatio) {
|
|
741
|
+
startSubtractSize *= currRatio;
|
|
742
|
+
endSubtractSize *= currRatio;
|
|
822
743
|
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
744
|
+
}
|
|
745
|
+
const offsetLeftSize = (indexMaps[startStr] || 0) + startSubtractSize;
|
|
746
|
+
return {
|
|
747
|
+
offsetLeftSize,
|
|
748
|
+
offsetWidthSize: (indexMaps[endStr] || 0) - offsetLeftSize + endSubtractSize
|
|
828
749
|
};
|
|
829
|
-
}
|
|
750
|
+
};
|
|
751
|
+
}
|
|
830
752
|
}
|
|
831
753
|
}
|
|
832
|
-
return
|
|
754
|
+
return () => {
|
|
833
755
|
return {
|
|
834
756
|
offsetLeftSize: 0,
|
|
835
757
|
offsetWidthSize: 0
|
|
@@ -837,41 +759,36 @@ function createChartRender($xeGanttView, fullCols) {
|
|
|
837
759
|
};
|
|
838
760
|
}
|
|
839
761
|
function handleParseColumn($xeGanttView) {
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
var _handleColumnHeader = handleColumnHeader($xeGanttView),
|
|
848
|
-
fullCols = _handleColumnHeader.fullCols,
|
|
849
|
-
groupCols = _handleColumnHeader.groupCols;
|
|
762
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
763
|
+
const reactData = $xeGanttView.reactData;
|
|
764
|
+
const internalData = $xeGanttView.internalData;
|
|
765
|
+
const ganttProps = $xeGantt;
|
|
766
|
+
const { treeConfig } = ganttProps;
|
|
767
|
+
const { minViewDate, maxViewDate } = reactData;
|
|
768
|
+
const { fullCols, groupCols } = handleColumnHeader($xeGanttView);
|
|
850
769
|
if (minViewDate && maxViewDate) {
|
|
851
|
-
|
|
770
|
+
const $xeTable = internalData.xeTable;
|
|
852
771
|
if ($xeTable) {
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
var isMilestone = (0, _util.hasMilestoneTask)(renderTaskType);
|
|
874
|
-
var isSubview = (0, _util.hasSubviewTask)(renderTaskType);
|
|
772
|
+
const startField = $xeGantt.computeStartField;
|
|
773
|
+
const endField = $xeGantt.computeEndField;
|
|
774
|
+
const typeField = $xeGantt.computeTypeField;
|
|
775
|
+
const tableReactData = $xeTable.getReactData();
|
|
776
|
+
const { isRowGroupStatus } = tableReactData;
|
|
777
|
+
const tableInternalData = $xeTable.getInternalData();
|
|
778
|
+
const { afterFullData, afterTreeFullData, afterGroupFullData } = tableInternalData;
|
|
779
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
780
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
781
|
+
const { transform } = treeOpts;
|
|
782
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
783
|
+
const ctMaps = {};
|
|
784
|
+
const renderFn = createChartRender($xeGanttView, fullCols);
|
|
785
|
+
const handleParseRender = (row) => {
|
|
786
|
+
const rowid = $xeTable.getRowid(row);
|
|
787
|
+
let startValue = import_xe_utils.default.get(row, startField);
|
|
788
|
+
let endValue = import_xe_utils.default.get(row, endField);
|
|
789
|
+
const renderTaskType = (0, import_util.getTaskType)(import_xe_utils.default.get(row, typeField));
|
|
790
|
+
const isMilestone = (0, import_util.hasMilestoneTask)(renderTaskType);
|
|
791
|
+
const isSubview = (0, import_util.hasSubviewTask)(renderTaskType);
|
|
875
792
|
if (isMilestone) {
|
|
876
793
|
if (!startValue) {
|
|
877
794
|
startValue = endValue;
|
|
@@ -880,36 +797,28 @@ function handleParseColumn($xeGanttView) {
|
|
|
880
797
|
}
|
|
881
798
|
if (isSubview) {
|
|
882
799
|
ctMaps[rowid] = {
|
|
883
|
-
row
|
|
884
|
-
rowid
|
|
800
|
+
row,
|
|
801
|
+
rowid,
|
|
885
802
|
oLeftSize: 0,
|
|
886
803
|
oWidthSize: 0
|
|
887
804
|
};
|
|
888
805
|
} else if (startValue && endValue) {
|
|
889
|
-
|
|
890
|
-
offsetLeftSize = _renderFn.offsetLeftSize,
|
|
891
|
-
offsetWidthSize = _renderFn.offsetWidthSize;
|
|
806
|
+
const { offsetLeftSize, offsetWidthSize } = renderFn(startValue, endValue);
|
|
892
807
|
ctMaps[rowid] = {
|
|
893
|
-
row
|
|
894
|
-
rowid
|
|
808
|
+
row,
|
|
809
|
+
rowid,
|
|
895
810
|
oLeftSize: offsetLeftSize,
|
|
896
811
|
oWidthSize: offsetWidthSize
|
|
897
812
|
};
|
|
898
813
|
}
|
|
899
814
|
};
|
|
900
815
|
if (isRowGroupStatus) {
|
|
901
|
-
|
|
902
|
-
var mapChildrenField = aggregateOpts.mapChildrenField;
|
|
816
|
+
const mapChildrenField = aggregateOpts.mapChildrenField;
|
|
903
817
|
if (mapChildrenField) {
|
|
904
|
-
|
|
905
|
-
children: mapChildrenField
|
|
906
|
-
});
|
|
818
|
+
import_xe_utils.default.eachTree(afterGroupFullData, handleParseRender, { children: mapChildrenField });
|
|
907
819
|
}
|
|
908
820
|
} else if (treeConfig) {
|
|
909
|
-
|
|
910
|
-
_xeUtils.default.eachTree(afterTreeFullData, handleParseRender, {
|
|
911
|
-
children: transform ? treeOpts.mapChildrenField : childrenField
|
|
912
|
-
});
|
|
821
|
+
import_xe_utils.default.eachTree(afterTreeFullData, handleParseRender, { children: transform ? treeOpts.mapChildrenField : childrenField });
|
|
913
822
|
} else {
|
|
914
823
|
afterFullData.forEach(handleParseRender);
|
|
915
824
|
}
|
|
@@ -923,39 +832,37 @@ function handleParseColumn($xeGanttView) {
|
|
|
923
832
|
handleTableColumn($xeGanttView);
|
|
924
833
|
}
|
|
925
834
|
function handleUpdateData($xeGanttView) {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
835
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
836
|
+
const reactData = $xeGanttView.reactData;
|
|
837
|
+
const internalData = $xeGanttView.internalData;
|
|
838
|
+
const ganttProps = $xeGantt;
|
|
839
|
+
const ganttReactData = $xeGantt.reactData;
|
|
840
|
+
const { linkList } = ganttReactData;
|
|
841
|
+
const { treeConfig } = ganttProps;
|
|
842
|
+
const { scrollXStore } = internalData;
|
|
843
|
+
const $xeTable = internalData.xeTable;
|
|
844
|
+
const sdMaps = {};
|
|
845
|
+
const edMaps = {};
|
|
846
|
+
let minDate = null;
|
|
847
|
+
let maxDate = null;
|
|
848
|
+
const allList = [];
|
|
940
849
|
if ($xeTable) {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
var typeValue = _xeUtils.default.get(row, typeField);
|
|
958
|
-
var isMilestone = (0, _util.hasMilestoneTask)(typeValue);
|
|
850
|
+
const startField = $xeGantt.computeStartField;
|
|
851
|
+
const endField = $xeGantt.computeEndField;
|
|
852
|
+
const typeField = $xeGantt.computeTypeField;
|
|
853
|
+
const tableReactData = $xeTable.getReactData();
|
|
854
|
+
const { isRowGroupStatus } = tableReactData;
|
|
855
|
+
const tableInternalData = $xeTable.getInternalData();
|
|
856
|
+
const { afterFullData, afterTreeFullData, afterGroupFullData } = tableInternalData;
|
|
857
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
858
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
859
|
+
const { transform } = treeOpts;
|
|
860
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
861
|
+
const handleMinMaxData = (row) => {
|
|
862
|
+
let startValue = import_xe_utils.default.get(row, startField);
|
|
863
|
+
let endValue = import_xe_utils.default.get(row, endField);
|
|
864
|
+
const typeValue = import_xe_utils.default.get(row, typeField);
|
|
865
|
+
const isMilestone = (0, import_util.hasMilestoneTask)(typeValue);
|
|
959
866
|
if (!startValue) {
|
|
960
867
|
startValue = endValue;
|
|
961
868
|
}
|
|
@@ -963,13 +870,13 @@ function handleUpdateData($xeGanttView) {
|
|
|
963
870
|
endValue = startValue;
|
|
964
871
|
}
|
|
965
872
|
if (startValue) {
|
|
966
|
-
|
|
873
|
+
const startDate = parseStringDate($xeGanttView, startValue);
|
|
967
874
|
if (!minDate || minDate.getTime() > startDate.getTime()) {
|
|
968
875
|
minDate = startDate;
|
|
969
876
|
}
|
|
970
877
|
}
|
|
971
878
|
if (endValue) {
|
|
972
|
-
|
|
879
|
+
const endDate = parseStringDate($xeGanttView, endValue);
|
|
973
880
|
if (!maxDate || maxDate.getTime() < endDate.getTime()) {
|
|
974
881
|
maxDate = endDate;
|
|
975
882
|
}
|
|
@@ -977,18 +884,12 @@ function handleUpdateData($xeGanttView) {
|
|
|
977
884
|
allList.push(row);
|
|
978
885
|
};
|
|
979
886
|
if (isRowGroupStatus) {
|
|
980
|
-
|
|
981
|
-
var mapChildrenField = aggregateOpts.mapChildrenField;
|
|
887
|
+
const mapChildrenField = aggregateOpts.mapChildrenField;
|
|
982
888
|
if (mapChildrenField) {
|
|
983
|
-
|
|
984
|
-
children: mapChildrenField
|
|
985
|
-
});
|
|
889
|
+
import_xe_utils.default.eachTree(afterGroupFullData, handleMinMaxData, { children: mapChildrenField });
|
|
986
890
|
}
|
|
987
891
|
} else if (treeConfig) {
|
|
988
|
-
|
|
989
|
-
_xeUtils.default.eachTree(afterTreeFullData, handleMinMaxData, {
|
|
990
|
-
children: transform ? treeOpts.mapChildrenField : childrenField
|
|
991
|
-
});
|
|
892
|
+
import_xe_utils.default.eachTree(afterTreeFullData, handleMinMaxData, { children: transform ? treeOpts.mapChildrenField : childrenField });
|
|
992
893
|
} else {
|
|
993
894
|
afterFullData.forEach(handleMinMaxData);
|
|
994
895
|
}
|
|
@@ -1002,9 +903,6 @@ function handleUpdateData($xeGanttView) {
|
|
|
1002
903
|
handleParseColumn($xeGanttView);
|
|
1003
904
|
handleCriticalPath($xeGanttView, allList, linkList);
|
|
1004
905
|
}
|
|
1005
|
-
/**
|
|
1006
|
-
* 正向:后置 ES 的下连接线
|
|
1007
|
-
*/
|
|
1008
906
|
function forwardCriticalPathLowerBound(linkType, predES, predEF, duration) {
|
|
1009
907
|
switch (linkType) {
|
|
1010
908
|
case FinishToStart:
|
|
@@ -1019,9 +917,6 @@ function forwardCriticalPathLowerBound(linkType, predES, predEF, duration) {
|
|
|
1019
917
|
return 0;
|
|
1020
918
|
}
|
|
1021
919
|
}
|
|
1022
|
-
/**
|
|
1023
|
-
* 反向:前置 LF 的上连接线
|
|
1024
|
-
*/
|
|
1025
920
|
function backwardCriticalPathUpperBound(linkType, succLS, succLF, duration) {
|
|
1026
921
|
switch (linkType) {
|
|
1027
922
|
case FinishToStart:
|
|
@@ -1036,9 +931,6 @@ function backwardCriticalPathUpperBound(linkType, succLS, succLF, duration) {
|
|
|
1036
931
|
return -1;
|
|
1037
932
|
}
|
|
1038
933
|
}
|
|
1039
|
-
/**
|
|
1040
|
-
* 关键边:两端都关键时,约束是否连接
|
|
1041
|
-
*/
|
|
1042
934
|
function isCriticalPathLinkTight(linkType, fromES, fromEF, toES, toEF, tolerance) {
|
|
1043
935
|
switch (linkType) {
|
|
1044
936
|
case FinishToStart:
|
|
@@ -1054,15 +946,15 @@ function isCriticalPathLinkTight(linkType, fromES, fromEF, toES, toEF, tolerance
|
|
|
1054
946
|
}
|
|
1055
947
|
}
|
|
1056
948
|
function handleCriticalPath($xeGanttView, data, links) {
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
949
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
950
|
+
const internalData = $xeGanttView.internalData;
|
|
951
|
+
const ganttReactData = $xeGantt.reactData;
|
|
952
|
+
const ganttInternalData = $xeGantt.internalData;
|
|
953
|
+
const taskBarOpts = $xeGantt.computeTaskBarOpts;
|
|
954
|
+
const $xeTable = internalData.xeTable;
|
|
955
|
+
const criticalRowList = [];
|
|
956
|
+
const criticalRowMaps = /* @__PURE__ */ new Map();
|
|
957
|
+
const criticalLinkKeyMaps = /* @__PURE__ */ new Map();
|
|
1066
958
|
ganttInternalData.criticalRowList = criticalRowList;
|
|
1067
959
|
ganttInternalData.criticalRowMaps = criticalRowMaps;
|
|
1068
960
|
ganttInternalData.criticalLinkKeyMaps = criticalLinkKeyMaps;
|
|
@@ -1074,101 +966,71 @@ function handleCriticalPath($xeGanttView, data, links) {
|
|
|
1074
966
|
ganttReactData.criticalRowIds = [];
|
|
1075
967
|
return;
|
|
1076
968
|
}
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
969
|
+
const { chartMaps } = internalData;
|
|
970
|
+
const tolerance = 1e-6;
|
|
971
|
+
const nodeMap = /* @__PURE__ */ new Map();
|
|
972
|
+
for (const row of data) {
|
|
973
|
+
const rowid = $xeTable.getRowid(row);
|
|
974
|
+
const chartRest = chartMaps[rowid];
|
|
975
|
+
nodeMap.set(rowid, {
|
|
976
|
+
row,
|
|
977
|
+
rowid,
|
|
978
|
+
duration: chartRest ? chartRest.oWidthSize : 0,
|
|
979
|
+
incoming: [],
|
|
980
|
+
outgoing: [],
|
|
981
|
+
indeg: 0,
|
|
982
|
+
ES: 0,
|
|
983
|
+
EF: 0,
|
|
984
|
+
LS: 0,
|
|
985
|
+
LF: 0
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
const linkList = [];
|
|
989
|
+
for (const link of links) {
|
|
990
|
+
const fromKey = "" + link.from;
|
|
991
|
+
const toKey = "" + link.to;
|
|
992
|
+
if (!nodeMap.has(fromKey) || !nodeMap.has(toKey) || fromKey === toKey) {
|
|
993
|
+
continue;
|
|
1099
994
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
var link = _step2.value;
|
|
1112
|
-
var fromKey = '' + link.from;
|
|
1113
|
-
var toKey = '' + link.to;
|
|
1114
|
-
if (!nodeMap.has(fromKey) || !nodeMap.has(toKey) || fromKey === toKey) {
|
|
1115
|
-
continue;
|
|
1116
|
-
}
|
|
1117
|
-
var _lkItemitem = {
|
|
1118
|
-
from: link.from,
|
|
1119
|
-
to: link.to,
|
|
1120
|
-
type: _xeUtils.default.toNumber(link.type) || 0,
|
|
1121
|
-
raw: link
|
|
1122
|
-
};
|
|
1123
|
-
linkList.push(_lkItemitem);
|
|
1124
|
-
var _toObjItem3 = nodeMap.get('' + link.to);
|
|
1125
|
-
var _fromObjItem2 = nodeMap.get('' + link.from);
|
|
1126
|
-
if (_fromObjItem2) {
|
|
1127
|
-
_fromObjItem2.outgoing.push(_lkItemitem);
|
|
1128
|
-
}
|
|
1129
|
-
if (_toObjItem3) {
|
|
1130
|
-
_toObjItem3.incoming.push(_lkItemitem);
|
|
1131
|
-
_toObjItem3.indeg++;
|
|
1132
|
-
}
|
|
995
|
+
const lkItemitem = {
|
|
996
|
+
from: link.from,
|
|
997
|
+
to: link.to,
|
|
998
|
+
type: import_xe_utils.default.toNumber(link.type) || 0,
|
|
999
|
+
raw: link
|
|
1000
|
+
};
|
|
1001
|
+
linkList.push(lkItemitem);
|
|
1002
|
+
const toObjItem = nodeMap.get("" + link.to);
|
|
1003
|
+
const fromObjItem = nodeMap.get("" + link.from);
|
|
1004
|
+
if (fromObjItem) {
|
|
1005
|
+
fromObjItem.outgoing.push(lkItemitem);
|
|
1133
1006
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
nodeMap.forEach(function (nodeitem) {
|
|
1007
|
+
if (toObjItem) {
|
|
1008
|
+
toObjItem.incoming.push(lkItemitem);
|
|
1009
|
+
toObjItem.indeg++;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
const queueList = [];
|
|
1013
|
+
nodeMap.forEach((nodeitem) => {
|
|
1142
1014
|
if (nodeitem.indeg === 0) {
|
|
1143
1015
|
queueList.push(nodeitem);
|
|
1144
1016
|
}
|
|
1145
1017
|
});
|
|
1146
|
-
|
|
1147
|
-
for (
|
|
1148
|
-
|
|
1018
|
+
const orderList = [];
|
|
1019
|
+
for (let head = 0; head < queueList.length; head++) {
|
|
1020
|
+
const node = queueList[head];
|
|
1149
1021
|
orderList.push(node);
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
var nextDeg = toObjItem.indeg - 1;
|
|
1158
|
-
toObjItem.indeg = nextDeg;
|
|
1159
|
-
if (nextDeg === 0) {
|
|
1160
|
-
queueList.push(nodeMap.get('' + lkItemitem.to));
|
|
1161
|
-
}
|
|
1022
|
+
for (const lkItemitem of node.outgoing) {
|
|
1023
|
+
const toObjItem = nodeMap.get("" + lkItemitem.to);
|
|
1024
|
+
if (toObjItem) {
|
|
1025
|
+
const nextDeg = toObjItem.indeg - 1;
|
|
1026
|
+
toObjItem.indeg = nextDeg;
|
|
1027
|
+
if (nextDeg === 0) {
|
|
1028
|
+
queueList.push(nodeMap.get("" + lkItemitem.to));
|
|
1162
1029
|
}
|
|
1163
1030
|
}
|
|
1164
|
-
} catch (err) {
|
|
1165
|
-
_iterator3.e(err);
|
|
1166
|
-
} finally {
|
|
1167
|
-
_iterator3.f();
|
|
1168
1031
|
}
|
|
1169
1032
|
}
|
|
1170
1033
|
if (orderList.length !== nodeMap.size) {
|
|
1171
|
-
// 异常数据,依赖图中存在环
|
|
1172
1034
|
if (ganttReactData.criticalRowIds.length || ganttReactData.criticalLinks.length) {
|
|
1173
1035
|
ganttReactData.criticalPathFlag++;
|
|
1174
1036
|
}
|
|
@@ -1176,65 +1038,42 @@ function handleCriticalPath($xeGanttView, data, links) {
|
|
|
1176
1038
|
ganttReactData.criticalRowIds = [];
|
|
1177
1039
|
return;
|
|
1178
1040
|
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
var lkItem = _step4.value;
|
|
1189
|
-
var fromObjItem = nodeMap.get('' + lkItem.from);
|
|
1190
|
-
if (fromObjItem) {
|
|
1191
|
-
var need = forwardCriticalPathLowerBound(lkItem.type, fromObjItem.ES, fromObjItem.EF, _node.duration);
|
|
1192
|
-
if (need > earliestStart) {
|
|
1193
|
-
earliestStart = need;
|
|
1194
|
-
}
|
|
1041
|
+
let criticalDuration = 0;
|
|
1042
|
+
for (const node of orderList) {
|
|
1043
|
+
let earliestStart = 0;
|
|
1044
|
+
for (const lkItem of node.incoming) {
|
|
1045
|
+
const fromObjItem = nodeMap.get("" + lkItem.from);
|
|
1046
|
+
if (fromObjItem) {
|
|
1047
|
+
const need = forwardCriticalPathLowerBound(lkItem.type, fromObjItem.ES, fromObjItem.EF, node.duration);
|
|
1048
|
+
if (need > earliestStart) {
|
|
1049
|
+
earliestStart = need;
|
|
1195
1050
|
}
|
|
1196
1051
|
}
|
|
1197
|
-
} catch (err) {
|
|
1198
|
-
_iterator4.e(err);
|
|
1199
|
-
} finally {
|
|
1200
|
-
_iterator4.f();
|
|
1201
1052
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
if (
|
|
1205
|
-
criticalDuration =
|
|
1053
|
+
node.ES = earliestStart;
|
|
1054
|
+
node.EF = earliestStart + node.duration;
|
|
1055
|
+
if (node.EF > criticalDuration) {
|
|
1056
|
+
criticalDuration = node.EF;
|
|
1206
1057
|
}
|
|
1207
1058
|
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
var _toObjItem = nodeMap.get('' + _lkItem.to);
|
|
1218
|
-
if (_toObjItem) {
|
|
1219
|
-
var _need = backwardCriticalPathUpperBound(_lkItem.type, _toObjItem.LS, _toObjItem.LF, _node2.duration);
|
|
1220
|
-
if (_need < latestFinish) {
|
|
1221
|
-
latestFinish = _need;
|
|
1222
|
-
}
|
|
1059
|
+
for (let i = orderList.length - 1; i >= 0; i--) {
|
|
1060
|
+
const node = orderList[i];
|
|
1061
|
+
let latestFinish = criticalDuration;
|
|
1062
|
+
for (const lkItem of node.outgoing) {
|
|
1063
|
+
const toObjItem = nodeMap.get("" + lkItem.to);
|
|
1064
|
+
if (toObjItem) {
|
|
1065
|
+
const need = backwardCriticalPathUpperBound(lkItem.type, toObjItem.LS, toObjItem.LF, node.duration);
|
|
1066
|
+
if (need < latestFinish) {
|
|
1067
|
+
latestFinish = need;
|
|
1223
1068
|
}
|
|
1224
1069
|
}
|
|
1225
|
-
} catch (err) {
|
|
1226
|
-
_iterator5.e(err);
|
|
1227
|
-
} finally {
|
|
1228
|
-
_iterator5.f();
|
|
1229
1070
|
}
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
for (var _i2 = 0, _orderList2 = orderList; _i2 < _orderList2.length; _i2++) {
|
|
1237
|
-
var nodeItem = _orderList2[_i2];
|
|
1071
|
+
node.LF = latestFinish;
|
|
1072
|
+
node.LS = latestFinish - node.duration;
|
|
1073
|
+
}
|
|
1074
|
+
const criticalSet = /* @__PURE__ */ new Set();
|
|
1075
|
+
const criticalRowIds = [];
|
|
1076
|
+
for (const nodeItem of orderList) {
|
|
1238
1077
|
if (Math.abs(nodeItem.LS - nodeItem.ES) < tolerance) {
|
|
1239
1078
|
criticalSet.add(nodeItem.rowid);
|
|
1240
1079
|
criticalRowIds.push(nodeItem.rowid);
|
|
@@ -1242,23 +1081,19 @@ function handleCriticalPath($xeGanttView, data, links) {
|
|
|
1242
1081
|
criticalRowMaps.set(nodeItem.rowid, nodeItem.row);
|
|
1243
1082
|
}
|
|
1244
1083
|
}
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
var _fromObjItem = nodeMap.get('' + _lkItem2.from);
|
|
1251
|
-
if (!_toObjItem2 || !_fromObjItem) {
|
|
1084
|
+
const criticalLinks = [];
|
|
1085
|
+
for (const lkItem of linkList) {
|
|
1086
|
+
const toObjItem = nodeMap.get("" + lkItem.to);
|
|
1087
|
+
const fromObjItem = nodeMap.get("" + lkItem.from);
|
|
1088
|
+
if (!toObjItem || !fromObjItem) {
|
|
1252
1089
|
continue;
|
|
1253
1090
|
}
|
|
1254
|
-
|
|
1255
|
-
if (!criticalSet.has(_fromObjItem.rowid) || !criticalSet.has(_toObjItem2.rowid)) {
|
|
1091
|
+
if (!criticalSet.has(fromObjItem.rowid) || !criticalSet.has(toObjItem.rowid)) {
|
|
1256
1092
|
continue;
|
|
1257
1093
|
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
criticalLinkKeyMaps.set(getTaskLinkKey(_lkItem2.from, _lkItem2.to, _lkItem2.type), _lkItem2.raw);
|
|
1094
|
+
if (isCriticalPathLinkTight(lkItem.type, fromObjItem.ES, fromObjItem.EF, toObjItem.ES, toObjItem.EF, tolerance)) {
|
|
1095
|
+
criticalLinks.push(lkItem.raw);
|
|
1096
|
+
criticalLinkKeyMaps.set(getTaskLinkKey(lkItem.from, lkItem.to, lkItem.type), lkItem.raw);
|
|
1262
1097
|
}
|
|
1263
1098
|
}
|
|
1264
1099
|
ganttReactData.criticalLinks = criticalLinks;
|
|
@@ -1266,23 +1101,22 @@ function handleCriticalPath($xeGanttView, data, links) {
|
|
|
1266
1101
|
ganttReactData.criticalPathFlag++;
|
|
1267
1102
|
}
|
|
1268
1103
|
function calcScrollbar($xeGanttView) {
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
var overflowX = false;
|
|
1104
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1105
|
+
const reactData = $xeGanttView.reactData;
|
|
1106
|
+
const internalData = $xeGanttView.internalData;
|
|
1107
|
+
const ganttReactData = $xeGantt.reactData;
|
|
1108
|
+
const { scrollXWidth, scrollYHeight } = reactData;
|
|
1109
|
+
const { elemStore } = internalData;
|
|
1110
|
+
const scrollbarOpts = $xeGantt.computeScrollbarOpts;
|
|
1111
|
+
const bodyWrapperElem = (0, import_util.getRefElem)(elemStore["main-body-wrapper"]);
|
|
1112
|
+
const xHandleEl = $xeGanttView.$refs.refScrollXHandleElem;
|
|
1113
|
+
const yHandleEl = $xeGanttView.$refs.refScrollYHandleElem;
|
|
1114
|
+
let overflowY = false;
|
|
1115
|
+
let overflowX = false;
|
|
1282
1116
|
if (bodyWrapperElem) {
|
|
1283
1117
|
overflowY = scrollYHeight > bodyWrapperElem.clientHeight;
|
|
1284
1118
|
if (yHandleEl) {
|
|
1285
|
-
|
|
1119
|
+
const scrollbarWidth = scrollbarOpts.width || yHandleEl.offsetWidth - yHandleEl.clientWidth || 14;
|
|
1286
1120
|
reactData.scrollbarWidth = scrollbarWidth;
|
|
1287
1121
|
ganttReactData.scrollbarWidth = scrollbarWidth;
|
|
1288
1122
|
}
|
|
@@ -1290,7 +1124,7 @@ function calcScrollbar($xeGanttView) {
|
|
|
1290
1124
|
ganttReactData.overflowY = overflowY;
|
|
1291
1125
|
overflowX = scrollXWidth > bodyWrapperElem.clientWidth;
|
|
1292
1126
|
if (xHandleEl) {
|
|
1293
|
-
|
|
1127
|
+
const scrollbarHeight = scrollbarOpts.height || xHandleEl.offsetHeight - xHandleEl.clientHeight || 14;
|
|
1294
1128
|
reactData.scrollbarHeight = scrollbarHeight;
|
|
1295
1129
|
ganttReactData.scrollbarHeight = scrollbarHeight;
|
|
1296
1130
|
}
|
|
@@ -1299,106 +1133,93 @@ function calcScrollbar($xeGanttView) {
|
|
|
1299
1133
|
}
|
|
1300
1134
|
}
|
|
1301
1135
|
function handleSubTaskMinMaxSize($xeGanttView, $xeTable, list) {
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
if ((0,
|
|
1136
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1137
|
+
const internalData = $xeGanttView.internalData;
|
|
1138
|
+
const { chartMaps } = internalData;
|
|
1139
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
1140
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
1141
|
+
const typeField = $xeGantt.computeTypeField;
|
|
1142
|
+
let minChildLeftSize = 0;
|
|
1143
|
+
let maxChildLeftSize = 0;
|
|
1144
|
+
import_xe_utils.default.eachTree(list, (childRow) => {
|
|
1145
|
+
const childRowid = $xeTable.getRowid(childRow);
|
|
1146
|
+
const renderTaskType = import_xe_utils.default.get(childRow, typeField);
|
|
1147
|
+
if ((0, import_util.hasSubviewTask)(renderTaskType)) {
|
|
1314
1148
|
return;
|
|
1315
1149
|
}
|
|
1316
|
-
|
|
1150
|
+
const childChartRest = childRowid ? chartMaps[childRowid] : null;
|
|
1317
1151
|
if (childChartRest) {
|
|
1318
1152
|
maxChildLeftSize = Math.max(maxChildLeftSize, childChartRest.oLeftSize + childChartRest.oWidthSize);
|
|
1319
1153
|
minChildLeftSize = minChildLeftSize ? Math.min(minChildLeftSize, childChartRest.oLeftSize) : childChartRest.oLeftSize;
|
|
1320
1154
|
}
|
|
1321
|
-
}, {
|
|
1322
|
-
children: childrenField
|
|
1323
|
-
});
|
|
1155
|
+
}, { children: childrenField });
|
|
1324
1156
|
return {
|
|
1325
1157
|
minSize: minChildLeftSize,
|
|
1326
1158
|
maxSize: maxChildLeftSize
|
|
1327
1159
|
};
|
|
1328
1160
|
}
|
|
1329
1161
|
function updateTaskChartStyle($xeGanttView) {
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
var chartWrapper = (0, _util.getRefElem)(elemStore['main-chart-task-wrapper']);
|
|
1162
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1163
|
+
const reactData = $xeGanttView.reactData;
|
|
1164
|
+
const internalData = $xeGanttView.internalData;
|
|
1165
|
+
const ganttInternalData = $xeGantt.internalData;
|
|
1166
|
+
const $xeTable = internalData.xeTable;
|
|
1167
|
+
const { dragBarRow } = ganttInternalData;
|
|
1168
|
+
const { viewCellWidth } = reactData;
|
|
1169
|
+
const { elemStore, chartMaps } = internalData;
|
|
1170
|
+
const chartWrapper = (0, import_util.getRefElem)(elemStore["main-chart-task-wrapper"]);
|
|
1340
1171
|
if (chartWrapper && $xeTable) {
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1172
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
1173
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
1174
|
+
import_xe_utils.default.arrayEach(chartWrapper.children, (rowEl) => {
|
|
1175
|
+
const barEl = rowEl.children[0];
|
|
1345
1176
|
if (!barEl) {
|
|
1346
1177
|
return;
|
|
1347
1178
|
}
|
|
1348
|
-
|
|
1179
|
+
const rowid = rowEl.getAttribute("rowid");
|
|
1349
1180
|
if (dragBarRow && $xeTable.getRowid(dragBarRow) === rowid) {
|
|
1350
1181
|
return;
|
|
1351
1182
|
}
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
var childWrapperEl = barEl.firstElementChild;
|
|
1183
|
+
const chartRest = rowid ? chartMaps[rowid] : null;
|
|
1184
|
+
const row = chartRest ? chartRest.row : null;
|
|
1185
|
+
if ((0, import_dom.hasClass)(barEl, "is--subview")) {
|
|
1186
|
+
const childWrapperEl = barEl.firstElementChild;
|
|
1357
1187
|
if (childWrapperEl) {
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
var childChartRest = childRowid ? chartMaps[childRowid] : null;
|
|
1188
|
+
if ((0, import_dom.hasClass)(childWrapperEl, "is--inline")) {
|
|
1189
|
+
import_xe_utils.default.arrayEach(childWrapperEl.children, (childRowEl) => {
|
|
1190
|
+
const childBarEl = childRowEl.children[0];
|
|
1191
|
+
const childRowid = childBarEl.getAttribute("rowid") || "";
|
|
1192
|
+
const childChartRest = childRowid ? chartMaps[childRowid] : null;
|
|
1364
1193
|
if (childChartRest) {
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
maxChildLeftSize = _handleSubTaskMinMaxS.maxSize;
|
|
1372
|
-
childBarEl.style.left = "".concat(viewCellWidth * minChildLeftSize, "px");
|
|
1373
|
-
childBarEl.style.width = "".concat(viewCellWidth * (maxChildLeftSize - minChildLeftSize), "px");
|
|
1194
|
+
const childRow = childChartRest.row;
|
|
1195
|
+
if ((0, import_dom.hasClass)(childBarEl, "is--subview")) {
|
|
1196
|
+
const subChildren = childRow[childrenField];
|
|
1197
|
+
const { minSize: minChildLeftSize, maxSize: maxChildLeftSize } = handleSubTaskMinMaxSize($xeGanttView, $xeTable, subChildren);
|
|
1198
|
+
childBarEl.style.left = `${viewCellWidth * minChildLeftSize}px`;
|
|
1199
|
+
childBarEl.style.width = `${viewCellWidth * (maxChildLeftSize - minChildLeftSize)}px`;
|
|
1374
1200
|
} else {
|
|
1375
|
-
childBarEl.style.left =
|
|
1376
|
-
if (!(0,
|
|
1377
|
-
|
|
1378
|
-
childBarEl.style.width = "".concat((0, _util.getTaskBarWidth)(childChartRest, viewCellWidth), "px");
|
|
1201
|
+
childBarEl.style.left = `${(0, import_util.getTaskBarLeft)(childChartRest, viewCellWidth)}px`;
|
|
1202
|
+
if (!(0, import_dom.hasClass)(childBarEl, "is--milestone")) {
|
|
1203
|
+
childBarEl.style.width = `${(0, import_util.getTaskBarWidth)(childChartRest, viewCellWidth)}px`;
|
|
1379
1204
|
}
|
|
1380
1205
|
}
|
|
1381
1206
|
}
|
|
1382
1207
|
});
|
|
1383
1208
|
} else {
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
var childBarEl = childRowEl ? childRowEl.children[0] : null;
|
|
1209
|
+
const childRowEl = childWrapperEl.children[0];
|
|
1210
|
+
const childBarEl = childRowEl ? childRowEl.children[0] : null;
|
|
1387
1211
|
if (childBarEl) {
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
childBarEl.style.left = "".concat(viewCellWidth * minChildLeftSize, "px");
|
|
1393
|
-
childBarEl.style.width = "".concat(viewCellWidth * (maxChildLeftSize - minChildLeftSize), "px");
|
|
1212
|
+
const rowChildren = row ? row[childrenField] : [];
|
|
1213
|
+
const { minSize: minChildLeftSize, maxSize: maxChildLeftSize } = handleSubTaskMinMaxSize($xeGanttView, $xeTable, rowChildren);
|
|
1214
|
+
childBarEl.style.left = `${viewCellWidth * minChildLeftSize}px`;
|
|
1215
|
+
childBarEl.style.width = `${viewCellWidth * (maxChildLeftSize - minChildLeftSize)}px`;
|
|
1394
1216
|
}
|
|
1395
1217
|
}
|
|
1396
1218
|
}
|
|
1397
1219
|
} else {
|
|
1398
|
-
barEl.style.left =
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
barEl.style.width = "".concat((0, _util.getTaskBarWidth)(chartRest, viewCellWidth), "px");
|
|
1220
|
+
barEl.style.left = `${(0, import_util.getTaskBarLeft)(chartRest, viewCellWidth)}px`;
|
|
1221
|
+
if (!(0, import_dom.hasClass)(barEl, "is--milestone")) {
|
|
1222
|
+
barEl.style.width = `${(0, import_util.getTaskBarWidth)(chartRest, viewCellWidth)}px`;
|
|
1402
1223
|
}
|
|
1403
1224
|
}
|
|
1404
1225
|
});
|
|
@@ -1406,111 +1227,107 @@ function updateTaskChartStyle($xeGanttView) {
|
|
|
1406
1227
|
return $xeGanttView.$nextTick();
|
|
1407
1228
|
}
|
|
1408
1229
|
function updateStyle($xeGanttView) {
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
var elemStore = internalData.elemStore,
|
|
1419
|
-
visibleColumn = internalData.visibleColumn;
|
|
1420
|
-
var $xeTable = internalData.xeTable;
|
|
1421
|
-
var el = $xeGanttView.$refs.refElem;
|
|
1230
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1231
|
+
const reactData = $xeGanttView.reactData;
|
|
1232
|
+
const internalData = $xeGanttView.internalData;
|
|
1233
|
+
const ganttReactData = $xeGantt.reactData;
|
|
1234
|
+
const { showLeftView } = ganttReactData;
|
|
1235
|
+
const { scrollbarWidth, scrollbarHeight, headerGroups, tableColumn } = reactData;
|
|
1236
|
+
const { elemStore, visibleColumn } = internalData;
|
|
1237
|
+
const $xeTable = internalData.xeTable;
|
|
1238
|
+
const el = $xeGanttView.$refs.refElem;
|
|
1422
1239
|
if (!el) {
|
|
1423
1240
|
return;
|
|
1424
1241
|
}
|
|
1425
1242
|
if (!$xeGantt) {
|
|
1426
1243
|
return;
|
|
1427
1244
|
}
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1245
|
+
const scrollYVisible = $xeGanttView.computeScrollYVisible;
|
|
1246
|
+
const scrollbarXToTop = $xeGantt.computeScrollbarXToTop;
|
|
1247
|
+
const scrollbarYToLeft = $xeGantt.computeScrollbarYToLeft;
|
|
1248
|
+
const xLeftCornerEl = $xeGanttView.$refs.refScrollXLeftCornerElem;
|
|
1249
|
+
const xRightCornerEl = $xeGanttView.$refs.refScrollXRightCornerElem;
|
|
1250
|
+
const scrollXVirtualEl = $xeGanttView.$refs.refScrollXVirtualElem;
|
|
1251
|
+
let osbWidth = scrollbarWidth;
|
|
1252
|
+
const osbHeight = scrollbarHeight;
|
|
1253
|
+
let tbHeight = 0;
|
|
1254
|
+
let tHeaderHeight = 0;
|
|
1255
|
+
let tFooterHeight = 0;
|
|
1439
1256
|
if ($xeTable) {
|
|
1440
|
-
|
|
1257
|
+
const tableInternalData = $xeTable.getInternalData();
|
|
1441
1258
|
tbHeight = tableInternalData.tBodyHeight;
|
|
1442
1259
|
tHeaderHeight = tableInternalData.tHeaderHeight;
|
|
1443
1260
|
tFooterHeight = tableInternalData.tFooterHeight;
|
|
1444
1261
|
}
|
|
1445
|
-
|
|
1446
|
-
|
|
1262
|
+
let yScrollbarVisible = "visible";
|
|
1263
|
+
const hideYScroll = scrollYVisible === false || scrollYVisible === "hidden";
|
|
1447
1264
|
if (hideYScroll || scrollbarYToLeft && showLeftView) {
|
|
1448
1265
|
osbWidth = 0;
|
|
1449
|
-
yScrollbarVisible =
|
|
1266
|
+
yScrollbarVisible = "hidden";
|
|
1450
1267
|
}
|
|
1451
|
-
|
|
1268
|
+
const headerScrollElem = (0, import_util.getRefElem)(elemStore["main-header-scroll"]);
|
|
1452
1269
|
if (headerScrollElem) {
|
|
1453
|
-
headerScrollElem.style.height =
|
|
1454
|
-
headerScrollElem.style.setProperty(
|
|
1270
|
+
headerScrollElem.style.height = `${tHeaderHeight}px`;
|
|
1271
|
+
headerScrollElem.style.setProperty("--vxe-ui-gantt-view-cell-height", `${tHeaderHeight / headerGroups.length}px`);
|
|
1455
1272
|
}
|
|
1456
|
-
|
|
1273
|
+
const bodyScrollElem = (0, import_util.getRefElem)(elemStore["main-body-scroll"]);
|
|
1457
1274
|
if (bodyScrollElem) {
|
|
1458
|
-
bodyScrollElem.style.height =
|
|
1275
|
+
bodyScrollElem.style.height = `${tbHeight}px`;
|
|
1459
1276
|
}
|
|
1460
|
-
|
|
1277
|
+
const footerScrollElem = (0, import_util.getRefElem)(elemStore["main-footer-scroll"]);
|
|
1461
1278
|
if (footerScrollElem) {
|
|
1462
|
-
footerScrollElem.style.height =
|
|
1279
|
+
footerScrollElem.style.height = `${tFooterHeight}px`;
|
|
1463
1280
|
}
|
|
1464
1281
|
if (scrollXVirtualEl) {
|
|
1465
|
-
scrollXVirtualEl.style.height =
|
|
1466
|
-
scrollXVirtualEl.style.visibility =
|
|
1282
|
+
scrollXVirtualEl.style.height = `${osbHeight}px`;
|
|
1283
|
+
scrollXVirtualEl.style.visibility = "visible";
|
|
1467
1284
|
}
|
|
1468
|
-
|
|
1285
|
+
const xWrapperEl = $xeGanttView.$refs.refScrollXWrapperElem;
|
|
1469
1286
|
if (xWrapperEl) {
|
|
1470
|
-
xWrapperEl.style.left = scrollbarXToTop ?
|
|
1471
|
-
xWrapperEl.style.width =
|
|
1287
|
+
xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : "";
|
|
1288
|
+
xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`;
|
|
1472
1289
|
}
|
|
1473
1290
|
if (xLeftCornerEl) {
|
|
1474
|
-
xLeftCornerEl.style.width = scrollbarXToTop ?
|
|
1475
|
-
xLeftCornerEl.style.display = scrollbarXToTop ? osbHeight ?
|
|
1291
|
+
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : "";
|
|
1292
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? osbHeight ? "block" : "" : "";
|
|
1476
1293
|
}
|
|
1477
1294
|
if (xRightCornerEl) {
|
|
1478
|
-
xRightCornerEl.style.width = scrollbarXToTop ?
|
|
1479
|
-
xRightCornerEl.style.display = scrollbarXToTop ?
|
|
1295
|
+
xRightCornerEl.style.width = scrollbarXToTop ? "" : `${osbWidth}px`;
|
|
1296
|
+
xRightCornerEl.style.display = scrollbarXToTop ? "" : osbHeight ? "block" : "";
|
|
1480
1297
|
}
|
|
1481
|
-
|
|
1298
|
+
const scrollYVirtualEl = $xeGanttView.$refs.refScrollYVirtualElem;
|
|
1482
1299
|
if (scrollYVirtualEl) {
|
|
1483
|
-
scrollYVirtualEl.style.width =
|
|
1484
|
-
scrollYVirtualEl.style.height =
|
|
1300
|
+
scrollYVirtualEl.style.width = `${osbWidth}px`;
|
|
1301
|
+
scrollYVirtualEl.style.height = `${tbHeight + tHeaderHeight + tFooterHeight}px`;
|
|
1485
1302
|
scrollYVirtualEl.style.visibility = yScrollbarVisible;
|
|
1486
1303
|
}
|
|
1487
|
-
|
|
1304
|
+
const yTopCornerEl = $xeGanttView.$refs.refScrollYTopCornerElem;
|
|
1488
1305
|
if (yTopCornerEl) {
|
|
1489
|
-
yTopCornerEl.style.height =
|
|
1490
|
-
yTopCornerEl.style.display = tHeaderHeight ?
|
|
1306
|
+
yTopCornerEl.style.height = `${tHeaderHeight}px`;
|
|
1307
|
+
yTopCornerEl.style.display = tHeaderHeight ? "block" : "";
|
|
1491
1308
|
}
|
|
1492
|
-
|
|
1309
|
+
const yWrapperEl = $xeGanttView.$refs.refScrollYWrapperElem;
|
|
1493
1310
|
if (yWrapperEl) {
|
|
1494
|
-
yWrapperEl.style.height =
|
|
1495
|
-
yWrapperEl.style.top =
|
|
1311
|
+
yWrapperEl.style.height = `${tbHeight}px`;
|
|
1312
|
+
yWrapperEl.style.top = `${tHeaderHeight}px`;
|
|
1496
1313
|
}
|
|
1497
|
-
|
|
1314
|
+
const yBottomCornerEl = $xeGanttView.$refs.refScrollYBottomCornerElem;
|
|
1498
1315
|
if (yBottomCornerEl) {
|
|
1499
|
-
yBottomCornerEl.style.height =
|
|
1500
|
-
yBottomCornerEl.style.top =
|
|
1501
|
-
yBottomCornerEl.style.display = tFooterHeight ?
|
|
1316
|
+
yBottomCornerEl.style.height = `${tFooterHeight}px`;
|
|
1317
|
+
yBottomCornerEl.style.top = `${tHeaderHeight + tbHeight}px`;
|
|
1318
|
+
yBottomCornerEl.style.display = tFooterHeight ? "block" : "";
|
|
1502
1319
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1320
|
+
const colInfoElem = $xeGanttView.$refs.refColInfoElem;
|
|
1321
|
+
let viewCellWidth = 40;
|
|
1505
1322
|
if (colInfoElem) {
|
|
1506
1323
|
viewCellWidth = colInfoElem.clientWidth || 40;
|
|
1507
1324
|
}
|
|
1508
|
-
|
|
1325
|
+
let viewTableWidth = viewCellWidth;
|
|
1509
1326
|
if (visibleColumn.length) {
|
|
1510
1327
|
viewTableWidth = Math.max(0, viewCellWidth * visibleColumn.length);
|
|
1511
1328
|
if (bodyScrollElem) {
|
|
1512
|
-
|
|
1513
|
-
|
|
1329
|
+
const viewWidth = bodyScrollElem.clientWidth;
|
|
1330
|
+
const remainWidth = viewWidth - viewTableWidth;
|
|
1514
1331
|
if (remainWidth > 0) {
|
|
1515
1332
|
viewCellWidth += Math.max(0, remainWidth / visibleColumn.length);
|
|
1516
1333
|
viewTableWidth = viewWidth;
|
|
@@ -1518,22 +1335,25 @@ function updateStyle($xeGanttView) {
|
|
|
1518
1335
|
}
|
|
1519
1336
|
}
|
|
1520
1337
|
reactData.viewCellWidth = viewCellWidth;
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1338
|
+
const headerTableElem = (0, import_util.getRefElem)(elemStore["main-header-table"]);
|
|
1339
|
+
const bodyTableElem = (0, import_util.getRefElem)(elemStore["main-body-table"]);
|
|
1340
|
+
const vmTableWidth = viewCellWidth * tableColumn.length;
|
|
1524
1341
|
if (headerTableElem) {
|
|
1525
|
-
headerTableElem.style.width =
|
|
1342
|
+
headerTableElem.style.width = `${viewTableWidth}px`;
|
|
1526
1343
|
}
|
|
1527
1344
|
if (bodyTableElem) {
|
|
1528
|
-
bodyTableElem.style.width =
|
|
1345
|
+
bodyTableElem.style.width = `${vmTableWidth}px`;
|
|
1529
1346
|
}
|
|
1530
1347
|
reactData.scrollXWidth = viewTableWidth;
|
|
1531
|
-
return Promise.all([
|
|
1348
|
+
return Promise.all([
|
|
1349
|
+
updateTaskChartStyle($xeGanttView),
|
|
1350
|
+
$xeGantt.handleUpTaskLinkStyle ? $xeGantt.handleUpTaskLinkStyle($xeGanttView) : null
|
|
1351
|
+
]);
|
|
1532
1352
|
}
|
|
1533
1353
|
function handleRecalculateStyle($xeGanttView) {
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1354
|
+
const internalData = $xeGanttView.internalData;
|
|
1355
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1356
|
+
const el = $xeGanttView.$refs.refElem;
|
|
1537
1357
|
internalData.rceRunTime = Date.now();
|
|
1538
1358
|
if (!el || !el.clientWidth) {
|
|
1539
1359
|
return $xeGanttView.$nextTick();
|
|
@@ -1545,55 +1365,55 @@ function handleRecalculateStyle($xeGanttView) {
|
|
|
1545
1365
|
updateStyle($xeGanttView);
|
|
1546
1366
|
return computeScrollLoad($xeGanttView);
|
|
1547
1367
|
}
|
|
1548
|
-
function
|
|
1549
|
-
|
|
1550
|
-
return new Promise(
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
var refreshDelay = 30;
|
|
1368
|
+
function handleLazyRecalculate($xeGanttView) {
|
|
1369
|
+
const internalData = $xeGanttView.internalData;
|
|
1370
|
+
return new Promise((resolve) => {
|
|
1371
|
+
const { rceTimeout, rceRunTime } = internalData;
|
|
1372
|
+
const $xeTable = internalData.xeTable;
|
|
1373
|
+
let refreshDelay = 30;
|
|
1555
1374
|
if ($xeTable) {
|
|
1556
|
-
|
|
1375
|
+
const resizeOpts = $xeTable.computeResizeOpts;
|
|
1557
1376
|
refreshDelay = resizeOpts.refreshDelay || refreshDelay;
|
|
1558
1377
|
}
|
|
1559
1378
|
$xeGanttView.updateScrollbar();
|
|
1560
1379
|
if (rceTimeout) {
|
|
1561
1380
|
clearTimeout(rceTimeout);
|
|
1562
1381
|
if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
|
|
1563
|
-
resolve(
|
|
1382
|
+
resolve(
|
|
1383
|
+
handleRecalculateStyle($xeGanttView)
|
|
1384
|
+
);
|
|
1564
1385
|
} else {
|
|
1565
|
-
$xeGanttView.$nextTick(
|
|
1386
|
+
$xeGanttView.$nextTick(() => {
|
|
1566
1387
|
resolve();
|
|
1567
1388
|
});
|
|
1568
1389
|
}
|
|
1569
1390
|
} else {
|
|
1570
|
-
resolve(
|
|
1391
|
+
resolve(
|
|
1392
|
+
handleRecalculateStyle($xeGanttView)
|
|
1393
|
+
);
|
|
1571
1394
|
}
|
|
1572
|
-
internalData.rceTimeout = setTimeout(
|
|
1573
|
-
internalData.rceTimeout =
|
|
1395
|
+
internalData.rceTimeout = setTimeout(() => {
|
|
1396
|
+
internalData.rceTimeout = void 0;
|
|
1574
1397
|
handleRecalculateStyle($xeGanttView);
|
|
1575
1398
|
}, refreshDelay);
|
|
1576
1399
|
});
|
|
1577
1400
|
}
|
|
1578
1401
|
function computeScrollLoad($xeGanttView) {
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
return $xeGanttView.$nextTick().then(
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
// 计算 X 逻辑
|
|
1402
|
+
const reactData = $xeGanttView.reactData;
|
|
1403
|
+
const internalData = $xeGanttView.internalData;
|
|
1404
|
+
return $xeGanttView.$nextTick().then(() => {
|
|
1405
|
+
const { scrollXLoad } = reactData;
|
|
1406
|
+
const { scrollXStore } = internalData;
|
|
1585
1407
|
if (scrollXLoad) {
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
visibleXSize = _handleVirtualXVisibl.visibleSize;
|
|
1589
|
-
var offsetXSize = 2;
|
|
1408
|
+
const { toVisibleIndex: toXVisibleIndex, visibleSize: visibleXSize } = handleVirtualXVisible($xeGanttView);
|
|
1409
|
+
const offsetXSize = 2;
|
|
1590
1410
|
scrollXStore.preloadSize = 1;
|
|
1591
1411
|
scrollXStore.offsetSize = offsetXSize;
|
|
1592
1412
|
scrollXStore.visibleSize = visibleXSize;
|
|
1593
1413
|
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
|
|
1594
1414
|
scrollXStore.visibleStartIndex = Math.max(scrollXStore.startIndex, toXVisibleIndex);
|
|
1595
1415
|
scrollXStore.visibleEndIndex = Math.min(scrollXStore.endIndex, toXVisibleIndex + visibleXSize);
|
|
1596
|
-
updateScrollXData($xeGanttView).then(
|
|
1416
|
+
updateScrollXData($xeGanttView).then(() => {
|
|
1597
1417
|
loadScrollXData($xeGanttView);
|
|
1598
1418
|
});
|
|
1599
1419
|
} else {
|
|
@@ -1602,46 +1422,34 @@ function computeScrollLoad($xeGanttView) {
|
|
|
1602
1422
|
});
|
|
1603
1423
|
}
|
|
1604
1424
|
function handleVirtualXVisible($xeGanttView) {
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1425
|
+
const reactData = $xeGanttView.reactData;
|
|
1426
|
+
const internalData = $xeGanttView.internalData;
|
|
1427
|
+
const { viewCellWidth } = reactData;
|
|
1428
|
+
const { elemStore } = internalData;
|
|
1429
|
+
const bodyScrollElem = (0, import_util.getRefElem)(elemStore["main-body-scroll"]);
|
|
1610
1430
|
if (bodyScrollElem) {
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
return {
|
|
1616
|
-
toVisibleIndex: Math.max(0, toVisibleIndex),
|
|
1617
|
-
visibleSize: Math.max(1, visibleSize)
|
|
1618
|
-
};
|
|
1431
|
+
const clientWidth = bodyScrollElem.clientWidth;
|
|
1432
|
+
const scrollLeft = bodyScrollElem.scrollLeft;
|
|
1433
|
+
const toVisibleIndex = Math.floor(scrollLeft / viewCellWidth) - 1;
|
|
1434
|
+
const visibleSize = Math.ceil(clientWidth / viewCellWidth) + 1;
|
|
1435
|
+
return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(1, visibleSize) };
|
|
1619
1436
|
}
|
|
1620
|
-
return {
|
|
1621
|
-
toVisibleIndex: 0,
|
|
1622
|
-
visibleSize: 6
|
|
1623
|
-
};
|
|
1437
|
+
return { toVisibleIndex: 0, visibleSize: 6 };
|
|
1624
1438
|
}
|
|
1625
1439
|
function loadScrollXData($xeGanttView) {
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
offsetSize = scrollXStore.offsetSize;
|
|
1634
|
-
var _handleVirtualXVisibl2 = handleVirtualXVisible($xeGanttView),
|
|
1635
|
-
toVisibleIndex = _handleVirtualXVisibl2.toVisibleIndex,
|
|
1636
|
-
visibleSize = _handleVirtualXVisibl2.visibleSize;
|
|
1637
|
-
var offsetItem = {
|
|
1440
|
+
const reactData = $xeGanttView.reactData;
|
|
1441
|
+
const internalData = $xeGanttView.internalData;
|
|
1442
|
+
const { isScrollXBig } = reactData;
|
|
1443
|
+
const { scrollXStore } = internalData;
|
|
1444
|
+
const { preloadSize, startIndex, endIndex, offsetSize } = scrollXStore;
|
|
1445
|
+
const { toVisibleIndex, visibleSize } = handleVirtualXVisible($xeGanttView);
|
|
1446
|
+
const offsetItem = {
|
|
1638
1447
|
startIndex: Math.max(0, isScrollXBig ? toVisibleIndex - 1 : toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
1639
1448
|
endIndex: isScrollXBig ? toVisibleIndex + visibleSize : toVisibleIndex + visibleSize + offsetSize + preloadSize
|
|
1640
1449
|
};
|
|
1641
1450
|
scrollXStore.visibleStartIndex = toVisibleIndex - 1;
|
|
1642
1451
|
scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
|
|
1643
|
-
|
|
1644
|
-
offsetEndIndex = offsetItem.endIndex;
|
|
1452
|
+
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
|
|
1645
1453
|
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
1646
1454
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
1647
1455
|
scrollXStore.startIndex = offsetStartIndex;
|
|
@@ -1656,66 +1464,54 @@ function updateScrollXData($xeGanttView) {
|
|
|
1656
1464
|
return $xeGanttView.$nextTick();
|
|
1657
1465
|
}
|
|
1658
1466
|
function updateScrollXStatus($xeGanttView) {
|
|
1659
|
-
|
|
1660
|
-
|
|
1467
|
+
const reactData = $xeGanttView.reactData;
|
|
1468
|
+
const scrollXLoad = true;
|
|
1661
1469
|
reactData.scrollXLoad = scrollXLoad;
|
|
1662
1470
|
return scrollXLoad;
|
|
1663
1471
|
}
|
|
1664
1472
|
function handleTableColumn($xeGanttView) {
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
var tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0);
|
|
1473
|
+
const reactData = $xeGanttView.reactData;
|
|
1474
|
+
const internalData = $xeGanttView.internalData;
|
|
1475
|
+
const { scrollXLoad } = reactData;
|
|
1476
|
+
const { visibleColumn, scrollXStore } = internalData;
|
|
1477
|
+
const tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0);
|
|
1671
1478
|
reactData.tableColumn = tableColumn;
|
|
1672
1479
|
}
|
|
1673
1480
|
function updateScrollXSpace($xeGanttView) {
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
var bodyTableElem = (0, _util.getRefElem)(elemStore['main-body-table']);
|
|
1682
|
-
// const headerTableElem = getRefElem(elemStore['main-header-table'])
|
|
1683
|
-
// const footerTableElem = getRefElem(elemStore['main-footer-table'])
|
|
1684
|
-
var startIndex = scrollXStore.startIndex;
|
|
1685
|
-
var xSpaceLeft = 0;
|
|
1481
|
+
const reactData = $xeGanttView.reactData;
|
|
1482
|
+
const internalData = $xeGanttView.internalData;
|
|
1483
|
+
const { scrollXLoad, scrollXWidth, viewCellWidth } = reactData;
|
|
1484
|
+
const { elemStore, scrollXStore } = internalData;
|
|
1485
|
+
const bodyTableElem = (0, import_util.getRefElem)(elemStore["main-body-table"]);
|
|
1486
|
+
const { startIndex } = scrollXStore;
|
|
1487
|
+
let xSpaceLeft = 0;
|
|
1686
1488
|
if (scrollXLoad) {
|
|
1687
1489
|
xSpaceLeft = Math.max(0, startIndex * viewCellWidth);
|
|
1688
1490
|
}
|
|
1689
|
-
// if (headerTableElem) {
|
|
1690
|
-
// headerTableElem.style.transform = `translate(${xSpaceLeft}px, 0px)`
|
|
1691
|
-
// }
|
|
1692
1491
|
if (bodyTableElem) {
|
|
1693
|
-
bodyTableElem.style.transform =
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
var layoutList = ['header', 'body', 'footer'];
|
|
1700
|
-
layoutList.forEach(function (layout) {
|
|
1701
|
-
var xSpaceElem = (0, _util.getRefElem)(elemStore["main-".concat(layout, "-xSpace")]);
|
|
1492
|
+
bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`;
|
|
1493
|
+
}
|
|
1494
|
+
const ySpaceWidth = scrollXWidth;
|
|
1495
|
+
const layoutList = ["header", "body", "footer"];
|
|
1496
|
+
layoutList.forEach((layout) => {
|
|
1497
|
+
const xSpaceElem = (0, import_util.getRefElem)(elemStore[`main-${layout}-xSpace`]);
|
|
1702
1498
|
if (xSpaceElem) {
|
|
1703
|
-
xSpaceElem.style.width = scrollXLoad ?
|
|
1499
|
+
xSpaceElem.style.width = scrollXLoad ? `${ySpaceWidth}px` : "";
|
|
1704
1500
|
}
|
|
1705
1501
|
});
|
|
1706
|
-
|
|
1502
|
+
const scrollXSpaceEl = $xeGanttView.$refs.refScrollXSpaceElem;
|
|
1707
1503
|
if (scrollXSpaceEl) {
|
|
1708
|
-
scrollXSpaceEl.style.width =
|
|
1504
|
+
scrollXSpaceEl.style.width = `${ySpaceWidth}px`;
|
|
1709
1505
|
}
|
|
1710
|
-
|
|
1711
|
-
|
|
1506
|
+
const beforeWrapper = (0, import_util.getRefElem)(elemStore["main-chart-before-wrapper"]);
|
|
1507
|
+
const beforeSvgElem = beforeWrapper ? beforeWrapper.firstElementChild : null;
|
|
1712
1508
|
if (beforeSvgElem) {
|
|
1713
|
-
beforeSvgElem.style.width =
|
|
1509
|
+
beforeSvgElem.style.width = `${ySpaceWidth}px`;
|
|
1714
1510
|
}
|
|
1715
|
-
|
|
1716
|
-
|
|
1511
|
+
const afterWrapper = (0, import_util.getRefElem)(elemStore["main-chart-after-wrapper"]);
|
|
1512
|
+
const afterSvgElem = afterWrapper ? afterWrapper.firstElementChild : null;
|
|
1717
1513
|
if (afterSvgElem) {
|
|
1718
|
-
afterSvgElem.style.width =
|
|
1514
|
+
afterSvgElem.style.width = `${ySpaceWidth}px`;
|
|
1719
1515
|
}
|
|
1720
1516
|
reactData.scrollXLeft = xSpaceLeft;
|
|
1721
1517
|
reactData.scrollXWidth = ySpaceWidth;
|
|
@@ -1726,31 +1522,29 @@ function triggerScrollXEvent($xeGanttView) {
|
|
|
1726
1522
|
loadScrollXData($xeGanttView);
|
|
1727
1523
|
}
|
|
1728
1524
|
function updateScrollYSpace($xeGanttView) {
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
var isScrollYBig = false;
|
|
1525
|
+
const reactData = $xeGanttView.reactData;
|
|
1526
|
+
const internalData = $xeGanttView.internalData;
|
|
1527
|
+
const { scrollYLoad, overflowY } = reactData;
|
|
1528
|
+
const { elemStore } = internalData;
|
|
1529
|
+
const $xeTable = internalData.xeTable;
|
|
1530
|
+
const bodyScrollElem = (0, import_util.getRefElem)(elemStore["main-body-scroll"]);
|
|
1531
|
+
const bodyTableElem = (0, import_util.getRefElem)(elemStore["main-body-table"]);
|
|
1532
|
+
let ySpaceTop = 0;
|
|
1533
|
+
let scrollYHeight = 0;
|
|
1534
|
+
let isScrollYBig = false;
|
|
1740
1535
|
if ($xeTable) {
|
|
1741
|
-
|
|
1536
|
+
const tableReactData = $xeTable.getReactData();
|
|
1742
1537
|
ySpaceTop = tableReactData.scrollYTop;
|
|
1743
1538
|
scrollYHeight = tableReactData.scrollYHeight;
|
|
1744
1539
|
isScrollYBig = tableReactData.isScrollYBig;
|
|
1745
1540
|
}
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1541
|
+
let ySpaceHeight = scrollYHeight;
|
|
1542
|
+
let scrollYTop = ySpaceTop;
|
|
1543
|
+
let clientHeight = 0;
|
|
1749
1544
|
if (bodyScrollElem) {
|
|
1750
1545
|
clientHeight = bodyScrollElem.clientHeight;
|
|
1751
1546
|
}
|
|
1752
1547
|
if (isScrollYBig) {
|
|
1753
|
-
// 触底
|
|
1754
1548
|
if (bodyScrollElem && bodyTableElem && bodyScrollElem.scrollTop + clientHeight >= maxYHeight) {
|
|
1755
1549
|
scrollYTop = maxYHeight - bodyTableElem.clientHeight;
|
|
1756
1550
|
} else {
|
|
@@ -1761,56 +1555,55 @@ function updateScrollYSpace($xeGanttView) {
|
|
|
1761
1555
|
if (!(scrollYLoad && overflowY)) {
|
|
1762
1556
|
scrollYTop = 0;
|
|
1763
1557
|
}
|
|
1764
|
-
|
|
1558
|
+
const bodyChartWrapperElem = (0, import_util.getRefElem)(elemStore["main-chart-task-wrapper"]);
|
|
1765
1559
|
if (bodyTableElem) {
|
|
1766
|
-
bodyTableElem.style.transform =
|
|
1560
|
+
bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`;
|
|
1767
1561
|
}
|
|
1768
1562
|
if (bodyChartWrapperElem) {
|
|
1769
|
-
bodyChartWrapperElem.style.transform =
|
|
1563
|
+
bodyChartWrapperElem.style.transform = `translateY(${scrollYTop}px)`;
|
|
1770
1564
|
}
|
|
1771
|
-
|
|
1565
|
+
const bodyYSpaceElem = (0, import_util.getRefElem)(elemStore["main-body-ySpace"]);
|
|
1772
1566
|
if (bodyYSpaceElem) {
|
|
1773
|
-
bodyYSpaceElem.style.height = ySpaceHeight ?
|
|
1567
|
+
bodyYSpaceElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : "";
|
|
1774
1568
|
}
|
|
1775
|
-
|
|
1569
|
+
const scrollYSpaceEl = $xeGanttView.$refs.refScrollYSpaceElem;
|
|
1776
1570
|
if (scrollYSpaceEl) {
|
|
1777
|
-
scrollYSpaceEl.style.height = ySpaceHeight ?
|
|
1571
|
+
scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : "";
|
|
1778
1572
|
}
|
|
1779
|
-
|
|
1780
|
-
|
|
1573
|
+
const beforeWrapper = (0, import_util.getRefElem)(elemStore["main-chart-before-wrapper"]);
|
|
1574
|
+
const beforeSvgElem = beforeWrapper ? beforeWrapper.firstElementChild : null;
|
|
1781
1575
|
if (beforeSvgElem) {
|
|
1782
|
-
beforeSvgElem.style.height = ySpaceHeight ?
|
|
1576
|
+
beforeSvgElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : "";
|
|
1783
1577
|
}
|
|
1784
|
-
|
|
1785
|
-
|
|
1578
|
+
const afterWrapper = (0, import_util.getRefElem)(elemStore["main-chart-after-wrapper"]);
|
|
1579
|
+
const afterSvgElem = afterWrapper ? afterWrapper.firstElementChild : null;
|
|
1786
1580
|
if (afterSvgElem) {
|
|
1787
|
-
afterSvgElem.style.height = ySpaceHeight ?
|
|
1581
|
+
afterSvgElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : "";
|
|
1788
1582
|
}
|
|
1789
|
-
|
|
1583
|
+
const nowLineElem = (0, import_util.getRefElem)(elemStore["main-chart-now-line"]);
|
|
1790
1584
|
if (nowLineElem) {
|
|
1791
|
-
nowLineElem.style.height = ySpaceHeight ?
|
|
1585
|
+
nowLineElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : "";
|
|
1792
1586
|
}
|
|
1793
1587
|
reactData.scrollYTop = scrollYTop;
|
|
1794
1588
|
reactData.scrollYHeight = scrollYHeight;
|
|
1795
1589
|
reactData.isScrollYBig = isScrollYBig;
|
|
1796
1590
|
calcScrollbar($xeGanttView);
|
|
1797
|
-
return $xeGanttView.$nextTick().then(
|
|
1591
|
+
return $xeGanttView.$nextTick().then(() => {
|
|
1798
1592
|
updateStyle($xeGanttView);
|
|
1799
1593
|
});
|
|
1800
1594
|
}
|
|
1801
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1802
1595
|
function checkLastSyncScroll($xeGanttView, isRollX, isRollY) {
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1596
|
+
const reactData = $xeGanttView.reactData;
|
|
1597
|
+
const internalData = $xeGanttView.internalData;
|
|
1598
|
+
const { lcsTimeout } = internalData;
|
|
1806
1599
|
reactData.lazScrollLoading = true;
|
|
1807
1600
|
if (lcsTimeout) {
|
|
1808
1601
|
clearTimeout(lcsTimeout);
|
|
1809
1602
|
}
|
|
1810
|
-
internalData.lcsTimeout = setTimeout(
|
|
1811
|
-
|
|
1603
|
+
internalData.lcsTimeout = setTimeout(() => {
|
|
1604
|
+
const $xeTable = internalData.xeTable;
|
|
1812
1605
|
internalData.lcsRunTime = Date.now();
|
|
1813
|
-
internalData.lcsTimeout =
|
|
1606
|
+
internalData.lcsTimeout = void 0;
|
|
1814
1607
|
internalData.intoRunScroll = false;
|
|
1815
1608
|
internalData.inVirtualScroll = false;
|
|
1816
1609
|
internalData.inWheelScroll = false;
|
|
@@ -1820,14 +1613,14 @@ function checkLastSyncScroll($xeGanttView, isRollX, isRollY) {
|
|
|
1820
1613
|
internalData.isSyncTableScrollTop = false;
|
|
1821
1614
|
reactData.lazScrollLoading = false;
|
|
1822
1615
|
if ($xeTable) {
|
|
1823
|
-
|
|
1616
|
+
const tableInternalData = $xeTable.getInternalData();
|
|
1824
1617
|
tableInternalData.isSyncGanttScrollTop = false;
|
|
1825
1618
|
}
|
|
1826
1619
|
}, 200);
|
|
1827
1620
|
}
|
|
1828
1621
|
function handleScrollData($xeGanttView, isRollY, isRollX, scrollTop, scrollLeft) {
|
|
1829
|
-
|
|
1830
|
-
|
|
1622
|
+
const reactData = $xeGanttView.reactData;
|
|
1623
|
+
const internalData = $xeGanttView.internalData;
|
|
1831
1624
|
if (isRollX) {
|
|
1832
1625
|
internalData.lastScrollLeft = scrollLeft;
|
|
1833
1626
|
}
|
|
@@ -1837,286 +1630,277 @@ function handleScrollData($xeGanttView, isRollY, isRollX, scrollTop, scrollLeft)
|
|
|
1837
1630
|
reactData.lastScrollTime = Date.now();
|
|
1838
1631
|
checkLastSyncScroll($xeGanttView, isRollX, isRollY);
|
|
1839
1632
|
}
|
|
1840
|
-
/**
|
|
1841
|
-
* 同步表格滚动
|
|
1842
|
-
*/
|
|
1843
1633
|
function syncTableScrollTop($xeGanttView, scrollTop) {
|
|
1844
|
-
|
|
1845
|
-
|
|
1634
|
+
const internalData = $xeGanttView.internalData;
|
|
1635
|
+
const { isSyncTableScrollTop } = internalData;
|
|
1846
1636
|
if (isSyncTableScrollTop) {
|
|
1847
1637
|
return;
|
|
1848
1638
|
}
|
|
1849
|
-
|
|
1639
|
+
const $xeTable = internalData.xeTable;
|
|
1850
1640
|
if ($xeTable) {
|
|
1851
|
-
|
|
1641
|
+
const tableInternalData = $xeTable.getInternalData();
|
|
1852
1642
|
tableInternalData.isSyncGanttScrollTop = true;
|
|
1853
|
-
$xeTable.handleSyncScrollTop({
|
|
1854
|
-
scrollTop: scrollTop
|
|
1855
|
-
});
|
|
1643
|
+
$xeTable.handleSyncScrollTop({ scrollTop });
|
|
1856
1644
|
}
|
|
1857
1645
|
}
|
|
1858
|
-
var
|
|
1859
|
-
name:
|
|
1860
|
-
mixins: [
|
|
1646
|
+
var gantt_view_default = (0, import_comp.defineVxeComponent)({
|
|
1647
|
+
name: "VxeGanttView",
|
|
1648
|
+
mixins: [
|
|
1649
|
+
import_core.globalMixins.vScrollbarMixin,
|
|
1650
|
+
import_core.globalMixins.initVScrollbarMixin
|
|
1651
|
+
],
|
|
1861
1652
|
inject: {
|
|
1862
1653
|
$xeGantt: {
|
|
1863
1654
|
default: null
|
|
1864
1655
|
}
|
|
1865
1656
|
},
|
|
1866
|
-
provide
|
|
1867
|
-
|
|
1657
|
+
provide() {
|
|
1658
|
+
const $xeGanttView = this;
|
|
1868
1659
|
return {
|
|
1869
|
-
$xeGanttView
|
|
1660
|
+
$xeGanttView
|
|
1870
1661
|
};
|
|
1871
1662
|
},
|
|
1872
1663
|
props: {},
|
|
1873
|
-
data
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1664
|
+
data() {
|
|
1665
|
+
const xID = import_xe_utils.default.uniqueId();
|
|
1666
|
+
const reactData = createReactData();
|
|
1667
|
+
const internalData = createInternalData();
|
|
1668
|
+
const scrollDefaultConf = Object.assign({}, getConfig().scrollbar);
|
|
1878
1669
|
return {
|
|
1879
|
-
xID
|
|
1880
|
-
reactData
|
|
1881
|
-
internalData
|
|
1882
|
-
scrollDefaultConf
|
|
1670
|
+
xID,
|
|
1671
|
+
reactData,
|
|
1672
|
+
internalData,
|
|
1673
|
+
scrollDefaultConf,
|
|
1883
1674
|
reScrollFlag: 0
|
|
1884
1675
|
};
|
|
1885
1676
|
},
|
|
1886
|
-
computed:
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1677
|
+
computed: {
|
|
1678
|
+
...{},
|
|
1679
|
+
computeGanttIsVScrollbar() {
|
|
1680
|
+
const $xeGanttView = this;
|
|
1681
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1682
|
+
const isVScrollbar = $xeGantt.computeIsVScrollbar;
|
|
1891
1683
|
return isVScrollbar;
|
|
1892
1684
|
},
|
|
1893
|
-
computeScrollbarXOpts
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1685
|
+
computeScrollbarXOpts() {
|
|
1686
|
+
const $xeGanttView = this;
|
|
1687
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1688
|
+
const scrollbarOpts = $xeGantt.computeScrollbarOpts;
|
|
1897
1689
|
return scrollbarOpts.x ? Object.assign({}, scrollbarOpts.x, scrollbarOpts.xConfig) : scrollbarOpts.xConfig || {};
|
|
1898
1690
|
},
|
|
1899
|
-
computeScrollbarYOpts
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1691
|
+
computeScrollbarYOpts() {
|
|
1692
|
+
const $xeGanttView = this;
|
|
1693
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1694
|
+
const scrollbarOpts = $xeGantt.computeScrollbarOpts;
|
|
1903
1695
|
return scrollbarOpts.y ? Object.assign({}, scrollbarOpts.y, scrollbarOpts.yConfig) : scrollbarOpts.yConfig || {};
|
|
1904
1696
|
},
|
|
1905
|
-
computeScrollXHeight
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
return
|
|
1697
|
+
computeScrollXHeight() {
|
|
1698
|
+
const $xeGanttView = this;
|
|
1699
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1700
|
+
const scrollDefaultConf = $xeGanttView.scrollDefaultConf;
|
|
1701
|
+
const scrollbarOpts = $xeGantt.computeScrollbarOpts;
|
|
1702
|
+
const scrollbarXOpts = $xeGanttView.computeScrollbarXOpts;
|
|
1703
|
+
return import_xe_utils.default.toNumber((0, import_utils.getDefaultConfig)((0, import_utils.getDefaultConfig)(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height));
|
|
1912
1704
|
},
|
|
1913
|
-
computeScrollYWidth
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
return
|
|
1705
|
+
computeScrollYWidth() {
|
|
1706
|
+
const $xeGanttView = this;
|
|
1707
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1708
|
+
const scrollDefaultConf = $xeGanttView.scrollDefaultConf;
|
|
1709
|
+
const scrollbarOpts = $xeGantt.computeScrollbarOpts;
|
|
1710
|
+
const scrollbarYOpts = $xeGanttView.computeScrollbarYOpts;
|
|
1711
|
+
return import_xe_utils.default.toNumber((0, import_utils.getDefaultConfig)((0, import_utils.getDefaultConfig)(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width));
|
|
1920
1712
|
},
|
|
1921
|
-
computeScrollXVisible
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
return (0,
|
|
1713
|
+
computeScrollXVisible() {
|
|
1714
|
+
const $xeGanttView = this;
|
|
1715
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1716
|
+
const scrollbarOpts = $xeGantt.computeScrollbarOpts;
|
|
1717
|
+
const scrollbarXOpts = $xeGanttView.computeScrollbarXOpts;
|
|
1718
|
+
return (0, import_utils.getDefaultConfig)(scrollbarXOpts.visible, scrollbarOpts.visible);
|
|
1927
1719
|
},
|
|
1928
|
-
computeScrollYVisible
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
return (0,
|
|
1720
|
+
computeScrollYVisible() {
|
|
1721
|
+
const $xeGanttView = this;
|
|
1722
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1723
|
+
const scrollbarOpts = $xeGantt.computeScrollbarOpts;
|
|
1724
|
+
const scrollbarYOpts = $xeGanttView.computeScrollbarYOpts;
|
|
1725
|
+
return (0, import_utils.getDefaultConfig)(scrollbarYOpts.visible, scrollbarOpts.visible);
|
|
1934
1726
|
},
|
|
1935
|
-
computeScrollXAutoHide
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
return (0,
|
|
1727
|
+
computeScrollXAutoHide() {
|
|
1728
|
+
const $xeGanttView = this;
|
|
1729
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1730
|
+
const scrollDefaultConf = $xeGanttView.scrollDefaultConf;
|
|
1731
|
+
const scrollbarOpts = $xeGantt.computeScrollbarOpts;
|
|
1732
|
+
const scrollbarXOpts = $xeGanttView.computeScrollbarXOpts;
|
|
1733
|
+
return (0, import_utils.getDefaultConfig)((0, import_utils.getDefaultConfig)(scrollbarXOpts.autoHide, scrollbarOpts.autoHide), scrollDefaultConf.autoHide);
|
|
1942
1734
|
},
|
|
1943
|
-
computeScrollYAutoHide
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
return (0,
|
|
1735
|
+
computeScrollYAutoHide() {
|
|
1736
|
+
const $xeGanttView = this;
|
|
1737
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1738
|
+
const scrollDefaultConf = $xeGanttView.scrollDefaultConf;
|
|
1739
|
+
const scrollbarOpts = $xeGantt.computeScrollbarOpts;
|
|
1740
|
+
const scrollbarYOpts = $xeGanttView.computeScrollbarYOpts;
|
|
1741
|
+
return (0, import_utils.getDefaultConfig)((0, import_utils.getDefaultConfig)(scrollbarYOpts.autoHide, scrollbarOpts.autoHide), scrollDefaultConf.autoHide);
|
|
1950
1742
|
},
|
|
1951
|
-
computeScrollbarXToTop
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
return scrollbarXOpts.position ===
|
|
1743
|
+
computeScrollbarXToTop() {
|
|
1744
|
+
const $xeGanttView = this;
|
|
1745
|
+
const scrollbarXOpts = $xeGanttView.computeScrollbarXOpts;
|
|
1746
|
+
return scrollbarXOpts.position === "top";
|
|
1955
1747
|
},
|
|
1956
|
-
computeScrollbarYToLeft
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
return scrollbarYOpts.position ===
|
|
1748
|
+
computeScrollbarYToLeft() {
|
|
1749
|
+
const $xeGanttView = this;
|
|
1750
|
+
const scrollbarYOpts = $xeGanttView.computeScrollbarYOpts;
|
|
1751
|
+
return scrollbarYOpts.position === "left";
|
|
1960
1752
|
},
|
|
1961
|
-
computeScrollbarWrapperClss
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
return domUtils.buildClass([
|
|
1972
|
-
|
|
1973
|
-
|
|
1753
|
+
computeScrollbarWrapperClss() {
|
|
1754
|
+
const $xeGanttView = this;
|
|
1755
|
+
const reactData = $xeGanttView.reactData;
|
|
1756
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1757
|
+
const { yThumbHeight, xThumbWidth } = reactData;
|
|
1758
|
+
const scrollbarOpts = $xeGantt.computeScrollbarOpts;
|
|
1759
|
+
const scrollbarXToTop = $xeGantt.computeScrollbarXToTop;
|
|
1760
|
+
const scrollbarYToLeft = $xeGantt.computeScrollbarYToLeft;
|
|
1761
|
+
const scrollXVisible = $xeGanttView.computeScrollXVisible;
|
|
1762
|
+
const scrollYVisible = $xeGanttView.computeScrollYVisible;
|
|
1763
|
+
return domUtils.buildClass([
|
|
1764
|
+
"vxe-scrollbar is--virtual",
|
|
1765
|
+
scrollbarOpts.fluentOverlay ? "is--fluent-overlay" : "is--default-mode",
|
|
1766
|
+
`ov-x--${scrollXVisible === false ? "hidden" : "visible"}`,
|
|
1767
|
+
`ov-y--${scrollYVisible === false ? "hidden" : "visible"}`,
|
|
1768
|
+
`sx-pos--${scrollbarXToTop ? "top" : "bottom"}`,
|
|
1769
|
+
`sy-pos--${scrollbarYToLeft ? "left" : "right"}`
|
|
1770
|
+
], {
|
|
1771
|
+
"overflow-y": yThumbHeight,
|
|
1772
|
+
"overflow-x": xThumbWidth
|
|
1974
1773
|
});
|
|
1975
1774
|
},
|
|
1976
|
-
computeScaleDateList
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
var dateList = [];
|
|
1775
|
+
computeScaleDateList() {
|
|
1776
|
+
const $xeGanttView = this;
|
|
1777
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1778
|
+
const reactData = $xeGanttView.reactData;
|
|
1779
|
+
const ganttReactData = $xeGantt.reactData;
|
|
1780
|
+
const { minViewDate, maxViewDate } = reactData;
|
|
1781
|
+
const taskViewOpts = $xeGantt.computeTaskViewOpts;
|
|
1782
|
+
const minScale = $xeGantt.computeMinScale;
|
|
1783
|
+
const scaleStep = $xeGantt.computeScaleStep;
|
|
1784
|
+
const { gridding } = taskViewOpts;
|
|
1785
|
+
const dateList = [];
|
|
1988
1786
|
if (!minScale || !minViewDate || !maxViewDate) {
|
|
1989
1787
|
return dateList;
|
|
1990
1788
|
}
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
var rightSize = ganttReactData.currRightSpacing + _xeUtils.default.toNumber(gridding ? gridding.rightSpacing || 0 : 0);
|
|
1789
|
+
const { type, startDay } = minScale;
|
|
1790
|
+
let leftSize = -(ganttReactData.currLeftSpacing + import_xe_utils.default.toNumber(gridding ? gridding.leftSpacing || 0 : 0));
|
|
1791
|
+
let rightSize = ganttReactData.currRightSpacing + import_xe_utils.default.toNumber(gridding ? gridding.rightSpacing || 0 : 0);
|
|
1995
1792
|
if (scaleStep > 0) {
|
|
1996
1793
|
leftSize *= scaleStep;
|
|
1997
1794
|
rightSize *= scaleStep;
|
|
1998
1795
|
}
|
|
1999
1796
|
switch (type) {
|
|
2000
|
-
case
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
currDate = _xeUtils.default.getWhatYear(currDate, scaleStep);
|
|
2008
|
-
}
|
|
2009
|
-
break;
|
|
1797
|
+
case "year": {
|
|
1798
|
+
let currDate = import_xe_utils.default.getWhatYear(minViewDate, leftSize, "first");
|
|
1799
|
+
const endDate = import_xe_utils.default.getWhatYear(maxViewDate, rightSize, "first");
|
|
1800
|
+
while (currDate <= endDate) {
|
|
1801
|
+
const itemDate = currDate;
|
|
1802
|
+
dateList.push(itemDate);
|
|
1803
|
+
currDate = import_xe_utils.default.getWhatYear(currDate, scaleStep);
|
|
2010
1804
|
}
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
break;
|
|
1805
|
+
break;
|
|
1806
|
+
}
|
|
1807
|
+
case "quarter": {
|
|
1808
|
+
let currDate = import_xe_utils.default.getWhatQuarter(minViewDate, leftSize, "first");
|
|
1809
|
+
const endDate = import_xe_utils.default.getWhatQuarter(maxViewDate, rightSize, "first");
|
|
1810
|
+
while (currDate <= endDate) {
|
|
1811
|
+
const itemDate = currDate;
|
|
1812
|
+
dateList.push(itemDate);
|
|
1813
|
+
currDate = import_xe_utils.default.getWhatQuarter(currDate, scaleStep);
|
|
2021
1814
|
}
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
break;
|
|
1815
|
+
break;
|
|
1816
|
+
}
|
|
1817
|
+
case "month": {
|
|
1818
|
+
let currDate = import_xe_utils.default.getWhatMonth(minViewDate, leftSize, "first");
|
|
1819
|
+
const endDate = import_xe_utils.default.getWhatMonth(maxViewDate, rightSize, "first");
|
|
1820
|
+
while (currDate <= endDate) {
|
|
1821
|
+
const itemDate = currDate;
|
|
1822
|
+
dateList.push(itemDate);
|
|
1823
|
+
currDate = import_xe_utils.default.getWhatMonth(currDate, scaleStep);
|
|
2032
1824
|
}
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
break;
|
|
1825
|
+
break;
|
|
1826
|
+
}
|
|
1827
|
+
case "week": {
|
|
1828
|
+
let currDate = import_xe_utils.default.getWhatWeek(minViewDate, leftSize, startDay, startDay);
|
|
1829
|
+
const endDate = import_xe_utils.default.getWhatWeek(maxViewDate, rightSize, startDay, startDay);
|
|
1830
|
+
while (currDate <= endDate) {
|
|
1831
|
+
const itemDate = currDate;
|
|
1832
|
+
dateList.push(itemDate);
|
|
1833
|
+
currDate = import_xe_utils.default.getWhatWeek(currDate, scaleStep);
|
|
2043
1834
|
}
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
break;
|
|
1835
|
+
break;
|
|
1836
|
+
}
|
|
1837
|
+
case "day":
|
|
1838
|
+
case "date": {
|
|
1839
|
+
let currDate = import_xe_utils.default.getWhatDay(minViewDate, leftSize, "first");
|
|
1840
|
+
const endDate = import_xe_utils.default.getWhatDay(maxViewDate, rightSize, "first");
|
|
1841
|
+
while (currDate <= endDate) {
|
|
1842
|
+
const itemDate = currDate;
|
|
1843
|
+
dateList.push(itemDate);
|
|
1844
|
+
currDate = import_xe_utils.default.getWhatDay(currDate, scaleStep);
|
|
2055
1845
|
}
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
break;
|
|
1846
|
+
break;
|
|
1847
|
+
}
|
|
1848
|
+
case "hour": {
|
|
1849
|
+
let currDate = import_xe_utils.default.getWhatHours(minViewDate, leftSize, "first");
|
|
1850
|
+
const endDate = import_xe_utils.default.getWhatHours(maxViewDate, rightSize, "first");
|
|
1851
|
+
while (currDate <= endDate) {
|
|
1852
|
+
const itemDate = currDate;
|
|
1853
|
+
dateList.push(itemDate);
|
|
1854
|
+
currDate = import_xe_utils.default.getWhatHours(currDate, scaleStep);
|
|
2066
1855
|
}
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
break;
|
|
1856
|
+
break;
|
|
1857
|
+
}
|
|
1858
|
+
case "minute": {
|
|
1859
|
+
let currDate = import_xe_utils.default.getWhatMinutes(minViewDate, leftSize, "first");
|
|
1860
|
+
const endDate = import_xe_utils.default.getWhatMinutes(maxViewDate, rightSize, "first");
|
|
1861
|
+
while (currDate <= endDate) {
|
|
1862
|
+
const itemDate = currDate;
|
|
1863
|
+
dateList.push(itemDate);
|
|
1864
|
+
currDate = import_xe_utils.default.getWhatMinutes(currDate, scaleStep);
|
|
2077
1865
|
}
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
break;
|
|
1866
|
+
break;
|
|
1867
|
+
}
|
|
1868
|
+
case "second": {
|
|
1869
|
+
let currDate = import_xe_utils.default.getWhatSeconds(minViewDate, leftSize, "first");
|
|
1870
|
+
const endDate = import_xe_utils.default.getWhatSeconds(maxViewDate, rightSize, "first");
|
|
1871
|
+
while (currDate <= endDate) {
|
|
1872
|
+
const itemDate = currDate;
|
|
1873
|
+
dateList.push(itemDate);
|
|
1874
|
+
currDate = import_xe_utils.default.getWhatSeconds(currDate, scaleStep);
|
|
2088
1875
|
}
|
|
1876
|
+
break;
|
|
1877
|
+
}
|
|
2089
1878
|
}
|
|
2090
1879
|
return dateList;
|
|
2091
1880
|
},
|
|
2092
|
-
computeNowLineLeft
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
var mode = taskNowLineOpts.mode;
|
|
2108
|
-
var nowTime = ganttReactData.nowTime;
|
|
2109
|
-
// 此刻线
|
|
2110
|
-
var nlLeft = 0;
|
|
1881
|
+
computeNowLineLeft() {
|
|
1882
|
+
const $xeGanttView = this;
|
|
1883
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1884
|
+
const reactData = $xeGanttView.reactData;
|
|
1885
|
+
const internalData = $xeGanttView.internalData;
|
|
1886
|
+
const ganttReactData = $xeGantt.reactData;
|
|
1887
|
+
const { minViewDate, maxViewDate, viewCellWidth } = reactData;
|
|
1888
|
+
const { visibleColumn, todayDateMaps } = internalData;
|
|
1889
|
+
const minScale = $xeGantt.computeMinScale;
|
|
1890
|
+
const taskViewOpts = $xeGantt.computeTaskViewOpts;
|
|
1891
|
+
const taskNowLineOpts = $xeGantt.computeTaskNowLineOpts;
|
|
1892
|
+
const { showNowLine } = taskViewOpts;
|
|
1893
|
+
const { mode } = taskNowLineOpts;
|
|
1894
|
+
const { nowTime } = ganttReactData;
|
|
1895
|
+
let nlLeft = 0;
|
|
2111
1896
|
if (showNowLine && minScale && minViewDate && maxViewDate && nowTime >= minViewDate.getTime() && nowTime <= maxViewDate.getTime()) {
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
for (
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
endDateObj = column.endDateObj;
|
|
1897
|
+
const todayValue = todayDateMaps[minScale.type];
|
|
1898
|
+
const todayDate = import_xe_utils.default.toStringDate(todayValue);
|
|
1899
|
+
let currCol = null;
|
|
1900
|
+
let nextCol = null;
|
|
1901
|
+
for (let i = 0; i < visibleColumn.length; i++) {
|
|
1902
|
+
const column = visibleColumn[i];
|
|
1903
|
+
const { startDateObj, endDateObj } = column;
|
|
2120
1904
|
if (startDateObj.date <= todayDate && endDateObj.date >= todayDate) {
|
|
2121
1905
|
currCol = column;
|
|
2122
1906
|
nlLeft = i * viewCellWidth;
|
|
@@ -2124,56 +1908,56 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
2124
1908
|
break;
|
|
2125
1909
|
}
|
|
2126
1910
|
}
|
|
2127
|
-
if (mode ===
|
|
1911
|
+
if (mode === "progress") {
|
|
2128
1912
|
if (currCol && nextCol) {
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
1913
|
+
const currTime = currCol.dateObj.date.getTime();
|
|
1914
|
+
const offsetTime = nowTime - currTime;
|
|
1915
|
+
const nowProgress = Math.max(0, Math.min(1, offsetTime / (nextCol.dateObj.date.getTime() - currTime)));
|
|
2132
1916
|
nlLeft += nowProgress * viewCellWidth;
|
|
2133
1917
|
}
|
|
2134
|
-
} else if (mode ===
|
|
1918
|
+
} else if (mode === "center") {
|
|
2135
1919
|
nlLeft += viewCellWidth / 2;
|
|
2136
|
-
} else if (mode ===
|
|
1920
|
+
} else if (mode === "end") {
|
|
2137
1921
|
nlLeft += viewCellWidth - 1;
|
|
2138
1922
|
}
|
|
2139
1923
|
}
|
|
2140
1924
|
return nlLeft;
|
|
2141
1925
|
}
|
|
2142
|
-
}
|
|
1926
|
+
},
|
|
2143
1927
|
methods: {
|
|
2144
1928
|
//
|
|
2145
1929
|
// Method
|
|
2146
1930
|
//
|
|
2147
|
-
getScrollViewElem
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
1931
|
+
getScrollViewElem() {
|
|
1932
|
+
const $xeGanttView = this;
|
|
1933
|
+
const internalData = $xeGanttView.internalData;
|
|
1934
|
+
const { elemStore } = internalData;
|
|
1935
|
+
const viewEl = (0, import_util.getRefElem)(elemStore["main-body-scroll"]);
|
|
2152
1936
|
return viewEl;
|
|
2153
1937
|
},
|
|
2154
|
-
refreshData
|
|
2155
|
-
|
|
2156
|
-
|
|
1938
|
+
refreshData() {
|
|
1939
|
+
const $xeGanttView = this;
|
|
1940
|
+
const internalData = $xeGanttView.internalData;
|
|
2157
1941
|
handleUpdateData($xeGanttView);
|
|
2158
1942
|
handleRecalculateStyle($xeGanttView);
|
|
2159
|
-
return $xeGanttView.$nextTick().then(
|
|
2160
|
-
|
|
1943
|
+
return $xeGanttView.$nextTick().then(() => {
|
|
1944
|
+
const $xeTable = internalData.xeTable;
|
|
2161
1945
|
handleRecalculateStyle($xeGanttView);
|
|
2162
1946
|
if ($xeTable) {
|
|
2163
1947
|
return $xeTable.recalculate();
|
|
2164
1948
|
}
|
|
2165
1949
|
});
|
|
2166
1950
|
},
|
|
2167
|
-
updateViewData
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
1951
|
+
updateViewData(force) {
|
|
1952
|
+
const $xeGanttView = this;
|
|
1953
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
1954
|
+
const reactData = $xeGanttView.reactData;
|
|
1955
|
+
const internalData = $xeGanttView.internalData;
|
|
1956
|
+
const ganttReactData = $xeGantt.reactData;
|
|
1957
|
+
const $xeTable = internalData.xeTable;
|
|
2174
1958
|
if ($xeTable) {
|
|
2175
|
-
|
|
2176
|
-
|
|
1959
|
+
const tableReactData = $xeTable.getReactData();
|
|
1960
|
+
const { tableData } = tableReactData;
|
|
2177
1961
|
reactData.tableData = tableData;
|
|
2178
1962
|
if (force) {
|
|
2179
1963
|
ganttReactData.currLeftSpacing = 0;
|
|
@@ -2184,130 +1968,119 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
2184
1968
|
}
|
|
2185
1969
|
return $xeGanttView.$nextTick();
|
|
2186
1970
|
},
|
|
2187
|
-
connectUpdate
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
var internalData = $xeGanttView.internalData;
|
|
1971
|
+
connectUpdate({ $table }) {
|
|
1972
|
+
const $xeGanttView = this;
|
|
1973
|
+
const internalData = $xeGanttView.internalData;
|
|
2191
1974
|
if ($table) {
|
|
2192
1975
|
internalData.xeTable = $table;
|
|
2193
1976
|
}
|
|
2194
1977
|
return $xeGanttView.$nextTick();
|
|
2195
1978
|
},
|
|
2196
|
-
handleUpdateStyle
|
|
2197
|
-
|
|
1979
|
+
handleUpdateStyle() {
|
|
1980
|
+
const $xeGanttView = this;
|
|
2198
1981
|
return updateStyle($xeGanttView);
|
|
2199
1982
|
},
|
|
2200
|
-
handleLazyRecalculate
|
|
2201
|
-
|
|
2202
|
-
return
|
|
1983
|
+
handleLazyRecalculate() {
|
|
1984
|
+
const $xeGanttView = this;
|
|
1985
|
+
return handleLazyRecalculate($xeGanttView);
|
|
2203
1986
|
},
|
|
2204
|
-
handleUpdateCurrentRow
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
1987
|
+
handleUpdateCurrentRow(row) {
|
|
1988
|
+
const $xeGanttView = this;
|
|
1989
|
+
const internalData = $xeGanttView.internalData;
|
|
1990
|
+
const $xeTable = internalData.xeTable;
|
|
1991
|
+
const el = $xeGanttView.$refs.refElem;
|
|
2209
1992
|
if ($xeTable && el) {
|
|
2210
1993
|
if (row) {
|
|
2211
|
-
|
|
2212
|
-
|
|
1994
|
+
const tableProps = $xeTable;
|
|
1995
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
2213
1996
|
if (rowOpts.isCurrent || tableProps.highlightCurrentRow) {
|
|
2214
|
-
|
|
2215
|
-
return (0, _dom.addClass)(elem, 'row--current');
|
|
2216
|
-
});
|
|
1997
|
+
import_xe_utils.default.arrayEach(el.querySelectorAll(`[rowid="${$xeTable.getRowid(row)}"]`), (elem) => (0, import_dom.addClass)(elem, "row--current"));
|
|
2217
1998
|
}
|
|
2218
1999
|
} else {
|
|
2219
|
-
|
|
2220
|
-
return (0, _dom.removeClass)(elem, 'row--current');
|
|
2221
|
-
});
|
|
2000
|
+
import_xe_utils.default.arrayEach(el.querySelectorAll(".row--current"), (elem) => (0, import_dom.removeClass)(elem, "row--current"));
|
|
2222
2001
|
}
|
|
2223
2002
|
}
|
|
2224
2003
|
},
|
|
2225
|
-
handleUpdateHoverRow
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2004
|
+
handleUpdateHoverRow(row) {
|
|
2005
|
+
const $xeGanttView = this;
|
|
2006
|
+
const internalData = $xeGanttView.internalData;
|
|
2007
|
+
const $xeTable = internalData.xeTable;
|
|
2008
|
+
const el = $xeGanttView.$refs.refElem;
|
|
2230
2009
|
if ($xeTable && el) {
|
|
2231
2010
|
if (row) {
|
|
2232
|
-
|
|
2233
|
-
return (0, _dom.addClass)(elem, 'row--hover');
|
|
2234
|
-
});
|
|
2011
|
+
import_xe_utils.default.arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${$xeTable.getRowid(row)}"]`), (elem) => (0, import_dom.addClass)(elem, "row--hover"));
|
|
2235
2012
|
} else {
|
|
2236
|
-
|
|
2237
|
-
return (0, _dom.removeClass)(elem, 'row--hover');
|
|
2238
|
-
});
|
|
2013
|
+
import_xe_utils.default.arrayEach(el.querySelectorAll(".vxe-body--row.row--hover"), (elem) => (0, import_dom.removeClass)(elem, "row--hover"));
|
|
2239
2014
|
}
|
|
2240
2015
|
}
|
|
2241
2016
|
},
|
|
2242
|
-
handleSyncScrollTop
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2017
|
+
handleSyncScrollTop(params) {
|
|
2018
|
+
const $xeGanttView = this;
|
|
2019
|
+
const internalData = $xeGanttView.internalData;
|
|
2020
|
+
const { scrollTop } = params;
|
|
2021
|
+
const { elemStore } = internalData;
|
|
2022
|
+
const bodyScrollElem = (0, import_util.getRefElem)(elemStore["main-body-scroll"]);
|
|
2248
2023
|
if (bodyScrollElem) {
|
|
2249
2024
|
bodyScrollElem.scrollTop = scrollTop;
|
|
2250
2025
|
}
|
|
2251
2026
|
},
|
|
2252
|
-
handleScrollEvent
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
lastScrollTop = internalData.lastScrollTop;
|
|
2260
|
-
var bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
2027
|
+
handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft) {
|
|
2028
|
+
const $xeGanttView = this;
|
|
2029
|
+
const internalData = $xeGanttView.internalData;
|
|
2030
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
2031
|
+
const $xeTable = internalData.xeTable;
|
|
2032
|
+
const { elemStore, lastScrollLeft, lastScrollTop } = internalData;
|
|
2033
|
+
const bodyScrollElem = (0, import_util.getRefElem)(elemStore["main-body-scroll"]);
|
|
2261
2034
|
if (!bodyScrollElem) {
|
|
2262
2035
|
return;
|
|
2263
2036
|
}
|
|
2264
2037
|
if (!$xeTable) {
|
|
2265
2038
|
return;
|
|
2266
2039
|
}
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2040
|
+
const bodyHeight = bodyScrollElem.clientHeight;
|
|
2041
|
+
const bodyWidth = bodyScrollElem.clientWidth;
|
|
2042
|
+
const scrollHeight = bodyScrollElem.scrollHeight;
|
|
2043
|
+
const scrollWidth = bodyScrollElem.scrollWidth;
|
|
2044
|
+
let isTop = false;
|
|
2045
|
+
let isBottom = false;
|
|
2046
|
+
let isLeft = false;
|
|
2047
|
+
let isRight = false;
|
|
2048
|
+
let direction = "";
|
|
2049
|
+
let isTopBoundary = false;
|
|
2050
|
+
let isBottomBoundary = false;
|
|
2051
|
+
let isLeftBoundary = false;
|
|
2052
|
+
let isRightBoundary = false;
|
|
2280
2053
|
if (isRollX) {
|
|
2281
|
-
|
|
2054
|
+
const xThreshold = $xeTable.computeScrollXThreshold;
|
|
2282
2055
|
isLeft = scrollLeft <= 0;
|
|
2283
2056
|
if (!isLeft) {
|
|
2284
2057
|
isRight = scrollLeft + bodyWidth >= scrollWidth - 1;
|
|
2285
2058
|
}
|
|
2286
2059
|
if (scrollLeft > lastScrollLeft) {
|
|
2287
|
-
direction =
|
|
2060
|
+
direction = "right";
|
|
2288
2061
|
if (scrollLeft + bodyWidth >= scrollWidth - xThreshold) {
|
|
2289
2062
|
isRightBoundary = true;
|
|
2290
2063
|
}
|
|
2291
2064
|
} else {
|
|
2292
|
-
direction =
|
|
2065
|
+
direction = "left";
|
|
2293
2066
|
if (scrollLeft <= xThreshold) {
|
|
2294
2067
|
isLeftBoundary = true;
|
|
2295
2068
|
}
|
|
2296
2069
|
}
|
|
2297
2070
|
}
|
|
2298
2071
|
if (isRollY) {
|
|
2299
|
-
|
|
2072
|
+
const yThreshold = $xeTable.computeScrollYThreshold;
|
|
2300
2073
|
isTop = scrollTop <= 0;
|
|
2301
2074
|
if (!isTop) {
|
|
2302
2075
|
isBottom = scrollTop + bodyHeight >= scrollHeight - 1;
|
|
2303
2076
|
}
|
|
2304
2077
|
if (scrollTop > lastScrollTop) {
|
|
2305
|
-
direction =
|
|
2078
|
+
direction = "bottom";
|
|
2306
2079
|
if (scrollTop + bodyHeight >= scrollHeight - yThreshold) {
|
|
2307
2080
|
isBottomBoundary = true;
|
|
2308
2081
|
}
|
|
2309
2082
|
} else {
|
|
2310
|
-
direction =
|
|
2083
|
+
direction = "top";
|
|
2311
2084
|
if (scrollTop <= yThreshold) {
|
|
2312
2085
|
isTopBoundary = true;
|
|
2313
2086
|
}
|
|
@@ -2315,88 +2088,80 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
2315
2088
|
}
|
|
2316
2089
|
$xeGanttView.updateThumbOffset();
|
|
2317
2090
|
handleScrollData($xeGanttView, isRollY, isRollX, scrollTop, scrollLeft);
|
|
2318
|
-
|
|
2091
|
+
const evntParams = {
|
|
2319
2092
|
source: sourceType,
|
|
2320
|
-
scrollTop
|
|
2321
|
-
scrollLeft
|
|
2322
|
-
bodyHeight
|
|
2323
|
-
bodyWidth
|
|
2324
|
-
scrollHeight
|
|
2325
|
-
scrollWidth
|
|
2093
|
+
scrollTop,
|
|
2094
|
+
scrollLeft,
|
|
2095
|
+
bodyHeight,
|
|
2096
|
+
bodyWidth,
|
|
2097
|
+
scrollHeight,
|
|
2098
|
+
scrollWidth,
|
|
2326
2099
|
isX: isRollX,
|
|
2327
2100
|
isY: isRollY,
|
|
2328
|
-
isTop
|
|
2329
|
-
isBottom
|
|
2330
|
-
isLeft
|
|
2331
|
-
isRight
|
|
2332
|
-
direction
|
|
2101
|
+
isTop,
|
|
2102
|
+
isBottom,
|
|
2103
|
+
isLeft,
|
|
2104
|
+
isRight,
|
|
2105
|
+
direction
|
|
2333
2106
|
};
|
|
2334
2107
|
if (isBottomBoundary || isTopBoundary || isRightBoundary || isLeftBoundary) {
|
|
2335
|
-
$xeGantt.dispatchEvent(
|
|
2108
|
+
$xeGantt.dispatchEvent("scroll-boundary", evntParams, evnt);
|
|
2336
2109
|
}
|
|
2337
|
-
$xeGantt.dispatchEvent(
|
|
2110
|
+
$xeGantt.dispatchEvent("scroll", evntParams, evnt);
|
|
2338
2111
|
},
|
|
2339
|
-
triggerHeaderScrollEvent
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
inVirtualScroll = internalData.inVirtualScroll,
|
|
2344
|
-
inBodyScroll = internalData.inBodyScroll,
|
|
2345
|
-
inFooterScroll = internalData.inFooterScroll;
|
|
2112
|
+
triggerHeaderScrollEvent(evnt) {
|
|
2113
|
+
const $xeGanttView = this;
|
|
2114
|
+
const internalData = $xeGanttView.internalData;
|
|
2115
|
+
const { elemStore, inVirtualScroll, inBodyScroll, inFooterScroll } = internalData;
|
|
2346
2116
|
if (inVirtualScroll) {
|
|
2347
2117
|
return;
|
|
2348
2118
|
}
|
|
2349
2119
|
if (inBodyScroll || inFooterScroll) {
|
|
2350
2120
|
return;
|
|
2351
2121
|
}
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2122
|
+
const wrapperEl = evnt.currentTarget;
|
|
2123
|
+
const bodyScrollElem = (0, import_util.getRefElem)(elemStore["main-body-scroll"]);
|
|
2124
|
+
const xHandleEl = $xeGanttView.$refs.refScrollXHandleElem;
|
|
2355
2125
|
if (bodyScrollElem && wrapperEl) {
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2126
|
+
const isRollX = true;
|
|
2127
|
+
const isRollY = false;
|
|
2128
|
+
const currLeftNum = wrapperEl.scrollLeft;
|
|
2359
2129
|
internalData.inHeaderScroll = true;
|
|
2360
|
-
(0,
|
|
2361
|
-
(0,
|
|
2130
|
+
(0, import_dom.setScrollLeft)(xHandleEl, currLeftNum);
|
|
2131
|
+
(0, import_dom.setScrollLeft)(bodyScrollElem, currLeftNum);
|
|
2362
2132
|
$xeGanttView.handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum);
|
|
2363
2133
|
}
|
|
2364
2134
|
},
|
|
2365
|
-
triggerBodyScrollEvent
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
inVirtualScroll = internalData.inVirtualScroll,
|
|
2372
|
-
inHeaderScroll = internalData.inHeaderScroll,
|
|
2373
|
-
inFooterScroll = internalData.inFooterScroll,
|
|
2374
|
-
lastScrollLeft = internalData.lastScrollLeft,
|
|
2375
|
-
lastScrollTop = internalData.lastScrollTop;
|
|
2135
|
+
triggerBodyScrollEvent(evnt) {
|
|
2136
|
+
const $xeGanttView = this;
|
|
2137
|
+
const reactData = $xeGanttView.reactData;
|
|
2138
|
+
const internalData = $xeGanttView.internalData;
|
|
2139
|
+
const { scrollXLoad } = reactData;
|
|
2140
|
+
const { elemStore, inVirtualScroll, inHeaderScroll, inFooterScroll, lastScrollLeft, lastScrollTop } = internalData;
|
|
2376
2141
|
if (inVirtualScroll) {
|
|
2377
2142
|
return;
|
|
2378
2143
|
}
|
|
2379
2144
|
if (inHeaderScroll || inFooterScroll) {
|
|
2380
2145
|
return;
|
|
2381
2146
|
}
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2147
|
+
const wrapperEl = evnt.currentTarget;
|
|
2148
|
+
const headerScrollElem = (0, import_util.getRefElem)(elemStore["main-header-scroll"]);
|
|
2149
|
+
const xHandleEl = $xeGanttView.$refs.refScrollXHandleElem;
|
|
2150
|
+
const yHandleEl = $xeGanttView.$refs.refScrollYHandleElem;
|
|
2151
|
+
const scrollLeft = wrapperEl.scrollLeft;
|
|
2152
|
+
const scrollTop = wrapperEl.scrollTop;
|
|
2153
|
+
const isRollX = scrollLeft !== lastScrollLeft;
|
|
2154
|
+
const isRollY = scrollTop !== lastScrollTop;
|
|
2390
2155
|
internalData.inBodyScroll = true;
|
|
2391
|
-
internalData.scrollRenderType =
|
|
2156
|
+
internalData.scrollRenderType = "";
|
|
2392
2157
|
if (isRollY) {
|
|
2393
|
-
(0,
|
|
2158
|
+
(0, import_dom.setScrollTop)(yHandleEl, scrollTop);
|
|
2394
2159
|
syncTableScrollTop($xeGanttView, scrollTop);
|
|
2395
2160
|
}
|
|
2396
2161
|
if (isRollX) {
|
|
2397
2162
|
internalData.inBodyScroll = true;
|
|
2398
|
-
(0,
|
|
2399
|
-
(0,
|
|
2163
|
+
(0, import_dom.setScrollLeft)(xHandleEl, scrollLeft);
|
|
2164
|
+
(0, import_dom.setScrollLeft)(headerScrollElem, scrollLeft);
|
|
2400
2165
|
if (scrollXLoad) {
|
|
2401
2166
|
triggerScrollXEvent($xeGanttView);
|
|
2402
2167
|
}
|
|
@@ -2421,339 +2186,383 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
2421
2186
|
// $xeGanttView.handleScrollEvent(, evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum)
|
|
2422
2187
|
// }
|
|
2423
2188
|
// },
|
|
2424
|
-
triggerVirtualScrollXEvent
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
inHeaderScroll = internalData.inHeaderScroll,
|
|
2431
|
-
inBodyScroll = internalData.inBodyScroll;
|
|
2189
|
+
triggerVirtualScrollXEvent(evnt) {
|
|
2190
|
+
const $xeGanttView = this;
|
|
2191
|
+
const reactData = $xeGanttView.reactData;
|
|
2192
|
+
const internalData = $xeGanttView.internalData;
|
|
2193
|
+
const { scrollXLoad } = reactData;
|
|
2194
|
+
const { elemStore, inHeaderScroll, inBodyScroll } = internalData;
|
|
2432
2195
|
if (inHeaderScroll || inBodyScroll) {
|
|
2433
2196
|
return;
|
|
2434
2197
|
}
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2198
|
+
const wrapperEl = evnt.currentTarget;
|
|
2199
|
+
const headerScrollElem = (0, import_util.getRefElem)(elemStore["main-header-scroll"]);
|
|
2200
|
+
const bodyScrollElem = (0, import_util.getRefElem)(elemStore["main-body-scroll"]);
|
|
2438
2201
|
if (wrapperEl) {
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2202
|
+
const isRollY = false;
|
|
2203
|
+
const isRollX = true;
|
|
2204
|
+
const currLeftNum = wrapperEl.scrollLeft;
|
|
2442
2205
|
internalData.inVirtualScroll = true;
|
|
2443
|
-
(0,
|
|
2444
|
-
(0,
|
|
2206
|
+
(0, import_dom.setScrollLeft)(headerScrollElem, currLeftNum);
|
|
2207
|
+
(0, import_dom.setScrollLeft)(bodyScrollElem, currLeftNum);
|
|
2445
2208
|
if (scrollXLoad) {
|
|
2446
2209
|
triggerScrollXEvent($xeGanttView);
|
|
2447
2210
|
}
|
|
2448
2211
|
$xeGanttView.handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum);
|
|
2449
2212
|
}
|
|
2450
2213
|
},
|
|
2451
|
-
triggerVirtualScrollYEvent
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
inHeaderScroll = internalData.inHeaderScroll,
|
|
2456
|
-
inBodyScroll = internalData.inBodyScroll;
|
|
2214
|
+
triggerVirtualScrollYEvent(evnt) {
|
|
2215
|
+
const $xeGanttView = this;
|
|
2216
|
+
const internalData = $xeGanttView.internalData;
|
|
2217
|
+
const { elemStore, inHeaderScroll, inBodyScroll } = internalData;
|
|
2457
2218
|
if (inHeaderScroll || inBodyScroll) {
|
|
2458
2219
|
return;
|
|
2459
2220
|
}
|
|
2460
|
-
|
|
2461
|
-
|
|
2221
|
+
const wrapperEl = evnt.currentTarget;
|
|
2222
|
+
const bodyScrollElem = (0, import_util.getRefElem)(elemStore["main-body-scroll"]);
|
|
2462
2223
|
if (wrapperEl) {
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2224
|
+
const isRollY = true;
|
|
2225
|
+
const isRollX = false;
|
|
2226
|
+
const currTopNum = wrapperEl.scrollTop;
|
|
2466
2227
|
internalData.inVirtualScroll = true;
|
|
2467
|
-
(0,
|
|
2228
|
+
(0, import_dom.setScrollTop)(bodyScrollElem, currTopNum);
|
|
2468
2229
|
syncTableScrollTop($xeGanttView, currTopNum);
|
|
2469
2230
|
$xeGanttView.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, wrapperEl.scrollLeft);
|
|
2470
2231
|
}
|
|
2471
2232
|
},
|
|
2472
|
-
handleUpdateSXSpace
|
|
2473
|
-
|
|
2233
|
+
handleUpdateSXSpace() {
|
|
2234
|
+
const $xeGanttView = this;
|
|
2474
2235
|
return updateScrollXSpace($xeGanttView);
|
|
2475
2236
|
},
|
|
2476
|
-
handleUpdateSYSpace
|
|
2477
|
-
|
|
2237
|
+
handleUpdateSYSpace() {
|
|
2238
|
+
const $xeGanttView = this;
|
|
2478
2239
|
return updateScrollYSpace($xeGanttView);
|
|
2479
2240
|
},
|
|
2480
|
-
handleUpdateSYStatus
|
|
2481
|
-
|
|
2482
|
-
|
|
2241
|
+
handleUpdateSYStatus(sYLoad) {
|
|
2242
|
+
const $xeGanttView = this;
|
|
2243
|
+
const reactData = $xeGanttView.reactData;
|
|
2483
2244
|
reactData.scrollYLoad = sYLoad;
|
|
2484
2245
|
},
|
|
2485
2246
|
/**
|
|
2486
2247
|
* @private
|
|
2487
2248
|
*/
|
|
2488
|
-
updateScrollbar
|
|
2489
|
-
|
|
2490
|
-
|
|
2249
|
+
updateScrollbar() {
|
|
2250
|
+
const $xeGanttView = this;
|
|
2251
|
+
const isVScrollbar = $xeGanttView.computeGanttIsVScrollbar;
|
|
2491
2252
|
if (isVScrollbar) {
|
|
2492
|
-
return $xeGanttView.$nextTick().then(
|
|
2253
|
+
return $xeGanttView.$nextTick().then(() => {
|
|
2493
2254
|
$xeGanttView.updateThumbSize();
|
|
2494
2255
|
$xeGanttView.updateThumbOffset();
|
|
2495
2256
|
});
|
|
2496
2257
|
}
|
|
2497
2258
|
return Promise.resolve();
|
|
2498
2259
|
},
|
|
2499
|
-
handleGlobalResizeEvent
|
|
2500
|
-
|
|
2501
|
-
|
|
2260
|
+
handleGlobalResizeEvent() {
|
|
2261
|
+
const $xeGanttView = this;
|
|
2262
|
+
handleLazyRecalculate($xeGanttView);
|
|
2502
2263
|
},
|
|
2503
2264
|
// 滚动条
|
|
2504
|
-
bindScrollbarResize
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
var isVScrollbar = $xeGanttView.computeGanttIsVScrollbar;
|
|
2265
|
+
bindScrollbarResize() {
|
|
2266
|
+
const $xeGanttView = this;
|
|
2267
|
+
const internalData = $xeGanttView.internalData;
|
|
2268
|
+
const { elemStore, scrollObserver } = internalData;
|
|
2269
|
+
const isVScrollbar = $xeGanttView.computeGanttIsVScrollbar;
|
|
2510
2270
|
if (isVScrollbar) {
|
|
2511
2271
|
if (!scrollObserver) {
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2272
|
+
const el = $xeGanttView.$refs.refElem;
|
|
2273
|
+
const viewInnerXEl = (0, import_util.getRefElem)(elemStore["main-body-xSpace"]);
|
|
2274
|
+
const viewInnerYEl = (0, import_util.getRefElem)(elemStore["main-body-xSpace"]);
|
|
2275
|
+
const scrollObserver2 = globalResize.create(() => {
|
|
2516
2276
|
$xeGanttView.reScrollFlag++;
|
|
2517
2277
|
});
|
|
2518
2278
|
if (el) {
|
|
2519
|
-
|
|
2279
|
+
scrollObserver2.observe(el);
|
|
2520
2280
|
}
|
|
2521
2281
|
if (viewInnerXEl) {
|
|
2522
|
-
|
|
2282
|
+
scrollObserver2.observe(viewInnerXEl);
|
|
2523
2283
|
}
|
|
2524
2284
|
if (viewInnerYEl) {
|
|
2525
|
-
|
|
2285
|
+
scrollObserver2.observe(viewInnerYEl);
|
|
2526
2286
|
}
|
|
2527
|
-
internalData.scrollObserver =
|
|
2287
|
+
internalData.scrollObserver = scrollObserver2;
|
|
2528
2288
|
}
|
|
2529
2289
|
}
|
|
2530
2290
|
},
|
|
2531
2291
|
//
|
|
2532
2292
|
// Render
|
|
2533
2293
|
//
|
|
2534
|
-
renderScrollX
|
|
2535
|
-
|
|
2536
|
-
return h(
|
|
2537
|
-
key:
|
|
2538
|
-
ref:
|
|
2539
|
-
class:
|
|
2540
|
-
}, [
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2294
|
+
renderScrollX(h) {
|
|
2295
|
+
const $xeGanttView = this;
|
|
2296
|
+
return h("div", {
|
|
2297
|
+
key: "vsx",
|
|
2298
|
+
ref: "refScrollXVirtualElem",
|
|
2299
|
+
class: "vxe-gantt-view--scroll-x-virtual"
|
|
2300
|
+
}, [
|
|
2301
|
+
h("div", {
|
|
2302
|
+
ref: "refScrollXLeftCornerElem",
|
|
2303
|
+
class: "vxe-gantt-view--scroll-x-left-corner"
|
|
2304
|
+
}),
|
|
2305
|
+
h("div", {
|
|
2306
|
+
ref: "refScrollXWrapperElem",
|
|
2307
|
+
class: "vxe-gantt-view--scroll-x-wrapper"
|
|
2308
|
+
}, [
|
|
2309
|
+
h("div", {
|
|
2310
|
+
ref: "refScrollXHandleElem",
|
|
2311
|
+
class: "vxe-gantt-view--scroll-x-handle",
|
|
2312
|
+
on: {
|
|
2313
|
+
scroll: $xeGanttView.triggerVirtualScrollXEvent
|
|
2314
|
+
}
|
|
2315
|
+
}, [
|
|
2316
|
+
h("div", {
|
|
2317
|
+
ref: "refScrollXSpaceElem",
|
|
2318
|
+
class: "vxe-gantt-view--scroll-x-space"
|
|
2319
|
+
})
|
|
2320
|
+
]),
|
|
2321
|
+
h("div", {
|
|
2322
|
+
class: "vxe-gantt-view--scroll-x-handle-appearance"
|
|
2323
|
+
})
|
|
2324
|
+
]),
|
|
2325
|
+
h("div", {
|
|
2326
|
+
ref: "refScrollXRightCornerElem",
|
|
2327
|
+
class: "vxe-gantt-view--scroll-x-right-corner"
|
|
2328
|
+
})
|
|
2329
|
+
]);
|
|
2561
2330
|
},
|
|
2562
|
-
renderScrollY
|
|
2563
|
-
|
|
2564
|
-
return h(
|
|
2565
|
-
ref:
|
|
2566
|
-
class:
|
|
2567
|
-
}, [
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2331
|
+
renderScrollY(h) {
|
|
2332
|
+
const $xeGanttView = this;
|
|
2333
|
+
return h("div", {
|
|
2334
|
+
ref: "refScrollYVirtualElem",
|
|
2335
|
+
class: "vxe-gantt-view--scroll-y-virtual"
|
|
2336
|
+
}, [
|
|
2337
|
+
h("div", {
|
|
2338
|
+
ref: "refScrollYTopCornerElem",
|
|
2339
|
+
class: "vxe-gantt-view--scroll-y-top-corner"
|
|
2340
|
+
}),
|
|
2341
|
+
h("div", {
|
|
2342
|
+
ref: "refScrollYWrapperElem",
|
|
2343
|
+
class: "vxe-gantt-view--scroll-y-wrapper"
|
|
2344
|
+
}, [
|
|
2345
|
+
h("div", {
|
|
2346
|
+
ref: "refScrollYHandleElem",
|
|
2347
|
+
class: "vxe-gantt-view--scroll-y-handle",
|
|
2348
|
+
on: {
|
|
2349
|
+
scroll: $xeGanttView.triggerVirtualScrollYEvent
|
|
2350
|
+
}
|
|
2351
|
+
}, [
|
|
2352
|
+
h("div", {
|
|
2353
|
+
ref: "refScrollYSpaceElem",
|
|
2354
|
+
class: "vxe-gantt-view--scroll-y-space"
|
|
2355
|
+
})
|
|
2356
|
+
]),
|
|
2357
|
+
h("div", {
|
|
2358
|
+
class: "vxe-gantt-view--scroll-y-handle-appearance"
|
|
2359
|
+
})
|
|
2360
|
+
]),
|
|
2361
|
+
h("div", {
|
|
2362
|
+
ref: "refScrollYBottomCornerElem",
|
|
2363
|
+
class: "vxe-gantt-view--scroll-y-bottom-corner"
|
|
2364
|
+
})
|
|
2365
|
+
]);
|
|
2588
2366
|
},
|
|
2589
|
-
renderViewport
|
|
2590
|
-
return h(
|
|
2591
|
-
class:
|
|
2592
|
-
}, [
|
|
2367
|
+
renderViewport(h) {
|
|
2368
|
+
return h("div", {
|
|
2369
|
+
class: "vxe-gantt-view--viewport-wrapper"
|
|
2370
|
+
}, [
|
|
2371
|
+
h(import_gantt_header.default),
|
|
2372
|
+
h(import_gantt_body.default),
|
|
2373
|
+
h(import_gantt_footer.default)
|
|
2374
|
+
]);
|
|
2593
2375
|
},
|
|
2594
|
-
renderNativeBody
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
return h(
|
|
2599
|
-
class:
|
|
2600
|
-
}, scrollbarYToLeft ? [
|
|
2376
|
+
renderNativeBody(h) {
|
|
2377
|
+
const $xeGanttView = this;
|
|
2378
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
2379
|
+
const scrollbarYToLeft = $xeGantt.computeScrollbarYToLeft;
|
|
2380
|
+
return h("div", {
|
|
2381
|
+
class: "vxe-gantt-view--layout-wrapper"
|
|
2382
|
+
}, scrollbarYToLeft ? [
|
|
2383
|
+
$xeGanttView.renderScrollY(h),
|
|
2384
|
+
$xeGanttView.renderViewport(h)
|
|
2385
|
+
] : [
|
|
2386
|
+
$xeGanttView.renderViewport(h),
|
|
2387
|
+
$xeGanttView.renderScrollY(h)
|
|
2388
|
+
]);
|
|
2601
2389
|
},
|
|
2602
|
-
renderVirtualBody
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
'overflow-x': xThumbWidth
|
|
2390
|
+
renderVirtualBody(h) {
|
|
2391
|
+
const $xeGanttView = this;
|
|
2392
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
2393
|
+
const reactData = $xeGanttView.reactData;
|
|
2394
|
+
const ganttReactData = $xeGantt.reactData;
|
|
2395
|
+
const { showLeftView } = ganttReactData;
|
|
2396
|
+
const { xThumbWidth, yThumbHeight } = reactData;
|
|
2397
|
+
const scrollbarOpts = $xeGantt.computeScrollbarOpts;
|
|
2398
|
+
const isVScrollbar = $xeGanttView.computeGanttIsVScrollbar;
|
|
2399
|
+
const scrollXAutoHide = $xeGanttView.computeScrollXAutoHide;
|
|
2400
|
+
const scrollYAutoHide = $xeGanttView.computeScrollYAutoHide;
|
|
2401
|
+
const scrollXVisible = $xeGanttView.computeScrollXVisible;
|
|
2402
|
+
const scrollYVisible = $xeGanttView.computeScrollYVisible;
|
|
2403
|
+
const scrollbarXToTop = $xeGanttView.computeScrollbarXToTop;
|
|
2404
|
+
const scrollbarYToLeft = $xeGantt.computeScrollbarYToLeft;
|
|
2405
|
+
const scrollbarWrapperClss = $xeGanttView.computeScrollbarWrapperClss;
|
|
2406
|
+
return h("div", {
|
|
2407
|
+
key: "lvb",
|
|
2408
|
+
class: ["vxe-gantt--layout-wrapper", `sx-pos--${scrollbarXToTop ? "top" : "bottom"}`, `sy-pos--${scrollbarYToLeft ? "left" : "right"}`, {
|
|
2409
|
+
"is--virtual-scrollbar": isVScrollbar,
|
|
2410
|
+
"ov-padding": isVScrollbar && scrollbarOpts.padding,
|
|
2411
|
+
"ov-x--auto-hide": isVScrollbar && scrollXAutoHide,
|
|
2412
|
+
"ov-y--auto-hide": isVScrollbar && scrollYAutoHide,
|
|
2413
|
+
"overflow-y": yThumbHeight,
|
|
2414
|
+
"overflow-x": xThumbWidth
|
|
2628
2415
|
}]
|
|
2629
|
-
}, [
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2416
|
+
}, [
|
|
2417
|
+
$xeGanttView.renderViewport(h),
|
|
2418
|
+
h("div", {
|
|
2419
|
+
class: scrollbarWrapperClss
|
|
2420
|
+
}, [
|
|
2421
|
+
scrollXVisible === false ? renderEmptyElement($xeGantt) : h("div", {
|
|
2422
|
+
ref: "refTrackXElem",
|
|
2423
|
+
class: "vxe-scrollbar--track-x",
|
|
2424
|
+
on: {
|
|
2425
|
+
click: $xeGanttView.clickTrackXEvent
|
|
2426
|
+
}
|
|
2427
|
+
}, [
|
|
2428
|
+
h("div", {
|
|
2429
|
+
ref: "refThumbXElem",
|
|
2430
|
+
class: "vxe-scrollbar--thumb-x",
|
|
2431
|
+
on: {
|
|
2432
|
+
pointerdown: $xeGanttView.pointerdownThumbXEvent,
|
|
2433
|
+
pointermove: $xeGanttView.pointermoveThumbXEvent,
|
|
2434
|
+
pointerup: $xeGanttView.cleatPointerThumbEvent,
|
|
2435
|
+
pointercancel: $xeGanttView.cleatPointerThumbEvent,
|
|
2436
|
+
lostpointercapture: $xeGanttView.cleatPointerThumbEvent
|
|
2437
|
+
}
|
|
2438
|
+
})
|
|
2439
|
+
]),
|
|
2440
|
+
scrollbarYToLeft && showLeftView || scrollYVisible === false ? renderEmptyElement($xeGantt) : h("div", {
|
|
2441
|
+
ref: "refTrackYElem",
|
|
2442
|
+
class: "vxe-scrollbar--track-y",
|
|
2443
|
+
on: {
|
|
2444
|
+
click: $xeGanttView.clickTrackYEvent
|
|
2445
|
+
}
|
|
2446
|
+
}, [
|
|
2447
|
+
h("div", {
|
|
2448
|
+
ref: "refThumbYElem",
|
|
2449
|
+
class: "vxe-scrollbar--thumb-y",
|
|
2450
|
+
on: {
|
|
2451
|
+
pointerdown: $xeGanttView.pointerdownThumbYEvent,
|
|
2452
|
+
pointermove: $xeGanttView.pointermoveThumbYEvent,
|
|
2453
|
+
pointerup: $xeGanttView.cleatPointerThumbEvent,
|
|
2454
|
+
pointercancel: $xeGanttView.cleatPointerThumbEvent,
|
|
2455
|
+
lostpointercapture: $xeGanttView.cleatPointerThumbEvent
|
|
2456
|
+
}
|
|
2457
|
+
})
|
|
2458
|
+
])
|
|
2459
|
+
])
|
|
2460
|
+
]);
|
|
2664
2461
|
},
|
|
2665
|
-
renderVN
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
'is--scroll-x': overflowX,
|
|
2680
|
-
'is--virtual-x': scrollXLoad,
|
|
2681
|
-
'is--virtual-y': scrollYLoad
|
|
2462
|
+
renderVN(h) {
|
|
2463
|
+
const $xeGanttView = this;
|
|
2464
|
+
const $xeGantt = $xeGanttView.$xeGantt;
|
|
2465
|
+
const reactData = $xeGanttView.reactData;
|
|
2466
|
+
const { overflowX, overflowY, scrollXLoad, scrollYLoad } = reactData;
|
|
2467
|
+
const isVScrollbar = $xeGanttView.computeGanttIsVScrollbar;
|
|
2468
|
+
const scrollbarXToTop = $xeGantt.computeScrollbarXToTop;
|
|
2469
|
+
return h("div", {
|
|
2470
|
+
ref: "refElem",
|
|
2471
|
+
class: ["vxe-gantt-view", {
|
|
2472
|
+
"is--scroll-y": overflowY,
|
|
2473
|
+
"is--scroll-x": overflowX,
|
|
2474
|
+
"is--virtual-x": scrollXLoad,
|
|
2475
|
+
"is--virtual-y": scrollYLoad
|
|
2682
2476
|
}]
|
|
2683
|
-
}, [
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2477
|
+
}, [
|
|
2478
|
+
h(
|
|
2479
|
+
"div",
|
|
2480
|
+
{
|
|
2481
|
+
class: "vxe-gantt-view--render-wrapper"
|
|
2482
|
+
},
|
|
2483
|
+
isVScrollbar ? [$xeGanttView.renderVirtualBody(h)] : scrollbarXToTop ? [
|
|
2484
|
+
$xeGanttView.renderScrollX(h),
|
|
2485
|
+
$xeGanttView.renderNativeBody(h)
|
|
2486
|
+
] : [
|
|
2487
|
+
$xeGanttView.renderNativeBody(h),
|
|
2488
|
+
$xeGanttView.renderScrollX(h)
|
|
2489
|
+
]
|
|
2490
|
+
),
|
|
2491
|
+
h("div", {
|
|
2492
|
+
class: "vxe-gantt-view--render-vars"
|
|
2493
|
+
}, [
|
|
2494
|
+
h("div", {
|
|
2495
|
+
ref: "refColInfoElem",
|
|
2496
|
+
class: "vxe-gantt-view--column-info"
|
|
2497
|
+
})
|
|
2498
|
+
])
|
|
2499
|
+
]);
|
|
2691
2500
|
}
|
|
2692
2501
|
},
|
|
2693
2502
|
watch: {
|
|
2694
|
-
computeGanttIsVScrollbar
|
|
2695
|
-
|
|
2696
|
-
$xeGanttView.$nextTick(
|
|
2503
|
+
computeGanttIsVScrollbar() {
|
|
2504
|
+
const $xeGanttView = this;
|
|
2505
|
+
$xeGanttView.$nextTick(() => {
|
|
2697
2506
|
$xeGanttView.bindScrollbarResize();
|
|
2698
|
-
$xeGanttView.$nextTick(
|
|
2507
|
+
$xeGanttView.$nextTick(() => {
|
|
2699
2508
|
$xeGanttView.reScrollFlag++;
|
|
2700
2509
|
});
|
|
2701
2510
|
});
|
|
2702
2511
|
},
|
|
2703
|
-
computeScrollbarXToTop
|
|
2704
|
-
|
|
2512
|
+
computeScrollbarXToTop() {
|
|
2513
|
+
const $xeGanttView = this;
|
|
2705
2514
|
$xeGanttView.reScrollFlag++;
|
|
2706
2515
|
},
|
|
2707
|
-
computeScrollbarYToLeft
|
|
2708
|
-
|
|
2516
|
+
computeScrollbarYToLeft() {
|
|
2517
|
+
const $xeGanttView = this;
|
|
2709
2518
|
$xeGanttView.reScrollFlag++;
|
|
2710
2519
|
},
|
|
2711
|
-
computeScrollXVisible
|
|
2712
|
-
|
|
2520
|
+
computeScrollXVisible() {
|
|
2521
|
+
const $xeGanttView = this;
|
|
2713
2522
|
$xeGanttView.reScrollFlag++;
|
|
2714
2523
|
},
|
|
2715
|
-
computeScrollYVisible
|
|
2716
|
-
|
|
2524
|
+
computeScrollYVisible() {
|
|
2525
|
+
const $xeGanttView = this;
|
|
2717
2526
|
$xeGanttView.reScrollFlag++;
|
|
2718
2527
|
},
|
|
2719
|
-
computeScrollXHeight
|
|
2720
|
-
|
|
2528
|
+
computeScrollXHeight() {
|
|
2529
|
+
const $xeGanttView = this;
|
|
2721
2530
|
$xeGanttView.reScrollFlag++;
|
|
2722
2531
|
},
|
|
2723
|
-
computeScrollYWidth
|
|
2724
|
-
|
|
2532
|
+
computeScrollYWidth() {
|
|
2533
|
+
const $xeGanttView = this;
|
|
2725
2534
|
$xeGanttView.reScrollFlag++;
|
|
2726
2535
|
},
|
|
2727
|
-
reScrollFlag
|
|
2728
|
-
|
|
2729
|
-
$xeGanttView.$nextTick(
|
|
2536
|
+
reScrollFlag() {
|
|
2537
|
+
const $xeGanttView = this;
|
|
2538
|
+
$xeGanttView.$nextTick(() => {
|
|
2730
2539
|
$xeGanttView.updateScrollbar();
|
|
2731
|
-
$xeGanttView.$nextTick(
|
|
2540
|
+
$xeGanttView.$nextTick(() => {
|
|
2732
2541
|
$xeGanttView.updateScrollbar();
|
|
2733
2542
|
});
|
|
2734
2543
|
});
|
|
2735
2544
|
}
|
|
2736
2545
|
},
|
|
2737
|
-
mounted
|
|
2738
|
-
|
|
2739
|
-
$xeGanttView.$nextTick(
|
|
2546
|
+
mounted() {
|
|
2547
|
+
const $xeGanttView = this;
|
|
2548
|
+
$xeGanttView.$nextTick(() => {
|
|
2740
2549
|
$xeGanttView.bindScrollbarResize();
|
|
2741
2550
|
});
|
|
2742
|
-
globalEvents.on($xeGanttView,
|
|
2551
|
+
globalEvents.on($xeGanttView, "resize", $xeGanttView.handleGlobalResizeEvent);
|
|
2743
2552
|
},
|
|
2744
|
-
beforeDestroy
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2553
|
+
beforeDestroy() {
|
|
2554
|
+
const $xeGanttView = this;
|
|
2555
|
+
const reactData = $xeGanttView.reactData;
|
|
2556
|
+
const internalData = $xeGanttView.internalData;
|
|
2557
|
+
const { scrollObserver } = internalData;
|
|
2749
2558
|
if (scrollObserver) {
|
|
2750
2559
|
scrollObserver.disconnect();
|
|
2751
2560
|
}
|
|
2752
|
-
globalEvents.off($xeGanttView,
|
|
2753
|
-
|
|
2754
|
-
|
|
2561
|
+
globalEvents.off($xeGanttView, "keydown");
|
|
2562
|
+
import_xe_utils.default.assign(reactData, createReactData());
|
|
2563
|
+
import_xe_utils.default.assign(internalData, createInternalData());
|
|
2755
2564
|
},
|
|
2756
|
-
render
|
|
2565
|
+
render(h) {
|
|
2757
2566
|
return this.renderVN(h);
|
|
2758
2567
|
}
|
|
2759
|
-
});
|
|
2568
|
+
});
|