vxe-gantt 4.0.6 → 4.0.8
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-header.js +3 -2
- package/es/gantt/src/gantt-view.js +277 -104
- package/es/gantt/src/gantt.js +8 -11
- package/es/gantt/style.css +5 -1
- 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 +5 -1
- package/es/vxe-gantt/style.min.css +1 -1
- package/lib/gantt/src/gantt-header.js +4 -2
- package/lib/gantt/src/gantt-header.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +343 -112
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +6 -9
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/gantt/style/style.css +5 -1
- package/lib/gantt/style/style.min.css +1 -1
- package/lib/index.umd.js +355 -125
- 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 +5 -1
- package/lib/vxe-gantt/style/style.min.css +1 -1
- package/package.json +3 -3
- package/packages/gantt/src/gantt-header.ts +3 -2
- package/packages/gantt/src/gantt-view.ts +288 -107
- package/packages/gantt/src/gantt.ts +6 -9
- package/styles/components/gantt.scss +6 -1
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
|
@@ -15,6 +15,7 @@ const { globalEvents } = VxeUI
|
|
|
15
15
|
function createInternalData (): GanttViewInternalData {
|
|
16
16
|
return {
|
|
17
17
|
xeTable: null,
|
|
18
|
+
visibleColumn: [],
|
|
18
19
|
startMaps: {},
|
|
19
20
|
endMaps: {},
|
|
20
21
|
chartMaps: {},
|
|
@@ -29,16 +30,9 @@ function createInternalData (): GanttViewInternalData {
|
|
|
29
30
|
startIndex: 0,
|
|
30
31
|
endIndex: 0
|
|
31
32
|
},
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
offsetSize: 0,
|
|
36
|
-
visibleSize: 0,
|
|
37
|
-
visibleStartIndex: 0,
|
|
38
|
-
visibleEndIndex: 0,
|
|
39
|
-
startIndex: 0,
|
|
40
|
-
endIndex: 0
|
|
41
|
-
}
|
|
33
|
+
// 最后滚动位置
|
|
34
|
+
lastScrollTop: 0,
|
|
35
|
+
lastScrollLeft: 0
|
|
42
36
|
}
|
|
43
37
|
}
|
|
44
38
|
|
|
@@ -85,6 +79,8 @@ export default defineVxeComponent({
|
|
|
85
79
|
// 横向滚动条的高度
|
|
86
80
|
scrollbarHeight: 0,
|
|
87
81
|
|
|
82
|
+
// 最后滚动时间戳
|
|
83
|
+
lastScrollTime: 0,
|
|
88
84
|
lazScrollLoading: false,
|
|
89
85
|
|
|
90
86
|
scrollVMLoading: false,
|
|
@@ -161,37 +157,37 @@ export default defineVxeComponent({
|
|
|
161
157
|
const diffDayNum = maxViewDate.getTime() - minViewDate.getTime()
|
|
162
158
|
const countSize = Math.max(5, Math.floor(diffDayNum / gapTime) + 1)
|
|
163
159
|
|
|
164
|
-
switch (minScale.type) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
160
|
+
// switch (minScale.type) {
|
|
161
|
+
// case 'day':
|
|
162
|
+
// case 'date':
|
|
163
|
+
// if (diffDayNum > (1000 * 60 * 60 * 24 * 366 * 3)) {
|
|
164
|
+
// reactData.tableColumn = []
|
|
165
|
+
// reactData.headerGroups = []
|
|
166
|
+
// return
|
|
167
|
+
// }
|
|
168
|
+
// break
|
|
169
|
+
// case 'hour':
|
|
170
|
+
// if (diffDayNum > (1000 * 60 * 60 * 24 * 31 * 3)) {
|
|
171
|
+
// reactData.tableColumn = []
|
|
172
|
+
// reactData.headerGroups = []
|
|
173
|
+
// return
|
|
174
|
+
// }
|
|
175
|
+
// break
|
|
176
|
+
// case 'minute':
|
|
177
|
+
// if (diffDayNum > (1000 * 60 * 60 * 24 * 3)) {
|
|
178
|
+
// reactData.tableColumn = []
|
|
179
|
+
// reactData.headerGroups = []
|
|
180
|
+
// return
|
|
181
|
+
// }
|
|
182
|
+
// break
|
|
183
|
+
// case 'second':
|
|
184
|
+
// if (diffDayNum > (1000 * 60 * 60 * 3)) {
|
|
185
|
+
// reactData.tableColumn = []
|
|
186
|
+
// reactData.headerGroups = []
|
|
187
|
+
// return
|
|
188
|
+
// }
|
|
189
|
+
// break
|
|
190
|
+
// }
|
|
195
191
|
|
|
196
192
|
const renderListMaps: Record<VxeGanttDefines.ColumnScaleType, VxeGanttDefines.ViewColumn[]> = {
|
|
197
193
|
year: [],
|
|
@@ -345,9 +341,12 @@ export default defineVxeComponent({
|
|
|
345
341
|
if ($xeTable) {
|
|
346
342
|
const startField = computeStartField.value
|
|
347
343
|
const endField = computeEndField.value
|
|
348
|
-
const { computeTreeOpts } = $xeTable.getComputeMaps()
|
|
344
|
+
const { computeAggregateOpts, computeTreeOpts } = $xeTable.getComputeMaps()
|
|
345
|
+
const tableReactData = $xeTable.reactData
|
|
346
|
+
const { isRowGroupStatus } = tableReactData
|
|
349
347
|
const tableInternalData = $xeTable.internalData
|
|
350
|
-
const { afterFullData, afterTreeFullData } = tableInternalData
|
|
348
|
+
const { afterFullData, afterTreeFullData, afterGroupFullData } = tableInternalData
|
|
349
|
+
const aggregateOpts = computeAggregateOpts.value
|
|
351
350
|
const treeOpts = computeTreeOpts.value
|
|
352
351
|
const { transform } = treeOpts
|
|
353
352
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
@@ -371,7 +370,14 @@ export default defineVxeComponent({
|
|
|
371
370
|
}
|
|
372
371
|
}
|
|
373
372
|
|
|
374
|
-
if (
|
|
373
|
+
if (isRowGroupStatus) {
|
|
374
|
+
// 行分组
|
|
375
|
+
const mapChildrenField = aggregateOpts.mapChildrenField
|
|
376
|
+
if (mapChildrenField) {
|
|
377
|
+
XEUtils.eachTree(afterGroupFullData, handleParseRender, { children: mapChildrenField })
|
|
378
|
+
}
|
|
379
|
+
} else if (treeConfig) {
|
|
380
|
+
// 树结构
|
|
375
381
|
XEUtils.eachTree(afterTreeFullData, handleParseRender, { children: transform ? treeOpts.mapChildrenField : childrenField })
|
|
376
382
|
} else {
|
|
377
383
|
afterFullData.forEach(handleParseRender)
|
|
@@ -379,13 +385,16 @@ export default defineVxeComponent({
|
|
|
379
385
|
internalData.chartMaps = ctMaps
|
|
380
386
|
}
|
|
381
387
|
}
|
|
382
|
-
|
|
388
|
+
internalData.visibleColumn = fullCols
|
|
383
389
|
reactData.headerGroups = groupCols
|
|
390
|
+
updateScrollXStatus()
|
|
391
|
+
handleTableColumn()
|
|
384
392
|
}
|
|
385
393
|
|
|
386
394
|
const handleUpdateData = () => {
|
|
387
395
|
const ganttProps = $xeGantt.props
|
|
388
396
|
const { treeConfig } = ganttProps
|
|
397
|
+
const { scrollXStore } = internalData
|
|
389
398
|
const $xeTable = internalData.xeTable
|
|
390
399
|
const sdMaps: Record<string, any> = {}
|
|
391
400
|
const edMaps: Record<string, any> = {}
|
|
@@ -394,9 +403,12 @@ export default defineVxeComponent({
|
|
|
394
403
|
if ($xeTable) {
|
|
395
404
|
const startField = computeStartField.value
|
|
396
405
|
const endField = computeEndField.value
|
|
397
|
-
const { computeTreeOpts } = $xeTable.getComputeMaps()
|
|
406
|
+
const { computeAggregateOpts, computeTreeOpts } = $xeTable.getComputeMaps()
|
|
407
|
+
const tableReactData = $xeTable.reactData
|
|
408
|
+
const { isRowGroupStatus } = tableReactData
|
|
398
409
|
const tableInternalData = $xeTable.internalData
|
|
399
|
-
const { afterFullData, afterTreeFullData } = tableInternalData
|
|
410
|
+
const { afterFullData, afterTreeFullData, afterGroupFullData } = tableInternalData
|
|
411
|
+
const aggregateOpts = computeAggregateOpts.value
|
|
400
412
|
const treeOpts = computeTreeOpts.value
|
|
401
413
|
const { transform } = treeOpts
|
|
402
414
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
@@ -416,12 +428,21 @@ export default defineVxeComponent({
|
|
|
416
428
|
}
|
|
417
429
|
}
|
|
418
430
|
|
|
419
|
-
if (
|
|
431
|
+
if (isRowGroupStatus) {
|
|
432
|
+
// 行分组
|
|
433
|
+
const mapChildrenField = aggregateOpts.mapChildrenField
|
|
434
|
+
if (mapChildrenField) {
|
|
435
|
+
XEUtils.eachTree(afterGroupFullData, handleMinMaxData, { children: mapChildrenField })
|
|
436
|
+
}
|
|
437
|
+
} else if (treeConfig) {
|
|
438
|
+
// 树结构
|
|
420
439
|
XEUtils.eachTree(afterTreeFullData, handleMinMaxData, { children: transform ? treeOpts.mapChildrenField : childrenField })
|
|
421
440
|
} else {
|
|
422
441
|
afterFullData.forEach(handleMinMaxData)
|
|
423
442
|
}
|
|
424
443
|
}
|
|
444
|
+
scrollXStore.startIndex = 0
|
|
445
|
+
scrollXStore.endIndex = Math.max(1, scrollXStore.visibleSize)
|
|
425
446
|
reactData.minViewDate = minDate
|
|
426
447
|
reactData.maxViewDate = maxDate
|
|
427
448
|
internalData.startMaps = sdMaps
|
|
@@ -466,18 +487,16 @@ export default defineVxeComponent({
|
|
|
466
487
|
}
|
|
467
488
|
const rowid = rowEl.getAttribute('rowid')
|
|
468
489
|
const rowRest = rowid ? chartMaps[rowid] : null
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
barEl.style.width = `${viewCellWidth * rowRest.oWidthSize}px`
|
|
472
|
-
}
|
|
490
|
+
barEl.style.left = `${rowRest ? viewCellWidth * rowRest.oLeftSize : 0}px`
|
|
491
|
+
barEl.style.width = `${rowRest ? viewCellWidth * rowRest.oWidthSize : 0}px`
|
|
473
492
|
})
|
|
474
493
|
}
|
|
475
494
|
return nextTick()
|
|
476
495
|
}
|
|
477
496
|
|
|
478
497
|
const updateStyle = () => {
|
|
479
|
-
const { scrollbarWidth, scrollbarHeight,
|
|
480
|
-
const { elemStore } = internalData
|
|
498
|
+
const { scrollbarWidth, scrollbarHeight, headerGroups, tableColumn } = reactData
|
|
499
|
+
const { elemStore, visibleColumn } = internalData
|
|
481
500
|
const $xeTable = internalData.xeTable
|
|
482
501
|
|
|
483
502
|
const el = refElem.value
|
|
@@ -568,25 +587,28 @@ export default defineVxeComponent({
|
|
|
568
587
|
}
|
|
569
588
|
|
|
570
589
|
const colInfoElem = refColInfoElem.value
|
|
590
|
+
let viewCellWidth = 40
|
|
571
591
|
if (colInfoElem) {
|
|
572
|
-
|
|
592
|
+
viewCellWidth = colInfoElem.clientWidth || 40
|
|
573
593
|
}
|
|
574
|
-
let viewTableWidth =
|
|
594
|
+
let viewTableWidth = viewCellWidth * visibleColumn.length
|
|
575
595
|
if (bodyScrollElem) {
|
|
576
596
|
const viewWidth = bodyScrollElem.clientWidth
|
|
577
597
|
const remainWidth = viewWidth - viewTableWidth
|
|
578
598
|
if (remainWidth > 0) {
|
|
579
|
-
|
|
599
|
+
viewCellWidth += Math.floor(remainWidth / visibleColumn.length)
|
|
580
600
|
viewTableWidth = viewWidth
|
|
581
601
|
}
|
|
582
602
|
}
|
|
603
|
+
reactData.viewCellWidth = viewCellWidth
|
|
583
604
|
const headerTableElem = getRefElem(elemStore['main-header-table'])
|
|
584
605
|
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
606
|
+
const vmTableWidth = viewCellWidth * tableColumn.length
|
|
585
607
|
if (headerTableElem) {
|
|
586
608
|
headerTableElem.style.width = `${viewTableWidth}px`
|
|
587
609
|
}
|
|
588
610
|
if (bodyTableElem) {
|
|
589
|
-
bodyTableElem.style.width = `${
|
|
611
|
+
bodyTableElem.style.width = `${vmTableWidth}px`
|
|
590
612
|
}
|
|
591
613
|
|
|
592
614
|
reactData.scrollXWidth = viewTableWidth
|
|
@@ -594,16 +616,171 @@ export default defineVxeComponent({
|
|
|
594
616
|
return updateChart()
|
|
595
617
|
}
|
|
596
618
|
|
|
597
|
-
const
|
|
619
|
+
const handleRecalculateStyle = () => {
|
|
620
|
+
const el = refElem.value
|
|
621
|
+
internalData.rceRunTime = Date.now()
|
|
622
|
+
if (!el || !el.clientWidth) {
|
|
623
|
+
return nextTick()
|
|
624
|
+
}
|
|
598
625
|
calcScrollbar()
|
|
599
626
|
updateStyle()
|
|
600
627
|
updateChart()
|
|
628
|
+
return computeScrollLoad()
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
const handleLazyRecalculate = () => {
|
|
632
|
+
return new Promise<void>(resolve => {
|
|
633
|
+
const { rceTimeout, rceRunTime } = internalData
|
|
634
|
+
const $xeTable = internalData.xeTable
|
|
635
|
+
let refreshDelay = 50
|
|
636
|
+
if ($xeTable) {
|
|
637
|
+
const { computeResizeOpts } = $xeTable.getComputeMaps()
|
|
638
|
+
const resizeOpts = computeResizeOpts.value
|
|
639
|
+
refreshDelay = resizeOpts.refreshDelay || 50
|
|
640
|
+
}
|
|
641
|
+
if (rceTimeout) {
|
|
642
|
+
clearTimeout(rceTimeout)
|
|
643
|
+
if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
|
|
644
|
+
resolve(
|
|
645
|
+
handleRecalculateStyle()
|
|
646
|
+
)
|
|
647
|
+
} else {
|
|
648
|
+
nextTick(() => {
|
|
649
|
+
resolve()
|
|
650
|
+
})
|
|
651
|
+
}
|
|
652
|
+
} else {
|
|
653
|
+
resolve(
|
|
654
|
+
handleRecalculateStyle()
|
|
655
|
+
)
|
|
656
|
+
}
|
|
657
|
+
internalData.rceTimeout = setTimeout(() => {
|
|
658
|
+
internalData.rceTimeout = undefined
|
|
659
|
+
handleRecalculateStyle()
|
|
660
|
+
}, refreshDelay)
|
|
661
|
+
})
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
const computeScrollLoad = () => {
|
|
665
|
+
return nextTick().then(() => {
|
|
666
|
+
const { scrollXLoad } = reactData
|
|
667
|
+
const { scrollXStore } = internalData
|
|
668
|
+
// 计算 X 逻辑
|
|
669
|
+
if (scrollXLoad) {
|
|
670
|
+
const { toVisibleIndex: toXVisibleIndex, visibleSize: visibleXSize } = handleVirtualXVisible()
|
|
671
|
+
const offsetXSize = 2
|
|
672
|
+
scrollXStore.preloadSize = 1
|
|
673
|
+
scrollXStore.offsetSize = offsetXSize
|
|
674
|
+
scrollXStore.visibleSize = visibleXSize
|
|
675
|
+
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex)
|
|
676
|
+
scrollXStore.visibleStartIndex = Math.max(scrollXStore.startIndex, toXVisibleIndex)
|
|
677
|
+
scrollXStore.visibleEndIndex = Math.min(scrollXStore.endIndex, toXVisibleIndex + visibleXSize)
|
|
678
|
+
updateScrollXData().then(() => {
|
|
679
|
+
loadScrollXData()
|
|
680
|
+
})
|
|
681
|
+
} else {
|
|
682
|
+
updateScrollXSpace()
|
|
683
|
+
}
|
|
684
|
+
})
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
const handleVirtualXVisible = () => {
|
|
688
|
+
const { viewCellWidth } = reactData
|
|
689
|
+
const { elemStore } = internalData
|
|
690
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
691
|
+
if (bodyScrollElem) {
|
|
692
|
+
const clientWidth = bodyScrollElem.clientWidth
|
|
693
|
+
const scrollLeft = bodyScrollElem.scrollLeft
|
|
694
|
+
const toVisibleIndex = Math.floor(scrollLeft / viewCellWidth) - 1
|
|
695
|
+
const visibleSize = Math.ceil(clientWidth / viewCellWidth) + 1
|
|
696
|
+
return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(1, visibleSize) }
|
|
697
|
+
}
|
|
698
|
+
return { toVisibleIndex: 0, visibleSize: 6 }
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const loadScrollXData = () => {
|
|
702
|
+
const { isScrollXBig } = reactData
|
|
703
|
+
const { scrollXStore } = internalData
|
|
704
|
+
const { preloadSize, startIndex, endIndex, offsetSize } = scrollXStore
|
|
705
|
+
const { toVisibleIndex, visibleSize } = handleVirtualXVisible()
|
|
706
|
+
const offsetItem = {
|
|
707
|
+
startIndex: Math.max(0, isScrollXBig ? toVisibleIndex - 1 : toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
708
|
+
endIndex: isScrollXBig ? toVisibleIndex + visibleSize : toVisibleIndex + visibleSize + offsetSize + preloadSize
|
|
709
|
+
}
|
|
710
|
+
scrollXStore.visibleStartIndex = toVisibleIndex - 1
|
|
711
|
+
scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1
|
|
712
|
+
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem
|
|
713
|
+
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
714
|
+
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
715
|
+
scrollXStore.startIndex = offsetStartIndex
|
|
716
|
+
scrollXStore.endIndex = offsetEndIndex
|
|
717
|
+
updateScrollXData()
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
const updateScrollXData = () => {
|
|
723
|
+
handleTableColumn()
|
|
724
|
+
updateScrollXSpace()
|
|
601
725
|
return nextTick()
|
|
602
726
|
}
|
|
603
727
|
|
|
604
|
-
|
|
728
|
+
const updateScrollXStatus = () => {
|
|
729
|
+
const scrollXLoad = true
|
|
730
|
+
reactData.scrollXLoad = scrollXLoad
|
|
731
|
+
return scrollXLoad
|
|
732
|
+
}
|
|
605
733
|
|
|
606
|
-
|
|
734
|
+
const handleTableColumn = () => {
|
|
735
|
+
const { scrollXLoad } = reactData
|
|
736
|
+
const { visibleColumn, scrollXStore } = internalData
|
|
737
|
+
const tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0)
|
|
738
|
+
reactData.tableColumn = tableColumn
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
const updateScrollXSpace = () => {
|
|
742
|
+
const { scrollXLoad, scrollXWidth, viewCellWidth } = reactData
|
|
743
|
+
const { elemStore, scrollXStore } = internalData
|
|
744
|
+
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
745
|
+
// const headerTableElem = getRefElem(elemStore['main-header-table'])
|
|
746
|
+
// const footerTableElem = getRefElem(elemStore['main-footer-table'])
|
|
747
|
+
|
|
748
|
+
const { startIndex } = scrollXStore
|
|
749
|
+
let xSpaceLeft = 0
|
|
750
|
+
if (scrollXLoad) {
|
|
751
|
+
xSpaceLeft = Math.max(0, startIndex * viewCellWidth)
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
// if (headerTableElem) {
|
|
755
|
+
// headerTableElem.style.transform = `translate(${xSpaceLeft}px, 0px)`
|
|
756
|
+
// }
|
|
757
|
+
if (bodyTableElem) {
|
|
758
|
+
bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`
|
|
759
|
+
}
|
|
760
|
+
// if (footerTableElem) {
|
|
761
|
+
// footerTableElem.style.transform = `translate(${xSpaceLeft}px, 0px)`
|
|
762
|
+
// }
|
|
763
|
+
|
|
764
|
+
const layoutList = ['header', 'body', 'footer']
|
|
765
|
+
layoutList.forEach(layout => {
|
|
766
|
+
const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`])
|
|
767
|
+
if (xSpaceElem) {
|
|
768
|
+
xSpaceElem.style.width = scrollXLoad ? `${scrollXWidth}px` : ''
|
|
769
|
+
}
|
|
770
|
+
})
|
|
771
|
+
|
|
772
|
+
const scrollXSpaceEl = refScrollXSpaceElem.value
|
|
773
|
+
if (scrollXSpaceEl) {
|
|
774
|
+
scrollXSpaceEl.style.width = `${scrollXWidth}px`
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
calcScrollbar()
|
|
778
|
+
return nextTick()
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
const triggerScrollXEvent = () => {
|
|
782
|
+
loadScrollXData()
|
|
783
|
+
}
|
|
607
784
|
|
|
608
785
|
const updateScrollYSpace = () => {
|
|
609
786
|
const { elemStore } = internalData
|
|
@@ -687,6 +864,13 @@ export default defineVxeComponent({
|
|
|
687
864
|
|
|
688
865
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
689
866
|
const handleScrollEvent = (evnt: Event, isRollY: boolean, isRollX: boolean, scrollTop: number, scrollLeft: number) => {
|
|
867
|
+
if (isRollX) {
|
|
868
|
+
internalData.lastScrollLeft = scrollLeft
|
|
869
|
+
}
|
|
870
|
+
if (isRollY) {
|
|
871
|
+
internalData.lastScrollTop = scrollTop
|
|
872
|
+
}
|
|
873
|
+
reactData.lastScrollTime = Date.now()
|
|
690
874
|
checkLastSyncScroll(isRollX, isRollY)
|
|
691
875
|
}
|
|
692
876
|
|
|
@@ -780,7 +964,8 @@ export default defineVxeComponent({
|
|
|
780
964
|
}
|
|
781
965
|
},
|
|
782
966
|
triggerBodyScrollEvent (evnt) {
|
|
783
|
-
const {
|
|
967
|
+
const { scrollXLoad } = reactData
|
|
968
|
+
const { elemStore, inVirtualScroll, inHeaderScroll, inFooterScroll, lastScrollLeft, lastScrollTop } = internalData
|
|
784
969
|
if (inVirtualScroll) {
|
|
785
970
|
return
|
|
786
971
|
}
|
|
@@ -791,36 +976,44 @@ export default defineVxeComponent({
|
|
|
791
976
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
|
|
792
977
|
const xHandleEl = refScrollXHandleElem.value
|
|
793
978
|
const yHandleEl = refScrollYHandleElem.value
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
syncTableScrollTop(currTopNum)
|
|
804
|
-
handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum)
|
|
979
|
+
const scrollLeft = wrapperEl.scrollLeft
|
|
980
|
+
const scrollTop = wrapperEl.scrollTop
|
|
981
|
+
const isRollX = scrollLeft !== lastScrollLeft
|
|
982
|
+
const isRollY = scrollTop !== lastScrollTop
|
|
983
|
+
internalData.inBodyScroll = true
|
|
984
|
+
internalData.scrollRenderType = ''
|
|
985
|
+
if (isRollY) {
|
|
986
|
+
setScrollTop(yHandleEl, scrollTop)
|
|
987
|
+
syncTableScrollTop(scrollTop)
|
|
805
988
|
}
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
return
|
|
814
|
-
}
|
|
815
|
-
const wrapperEl = evnt.currentTarget as HTMLDivElement
|
|
816
|
-
if (wrapperEl) {
|
|
817
|
-
const isRollX = true
|
|
818
|
-
const isRollY = false
|
|
819
|
-
const currLeftNum = wrapperEl.scrollLeft
|
|
820
|
-
handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum)
|
|
989
|
+
if (isRollX) {
|
|
990
|
+
internalData.inBodyScroll = true
|
|
991
|
+
setScrollLeft(xHandleEl, scrollLeft)
|
|
992
|
+
setScrollLeft(headerScrollElem, scrollLeft)
|
|
993
|
+
if (scrollXLoad) {
|
|
994
|
+
triggerScrollXEvent()
|
|
995
|
+
}
|
|
821
996
|
}
|
|
997
|
+
handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, scrollLeft)
|
|
822
998
|
},
|
|
999
|
+
// triggerFooterScrollEvent (evnt) {
|
|
1000
|
+
// const { inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData
|
|
1001
|
+
// if (inVirtualScroll) {
|
|
1002
|
+
// return
|
|
1003
|
+
// }
|
|
1004
|
+
// if (inHeaderScroll || inBodyScroll) {
|
|
1005
|
+
// return
|
|
1006
|
+
// }
|
|
1007
|
+
// const wrapperEl = evnt.currentTarget as HTMLDivElement
|
|
1008
|
+
// if (wrapperEl) {
|
|
1009
|
+
// const isRollX = true
|
|
1010
|
+
// const isRollY = false
|
|
1011
|
+
// const currLeftNum = wrapperEl.scrollLeft
|
|
1012
|
+
// handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum)
|
|
1013
|
+
// }
|
|
1014
|
+
// },
|
|
823
1015
|
triggerVirtualScrollXEvent (evnt) {
|
|
1016
|
+
const { scrollXLoad } = reactData
|
|
824
1017
|
const { elemStore, inHeaderScroll, inBodyScroll } = internalData
|
|
825
1018
|
if (inHeaderScroll || inBodyScroll) {
|
|
826
1019
|
return
|
|
@@ -835,6 +1028,9 @@ export default defineVxeComponent({
|
|
|
835
1028
|
internalData.inVirtualScroll = true
|
|
836
1029
|
setScrollLeft(headerScrollElem, currLeftNum)
|
|
837
1030
|
setScrollLeft(bodyScrollElem, currLeftNum)
|
|
1031
|
+
if (scrollXLoad) {
|
|
1032
|
+
triggerScrollXEvent()
|
|
1033
|
+
}
|
|
838
1034
|
handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum)
|
|
839
1035
|
}
|
|
840
1036
|
},
|
|
@@ -856,26 +1052,11 @@ export default defineVxeComponent({
|
|
|
856
1052
|
}
|
|
857
1053
|
},
|
|
858
1054
|
handleUpdateSXSpace () {
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
layoutList.forEach(layout => {
|
|
864
|
-
const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`])
|
|
865
|
-
if (xSpaceElem) {
|
|
866
|
-
xSpaceElem.style.width = scrollXLoad ? `${scrollXWidth}px` : ''
|
|
867
|
-
}
|
|
868
|
-
})
|
|
869
|
-
|
|
870
|
-
const scrollXSpaceEl = refScrollXSpaceElem.value
|
|
871
|
-
if (scrollXSpaceEl) {
|
|
872
|
-
scrollXSpaceEl.style.width = `${scrollXWidth}px`
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
calcScrollbar()
|
|
876
|
-
return nextTick()
|
|
1055
|
+
return updateScrollXSpace()
|
|
1056
|
+
},
|
|
1057
|
+
handleUpdateSYSpace () {
|
|
1058
|
+
return updateScrollYSpace()
|
|
877
1059
|
},
|
|
878
|
-
handleUpdateSYSpace: updateScrollYSpace,
|
|
879
1060
|
handleUpdateSYStatus (sYLoad) {
|
|
880
1061
|
reactData.scrollYLoad = sYLoad
|
|
881
1062
|
}
|
|
@@ -794,20 +794,20 @@ export default defineVxeComponent({
|
|
|
794
794
|
let tipHeight = 0
|
|
795
795
|
if (rsNumLeftEl) {
|
|
796
796
|
if (offsetLeft < 0) {
|
|
797
|
+
rsNumLeftEl.style.display = 'none'
|
|
798
|
+
} else {
|
|
797
799
|
rsNumLeftEl.textContent = `${targetTableWidth}px`
|
|
798
800
|
rsNumLeftEl.style.display = 'block'
|
|
799
801
|
tipHeight = rsNumLeftEl.offsetHeight
|
|
800
|
-
} else {
|
|
801
|
-
rsNumLeftEl.style.display = 'none'
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
804
|
if (rsNumRightEl) {
|
|
805
805
|
if (offsetLeft < 0) {
|
|
806
|
-
rsNumRightEl.style.display = 'none'
|
|
807
|
-
} else {
|
|
808
806
|
rsNumRightEl.textContent = `${Math.floor(containerRect.width - targetTableWidth)}px`
|
|
809
807
|
rsNumRightEl.style.display = 'block'
|
|
810
808
|
tipHeight = rsNumRightEl.offsetHeight
|
|
809
|
+
} else {
|
|
810
|
+
rsNumRightEl.style.display = 'none'
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
813
|
const tipTop = evnt.clientY - containerRect.top - tipHeight / 2
|
|
@@ -1929,10 +1929,10 @@ export default defineVxeComponent({
|
|
|
1929
1929
|
}, [
|
|
1930
1930
|
h('div', {
|
|
1931
1931
|
class: 'vxe-gantt--resizable-split-number-left'
|
|
1932
|
-
}
|
|
1932
|
+
}),
|
|
1933
1933
|
h('div', {
|
|
1934
1934
|
class: 'vxe-gantt--resizable-split-number-right'
|
|
1935
|
-
}
|
|
1935
|
+
})
|
|
1936
1936
|
])
|
|
1937
1937
|
]),
|
|
1938
1938
|
h('div', {
|
|
@@ -2085,9 +2085,6 @@ export default defineVxeComponent({
|
|
|
2085
2085
|
if (props.expandConfig) {
|
|
2086
2086
|
warnLog('vxe.error.notProp', ['expand-config'])
|
|
2087
2087
|
}
|
|
2088
|
-
if (props.aggregateConfig) {
|
|
2089
|
-
warnLog('vxe.error.notProp', ['aggregate-config'])
|
|
2090
|
-
}
|
|
2091
2088
|
|
|
2092
2089
|
if (columns && columns.length) {
|
|
2093
2090
|
$xeGantt.loadColumn(columns)
|
|
@@ -77,6 +77,10 @@
|
|
|
77
77
|
flex-shrink: 0;
|
|
78
78
|
width: var(--vxe-ui-gantt-view-split-bar-width);
|
|
79
79
|
background-color: var(--vxe-ui-gantt-view-split-bar-background-color);
|
|
80
|
+
&:hover,
|
|
81
|
+
&:active {
|
|
82
|
+
background-color: var(--vxe-ui-gantt-view-split-bar-hover-background-color);
|
|
83
|
+
}
|
|
80
84
|
&.is--resize {
|
|
81
85
|
cursor: col-resize;
|
|
82
86
|
}
|
|
@@ -326,7 +330,8 @@
|
|
|
326
330
|
user-select: none;
|
|
327
331
|
@include baseMixin.createAnimationTransition(all, 0.1s);
|
|
328
332
|
&:hover {
|
|
329
|
-
|
|
333
|
+
color: #ffffff;
|
|
334
|
+
background-color: var(--vxe-ui-font-primary-color);
|
|
330
335
|
}
|
|
331
336
|
&:active {
|
|
332
337
|
transform: scale(0.9);
|
package/styles/theme/dark.scss
CHANGED