vxe-gantt 3.2.6 → 3.3.0
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-chart.js +164 -145
- package/es/gantt/src/gantt-view.js +64 -9
- package/es/gantt/style.css +41 -12
- 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 +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-gantt/style.css +41 -12
- package/es/vxe-gantt/style.min.css +1 -1
- package/lib/gantt/src/gantt-chart.js +152 -134
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +68 -9
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/style/style.css +41 -12
- package/lib/gantt/style/style.min.css +1 -1
- package/lib/index.umd.js +222 -147
- 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 +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/lib/vxe-gantt/style/style.css +41 -12
- package/lib/vxe-gantt/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/gantt/src/gantt-chart.ts +164 -139
- package/packages/gantt/src/gantt-view.ts +65 -9
- package/styles/components/gantt-module/gantt-chart.scss +67 -11
- package/styles/theme/base.scss +1 -1
|
@@ -49,14 +49,15 @@ export default defineVxeComponent({
|
|
|
49
49
|
const cellOpts = $xeTable.computeCellOpts
|
|
50
50
|
const rowOpts = $xeTable.computeRowOpts
|
|
51
51
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight
|
|
52
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
53
|
+
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
52
54
|
|
|
53
55
|
const ganttProps = $xeGantt
|
|
54
56
|
const ganttReactData = $xeGantt.reactData
|
|
55
|
-
const ganttInternalData = $xeGantt.internalData
|
|
56
57
|
const ganttSlots = $xeGantt.$scopedSlots
|
|
57
58
|
const taskBarSlot = ganttSlots.taskBar || ganttSlots['task-bar']
|
|
58
59
|
|
|
59
|
-
const { taskBarMilestoneConfig, taskBarSubviewConfig } = ganttProps
|
|
60
|
+
const { treeConfig, taskBarMilestoneConfig, taskBarSubviewConfig } = ganttProps
|
|
60
61
|
const { activeLink, activeBarRowid } = ganttReactData
|
|
61
62
|
const titleField = $xeGantt.computeTitleField
|
|
62
63
|
const progressField = $xeGantt.computeProgressField
|
|
@@ -77,8 +78,6 @@ export default defineVxeComponent({
|
|
|
77
78
|
let title = getStringValue(XEUtils.get(row, titleField))
|
|
78
79
|
const progressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(row, progressField)))) : 0
|
|
79
80
|
const renderTaskType = getTaskType(XEUtils.get(row, typeField))
|
|
80
|
-
const isMilestone = !!(hasEnableConf(taskBarMilestoneConfig, taskBarMilestoneOpts) && hasMilestoneTask(renderTaskType))
|
|
81
|
-
const isSubview = !!(hasEnableConf(taskBarSubviewConfig, taskBarSubviewOpts) && hasSubviewTask(renderTaskType))
|
|
82
81
|
|
|
83
82
|
const vbStyle: VxeComponentStyleType = {}
|
|
84
83
|
const vpStyle: VxeComponentStyleType = {
|
|
@@ -94,10 +93,6 @@ export default defineVxeComponent({
|
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
|
|
97
|
-
if (contentMethod) {
|
|
98
|
-
title = getStringValue(contentMethod({ row, title, scaleType: scaleUnit }))
|
|
99
|
-
}
|
|
100
|
-
|
|
101
96
|
const ctParams = {
|
|
102
97
|
$gantt: $xeGantt,
|
|
103
98
|
source: sourceType,
|
|
@@ -108,89 +103,97 @@ export default defineVxeComponent({
|
|
|
108
103
|
rowIndex,
|
|
109
104
|
_rowIndex
|
|
110
105
|
}
|
|
111
|
-
const ctOns: {
|
|
112
|
-
mouseover?: any
|
|
113
|
-
mouseleave?: any
|
|
114
|
-
} = {}
|
|
115
|
-
if (showTooltip) {
|
|
116
|
-
ctOns.mouseover = (evnt: MouseEvent) => {
|
|
117
|
-
const { dragBarRow } = ganttInternalData
|
|
118
|
-
const ttParams = Object.assign({ $event: evnt }, ctParams)
|
|
119
|
-
if (!dragBarRow) {
|
|
120
|
-
$xeGantt.triggerTaskBarTooltipEvent(evnt, ttParams)
|
|
121
|
-
}
|
|
122
|
-
$xeGantt.dispatchEvent('task-bar-mouseenter', ttParams, evnt)
|
|
123
|
-
}
|
|
124
|
-
ctOns.mouseleave = (evnt: MouseEvent) => {
|
|
125
|
-
const { dragBarRow } = ganttInternalData
|
|
126
|
-
const ttParams = Object.assign({ $event: evnt }, ctParams)
|
|
127
|
-
if (!dragBarRow) {
|
|
128
|
-
$xeGantt.handleTaskBarTooltipLeaveEvent(evnt, ttParams)
|
|
129
|
-
}
|
|
130
|
-
$xeGantt.dispatchEvent('task-bar-mouseleave', ttParams, evnt)
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
106
|
|
|
134
107
|
let cbVNs: VNode[] = []
|
|
135
108
|
if ($xeGantt.renderGanttTaskBarContent) {
|
|
136
109
|
cbVNs = $xeGantt.renderGanttTaskBarContent(h, ctParams, {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
vpStyle,
|
|
141
|
-
rowid,
|
|
142
|
-
ctOns
|
|
110
|
+
$gantt: $xeGantt,
|
|
111
|
+
$table: $xeTable,
|
|
112
|
+
rowid
|
|
143
113
|
})
|
|
144
|
-
} else if (taskBarSlot) {
|
|
145
|
-
cbVNs.push(
|
|
146
|
-
h('div', {
|
|
147
|
-
key: 'cbc',
|
|
148
|
-
class: 'vxe-gantt-view--chart-custom-bar-content-wrapper',
|
|
149
|
-
on: ctOns
|
|
150
|
-
}, $xeGantt.callSlot(taskBarSlot, barParams, h))
|
|
151
|
-
)
|
|
152
114
|
} else {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
115
|
+
const isMilestone = !!(hasEnableConf(taskBarMilestoneConfig, taskBarMilestoneOpts) && hasMilestoneTask(renderTaskType))
|
|
116
|
+
const isSubview = !!(hasEnableConf(taskBarSubviewConfig, taskBarSubviewOpts) && hasSubviewTask(renderTaskType))
|
|
117
|
+
|
|
118
|
+
if (contentMethod) {
|
|
119
|
+
title = getStringValue(contentMethod({ row, title, scaleType: scaleUnit }))
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const ctOns: {
|
|
123
|
+
mouseover?: any
|
|
124
|
+
mouseleave?: any
|
|
125
|
+
} = {}
|
|
126
|
+
if (showTooltip) {
|
|
127
|
+
ctOns.mouseover = (evnt: MouseEvent) => {
|
|
128
|
+
const ttParams = Object.assign({ $event: evnt }, ctParams)
|
|
129
|
+
$xeGantt.dispatchEvent('task-bar-mouseenter', ttParams, evnt)
|
|
130
|
+
}
|
|
131
|
+
ctOns.mouseleave = (evnt: MouseEvent) => {
|
|
132
|
+
const ttParams = Object.assign({ $event: evnt }, ctParams)
|
|
133
|
+
$xeGantt.dispatchEvent('task-bar-mouseleave', ttParams, evnt)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (taskBarSlot) {
|
|
138
|
+
cbVNs.push(
|
|
139
|
+
h('div', {
|
|
140
|
+
key: 'cbc',
|
|
141
|
+
class: 'vxe-gantt-view--chart-custom-bar-content-wrapper',
|
|
142
|
+
on: ctOns
|
|
143
|
+
}, $xeGantt.callSlot(taskBarSlot, barParams, h))
|
|
144
|
+
)
|
|
145
|
+
} else {
|
|
146
|
+
if (isSubview && treeConfig && rowChildren && rowChildren.length) {
|
|
147
|
+
if (isExpandTree) {
|
|
148
|
+
if (taskBarSubviewOpts.showOverview) {
|
|
149
|
+
cbVNs.push(
|
|
164
150
|
h('div', {
|
|
165
|
-
key:
|
|
166
|
-
|
|
167
|
-
rowid: rowid
|
|
168
|
-
},
|
|
169
|
-
class: 'vxe-gantt-view--chart-subview-bar'
|
|
151
|
+
key: 'vcso',
|
|
152
|
+
class: 'vxe-gantt-view--chart-subview-wrapper is--overview'
|
|
170
153
|
}, [
|
|
171
154
|
h('div', {
|
|
172
|
-
|
|
155
|
+
key: rowid,
|
|
156
|
+
attrs: {
|
|
157
|
+
rowid: rowid
|
|
158
|
+
},
|
|
159
|
+
class: ['vxe-gantt-view--chart-subview-row', {
|
|
160
|
+
'is--progress': showProgress,
|
|
161
|
+
'is--round': round,
|
|
162
|
+
'is--move': moveable
|
|
163
|
+
}]
|
|
173
164
|
}, [
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
},
|
|
178
|
-
:
|
|
165
|
+
h('div', {
|
|
166
|
+
attrs: {
|
|
167
|
+
rowid: rowid
|
|
168
|
+
},
|
|
169
|
+
class: 'vxe-gantt-view--chart-subview-bar'
|
|
170
|
+
}, [
|
|
171
|
+
h('div', {
|
|
172
|
+
class: 'vxe-gantt-view--chart-subview-bar-content-wrapper'
|
|
173
|
+
}, [
|
|
174
|
+
showContent
|
|
175
|
+
? h('div', {
|
|
176
|
+
class: 'vxe-gantt-view--chart-content'
|
|
177
|
+
}, title)
|
|
178
|
+
: renderEmptyElement($xeGantt)
|
|
179
|
+
])
|
|
180
|
+
])
|
|
179
181
|
])
|
|
180
182
|
])
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
h('div', {
|
|
187
|
-
key: 'vcsc',
|
|
188
|
-
class: 'vxe-gantt-view--chart-subview-wrapper is--inline'
|
|
189
|
-
}, rowChildren.map(childRow => {
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
} else {
|
|
186
|
+
const cbcVNs: VNode[] = []
|
|
187
|
+
XEUtils.eachTree(rowChildren, childRow => {
|
|
190
188
|
const childRowid = $xeTable.getRowid(childRow)
|
|
191
189
|
let childTitle = getStringValue(XEUtils.get(childRow, titleField))
|
|
192
190
|
const childProgressValue = showProgress ? Math.min(100, Math.max(0, XEUtils.toNumber(XEUtils.get(childRow, progressField)))) : 0
|
|
193
191
|
const childRenderTaskType = getTaskType(XEUtils.get(childRow, typeField))
|
|
192
|
+
const isChildSubview = !!(hasEnableConf(taskBarSubviewConfig, taskBarSubviewOpts) && hasSubviewTask(childRenderTaskType))
|
|
193
|
+
|
|
194
|
+
if (isChildSubview) {
|
|
195
|
+
return
|
|
196
|
+
}
|
|
194
197
|
|
|
195
198
|
const vpcStyle: VxeComponentStyleType = {
|
|
196
199
|
width: `${childProgressValue || 0}%`
|
|
@@ -206,76 +209,97 @@ export default defineVxeComponent({
|
|
|
206
209
|
childTitle = getStringValue(contentMethod({ row: childRow, title: childTitle, scaleType: scaleUnit }))
|
|
207
210
|
}
|
|
208
211
|
|
|
209
|
-
|
|
210
|
-
key: childRowid,
|
|
211
|
-
attrs: {
|
|
212
|
-
rowid: childRowid
|
|
213
|
-
},
|
|
214
|
-
class: ['vxe-gantt-view--chart-subview-bar', `is--${childRenderTaskType}`]
|
|
215
|
-
}, [
|
|
212
|
+
cbcVNs.push(
|
|
216
213
|
h('div', {
|
|
217
|
-
|
|
214
|
+
key: childRowid,
|
|
215
|
+
attrs: {
|
|
216
|
+
rowid: childRowid
|
|
217
|
+
},
|
|
218
|
+
class: ['vxe-gantt-view--chart-subview-row', `is--${childRenderTaskType}`, {
|
|
219
|
+
'is--progress': showProgress,
|
|
220
|
+
'is--round': round,
|
|
221
|
+
'is--move': moveable,
|
|
222
|
+
'row--pending': !!pendingRowFlag && !!pendingRowMaps[childRowid]
|
|
223
|
+
}]
|
|
218
224
|
}, [
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
225
|
+
h('div', {
|
|
226
|
+
attrs: {
|
|
227
|
+
rowid: childRowid
|
|
228
|
+
},
|
|
229
|
+
class: 'vxe-gantt-view--chart-subview-bar'
|
|
230
|
+
}, [
|
|
231
|
+
h('div', {
|
|
232
|
+
class: 'vxe-gantt-view--chart-subview-bar-content-wrapper'
|
|
233
|
+
}, [
|
|
234
|
+
showProgress
|
|
235
|
+
? h('div', {
|
|
236
|
+
class: 'vxe-gantt-view--chart-progress',
|
|
237
|
+
style: vpcStyle
|
|
238
|
+
})
|
|
239
|
+
: renderEmptyElement($xeGantt),
|
|
240
|
+
showContent
|
|
241
|
+
? h('div', {
|
|
242
|
+
class: 'vxe-gantt-view--chart-content'
|
|
243
|
+
}, childTitle)
|
|
244
|
+
: renderEmptyElement($xeGantt)
|
|
245
|
+
])
|
|
246
|
+
])
|
|
230
247
|
])
|
|
231
|
-
|
|
232
|
-
})
|
|
248
|
+
)
|
|
249
|
+
}, { children: childrenField })
|
|
250
|
+
|
|
251
|
+
cbVNs.push(
|
|
252
|
+
h('div', {
|
|
253
|
+
key: 'vcsc',
|
|
254
|
+
class: 'vxe-gantt-view--chart-subview-wrappe is--inliner'
|
|
255
|
+
}, cbcVNs)
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
} else if (isMilestone) {
|
|
259
|
+
const { icon, iconStatus, iconStyle } = taskBarMilestoneOpts
|
|
260
|
+
const tbmParams = { $gantt: $xeGantt, row }
|
|
261
|
+
cbVNs.push(
|
|
262
|
+
h('div', {
|
|
263
|
+
key: 'vcm',
|
|
264
|
+
class: 'vxe-gantt-view--chart-milestone-wrapper',
|
|
265
|
+
on: ctOns
|
|
266
|
+
}, [
|
|
267
|
+
h('div', {
|
|
268
|
+
class: ['vxe-gantt-view--chart-milestone-icon', iconStatus ? `theme--${XEUtils.isFunction(iconStatus) ? iconStatus(tbmParams) : iconStatus}` : ''],
|
|
269
|
+
style: iconStyle ? Object.assign({}, XEUtils.isFunction(iconStyle) ? iconStyle(tbmParams) : iconStyle) : undefined
|
|
270
|
+
}, [
|
|
271
|
+
h('i', {
|
|
272
|
+
class: (icon ? (XEUtils.isFunction(icon) ? icon(tbmParams) : icon) : '') || getIcon().GANTT_VIEW_TASK_MILESTONE
|
|
273
|
+
})
|
|
274
|
+
]),
|
|
275
|
+
showContent
|
|
276
|
+
? h('div', {
|
|
277
|
+
class: 'vxe-gantt-view--chart-milestone-content'
|
|
278
|
+
}, title)
|
|
279
|
+
: renderEmptyElement($xeGantt)
|
|
280
|
+
])
|
|
233
281
|
)
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const { icon, iconStatus, iconStyle } = taskBarMilestoneOpts
|
|
237
|
-
const tbmParams = { $gantt: $xeGantt, row }
|
|
238
|
-
cbVNs.push(
|
|
239
|
-
h('div', {
|
|
240
|
-
key: 'vcm',
|
|
241
|
-
class: 'vxe-gantt-view--chart-milestone-wrapper',
|
|
242
|
-
on: ctOns
|
|
243
|
-
}, [
|
|
282
|
+
} else {
|
|
283
|
+
cbVNs.push(
|
|
244
284
|
h('div', {
|
|
245
|
-
|
|
246
|
-
|
|
285
|
+
key: 'vbc',
|
|
286
|
+
class: 'vxe-gantt-view--chart-bar-content-wrapper',
|
|
287
|
+
on: ctOns
|
|
247
288
|
}, [
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
key: 'vbc',
|
|
263
|
-
class: 'vxe-gantt-view--chart-bar-content-wrapper',
|
|
264
|
-
on: ctOns
|
|
265
|
-
}, [
|
|
266
|
-
showProgress
|
|
267
|
-
? h('div', {
|
|
268
|
-
class: 'vxe-gantt-view--chart-progress',
|
|
269
|
-
style: vpStyle
|
|
270
|
-
})
|
|
271
|
-
: renderEmptyElement($xeGantt),
|
|
272
|
-
showContent
|
|
273
|
-
? h('div', {
|
|
274
|
-
class: 'vxe-gantt-view--chart-content'
|
|
275
|
-
}, title)
|
|
276
|
-
: renderEmptyElement($xeGantt)
|
|
277
|
-
])
|
|
278
|
-
)
|
|
289
|
+
showProgress
|
|
290
|
+
? h('div', {
|
|
291
|
+
class: 'vxe-gantt-view--chart-progress',
|
|
292
|
+
style: vpStyle
|
|
293
|
+
})
|
|
294
|
+
: renderEmptyElement($xeGantt),
|
|
295
|
+
showContent
|
|
296
|
+
? h('div', {
|
|
297
|
+
class: 'vxe-gantt-view--chart-content'
|
|
298
|
+
}, title)
|
|
299
|
+
: renderEmptyElement($xeGantt)
|
|
300
|
+
])
|
|
301
|
+
)
|
|
302
|
+
}
|
|
279
303
|
}
|
|
280
304
|
}
|
|
281
305
|
|
|
@@ -285,6 +309,7 @@ export default defineVxeComponent({
|
|
|
285
309
|
rowid
|
|
286
310
|
},
|
|
287
311
|
class: ['vxe-gantt-view--chart-row', `is--${renderTaskType}`, {
|
|
312
|
+
'is--progress': showProgress,
|
|
288
313
|
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
|
|
289
314
|
'is--round': round,
|
|
290
315
|
'is--move': moveable
|
|
@@ -707,6 +707,35 @@ function calcScrollbar ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPriv
|
|
|
707
707
|
}
|
|
708
708
|
}
|
|
709
709
|
|
|
710
|
+
function handleSubTaskMinMaxSize ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods, $xeTable: VxeTableConstructor, list: any[]) {
|
|
711
|
+
const $xeGantt = $xeGanttView.$xeGantt
|
|
712
|
+
const internalData = $xeGanttView.internalData
|
|
713
|
+
|
|
714
|
+
const { chartMaps } = internalData
|
|
715
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
716
|
+
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
717
|
+
|
|
718
|
+
const typeField = $xeGantt.computeTypeField
|
|
719
|
+
let minChildLeftSize = 0
|
|
720
|
+
let maxChildLeftSize = 0
|
|
721
|
+
XEUtils.eachTree(list, childRow => {
|
|
722
|
+
const childRowid = $xeTable.getRowid(childRow)
|
|
723
|
+
const renderTaskType = XEUtils.get(childRow, typeField)
|
|
724
|
+
if (hasSubviewTask(renderTaskType)) {
|
|
725
|
+
return
|
|
726
|
+
}
|
|
727
|
+
const childChartRest = childRowid ? chartMaps[childRowid] : null
|
|
728
|
+
if (childChartRest) {
|
|
729
|
+
maxChildLeftSize = Math.max(maxChildLeftSize, childChartRest.oLeftSize + childChartRest.oWidthSize)
|
|
730
|
+
minChildLeftSize = minChildLeftSize ? Math.min(minChildLeftSize, childChartRest.oLeftSize) : childChartRest.oLeftSize
|
|
731
|
+
}
|
|
732
|
+
}, { children: childrenField })
|
|
733
|
+
return {
|
|
734
|
+
minSize: minChildLeftSize,
|
|
735
|
+
maxSize: maxChildLeftSize
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
710
739
|
function updateTaskChartStyle ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods) {
|
|
711
740
|
const $xeGantt = $xeGanttView.$xeGantt
|
|
712
741
|
const reactData = $xeGanttView.reactData
|
|
@@ -719,6 +748,8 @@ function updateTaskChartStyle ($xeGanttView: VxeGanttViewConstructor & VxeGanttV
|
|
|
719
748
|
const { elemStore, chartMaps } = internalData
|
|
720
749
|
const chartWrapper = getRefElem(elemStore['main-chart-task-wrapper'])
|
|
721
750
|
if (chartWrapper && $xeTable) {
|
|
751
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
752
|
+
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
722
753
|
XEUtils.arrayEach(chartWrapper.children, (rowEl) => {
|
|
723
754
|
const barEl = rowEl.children[0] as HTMLDivElement
|
|
724
755
|
if (!barEl) {
|
|
@@ -729,20 +760,45 @@ function updateTaskChartStyle ($xeGanttView: VxeGanttViewConstructor & VxeGanttV
|
|
|
729
760
|
return
|
|
730
761
|
}
|
|
731
762
|
const chartRest = rowid ? chartMaps[rowid] : null
|
|
763
|
+
const row = chartRest ? chartRest.row : null
|
|
732
764
|
// 子任务视图
|
|
733
765
|
if (hasClass(barEl, 'is--subview')) {
|
|
734
766
|
const childWrapperEl = barEl.firstElementChild as HTMLDivElement
|
|
735
767
|
if (childWrapperEl) {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
768
|
+
// 行内展示
|
|
769
|
+
if (hasClass(childWrapperEl, 'is--inline')) {
|
|
770
|
+
XEUtils.arrayEach(childWrapperEl.children, (childRowEl) => {
|
|
771
|
+
const childBarEl = childRowEl.children[0] as HTMLDivElement
|
|
772
|
+
const childRowid = childBarEl.getAttribute('rowid') || ''
|
|
773
|
+
const childChartRest = childRowid ? chartMaps[childRowid] : null
|
|
774
|
+
if (childChartRest) {
|
|
775
|
+
const childRow = childChartRest.row
|
|
776
|
+
// 如果是子视图
|
|
777
|
+
if (hasClass(childBarEl, 'is--subview')) {
|
|
778
|
+
const subChildren: any[] = childRow[childrenField]
|
|
779
|
+
const { minSize: minChildLeftSize, maxSize: maxChildLeftSize } = handleSubTaskMinMaxSize($xeGanttView, $xeTable, subChildren)
|
|
780
|
+
childBarEl.style.left = `${viewCellWidth * minChildLeftSize}px`
|
|
781
|
+
childBarEl.style.width = `${viewCellWidth * (maxChildLeftSize - minChildLeftSize)}px`
|
|
782
|
+
} else {
|
|
783
|
+
childBarEl.style.left = `${getTaskBarLeft(childChartRest, viewCellWidth)}px`
|
|
784
|
+
if (!hasClass(childBarEl, 'is--milestone')) {
|
|
785
|
+
// 里程碑不需要宽度
|
|
786
|
+
childBarEl.style.width = `${getTaskBarWidth(childChartRest, viewCellWidth)}px`
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
})
|
|
791
|
+
} else {
|
|
792
|
+
// 如果展开子任务
|
|
793
|
+
const childRowEl = childWrapperEl.children[0] as HTMLDivElement
|
|
794
|
+
const childBarEl = childRowEl ? childRowEl.children[0] as HTMLDivElement : null
|
|
795
|
+
if (childBarEl) {
|
|
796
|
+
const rowChildren: any[] = row ? row[childrenField] : []
|
|
797
|
+
const { minSize: minChildLeftSize, maxSize: maxChildLeftSize } = handleSubTaskMinMaxSize($xeGanttView, $xeTable, rowChildren)
|
|
798
|
+
childBarEl.style.left = `${viewCellWidth * minChildLeftSize}px`
|
|
799
|
+
childBarEl.style.width = `${viewCellWidth * (maxChildLeftSize - minChildLeftSize)}px`
|
|
744
800
|
}
|
|
745
|
-
}
|
|
801
|
+
}
|
|
746
802
|
}
|
|
747
803
|
} else {
|
|
748
804
|
barEl.style.left = `${getTaskBarLeft(chartRest, viewCellWidth)}px`
|
|
@@ -8,13 +8,15 @@
|
|
|
8
8
|
pointer-events: none;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.vxe-gantt-view--chart-row
|
|
11
|
+
.vxe-gantt-view--chart-row,
|
|
12
|
+
.vxe-gantt-view--chart-subview-row {
|
|
12
13
|
position: relative;
|
|
13
14
|
width: 100%;
|
|
14
15
|
height: 0;
|
|
16
|
+
}
|
|
17
|
+
.vxe-gantt-view--chart-row {
|
|
15
18
|
&.row--pending {
|
|
16
|
-
.vxe-gantt-view--chart-bar
|
|
17
|
-
.vxe-gantt-view--chart-subview-bar {
|
|
19
|
+
.vxe-gantt-view--chart-bar {
|
|
18
20
|
color: var(--vxe-ui-font-disabled-color);
|
|
19
21
|
opacity: 0.5;
|
|
20
22
|
text-decoration: line-through;
|
|
@@ -36,7 +38,14 @@
|
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
|
-
.vxe-gantt-view--chart-subview-
|
|
41
|
+
.vxe-gantt-view--chart-subview-row {
|
|
42
|
+
&.row--pending {
|
|
43
|
+
.vxe-gantt-view--chart-subview-bar {
|
|
44
|
+
color: var(--vxe-ui-font-disabled-color);
|
|
45
|
+
opacity: 0.5;
|
|
46
|
+
text-decoration: line-through;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
40
49
|
&.is--round {
|
|
41
50
|
& > .vxe-gantt-view--chart-subview-bar {
|
|
42
51
|
border-radius: var(--vxe-ui-gantt-view-task-bar-border-radius);
|
|
@@ -50,10 +59,14 @@
|
|
|
50
59
|
}
|
|
51
60
|
}
|
|
52
61
|
}
|
|
62
|
+
}
|
|
63
|
+
.vxe-gantt-view--chart-subview-wrapper {
|
|
53
64
|
&.is--overview {
|
|
54
|
-
& > .vxe-gantt-view--chart-subview-
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
& > .vxe-gantt-view--chart-subview-row {
|
|
66
|
+
.vxe-gantt-view--chart-subview-bar {
|
|
67
|
+
color: #ffffff;
|
|
68
|
+
background-color: var(--vxe-ui-gantt-view-task-bar-overview-background-color);
|
|
69
|
+
}
|
|
57
70
|
}
|
|
58
71
|
}
|
|
59
72
|
}
|
|
@@ -68,11 +81,53 @@
|
|
|
68
81
|
left: 0;
|
|
69
82
|
transform: translateY(-50%);
|
|
70
83
|
pointer-events: all;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.vxe-gantt-view--chart-row {
|
|
87
|
+
&.is--progress {
|
|
88
|
+
& > .vxe-gantt-view--chart-bar {
|
|
89
|
+
&.is--default {
|
|
90
|
+
color: #ffffff;
|
|
91
|
+
background-color: var(--vxe-ui-gantt-view-task-bar-background-color);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
&:not(.is--progress) {
|
|
96
|
+
& > .vxe-gantt-view--chart-bar {
|
|
97
|
+
&.is--default {
|
|
98
|
+
color: #ffffff;
|
|
99
|
+
background-color: var(--vxe-ui-gantt-view-task-bar-completed-background-color);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
74
102
|
}
|
|
75
103
|
}
|
|
104
|
+
.vxe-gantt-view--chart-subview-row {
|
|
105
|
+
&.is--progress {
|
|
106
|
+
& > .vxe-gantt-view--chart-subview-bar {
|
|
107
|
+
&.is--subview {
|
|
108
|
+
color: #ffffff;
|
|
109
|
+
background-color: var(--vxe-ui-gantt-view-task-bar-overview-background-color);
|
|
110
|
+
}
|
|
111
|
+
&.is--default {
|
|
112
|
+
color: #ffffff;
|
|
113
|
+
background-color: var(--vxe-ui-gantt-view-task-bar-background-color);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
&:not(.is--progress) {
|
|
118
|
+
& > .vxe-gantt-view--chart-subview-bar {
|
|
119
|
+
&.is--subview {
|
|
120
|
+
color: #ffffff;
|
|
121
|
+
background-color: var(--vxe-ui-gantt-view-task-bar-overview-background-color);
|
|
122
|
+
}
|
|
123
|
+
&.is--default {
|
|
124
|
+
color: #ffffff;
|
|
125
|
+
background-color: var(--vxe-ui-gantt-view-task-bar-completed-background-color);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
76
131
|
.vxe-gantt-view--chart-bar-content-wrapper,
|
|
77
132
|
.vxe-gantt-view--chart-custom-bar-content-wrapper,
|
|
78
133
|
.vxe-gantt-view--chart-subview-bar-content-wrapper {
|
|
@@ -179,7 +234,8 @@ $iconThemeList: (
|
|
|
179
234
|
}
|
|
180
235
|
|
|
181
236
|
/*行拖拽*/
|
|
182
|
-
.vxe-gantt-view--chart-row
|
|
237
|
+
.vxe-gantt-view--chart-row,
|
|
238
|
+
.vxe-gantt-view--chart-subview-row {
|
|
183
239
|
&.row--drag-move {
|
|
184
240
|
transition: transform 0.5s ease;
|
|
185
241
|
}
|
package/styles/theme/base.scss
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
--vxe-ui-gantt-view-task-bar-border-radius: calc(var(--vxe-ui-gantt-view-split-bar-height) / 2);
|
|
9
9
|
--vxe-ui-gantt-view-task-bar-background-color: var(--vxe-ui-font-primary-lighten-color);
|
|
10
10
|
--vxe-ui-gantt-view-task-bar-completed-background-color: var(--vxe-ui-font-primary-color);
|
|
11
|
-
--vxe-ui-gantt-view-task-bar-overview-background-color: var(--vxe-ui-font-
|
|
11
|
+
--vxe-ui-gantt-view-task-bar-overview-background-color: var(--vxe-ui-font-disabled-color);
|
|
12
12
|
--vxe-ui-gantt-view-task-line-color: var(--vxe-ui-font-primary-color);
|
|
13
13
|
--vxe-ui-gantt-view-task-line-width: 2px;
|
|
14
14
|
--vxe-ui-gantt-view-task-line-arrow-width: 5;
|