vxe-gantt 3.0.0-beta.0 → 3.0.0-beta.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 +77 -36
- package/es/gantt/src/gantt-chart.js +87 -60
- package/es/gantt/src/gantt-view.js +63 -7
- package/es/gantt/src/gantt.js +27 -7
- package/es/gantt/style.css +37 -11
- package/es/gantt/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +7 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-gantt/style.css +37 -11
- package/es/vxe-gantt/style.min.css +1 -1
- package/lib/gantt/src/gantt-body.js +98 -40
- package/lib/gantt/src/gantt-body.min.js +1 -1
- package/lib/gantt/src/gantt-chart.js +95 -62
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +72 -6
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +27 -7
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/gantt/style/style.css +37 -11
- package/lib/gantt/style/style.min.css +1 -1
- package/lib/index.umd.js +296 -123
- 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 +13 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-gantt/style/style.css +37 -11
- package/lib/vxe-gantt/style/style.min.css +1 -1
- package/package.json +4 -4
- package/packages/gantt/src/gantt-body.ts +85 -39
- package/packages/gantt/src/gantt-chart.ts +99 -66
- package/packages/gantt/src/gantt-view.ts +65 -7
- package/packages/gantt/src/gantt.ts +27 -7
- package/packages/ui/index.ts +9 -1
- package/styles/components/gantt-module/gantt-chart.scss +1 -0
- package/styles/components/gantt.scss +43 -14
|
@@ -5,7 +5,7 @@ import XEUtils from 'xe-utils'
|
|
|
5
5
|
import { getCellRestHeight } from './util'
|
|
6
6
|
import { getStringValue } from '../../ui/src/utils'
|
|
7
7
|
|
|
8
|
-
import type {
|
|
8
|
+
import type { TableInternalData, TableReactData, VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from 'vxe-table'
|
|
9
9
|
import type { VxeGanttViewConstructor, VxeGanttViewPrivateMethods, VxeGanttConstructor, VxeGanttPrivateMethods } from '../../../types'
|
|
10
10
|
|
|
11
11
|
const { renderEmptyElement } = VxeUI
|
|
@@ -34,89 +34,122 @@ export default defineVxeComponent({
|
|
|
34
34
|
//
|
|
35
35
|
// Render
|
|
36
36
|
//
|
|
37
|
-
|
|
37
|
+
renderTaskBar (h: CreateElement, $xeTable: VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods, row: any, rowid: string, $rowIndex: number) {
|
|
38
38
|
const _vm = this
|
|
39
39
|
const $xeGantt = _vm.$xeGantt
|
|
40
|
-
const $xeGanttView = _vm.$xeGanttView
|
|
41
|
-
const $xeTable = $xeGanttView.internalData.xeTable
|
|
42
40
|
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
rowOpts = $xeTable.computeRowOpts
|
|
51
|
-
defaultRowHeight = $xeTable.computeDefaultRowHeight
|
|
52
|
-
}
|
|
41
|
+
const tableProps = $xeTable
|
|
42
|
+
const { treeConfig } = tableProps
|
|
43
|
+
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
44
|
+
const { fullAllDataRowIdData } = tableInternalData
|
|
45
|
+
const cellOpts = $xeTable.computeCellOpts
|
|
46
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
47
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight
|
|
53
48
|
|
|
54
|
-
const { reactData } = $xeGanttView
|
|
55
|
-
const { tableData } = reactData
|
|
56
49
|
const titleField = $xeGantt.computeTitleField
|
|
57
50
|
const progressField = $xeGantt.computeProgressField
|
|
58
51
|
const taskBarOpts = $xeGantt.computeTaskBarOpts
|
|
59
52
|
const { showProgress, showContent, contentMethod, barStyle } = taskBarOpts
|
|
60
53
|
const { round } = barStyle || {}
|
|
61
54
|
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
56
|
+
const cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight)
|
|
57
|
+
let title = getStringValue(XEUtils.get(row, titleField))
|
|
58
|
+
const progressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(row, progressField)))) : 0
|
|
59
|
+
|
|
60
|
+
if (contentMethod) {
|
|
61
|
+
title = getStringValue(contentMethod({ row, title }))
|
|
62
|
+
}
|
|
63
|
+
return h('div', {
|
|
64
|
+
key: treeConfig ? rowid : $rowIndex,
|
|
65
|
+
attrs: {
|
|
66
|
+
rowid
|
|
67
|
+
},
|
|
68
|
+
class: ['vxe-gantt-view--chart-row', {
|
|
69
|
+
'is--round': round
|
|
70
|
+
}],
|
|
71
|
+
style: {
|
|
72
|
+
height: `${cellHeight}px`
|
|
71
73
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
}, [
|
|
75
|
+
h('div', {
|
|
76
|
+
class: 'vxe-gantt-view--chart-bar',
|
|
77
|
+
attrs: {
|
|
78
|
+
rowid
|
|
79
|
+
},
|
|
80
|
+
on: {
|
|
81
|
+
click (evnt: MouseEvent) {
|
|
82
|
+
$xeGantt.handleTaskBarClickEvent(evnt, { row })
|
|
77
83
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}],
|
|
81
|
-
style: {
|
|
82
|
-
height: `${cellHeight}px`
|
|
84
|
+
dblclick (evnt: MouseEvent) {
|
|
85
|
+
$xeGantt.handleTaskBarDblclickEvent(evnt, { row })
|
|
83
86
|
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
click (evnt: MouseEvent) {
|
|
92
|
-
$xeGantt.handleTaskBarClickEvent(evnt, { row })
|
|
93
|
-
},
|
|
94
|
-
dblclick (evnt: MouseEvent) {
|
|
95
|
-
$xeGantt.handleTaskBarDblclickEvent(evnt, { row })
|
|
96
|
-
}
|
|
87
|
+
}
|
|
88
|
+
}, [
|
|
89
|
+
showProgress
|
|
90
|
+
? h('div', {
|
|
91
|
+
class: 'vxe-gantt-view--chart-progress',
|
|
92
|
+
style: {
|
|
93
|
+
width: `${progressValue || 0}%`
|
|
97
94
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
95
|
+
})
|
|
96
|
+
: renderEmptyElement($xeGantt),
|
|
97
|
+
showContent
|
|
98
|
+
? h('div', {
|
|
99
|
+
class: 'vxe-gantt-view--chart-content'
|
|
100
|
+
}, title)
|
|
101
|
+
: renderEmptyElement($xeGantt)
|
|
102
|
+
])
|
|
103
|
+
])
|
|
104
|
+
},
|
|
105
|
+
renderRows (h: CreateElement, $xeTable: VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods, tableData: any[]) {
|
|
106
|
+
const _vm = this
|
|
107
|
+
const $xeGanttView = _vm.$xeGanttView
|
|
108
|
+
const { reactData } = $xeGanttView
|
|
109
|
+
|
|
110
|
+
const tableProps = $xeTable
|
|
111
|
+
const { treeConfig } = tableProps
|
|
112
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
113
|
+
const { treeExpandedFlag } = tableReactData
|
|
114
|
+
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
115
|
+
const { treeExpandedMaps } = tableInternalData
|
|
116
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
117
|
+
const { transform } = treeOpts
|
|
118
|
+
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
119
|
+
|
|
120
|
+
const { scrollYLoad } = reactData
|
|
121
|
+
|
|
122
|
+
const trVNs: VNode[] = []
|
|
123
|
+
tableData.forEach((row, $rowIndex) => {
|
|
124
|
+
const rowid = $xeTable ? $xeTable.getRowid(row) : ''
|
|
125
|
+
trVNs.push(_vm.renderTaskBar(h, $xeTable, row, rowid, $rowIndex))
|
|
126
|
+
let isExpandTree = false
|
|
127
|
+
let rowChildren: any[] = []
|
|
128
|
+
|
|
129
|
+
if (treeConfig && !scrollYLoad && !transform) {
|
|
130
|
+
rowChildren = row[childrenField]
|
|
131
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid]
|
|
132
|
+
}
|
|
133
|
+
// 如果是树形表格
|
|
134
|
+
if (isExpandTree) {
|
|
135
|
+
trVNs.push(..._vm.renderRows(h, $xeTable, rowChildren))
|
|
136
|
+
}
|
|
115
137
|
})
|
|
138
|
+
return trVNs
|
|
139
|
+
},
|
|
140
|
+
renderVN (h: CreateElement): VNode {
|
|
141
|
+
const _vm = this
|
|
142
|
+
const $xeGanttView = _vm.$xeGanttView
|
|
143
|
+
const { reactData } = $xeGanttView
|
|
144
|
+
|
|
145
|
+
const $xeTable = $xeGanttView.internalData.xeTable
|
|
146
|
+
|
|
147
|
+
const { tableData } = reactData
|
|
148
|
+
|
|
116
149
|
return h('div', {
|
|
117
150
|
ref: 'refElem',
|
|
118
151
|
class: 'vxe-gantt-view--chart-wrapper'
|
|
119
|
-
},
|
|
152
|
+
}, $xeTable ? _vm.renderRows(h, $xeTable, tableData) : [])
|
|
120
153
|
}
|
|
121
154
|
},
|
|
122
155
|
mounted () {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VNode, CreateElement } from 'vue'
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import { VxeUI } from '@vxe-ui/core'
|
|
4
|
-
import { setScrollTop, setScrollLeft } from '../../ui/src/dom'
|
|
4
|
+
import { setScrollTop, setScrollLeft, removeClass, addClass } from '../../ui/src/dom'
|
|
5
5
|
import { getRefElem } from './util'
|
|
6
6
|
import XEUtils from 'xe-utils'
|
|
7
7
|
import GanttViewHeaderComponent from './gantt-header'
|
|
@@ -49,6 +49,8 @@ function handleParseColumn ($xeGanttView: VxeGanttViewConstructor & VxeGanttView
|
|
|
49
49
|
const reactData = $xeGanttView.reactData
|
|
50
50
|
const internalData = $xeGanttView.internalData
|
|
51
51
|
|
|
52
|
+
const ganttProps = $xeGantt
|
|
53
|
+
const { treeConfig } = ganttProps
|
|
52
54
|
const { minViewDate, maxViewDate } = reactData
|
|
53
55
|
const taskViewOpts = $xeGantt.computeTaskViewOpts
|
|
54
56
|
const fullCols: VxeGanttPropTypes.Column[] = []
|
|
@@ -101,9 +103,13 @@ function handleParseColumn ($xeGanttView: VxeGanttViewConstructor & VxeGanttView
|
|
|
101
103
|
const startField = $xeGantt.computeStartField
|
|
102
104
|
const endField = $xeGantt.computeEndField
|
|
103
105
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
104
|
-
const { afterFullData } = tableInternalData
|
|
106
|
+
const { afterFullData, afterTreeFullData } = tableInternalData
|
|
107
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
108
|
+
const { transform } = treeOpts
|
|
109
|
+
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
110
|
+
|
|
105
111
|
const ctMaps: Record<string, VxeGanttDefines.RowCacheItem> = {}
|
|
106
|
-
|
|
112
|
+
const handleParseRender = (row: any) => {
|
|
107
113
|
const rowid = $xeTable.getRowid(row)
|
|
108
114
|
const startValue = XEUtils.get(row, startField)
|
|
109
115
|
const endValue = XEUtils.get(row, endField)
|
|
@@ -119,7 +125,13 @@ function handleParseColumn ($xeGanttView: VxeGanttViewConstructor & VxeGanttView
|
|
|
119
125
|
oWidthSize
|
|
120
126
|
}
|
|
121
127
|
}
|
|
122
|
-
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (treeConfig) {
|
|
131
|
+
XEUtils.eachTree(afterTreeFullData, handleParseRender, { children: transform ? treeOpts.mapChildrenField : childrenField })
|
|
132
|
+
} else {
|
|
133
|
+
afterFullData.forEach(handleParseRender)
|
|
134
|
+
}
|
|
123
135
|
internalData.chartMaps = ctMaps
|
|
124
136
|
}
|
|
125
137
|
}
|
|
@@ -135,6 +147,8 @@ function handleUpdateData ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewP
|
|
|
135
147
|
const reactData = $xeGanttView.reactData
|
|
136
148
|
const internalData = $xeGanttView.internalData
|
|
137
149
|
|
|
150
|
+
const ganttProps = $xeGantt
|
|
151
|
+
const { treeConfig } = ganttProps
|
|
138
152
|
const $xeTable = internalData.xeTable
|
|
139
153
|
const sdMaps: Record<string, any> = {}
|
|
140
154
|
const edMaps: Record<string, any> = {}
|
|
@@ -144,8 +158,12 @@ function handleUpdateData ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewP
|
|
|
144
158
|
const startField = $xeGantt.computeStartField
|
|
145
159
|
const endField = $xeGantt.computeEndField
|
|
146
160
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
147
|
-
const { afterFullData } = tableInternalData
|
|
148
|
-
|
|
161
|
+
const { afterFullData, afterTreeFullData } = tableInternalData
|
|
162
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
163
|
+
const { transform } = treeOpts
|
|
164
|
+
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
165
|
+
|
|
166
|
+
const handleMinMaxData = (row: any) => {
|
|
149
167
|
const startValue = XEUtils.get(row, startField)
|
|
150
168
|
const endValue = XEUtils.get(row, endField)
|
|
151
169
|
if (startValue && endValue) {
|
|
@@ -158,7 +176,13 @@ function handleUpdateData ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewP
|
|
|
158
176
|
maxDate = endDate
|
|
159
177
|
}
|
|
160
178
|
}
|
|
161
|
-
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (treeConfig) {
|
|
182
|
+
XEUtils.eachTree(afterTreeFullData, handleMinMaxData, { children: transform ? treeOpts.mapChildrenField : childrenField })
|
|
183
|
+
} else {
|
|
184
|
+
afterFullData.forEach(handleMinMaxData)
|
|
185
|
+
}
|
|
162
186
|
}
|
|
163
187
|
reactData.minViewDate = minDate
|
|
164
188
|
reactData.maxViewDate = maxDate
|
|
@@ -333,6 +357,7 @@ function updateStyle ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivat
|
|
|
333
357
|
function handleLazyRecalculate ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods) {
|
|
334
358
|
calcScrollbar($xeGanttView)
|
|
335
359
|
updateStyle($xeGanttView)
|
|
360
|
+
updateChart($xeGanttView)
|
|
336
361
|
return $xeGanttView.$nextTick()
|
|
337
362
|
}
|
|
338
363
|
|
|
@@ -619,6 +644,39 @@ export default defineVxeComponent({
|
|
|
619
644
|
|
|
620
645
|
return handleLazyRecalculate($xeGanttView)
|
|
621
646
|
},
|
|
647
|
+
handleUpdateCurrentRow (row: any) {
|
|
648
|
+
const $xeGanttView = this
|
|
649
|
+
const internalData = $xeGanttView.internalData
|
|
650
|
+
|
|
651
|
+
const $xeTable = internalData.xeTable
|
|
652
|
+
const el = $xeGanttView.$refs.refElem as HTMLDivElement
|
|
653
|
+
if ($xeTable && el) {
|
|
654
|
+
if (row) {
|
|
655
|
+
const tableProps = $xeTable
|
|
656
|
+
const { highlightCurrentRow } = tableProps
|
|
657
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
658
|
+
if (rowOpts.isCurrent || highlightCurrentRow) {
|
|
659
|
+
XEUtils.arrayEach(el.querySelectorAll(`[rowid="${$xeTable.getRowid(row)}"]`), elem => addClass(elem, 'row--current'))
|
|
660
|
+
}
|
|
661
|
+
} else {
|
|
662
|
+
XEUtils.arrayEach(el.querySelectorAll('.row--current'), elem => removeClass(elem, 'row--current'))
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
handleUpdateHoverRow (row: any) {
|
|
667
|
+
const $xeGanttView = this
|
|
668
|
+
const internalData = $xeGanttView.internalData
|
|
669
|
+
|
|
670
|
+
const $xeTable = internalData.xeTable
|
|
671
|
+
const el = $xeGanttView.$refs.refElem as HTMLDivElement
|
|
672
|
+
if ($xeTable && el) {
|
|
673
|
+
if (row) {
|
|
674
|
+
XEUtils.arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${$xeTable.getRowid(row)}"]`), elem => addClass(elem, 'row--hover'))
|
|
675
|
+
} else {
|
|
676
|
+
XEUtils.arrayEach(el.querySelectorAll('.vxe-body--row.row--hover'), elem => removeClass(elem, 'row--hover'))
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
},
|
|
622
680
|
triggerHeaderScrollEvent (evnt: Event) {
|
|
623
681
|
const $xeGanttView = this
|
|
624
682
|
const internalData = $xeGanttView.internalData
|
|
@@ -307,7 +307,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
307
307
|
const proxyOpts = $xeGantt.computeProxyOpts
|
|
308
308
|
const pagerOpts = $xeGantt.computePagerOpts
|
|
309
309
|
const isLoading = $xeGantt.computeIsLoading
|
|
310
|
-
const tProps = Object.assign({}, tableExtendProps
|
|
310
|
+
const tProps = Object.assign({}, tableExtendProps, {
|
|
311
|
+
showOverflow: true,
|
|
312
|
+
showHeaderOverflow: true,
|
|
313
|
+
showFooterOverflow: true,
|
|
314
|
+
showFooter: false
|
|
315
|
+
})
|
|
311
316
|
if (isZMax) {
|
|
312
317
|
if (tableExtendProps.maxHeight) {
|
|
313
318
|
tProps.maxHeight = '100%'
|
|
@@ -1495,7 +1500,22 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1495
1500
|
},
|
|
1496
1501
|
handleTaskCellClickEvent (evnt: MouseEvent, params: VxeGanttDefines.TaskCellClickParams) {
|
|
1497
1502
|
const $xeGantt = this
|
|
1503
|
+
const $xeTable = $xeGantt.$refs.refTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
1498
1504
|
|
|
1505
|
+
if ($xeTable) {
|
|
1506
|
+
const tableProps = $xeTable
|
|
1507
|
+
const { highlightCurrentRow } = tableProps
|
|
1508
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
1509
|
+
const { row } = params
|
|
1510
|
+
// 如果是当前行
|
|
1511
|
+
if (rowOpts.isCurrent || highlightCurrentRow) {
|
|
1512
|
+
$xeTable.triggerCurrentRowEvent(evnt, Object.assign({
|
|
1513
|
+
$table: $xeTable,
|
|
1514
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
1515
|
+
$rowIndex: $xeTable.getVMRowIndex(row)
|
|
1516
|
+
}, params))
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1499
1519
|
$xeGantt.dispatchEvent('task-cell-click', params, evnt)
|
|
1500
1520
|
},
|
|
1501
1521
|
handleTaskCellDblclickEvent (evnt: MouseEvent, params: VxeGanttDefines.TaskCellClickParams) {
|
|
@@ -1706,10 +1726,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1706
1726
|
|
|
1707
1727
|
const { toolbarConfig } = props
|
|
1708
1728
|
const toolbarSlot = slots.toolbar
|
|
1709
|
-
const hasToolbar = !!(toolbarSlot || isEnableConf(toolbarConfig) || toolbar)
|
|
1710
1729
|
const toolbarOpts = $xeGantt.computeToolbarOpts
|
|
1711
1730
|
|
|
1712
|
-
if (
|
|
1731
|
+
if ((toolbarConfig && isEnableConf(toolbarOpts)) || toolbarSlot) {
|
|
1713
1732
|
return h('div', {
|
|
1714
1733
|
key: 'toolbar',
|
|
1715
1734
|
ref: 'refToolbarWrapper',
|
|
@@ -1854,20 +1873,21 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1854
1873
|
if (!enabled) {
|
|
1855
1874
|
return renderEmptyElement($xeGantt)
|
|
1856
1875
|
}
|
|
1876
|
+
const isResize = resize && showLeftView && showRightView
|
|
1857
1877
|
const ons: {
|
|
1858
1878
|
mousedown?: any
|
|
1859
1879
|
} = {}
|
|
1860
|
-
if (
|
|
1880
|
+
if (isResize) {
|
|
1861
1881
|
ons.mousedown = $xeGantt.dragSplitEvent
|
|
1862
1882
|
}
|
|
1863
1883
|
return h('div', {
|
|
1864
1884
|
class: ['vxe-gantt--view-split-bar', {
|
|
1865
|
-
'is--resize':
|
|
1866
|
-
on: ons
|
|
1885
|
+
'is--resize': isResize
|
|
1867
1886
|
}]
|
|
1868
1887
|
}, [
|
|
1869
1888
|
h('div', {
|
|
1870
|
-
class: 'vxe-gantt--view-split-bar-handle'
|
|
1889
|
+
class: 'vxe-gantt--view-split-bar-handle',
|
|
1890
|
+
on: ons
|
|
1871
1891
|
}),
|
|
1872
1892
|
showCollapseTableButton || showCollapseTaskButton
|
|
1873
1893
|
? h('div', {
|
package/packages/ui/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core'
|
|
2
|
+
import { errLog } from './src/log'
|
|
2
3
|
|
|
3
|
-
const { setConfig, setIcon } = VxeUI
|
|
4
|
+
const { setConfig, setIcon, checkVersion } = VxeUI
|
|
4
5
|
|
|
5
6
|
VxeUI.ganttVersion = process.env.VUE_APP_VXE_VERSION as string
|
|
6
7
|
|
|
@@ -61,4 +62,11 @@ setIcon({
|
|
|
61
62
|
GANTT_VIEW_RIGHT_CLOSE: iconPrefix + 'arrow-left'
|
|
62
63
|
})
|
|
63
64
|
|
|
65
|
+
if (!checkVersion(VxeUI.tableVersion, 3, 18)) {
|
|
66
|
+
errLog('vxe.error.errorVersion', [`vxe-table@${VxeUI.tableVersion || '?'}`, 'vxe-table v3.18+'])
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
VxeUI
|
|
71
|
+
}
|
|
64
72
|
export default VxeUI
|
|
@@ -130,13 +130,6 @@
|
|
|
130
130
|
border: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
131
131
|
}
|
|
132
132
|
.vxe-gantt {
|
|
133
|
-
&.border--default,
|
|
134
|
-
&.border--full,
|
|
135
|
-
&.border--outer {
|
|
136
|
-
.vxe-gantt-view--header-wrapper {
|
|
137
|
-
background-color: var(--vxe-ui-table-header-background-color);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
133
|
&.border--full {
|
|
141
134
|
.vxe-gantt-view--header-column,
|
|
142
135
|
.vxe-gantt-view--body-column,
|
|
@@ -203,7 +196,6 @@
|
|
|
203
196
|
}
|
|
204
197
|
}
|
|
205
198
|
}
|
|
206
|
-
|
|
207
199
|
&.border--default,
|
|
208
200
|
&.border--full {
|
|
209
201
|
.vxe-gantt-view--scroll-y-top-corner {
|
|
@@ -256,6 +248,27 @@
|
|
|
256
248
|
}
|
|
257
249
|
}
|
|
258
250
|
}
|
|
251
|
+
&.border--default,
|
|
252
|
+
&.border--inner {
|
|
253
|
+
.vxe-gantt-view--header-column,
|
|
254
|
+
.vxe-gantt-view--body-column,
|
|
255
|
+
.vxe-gantt-view--footer-column {
|
|
256
|
+
background-image: linear-gradient(var(--vxe-ui-table-border-color), var(--vxe-ui-table-border-color));
|
|
257
|
+
background-repeat: no-repeat;
|
|
258
|
+
background-size: 100% var(--vxe-ui-table-border-width);
|
|
259
|
+
background-position: right bottom;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
&.border--inner {
|
|
263
|
+
.vxe-gantt--border-line {
|
|
264
|
+
border-width: 0 0 1px 0;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
&.border--none {
|
|
268
|
+
.vxe-gantt--border-line {
|
|
269
|
+
display: none;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
259
272
|
}
|
|
260
273
|
|
|
261
274
|
/*分割条*/
|
|
@@ -518,9 +531,6 @@
|
|
|
518
531
|
float: left;
|
|
519
532
|
}
|
|
520
533
|
}
|
|
521
|
-
.vxe-gantt-view--header-table {
|
|
522
|
-
height: 100%;
|
|
523
|
-
}
|
|
524
534
|
.vxe-gantt-view--header-table,
|
|
525
535
|
.vxe-gantt-view--body-table {
|
|
526
536
|
border: 0;
|
|
@@ -531,6 +541,9 @@
|
|
|
531
541
|
width: var(--vxe-ui-gantt-view-default-cell-width);
|
|
532
542
|
}
|
|
533
543
|
}
|
|
544
|
+
.vxe-gantt-view--header-wrapper {
|
|
545
|
+
background-color: var(--vxe-ui-table-header-background-color);
|
|
546
|
+
}
|
|
534
547
|
.vxe-gantt-view--header-wrapper,
|
|
535
548
|
.vxe-gantt-view--body-wrapper {
|
|
536
549
|
overflow: hidden;
|
|
@@ -556,9 +569,6 @@
|
|
|
556
569
|
text-align: center;
|
|
557
570
|
font-size: 1em;
|
|
558
571
|
}
|
|
559
|
-
.vxe-gantt-view--body-column {
|
|
560
|
-
height: 48px;
|
|
561
|
-
}
|
|
562
572
|
.vxe-gantt-view--header-column,
|
|
563
573
|
.vxe-gantt-view--body-column,
|
|
564
574
|
.vxe-gantt-view--footer-column {
|
|
@@ -568,6 +578,25 @@
|
|
|
568
578
|
white-space: nowrap;
|
|
569
579
|
}
|
|
570
580
|
|
|
581
|
+
// 行高亮
|
|
582
|
+
.vxe-gantt-view--body-row {
|
|
583
|
+
&.row--stripe {
|
|
584
|
+
background-color: var(--vxe-ui-table-row-striped-background-color);
|
|
585
|
+
}
|
|
586
|
+
&.row--current {
|
|
587
|
+
background-color: var(--vxe-ui-table-row-current-background-color);
|
|
588
|
+
}
|
|
589
|
+
&.row--hover {
|
|
590
|
+
background-color: var(--vxe-ui-table-row-hover-background-color);
|
|
591
|
+
&.row--stripe {
|
|
592
|
+
background-color: var(--vxe-ui-table-row-hover-striped-background-color);
|
|
593
|
+
}
|
|
594
|
+
&.row--current {
|
|
595
|
+
background-color: var(--vxe-ui-table-row-hover-current-background-color);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
571
600
|
.vxe-gantt-view {
|
|
572
601
|
&.mode--day {
|
|
573
602
|
.vxe-gantt-view--header-column {
|