vxe-gantt 3.2.4 → 3.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/gantt/src/gantt-chart.js +91 -14
- package/es/gantt/src/gantt-view.js +46 -10
- package/es/gantt/src/gantt.js +13 -4
- package/es/gantt/src/static.js +6 -2
- package/es/gantt/src/util.js +8 -4
- package/es/gantt/style.css +28 -6
- package/es/gantt/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +4 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +3 -0
- package/es/vxe-gantt/style.css +28 -6
- package/es/vxe-gantt/style.min.css +1 -1
- package/lib/gantt/src/gantt-chart.js +75 -12
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +50 -15
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +14 -2
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/gantt/src/static.js +6 -2
- package/lib/gantt/src/static.min.js +1 -1
- package/lib/gantt/src/util.js +10 -5
- package/lib/gantt/src/util.min.js +1 -1
- package/lib/gantt/style/style.css +28 -6
- package/lib/gantt/style/style.min.css +1 -1
- package/lib/index.umd.js +163 -37
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +4 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/utils.js +4 -0
- package/lib/ui/src/utils.min.js +1 -1
- package/lib/vxe-gantt/style/style.css +28 -6
- package/lib/vxe-gantt/style/style.min.css +1 -1
- package/package.json +3 -3
- package/packages/gantt/src/gantt-chart.ts +97 -14
- package/packages/gantt/src/gantt-view.ts +44 -10
- package/packages/gantt/src/gantt.ts +14 -3
- package/packages/gantt/src/static.ts +7 -3
- package/packages/gantt/src/util.ts +11 -7
- package/packages/ui/index.ts +3 -0
- package/packages/ui/src/utils.ts +4 -0
- package/styles/components/gantt-module/gantt-chart.scss +31 -4
- package/styles/theme/base.scss +1 -0
package/lib/index.umd.js
CHANGED
|
@@ -8286,7 +8286,7 @@ var core_ = __webpack_require__(4345);
|
|
|
8286
8286
|
|
|
8287
8287
|
var setConfig = core_.VxeUI.setConfig,
|
|
8288
8288
|
setIcon = core_.VxeUI.setIcon;
|
|
8289
|
-
core_.VxeUI.ganttVersion = "3.2.
|
|
8289
|
+
core_.VxeUI.ganttVersion = "3.2.6";
|
|
8290
8290
|
var ymdFormat = 'yyyy-MM-dd';
|
|
8291
8291
|
var ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
|
|
8292
8292
|
setConfig({
|
|
@@ -8377,6 +8377,9 @@ setConfig({
|
|
|
8377
8377
|
resize: true,
|
|
8378
8378
|
showCollapseTableButton: true,
|
|
8379
8379
|
showCollapseTaskButton: true
|
|
8380
|
+
},
|
|
8381
|
+
taskBarSubviewConfig: {
|
|
8382
|
+
// showOverview: false
|
|
8380
8383
|
}
|
|
8381
8384
|
}
|
|
8382
8385
|
});
|
|
@@ -8400,7 +8403,7 @@ var es_array_concat = __webpack_require__(8706);
|
|
|
8400
8403
|
;// ./packages/ui/src/log.ts
|
|
8401
8404
|
|
|
8402
8405
|
var log = core_.VxeUI.log;
|
|
8403
|
-
var version = "gantt v".concat("3.2.
|
|
8406
|
+
var version = "gantt v".concat("3.2.6");
|
|
8404
8407
|
var warnLog = log.create('warn', version);
|
|
8405
8408
|
var errLog = log.create('error', version);
|
|
8406
8409
|
;// ./packages/ui/src/depend.ts
|
|
@@ -8862,6 +8865,9 @@ var getConfig = core_.VxeUI.getConfig;
|
|
|
8862
8865
|
function isEnableConf(conf) {
|
|
8863
8866
|
return conf && conf.enabled !== false;
|
|
8864
8867
|
}
|
|
8868
|
+
function hasEnableConf(conf, opts) {
|
|
8869
|
+
return opts && (conf ? opts.enabled !== false : opts.enabled);
|
|
8870
|
+
}
|
|
8865
8871
|
function isEmptyValue(cellValue) {
|
|
8866
8872
|
return cellValue === null || cellValue === undefined || cellValue === '';
|
|
8867
8873
|
}
|
|
@@ -9151,15 +9157,19 @@ function getTaskBarLeft(chartRest, viewCellWidth) {
|
|
|
9151
9157
|
return chartRest ? viewCellWidth * chartRest.oLeftSize : 0;
|
|
9152
9158
|
}
|
|
9153
9159
|
function getTaskBarWidth(chartRest, viewCellWidth) {
|
|
9154
|
-
return Math.max(1, chartRest ? Math.floor(viewCellWidth * chartRest.oWidthSize) - 1 : 0);
|
|
9160
|
+
return chartRest && chartRest.oWidthSize ? Math.max(1, chartRest ? Math.floor(viewCellWidth * chartRest.oWidthSize) - 1 : 0) : 0;
|
|
9155
9161
|
}
|
|
9156
9162
|
var taskTypeMaps = {
|
|
9157
|
-
milestone: true
|
|
9163
|
+
milestone: true,
|
|
9164
|
+
subview: true
|
|
9158
9165
|
};
|
|
9159
9166
|
function hasMilestoneTask(type) {
|
|
9160
|
-
return
|
|
9167
|
+
return type === 'milestone';
|
|
9161
9168
|
}
|
|
9162
|
-
function
|
|
9169
|
+
function hasSubviewTask(type) {
|
|
9170
|
+
return type === 'subview';
|
|
9171
|
+
}
|
|
9172
|
+
function getTaskType(type) {
|
|
9163
9173
|
return taskTypeMaps[type] ? type : 'default';
|
|
9164
9174
|
}
|
|
9165
9175
|
;// ./packages/gantt/src/gantt-header.ts
|
|
@@ -9339,6 +9349,8 @@ var viewType = 'header';
|
|
|
9339
9349
|
|
|
9340
9350
|
|
|
9341
9351
|
|
|
9352
|
+
|
|
9353
|
+
|
|
9342
9354
|
var getIcon = core_.VxeUI.getIcon,
|
|
9343
9355
|
renderEmptyElement = core_.VxeUI.renderEmptyElement;
|
|
9344
9356
|
var gantt_chart_sourceType = 'gantt';
|
|
@@ -9362,7 +9374,7 @@ var gantt_chart_viewType = 'chart';
|
|
|
9362
9374
|
//
|
|
9363
9375
|
// Render
|
|
9364
9376
|
//
|
|
9365
|
-
renderTaskBar: function renderTaskBar(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex) {
|
|
9377
|
+
renderTaskBar: function renderTaskBar(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, rowChildren, isExpandTree) {
|
|
9366
9378
|
var _vm = this;
|
|
9367
9379
|
var $xeGantt = _vm.$xeGantt;
|
|
9368
9380
|
var tableReactData = $xeTable;
|
|
@@ -9379,7 +9391,8 @@ var gantt_chart_viewType = 'chart';
|
|
|
9379
9391
|
var ganttInternalData = $xeGantt.internalData;
|
|
9380
9392
|
var ganttSlots = $xeGantt.$scopedSlots;
|
|
9381
9393
|
var taskBarSlot = ganttSlots.taskBar || ganttSlots['task-bar'];
|
|
9382
|
-
var taskBarMilestoneConfig = ganttProps.taskBarMilestoneConfig
|
|
9394
|
+
var taskBarMilestoneConfig = ganttProps.taskBarMilestoneConfig,
|
|
9395
|
+
taskBarSubviewConfig = ganttProps.taskBarSubviewConfig;
|
|
9383
9396
|
var activeLink = ganttReactData.activeLink,
|
|
9384
9397
|
activeBarRowid = ganttReactData.activeBarRowid;
|
|
9385
9398
|
var titleField = $xeGantt.computeTitleField;
|
|
@@ -9387,6 +9400,7 @@ var gantt_chart_viewType = 'chart';
|
|
|
9387
9400
|
var typeField = $xeGantt.computeTypeField;
|
|
9388
9401
|
var taskBarOpts = $xeGantt.computeTaskBarOpts;
|
|
9389
9402
|
var taskBarMilestoneOpts = $xeGantt.computeTaskBarMilestoneOpts;
|
|
9403
|
+
var taskBarSubviewOpts = $xeGantt.computeTaskBarSubviewOpts;
|
|
9390
9404
|
var scaleUnit = $xeGantt.computeScaleUnit;
|
|
9391
9405
|
var barParams = {
|
|
9392
9406
|
$gantt: $xeGantt,
|
|
@@ -9406,8 +9420,9 @@ var gantt_chart_viewType = 'chart';
|
|
|
9406
9420
|
var cellHeight = resizeHeightFlag ? getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
|
|
9407
9421
|
var title = getStringValue(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, titleField));
|
|
9408
9422
|
var progressValue = showProgress ? Math.min(100, Math.max(0, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, progressField)))) : 0;
|
|
9409
|
-
var
|
|
9410
|
-
var isMilestone = !!(taskBarMilestoneConfig && hasMilestoneTask(
|
|
9423
|
+
var renderTaskType = getTaskType(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, typeField));
|
|
9424
|
+
var isMilestone = !!(hasEnableConf(taskBarMilestoneConfig, taskBarMilestoneOpts) && hasMilestoneTask(renderTaskType));
|
|
9425
|
+
var isSubview = !!(hasEnableConf(taskBarSubviewConfig, taskBarSubviewOpts) && hasSubviewTask(renderTaskType));
|
|
9411
9426
|
var vbStyle = {};
|
|
9412
9427
|
var vpStyle = {
|
|
9413
9428
|
width: "".concat(progressValue || 0, "%")
|
|
@@ -9479,7 +9494,69 @@ var gantt_chart_viewType = 'chart';
|
|
|
9479
9494
|
on: ctOns
|
|
9480
9495
|
}, $xeGantt.callSlot(taskBarSlot, barParams, h)));
|
|
9481
9496
|
} else {
|
|
9482
|
-
if (
|
|
9497
|
+
if (isSubview && rowChildren && rowChildren.length) {
|
|
9498
|
+
if (isExpandTree) {
|
|
9499
|
+
if (taskBarSubviewOpts.showOverview) {
|
|
9500
|
+
cbVNs.push(h('div', {
|
|
9501
|
+
key: 'vcso',
|
|
9502
|
+
class: ['vxe-gantt-view--chart-subview-wrapper is--overview', {
|
|
9503
|
+
'is--round': round,
|
|
9504
|
+
'is--move': moveable
|
|
9505
|
+
}]
|
|
9506
|
+
}, [h('div', {
|
|
9507
|
+
key: rowid,
|
|
9508
|
+
attrs: {
|
|
9509
|
+
rowid: rowid
|
|
9510
|
+
},
|
|
9511
|
+
class: 'vxe-gantt-view--chart-subview-bar'
|
|
9512
|
+
}, [h('div', {
|
|
9513
|
+
class: 'vxe-gantt-view--chart-subview-bar-content-wrapper'
|
|
9514
|
+
}, [showContent ? h('div', {
|
|
9515
|
+
class: 'vxe-gantt-view--chart-content'
|
|
9516
|
+
}, title) : renderEmptyElement($xeGantt)])])]));
|
|
9517
|
+
}
|
|
9518
|
+
} else {
|
|
9519
|
+
cbVNs.push(h('div', {
|
|
9520
|
+
key: 'vcsc',
|
|
9521
|
+
class: 'vxe-gantt-view--chart-subview-wrapper is--inline'
|
|
9522
|
+
}, rowChildren.map(function (childRow) {
|
|
9523
|
+
var childRowid = $xeTable.getRowid(childRow);
|
|
9524
|
+
var childTitle = getStringValue(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(childRow, titleField));
|
|
9525
|
+
var childProgressValue = showProgress ? Math.min(100, Math.max(0, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(childRow, progressField)))) : 0;
|
|
9526
|
+
var childRenderTaskType = getTaskType(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(childRow, typeField));
|
|
9527
|
+
var vpcStyle = {
|
|
9528
|
+
width: "".concat(childProgressValue || 0, "%")
|
|
9529
|
+
};
|
|
9530
|
+
if (isBarRowStyle) {
|
|
9531
|
+
var _completedBgColor = barStyObj.completedBgColor;
|
|
9532
|
+
if (_completedBgColor) {
|
|
9533
|
+
vpcStyle.backgroundColor = _completedBgColor;
|
|
9534
|
+
}
|
|
9535
|
+
}
|
|
9536
|
+
if (contentMethod) {
|
|
9537
|
+
childTitle = getStringValue(contentMethod({
|
|
9538
|
+
row: childRow,
|
|
9539
|
+
title: childTitle,
|
|
9540
|
+
scaleType: scaleUnit
|
|
9541
|
+
}));
|
|
9542
|
+
}
|
|
9543
|
+
return h('div', {
|
|
9544
|
+
key: childRowid,
|
|
9545
|
+
attrs: {
|
|
9546
|
+
rowid: childRowid
|
|
9547
|
+
},
|
|
9548
|
+
class: ['vxe-gantt-view--chart-subview-bar', "is--".concat(childRenderTaskType)]
|
|
9549
|
+
}, [h('div', {
|
|
9550
|
+
class: 'vxe-gantt-view--chart-subview-bar-content-wrapper'
|
|
9551
|
+
}, [showProgress ? h('div', {
|
|
9552
|
+
class: 'vxe-gantt-view--chart-progress',
|
|
9553
|
+
style: vpcStyle
|
|
9554
|
+
}) : renderEmptyElement($xeGantt), showContent ? h('div', {
|
|
9555
|
+
class: 'vxe-gantt-view--chart-content'
|
|
9556
|
+
}, childTitle) : renderEmptyElement($xeGantt)])]);
|
|
9557
|
+
})));
|
|
9558
|
+
}
|
|
9559
|
+
} else if (isMilestone) {
|
|
9483
9560
|
var icon = taskBarMilestoneOpts.icon,
|
|
9484
9561
|
iconStatus = taskBarMilestoneOpts.iconStatus,
|
|
9485
9562
|
iconStyle = taskBarMilestoneOpts.iconStyle;
|
|
@@ -9505,11 +9582,9 @@ var gantt_chart_viewType = 'chart';
|
|
|
9505
9582
|
class: 'vxe-gantt-view--chart-bar-content-wrapper',
|
|
9506
9583
|
on: ctOns
|
|
9507
9584
|
}, [showProgress ? h('div', {
|
|
9508
|
-
key: 'vcp',
|
|
9509
9585
|
class: 'vxe-gantt-view--chart-progress',
|
|
9510
9586
|
style: vpStyle
|
|
9511
9587
|
}) : renderEmptyElement($xeGantt), showContent ? h('div', {
|
|
9512
|
-
key: 'vcc',
|
|
9513
9588
|
class: 'vxe-gantt-view--chart-content'
|
|
9514
9589
|
}, title) : renderEmptyElement($xeGantt)]));
|
|
9515
9590
|
}
|
|
@@ -9519,7 +9594,7 @@ var gantt_chart_viewType = 'chart';
|
|
|
9519
9594
|
attrs: {
|
|
9520
9595
|
rowid: rowid
|
|
9521
9596
|
},
|
|
9522
|
-
class: ['vxe-gantt-view--chart-row', "is--".concat(
|
|
9597
|
+
class: ['vxe-gantt-view--chart-row', "is--".concat(renderTaskType), {
|
|
9523
9598
|
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
|
|
9524
9599
|
'is--round': round,
|
|
9525
9600
|
'is--move': moveable
|
|
@@ -9533,7 +9608,7 @@ var gantt_chart_viewType = 'chart';
|
|
|
9533
9608
|
}
|
|
9534
9609
|
}
|
|
9535
9610
|
}, [h('div', {
|
|
9536
|
-
class: [taskBarSlot ? 'vxe-gantt-view--chart-custom-bar' : 'vxe-gantt-view--chart-bar', "is--".concat(
|
|
9611
|
+
class: [taskBarSlot ? 'vxe-gantt-view--chart-custom-bar' : 'vxe-gantt-view--chart-bar', "is--".concat(renderTaskType), {
|
|
9537
9612
|
'is--active': activeBarRowid === rowid,
|
|
9538
9613
|
'active--link': activeLink && (rowid === "".concat(activeLink.from) || rowid === "".concat(activeLink.to))
|
|
9539
9614
|
}],
|
|
@@ -9581,15 +9656,15 @@ var gantt_chart_viewType = 'chart';
|
|
|
9581
9656
|
rowIndex = rowRest.index;
|
|
9582
9657
|
_rowIndex = rowRest._index;
|
|
9583
9658
|
}
|
|
9584
|
-
trVNs.push(_vm.renderTaskBar(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex));
|
|
9585
9659
|
var isExpandTree = false;
|
|
9586
9660
|
var rowChildren = [];
|
|
9587
|
-
if (treeConfig
|
|
9661
|
+
if (treeConfig) {
|
|
9588
9662
|
rowChildren = row[childrenField];
|
|
9589
9663
|
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
9590
9664
|
}
|
|
9665
|
+
trVNs.push(_vm.renderTaskBar(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, rowChildren, isExpandTree));
|
|
9591
9666
|
// 如果是树形表格
|
|
9592
|
-
if (isExpandTree) {
|
|
9667
|
+
if (treeConfig && isExpandTree && !scrollYLoad && !transform) {
|
|
9593
9668
|
trVNs.push.apply(trVNs, _toConsumableArray(_vm.renderTaskRows(h, $xeTable, rowChildren)));
|
|
9594
9669
|
}
|
|
9595
9670
|
});
|
|
@@ -10148,22 +10223,30 @@ function updateTodayData($xeGanttView) {
|
|
|
10148
10223
|
var internalData = $xeGanttView.internalData;
|
|
10149
10224
|
var ganttReactData = $xeGantt.reactData;
|
|
10150
10225
|
var taskScaleList = ganttReactData.taskScaleList;
|
|
10226
|
+
var minScale = $xeGantt.computeMinScale;
|
|
10151
10227
|
var weekScale = taskScaleList.find(function (item) {
|
|
10152
10228
|
return item.type === 'week';
|
|
10153
10229
|
});
|
|
10230
|
+
var isMinWeek = minScale.type === 'week';
|
|
10154
10231
|
var itemDate = new Date();
|
|
10155
|
-
var _XEUtils$toDateString = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(itemDate, 'yyyy-M-
|
|
10156
|
-
_XEUtils$toDateString2 = _slicedToArray(_XEUtils$toDateString,
|
|
10232
|
+
var _XEUtils$toDateString = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(itemDate, 'yyyy-M-MM-dd-HH-mm-ss').split('-'),
|
|
10233
|
+
_XEUtils$toDateString2 = _slicedToArray(_XEUtils$toDateString, 7),
|
|
10157
10234
|
yyyy = _XEUtils$toDateString2[0],
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10235
|
+
M = _XEUtils$toDateString2[1],
|
|
10236
|
+
MM = _XEUtils$toDateString2[2],
|
|
10237
|
+
dd = _XEUtils$toDateString2[3],
|
|
10238
|
+
HH = _XEUtils$toDateString2[4],
|
|
10239
|
+
mm = _XEUtils$toDateString2[5],
|
|
10240
|
+
ss = _XEUtils$toDateString2[6];
|
|
10163
10241
|
var e = itemDate.getDay();
|
|
10164
10242
|
var E = e + 1;
|
|
10165
10243
|
var q = Math.ceil((itemDate.getMonth() + 1) / 3);
|
|
10166
|
-
var W = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(itemDate, weekScale ? weekScale.startDay : undefined);
|
|
10244
|
+
var W = "".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(itemDate, weekScale ? weekScale.startDay : undefined));
|
|
10245
|
+
if (isMinWeek && checkWeekOfsetYear(W, M)) {
|
|
10246
|
+
yyyy = "".concat(Number(yyyy) + 1);
|
|
10247
|
+
M = '1';
|
|
10248
|
+
MM = '0' + M;
|
|
10249
|
+
}
|
|
10167
10250
|
internalData.todayDateMaps = {
|
|
10168
10251
|
year: yyyy,
|
|
10169
10252
|
quarter: "".concat(yyyy, "_q").concat(q),
|
|
@@ -10647,14 +10730,23 @@ function handleParseColumn($xeGanttView) {
|
|
|
10647
10730
|
var rowid = $xeTable.getRowid(row);
|
|
10648
10731
|
var startValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, startField);
|
|
10649
10732
|
var endValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, endField);
|
|
10650
|
-
var
|
|
10733
|
+
var renderTaskType = getTaskType(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, typeField));
|
|
10734
|
+
var isMilestone = hasMilestoneTask(renderTaskType);
|
|
10735
|
+
var isSubview = hasSubviewTask(renderTaskType);
|
|
10651
10736
|
if (isMilestone) {
|
|
10652
10737
|
if (!startValue) {
|
|
10653
10738
|
startValue = endValue;
|
|
10654
10739
|
}
|
|
10655
10740
|
endValue = startValue;
|
|
10656
10741
|
}
|
|
10657
|
-
if (
|
|
10742
|
+
if (isSubview) {
|
|
10743
|
+
ctMaps[rowid] = {
|
|
10744
|
+
row: row,
|
|
10745
|
+
rowid: rowid,
|
|
10746
|
+
oLeftSize: 0,
|
|
10747
|
+
oWidthSize: 0
|
|
10748
|
+
};
|
|
10749
|
+
} else if (startValue && endValue) {
|
|
10658
10750
|
var _renderFn = renderFn(startValue, endValue),
|
|
10659
10751
|
offsetLeftSize = _renderFn.offsetLeftSize,
|
|
10660
10752
|
offsetWidthSize = _renderFn.offsetWidthSize;
|
|
@@ -10792,7 +10884,7 @@ function calcScrollbar($xeGanttView) {
|
|
|
10792
10884
|
reactData.overflowX = overflowX;
|
|
10793
10885
|
}
|
|
10794
10886
|
}
|
|
10795
|
-
function
|
|
10887
|
+
function updateTaskChartStyle($xeGanttView) {
|
|
10796
10888
|
var $xeGantt = $xeGanttView.$xeGantt;
|
|
10797
10889
|
var reactData = $xeGanttView.reactData;
|
|
10798
10890
|
var internalData = $xeGanttView.internalData;
|
|
@@ -10814,9 +10906,27 @@ function updateTaskChart($xeGanttView) {
|
|
|
10814
10906
|
return;
|
|
10815
10907
|
}
|
|
10816
10908
|
var chartRest = rowid ? chartMaps[rowid] : null;
|
|
10817
|
-
|
|
10818
|
-
if (
|
|
10819
|
-
|
|
10909
|
+
// 子任务视图
|
|
10910
|
+
if (hasClass(barEl, 'is--subview')) {
|
|
10911
|
+
var childWrapperEl = barEl.firstElementChild;
|
|
10912
|
+
if (childWrapperEl) {
|
|
10913
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(childWrapperEl.children, function (childEl) {
|
|
10914
|
+
var childBarEl = childEl;
|
|
10915
|
+
var childRowid = childBarEl.getAttribute('rowid') || '';
|
|
10916
|
+
var childChartRest = childRowid ? chartMaps[childRowid] : null;
|
|
10917
|
+
childBarEl.style.left = "".concat(getTaskBarLeft(childChartRest, viewCellWidth), "px");
|
|
10918
|
+
// 里程碑不需要宽度
|
|
10919
|
+
if (!hasClass(childBarEl, 'is--milestone')) {
|
|
10920
|
+
childBarEl.style.width = "".concat(getTaskBarWidth(childChartRest, viewCellWidth), "px");
|
|
10921
|
+
}
|
|
10922
|
+
});
|
|
10923
|
+
}
|
|
10924
|
+
} else {
|
|
10925
|
+
barEl.style.left = "".concat(getTaskBarLeft(chartRest, viewCellWidth), "px");
|
|
10926
|
+
// 里程碑不需要宽度
|
|
10927
|
+
if (!hasClass(barEl, 'is--milestone')) {
|
|
10928
|
+
barEl.style.width = "".concat(getTaskBarWidth(chartRest, viewCellWidth), "px");
|
|
10929
|
+
}
|
|
10820
10930
|
}
|
|
10821
10931
|
});
|
|
10822
10932
|
}
|
|
@@ -10942,7 +11052,7 @@ function updateStyle($xeGanttView) {
|
|
|
10942
11052
|
bodyTableElem.style.width = "".concat(vmTableWidth, "px");
|
|
10943
11053
|
}
|
|
10944
11054
|
reactData.scrollXWidth = viewTableWidth;
|
|
10945
|
-
return Promise.all([
|
|
11055
|
+
return Promise.all([updateTaskChartStyle($xeGanttView), $xeGantt.handleUpdateTaskLinkStyle ? $xeGantt.handleUpdateTaskLinkStyle($xeGanttView) : null]);
|
|
10946
11056
|
}
|
|
10947
11057
|
function handleRecalculateStyle($xeGanttView) {
|
|
10948
11058
|
var internalData = $xeGanttView.internalData;
|
|
@@ -11981,6 +12091,7 @@ function gantt_createReactData() {
|
|
|
11981
12091
|
taskLinkConfig: Object,
|
|
11982
12092
|
taskBarConfig: Object,
|
|
11983
12093
|
taskBarMilestoneConfig: Object,
|
|
12094
|
+
taskBarSubviewConfig: Object,
|
|
11984
12095
|
taskBarTooltipConfig: Object,
|
|
11985
12096
|
taskSplitConfig: Object,
|
|
11986
12097
|
taskBarResizeConfig: Object,
|
|
@@ -12086,6 +12197,11 @@ function gantt_createReactData() {
|
|
|
12086
12197
|
var props = $xeGantt;
|
|
12087
12198
|
return Object.assign({}, gantt_getConfig().gantt.taskBarMilestoneConfig, props.taskBarMilestoneConfig);
|
|
12088
12199
|
},
|
|
12200
|
+
computeTaskBarSubviewOpts: function computeTaskBarSubviewOpts() {
|
|
12201
|
+
var $xeGantt = this;
|
|
12202
|
+
var props = $xeGantt;
|
|
12203
|
+
return Object.assign({}, gantt_getConfig().gantt.taskBarSubviewConfig, props.taskBarSubviewConfig);
|
|
12204
|
+
},
|
|
12089
12205
|
computeTaskBarTooltipOpts: function computeTaskBarTooltipOpts() {
|
|
12090
12206
|
var $xeGantt = this;
|
|
12091
12207
|
var props = $xeGantt;
|
|
@@ -12182,13 +12298,15 @@ function gantt_createReactData() {
|
|
|
12182
12298
|
var props = $xeGantt;
|
|
12183
12299
|
var reactData = $xeGantt.reactData;
|
|
12184
12300
|
var height = props.height,
|
|
12185
|
-
maxHeight = props.maxHeight
|
|
12301
|
+
maxHeight = props.maxHeight,
|
|
12302
|
+
taskBarSubviewConfig = props.taskBarSubviewConfig;
|
|
12186
12303
|
var isZMax = reactData.isZMax,
|
|
12187
12304
|
tZindex = reactData.tZindex;
|
|
12188
12305
|
var taskViewOpts = $xeGantt.computeTaskViewOpts;
|
|
12189
12306
|
var tableStyle = taskViewOpts.tableStyle;
|
|
12190
12307
|
var taskBarOpts = $xeGantt.computeTaskBarOpts;
|
|
12191
12308
|
var barStyle = taskBarOpts.barStyle;
|
|
12309
|
+
var taskBarSubviewOpts = $xeGantt.computeTaskBarSubviewOpts;
|
|
12192
12310
|
var stys = {};
|
|
12193
12311
|
if (isZMax) {
|
|
12194
12312
|
stys.zIndex = tZindex;
|
|
@@ -12202,13 +12320,17 @@ function gantt_createReactData() {
|
|
|
12202
12320
|
}
|
|
12203
12321
|
if (barStyle && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(barStyle)) {
|
|
12204
12322
|
var bgColor = barStyle.bgColor,
|
|
12205
|
-
completedBgColor = barStyle.completedBgColor
|
|
12323
|
+
completedBgColor = barStyle.completedBgColor,
|
|
12324
|
+
overviewBgColor = barStyle.overviewBgColor;
|
|
12206
12325
|
if (bgColor) {
|
|
12207
12326
|
stys['--vxe-ui-gantt-view-task-bar-background-color'] = bgColor;
|
|
12208
12327
|
}
|
|
12209
12328
|
if (completedBgColor) {
|
|
12210
12329
|
stys['--vxe-ui-gantt-view-task-bar-completed-background-color'] = completedBgColor;
|
|
12211
12330
|
}
|
|
12331
|
+
if (overviewBgColor && hasEnableConf(taskBarSubviewConfig, taskBarSubviewOpts)) {
|
|
12332
|
+
stys['--vxe-ui-gantt-view-task-bar-overview-background-color'] = overviewBgColor;
|
|
12333
|
+
}
|
|
12212
12334
|
}
|
|
12213
12335
|
if (tableStyle) {
|
|
12214
12336
|
var defTbWidth = tableStyle.width;
|
|
@@ -14543,14 +14665,18 @@ var VxeGanttDependencyType;
|
|
|
14543
14665
|
VxeGanttDependencyType[VxeGanttDependencyType["FinishToFinish"] = 3] = "FinishToFinish";
|
|
14544
14666
|
})(VxeGanttDependencyType || (VxeGanttDependencyType = {}));
|
|
14545
14667
|
/**
|
|
14546
|
-
*
|
|
14668
|
+
* 任务渲染类型
|
|
14547
14669
|
*/
|
|
14548
14670
|
var VxeGanttTaskType;
|
|
14549
14671
|
(function (VxeGanttTaskType) {
|
|
14550
14672
|
/**
|
|
14551
|
-
*
|
|
14673
|
+
* 里程碑类型,该类型节点不需要结束日期
|
|
14552
14674
|
*/
|
|
14553
14675
|
VxeGanttTaskType["Milestone"] = "milestone";
|
|
14676
|
+
/**
|
|
14677
|
+
* 子视图类型,该类型会将子任务渲染到一行,无需开始日期和结束日期
|
|
14678
|
+
*/
|
|
14679
|
+
VxeGanttTaskType["Subview"] = "subview";
|
|
14554
14680
|
})(VxeGanttTaskType || (VxeGanttTaskType = {}));
|
|
14555
14681
|
;// ./packages/gantt/index.ts
|
|
14556
14682
|
|