vxe-gantt 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/gantt/src/gantt-body.js +24 -2
- package/es/gantt/src/gantt-chart.js +36 -17
- package/es/gantt/src/gantt-header.js +11 -8
- package/es/gantt/src/gantt-view.js +5 -2
- package/es/gantt/src/gantt.js +155 -7
- package/es/ui/index.js +4 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +6 -0
- package/lib/gantt/src/gantt-body.js +6 -0
- package/lib/gantt/src/gantt-body.min.js +1 -1
- package/lib/gantt/src/gantt-chart.js +35 -16
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt-header.js +9 -7
- package/lib/gantt/src/gantt-header.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +5 -2
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +151 -5
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/index.umd.js +218 -33
- package/lib/index.umd.min.js +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 +8 -0
- package/lib/ui/src/utils.min.js +1 -1
- package/package.json +2 -2
- package/packages/gantt/src/gantt-body.ts +24 -2
- package/packages/gantt/src/gantt-chart.ts +42 -17
- package/packages/gantt/src/gantt-header.ts +9 -7
- package/packages/gantt/src/gantt-view.ts +5 -2
- package/packages/gantt/src/gantt.ts +161 -7
- package/packages/ui/index.ts +3 -0
- package/packages/ui/src/utils.ts +8 -0
package/lib/index.umd.js
CHANGED
|
@@ -8182,7 +8182,7 @@ var core_ = __webpack_require__(4345);
|
|
|
8182
8182
|
;// ./packages/ui/src/log.ts
|
|
8183
8183
|
|
|
8184
8184
|
var log = core_.VxeUI.log;
|
|
8185
|
-
var version = "gantt v".concat("3.1.
|
|
8185
|
+
var version = "gantt v".concat("3.1.2");
|
|
8186
8186
|
var warnLog = log.create('warn', version);
|
|
8187
8187
|
var errLog = log.create('error', version);
|
|
8188
8188
|
;// ./packages/ui/index.ts
|
|
@@ -8192,7 +8192,7 @@ var errLog = log.create('error', version);
|
|
|
8192
8192
|
var setConfig = core_.VxeUI.setConfig,
|
|
8193
8193
|
setIcon = core_.VxeUI.setIcon,
|
|
8194
8194
|
checkVersion = core_.VxeUI.checkVersion;
|
|
8195
|
-
core_.VxeUI.ganttVersion = "3.1.
|
|
8195
|
+
core_.VxeUI.ganttVersion = "3.1.2";
|
|
8196
8196
|
setConfig({
|
|
8197
8197
|
gantt: {
|
|
8198
8198
|
// size: null,
|
|
@@ -8231,6 +8231,9 @@ setConfig({
|
|
|
8231
8231
|
// beforeSave: null,
|
|
8232
8232
|
// afterSave: null
|
|
8233
8233
|
},
|
|
8234
|
+
taskBarTooltipConfig: {
|
|
8235
|
+
enterable: true
|
|
8236
|
+
},
|
|
8234
8237
|
taskViewScaleConfig: {
|
|
8235
8238
|
week: {
|
|
8236
8239
|
startDay: 1
|
|
@@ -8714,6 +8717,9 @@ var getConfig = core_.VxeUI.getConfig;
|
|
|
8714
8717
|
function isEnableConf(conf) {
|
|
8715
8718
|
return conf && conf.enabled !== false;
|
|
8716
8719
|
}
|
|
8720
|
+
function isEmptyValue(cellValue) {
|
|
8721
|
+
return cellValue === null || cellValue === undefined || cellValue === '';
|
|
8722
|
+
}
|
|
8717
8723
|
function nextZIndex() {
|
|
8718
8724
|
return index_esm.getNext();
|
|
8719
8725
|
}
|
|
@@ -8739,6 +8745,9 @@ function getFuncText(content, args) {
|
|
|
8739
8745
|
}
|
|
8740
8746
|
return '';
|
|
8741
8747
|
}
|
|
8748
|
+
function formatText(value, placeholder) {
|
|
8749
|
+
return '' + (isEmptyValue(value) ? placeholder ? core_.VxeUI.getConfig().emptyCell : '' : value);
|
|
8750
|
+
}
|
|
8742
8751
|
/**
|
|
8743
8752
|
* 判断值为:'' | null | undefined 时都属于空值
|
|
8744
8753
|
*/
|
|
@@ -9000,7 +9009,6 @@ function getStandardGapTime(type) {
|
|
|
9000
9009
|
|
|
9001
9010
|
|
|
9002
9011
|
|
|
9003
|
-
|
|
9004
9012
|
var getI18n = core_.VxeUI.getI18n;
|
|
9005
9013
|
var sourceType = 'gantt';
|
|
9006
9014
|
var viewType = 'header';
|
|
@@ -9071,15 +9079,17 @@ var viewType = 'header';
|
|
|
9071
9079
|
childCount = column.childCount,
|
|
9072
9080
|
dateObj = column.dateObj;
|
|
9073
9081
|
var label = "".concat(column.title);
|
|
9074
|
-
if (
|
|
9075
|
-
|
|
9076
|
-
label = getI18n("vxe.gantt.dayss.w".concat(dateObj.e));
|
|
9077
|
-
} else {
|
|
9078
|
-
label = getI18n("vxe.gantt.".concat(!$rowIndex && headerGroups.length > 1 ? 'tFullFormat' : 'tSimpleFormat', ".").concat(type), dateObj);
|
|
9079
|
-
}
|
|
9082
|
+
if (scaleItem.type === 'day') {
|
|
9083
|
+
label = getI18n("vxe.gantt.dayss.w".concat(dateObj.e));
|
|
9080
9084
|
} else {
|
|
9081
|
-
if (
|
|
9085
|
+
if ($rowIndex) {
|
|
9082
9086
|
label = getI18n("vxe.gantt.tSimpleFormat.".concat(type), dateObj);
|
|
9087
|
+
} else {
|
|
9088
|
+
if (isLast && scaleItem.type === 'week') {
|
|
9089
|
+
label = getI18n("vxe.gantt.tSimpleFormat.".concat(type), dateObj);
|
|
9090
|
+
} else {
|
|
9091
|
+
label = getI18n("vxe.gantt.tFullFormat.".concat(type), dateObj);
|
|
9092
|
+
}
|
|
9083
9093
|
}
|
|
9084
9094
|
}
|
|
9085
9095
|
var cellVNs = label;
|
|
@@ -9166,6 +9176,7 @@ var viewType = 'header';
|
|
|
9166
9176
|
|
|
9167
9177
|
|
|
9168
9178
|
|
|
9179
|
+
|
|
9169
9180
|
var renderEmptyElement = core_.VxeUI.renderEmptyElement;
|
|
9170
9181
|
var gantt_chart_sourceType = 'gantt';
|
|
9171
9182
|
var gantt_chart_viewType = 'chart';
|
|
@@ -9205,15 +9216,18 @@ var gantt_chart_viewType = 'chart';
|
|
|
9205
9216
|
var titleField = $xeGantt.computeTitleField;
|
|
9206
9217
|
var progressField = $xeGantt.computeProgressField;
|
|
9207
9218
|
var taskBarOpts = $xeGantt.computeTaskBarOpts;
|
|
9219
|
+
var scaleUnit = $xeGantt.computeScaleUnit;
|
|
9208
9220
|
var barParams = {
|
|
9209
9221
|
$gantt: $xeGantt,
|
|
9210
|
-
row: row
|
|
9222
|
+
row: row,
|
|
9223
|
+
scaleType: scaleUnit
|
|
9211
9224
|
};
|
|
9212
9225
|
var showProgress = taskBarOpts.showProgress,
|
|
9213
9226
|
showContent = taskBarOpts.showContent,
|
|
9214
9227
|
contentMethod = taskBarOpts.contentMethod,
|
|
9215
9228
|
barStyle = taskBarOpts.barStyle,
|
|
9216
|
-
drag = taskBarOpts.drag
|
|
9229
|
+
drag = taskBarOpts.drag,
|
|
9230
|
+
showTooltip = taskBarOpts.showTooltip;
|
|
9217
9231
|
var isBarRowStyle = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(barStyle);
|
|
9218
9232
|
var barStyObj = (barStyle ? isBarRowStyle ? barStyle(barParams) : barStyle : {}) || {};
|
|
9219
9233
|
var round = barStyObj.round;
|
|
@@ -9240,17 +9254,45 @@ var gantt_chart_viewType = 'chart';
|
|
|
9240
9254
|
if (contentMethod) {
|
|
9241
9255
|
title = getStringValue(contentMethod({
|
|
9242
9256
|
row: row,
|
|
9243
|
-
title: title
|
|
9257
|
+
title: title,
|
|
9258
|
+
scaleType: scaleUnit
|
|
9244
9259
|
}));
|
|
9245
9260
|
}
|
|
9246
9261
|
var ctParams = {
|
|
9262
|
+
$gantt: $xeGantt,
|
|
9247
9263
|
source: gantt_chart_sourceType,
|
|
9248
9264
|
type: gantt_chart_viewType,
|
|
9265
|
+
scaleType: scaleUnit,
|
|
9249
9266
|
row: row,
|
|
9250
9267
|
$rowIndex: $rowIndex,
|
|
9251
9268
|
rowIndex: rowIndex,
|
|
9252
9269
|
_rowIndex: _rowIndex
|
|
9253
9270
|
};
|
|
9271
|
+
var ons = {
|
|
9272
|
+
click: function click(evnt) {
|
|
9273
|
+
$xeGantt.handleTaskBarClickEvent(evnt, barParams);
|
|
9274
|
+
},
|
|
9275
|
+
dblclick: function dblclick(evnt) {
|
|
9276
|
+
$xeGantt.handleTaskBarDblclickEvent(evnt, barParams);
|
|
9277
|
+
},
|
|
9278
|
+
mousedown: function mousedown(evnt) {
|
|
9279
|
+
if ($xeGantt.handleTaskBarMousedownEvent) {
|
|
9280
|
+
$xeGantt.handleTaskBarMousedownEvent(evnt, barParams);
|
|
9281
|
+
}
|
|
9282
|
+
}
|
|
9283
|
+
};
|
|
9284
|
+
if (showTooltip) {
|
|
9285
|
+
ons.mouseover = function (evnt) {
|
|
9286
|
+
$xeGantt.triggerTaskBarTooltipEvent(evnt, Object.assign({
|
|
9287
|
+
$event: evnt
|
|
9288
|
+
}, ctParams));
|
|
9289
|
+
};
|
|
9290
|
+
ons.mouseleave = function (evnt) {
|
|
9291
|
+
$xeGantt.handleTaskBarTooltipLeaveEvent(evnt, Object.assign({
|
|
9292
|
+
$event: evnt
|
|
9293
|
+
}, ctParams));
|
|
9294
|
+
};
|
|
9295
|
+
}
|
|
9254
9296
|
return h('div', {
|
|
9255
9297
|
key: treeConfig ? rowid : $rowIndex,
|
|
9256
9298
|
attrs: {
|
|
@@ -9275,19 +9317,7 @@ var gantt_chart_viewType = 'chart';
|
|
|
9275
9317
|
attrs: {
|
|
9276
9318
|
rowid: rowid
|
|
9277
9319
|
},
|
|
9278
|
-
on:
|
|
9279
|
-
click: function click(evnt) {
|
|
9280
|
-
$xeGantt.handleTaskBarClickEvent(evnt, barParams);
|
|
9281
|
-
},
|
|
9282
|
-
dblclick: function dblclick(evnt) {
|
|
9283
|
-
$xeGantt.handleTaskBarDblclickEvent(evnt, barParams);
|
|
9284
|
-
},
|
|
9285
|
-
mousedown: function mousedown(evnt) {
|
|
9286
|
-
if ($xeGantt.handleTaskBarMousedownEvent) {
|
|
9287
|
-
$xeGantt.handleTaskBarMousedownEvent(evnt, barParams);
|
|
9288
|
-
}
|
|
9289
|
-
}
|
|
9290
|
-
}
|
|
9320
|
+
on: ons
|
|
9291
9321
|
}, taskBarSlot ? $xeGantt.callSlot(taskBarSlot, barParams, h) : [showProgress ? h('div', {
|
|
9292
9322
|
class: 'vxe-gantt-view--chart-progress',
|
|
9293
9323
|
style: vpStyle
|
|
@@ -9420,6 +9450,7 @@ var gantt_body_viewType = 'body';
|
|
|
9420
9450
|
var taskViewOpts = $xeGantt.computeTaskViewOpts;
|
|
9421
9451
|
var showNowLine = taskViewOpts.showNowLine,
|
|
9422
9452
|
viewStyle = taskViewOpts.viewStyle;
|
|
9453
|
+
var scaleUnit = $xeGantt.computeScaleUnit;
|
|
9423
9454
|
var _ref = headerGroups[headerGroups.length - 1] || {},
|
|
9424
9455
|
scaleItem = _ref.scaleItem;
|
|
9425
9456
|
var field = column.field,
|
|
@@ -9472,8 +9503,10 @@ var gantt_body_viewType = 'body';
|
|
|
9472
9503
|
}));
|
|
9473
9504
|
}
|
|
9474
9505
|
var ctParams = {
|
|
9506
|
+
$gantt: $xeGantt,
|
|
9475
9507
|
source: gantt_body_sourceType,
|
|
9476
9508
|
type: gantt_body_viewType,
|
|
9509
|
+
scaleType: scaleUnit,
|
|
9477
9510
|
dateObj: dateObj,
|
|
9478
9511
|
row: row,
|
|
9479
9512
|
column: column,
|
|
@@ -9536,6 +9569,7 @@ var gantt_body_viewType = 'body';
|
|
|
9536
9569
|
var treeOpts = $xeTable.computeTreeOpts;
|
|
9537
9570
|
var transform = treeOpts.transform;
|
|
9538
9571
|
var childrenField = treeOpts.children || treeOpts.childrenField;
|
|
9572
|
+
var scaleUnit = $xeGantt.computeScaleUnit;
|
|
9539
9573
|
var taskViewOpts = $xeGantt.computeTaskViewOpts;
|
|
9540
9574
|
var viewStyle = taskViewOpts.viewStyle;
|
|
9541
9575
|
var _ref3 = viewStyle || {},
|
|
@@ -9578,8 +9612,10 @@ var gantt_body_viewType = 'body';
|
|
|
9578
9612
|
trOns.dragover = $xeTable.handleRowDragDragoverEvent;
|
|
9579
9613
|
}
|
|
9580
9614
|
var rowParams = {
|
|
9615
|
+
$gantt: $xeGantt,
|
|
9581
9616
|
source: gantt_body_sourceType,
|
|
9582
9617
|
type: gantt_body_viewType,
|
|
9618
|
+
scaleType: scaleUnit,
|
|
9583
9619
|
row: row,
|
|
9584
9620
|
rowIndex: rowIndex,
|
|
9585
9621
|
$rowIndex: $rowIndex,
|
|
@@ -9976,7 +10012,7 @@ function handleColumnHeader($xeGanttView) {
|
|
|
9976
10012
|
if (minScale.level < 17) {
|
|
9977
10013
|
handleData('quarter', colMaps, minCol);
|
|
9978
10014
|
}
|
|
9979
|
-
if (minScale.level <
|
|
10015
|
+
if (minScale.level < 15) {
|
|
9980
10016
|
handleData('month', colMaps, minCol);
|
|
9981
10017
|
}
|
|
9982
10018
|
if (minScale.level < 13) {
|
|
@@ -9985,7 +10021,7 @@ function handleColumnHeader($xeGanttView) {
|
|
|
9985
10021
|
if (minScale.level < 11) {
|
|
9986
10022
|
handleData('day', colMaps, minCol);
|
|
9987
10023
|
}
|
|
9988
|
-
if (minScale.level <
|
|
10024
|
+
if (minScale.level < 9) {
|
|
9989
10025
|
handleData('date', colMaps, minCol);
|
|
9990
10026
|
}
|
|
9991
10027
|
if (minScale.level < 7) {
|
|
@@ -9994,6 +10030,9 @@ function handleColumnHeader($xeGanttView) {
|
|
|
9994
10030
|
if (minScale.level < 5) {
|
|
9995
10031
|
handleData('minute', colMaps, minCol);
|
|
9996
10032
|
}
|
|
10033
|
+
if (minScale.level < 3) {
|
|
10034
|
+
handleData('second', colMaps, minCol);
|
|
10035
|
+
}
|
|
9997
10036
|
fullCols.push(minCol);
|
|
9998
10037
|
}
|
|
9999
10038
|
taskScaleList.forEach(function (scaleItem) {
|
|
@@ -11485,6 +11524,7 @@ function gantt_createInternalData() {
|
|
|
11485
11524
|
return {
|
|
11486
11525
|
uFoot: false,
|
|
11487
11526
|
resizeTableWidth: 0
|
|
11527
|
+
// barTipTimeout: undefined
|
|
11488
11528
|
};
|
|
11489
11529
|
}
|
|
11490
11530
|
/* harmony default export */ var gantt = (/* define-vxe-component start */defineVxeComponent({
|
|
@@ -11502,6 +11542,7 @@ function gantt_createInternalData() {
|
|
|
11502
11542
|
taskViewScaleConfig: Object,
|
|
11503
11543
|
taskViewConfig: Object,
|
|
11504
11544
|
taskBarConfig: Object,
|
|
11545
|
+
taskBarTooltipConfig: Object,
|
|
11505
11546
|
taskSplitConfig: Object,
|
|
11506
11547
|
taskBarResizeConfig: Object,
|
|
11507
11548
|
taskBarDragConfig: Object,
|
|
@@ -11540,7 +11581,13 @@ function gantt_createInternalData() {
|
|
|
11540
11581
|
},
|
|
11541
11582
|
showLeftView: true,
|
|
11542
11583
|
showRightView: true,
|
|
11543
|
-
taskScaleList: []
|
|
11584
|
+
taskScaleList: [],
|
|
11585
|
+
barTipStore: {
|
|
11586
|
+
row: null,
|
|
11587
|
+
content: '',
|
|
11588
|
+
visible: false,
|
|
11589
|
+
params: null
|
|
11590
|
+
}
|
|
11544
11591
|
};
|
|
11545
11592
|
var internalData = gantt_createInternalData();
|
|
11546
11593
|
return {
|
|
@@ -11620,6 +11667,11 @@ function gantt_createInternalData() {
|
|
|
11620
11667
|
var props = $xeGantt;
|
|
11621
11668
|
return Object.assign({}, gantt_getConfig().gantt.taskSplitConfig, props.taskSplitConfig);
|
|
11622
11669
|
},
|
|
11670
|
+
computeTaskBarTooltipOpts: function computeTaskBarTooltipOpts() {
|
|
11671
|
+
var $xeGantt = this;
|
|
11672
|
+
var props = $xeGantt;
|
|
11673
|
+
return Object.assign({}, gantt_getConfig().gantt.taskBarTooltipConfig, props.taskBarTooltipConfig);
|
|
11674
|
+
},
|
|
11623
11675
|
computeScaleUnit: function computeScaleUnit() {
|
|
11624
11676
|
var $xeGantt = this;
|
|
11625
11677
|
var minScale = $xeGantt.computeMinScale;
|
|
@@ -11639,12 +11691,19 @@ function gantt_createInternalData() {
|
|
|
11639
11691
|
return item.type === 'week';
|
|
11640
11692
|
});
|
|
11641
11693
|
},
|
|
11642
|
-
|
|
11694
|
+
computeTaskViewScales: function computeTaskViewScales() {
|
|
11643
11695
|
var $xeGantt = this;
|
|
11644
11696
|
var taskViewOpts = $xeGantt.computeTaskViewOpts;
|
|
11645
11697
|
var scales = taskViewOpts.scales;
|
|
11646
11698
|
return scales;
|
|
11647
11699
|
},
|
|
11700
|
+
/**
|
|
11701
|
+
* 已废弃,保留兼容
|
|
11702
|
+
* @deprecated
|
|
11703
|
+
*/
|
|
11704
|
+
computeTaskScaleConfs: function computeTaskScaleConfs() {
|
|
11705
|
+
return this.computeTaskViewScales;
|
|
11706
|
+
},
|
|
11648
11707
|
computeTitleField: function computeTitleField() {
|
|
11649
11708
|
var $xeGantt = this;
|
|
11650
11709
|
var taskOpts = $xeGantt.computeTaskOpts;
|
|
@@ -11902,7 +11961,7 @@ function gantt_createInternalData() {
|
|
|
11902
11961
|
var $xeGantt = this;
|
|
11903
11962
|
$xeGantt.initProxy();
|
|
11904
11963
|
},
|
|
11905
|
-
|
|
11964
|
+
computeTaskViewScales: function computeTaskViewScales() {
|
|
11906
11965
|
var $xeGantt = this;
|
|
11907
11966
|
$xeGantt.handleTaskScaleConfig();
|
|
11908
11967
|
$xeGantt.refreshTaskView();
|
|
@@ -11919,7 +11978,7 @@ function gantt_createInternalData() {
|
|
|
11919
11978
|
handleTaskScaleConfig: function handleTaskScaleConfig() {
|
|
11920
11979
|
var $xeGantt = this;
|
|
11921
11980
|
var reactData = $xeGantt.reactData;
|
|
11922
|
-
var taskScaleConfs = $xeGantt.
|
|
11981
|
+
var taskScaleConfs = $xeGantt.computeTaskViewScales;
|
|
11923
11982
|
var taskViewScaleOpts = $xeGantt.computeTaskViewScaleOpts;
|
|
11924
11983
|
var scaleConfs = [];
|
|
11925
11984
|
if (taskScaleConfs) {
|
|
@@ -13152,6 +13211,27 @@ function gantt_createInternalData() {
|
|
|
13152
13211
|
reactData.showRightView = false;
|
|
13153
13212
|
return $xeGantt.$nextTick();
|
|
13154
13213
|
},
|
|
13214
|
+
/**
|
|
13215
|
+
* 关闭 bar tooltip
|
|
13216
|
+
*/
|
|
13217
|
+
closeTaskBarTooltip: function closeTaskBarTooltip() {
|
|
13218
|
+
var $xeGantt = this;
|
|
13219
|
+
var reactData = $xeGantt.reactData;
|
|
13220
|
+
var barTipStore = reactData.barTipStore;
|
|
13221
|
+
var $tooltip = $xeGantt.$refs.refTooltip;
|
|
13222
|
+
if (barTipStore.visible) {
|
|
13223
|
+
Object.assign(barTipStore, {
|
|
13224
|
+
row: null,
|
|
13225
|
+
content: null,
|
|
13226
|
+
visible: false,
|
|
13227
|
+
params: {}
|
|
13228
|
+
});
|
|
13229
|
+
if ($tooltip && $tooltip.close) {
|
|
13230
|
+
$tooltip.close();
|
|
13231
|
+
}
|
|
13232
|
+
}
|
|
13233
|
+
return $xeGantt.$nextTick();
|
|
13234
|
+
},
|
|
13155
13235
|
callSlot: function callSlot(slotFunc, params, h) {
|
|
13156
13236
|
var $xeGantt = this;
|
|
13157
13237
|
var slots = $xeGantt.$scopedSlots;
|
|
@@ -13286,6 +13366,72 @@ function gantt_createInternalData() {
|
|
|
13286
13366
|
var $xeGantt = this;
|
|
13287
13367
|
$xeGantt.dispatchEvent('task-bar-dblclick', params, evnt);
|
|
13288
13368
|
},
|
|
13369
|
+
triggerTaskBarTooltipEvent: function triggerTaskBarTooltipEvent(evnt, params) {
|
|
13370
|
+
var $xeGantt = this;
|
|
13371
|
+
var reactData = $xeGantt.reactData;
|
|
13372
|
+
var barTipStore = reactData.barTipStore;
|
|
13373
|
+
var taskBarTooltipOpts = $xeGantt.computeTaskBarTooltipOpts;
|
|
13374
|
+
var titleField = $xeGantt.computeTitleField;
|
|
13375
|
+
var contentMethod = taskBarTooltipOpts.contentMethod;
|
|
13376
|
+
var row = params.row;
|
|
13377
|
+
var content = formatText(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, titleField));
|
|
13378
|
+
if (contentMethod) {
|
|
13379
|
+
var customContnet = contentMethod(params);
|
|
13380
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContnet)) {
|
|
13381
|
+
content = "".concat(customContnet);
|
|
13382
|
+
}
|
|
13383
|
+
}
|
|
13384
|
+
$xeGantt.handleTargetEnterEvent(barTipStore.row !== row);
|
|
13385
|
+
var tipContent = formatText(content);
|
|
13386
|
+
Object.assign(barTipStore, {
|
|
13387
|
+
row: row,
|
|
13388
|
+
visible: true,
|
|
13389
|
+
content: tipContent,
|
|
13390
|
+
params: params
|
|
13391
|
+
});
|
|
13392
|
+
$xeGantt.$nextTick(function () {
|
|
13393
|
+
var $tooltip = $xeGantt.$refs.refTooltip;
|
|
13394
|
+
if ($tooltip) {
|
|
13395
|
+
if ($tooltip.openByEvent) {
|
|
13396
|
+
$tooltip.openByEvent(evnt, evnt.currentTarget, tipContent);
|
|
13397
|
+
} else if ($tooltip.open) {
|
|
13398
|
+
$tooltip.open(evnt.currentTarget, tipContent);
|
|
13399
|
+
}
|
|
13400
|
+
}
|
|
13401
|
+
});
|
|
13402
|
+
},
|
|
13403
|
+
handleTargetEnterEvent: function handleTargetEnterEvent(isClear) {
|
|
13404
|
+
var $xeGantt = this;
|
|
13405
|
+
var internalData = $xeGantt.internalData;
|
|
13406
|
+
var $tooltip = $xeGantt.$refs.refTooltip;
|
|
13407
|
+
clearTimeout(internalData.barTipTimeout);
|
|
13408
|
+
if (isClear) {
|
|
13409
|
+
$xeGantt.closeTaskBarTooltip();
|
|
13410
|
+
} else {
|
|
13411
|
+
if ($tooltip && $tooltip.setActived) {
|
|
13412
|
+
$tooltip.setActived(true);
|
|
13413
|
+
}
|
|
13414
|
+
}
|
|
13415
|
+
},
|
|
13416
|
+
handleTaskBarTooltipLeaveEvent: function handleTaskBarTooltipLeaveEvent() {
|
|
13417
|
+
var $xeGantt = this;
|
|
13418
|
+
var internalData = $xeGantt.internalData;
|
|
13419
|
+
var taskBarTooltipOpts = $xeGantt.computeTaskBarTooltipOpts;
|
|
13420
|
+
var $tooltip = $xeGantt.$refs.refTooltip;
|
|
13421
|
+
if ($tooltip && $tooltip.setActived) {
|
|
13422
|
+
$tooltip.setActived(false);
|
|
13423
|
+
}
|
|
13424
|
+
if (taskBarTooltipOpts.enterable) {
|
|
13425
|
+
internalData.barTipTimeout = setTimeout(function () {
|
|
13426
|
+
$tooltip = $xeGantt.$refs.refTooltip;
|
|
13427
|
+
if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
|
|
13428
|
+
$xeGantt.closeTaskBarTooltip();
|
|
13429
|
+
}
|
|
13430
|
+
}, taskBarTooltipOpts.leaveDelay);
|
|
13431
|
+
} else {
|
|
13432
|
+
$xeGantt.closeTaskBarTooltip();
|
|
13433
|
+
}
|
|
13434
|
+
},
|
|
13289
13435
|
handleTaskHeaderContextmenuEvent: function handleTaskHeaderContextmenuEvent(evnt, params) {
|
|
13290
13436
|
var $xeGantt = this;
|
|
13291
13437
|
var $xeTable = $xeGantt.$refs.refTable;
|
|
@@ -13736,14 +13882,19 @@ function gantt_createInternalData() {
|
|
|
13736
13882
|
return childVNs;
|
|
13737
13883
|
},
|
|
13738
13884
|
renderLayout: function renderLayout(h) {
|
|
13885
|
+
var VxeUITooltipComponent = core_.VxeUI.getComponent('VxeTooltip');
|
|
13739
13886
|
var $xeGantt = this;
|
|
13887
|
+
var reactData = $xeGantt.reactData;
|
|
13740
13888
|
var slots = $xeGantt.$scopedSlots;
|
|
13889
|
+
var barTipStore = reactData.barTipStore;
|
|
13741
13890
|
var currLayoutConf = $xeGantt.computeCurrLayoutConf;
|
|
13742
13891
|
var headKeys = currLayoutConf.headKeys,
|
|
13743
13892
|
bodyKeys = currLayoutConf.bodyKeys,
|
|
13744
13893
|
footKeys = currLayoutConf.footKeys;
|
|
13894
|
+
var taskBarTooltipOpts = $xeGantt.computeTaskBarTooltipOpts;
|
|
13745
13895
|
var asideLeftSlot = slots.asideLeft || slots['aside-left'];
|
|
13746
13896
|
var asideRightSlot = slots.asideRight || slots['aside-right'];
|
|
13897
|
+
var taskBarTooltipSlot = slots.taskBarTooltip || slots['task-bar-tooltip'];
|
|
13747
13898
|
return [h('div', {
|
|
13748
13899
|
class: 'vxe-gantt--layout-header-wrapper'
|
|
13749
13900
|
}, $xeGantt.renderChildLayout(h, headKeys)), h('div', {
|
|
@@ -13758,7 +13909,41 @@ function gantt_createInternalData() {
|
|
|
13758
13909
|
class: 'vxe-gantt--layout-footer-wrapper'
|
|
13759
13910
|
}, $xeGantt.renderChildLayout(h, footKeys)), h('div', {
|
|
13760
13911
|
ref: 'refPopupContainerElem'
|
|
13761
|
-
})
|
|
13912
|
+
}), h('div', {}, [
|
|
13913
|
+
/**
|
|
13914
|
+
* 任务条提示
|
|
13915
|
+
*/
|
|
13916
|
+
h(VxeUITooltipComponent, {
|
|
13917
|
+
key: 'gtp',
|
|
13918
|
+
ref: 'refTooltip',
|
|
13919
|
+
props: {
|
|
13920
|
+
theme: taskBarTooltipOpts.theme,
|
|
13921
|
+
enterable: taskBarTooltipOpts.enterable,
|
|
13922
|
+
enterDelay: taskBarTooltipOpts.enterDelay,
|
|
13923
|
+
leaveDelay: taskBarTooltipOpts.leaveDelay,
|
|
13924
|
+
useHTML: taskBarTooltipOpts.useHTML,
|
|
13925
|
+
width: taskBarTooltipOpts.width,
|
|
13926
|
+
height: taskBarTooltipOpts.height,
|
|
13927
|
+
minWidth: taskBarTooltipOpts.minWidth,
|
|
13928
|
+
minHeight: taskBarTooltipOpts.minHeight,
|
|
13929
|
+
maxWidth: taskBarTooltipOpts.maxWidth,
|
|
13930
|
+
maxHeight: taskBarTooltipOpts.maxHeight,
|
|
13931
|
+
isArrow: false
|
|
13932
|
+
},
|
|
13933
|
+
scopedSlots: taskBarTooltipSlot ? {
|
|
13934
|
+
content: function content() {
|
|
13935
|
+
var row = barTipStore.row,
|
|
13936
|
+
tooltipContent = barTipStore.content;
|
|
13937
|
+
if (row) {
|
|
13938
|
+
return h('div', {}, taskBarTooltipSlot(Object.assign({
|
|
13939
|
+
tooltipContent: tooltipContent,
|
|
13940
|
+
$gantt: $xeGantt
|
|
13941
|
+
}, barTipStore.params)));
|
|
13942
|
+
}
|
|
13943
|
+
return gantt_renderEmptyElement($xeGantt);
|
|
13944
|
+
}
|
|
13945
|
+
} : {}
|
|
13946
|
+
})])];
|
|
13762
13947
|
},
|
|
13763
13948
|
renderVN: function renderVN(h) {
|
|
13764
13949
|
var $xeGantt = this;
|