vxe-gantt 0.0.3 → 3.0.0-beta.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/README.md +14 -46
- package/es/components.js +3 -2
- package/es/gantt/src/gantt-body.js +83 -49
- package/es/gantt/src/gantt-chart.js +91 -43
- package/es/gantt/src/gantt-header.js +63 -36
- package/es/gantt/src/gantt-view.js +638 -586
- package/es/gantt/src/gantt.js +1346 -1178
- package/es/gantt/src/util.js +1 -4
- package/es/gantt/style.css +62 -28
- package/es/gantt/style.min.css +1 -1
- package/es/index.esm.js +5 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +9 -3
- package/es/ui/src/comp.js +1 -2
- package/es/ui/src/log.js +3 -2
- package/es/ui/src/utils.js +17 -17
- package/es/vxe-gantt/style.css +62 -28
- package/es/vxe-gantt/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/components.js +20 -19
- package/lib/components.min.js +1 -1
- package/lib/gantt/index.js +3 -3
- package/lib/gantt/index.min.js +1 -1
- package/lib/gantt/src/gantt-body.js +109 -87
- package/lib/gantt/src/gantt-body.min.js +1 -1
- package/lib/gantt/src/gantt-chart.js +109 -69
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt-header.js +75 -56
- package/lib/gantt/src/gantt-header.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +684 -686
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +1630 -1559
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/gantt/src/util.js +1 -4
- package/lib/gantt/src/util.min.js +1 -1
- package/lib/gantt/style/style.css +62 -28
- package/lib/gantt/style/style.min.css +1 -1
- package/lib/index.common.js +12 -7
- package/lib/index.umd.js +10704 -5870
- 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 +12 -16
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/comp.js +3 -2
- package/lib/ui/src/comp.min.js +1 -1
- package/lib/ui/src/dom.js +33 -33
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +4 -3
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/utils.js +21 -24
- package/lib/ui/src/utils.min.js +1 -1
- package/lib/vxe-gantt/index.js +4 -2
- package/lib/vxe-gantt/index.min.js +1 -1
- package/lib/vxe-gantt/style/style.css +62 -28
- package/lib/vxe-gantt/style/style.min.css +1 -1
- package/lib/vxe-ui/index.js +4 -2
- package/lib/vxe-ui/index.min.js +1 -1
- package/package.json +13 -13
- package/packages/components.ts +8 -5
- package/packages/gantt/index.ts +2 -2
- package/packages/gantt/src/gantt-body.ts +89 -53
- package/packages/gantt/src/gantt-chart.ts +100 -49
- package/packages/gantt/src/gantt-header.ts +69 -39
- package/packages/gantt/src/gantt-view.ts +692 -624
- package/packages/gantt/src/gantt.ts +1459 -1240
- package/packages/gantt/src/util.ts +1 -4
- package/packages/index.ts +6 -2
- package/packages/ui/index.ts +9 -3
- package/packages/ui/src/comp.ts +2 -2
- package/packages/ui/src/log.ts +3 -1
- package/packages/ui/src/utils.ts +22 -21
- package/styles/components/gantt-module/gantt-chart.scss +28 -9
- package/styles/components/gantt.scss +36 -21
- package/styles/theme/base.scss +5 -1
- package/types/all.d.ts +3 -3
- package/types/index.d.ts +2 -2
- package/README.en.md +0 -72
- package/README.ja-JP.md +0 -72
- package/README.zh-TW.md +0 -73
- package/es/gantt/src/emits.js +0 -4
- package/es/gantt/src/grid-emits.js +0 -16
- package/es/gantt/src/grid-props.js +0 -7
- package/es/gantt/src/props.js +0 -2
- package/es/gantt/src/table-emits.js +0 -97
- package/es/gantt/src/table-props.js +0 -298
- package/lib/gantt/src/emits.js +0 -8
- package/lib/gantt/src/emits.min.js +0 -1
- package/lib/gantt/src/grid-emits.js +0 -8
- package/lib/gantt/src/grid-emits.min.js +0 -1
- package/lib/gantt/src/grid-props.js +0 -24
- package/lib/gantt/src/grid-props.min.js +0 -1
- package/lib/gantt/src/props.js +0 -13
- package/lib/gantt/src/props.min.js +0 -1
- package/lib/gantt/src/table-emits.js +0 -7
- package/lib/gantt/src/table-emits.min.js +0 -1
- package/lib/gantt/src/table-props.js +0 -306
- package/lib/gantt/src/table-props.min.js +0 -1
- package/packages/gantt/src/emits.ts +0 -7
- package/packages/gantt/src/grid-emits.ts +0 -19
- package/packages/gantt/src/grid-props.ts +0 -23
- package/packages/gantt/src/props.ts +0 -13
- package/packages/gantt/src/table-emits.ts +0 -109
- package/packages/gantt/src/table-props.ts +0 -304
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# vxe-gantt
|
|
2
2
|
|
|
3
|
-
简体中文 | [繁體中文](README.zh-TW.md) | [English](README.en.md) | [日本語](README.ja-JP.md)
|
|
4
|
-
|
|
5
3
|
[](https://gitee.com/x-extends/vxe-gantt/stargazers)
|
|
6
4
|
[](https://www.npmjs.com/package/vxe-gantt)
|
|
7
5
|
[](https://github.com/x-extends/vxe-gantt/actions/workflows/webpack.yml)
|
|
@@ -14,72 +12,42 @@
|
|
|
14
12
|
|
|
15
13
|
一个基于 [Vxe UI](https://github.com/x-extends/vxe-pc-ui) 的基于 PC 端甘特图组件
|
|
16
14
|
|
|
17
|
-
* 设计理念
|
|
18
|
-
* 面向现代浏览器,高效的简洁 API 设计
|
|
19
|
-
|
|
20
|
-
* 版本说明
|
|
21
|
-
* **V4**
|
|
22
|
-
* [x] v4.0 基于 vue3.2+,只支持现代浏览器,不支持 IE
|
|
23
|
-
* **V3**
|
|
24
|
-
* [x] v3.0 基于 vue2.6~2.7,只支持现代浏览器,不支持 IE
|
|
25
|
-
* **V2**
|
|
26
|
-
* [x] ~~v2.0 基于 vue2.6+,停止维护~~
|
|
27
|
-
* **V1**
|
|
28
|
-
* [x] ~~v1.0 基于 vue2.6+,停止维护~~
|
|
29
|
-
|
|
30
15
|
## 浏览器支持
|
|
31
16
|
|
|
32
17
|
 |  |  |  | 
|
|
33
18
|
--- | --- | --- | --- | --- |
|
|
34
19
|
80+ ✔ | 80+ ✔ | 90+ ✔ | 75+ ✔ | 10+ ✔ |
|
|
35
20
|
|
|
36
|
-
## 在线文档
|
|
37
|
-
|
|
38
|
-
👉 [基础库](https://vxeui.com)
|
|
39
|
-
👉 [表格库](https://vxetable.cn)
|
|
40
|
-
👉 [甘特图](https://gantt.vxeui.com)
|
|
41
|
-
👉 [可视化](https://design.vxeui.com)
|
|
42
|
-
|
|
43
|
-
## QQ 交流群
|
|
44
|
-
|
|
45
|
-
该群供大家交流問題,如果群人数已满,将会不定期剔除不活跃的。
|
|
46
|
-
|
|
47
|
-

|
|
48
|
-

|
|
49
|
-
|
|
50
|
-
## 功能点
|
|
51
|
-
|
|
52
|
-
[👀 Vxe Gantt](https://gantt.vxeui.com/)
|
|
53
|
-
|
|
54
|
-
* [x] gantt 甘特图
|
|
55
|
-
|
|
56
21
|
## 安装
|
|
57
22
|
|
|
58
|
-
版本:[vue](https://www.npmjs.com/package/vue) 3.x
|
|
59
|
-
|
|
60
23
|
```shell
|
|
61
|
-
npm install vxe-gantt
|
|
24
|
+
npm install vxe-pc-ui@3 vxe-table@3 vxe-gantt@3
|
|
62
25
|
```
|
|
63
26
|
|
|
64
|
-
Get on [unpkg](https://unpkg.com/vxe-gantt/) and [cdnjs](https://cdn.jsdelivr.net/npm/vxe-gantt/)
|
|
65
|
-
|
|
66
|
-
### NPM
|
|
67
|
-
|
|
68
27
|
```javascript
|
|
28
|
+
import Vue from 'vue'
|
|
69
29
|
// ...
|
|
70
30
|
import VxeUIAll from 'vxe-pc-ui'
|
|
71
|
-
import 'vxe-pc-ui/
|
|
31
|
+
import 'vxe-pc-ui/es/style.css'
|
|
72
32
|
|
|
73
33
|
import VxeUITable from 'vxe-table'
|
|
74
|
-
import 'vxe-table/
|
|
34
|
+
import 'vxe-table/es/style.css'
|
|
75
35
|
|
|
76
36
|
import VxeUIGantt from 'vxe-gantt'
|
|
77
37
|
import 'vxe-gantt/lib/style.css'
|
|
78
38
|
// ...
|
|
79
39
|
|
|
80
|
-
|
|
40
|
+
Vue.use(VxeUIAll)
|
|
41
|
+
Vue.use(VxeUITable)
|
|
42
|
+
Vue.use(VxeUIGantt)
|
|
81
43
|
```
|
|
82
44
|
|
|
45
|
+
## Contributors
|
|
46
|
+
|
|
47
|
+
Thank you to everyone who contributed to this project.
|
|
48
|
+
|
|
49
|
+
[](https://github.com/x-extends/vxe-gantt/graphs/contributors)
|
|
50
|
+
|
|
83
51
|
## License
|
|
84
52
|
|
|
85
|
-
[MIT](LICENSE) ©
|
|
53
|
+
[MIT](LICENSE) © 2019-present, Xu Liangzhan
|
package/es/components.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import VxeUI from './ui';
|
|
2
2
|
import VxeGantt from './gantt';
|
|
3
|
+
const { setConfig } = VxeUI;
|
|
3
4
|
const components = [
|
|
4
5
|
VxeGantt
|
|
5
6
|
];
|
|
@@ -7,6 +8,6 @@ export function install(app, options) {
|
|
|
7
8
|
setConfig(options);
|
|
8
9
|
components.forEach(component => app.use(component));
|
|
9
10
|
}
|
|
10
|
-
export
|
|
11
|
+
export { VxeUI };
|
|
11
12
|
// Components
|
|
12
13
|
export * from './gantt';
|
|
@@ -1,31 +1,41 @@
|
|
|
1
|
-
import { h, inject, ref, onMounted, onUnmounted } from 'vue';
|
|
2
1
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
2
|
import { getCellRestHeight } from './util';
|
|
4
3
|
import GanttViewChartComponent from './gantt-chart';
|
|
5
4
|
export default defineVxeComponent({
|
|
6
5
|
name: 'VxeGanttViewBody',
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
inject: {
|
|
7
|
+
$xeGantt: {
|
|
8
|
+
default: null
|
|
9
|
+
},
|
|
10
|
+
$xeGanttView: {
|
|
11
|
+
default: null
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
props: {},
|
|
15
|
+
data() {
|
|
16
|
+
return {};
|
|
17
|
+
},
|
|
18
|
+
computed: Object.assign({}, {}),
|
|
19
|
+
methods: {
|
|
20
|
+
//
|
|
21
|
+
// Render
|
|
22
|
+
//
|
|
23
|
+
renderRows(h) {
|
|
24
|
+
const _vm = this;
|
|
25
|
+
const $xeGantt = _vm.$xeGantt;
|
|
26
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
27
|
+
const $xeTable = $xeGanttView.internalData.xeTable;
|
|
28
|
+
const tableInternalData = ($xeTable ? $xeTable : {});
|
|
29
|
+
const fullAllDataRowIdData = tableInternalData.fullAllDataRowIdData || {};
|
|
20
30
|
let cellOpts = {};
|
|
21
31
|
let rowOpts = {};
|
|
22
32
|
let defaultRowHeight = 0;
|
|
23
33
|
if ($xeTable) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
defaultRowHeight = computeDefaultRowHeight.value;
|
|
34
|
+
cellOpts = $xeTable.computeCellOpts;
|
|
35
|
+
rowOpts = $xeTable.computeRowOpts;
|
|
36
|
+
defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
28
37
|
}
|
|
38
|
+
const { reactData } = $xeGanttView;
|
|
29
39
|
const { tableData, tableColumn } = reactData;
|
|
30
40
|
const trVNs = [];
|
|
31
41
|
tableData.forEach((row, rIndex) => {
|
|
@@ -40,64 +50,88 @@ export default defineVxeComponent({
|
|
|
40
50
|
class: 'vxe-gantt-view--body-column',
|
|
41
51
|
style: {
|
|
42
52
|
height: `${cellHeight}px`
|
|
53
|
+
},
|
|
54
|
+
on: {
|
|
55
|
+
click(evnt) {
|
|
56
|
+
$xeGantt.handleTaskCellClickEvent(evnt, { row });
|
|
57
|
+
},
|
|
58
|
+
dblclick(evnt) {
|
|
59
|
+
$xeGantt.handleTaskCellDblclickEvent(evnt, { row });
|
|
60
|
+
}
|
|
43
61
|
}
|
|
44
62
|
});
|
|
45
63
|
})));
|
|
46
64
|
});
|
|
47
65
|
return trVNs;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const
|
|
66
|
+
},
|
|
67
|
+
renderVN(h) {
|
|
68
|
+
const _vm = this;
|
|
69
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
70
|
+
const { reactData } = $xeGanttView;
|
|
71
|
+
const { tableColumn, viewCellWidth } = reactData;
|
|
51
72
|
return h('div', {
|
|
52
|
-
ref: refElem,
|
|
73
|
+
ref: 'refElem',
|
|
53
74
|
class: 'vxe-gantt-view--body-wrapper'
|
|
54
75
|
}, [
|
|
55
76
|
h('div', {
|
|
56
|
-
ref: refBodyScroll,
|
|
77
|
+
ref: 'refBodyScroll',
|
|
57
78
|
class: 'vxe-gantt-view--body-inner-wrapper',
|
|
58
|
-
|
|
79
|
+
on: {
|
|
80
|
+
scroll: $xeGanttView.triggerBodyScrollEvent
|
|
81
|
+
}
|
|
59
82
|
}, [
|
|
60
83
|
h('div', {
|
|
61
|
-
ref: refBodyXSpace,
|
|
84
|
+
ref: 'refBodyXSpace',
|
|
62
85
|
class: 'vxe-body--x-space'
|
|
63
86
|
}),
|
|
64
87
|
h('div', {
|
|
65
|
-
ref: refBodyYSpace,
|
|
88
|
+
ref: 'refBodyYSpace',
|
|
66
89
|
class: 'vxe-body--y-space'
|
|
67
90
|
}),
|
|
68
91
|
h('table', {
|
|
69
|
-
ref: refBodyTable,
|
|
92
|
+
ref: 'refBodyTable',
|
|
70
93
|
class: 'vxe-gantt-view--body-table'
|
|
71
94
|
}, [
|
|
72
95
|
h('colgroup', {}, tableColumn.map((column, cIndex) => {
|
|
73
96
|
return h('col', {
|
|
74
|
-
key: cIndex
|
|
97
|
+
key: cIndex,
|
|
98
|
+
style: {
|
|
99
|
+
width: `${viewCellWidth}px`
|
|
100
|
+
}
|
|
75
101
|
});
|
|
76
102
|
})),
|
|
77
|
-
h('tbody', {}, renderRows())
|
|
103
|
+
h('tbody', {}, _vm.renderRows(h))
|
|
78
104
|
]),
|
|
79
105
|
h(GanttViewChartComponent)
|
|
80
106
|
])
|
|
81
107
|
]);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
mounted() {
|
|
111
|
+
const _vm = this;
|
|
112
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
113
|
+
const { internalData } = $xeGanttView;
|
|
114
|
+
const { elemStore } = internalData;
|
|
115
|
+
const prefix = 'main-body-';
|
|
116
|
+
elemStore[`${prefix}wrapper`] = _vm.$refs.refElem;
|
|
117
|
+
elemStore[`${prefix}scroll`] = _vm.$refs.refBodyScroll;
|
|
118
|
+
elemStore[`${prefix}table`] = _vm.$refs.refBodyTable;
|
|
119
|
+
elemStore[`${prefix}xSpace`] = _vm.$refs.refBodyXSpace;
|
|
120
|
+
elemStore[`${prefix}ySpace`] = _vm.$refs.refBodyYSpace;
|
|
121
|
+
},
|
|
122
|
+
destroyed() {
|
|
123
|
+
const _vm = this;
|
|
124
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
125
|
+
const { internalData } = $xeGanttView;
|
|
126
|
+
const { elemStore } = internalData;
|
|
127
|
+
const prefix = 'main-body-';
|
|
128
|
+
elemStore[`${prefix}wrapper`] = null;
|
|
129
|
+
elemStore[`${prefix}scroll`] = null;
|
|
130
|
+
elemStore[`${prefix}table`] = null;
|
|
131
|
+
elemStore[`${prefix}xSpace`] = null;
|
|
132
|
+
elemStore[`${prefix}ySpace`] = null;
|
|
133
|
+
},
|
|
134
|
+
render(h) {
|
|
135
|
+
return this.renderVN(h);
|
|
102
136
|
}
|
|
103
137
|
});
|
|
@@ -1,77 +1,125 @@
|
|
|
1
|
-
import { h, inject, ref, onMounted, onUnmounted } from 'vue';
|
|
2
1
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
2
|
+
import { VxeUI } from '@vxe-ui/core';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
4
|
import { getCellRestHeight } from './util';
|
|
5
|
+
import { getStringValue } from '../../ui/src/utils';
|
|
6
|
+
const { renderEmptyElement } = VxeUI;
|
|
5
7
|
export default defineVxeComponent({
|
|
6
8
|
name: 'VxeGanttViewChart',
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
inject: {
|
|
10
|
+
$xeGantt: {
|
|
11
|
+
default: null
|
|
12
|
+
},
|
|
13
|
+
$xeGanttView: {
|
|
14
|
+
default: null
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
props: {},
|
|
18
|
+
data() {
|
|
19
|
+
return {};
|
|
20
|
+
},
|
|
21
|
+
computed: Object.assign({}, {}),
|
|
22
|
+
methods: {
|
|
23
|
+
//
|
|
24
|
+
// Render
|
|
25
|
+
//
|
|
26
|
+
renderVN(h) {
|
|
27
|
+
const _vm = this;
|
|
28
|
+
const $xeGantt = _vm.$xeGantt;
|
|
29
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
30
|
+
const $xeTable = $xeGanttView.internalData.xeTable;
|
|
31
|
+
const tableInternalData = ($xeTable ? $xeTable : {});
|
|
32
|
+
const fullAllDataRowIdData = tableInternalData.fullAllDataRowIdData || {};
|
|
17
33
|
let cellOpts = {};
|
|
18
34
|
let rowOpts = {};
|
|
19
35
|
let defaultRowHeight = 0;
|
|
20
36
|
if ($xeTable) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
defaultRowHeight = computeDefaultRowHeight.value;
|
|
37
|
+
cellOpts = $xeTable.computeCellOpts;
|
|
38
|
+
rowOpts = $xeTable.computeRowOpts;
|
|
39
|
+
defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
25
40
|
}
|
|
41
|
+
const { reactData } = $xeGanttView;
|
|
26
42
|
const { tableData } = reactData;
|
|
27
|
-
const
|
|
43
|
+
const titleField = $xeGantt.computeTitleField;
|
|
44
|
+
const progressField = $xeGantt.computeProgressField;
|
|
45
|
+
const taskBarOpts = $xeGantt.computeTaskBarOpts;
|
|
46
|
+
const { showProgress, showContent, contentMethod, barStyle } = taskBarOpts;
|
|
47
|
+
const { round } = barStyle || {};
|
|
28
48
|
const trVNs = [];
|
|
29
49
|
tableData.forEach((row, rIndex) => {
|
|
30
50
|
const rowid = $xeTable ? $xeTable.getRowid(row) : '';
|
|
31
51
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
32
52
|
const cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
33
|
-
|
|
53
|
+
let title = getStringValue(XEUtils.get(row, titleField));
|
|
54
|
+
const progressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(row, progressField)))) : 0;
|
|
55
|
+
if (contentMethod) {
|
|
56
|
+
title = getStringValue(contentMethod({ row, title }));
|
|
57
|
+
}
|
|
34
58
|
trVNs.push(h('div', {
|
|
35
59
|
key: rIndex,
|
|
36
|
-
|
|
37
|
-
|
|
60
|
+
attrs: {
|
|
61
|
+
rowid
|
|
62
|
+
},
|
|
63
|
+
class: ['vxe-gantt-view--chart-row', {
|
|
64
|
+
'is--round': round
|
|
65
|
+
}],
|
|
38
66
|
style: {
|
|
39
67
|
height: `${cellHeight}px`
|
|
40
68
|
}
|
|
41
69
|
}, [
|
|
42
70
|
h('div', {
|
|
43
71
|
class: 'vxe-gantt-view--chart-bar',
|
|
44
|
-
|
|
72
|
+
attrs: {
|
|
73
|
+
rowid
|
|
74
|
+
},
|
|
75
|
+
on: {
|
|
76
|
+
click(evnt) {
|
|
77
|
+
$xeGantt.handleTaskBarClickEvent(evnt, { row });
|
|
78
|
+
},
|
|
79
|
+
dblclick(evnt) {
|
|
80
|
+
$xeGantt.handleTaskBarDblclickEvent(evnt, { row });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
45
83
|
}, [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
width: `${progressValue}%`
|
|
84
|
+
showProgress
|
|
85
|
+
? h('div', {
|
|
86
|
+
class: 'vxe-gantt-view--chart-progress',
|
|
87
|
+
style: {
|
|
88
|
+
width: `${progressValue || 0}%`
|
|
51
89
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
90
|
+
})
|
|
91
|
+
: renderEmptyElement($xeGantt),
|
|
92
|
+
showContent
|
|
93
|
+
? h('div', {
|
|
94
|
+
class: 'vxe-gantt-view--chart-content'
|
|
95
|
+
}, title)
|
|
96
|
+
: renderEmptyElement($xeGantt)
|
|
57
97
|
])
|
|
58
98
|
]));
|
|
59
99
|
});
|
|
60
100
|
return h('div', {
|
|
61
|
-
ref: refElem,
|
|
101
|
+
ref: 'refElem',
|
|
62
102
|
class: 'vxe-gantt-view--chart-wrapper'
|
|
63
103
|
}, trVNs);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
mounted() {
|
|
107
|
+
const _vm = this;
|
|
108
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
109
|
+
const { internalData } = $xeGanttView;
|
|
110
|
+
const { elemStore } = internalData;
|
|
111
|
+
const prefix = 'main-chart-';
|
|
112
|
+
elemStore[`${prefix}wrapper`] = _vm.$refs.refElem;
|
|
113
|
+
},
|
|
114
|
+
destroyed() {
|
|
115
|
+
const _vm = this;
|
|
116
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
117
|
+
const { internalData } = $xeGanttView;
|
|
118
|
+
const { elemStore } = internalData;
|
|
119
|
+
const prefix = 'main-chart-';
|
|
120
|
+
elemStore[`${prefix}wrapper`] = null;
|
|
121
|
+
},
|
|
122
|
+
render(h) {
|
|
123
|
+
return this.renderVN(h);
|
|
76
124
|
}
|
|
77
125
|
});
|
|
@@ -1,36 +1,53 @@
|
|
|
1
|
-
import { h, inject, ref, onMounted, onUnmounted } from 'vue';
|
|
2
1
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
2
|
export default defineVxeComponent({
|
|
4
3
|
name: 'VxeGanttView',
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
inject: {
|
|
5
|
+
$xeGantt: {
|
|
6
|
+
default: null
|
|
7
|
+
},
|
|
8
|
+
$xeGanttView: {
|
|
9
|
+
default: null
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
props: {},
|
|
13
|
+
data() {
|
|
14
|
+
return {};
|
|
15
|
+
},
|
|
16
|
+
computed: Object.assign({}, {}),
|
|
17
|
+
methods: {
|
|
18
|
+
//
|
|
19
|
+
// Render
|
|
20
|
+
//
|
|
21
|
+
renderVN(h) {
|
|
22
|
+
const _vm = this;
|
|
23
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
24
|
+
const { reactData } = $xeGanttView;
|
|
25
|
+
const { tableColumn, headerGroups, viewCellWidth } = reactData;
|
|
14
26
|
return h('div', {
|
|
15
|
-
ref: refElem,
|
|
27
|
+
ref: 'refElem',
|
|
16
28
|
class: 'vxe-gantt-view--header-wrapper'
|
|
17
29
|
}, [
|
|
18
30
|
h('div', {
|
|
19
|
-
ref: refHeaderScroll,
|
|
31
|
+
ref: 'refHeaderScroll',
|
|
20
32
|
class: 'vxe-gantt-view--header-inner-wrapper',
|
|
21
|
-
|
|
33
|
+
on: {
|
|
34
|
+
scroll: $xeGanttView.triggerHeaderScrollEvent
|
|
35
|
+
}
|
|
22
36
|
}, [
|
|
23
37
|
h('div', {
|
|
24
|
-
ref: refHeaderXSpace,
|
|
38
|
+
ref: 'refHeaderXSpace',
|
|
25
39
|
class: 'vxe-body--x-space'
|
|
26
40
|
}),
|
|
27
41
|
h('table', {
|
|
28
|
-
ref: refHeaderTable,
|
|
42
|
+
ref: 'refHeaderTable',
|
|
29
43
|
class: 'vxe-gantt-view--header-table'
|
|
30
44
|
}, [
|
|
31
45
|
h('colgroup', {}, tableColumn.map((column, cIndex) => {
|
|
32
46
|
return h('col', {
|
|
33
|
-
key: cIndex
|
|
47
|
+
key: cIndex,
|
|
48
|
+
style: {
|
|
49
|
+
width: `${viewCellWidth}px`
|
|
50
|
+
}
|
|
34
51
|
});
|
|
35
52
|
})),
|
|
36
53
|
h('thead', {}, headerGroups.map((cols, rIndex) => {
|
|
@@ -40,31 +57,41 @@ export default defineVxeComponent({
|
|
|
40
57
|
return h('th', {
|
|
41
58
|
key: cIndex,
|
|
42
59
|
class: 'vxe-gantt-view--header-column',
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
attrs: {
|
|
61
|
+
colspan: column.children ? column.children.length : null,
|
|
62
|
+
title: `${column.field}`
|
|
63
|
+
}
|
|
45
64
|
}, column.title);
|
|
46
65
|
}));
|
|
47
66
|
}))
|
|
48
67
|
])
|
|
49
68
|
])
|
|
50
69
|
]);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
mounted() {
|
|
73
|
+
const _vm = this;
|
|
74
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
75
|
+
const { internalData } = $xeGanttView;
|
|
76
|
+
const { elemStore } = internalData;
|
|
77
|
+
const prefix = 'main-header-';
|
|
78
|
+
elemStore[`${prefix}wrapper`] = _vm.$refs.refElem;
|
|
79
|
+
elemStore[`${prefix}scroll`] = _vm.$refs.refHeaderScroll;
|
|
80
|
+
elemStore[`${prefix}table`] = _vm.$refs.refHeaderTable;
|
|
81
|
+
elemStore[`${prefix}xSpace`] = _vm.$refs.refHeaderXSpace;
|
|
82
|
+
},
|
|
83
|
+
destroyed() {
|
|
84
|
+
const _vm = this;
|
|
85
|
+
const $xeGanttView = _vm.$xeGanttView;
|
|
86
|
+
const { internalData } = $xeGanttView;
|
|
87
|
+
const { elemStore } = internalData;
|
|
88
|
+
const prefix = 'main-header-';
|
|
89
|
+
elemStore[`${prefix}wrapper`] = null;
|
|
90
|
+
elemStore[`${prefix}scroll`] = null;
|
|
91
|
+
elemStore[`${prefix}table`] = null;
|
|
92
|
+
elemStore[`${prefix}xSpace`] = null;
|
|
93
|
+
},
|
|
94
|
+
render(h) {
|
|
95
|
+
return this.renderVN(h);
|
|
69
96
|
}
|
|
70
97
|
});
|