vxe-gantt 3.4.2 → 3.4.3
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/LICENSE +21 -21
- package/README.md +53 -53
- package/es/gantt/src/gantt.js +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/gantt.js +1 -1
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/index.umd.js +50 -50
- package/lib/index.umd.min.js +1 -1
- package/lib/ui/index.js +1 -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 +88 -88
- package/packages/components.ts +22 -22
- package/packages/gantt/index.ts +32 -32
- package/packages/gantt/src/gantt-body.ts +323 -323
- package/packages/gantt/src/gantt-chart.ts +542 -542
- package/packages/gantt/src/gantt-footer.ts +73 -73
- package/packages/gantt/src/gantt-header.ts +162 -162
- package/packages/gantt/src/gantt-view.ts +1954 -1954
- package/packages/gantt/src/gantt.ts +2827 -2827
- package/packages/gantt/src/static.ts +35 -35
- package/packages/gantt/src/util.ts +47 -47
- package/packages/index.ts +8 -8
- package/packages/ui/index.ts +119 -119
- package/packages/ui/src/comp.ts +3 -3
- package/packages/ui/src/depend.ts +14 -14
- package/packages/ui/src/dom.ts +196 -196
- package/packages/ui/src/log.ts +8 -8
- package/packages/ui/src/utils.ts +67 -67
- package/packages/ui/src/vn.ts +13 -13
- package/styles/all.scss +3 -3
- package/styles/base.scss +2 -2
- package/styles/components/gantt-module/gantt-chart.scss +261 -261
- package/styles/components/gantt.scss +707 -707
- package/styles/helpers/baseMixin.scss +95 -95
- package/styles/helpers/baseVar.scss +3 -3
- package/styles/helpers/placement.scss +38 -38
- package/styles/theme/base.scss +14 -14
- package/styles/theme/dark.scss +8 -8
- package/styles/theme/light.scss +8 -8
- package/types/all.d.ts +16 -16
- package/types/index.d.ts +4 -4
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { CreateElement } from 'vue'
|
|
2
|
-
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
-
|
|
4
|
-
import type { VxeGanttViewConstructor, VxeGanttViewPrivateMethods, VxeGanttConstructor, VxeGanttPrivateMethods } from '../../../types'
|
|
5
|
-
|
|
6
|
-
const sourceType = 'gantt'
|
|
7
|
-
const viewType = 'footer'
|
|
8
|
-
|
|
9
|
-
export default defineVxeComponent({
|
|
10
|
-
name: 'VxeGanttViewHeader',
|
|
11
|
-
inject: {
|
|
12
|
-
$xeGantt: {
|
|
13
|
-
default: null
|
|
14
|
-
},
|
|
15
|
-
$xeGanttView: {
|
|
16
|
-
default: null
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
props: {},
|
|
20
|
-
computed: {
|
|
21
|
-
...({} as {
|
|
22
|
-
$xeGantt(): (VxeGanttConstructor & VxeGanttPrivateMethods)
|
|
23
|
-
$xeGanttView(): (VxeGanttViewConstructor & VxeGanttViewPrivateMethods)
|
|
24
|
-
})
|
|
25
|
-
},
|
|
26
|
-
methods: {
|
|
27
|
-
//
|
|
28
|
-
// Render
|
|
29
|
-
//
|
|
30
|
-
renderVN (h: CreateElement) {
|
|
31
|
-
const _vm = this
|
|
32
|
-
const $xeGantt = _vm.$xeGantt
|
|
33
|
-
|
|
34
|
-
return h('div', {
|
|
35
|
-
ref: 'refElem',
|
|
36
|
-
class: 'vxe-gantt-view--footer-wrapper'
|
|
37
|
-
}, [
|
|
38
|
-
h('div', {
|
|
39
|
-
ref: 'refHeaderScroll',
|
|
40
|
-
class: 'vxe-gantt-view--footer-inner-wrapper',
|
|
41
|
-
on: {
|
|
42
|
-
contextmenu (evnt: Event) {
|
|
43
|
-
$xeGantt.handleTaskFooterContextmenuEvent(evnt, { source: sourceType, type: viewType, $rowIndex: -1 })
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}, [])
|
|
47
|
-
])
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
mounted () {
|
|
51
|
-
const _vm = this
|
|
52
|
-
const $xeGanttView = _vm.$xeGanttView
|
|
53
|
-
const { internalData } = $xeGanttView
|
|
54
|
-
|
|
55
|
-
const { elemStore } = internalData
|
|
56
|
-
const prefix = 'main-footer-'
|
|
57
|
-
elemStore[`${prefix}wrapper`] = _vm.$refs.refElem as HTMLDivElement
|
|
58
|
-
elemStore[`${prefix}scroll`] = _vm.$refs.refHeaderScroll as HTMLDivElement
|
|
59
|
-
},
|
|
60
|
-
destroyed () {
|
|
61
|
-
const _vm = this
|
|
62
|
-
const $xeGanttView = _vm.$xeGanttView
|
|
63
|
-
const { internalData } = $xeGanttView
|
|
64
|
-
|
|
65
|
-
const { elemStore } = internalData
|
|
66
|
-
const prefix = 'main-headefooterr-'
|
|
67
|
-
elemStore[`${prefix}wrapper`] = null
|
|
68
|
-
elemStore[`${prefix}scroll`] = null
|
|
69
|
-
},
|
|
70
|
-
render (this: any, h) {
|
|
71
|
-
return this.renderVN(h)
|
|
72
|
-
}
|
|
73
|
-
})
|
|
1
|
+
import { CreateElement } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
+
|
|
4
|
+
import type { VxeGanttViewConstructor, VxeGanttViewPrivateMethods, VxeGanttConstructor, VxeGanttPrivateMethods } from '../../../types'
|
|
5
|
+
|
|
6
|
+
const sourceType = 'gantt'
|
|
7
|
+
const viewType = 'footer'
|
|
8
|
+
|
|
9
|
+
export default defineVxeComponent({
|
|
10
|
+
name: 'VxeGanttViewHeader',
|
|
11
|
+
inject: {
|
|
12
|
+
$xeGantt: {
|
|
13
|
+
default: null
|
|
14
|
+
},
|
|
15
|
+
$xeGanttView: {
|
|
16
|
+
default: null
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
props: {},
|
|
20
|
+
computed: {
|
|
21
|
+
...({} as {
|
|
22
|
+
$xeGantt(): (VxeGanttConstructor & VxeGanttPrivateMethods)
|
|
23
|
+
$xeGanttView(): (VxeGanttViewConstructor & VxeGanttViewPrivateMethods)
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
methods: {
|
|
27
|
+
//
|
|
28
|
+
// Render
|
|
29
|
+
//
|
|
30
|
+
renderVN (h: CreateElement) {
|
|
31
|
+
const _vm = this
|
|
32
|
+
const $xeGantt = _vm.$xeGantt
|
|
33
|
+
|
|
34
|
+
return h('div', {
|
|
35
|
+
ref: 'refElem',
|
|
36
|
+
class: 'vxe-gantt-view--footer-wrapper'
|
|
37
|
+
}, [
|
|
38
|
+
h('div', {
|
|
39
|
+
ref: 'refHeaderScroll',
|
|
40
|
+
class: 'vxe-gantt-view--footer-inner-wrapper',
|
|
41
|
+
on: {
|
|
42
|
+
contextmenu (evnt: Event) {
|
|
43
|
+
$xeGantt.handleTaskFooterContextmenuEvent(evnt, { source: sourceType, type: viewType, $rowIndex: -1 })
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, [])
|
|
47
|
+
])
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
mounted () {
|
|
51
|
+
const _vm = this
|
|
52
|
+
const $xeGanttView = _vm.$xeGanttView
|
|
53
|
+
const { internalData } = $xeGanttView
|
|
54
|
+
|
|
55
|
+
const { elemStore } = internalData
|
|
56
|
+
const prefix = 'main-footer-'
|
|
57
|
+
elemStore[`${prefix}wrapper`] = _vm.$refs.refElem as HTMLDivElement
|
|
58
|
+
elemStore[`${prefix}scroll`] = _vm.$refs.refHeaderScroll as HTMLDivElement
|
|
59
|
+
},
|
|
60
|
+
destroyed () {
|
|
61
|
+
const _vm = this
|
|
62
|
+
const $xeGanttView = _vm.$xeGanttView
|
|
63
|
+
const { internalData } = $xeGanttView
|
|
64
|
+
|
|
65
|
+
const { elemStore } = internalData
|
|
66
|
+
const prefix = 'main-headefooterr-'
|
|
67
|
+
elemStore[`${prefix}wrapper`] = null
|
|
68
|
+
elemStore[`${prefix}scroll`] = null
|
|
69
|
+
},
|
|
70
|
+
render (this: any, h) {
|
|
71
|
+
return this.renderVN(h)
|
|
72
|
+
}
|
|
73
|
+
})
|
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
import { CreateElement } from 'vue'
|
|
2
|
-
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
-
import { VxeUI } from '@vxe-ui/core'
|
|
4
|
-
import XEUtils from 'xe-utils'
|
|
5
|
-
|
|
6
|
-
import type { VxeComponentSlotType } from 'vxe-pc-ui'
|
|
7
|
-
import type { VxeGanttViewConstructor, VxeGanttViewPrivateMethods, VxeGanttConstructor, VxeGanttPrivateMethods } from '../../../types'
|
|
8
|
-
|
|
9
|
-
const { getI18n } = VxeUI
|
|
10
|
-
|
|
11
|
-
const sourceType = 'gantt'
|
|
12
|
-
const viewType = 'header'
|
|
13
|
-
|
|
14
|
-
export default defineVxeComponent({
|
|
15
|
-
name: 'VxeGanttViewHeader',
|
|
16
|
-
inject: {
|
|
17
|
-
$xeGantt: {
|
|
18
|
-
default: null
|
|
19
|
-
},
|
|
20
|
-
$xeGanttView: {
|
|
21
|
-
default: null
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
computed: {
|
|
25
|
-
...({} as {
|
|
26
|
-
$xeGantt(): (VxeGanttConstructor & VxeGanttPrivateMethods)
|
|
27
|
-
$xeGanttView(): (VxeGanttViewConstructor & VxeGanttViewPrivateMethods)
|
|
28
|
-
})
|
|
29
|
-
},
|
|
30
|
-
methods: {
|
|
31
|
-
//
|
|
32
|
-
// Render
|
|
33
|
-
//
|
|
34
|
-
renderVN (h: CreateElement) {
|
|
35
|
-
const _vm = this
|
|
36
|
-
const $xeGantt = _vm.$xeGantt
|
|
37
|
-
const $xeGanttView = _vm.$xeGanttView
|
|
38
|
-
const reactData = $xeGanttView.reactData
|
|
39
|
-
const internalData = $xeGanttView.internalData
|
|
40
|
-
|
|
41
|
-
const { headerGroups, viewCellWidth } = reactData
|
|
42
|
-
const { todayDateMaps, visibleColumn } = internalData
|
|
43
|
-
const taskViewOpts = $xeGantt.computeTaskViewOpts
|
|
44
|
-
const { showNowLine } = taskViewOpts
|
|
45
|
-
return h('div', {
|
|
46
|
-
ref: 'refElem',
|
|
47
|
-
class: 'vxe-gantt-view--header-wrapper'
|
|
48
|
-
}, [
|
|
49
|
-
h('div', {
|
|
50
|
-
ref: 'refHeaderScroll',
|
|
51
|
-
class: 'vxe-gantt-view--header-inner-wrapper',
|
|
52
|
-
on: {
|
|
53
|
-
scroll: $xeGanttView.triggerHeaderScrollEvent
|
|
54
|
-
}
|
|
55
|
-
}, [
|
|
56
|
-
h('div', {
|
|
57
|
-
ref: 'refHeaderXSpace',
|
|
58
|
-
class: 'vxe-body--x-space'
|
|
59
|
-
}),
|
|
60
|
-
h('table', {
|
|
61
|
-
ref: 'refHeaderTable',
|
|
62
|
-
class: 'vxe-gantt-view--header-table'
|
|
63
|
-
}, [
|
|
64
|
-
h('colgroup', {}, visibleColumn.map((column, cIndex) => {
|
|
65
|
-
return h('col', {
|
|
66
|
-
key: cIndex,
|
|
67
|
-
style: {
|
|
68
|
-
width: `${viewCellWidth}px`
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
})),
|
|
72
|
-
h('thead', {}, headerGroups.map(({ scaleItem, columns }, $rowIndex) => {
|
|
73
|
-
const { type, titleFormat, titleMethod, headerCellStyle, slots } = scaleItem
|
|
74
|
-
const titleSlot = slots ? slots.title : null
|
|
75
|
-
const isLast = $rowIndex === headerGroups.length - 1
|
|
76
|
-
const todayValue = isLast && showNowLine ? todayDateMaps[type] : null
|
|
77
|
-
return h('tr', {
|
|
78
|
-
key: $rowIndex
|
|
79
|
-
}, columns.map((column, cIndex) => {
|
|
80
|
-
const { field, childCount, dateObj } = column
|
|
81
|
-
let label = `${column.title}`
|
|
82
|
-
if (scaleItem.type === 'day') {
|
|
83
|
-
label = getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
|
|
84
|
-
} else {
|
|
85
|
-
if ($rowIndex) {
|
|
86
|
-
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj)
|
|
87
|
-
} else {
|
|
88
|
-
if (isLast && scaleItem.type === 'week') {
|
|
89
|
-
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj)
|
|
90
|
-
} else {
|
|
91
|
-
label = getI18n(`vxe.gantt.tFullFormat.${type}`, dateObj)
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
let cellVNs: string | VxeComponentSlotType[] = label
|
|
96
|
-
const ctParams = { source: sourceType, type: viewType, column, scaleObj: scaleItem, title: label, dateObj: dateObj, $rowIndex }
|
|
97
|
-
if (titleSlot) {
|
|
98
|
-
cellVNs = $xeGantt.callSlot(titleSlot, ctParams, h)
|
|
99
|
-
} else if (titleMethod) {
|
|
100
|
-
cellVNs = `${titleMethod(ctParams)}`
|
|
101
|
-
} else if (titleFormat) {
|
|
102
|
-
cellVNs = XEUtils.toDateString(dateObj.date, titleFormat)
|
|
103
|
-
}
|
|
104
|
-
let cellStys: Partial<CSSStyleDeclaration> | null = {}
|
|
105
|
-
if (headerCellStyle) {
|
|
106
|
-
if (XEUtils.isFunction(headerCellStyle)) {
|
|
107
|
-
cellStys = headerCellStyle(ctParams) || null
|
|
108
|
-
} else {
|
|
109
|
-
cellStys = headerCellStyle
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return h('th', {
|
|
113
|
-
key: cIndex,
|
|
114
|
-
class: ['vxe-gantt-view--header-column', {
|
|
115
|
-
'is--now': showNowLine && todayValue && todayValue === field
|
|
116
|
-
}],
|
|
117
|
-
attrs: {
|
|
118
|
-
colspan: childCount || null,
|
|
119
|
-
title: titleSlot ? null : label
|
|
120
|
-
},
|
|
121
|
-
style: cellStys || undefined,
|
|
122
|
-
on: {
|
|
123
|
-
contextmenu (evnt: Event) {
|
|
124
|
-
$xeGantt.handleTaskHeaderContextmenuEvent(evnt, ctParams)
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}, cellVNs)
|
|
128
|
-
}))
|
|
129
|
-
}))
|
|
130
|
-
])
|
|
131
|
-
])
|
|
132
|
-
])
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
mounted () {
|
|
136
|
-
const _vm = this
|
|
137
|
-
const $xeGanttView = _vm.$xeGanttView
|
|
138
|
-
const { internalData } = $xeGanttView
|
|
139
|
-
|
|
140
|
-
const { elemStore } = internalData
|
|
141
|
-
const prefix = 'main-header-'
|
|
142
|
-
elemStore[`${prefix}wrapper`] = _vm.$refs.refElem as HTMLDivElement
|
|
143
|
-
elemStore[`${prefix}scroll`] = _vm.$refs.refHeaderScroll as HTMLDivElement
|
|
144
|
-
elemStore[`${prefix}table`] = _vm.$refs.refHeaderTable as HTMLDivElement
|
|
145
|
-
elemStore[`${prefix}xSpace`] = _vm.$refs.refHeaderXSpace as HTMLDivElement
|
|
146
|
-
},
|
|
147
|
-
destroyed () {
|
|
148
|
-
const _vm = this
|
|
149
|
-
const $xeGanttView = _vm.$xeGanttView
|
|
150
|
-
const { internalData } = $xeGanttView
|
|
151
|
-
|
|
152
|
-
const { elemStore } = internalData
|
|
153
|
-
const prefix = 'main-header-'
|
|
154
|
-
elemStore[`${prefix}wrapper`] = null
|
|
155
|
-
elemStore[`${prefix}scroll`] = null
|
|
156
|
-
elemStore[`${prefix}table`] = null
|
|
157
|
-
elemStore[`${prefix}xSpace`] = null
|
|
158
|
-
},
|
|
159
|
-
render (this: any, h) {
|
|
160
|
-
return this.renderVN(h)
|
|
161
|
-
}
|
|
162
|
-
})
|
|
1
|
+
import { CreateElement } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
+
import { VxeUI } from '@vxe-ui/core'
|
|
4
|
+
import XEUtils from 'xe-utils'
|
|
5
|
+
|
|
6
|
+
import type { VxeComponentSlotType } from 'vxe-pc-ui'
|
|
7
|
+
import type { VxeGanttViewConstructor, VxeGanttViewPrivateMethods, VxeGanttConstructor, VxeGanttPrivateMethods } from '../../../types'
|
|
8
|
+
|
|
9
|
+
const { getI18n } = VxeUI
|
|
10
|
+
|
|
11
|
+
const sourceType = 'gantt'
|
|
12
|
+
const viewType = 'header'
|
|
13
|
+
|
|
14
|
+
export default defineVxeComponent({
|
|
15
|
+
name: 'VxeGanttViewHeader',
|
|
16
|
+
inject: {
|
|
17
|
+
$xeGantt: {
|
|
18
|
+
default: null
|
|
19
|
+
},
|
|
20
|
+
$xeGanttView: {
|
|
21
|
+
default: null
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
computed: {
|
|
25
|
+
...({} as {
|
|
26
|
+
$xeGantt(): (VxeGanttConstructor & VxeGanttPrivateMethods)
|
|
27
|
+
$xeGanttView(): (VxeGanttViewConstructor & VxeGanttViewPrivateMethods)
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
methods: {
|
|
31
|
+
//
|
|
32
|
+
// Render
|
|
33
|
+
//
|
|
34
|
+
renderVN (h: CreateElement) {
|
|
35
|
+
const _vm = this
|
|
36
|
+
const $xeGantt = _vm.$xeGantt
|
|
37
|
+
const $xeGanttView = _vm.$xeGanttView
|
|
38
|
+
const reactData = $xeGanttView.reactData
|
|
39
|
+
const internalData = $xeGanttView.internalData
|
|
40
|
+
|
|
41
|
+
const { headerGroups, viewCellWidth } = reactData
|
|
42
|
+
const { todayDateMaps, visibleColumn } = internalData
|
|
43
|
+
const taskViewOpts = $xeGantt.computeTaskViewOpts
|
|
44
|
+
const { showNowLine } = taskViewOpts
|
|
45
|
+
return h('div', {
|
|
46
|
+
ref: 'refElem',
|
|
47
|
+
class: 'vxe-gantt-view--header-wrapper'
|
|
48
|
+
}, [
|
|
49
|
+
h('div', {
|
|
50
|
+
ref: 'refHeaderScroll',
|
|
51
|
+
class: 'vxe-gantt-view--header-inner-wrapper',
|
|
52
|
+
on: {
|
|
53
|
+
scroll: $xeGanttView.triggerHeaderScrollEvent
|
|
54
|
+
}
|
|
55
|
+
}, [
|
|
56
|
+
h('div', {
|
|
57
|
+
ref: 'refHeaderXSpace',
|
|
58
|
+
class: 'vxe-body--x-space'
|
|
59
|
+
}),
|
|
60
|
+
h('table', {
|
|
61
|
+
ref: 'refHeaderTable',
|
|
62
|
+
class: 'vxe-gantt-view--header-table'
|
|
63
|
+
}, [
|
|
64
|
+
h('colgroup', {}, visibleColumn.map((column, cIndex) => {
|
|
65
|
+
return h('col', {
|
|
66
|
+
key: cIndex,
|
|
67
|
+
style: {
|
|
68
|
+
width: `${viewCellWidth}px`
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
})),
|
|
72
|
+
h('thead', {}, headerGroups.map(({ scaleItem, columns }, $rowIndex) => {
|
|
73
|
+
const { type, titleFormat, titleMethod, headerCellStyle, slots } = scaleItem
|
|
74
|
+
const titleSlot = slots ? slots.title : null
|
|
75
|
+
const isLast = $rowIndex === headerGroups.length - 1
|
|
76
|
+
const todayValue = isLast && showNowLine ? todayDateMaps[type] : null
|
|
77
|
+
return h('tr', {
|
|
78
|
+
key: $rowIndex
|
|
79
|
+
}, columns.map((column, cIndex) => {
|
|
80
|
+
const { field, childCount, dateObj } = column
|
|
81
|
+
let label = `${column.title}`
|
|
82
|
+
if (scaleItem.type === 'day') {
|
|
83
|
+
label = getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
|
|
84
|
+
} else {
|
|
85
|
+
if ($rowIndex) {
|
|
86
|
+
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj)
|
|
87
|
+
} else {
|
|
88
|
+
if (isLast && scaleItem.type === 'week') {
|
|
89
|
+
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj)
|
|
90
|
+
} else {
|
|
91
|
+
label = getI18n(`vxe.gantt.tFullFormat.${type}`, dateObj)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
let cellVNs: string | VxeComponentSlotType[] = label
|
|
96
|
+
const ctParams = { source: sourceType, type: viewType, column, scaleObj: scaleItem, title: label, dateObj: dateObj, $rowIndex }
|
|
97
|
+
if (titleSlot) {
|
|
98
|
+
cellVNs = $xeGantt.callSlot(titleSlot, ctParams, h)
|
|
99
|
+
} else if (titleMethod) {
|
|
100
|
+
cellVNs = `${titleMethod(ctParams)}`
|
|
101
|
+
} else if (titleFormat) {
|
|
102
|
+
cellVNs = XEUtils.toDateString(dateObj.date, titleFormat)
|
|
103
|
+
}
|
|
104
|
+
let cellStys: Partial<CSSStyleDeclaration> | null = {}
|
|
105
|
+
if (headerCellStyle) {
|
|
106
|
+
if (XEUtils.isFunction(headerCellStyle)) {
|
|
107
|
+
cellStys = headerCellStyle(ctParams) || null
|
|
108
|
+
} else {
|
|
109
|
+
cellStys = headerCellStyle
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return h('th', {
|
|
113
|
+
key: cIndex,
|
|
114
|
+
class: ['vxe-gantt-view--header-column', {
|
|
115
|
+
'is--now': showNowLine && todayValue && todayValue === field
|
|
116
|
+
}],
|
|
117
|
+
attrs: {
|
|
118
|
+
colspan: childCount || null,
|
|
119
|
+
title: titleSlot ? null : label
|
|
120
|
+
},
|
|
121
|
+
style: cellStys || undefined,
|
|
122
|
+
on: {
|
|
123
|
+
contextmenu (evnt: Event) {
|
|
124
|
+
$xeGantt.handleTaskHeaderContextmenuEvent(evnt, ctParams)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, cellVNs)
|
|
128
|
+
}))
|
|
129
|
+
}))
|
|
130
|
+
])
|
|
131
|
+
])
|
|
132
|
+
])
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
mounted () {
|
|
136
|
+
const _vm = this
|
|
137
|
+
const $xeGanttView = _vm.$xeGanttView
|
|
138
|
+
const { internalData } = $xeGanttView
|
|
139
|
+
|
|
140
|
+
const { elemStore } = internalData
|
|
141
|
+
const prefix = 'main-header-'
|
|
142
|
+
elemStore[`${prefix}wrapper`] = _vm.$refs.refElem as HTMLDivElement
|
|
143
|
+
elemStore[`${prefix}scroll`] = _vm.$refs.refHeaderScroll as HTMLDivElement
|
|
144
|
+
elemStore[`${prefix}table`] = _vm.$refs.refHeaderTable as HTMLDivElement
|
|
145
|
+
elemStore[`${prefix}xSpace`] = _vm.$refs.refHeaderXSpace as HTMLDivElement
|
|
146
|
+
},
|
|
147
|
+
destroyed () {
|
|
148
|
+
const _vm = this
|
|
149
|
+
const $xeGanttView = _vm.$xeGanttView
|
|
150
|
+
const { internalData } = $xeGanttView
|
|
151
|
+
|
|
152
|
+
const { elemStore } = internalData
|
|
153
|
+
const prefix = 'main-header-'
|
|
154
|
+
elemStore[`${prefix}wrapper`] = null
|
|
155
|
+
elemStore[`${prefix}scroll`] = null
|
|
156
|
+
elemStore[`${prefix}table`] = null
|
|
157
|
+
elemStore[`${prefix}xSpace`] = null
|
|
158
|
+
},
|
|
159
|
+
render (this: any, h) {
|
|
160
|
+
return this.renderVN(h)
|
|
161
|
+
}
|
|
162
|
+
})
|