vxe-gantt 4.0.27 → 4.1.1
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/emits.js +2 -0
- package/es/gantt/src/gantt-chart.js +28 -18
- package/es/gantt/src/gantt-header.js +18 -6
- package/es/gantt/src/gantt-view.js +307 -47
- package/es/gantt/src/gantt.js +151 -8
- package/es/gantt/src/util.js +11 -0
- package/es/ui/index.js +4 -1
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/emits.js +1 -1
- package/lib/gantt/src/emits.min.js +1 -1
- package/lib/gantt/src/gantt-chart.js +36 -16
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt-header.js +15 -5
- package/lib/gantt/src/gantt-header.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +357 -50
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +163 -6
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/gantt/src/util.js +12 -0
- package/lib/gantt/src/util.min.js +1 -1
- package/lib/index.umd.js +590 -80
- 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/package.json +3 -3
- package/packages/gantt/src/emits.ts +2 -0
- package/packages/gantt/src/gantt-chart.ts +34 -13
- package/packages/gantt/src/gantt-header.ts +15 -6
- package/packages/gantt/src/gantt-view.ts +310 -46
- package/packages/gantt/src/gantt.ts +162 -8
- package/packages/gantt/src/util.ts +13 -0
- package/packages/ui/index.ts +3 -0
package/es/gantt/src/gantt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, ref, computed, provide, reactive, onUnmounted, watch, nextTick, onMounted } from 'vue';
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
|
-
import { getLastZIndex, nextZIndex, isEnableConf } from '../../ui/src/utils';
|
|
4
|
+
import { getLastZIndex, nextZIndex, isEnableConf, formatText } from '../../ui/src/utils';
|
|
5
5
|
import { getOffsetHeight, getPaddingTopBottomSize, getDomNode, toCssUnit, addClass, removeClass } from '../../ui/src/dom';
|
|
6
6
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
7
7
|
import { VxeUI } from '@vxe-ui/core';
|
|
@@ -19,6 +19,7 @@ function createInternalData() {
|
|
|
19
19
|
return {
|
|
20
20
|
uFoot: false,
|
|
21
21
|
resizeTableWidth: 0
|
|
22
|
+
// barTipTimeout: undefined
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
const viewTypeLevelMaps = {
|
|
@@ -38,7 +39,7 @@ function getViewTypeLevel(type) {
|
|
|
38
39
|
export default defineVxeComponent({
|
|
39
40
|
name: 'VxeGantt',
|
|
40
41
|
mixins: [],
|
|
41
|
-
props: Object.assign(Object.assign({}, tableProps), { columns: Array, pagerConfig: Object, proxyConfig: Object, toolbarConfig: Object, formConfig: Object, zoomConfig: Object, layouts: Array, taskConfig: Object, taskViewScaleConfig: Object, taskViewConfig: Object, taskBarConfig: Object, taskSplitConfig: Object, taskBarResizeConfig: Object, taskBarDragConfig: Object, size: {
|
|
42
|
+
props: Object.assign(Object.assign({}, tableProps), { columns: Array, pagerConfig: Object, proxyConfig: Object, toolbarConfig: Object, formConfig: Object, zoomConfig: Object, layouts: Array, taskConfig: Object, taskViewScaleConfig: Object, taskViewConfig: Object, taskBarConfig: Object, taskBarTooltipConfig: Object, taskSplitConfig: Object, taskBarResizeConfig: Object, taskBarDragConfig: Object, size: {
|
|
42
43
|
type: String,
|
|
43
44
|
default: () => getConfig().gantt.size || getConfig().size
|
|
44
45
|
} }),
|
|
@@ -52,6 +53,7 @@ export default defineVxeComponent({
|
|
|
52
53
|
const VxeUIPagerComponent = VxeUI.getComponent('VxePager');
|
|
53
54
|
const VxeTableComponent = VxeUI.getComponent('VxeTable');
|
|
54
55
|
const VxeToolbarComponent = VxeUI.getComponent('VxeToolbar');
|
|
56
|
+
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
|
|
55
57
|
const { computeSize } = useFns.useSize(props);
|
|
56
58
|
const reactData = reactive({
|
|
57
59
|
tableLoading: false,
|
|
@@ -70,7 +72,13 @@ export default defineVxeComponent({
|
|
|
70
72
|
},
|
|
71
73
|
showLeftView: true,
|
|
72
74
|
showRightView: true,
|
|
73
|
-
taskScaleList: []
|
|
75
|
+
taskScaleList: [],
|
|
76
|
+
barTipStore: {
|
|
77
|
+
row: null,
|
|
78
|
+
content: '',
|
|
79
|
+
visible: false,
|
|
80
|
+
params: null
|
|
81
|
+
}
|
|
74
82
|
});
|
|
75
83
|
const internalData = createInternalData();
|
|
76
84
|
const refElem = ref();
|
|
@@ -89,6 +97,7 @@ export default defineVxeComponent({
|
|
|
89
97
|
const refPagerWrapper = ref();
|
|
90
98
|
const refTableWrapper = ref();
|
|
91
99
|
const refGanttWrapper = ref();
|
|
100
|
+
const refTooltip = ref();
|
|
92
101
|
const refResizableSplitTip = ref();
|
|
93
102
|
const extendTableMethods = (methodKeys) => {
|
|
94
103
|
const funcs = {};
|
|
@@ -155,7 +164,22 @@ export default defineVxeComponent({
|
|
|
155
164
|
const computeTaskSplitOpts = computed(() => {
|
|
156
165
|
return Object.assign({}, getConfig().gantt.taskSplitConfig, props.taskSplitConfig);
|
|
157
166
|
});
|
|
158
|
-
const
|
|
167
|
+
const computeTaskBarTooltipOpts = computed(() => {
|
|
168
|
+
return Object.assign({}, getConfig().gantt.taskBarTooltipConfig, props.taskBarTooltipConfig);
|
|
169
|
+
});
|
|
170
|
+
const computeScaleUnit = computed(() => {
|
|
171
|
+
const minScale = computeMinScale.value;
|
|
172
|
+
return minScale ? minScale.type : 'date';
|
|
173
|
+
});
|
|
174
|
+
const computeMinScale = computed(() => {
|
|
175
|
+
const { taskScaleList } = reactData;
|
|
176
|
+
return XEUtils.last(taskScaleList);
|
|
177
|
+
});
|
|
178
|
+
const computeWeekScale = computed(() => {
|
|
179
|
+
const { taskScaleList } = reactData;
|
|
180
|
+
return taskScaleList.find(item => item.type === 'week');
|
|
181
|
+
});
|
|
182
|
+
const computeTaskViewScales = computed(() => {
|
|
159
183
|
const taskViewOpts = computeTaskViewOpts.value;
|
|
160
184
|
const { scales } = taskViewOpts;
|
|
161
185
|
return scales;
|
|
@@ -372,7 +396,11 @@ export default defineVxeComponent({
|
|
|
372
396
|
computeTaskBarDragOpts,
|
|
373
397
|
computeTaskBarResizeOpts,
|
|
374
398
|
computeTaskSplitOpts,
|
|
375
|
-
|
|
399
|
+
computeTaskBarTooltipOpts,
|
|
400
|
+
computeTaskViewScales,
|
|
401
|
+
computeScaleUnit,
|
|
402
|
+
computeMinScale,
|
|
403
|
+
computeWeekScale,
|
|
376
404
|
computeTitleField,
|
|
377
405
|
computeStartField,
|
|
378
406
|
computeEndField,
|
|
@@ -381,6 +409,7 @@ export default defineVxeComponent({
|
|
|
381
409
|
computeScrollbarXToTop,
|
|
382
410
|
computeScrollbarYToLeft
|
|
383
411
|
};
|
|
412
|
+
computeMaps.computeTaskScaleConfs = computeTaskViewScales;
|
|
384
413
|
const $xeGantt = {
|
|
385
414
|
xID,
|
|
386
415
|
props: props,
|
|
@@ -391,7 +420,7 @@ export default defineVxeComponent({
|
|
|
391
420
|
getComputeMaps: () => computeMaps
|
|
392
421
|
};
|
|
393
422
|
const handleTaskScaleConfig = () => {
|
|
394
|
-
const taskScaleConfs =
|
|
423
|
+
const taskScaleConfs = computeTaskViewScales.value;
|
|
395
424
|
const taskViewScaleOpts = computeTaskViewScaleOpts.value;
|
|
396
425
|
const scaleConfs = [];
|
|
397
426
|
if (taskScaleConfs) {
|
|
@@ -845,6 +874,18 @@ export default defineVxeComponent({
|
|
|
845
874
|
const dispatchEvent = (type, params, evnt) => {
|
|
846
875
|
emit(type, createEvent(evnt, { $grid: null, $gantt: $xeGantt }, params));
|
|
847
876
|
};
|
|
877
|
+
const handleTargetEnterEvent = (isClear) => {
|
|
878
|
+
const $tooltip = refTooltip.value;
|
|
879
|
+
clearTimeout(internalData.barTipTimeout);
|
|
880
|
+
if (isClear) {
|
|
881
|
+
$xeGantt.closeTaskBarTooltip();
|
|
882
|
+
}
|
|
883
|
+
else {
|
|
884
|
+
if ($tooltip && $tooltip.setActived) {
|
|
885
|
+
$tooltip.setActived(true);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
};
|
|
848
889
|
const ganttMethods = {
|
|
849
890
|
dispatchEvent,
|
|
850
891
|
getEl() {
|
|
@@ -1460,6 +1501,25 @@ export default defineVxeComponent({
|
|
|
1460
1501
|
hideTaskView() {
|
|
1461
1502
|
reactData.showRightView = false;
|
|
1462
1503
|
return nextTick();
|
|
1504
|
+
},
|
|
1505
|
+
/**
|
|
1506
|
+
* 关闭 bar tooltip
|
|
1507
|
+
*/
|
|
1508
|
+
closeTaskBarTooltip() {
|
|
1509
|
+
const { barTipStore } = reactData;
|
|
1510
|
+
const $tooltip = refTooltip.value;
|
|
1511
|
+
if (barTipStore.visible) {
|
|
1512
|
+
Object.assign(barTipStore, {
|
|
1513
|
+
row: null,
|
|
1514
|
+
content: null,
|
|
1515
|
+
visible: false,
|
|
1516
|
+
params: {}
|
|
1517
|
+
});
|
|
1518
|
+
if ($tooltip && $tooltip.close) {
|
|
1519
|
+
$tooltip.close();
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
return nextTick();
|
|
1463
1523
|
}
|
|
1464
1524
|
};
|
|
1465
1525
|
const ganttPrivateMethods = {
|
|
@@ -1577,6 +1637,54 @@ export default defineVxeComponent({
|
|
|
1577
1637
|
handleTaskBarDblclickEvent(evnt, params) {
|
|
1578
1638
|
$xeGantt.dispatchEvent('task-bar-dblclick', params, evnt);
|
|
1579
1639
|
},
|
|
1640
|
+
triggerTaskBarTooltipEvent(evnt, params) {
|
|
1641
|
+
const { barTipStore } = reactData;
|
|
1642
|
+
const taskBarTooltipOpts = computeTaskBarTooltipOpts.value;
|
|
1643
|
+
const titleField = computeTitleField.value;
|
|
1644
|
+
const { contentMethod } = taskBarTooltipOpts;
|
|
1645
|
+
const { row } = params;
|
|
1646
|
+
let content = formatText(XEUtils.get(row, titleField));
|
|
1647
|
+
if (contentMethod) {
|
|
1648
|
+
content = formatText(contentMethod(params));
|
|
1649
|
+
}
|
|
1650
|
+
handleTargetEnterEvent(barTipStore.row !== row);
|
|
1651
|
+
const tipContent = formatText(content);
|
|
1652
|
+
Object.assign(barTipStore, {
|
|
1653
|
+
row,
|
|
1654
|
+
visible: true,
|
|
1655
|
+
content: tipContent,
|
|
1656
|
+
params
|
|
1657
|
+
});
|
|
1658
|
+
nextTick(() => {
|
|
1659
|
+
const $tooltip = refTooltip.value;
|
|
1660
|
+
if ($tooltip) {
|
|
1661
|
+
if ($tooltip.openByEvent) {
|
|
1662
|
+
$tooltip.openByEvent(evnt, evnt.currentTarget, tipContent);
|
|
1663
|
+
}
|
|
1664
|
+
else if ($tooltip.open) {
|
|
1665
|
+
$tooltip.open(evnt.currentTarget, tipContent);
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
});
|
|
1669
|
+
},
|
|
1670
|
+
handleTaskBarTooltipLeaveEvent() {
|
|
1671
|
+
const taskBarTooltipOpts = computeTaskBarTooltipOpts.value;
|
|
1672
|
+
let $tooltip = refTooltip.value;
|
|
1673
|
+
if ($tooltip && $tooltip.setActived) {
|
|
1674
|
+
$tooltip.setActived(false);
|
|
1675
|
+
}
|
|
1676
|
+
if (taskBarTooltipOpts.enterable) {
|
|
1677
|
+
internalData.barTipTimeout = setTimeout(() => {
|
|
1678
|
+
$tooltip = refTooltip.value;
|
|
1679
|
+
if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
|
|
1680
|
+
$xeGantt.closeTaskBarTooltip();
|
|
1681
|
+
}
|
|
1682
|
+
}, taskBarTooltipOpts.leaveDelay);
|
|
1683
|
+
}
|
|
1684
|
+
else {
|
|
1685
|
+
$xeGantt.closeTaskBarTooltip();
|
|
1686
|
+
}
|
|
1687
|
+
},
|
|
1580
1688
|
handleTaskHeaderContextmenuEvent(evnt, params) {
|
|
1581
1689
|
const $xeTable = refTable.value;
|
|
1582
1690
|
if ($xeTable) {
|
|
@@ -1994,10 +2102,13 @@ export default defineVxeComponent({
|
|
|
1994
2102
|
return childVNs;
|
|
1995
2103
|
};
|
|
1996
2104
|
const renderLayout = () => {
|
|
2105
|
+
const { barTipStore } = reactData;
|
|
1997
2106
|
const currLayoutConf = computeCurrLayoutConf.value;
|
|
1998
2107
|
const { headKeys, bodyKeys, footKeys } = currLayoutConf;
|
|
2108
|
+
const taskBarTooltipOpts = computeTaskBarTooltipOpts.value;
|
|
1999
2109
|
const asideLeftSlot = slots.asideLeft || slots['aside-left'];
|
|
2000
2110
|
const asideRightSlot = slots.asideRight || slots['aside-right'];
|
|
2111
|
+
const taskBarTooltipSlot = slots.taskBarTooltip || slots['task-bar-tooltip'];
|
|
2001
2112
|
return [
|
|
2002
2113
|
h('div', {
|
|
2003
2114
|
class: 'vxe-gantt--layout-header-wrapper'
|
|
@@ -2024,7 +2135,38 @@ export default defineVxeComponent({
|
|
|
2024
2135
|
}, renderChildLayout(footKeys)),
|
|
2025
2136
|
h('div', {
|
|
2026
2137
|
ref: refPopupContainerElem
|
|
2027
|
-
})
|
|
2138
|
+
}),
|
|
2139
|
+
h('div', {}, [
|
|
2140
|
+
/**
|
|
2141
|
+
* 任务条提示
|
|
2142
|
+
*/
|
|
2143
|
+
h(VxeUITooltipComponent, {
|
|
2144
|
+
key: 'gtp',
|
|
2145
|
+
ref: refTooltip,
|
|
2146
|
+
theme: taskBarTooltipOpts.theme,
|
|
2147
|
+
enterable: taskBarTooltipOpts.enterable,
|
|
2148
|
+
enterDelay: taskBarTooltipOpts.enterDelay,
|
|
2149
|
+
leaveDelay: taskBarTooltipOpts.leaveDelay,
|
|
2150
|
+
useHTML: taskBarTooltipOpts.useHTML,
|
|
2151
|
+
width: taskBarTooltipOpts.width,
|
|
2152
|
+
height: taskBarTooltipOpts.height,
|
|
2153
|
+
minWidth: taskBarTooltipOpts.minWidth,
|
|
2154
|
+
minHeight: taskBarTooltipOpts.minHeight,
|
|
2155
|
+
maxWidth: taskBarTooltipOpts.maxWidth,
|
|
2156
|
+
maxHeight: taskBarTooltipOpts.maxHeight,
|
|
2157
|
+
isArrow: false
|
|
2158
|
+
}, taskBarTooltipSlot
|
|
2159
|
+
? {
|
|
2160
|
+
content: () => {
|
|
2161
|
+
const { row, content: tooltipContent } = barTipStore;
|
|
2162
|
+
if (row) {
|
|
2163
|
+
return h('div', {}, taskBarTooltipSlot(Object.assign({ tooltipContent, $gantt: $xeGantt }, barTipStore.params)));
|
|
2164
|
+
}
|
|
2165
|
+
return renderEmptyElement($xeGantt);
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
: {})
|
|
2169
|
+
])
|
|
2028
2170
|
];
|
|
2029
2171
|
};
|
|
2030
2172
|
const renderVN = () => {
|
|
@@ -2073,8 +2215,9 @@ export default defineVxeComponent({
|
|
|
2073
2215
|
watch(() => props.proxyConfig, () => {
|
|
2074
2216
|
initProxy();
|
|
2075
2217
|
});
|
|
2076
|
-
watch(
|
|
2218
|
+
watch(computeTaskViewScales, () => {
|
|
2077
2219
|
handleTaskScaleConfig();
|
|
2220
|
+
$xeGantt.refreshTaskView();
|
|
2078
2221
|
});
|
|
2079
2222
|
hooks.forEach((options) => {
|
|
2080
2223
|
const { setupGantt } = options;
|
package/es/gantt/src/util.js
CHANGED
|
@@ -16,3 +16,14 @@ export function getCalcHeight(height) {
|
|
|
16
16
|
export function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
|
|
17
17
|
return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
18
18
|
}
|
|
19
|
+
export function getStandardGapTime(type) {
|
|
20
|
+
switch (type) {
|
|
21
|
+
case 'hour':
|
|
22
|
+
return 1000 * 60 * 60;
|
|
23
|
+
case 'minute':
|
|
24
|
+
return 1000 * 60;
|
|
25
|
+
case 'second':
|
|
26
|
+
return 1000;
|
|
27
|
+
}
|
|
28
|
+
return 1000 * 60 * 60 * 24;
|
|
29
|
+
}
|
package/es/ui/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
import { errLog } from './src/log';
|
|
3
3
|
const { setConfig, setIcon, checkVersion } = VxeUI;
|
|
4
|
-
VxeUI.ganttVersion = "4.
|
|
4
|
+
VxeUI.ganttVersion = "4.1.1";
|
|
5
5
|
setConfig({
|
|
6
6
|
gantt: {
|
|
7
7
|
// size: null,
|
|
@@ -40,6 +40,9 @@ setConfig({
|
|
|
40
40
|
// beforeSave: null,
|
|
41
41
|
// afterSave: null
|
|
42
42
|
},
|
|
43
|
+
taskBarTooltipConfig: {
|
|
44
|
+
enterable: true
|
|
45
|
+
},
|
|
43
46
|
taskViewScaleConfig: {
|
|
44
47
|
week: {
|
|
45
48
|
startDay: 1
|
package/es/ui/src/log.js
CHANGED
package/lib/gantt/src/emits.js
CHANGED
|
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ganttEmits = void 0;
|
|
7
7
|
var _gridEmits = require("./grid-emits");
|
|
8
|
-
const ganttEmits = exports.ganttEmits = [..._gridEmits.gridEmits, 'task-cell-click', 'task-cell-dblclick', 'task-bar-click', 'task-bar-dblclick', 'task-view-cell-click', 'task-view-cell-dblclick'];
|
|
8
|
+
const ganttEmits = exports.ganttEmits = [..._gridEmits.gridEmits, 'task-cell-click', 'task-cell-dblclick', 'task-bar-mouseenter', 'task-bar-mouseleave', 'task-bar-click', 'task-bar-dblclick', 'task-view-cell-click', 'task-view-cell-dblclick'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.ganttEmits=void 0;var _gridEmits=require("./grid-emits");let ganttEmits=exports.ganttEmits=[..._gridEmits.gridEmits,"task-cell-click","task-cell-dblclick","task-bar-click","task-bar-dblclick","task-view-cell-click","task-view-cell-dblclick"];
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.ganttEmits=void 0;var _gridEmits=require("./grid-emits");let ganttEmits=exports.ganttEmits=[..._gridEmits.gridEmits,"task-cell-click","task-cell-dblclick","task-bar-mouseenter","task-bar-mouseleave","task-bar-click","task-bar-dblclick","task-view-cell-click","task-view-cell-dblclick"];
|
|
@@ -66,7 +66,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
66
66
|
showContent,
|
|
67
67
|
contentMethod,
|
|
68
68
|
barStyle,
|
|
69
|
-
drag
|
|
69
|
+
drag,
|
|
70
|
+
showTooltip
|
|
70
71
|
} = taskBarOpts;
|
|
71
72
|
const isBarRowStyle = _xeUtils.default.isFunction(barStyle);
|
|
72
73
|
const barStyObj = (barStyle ? isBarRowStyle ? barStyle(barParams) : barStyle : {}) || {};
|
|
@@ -107,8 +108,38 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
107
108
|
row,
|
|
108
109
|
$rowIndex,
|
|
109
110
|
rowIndex,
|
|
110
|
-
_rowIndex
|
|
111
|
+
_rowIndex,
|
|
112
|
+
$gantt: $xeGantt
|
|
111
113
|
};
|
|
114
|
+
const ons = {
|
|
115
|
+
onClick(evnt) {
|
|
116
|
+
$xeGantt.handleTaskBarClickEvent(evnt, barParams);
|
|
117
|
+
},
|
|
118
|
+
onDblclick(evnt) {
|
|
119
|
+
$xeGantt.handleTaskBarDblclickEvent(evnt, barParams);
|
|
120
|
+
},
|
|
121
|
+
onMousedown(evnt) {
|
|
122
|
+
if ($xeGantt.handleTaskBarMousedownEvent) {
|
|
123
|
+
$xeGantt.handleTaskBarMousedownEvent(evnt, barParams);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
if (showTooltip) {
|
|
128
|
+
ons.onMouseover = evnt => {
|
|
129
|
+
const ttParams = Object.assign({
|
|
130
|
+
$event: evnt
|
|
131
|
+
}, ctParams);
|
|
132
|
+
$xeGantt.triggerTaskBarTooltipEvent(evnt, ttParams);
|
|
133
|
+
$xeGantt.dispatchEvent('task-bar-mouseenter', ttParams, evnt);
|
|
134
|
+
};
|
|
135
|
+
ons.onMouseleave = evnt => {
|
|
136
|
+
const ttParams = Object.assign({
|
|
137
|
+
$event: evnt
|
|
138
|
+
}, ctParams);
|
|
139
|
+
$xeGantt.handleTaskBarTooltipLeaveEvent(evnt, ttParams);
|
|
140
|
+
$xeGantt.dispatchEvent('task-bar-mouseleave', ttParams, evnt);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
112
143
|
return (0, _vue.h)('div', {
|
|
113
144
|
key: treeConfig ? rowid : $rowIndex,
|
|
114
145
|
rowid,
|
|
@@ -123,22 +154,11 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
123
154
|
onContextmenu(evnt) {
|
|
124
155
|
$xeGantt.handleTaskBarContextmenuEvent(evnt, ctParams);
|
|
125
156
|
}
|
|
126
|
-
}, [(0, _vue.h)('div', {
|
|
157
|
+
}, [(0, _vue.h)('div', Object.assign({
|
|
127
158
|
class: taskBarSlot ? 'vxe-gantt-view--chart-custom-bar' : 'vxe-gantt-view--chart-bar',
|
|
128
159
|
style: vbStyle,
|
|
129
|
-
rowid
|
|
130
|
-
|
|
131
|
-
$xeGantt.handleTaskBarClickEvent(evnt, barParams);
|
|
132
|
-
},
|
|
133
|
-
onDblclick(evnt) {
|
|
134
|
-
$xeGantt.handleTaskBarDblclickEvent(evnt, barParams);
|
|
135
|
-
},
|
|
136
|
-
onMousedown(evnt) {
|
|
137
|
-
if ($xeGantt.handleTaskBarMousedownEvent) {
|
|
138
|
-
$xeGantt.handleTaskBarMousedownEvent(evnt, barParams);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}, taskBarSlot ? $xeGantt.callSlot(taskBarSlot, barParams) : [showProgress ? (0, _vue.h)('div', {
|
|
160
|
+
rowid
|
|
161
|
+
}, ons), taskBarSlot ? $xeGantt.callSlot(taskBarSlot, barParams) : [showProgress ? (0, _vue.h)('div', {
|
|
142
162
|
class: 'vxe-gantt-view--chart-progress',
|
|
143
163
|
style: vpStyle
|
|
144
164
|
}) : renderEmptyElement($xeGantt), showContent ? (0, _vue.h)('div', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_core=require("@vxe-ui/core"),_xeUtils=_interopRequireDefault(require("xe-utils")),_util=require("./util"),_utils=require("../../ui/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let renderEmptyElement=_core.VxeUI.renderEmptyElement,sourceType="gantt",viewType="chart";var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeGanttViewChart",setup(){let
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_core=require("@vxe-ui/core"),_xeUtils=_interopRequireDefault(require("xe-utils")),_util=require("./util"),_utils=require("../../ui/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let renderEmptyElement=_core.VxeUI.renderEmptyElement,sourceType="gantt",viewType="chart";var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeGanttViewChart",setup(){let T=(0,_vue.inject)("$xeGantt",{}),a=(0,_vue.inject)("$xeGanttView",{}),{reactData:r,internalData:t}=a,{computeProgressField:D,computeTitleField:y,computeTaskBarOpts:M}=T.getComputeMaps(),l=(0,_vue.ref)(),w=(e,t,a,r,l,n)=>{var o=e.props.treeConfig,u=e.reactData.resizeHeightFlag,i=e.internalData.fullAllDataRowIdData,{computeCellOpts:e,computeRowOpts:s,computeDefaultRowHeight:v}=e.getComputeMaps(),e=e.value,s=s.value,v=v.value,c=T.context.slots,c=c.taskBar||c["task-bar"],d=y.value,p=D.value,g=M.value;let h={$gantt:T,row:t};var{showProgress:g,showContent:m,contentMethod:w,barStyle:x,drag:_,showTooltip:f}=g,E=_xeUtils.default.isFunction(x),x=(x?E?x(h):x:{})||{},k=x.round,i=i[a]||{},u=0<(u?i.resizeHeight:0),i=(0,_util.getCellRestHeight)(i,e,s,v);let b=(0,_utils.getStringValue)(_xeUtils.default.get(t,d));e={},s={width:`${(g?Math.min(100,Math.max(0,_xeUtils.default.toNumber(_xeUtils.default.get(t,p)))):0)||0}%`};E&&({bgColor:v,completedBgColor:d}=x,v&&(e.backgroundColor=v),d)&&(s.backgroundColor=d),w&&(b=(0,_utils.getStringValue)(w({row:t,title:b})));let C={source:sourceType,type:viewType,row:t,$rowIndex:l,rowIndex:r,_rowIndex:n,$gantt:T};p={onClick(e){T.handleTaskBarClickEvent(e,h)},onDblclick(e){T.handleTaskBarDblclickEvent(e,h)},onMousedown(e){T.handleTaskBarMousedownEvent&&T.handleTaskBarMousedownEvent(e,h)}};return f&&(p.onMouseover=e=>{var t=Object.assign({$event:e},C);T.triggerTaskBarTooltipEvent(e,t),T.dispatchEvent("task-bar-mouseenter",t,e)},p.onMouseleave=e=>{var t=Object.assign({$event:e},C);T.handleTaskBarTooltipLeaveEvent(e,t),T.dispatchEvent("task-bar-mouseleave",t,e)}),(0,_vue.h)("div",{key:o?a:l,rowid:a,class:["vxe-gantt-view--chart-row",{"is--round":k,"is--drag":_,"col--rs-height":u}],style:{height:i+"px"},onContextmenu(e){T.handleTaskBarContextmenuEvent(e,C)}},[(0,_vue.h)("div",Object.assign({class:c?"vxe-gantt-view--chart-custom-bar":"vxe-gantt-view--chart-bar",style:e,rowid:a},p),c?T.callSlot(c,h):[g?(0,_vue.h)("div",{class:"vxe-gantt-view--chart-progress",style:s}):renderEmptyElement(T),m?(0,_vue.h)("div",{class:"vxe-gantt-view--chart-content"},b):renderEmptyElement(T)])])},x=(i,e)=>{let s=i.props.treeConfig,v=i.reactData.treeExpandedFlag,{fullAllDataRowIdData:c,treeExpandedMaps:d}=i.internalData;var t=i.getComputeMaps().computeTreeOpts,t=t.value;let p=t.transform,g=t.children||t.childrenField,h=r.scrollYLoad,m=[];return e.forEach((e,t)=>{var a=i?i.getRowid(e):"",r=c[a]||{};let l=t,n=-1,o=(r&&(l=r.index,n=r._index),m.push(w(i,e,a,l,t,n)),!1),u=[];!s||h||p||(u=e[g],o=!!v&&u&&0<u.length&&!!d[a]),o&&m.push(...x(i,u))}),m};return(0,_vue.onMounted)(()=>{var e=t.elemStore;e["main-chart-wrapper"]=l}),(0,_vue.onUnmounted)(()=>{var e=t.elemStore;e["main-chart-wrapper"]=null}),()=>{var e=a.internalData.xeTable,t=r.tableData;return(0,_vue.h)("div",{ref:l,class:"vxe-gantt-view--chart-wrapper"},e?x(e,t):[])}}});
|
|
@@ -69,12 +69,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
69
69
|
}, $rowIndex) => {
|
|
70
70
|
const {
|
|
71
71
|
type,
|
|
72
|
+
titleFormat,
|
|
72
73
|
titleMethod,
|
|
73
74
|
headerCellStyle,
|
|
74
75
|
slots
|
|
75
76
|
} = scaleItem;
|
|
76
77
|
const titleSlot = slots ? slots.title : null;
|
|
77
|
-
const
|
|
78
|
+
const isLast = $rowIndex === headerGroups.length - 1;
|
|
79
|
+
const todayValue = isLast && showNowLine ? todayDateMaps[type] : null;
|
|
78
80
|
return (0, _vue.h)('tr', {
|
|
79
81
|
key: $rowIndex
|
|
80
82
|
}, columns.map((column, cIndex) => {
|
|
@@ -84,11 +86,17 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
84
86
|
dateObj
|
|
85
87
|
} = column;
|
|
86
88
|
let label = `${column.title}`;
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
if (scaleItem.type === 'day') {
|
|
90
|
+
label = getI18n(`vxe.gantt.dayss.w${dateObj.e}`);
|
|
91
|
+
} else {
|
|
92
|
+
if ($rowIndex) {
|
|
93
|
+
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj);
|
|
90
94
|
} else {
|
|
91
|
-
|
|
95
|
+
if (isLast && scaleItem.type === 'week') {
|
|
96
|
+
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj);
|
|
97
|
+
} else {
|
|
98
|
+
label = getI18n(`vxe.gantt.tFullFormat.${type}`, dateObj);
|
|
99
|
+
}
|
|
92
100
|
}
|
|
93
101
|
}
|
|
94
102
|
let cellVNs = label;
|
|
@@ -105,6 +113,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
105
113
|
cellVNs = $xeGantt.callSlot(titleSlot, ctParams);
|
|
106
114
|
} else if (titleMethod) {
|
|
107
115
|
cellVNs = `${titleMethod(ctParams)}`;
|
|
116
|
+
} else if (titleFormat) {
|
|
117
|
+
cellVNs = _xeUtils.default.toDateString(dateObj.date, titleFormat);
|
|
108
118
|
}
|
|
109
119
|
let cellStys = {};
|
|
110
120
|
if (headerCellStyle) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_core=require("@vxe-ui/core"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let getI18n=_core.VxeUI.getI18n,sourceType="gantt",viewType="header";var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeGanttViewHeader",setup(){let
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_core=require("@vxe-ui/core"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let getI18n=_core.VxeUI.getI18n,sourceType="gantt",viewType="header";var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeGanttViewHeader",setup(){let f=(0,_vue.inject)("$xeGantt",{}),t=(0,_vue.inject)("$xeGanttView",{}),n=f.getComputeMaps().computeTaskViewOpts,{reactData:u,internalData:o}=t,i=(0,_vue.ref)(),v=(0,_vue.ref)(),s=(0,_vue.ref)(),d=(0,_vue.ref)();return(0,_vue.onMounted)(()=>{var e=o.elemStore,t="main-header-";e[t+"wrapper"]=i,e[t+"scroll"]=v,e[t+"table"]=s,e[t+"xSpace"]=d}),(0,_vue.onUnmounted)(()=>{var e=o.elemStore,t="main-header-";e[t+"wrapper"]=null,e[t+"scroll"]=null,e[t+"table"]=null,e[t+"xSpace"]=null}),()=>{let{headerGroups:l,viewCellWidth:a}=u,{todayDateMaps:r,visibleColumn:e}=o;let w=n.value.showNowLine;return(0,_vue.h)("div",{ref:i,class:"vxe-gantt-view--header-wrapper"},[(0,_vue.h)("div",{ref:v,class:"vxe-gantt-view--header-inner-wrapper",onScroll:t.triggerHeaderScrollEvent},[(0,_vue.h)("div",{ref:d,class:"vxe-body--x-space"}),(0,_vue.h)("table",{ref:s,class:"vxe-gantt-view--header-table"},[(0,_vue.h)("colgroup",{},e.map((e,t)=>(0,_vue.h)("col",{key:t,style:{width:a+"px"}}))),(0,_vue.h)("thead",{},l.map(({scaleItem:v,columns:e},s)=>{let{type:d,titleFormat:p,titleMethod:c,headerCellStyle:_,slots:t}=v,x=t?t.title:null,h=s===l.length-1,m=h&&w?r[d]:null;return(0,_vue.h)("tr",{key:s},e.map((e,t)=>{var{field:l,childCount:a,dateObj:r}=e;let n=""+e.title,u=n="day"===v.type?getI18n("vxe.gantt.dayss.w"+r.e):s||h&&"week"===v.type?getI18n("vxe.gantt.tSimpleFormat."+d,r):getI18n("vxe.gantt.tFullFormat."+d,r),o={source:sourceType,type:viewType,column:e,scaleObj:v,title:n,dateObj:r,$rowIndex:s},i=(x?u=f.callSlot(x,o):c?u=""+c(o):p&&(u=_xeUtils.default.toDateString(r.date,p)),{});return _&&(i=_xeUtils.default.isFunction(_)?_(o):_),(0,_vue.h)("th",{key:t,class:["vxe-gantt-view--header-column",{"is--now":w&&m&&m===l}],colspan:a||null,title:x?null:n,style:i,onContextmenu(e){f.handleTaskHeaderContextmenuEvent(e,o)}},u)}))}))])])])}}});
|