vxe-gantt 3.9.0 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components.d.ts +6 -0
- package/es/components.js +11 -9
- package/es/gantt/index.d.ts +1421 -0
- package/es/gantt/index.js +27 -22
- package/es/gantt/src/gantt-body.d.ts +19 -0
- package/es/gantt/src/gantt-body.js +291 -288
- package/es/gantt/src/gantt-chart.d.ts +19 -0
- package/es/gantt/src/gantt-chart.js +486 -495
- package/es/gantt/src/gantt-footer.d.ts +16 -0
- package/es/gantt/src/gantt-footer.js +62 -57
- package/es/gantt/src/gantt-header.d.ts +16 -0
- package/es/gantt/src/gantt-header.js +172 -174
- package/es/gantt/src/gantt-view.d.ts +76 -0
- package/es/gantt/src/gantt-view.js +2437 -2512
- package/es/gantt/src/gantt.d.ts +729 -0
- package/es/gantt/src/gantt.js +2815 -2858
- package/es/gantt/src/static.d.ts +34 -0
- package/es/gantt/src/static.js +16 -36
- package/es/gantt/src/util.d.ts +9 -0
- package/es/gantt/src/util.js +28 -19
- package/es/gantt/style.css +1 -1
- package/es/gantt/style.mini.css +1 -0
- package/es/index.d.ts +6 -0
- package/es/index.esm.js +6 -6
- package/es/index.js +6 -0
- package/es/ui/index.d.ts +3 -0
- package/es/ui/index.js +123 -120
- package/es/ui/src/comp.d.ts +2 -0
- package/es/ui/src/comp.js +4 -1
- package/es/ui/src/depend.d.ts +1 -0
- package/es/ui/src/depend.js +14 -12
- package/es/ui/src/dom.d.ts +49 -0
- package/es/ui/src/dom.js +180 -169
- package/es/ui/src/log.d.ts +6 -0
- package/es/ui/src/log.js +18 -13
- package/es/ui/src/utils.d.ts +21 -0
- package/es/ui/src/utils.js +60 -62
- package/es/ui/src/vn.d.ts +2 -0
- package/es/ui/src/vn.js +12 -9
- package/es/vxe-gantt/index.d.ts +3 -0
- package/es/vxe-gantt/index.js +6 -3
- package/es/vxe-gantt/style.css +1 -1
- package/es/vxe-gantt/style.mini.css +1 -0
- package/es/vxe-ui/index.d.ts +3 -0
- package/es/vxe-ui/index.js +6 -3
- package/lib/components.js +39 -35
- package/lib/gantt/index.js +50 -36
- package/lib/gantt/src/gantt-body.js +240 -245
- package/lib/gantt/src/gantt-chart.js +405 -375
- package/lib/gantt/src/gantt-footer.js +63 -46
- package/lib/gantt/src/gantt-header.js +186 -162
- package/lib/gantt/src/gantt-view.js +1554 -1745
- package/lib/gantt/src/gantt.js +2455 -2676
- package/lib/gantt/src/static.js +34 -40
- package/lib/gantt/src/util.js +32 -15
- package/lib/gantt/style/index.js +1 -1
- package/lib/gantt/style/style.css +1 -1
- package/lib/gantt/style/style.mini.css +1 -0
- package/lib/index.common.js +35 -23
- package/lib/index.js +37 -0
- package/lib/index.umd.js +4910 -15882
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +989 -1
- package/lib/style.mini.css +1 -0
- package/lib/ui/index.js +36 -25
- package/lib/ui/src/comp.js +22 -7
- package/lib/ui/src/depend.js +30 -13
- package/lib/ui/src/dom.js +88 -95
- package/lib/ui/src/log.js +34 -18
- package/lib/ui/src/utils.js +58 -50
- package/lib/ui/src/vn.js +35 -9
- package/lib/ui/style/index.js +1 -1
- package/lib/vxe-gantt/index.js +35 -20
- package/lib/vxe-gantt/style/index.js +1 -1
- package/lib/vxe-gantt/style/style.css +1 -1
- package/lib/vxe-gantt/style/style.mini.css +1 -0
- package/lib/vxe-ui/index.js +35 -20
- package/lib/vxe-ui/style/index.js +1 -1
- package/package.json +7 -4
- package/packages/gantt/src/gantt-view.ts +2 -0
- package/packages/gantt/src/gantt.ts +4 -0
- package/packages/ui/src/utils.ts +3 -12
- package/es/gantt/style.min.css +0 -1
- package/es/style.css +0 -1
- package/es/style.min.css +0 -1
- package/es/vxe-gantt/style.min.css +0 -1
- package/lib/components.min.js +0 -1
- package/lib/gantt/index.min.js +0 -1
- package/lib/gantt/src/gantt-body.min.js +0 -1
- package/lib/gantt/src/gantt-chart.min.js +0 -1
- package/lib/gantt/src/gantt-footer.min.js +0 -1
- package/lib/gantt/src/gantt-header.min.js +0 -1
- package/lib/gantt/src/gantt-view.min.js +0 -1
- package/lib/gantt/src/gantt.min.js +0 -1
- package/lib/gantt/src/static.min.js +0 -1
- package/lib/gantt/src/util.min.js +0 -1
- package/lib/gantt/style/style.min.css +0 -1
- package/lib/style.min.css +0 -1
- package/lib/ui/index.min.js +0 -1
- package/lib/ui/src/comp.min.js +0 -1
- package/lib/ui/src/depend.min.js +0 -1
- package/lib/ui/src/dom.min.js +0 -1
- package/lib/ui/src/log.min.js +0 -1
- package/lib/ui/src/utils.min.js +0 -1
- package/lib/ui/src/vn.min.js +0 -1
- package/lib/vxe-gantt/index.min.js +0 -1
- package/lib/vxe-gantt/style/style.min.css +0 -1
- package/lib/vxe-ui/index.min.js +0 -1
- /package/es/ui/{style.min.css → style.mini.css} +0 -0
- /package/es/vxe-ui/{style.min.css → style.mini.css} +0 -0
- /package/lib/ui/style/{style.min.css → style.mini.css} +0 -0
- /package/lib/vxe-ui/style/{style.min.css → style.mini.css} +0 -0
package/es/gantt/index.js
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { VxeUI } from
|
|
2
|
-
import { checkDependVersion } from
|
|
3
|
-
import VxeGanttComponent from
|
|
1
|
+
import { VxeUI } from "@vxe-ui/core";
|
|
2
|
+
import { checkDependVersion } from "../ui/src/depend";
|
|
3
|
+
import VxeGanttComponent from "./src/gantt";
|
|
4
4
|
let isReg = false;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
if (!isReg) {
|
|
14
|
-
isReg = true;
|
|
15
|
-
if (VxeUI.dynamicApp) {
|
|
16
|
-
VxeUI.dynamicApp.use(VxeGantt);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
checkDependVersion();
|
|
20
|
-
app.component(VxeGanttComponent.name, VxeGanttComponent);
|
|
5
|
+
const VxeGantt = Object.assign({}, VxeGanttComponent, {
|
|
6
|
+
install(app) {
|
|
7
|
+
if (typeof window !== "undefined") {
|
|
8
|
+
const VxeGanttExtendGanttChart = window.VxeGanttExtendGanttChart;
|
|
9
|
+
if (VxeGanttExtendGanttChart && VxeGanttExtendGanttChart.use) {
|
|
10
|
+
VxeGanttExtendGanttChart.use(VxeUI);
|
|
11
|
+
}
|
|
21
12
|
}
|
|
13
|
+
if (!isReg) {
|
|
14
|
+
isReg = true;
|
|
15
|
+
if (VxeUI.dynamicApp) {
|
|
16
|
+
VxeUI.dynamicApp.use(VxeGantt);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
checkDependVersion();
|
|
20
|
+
app.component(VxeGanttComponent.name, VxeGanttComponent);
|
|
21
|
+
}
|
|
22
22
|
});
|
|
23
23
|
VxeUI.component(VxeGanttComponent);
|
|
24
|
-
export * from
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
export * from "./src/static";
|
|
25
|
+
const Gantt = VxeGantt;
|
|
26
|
+
var gantt_default = VxeGantt;
|
|
27
|
+
export {
|
|
28
|
+
Gantt,
|
|
29
|
+
VxeGantt,
|
|
30
|
+
gantt_default as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { VNode, CreateElement } from 'vue';
|
|
2
|
+
import type { VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from 'vxe-table';
|
|
3
|
+
import type { VxeGanttViewPrivateMethods, VxeGanttConstructor, VxeGanttPrivateMethods, VxeGanttDefines } from '../../../types';
|
|
4
|
+
declare const _default: import("vue/types/vue").ExtendedVue<import("vue").default, unknown, {
|
|
5
|
+
renderColumn(h: CreateElement, $xeTable: VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods, row: any, rowid: string, rowIndex: number, $rowIndex: number, _rowIndex: number, column: VxeGanttDefines.ViewColumn, $columnIndex: number): VNode;
|
|
6
|
+
renderRows(h: CreateElement, $xeTable: VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods, tableData: any[]): VNode[];
|
|
7
|
+
renderVN(h: CreateElement): VNode;
|
|
8
|
+
}, {
|
|
9
|
+
$xeGantt: import("vxe-pc-ui").VxeComponentBaseOptions & {
|
|
10
|
+
reactData: import("vxe-pc-ui/types/components/gantt").GanttReactData<any>;
|
|
11
|
+
internalData: import("vxe-pc-ui/types/components/gantt").GanttInternalData;
|
|
12
|
+
} & import("vxe-pc-ui/types/components/gantt").VxeGanttMethods<any> & import("vxe-pc-ui/types/components/gantt").VxeGanttPrivateComputed<any> & import("vxe-pc-ui/types/components/gantt").VxeGanttProps<any> & import("vue").default & VxeGanttPrivateMethods<any>;
|
|
13
|
+
$xeGanttView: import("vxe-pc-ui").VxeComponentBaseOptions & {
|
|
14
|
+
reactData: import("vxe-pc-ui/types/components/gantt-module").GanttViewReactData;
|
|
15
|
+
internalData: import("vxe-pc-ui/types/components/gantt-module").GanttViewInternalData;
|
|
16
|
+
$xeGantt: VxeGanttConstructor;
|
|
17
|
+
} & import("vxe-pc-ui/types/components/gantt-module").VxeGanttViewMethods & import("vxe-pc-ui/types/components/gantt-module").GanttViewPrivateComputed & import("vxe-pc-ui/types/components/gantt-module").VxeGanttViewProps & import("vue").default & VxeGanttViewPrivateMethods;
|
|
18
|
+
}, Record<never, any>>;
|
|
19
|
+
export default _default;
|
|
@@ -1,296 +1,299 @@
|
|
|
1
|
-
import { defineVxeComponent } from
|
|
2
|
-
import { getCellRestHeight } from
|
|
3
|
-
import { getClass } from
|
|
4
|
-
import XEUtils from
|
|
5
|
-
import GanttViewChartComponent from
|
|
6
|
-
const sourceType =
|
|
7
|
-
const viewType =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
$xeGanttView: {
|
|
15
|
-
default: null
|
|
16
|
-
}
|
|
1
|
+
import { defineVxeComponent } from "../../ui/src/comp";
|
|
2
|
+
import { getCellRestHeight } from "./util";
|
|
3
|
+
import { getClass } from "../../ui/src/utils";
|
|
4
|
+
import XEUtils from "xe-utils";
|
|
5
|
+
import GanttViewChartComponent from "./gantt-chart";
|
|
6
|
+
const sourceType = "gantt";
|
|
7
|
+
const viewType = "body";
|
|
8
|
+
var gantt_body_default = defineVxeComponent({
|
|
9
|
+
name: "VxeGanttViewBody",
|
|
10
|
+
inject: {
|
|
11
|
+
$xeGantt: {
|
|
12
|
+
default: null
|
|
17
13
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
14
|
+
$xeGanttView: {
|
|
15
|
+
default: null
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
computed: {
|
|
19
|
+
...{}
|
|
20
|
+
},
|
|
21
|
+
methods: {
|
|
22
|
+
//
|
|
23
|
+
// Render
|
|
24
|
+
//
|
|
25
|
+
renderColumn(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex) {
|
|
26
|
+
const _vm = this;
|
|
27
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
28
|
+
const $xeGantt = _vm.$xeGantt;
|
|
29
|
+
const { reactData, internalData } = $xeGanttView;
|
|
30
|
+
const tableReactData = $xeTable.getReactData();
|
|
31
|
+
const { resizeHeightFlag } = tableReactData;
|
|
32
|
+
const tableInternalData = $xeTable.getInternalData();
|
|
33
|
+
const { fullAllDataRowIdData, visibleColumn } = tableInternalData;
|
|
34
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
35
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
36
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
37
|
+
const resizableOpts = $xeTable.computeResizableOpts;
|
|
38
|
+
const { isAllRowDrag } = resizableOpts;
|
|
39
|
+
const { headerGroups } = reactData;
|
|
40
|
+
const { todayDateMaps } = internalData;
|
|
41
|
+
const taskViewOpts = $xeGantt.computeTaskViewOpts;
|
|
42
|
+
const { showNowLine, viewStyle } = taskViewOpts;
|
|
43
|
+
const scaleUnit = $xeGantt.computeScaleUnit;
|
|
44
|
+
const { scaleItem } = headerGroups[headerGroups.length - 1] || {};
|
|
45
|
+
const { field, dateObj, startDateObj, endDateObj } = column;
|
|
46
|
+
const { cellClassName, cellStyle } = viewStyle || {};
|
|
47
|
+
const todayValue = showNowLine && scaleItem ? todayDateMaps[scaleItem.type] : null;
|
|
48
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
49
|
+
const cellHeight = resizeHeightFlag ? getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) : 0;
|
|
50
|
+
const tdVNs = [];
|
|
51
|
+
if (isAllRowDrag && rowOpts.resizable) {
|
|
52
|
+
const cellParams = {
|
|
53
|
+
$table: $xeTable,
|
|
54
|
+
$grid: null,
|
|
55
|
+
$gantt: $xeGantt,
|
|
56
|
+
seq: -1,
|
|
57
|
+
rowid,
|
|
58
|
+
row,
|
|
59
|
+
rowIndex,
|
|
60
|
+
$rowIndex,
|
|
61
|
+
_rowIndex,
|
|
62
|
+
column: visibleColumn[0],
|
|
63
|
+
columnIndex: 0,
|
|
64
|
+
$columnIndex: 0,
|
|
65
|
+
_columnIndex: 0,
|
|
66
|
+
fixed: "",
|
|
67
|
+
source: sourceType,
|
|
68
|
+
type: viewType,
|
|
69
|
+
isHidden: false,
|
|
70
|
+
isEdit: false,
|
|
71
|
+
level: -1,
|
|
72
|
+
// 已废弃属性
|
|
73
|
+
visibleData: [],
|
|
74
|
+
data: [],
|
|
75
|
+
items: []
|
|
76
|
+
};
|
|
77
|
+
tdVNs.push(
|
|
78
|
+
h("div", {
|
|
79
|
+
class: "vxe-gantt-view-cell--row-resizable",
|
|
80
|
+
on: {
|
|
81
|
+
mousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
82
|
+
dblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
on: {
|
|
114
|
-
click(evnt) {
|
|
115
|
-
$xeGantt.handleTaskCellClickEvent(evnt, { row, column });
|
|
116
|
-
},
|
|
117
|
-
dblclick(evnt) {
|
|
118
|
-
$xeGantt.handleTaskCellDblclickEvent(evnt, { row, column });
|
|
119
|
-
},
|
|
120
|
-
contextmenu(evnt) {
|
|
121
|
-
$xeGantt.handleTaskBodyContextmenuEvent(evnt, ctParams);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}, tdVNs);
|
|
125
|
-
},
|
|
126
|
-
renderRows(h, $xeTable, tableData) {
|
|
127
|
-
const _vm = this;
|
|
128
|
-
const $xeGanttView = _vm.$xeGanttView;
|
|
129
|
-
const $xeGantt = _vm.$xeGantt;
|
|
130
|
-
const { reactData } = $xeGanttView;
|
|
131
|
-
const tableProps = $xeTable;
|
|
132
|
-
const { treeConfig, stripe, highlightHoverRow, editConfig } = tableProps;
|
|
133
|
-
const tableReactData = $xeTable.getReactData();
|
|
134
|
-
const { treeExpandedFlag, selectRadioRow, pendingRowFlag, isRowGroupStatus } = tableReactData;
|
|
135
|
-
const tableInternalData = $xeTable.getInternalData();
|
|
136
|
-
const { fullAllDataRowIdData, treeExpandedMaps, pendingRowMaps } = tableInternalData;
|
|
137
|
-
const radioOpts = $xeTable.computeRadioOpts;
|
|
138
|
-
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
139
|
-
const rowOpts = $xeTable.computeRowOpts;
|
|
140
|
-
const treeOpts = $xeTable.computeTreeOpts;
|
|
141
|
-
const { transform } = treeOpts;
|
|
142
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
143
|
-
const scaleUnit = $xeGantt.computeScaleUnit;
|
|
144
|
-
const taskViewOpts = $xeGantt.computeTaskViewOpts;
|
|
145
|
-
const { viewStyle } = taskViewOpts;
|
|
146
|
-
const { rowClassName, rowStyle, cellClassName, cellStyle } = viewStyle || {};
|
|
147
|
-
const { tableColumn, scrollYLoad } = reactData;
|
|
148
|
-
const trVNs = [];
|
|
149
|
-
tableData.forEach((row, $rowIndex) => {
|
|
150
|
-
const rowid = $xeTable.getRowid(row);
|
|
151
|
-
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
152
|
-
const trOns = {};
|
|
153
|
-
let rowIndex = $rowIndex;
|
|
154
|
-
let _rowIndex = -1;
|
|
155
|
-
if (rowRest) {
|
|
156
|
-
rowIndex = rowRest.index;
|
|
157
|
-
_rowIndex = rowRest._index;
|
|
158
|
-
}
|
|
159
|
-
// 是否新增行
|
|
160
|
-
let isNewRow = false;
|
|
161
|
-
if (editConfig) {
|
|
162
|
-
isNewRow = $xeTable.isInsertByRow(row);
|
|
163
|
-
}
|
|
164
|
-
// 当前行事件
|
|
165
|
-
if (rowOpts.isHover || highlightHoverRow) {
|
|
166
|
-
trOns.mouseenter = (evnt) => {
|
|
167
|
-
$xeTable.triggerHoverEvent(evnt, { row, rowIndex });
|
|
168
|
-
};
|
|
169
|
-
trOns.mouseleave = () => {
|
|
170
|
-
$xeTable.clearHoverRow();
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
// 拖拽行事件
|
|
174
|
-
if (rowOpts.drag && !isRowGroupStatus && (!treeConfig || transform)) {
|
|
175
|
-
trOns.dragstart = $xeTable.handleRowDragDragstartEvent;
|
|
176
|
-
trOns.dragend = $xeTable.handleRowDragDragendEvent;
|
|
177
|
-
trOns.dragover = $xeTable.handleRowDragDragoverEvent;
|
|
178
|
-
}
|
|
179
|
-
const rowParams = {
|
|
180
|
-
$gantt: $xeGantt,
|
|
181
|
-
source: sourceType,
|
|
182
|
-
type: viewType,
|
|
183
|
-
scaleType: scaleUnit,
|
|
184
|
-
row,
|
|
185
|
-
rowIndex,
|
|
186
|
-
$rowIndex,
|
|
187
|
-
_rowIndex
|
|
188
|
-
};
|
|
189
|
-
trVNs.push(h('tr', {
|
|
190
|
-
key: rowClassName || rowStyle || cellClassName || cellStyle ? rowid : $rowIndex,
|
|
191
|
-
class: [
|
|
192
|
-
'vxe-gantt-view--body-row',
|
|
193
|
-
{
|
|
194
|
-
'row--stripe': stripe && (_rowIndex + 1) % 2 === 0,
|
|
195
|
-
'is--new': isNewRow,
|
|
196
|
-
'row--radio': radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
|
|
197
|
-
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
198
|
-
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid]
|
|
199
|
-
},
|
|
200
|
-
getClass(rowClassName, rowParams)
|
|
201
|
-
],
|
|
202
|
-
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(rowParams) || undefined : rowStyle) : undefined,
|
|
203
|
-
attrs: {
|
|
204
|
-
rowid
|
|
205
|
-
},
|
|
206
|
-
on: trOns
|
|
207
|
-
}, tableColumn.map((column, $columnIndex) => _vm.renderColumn(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex))));
|
|
208
|
-
let isExpandTree = false;
|
|
209
|
-
let rowChildren = [];
|
|
210
|
-
if (treeConfig && !scrollYLoad && !transform) {
|
|
211
|
-
rowChildren = row[childrenField];
|
|
212
|
-
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
213
|
-
}
|
|
214
|
-
// 如果是树形表格
|
|
215
|
-
if (isExpandTree) {
|
|
216
|
-
trVNs.push(..._vm.renderRows(h, $xeTable, rowChildren));
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
return trVNs;
|
|
84
|
+
})
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
const ctParams = {
|
|
88
|
+
$gantt: $xeGantt,
|
|
89
|
+
source: sourceType,
|
|
90
|
+
type: viewType,
|
|
91
|
+
scaleType: scaleUnit,
|
|
92
|
+
dateObj,
|
|
93
|
+
startDateObj,
|
|
94
|
+
endDateObj,
|
|
95
|
+
row,
|
|
96
|
+
column,
|
|
97
|
+
$rowIndex,
|
|
98
|
+
rowIndex,
|
|
99
|
+
_rowIndex
|
|
100
|
+
};
|
|
101
|
+
return h("td", {
|
|
102
|
+
key: cellClassName || cellStyle ? field : $columnIndex,
|
|
103
|
+
class: [
|
|
104
|
+
"vxe-gantt-view--body-column",
|
|
105
|
+
{
|
|
106
|
+
"is--now": showNowLine && todayValue === field
|
|
107
|
+
},
|
|
108
|
+
getClass(cellClassName, ctParams)
|
|
109
|
+
],
|
|
110
|
+
style: cellStyle ? Object.assign({}, XEUtils.isFunction(cellStyle) ? cellStyle(ctParams) : cellStyle, {
|
|
111
|
+
height: `${cellHeight}px`
|
|
112
|
+
}) : {
|
|
113
|
+
height: `${cellHeight}px`
|
|
220
114
|
},
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}, [
|
|
232
|
-
h('div', {
|
|
233
|
-
ref: 'refBodyScroll',
|
|
234
|
-
class: 'vxe-gantt-view--body-inner-wrapper',
|
|
235
|
-
on: {
|
|
236
|
-
scroll: $xeGanttView.triggerBodyScrollEvent,
|
|
237
|
-
contextmenu(evnt) {
|
|
238
|
-
$xeGantt.handleTaskBodyContextmenuEvent(evnt, { source: sourceType, type: viewType, rowIndex: -1, $rowIndex: -1, _rowIndex: -1 });
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}, [
|
|
242
|
-
h('div', {
|
|
243
|
-
ref: 'refBodyXSpace',
|
|
244
|
-
class: 'vxe-body--x-space'
|
|
245
|
-
}),
|
|
246
|
-
h('div', {
|
|
247
|
-
ref: 'refBodyYSpace',
|
|
248
|
-
class: 'vxe-body--y-space'
|
|
249
|
-
}),
|
|
250
|
-
h('table', {
|
|
251
|
-
ref: 'refBodyTable',
|
|
252
|
-
class: 'vxe-gantt-view--body-table'
|
|
253
|
-
}, [
|
|
254
|
-
h('colgroup', {}, tableColumn.map((column, cIndex) => {
|
|
255
|
-
return h('col', {
|
|
256
|
-
key: cIndex,
|
|
257
|
-
style: {
|
|
258
|
-
width: `${viewCellWidth}px`
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
})),
|
|
262
|
-
h('tbody', {}, $xeTable ? _vm.renderRows(h, $xeTable, tableData) : [])
|
|
263
|
-
]),
|
|
264
|
-
h(GanttViewChartComponent)
|
|
265
|
-
])
|
|
266
|
-
]);
|
|
115
|
+
on: {
|
|
116
|
+
click(evnt) {
|
|
117
|
+
$xeGantt.handleTaskCellClickEvent(evnt, { row, column });
|
|
118
|
+
},
|
|
119
|
+
dblclick(evnt) {
|
|
120
|
+
$xeGantt.handleTaskCellDblclickEvent(evnt, { row, column });
|
|
121
|
+
},
|
|
122
|
+
contextmenu(evnt) {
|
|
123
|
+
$xeGantt.handleTaskBodyContextmenuEvent(evnt, ctParams);
|
|
124
|
+
}
|
|
267
125
|
}
|
|
126
|
+
}, tdVNs);
|
|
268
127
|
},
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
128
|
+
renderRows(h, $xeTable, tableData) {
|
|
129
|
+
const _vm = this;
|
|
130
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
131
|
+
const $xeGantt = _vm.$xeGantt;
|
|
132
|
+
const { reactData } = $xeGanttView;
|
|
133
|
+
const tableProps = $xeTable;
|
|
134
|
+
const { treeConfig, stripe, highlightHoverRow, editConfig } = tableProps;
|
|
135
|
+
const tableReactData = $xeTable.getReactData();
|
|
136
|
+
const { treeExpandedFlag, selectRadioRow, pendingRowFlag, isRowGroupStatus } = tableReactData;
|
|
137
|
+
const tableInternalData = $xeTable.getInternalData();
|
|
138
|
+
const { fullAllDataRowIdData, treeExpandedMaps, pendingRowMaps } = tableInternalData;
|
|
139
|
+
const radioOpts = $xeTable.computeRadioOpts;
|
|
140
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
141
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
142
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
143
|
+
const { transform } = treeOpts;
|
|
144
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
145
|
+
const scaleUnit = $xeGantt.computeScaleUnit;
|
|
146
|
+
const taskViewOpts = $xeGantt.computeTaskViewOpts;
|
|
147
|
+
const { viewStyle } = taskViewOpts;
|
|
148
|
+
const { rowClassName, rowStyle, cellClassName, cellStyle } = viewStyle || {};
|
|
149
|
+
const { tableColumn, scrollYLoad } = reactData;
|
|
150
|
+
const trVNs = [];
|
|
151
|
+
tableData.forEach((row, $rowIndex) => {
|
|
152
|
+
const rowid = $xeTable.getRowid(row);
|
|
153
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
154
|
+
const trOns = {};
|
|
155
|
+
let rowIndex = $rowIndex;
|
|
156
|
+
let _rowIndex = -1;
|
|
157
|
+
if (rowRest) {
|
|
158
|
+
rowIndex = rowRest.index;
|
|
159
|
+
_rowIndex = rowRest._index;
|
|
160
|
+
}
|
|
161
|
+
let isNewRow = false;
|
|
162
|
+
if (editConfig) {
|
|
163
|
+
isNewRow = $xeTable.isInsertByRow(row);
|
|
164
|
+
}
|
|
165
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
166
|
+
trOns.mouseenter = (evnt) => {
|
|
167
|
+
$xeTable.triggerHoverEvent(evnt, { row, rowIndex });
|
|
168
|
+
};
|
|
169
|
+
trOns.mouseleave = () => {
|
|
170
|
+
$xeTable.clearHoverRow();
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
if (rowOpts.drag && !isRowGroupStatus && (!treeConfig || transform)) {
|
|
174
|
+
trOns.dragstart = $xeTable.handleRowDragDragstartEvent;
|
|
175
|
+
trOns.dragend = $xeTable.handleRowDragDragendEvent;
|
|
176
|
+
trOns.dragover = $xeTable.handleRowDragDragoverEvent;
|
|
177
|
+
}
|
|
178
|
+
const rowParams = {
|
|
179
|
+
$gantt: $xeGantt,
|
|
180
|
+
source: sourceType,
|
|
181
|
+
type: viewType,
|
|
182
|
+
scaleType: scaleUnit,
|
|
183
|
+
row,
|
|
184
|
+
rowIndex,
|
|
185
|
+
$rowIndex,
|
|
186
|
+
_rowIndex
|
|
187
|
+
};
|
|
188
|
+
trVNs.push(
|
|
189
|
+
h("tr", {
|
|
190
|
+
key: rowClassName || rowStyle || cellClassName || cellStyle ? rowid : $rowIndex,
|
|
191
|
+
class: [
|
|
192
|
+
"vxe-gantt-view--body-row",
|
|
193
|
+
{
|
|
194
|
+
"row--stripe": stripe && (_rowIndex + 1) % 2 === 0,
|
|
195
|
+
"is--new": isNewRow,
|
|
196
|
+
"row--radio": radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
|
|
197
|
+
"row--checked": checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
198
|
+
"row--pending": !!pendingRowFlag && !!pendingRowMaps[rowid]
|
|
199
|
+
},
|
|
200
|
+
getClass(rowClassName, rowParams)
|
|
201
|
+
],
|
|
202
|
+
style: rowStyle ? XEUtils.isFunction(rowStyle) ? rowStyle(rowParams) || void 0 : rowStyle : void 0,
|
|
203
|
+
attrs: {
|
|
204
|
+
rowid
|
|
205
|
+
},
|
|
206
|
+
on: trOns
|
|
207
|
+
}, tableColumn.map((column, $columnIndex) => _vm.renderColumn(h, $xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex)))
|
|
208
|
+
);
|
|
209
|
+
let isExpandTree = false;
|
|
210
|
+
let rowChildren = [];
|
|
211
|
+
if (treeConfig && !scrollYLoad && !transform) {
|
|
212
|
+
rowChildren = row[childrenField];
|
|
213
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
214
|
+
}
|
|
215
|
+
if (isExpandTree) {
|
|
216
|
+
trVNs.push(..._vm.renderRows(h, $xeTable, rowChildren));
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
return trVNs;
|
|
292
220
|
},
|
|
293
|
-
|
|
294
|
-
|
|
221
|
+
renderVN(h) {
|
|
222
|
+
const _vm = this;
|
|
223
|
+
const $xeGantt = _vm.$xeGantt;
|
|
224
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
225
|
+
const { reactData } = $xeGanttView;
|
|
226
|
+
const $xeTable = $xeGanttView.internalData.xeTable;
|
|
227
|
+
const { tableData, tableColumn, viewCellWidth } = reactData;
|
|
228
|
+
return h("div", {
|
|
229
|
+
ref: "refElem",
|
|
230
|
+
class: "vxe-gantt-view--body-wrapper"
|
|
231
|
+
}, [
|
|
232
|
+
h("div", {
|
|
233
|
+
ref: "refBodyScroll",
|
|
234
|
+
class: "vxe-gantt-view--body-inner-wrapper",
|
|
235
|
+
on: {
|
|
236
|
+
scroll: $xeGanttView.triggerBodyScrollEvent,
|
|
237
|
+
contextmenu(evnt) {
|
|
238
|
+
$xeGantt.handleTaskBodyContextmenuEvent(evnt, { source: sourceType, type: viewType, rowIndex: -1, $rowIndex: -1, _rowIndex: -1 });
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}, [
|
|
242
|
+
h("div", {
|
|
243
|
+
ref: "refBodyXSpace",
|
|
244
|
+
class: "vxe-body--x-space"
|
|
245
|
+
}),
|
|
246
|
+
h("div", {
|
|
247
|
+
ref: "refBodyYSpace",
|
|
248
|
+
class: "vxe-body--y-space"
|
|
249
|
+
}),
|
|
250
|
+
h("table", {
|
|
251
|
+
ref: "refBodyTable",
|
|
252
|
+
class: "vxe-gantt-view--body-table"
|
|
253
|
+
}, [
|
|
254
|
+
h("colgroup", {}, tableColumn.map((column, cIndex) => {
|
|
255
|
+
return h("col", {
|
|
256
|
+
key: cIndex,
|
|
257
|
+
style: {
|
|
258
|
+
width: `${viewCellWidth}px`
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
})),
|
|
262
|
+
h("tbody", {}, $xeTable ? _vm.renderRows(h, $xeTable, tableData) : [])
|
|
263
|
+
]),
|
|
264
|
+
h(GanttViewChartComponent)
|
|
265
|
+
])
|
|
266
|
+
]);
|
|
295
267
|
}
|
|
268
|
+
},
|
|
269
|
+
mounted() {
|
|
270
|
+
const _vm = this;
|
|
271
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
272
|
+
const { internalData } = $xeGanttView;
|
|
273
|
+
const { elemStore } = internalData;
|
|
274
|
+
const prefix = "main-body-";
|
|
275
|
+
elemStore[`${prefix}wrapper`] = _vm.$refs.refElem;
|
|
276
|
+
elemStore[`${prefix}scroll`] = _vm.$refs.refBodyScroll;
|
|
277
|
+
elemStore[`${prefix}table`] = _vm.$refs.refBodyTable;
|
|
278
|
+
elemStore[`${prefix}xSpace`] = _vm.$refs.refBodyXSpace;
|
|
279
|
+
elemStore[`${prefix}ySpace`] = _vm.$refs.refBodyYSpace;
|
|
280
|
+
},
|
|
281
|
+
destroyed() {
|
|
282
|
+
const _vm = this;
|
|
283
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
284
|
+
const { internalData } = $xeGanttView;
|
|
285
|
+
const { elemStore } = internalData;
|
|
286
|
+
const prefix = "main-body-";
|
|
287
|
+
elemStore[`${prefix}wrapper`] = null;
|
|
288
|
+
elemStore[`${prefix}scroll`] = null;
|
|
289
|
+
elemStore[`${prefix}table`] = null;
|
|
290
|
+
elemStore[`${prefix}xSpace`] = null;
|
|
291
|
+
elemStore[`${prefix}ySpace`] = null;
|
|
292
|
+
},
|
|
293
|
+
render(h) {
|
|
294
|
+
return this.renderVN(h);
|
|
295
|
+
}
|
|
296
296
|
});
|
|
297
|
+
export {
|
|
298
|
+
gantt_body_default as default
|
|
299
|
+
};
|