vxe-gantt 3.2.6 → 3.3.0
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 +164 -145
- package/es/gantt/src/gantt-view.js +64 -9
- package/es/gantt/style.css +41 -12
- 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 +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-gantt/style.css +41 -12
- package/es/vxe-gantt/style.min.css +1 -1
- package/lib/gantt/src/gantt-chart.js +152 -134
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +68 -9
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/style/style.css +41 -12
- package/lib/gantt/style/style.min.css +1 -1
- package/lib/index.umd.js +222 -147
- 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 +1 -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/vxe-gantt/style/style.css +41 -12
- package/lib/vxe-gantt/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/gantt/src/gantt-chart.ts +164 -139
- package/packages/gantt/src/gantt-view.ts +65 -9
- package/styles/components/gantt-module/gantt-chart.scss +67 -11
- package/styles/theme/base.scss +1 -1
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.
|
|
8289
|
+
core_.VxeUI.ganttVersion = "3.3.0";
|
|
8290
8290
|
var ymdFormat = 'yyyy-MM-dd';
|
|
8291
8291
|
var ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
|
|
8292
8292
|
setConfig({
|
|
@@ -8403,7 +8403,7 @@ var es_array_concat = __webpack_require__(8706);
|
|
|
8403
8403
|
;// ./packages/ui/src/log.ts
|
|
8404
8404
|
|
|
8405
8405
|
var log = core_.VxeUI.log;
|
|
8406
|
-
var version = "gantt v".concat("3.
|
|
8406
|
+
var version = "gantt v".concat("3.3.0");
|
|
8407
8407
|
var warnLog = log.create('warn', version);
|
|
8408
8408
|
var errLog = log.create('error', version);
|
|
8409
8409
|
;// ./packages/ui/src/depend.ts
|
|
@@ -9349,8 +9349,6 @@ var viewType = 'header';
|
|
|
9349
9349
|
|
|
9350
9350
|
|
|
9351
9351
|
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
9352
|
var getIcon = core_.VxeUI.getIcon,
|
|
9355
9353
|
renderEmptyElement = core_.VxeUI.renderEmptyElement;
|
|
9356
9354
|
var gantt_chart_sourceType = 'gantt';
|
|
@@ -9386,12 +9384,14 @@ var gantt_chart_viewType = 'chart';
|
|
|
9386
9384
|
var cellOpts = $xeTable.computeCellOpts;
|
|
9387
9385
|
var rowOpts = $xeTable.computeRowOpts;
|
|
9388
9386
|
var defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
9387
|
+
var treeOpts = $xeTable.computeTreeOpts;
|
|
9388
|
+
var childrenField = treeOpts.children || treeOpts.childrenField;
|
|
9389
9389
|
var ganttProps = $xeGantt;
|
|
9390
9390
|
var ganttReactData = $xeGantt.reactData;
|
|
9391
|
-
var ganttInternalData = $xeGantt.internalData;
|
|
9392
9391
|
var ganttSlots = $xeGantt.$scopedSlots;
|
|
9393
9392
|
var taskBarSlot = ganttSlots.taskBar || ganttSlots['task-bar'];
|
|
9394
|
-
var
|
|
9393
|
+
var treeConfig = ganttProps.treeConfig,
|
|
9394
|
+
taskBarMilestoneConfig = ganttProps.taskBarMilestoneConfig,
|
|
9395
9395
|
taskBarSubviewConfig = ganttProps.taskBarSubviewConfig;
|
|
9396
9396
|
var activeLink = ganttReactData.activeLink,
|
|
9397
9397
|
activeBarRowid = ganttReactData.activeBarRowid;
|
|
@@ -9421,8 +9421,6 @@ var gantt_chart_viewType = 'chart';
|
|
|
9421
9421
|
var title = getStringValue(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, titleField));
|
|
9422
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;
|
|
9423
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));
|
|
9426
9424
|
var vbStyle = {};
|
|
9427
9425
|
var vpStyle = {
|
|
9428
9426
|
width: "".concat(progressValue || 0, "%")
|
|
@@ -9437,13 +9435,6 @@ var gantt_chart_viewType = 'chart';
|
|
|
9437
9435
|
vpStyle.backgroundColor = completedBgColor;
|
|
9438
9436
|
}
|
|
9439
9437
|
}
|
|
9440
|
-
if (contentMethod) {
|
|
9441
|
-
title = getStringValue(contentMethod({
|
|
9442
|
-
row: row,
|
|
9443
|
-
title: title,
|
|
9444
|
-
scaleType: scaleUnit
|
|
9445
|
-
}));
|
|
9446
|
-
}
|
|
9447
9438
|
var ctParams = {
|
|
9448
9439
|
$gantt: $xeGantt,
|
|
9449
9440
|
source: gantt_chart_sourceType,
|
|
@@ -9454,139 +9445,163 @@ var gantt_chart_viewType = 'chart';
|
|
|
9454
9445
|
rowIndex: rowIndex,
|
|
9455
9446
|
_rowIndex: _rowIndex
|
|
9456
9447
|
};
|
|
9457
|
-
var ctOns = {};
|
|
9458
|
-
if (showTooltip) {
|
|
9459
|
-
ctOns.mouseover = function (evnt) {
|
|
9460
|
-
var dragBarRow = ganttInternalData.dragBarRow;
|
|
9461
|
-
var ttParams = Object.assign({
|
|
9462
|
-
$event: evnt
|
|
9463
|
-
}, ctParams);
|
|
9464
|
-
if (!dragBarRow) {
|
|
9465
|
-
$xeGantt.triggerTaskBarTooltipEvent(evnt, ttParams);
|
|
9466
|
-
}
|
|
9467
|
-
$xeGantt.dispatchEvent('task-bar-mouseenter', ttParams, evnt);
|
|
9468
|
-
};
|
|
9469
|
-
ctOns.mouseleave = function (evnt) {
|
|
9470
|
-
var dragBarRow = ganttInternalData.dragBarRow;
|
|
9471
|
-
var ttParams = Object.assign({
|
|
9472
|
-
$event: evnt
|
|
9473
|
-
}, ctParams);
|
|
9474
|
-
if (!dragBarRow) {
|
|
9475
|
-
$xeGantt.handleTaskBarTooltipLeaveEvent(evnt, ttParams);
|
|
9476
|
-
}
|
|
9477
|
-
$xeGantt.dispatchEvent('task-bar-mouseleave', ttParams, evnt);
|
|
9478
|
-
};
|
|
9479
|
-
}
|
|
9480
9448
|
var cbVNs = [];
|
|
9481
9449
|
if ($xeGantt.renderGanttTaskBarContent) {
|
|
9482
9450
|
cbVNs = $xeGantt.renderGanttTaskBarContent(h, ctParams, {
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
vpStyle: vpStyle,
|
|
9487
|
-
rowid: rowid,
|
|
9488
|
-
ctOns: ctOns
|
|
9451
|
+
$gantt: $xeGantt,
|
|
9452
|
+
$table: $xeTable,
|
|
9453
|
+
rowid: rowid
|
|
9489
9454
|
});
|
|
9490
|
-
} else if (taskBarSlot) {
|
|
9491
|
-
cbVNs.push(h('div', {
|
|
9492
|
-
key: 'cbc',
|
|
9493
|
-
class: 'vxe-gantt-view--chart-custom-bar-content-wrapper',
|
|
9494
|
-
on: ctOns
|
|
9495
|
-
}, $xeGantt.callSlot(taskBarSlot, barParams, h)));
|
|
9496
9455
|
} else {
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9456
|
+
var isMilestone = !!(hasEnableConf(taskBarMilestoneConfig, taskBarMilestoneOpts) && hasMilestoneTask(renderTaskType));
|
|
9457
|
+
var isSubview = !!(hasEnableConf(taskBarSubviewConfig, taskBarSubviewOpts) && hasSubviewTask(renderTaskType));
|
|
9458
|
+
if (contentMethod) {
|
|
9459
|
+
title = getStringValue(contentMethod({
|
|
9460
|
+
row: row,
|
|
9461
|
+
title: title,
|
|
9462
|
+
scaleType: scaleUnit
|
|
9463
|
+
}));
|
|
9464
|
+
}
|
|
9465
|
+
var ctOns = {};
|
|
9466
|
+
if (showTooltip) {
|
|
9467
|
+
ctOns.mouseover = function (evnt) {
|
|
9468
|
+
var ttParams = Object.assign({
|
|
9469
|
+
$event: evnt
|
|
9470
|
+
}, ctParams);
|
|
9471
|
+
$xeGantt.dispatchEvent('task-bar-mouseenter', ttParams, evnt);
|
|
9472
|
+
};
|
|
9473
|
+
ctOns.mouseleave = function (evnt) {
|
|
9474
|
+
var ttParams = Object.assign({
|
|
9475
|
+
$event: evnt
|
|
9476
|
+
}, ctParams);
|
|
9477
|
+
$xeGantt.dispatchEvent('task-bar-mouseleave', ttParams, evnt);
|
|
9478
|
+
};
|
|
9479
|
+
}
|
|
9480
|
+
if (taskBarSlot) {
|
|
9481
|
+
cbVNs.push(h('div', {
|
|
9482
|
+
key: 'cbc',
|
|
9483
|
+
class: 'vxe-gantt-view--chart-custom-bar-content-wrapper',
|
|
9484
|
+
on: ctOns
|
|
9485
|
+
}, $xeGantt.callSlot(taskBarSlot, barParams, h)));
|
|
9486
|
+
} else {
|
|
9487
|
+
if (isSubview && treeConfig && rowChildren && rowChildren.length) {
|
|
9488
|
+
if (isExpandTree) {
|
|
9489
|
+
if (taskBarSubviewOpts.showOverview) {
|
|
9490
|
+
cbVNs.push(h('div', {
|
|
9491
|
+
key: 'vcso',
|
|
9492
|
+
class: 'vxe-gantt-view--chart-subview-wrapper is--overview'
|
|
9493
|
+
}, [h('div', {
|
|
9494
|
+
key: rowid,
|
|
9495
|
+
attrs: {
|
|
9496
|
+
rowid: rowid
|
|
9497
|
+
},
|
|
9498
|
+
class: ['vxe-gantt-view--chart-subview-row', {
|
|
9499
|
+
'is--progress': showProgress,
|
|
9500
|
+
'is--round': round,
|
|
9501
|
+
'is--move': moveable
|
|
9502
|
+
}]
|
|
9503
|
+
}, [h('div', {
|
|
9504
|
+
attrs: {
|
|
9505
|
+
rowid: rowid
|
|
9506
|
+
},
|
|
9507
|
+
class: 'vxe-gantt-view--chart-subview-bar'
|
|
9508
|
+
}, [h('div', {
|
|
9509
|
+
class: 'vxe-gantt-view--chart-subview-bar-content-wrapper'
|
|
9510
|
+
}, [showContent ? h('div', {
|
|
9511
|
+
class: 'vxe-gantt-view--chart-content'
|
|
9512
|
+
}, title) : renderEmptyElement($xeGantt)])])])]));
|
|
9513
|
+
}
|
|
9514
|
+
} else {
|
|
9515
|
+
var cbcVNs = [];
|
|
9516
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rowChildren, function (childRow) {
|
|
9517
|
+
var childRowid = $xeTable.getRowid(childRow);
|
|
9518
|
+
var childTitle = getStringValue(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(childRow, titleField));
|
|
9519
|
+
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;
|
|
9520
|
+
var childRenderTaskType = getTaskType(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(childRow, typeField));
|
|
9521
|
+
var isChildSubview = !!(hasEnableConf(taskBarSubviewConfig, taskBarSubviewOpts) && hasSubviewTask(childRenderTaskType));
|
|
9522
|
+
if (isChildSubview) {
|
|
9523
|
+
return;
|
|
9524
|
+
}
|
|
9525
|
+
var vpcStyle = {
|
|
9526
|
+
width: "".concat(childProgressValue || 0, "%")
|
|
9527
|
+
};
|
|
9528
|
+
if (isBarRowStyle) {
|
|
9529
|
+
var _completedBgColor = barStyObj.completedBgColor;
|
|
9530
|
+
if (_completedBgColor) {
|
|
9531
|
+
vpcStyle.backgroundColor = _completedBgColor;
|
|
9532
|
+
}
|
|
9533
|
+
}
|
|
9534
|
+
if (contentMethod) {
|
|
9535
|
+
childTitle = getStringValue(contentMethod({
|
|
9536
|
+
row: childRow,
|
|
9537
|
+
title: childTitle,
|
|
9538
|
+
scaleType: scaleUnit
|
|
9539
|
+
}));
|
|
9540
|
+
}
|
|
9541
|
+
cbcVNs.push(h('div', {
|
|
9542
|
+
key: childRowid,
|
|
9543
|
+
attrs: {
|
|
9544
|
+
rowid: childRowid
|
|
9545
|
+
},
|
|
9546
|
+
class: ['vxe-gantt-view--chart-subview-row', "is--".concat(childRenderTaskType), {
|
|
9547
|
+
'is--progress': showProgress,
|
|
9548
|
+
'is--round': round,
|
|
9549
|
+
'is--move': moveable,
|
|
9550
|
+
'row--pending': !!pendingRowFlag && !!pendingRowMaps[childRowid]
|
|
9551
|
+
}]
|
|
9552
|
+
}, [h('div', {
|
|
9553
|
+
attrs: {
|
|
9554
|
+
rowid: childRowid
|
|
9555
|
+
},
|
|
9556
|
+
class: 'vxe-gantt-view--chart-subview-bar'
|
|
9557
|
+
}, [h('div', {
|
|
9558
|
+
class: 'vxe-gantt-view--chart-subview-bar-content-wrapper'
|
|
9559
|
+
}, [showProgress ? h('div', {
|
|
9560
|
+
class: 'vxe-gantt-view--chart-progress',
|
|
9561
|
+
style: vpcStyle
|
|
9562
|
+
}) : renderEmptyElement($xeGantt), showContent ? h('div', {
|
|
9563
|
+
class: 'vxe-gantt-view--chart-content'
|
|
9564
|
+
}, childTitle) : renderEmptyElement($xeGantt)])])]));
|
|
9565
|
+
}, {
|
|
9566
|
+
children: childrenField
|
|
9567
|
+
});
|
|
9500
9568
|
cbVNs.push(h('div', {
|
|
9501
|
-
key: '
|
|
9502
|
-
class:
|
|
9503
|
-
|
|
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)])])]));
|
|
9569
|
+
key: 'vcsc',
|
|
9570
|
+
class: 'vxe-gantt-view--chart-subview-wrappe is--inliner'
|
|
9571
|
+
}, cbcVNs));
|
|
9517
9572
|
}
|
|
9573
|
+
} else if (isMilestone) {
|
|
9574
|
+
var icon = taskBarMilestoneOpts.icon,
|
|
9575
|
+
iconStatus = taskBarMilestoneOpts.iconStatus,
|
|
9576
|
+
iconStyle = taskBarMilestoneOpts.iconStyle;
|
|
9577
|
+
var tbmParams = {
|
|
9578
|
+
$gantt: $xeGantt,
|
|
9579
|
+
row: row
|
|
9580
|
+
};
|
|
9581
|
+
cbVNs.push(h('div', {
|
|
9582
|
+
key: 'vcm',
|
|
9583
|
+
class: 'vxe-gantt-view--chart-milestone-wrapper',
|
|
9584
|
+
on: ctOns
|
|
9585
|
+
}, [h('div', {
|
|
9586
|
+
class: ['vxe-gantt-view--chart-milestone-icon', iconStatus ? "theme--".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(iconStatus) ? iconStatus(tbmParams) : iconStatus) : ''],
|
|
9587
|
+
style: iconStyle ? Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(iconStyle) ? iconStyle(tbmParams) : iconStyle) : undefined
|
|
9588
|
+
}, [h('i', {
|
|
9589
|
+
class: (icon ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(icon) ? icon(tbmParams) : icon : '') || getIcon().GANTT_VIEW_TASK_MILESTONE
|
|
9590
|
+
})]), showContent ? h('div', {
|
|
9591
|
+
class: 'vxe-gantt-view--chart-milestone-content'
|
|
9592
|
+
}, title) : renderEmptyElement($xeGantt)]));
|
|
9518
9593
|
} else {
|
|
9519
9594
|
cbVNs.push(h('div', {
|
|
9520
|
-
key: '
|
|
9521
|
-
class: 'vxe-gantt-view--chart-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
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
|
-
})));
|
|
9595
|
+
key: 'vbc',
|
|
9596
|
+
class: 'vxe-gantt-view--chart-bar-content-wrapper',
|
|
9597
|
+
on: ctOns
|
|
9598
|
+
}, [showProgress ? h('div', {
|
|
9599
|
+
class: 'vxe-gantt-view--chart-progress',
|
|
9600
|
+
style: vpStyle
|
|
9601
|
+
}) : renderEmptyElement($xeGantt), showContent ? h('div', {
|
|
9602
|
+
class: 'vxe-gantt-view--chart-content'
|
|
9603
|
+
}, title) : renderEmptyElement($xeGantt)]));
|
|
9558
9604
|
}
|
|
9559
|
-
} else if (isMilestone) {
|
|
9560
|
-
var icon = taskBarMilestoneOpts.icon,
|
|
9561
|
-
iconStatus = taskBarMilestoneOpts.iconStatus,
|
|
9562
|
-
iconStyle = taskBarMilestoneOpts.iconStyle;
|
|
9563
|
-
var tbmParams = {
|
|
9564
|
-
$gantt: $xeGantt,
|
|
9565
|
-
row: row
|
|
9566
|
-
};
|
|
9567
|
-
cbVNs.push(h('div', {
|
|
9568
|
-
key: 'vcm',
|
|
9569
|
-
class: 'vxe-gantt-view--chart-milestone-wrapper',
|
|
9570
|
-
on: ctOns
|
|
9571
|
-
}, [h('div', {
|
|
9572
|
-
class: ['vxe-gantt-view--chart-milestone-icon', iconStatus ? "theme--".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(iconStatus) ? iconStatus(tbmParams) : iconStatus) : ''],
|
|
9573
|
-
style: iconStyle ? Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(iconStyle) ? iconStyle(tbmParams) : iconStyle) : undefined
|
|
9574
|
-
}, [h('i', {
|
|
9575
|
-
class: (icon ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(icon) ? icon(tbmParams) : icon : '') || getIcon().GANTT_VIEW_TASK_MILESTONE
|
|
9576
|
-
})]), showContent ? h('div', {
|
|
9577
|
-
class: 'vxe-gantt-view--chart-milestone-content'
|
|
9578
|
-
}, title) : renderEmptyElement($xeGantt)]));
|
|
9579
|
-
} else {
|
|
9580
|
-
cbVNs.push(h('div', {
|
|
9581
|
-
key: 'vbc',
|
|
9582
|
-
class: 'vxe-gantt-view--chart-bar-content-wrapper',
|
|
9583
|
-
on: ctOns
|
|
9584
|
-
}, [showProgress ? h('div', {
|
|
9585
|
-
class: 'vxe-gantt-view--chart-progress',
|
|
9586
|
-
style: vpStyle
|
|
9587
|
-
}) : renderEmptyElement($xeGantt), showContent ? h('div', {
|
|
9588
|
-
class: 'vxe-gantt-view--chart-content'
|
|
9589
|
-
}, title) : renderEmptyElement($xeGantt)]));
|
|
9590
9605
|
}
|
|
9591
9606
|
}
|
|
9592
9607
|
return h('div', {
|
|
@@ -9595,6 +9610,7 @@ var gantt_chart_viewType = 'chart';
|
|
|
9595
9610
|
rowid: rowid
|
|
9596
9611
|
},
|
|
9597
9612
|
class: ['vxe-gantt-view--chart-row', "is--".concat(renderTaskType), {
|
|
9613
|
+
'is--progress': showProgress,
|
|
9598
9614
|
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
|
|
9599
9615
|
'is--round': round,
|
|
9600
9616
|
'is--move': moveable
|
|
@@ -10884,6 +10900,34 @@ function calcScrollbar($xeGanttView) {
|
|
|
10884
10900
|
reactData.overflowX = overflowX;
|
|
10885
10901
|
}
|
|
10886
10902
|
}
|
|
10903
|
+
function handleSubTaskMinMaxSize($xeGanttView, $xeTable, list) {
|
|
10904
|
+
var $xeGantt = $xeGanttView.$xeGantt;
|
|
10905
|
+
var internalData = $xeGanttView.internalData;
|
|
10906
|
+
var chartMaps = internalData.chartMaps;
|
|
10907
|
+
var treeOpts = $xeTable.computeTreeOpts;
|
|
10908
|
+
var childrenField = treeOpts.children || treeOpts.childrenField;
|
|
10909
|
+
var typeField = $xeGantt.computeTypeField;
|
|
10910
|
+
var minChildLeftSize = 0;
|
|
10911
|
+
var maxChildLeftSize = 0;
|
|
10912
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(list, function (childRow) {
|
|
10913
|
+
var childRowid = $xeTable.getRowid(childRow);
|
|
10914
|
+
var renderTaskType = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(childRow, typeField);
|
|
10915
|
+
if (hasSubviewTask(renderTaskType)) {
|
|
10916
|
+
return;
|
|
10917
|
+
}
|
|
10918
|
+
var childChartRest = childRowid ? chartMaps[childRowid] : null;
|
|
10919
|
+
if (childChartRest) {
|
|
10920
|
+
maxChildLeftSize = Math.max(maxChildLeftSize, childChartRest.oLeftSize + childChartRest.oWidthSize);
|
|
10921
|
+
minChildLeftSize = minChildLeftSize ? Math.min(minChildLeftSize, childChartRest.oLeftSize) : childChartRest.oLeftSize;
|
|
10922
|
+
}
|
|
10923
|
+
}, {
|
|
10924
|
+
children: childrenField
|
|
10925
|
+
});
|
|
10926
|
+
return {
|
|
10927
|
+
minSize: minChildLeftSize,
|
|
10928
|
+
maxSize: maxChildLeftSize
|
|
10929
|
+
};
|
|
10930
|
+
}
|
|
10887
10931
|
function updateTaskChartStyle($xeGanttView) {
|
|
10888
10932
|
var $xeGantt = $xeGanttView.$xeGantt;
|
|
10889
10933
|
var reactData = $xeGanttView.reactData;
|
|
@@ -10896,6 +10940,8 @@ function updateTaskChartStyle($xeGanttView) {
|
|
|
10896
10940
|
chartMaps = internalData.chartMaps;
|
|
10897
10941
|
var chartWrapper = getRefElem(elemStore['main-chart-task-wrapper']);
|
|
10898
10942
|
if (chartWrapper && $xeTable) {
|
|
10943
|
+
var treeOpts = $xeTable.computeTreeOpts;
|
|
10944
|
+
var childrenField = treeOpts.children || treeOpts.childrenField;
|
|
10899
10945
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(chartWrapper.children, function (rowEl) {
|
|
10900
10946
|
var barEl = rowEl.children[0];
|
|
10901
10947
|
if (!barEl) {
|
|
@@ -10906,20 +10952,49 @@ function updateTaskChartStyle($xeGanttView) {
|
|
|
10906
10952
|
return;
|
|
10907
10953
|
}
|
|
10908
10954
|
var chartRest = rowid ? chartMaps[rowid] : null;
|
|
10955
|
+
var row = chartRest ? chartRest.row : null;
|
|
10909
10956
|
// 子任务视图
|
|
10910
10957
|
if (hasClass(barEl, 'is--subview')) {
|
|
10911
10958
|
var childWrapperEl = barEl.firstElementChild;
|
|
10912
10959
|
if (childWrapperEl) {
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10960
|
+
// 行内展示
|
|
10961
|
+
if (hasClass(childWrapperEl, 'is--inline')) {
|
|
10962
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(childWrapperEl.children, function (childRowEl) {
|
|
10963
|
+
var childBarEl = childRowEl.children[0];
|
|
10964
|
+
var childRowid = childBarEl.getAttribute('rowid') || '';
|
|
10965
|
+
var childChartRest = childRowid ? chartMaps[childRowid] : null;
|
|
10966
|
+
if (childChartRest) {
|
|
10967
|
+
var childRow = childChartRest.row;
|
|
10968
|
+
// 如果是子视图
|
|
10969
|
+
if (hasClass(childBarEl, 'is--subview')) {
|
|
10970
|
+
var subChildren = childRow[childrenField];
|
|
10971
|
+
var _handleSubTaskMinMaxS = handleSubTaskMinMaxSize($xeGanttView, $xeTable, subChildren),
|
|
10972
|
+
minChildLeftSize = _handleSubTaskMinMaxS.minSize,
|
|
10973
|
+
maxChildLeftSize = _handleSubTaskMinMaxS.maxSize;
|
|
10974
|
+
childBarEl.style.left = "".concat(viewCellWidth * minChildLeftSize, "px");
|
|
10975
|
+
childBarEl.style.width = "".concat(viewCellWidth * (maxChildLeftSize - minChildLeftSize), "px");
|
|
10976
|
+
} else {
|
|
10977
|
+
childBarEl.style.left = "".concat(getTaskBarLeft(childChartRest, viewCellWidth), "px");
|
|
10978
|
+
if (!hasClass(childBarEl, 'is--milestone')) {
|
|
10979
|
+
// 里程碑不需要宽度
|
|
10980
|
+
childBarEl.style.width = "".concat(getTaskBarWidth(childChartRest, viewCellWidth), "px");
|
|
10981
|
+
}
|
|
10982
|
+
}
|
|
10983
|
+
}
|
|
10984
|
+
});
|
|
10985
|
+
} else {
|
|
10986
|
+
// 如果展开子任务
|
|
10987
|
+
var childRowEl = childWrapperEl.children[0];
|
|
10988
|
+
var childBarEl = childRowEl ? childRowEl.children[0] : null;
|
|
10989
|
+
if (childBarEl) {
|
|
10990
|
+
var rowChildren = row ? row[childrenField] : [];
|
|
10991
|
+
var _handleSubTaskMinMaxS2 = handleSubTaskMinMaxSize($xeGanttView, $xeTable, rowChildren),
|
|
10992
|
+
minChildLeftSize = _handleSubTaskMinMaxS2.minSize,
|
|
10993
|
+
maxChildLeftSize = _handleSubTaskMinMaxS2.maxSize;
|
|
10994
|
+
childBarEl.style.left = "".concat(viewCellWidth * minChildLeftSize, "px");
|
|
10995
|
+
childBarEl.style.width = "".concat(viewCellWidth * (maxChildLeftSize - minChildLeftSize), "px");
|
|
10921
10996
|
}
|
|
10922
|
-
}
|
|
10997
|
+
}
|
|
10923
10998
|
}
|
|
10924
10999
|
} else {
|
|
10925
11000
|
barEl.style.left = "".concat(getTaskBarLeft(chartRest, viewCellWidth), "px");
|