vxe-gantt 4.0.6 → 4.0.7
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 +247 -94
- package/es/gantt/src/gantt.js +8 -8
- 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 +305 -104
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +6 -6
- 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 +317 -114
- 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 +260 -97
- package/packages/gantt/src/gantt.ts +6 -6
- 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,
|
|
@@ -136,9 +132,12 @@ export default defineVxeComponent({
|
|
|
136
132
|
const { treeConfig } = ganttProps
|
|
137
133
|
const { taskScaleList } = ganttReactData
|
|
138
134
|
const { minViewDate, maxViewDate } = reactData
|
|
135
|
+
const { scrollXStore } = internalData
|
|
139
136
|
const minScale = XEUtils.last(taskScaleList)
|
|
140
137
|
const fullCols: VxeGanttDefines.ViewColumn[] = []
|
|
141
138
|
const groupCols: VxeGanttDefines.GroupColumn[] = []
|
|
139
|
+
scrollXStore.startIndex = 0
|
|
140
|
+
scrollXStore.endIndex = 1
|
|
142
141
|
if (minScale && minViewDate && maxViewDate) {
|
|
143
142
|
const minSType = minScale.type
|
|
144
143
|
const weekScale = taskScaleList.find(item => item.type === 'week')
|
|
@@ -161,37 +160,37 @@ export default defineVxeComponent({
|
|
|
161
160
|
const diffDayNum = maxViewDate.getTime() - minViewDate.getTime()
|
|
162
161
|
const countSize = Math.max(5, Math.floor(diffDayNum / gapTime) + 1)
|
|
163
162
|
|
|
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
|
-
}
|
|
163
|
+
// switch (minScale.type) {
|
|
164
|
+
// case 'day':
|
|
165
|
+
// case 'date':
|
|
166
|
+
// if (diffDayNum > (1000 * 60 * 60 * 24 * 366 * 3)) {
|
|
167
|
+
// reactData.tableColumn = []
|
|
168
|
+
// reactData.headerGroups = []
|
|
169
|
+
// return
|
|
170
|
+
// }
|
|
171
|
+
// break
|
|
172
|
+
// case 'hour':
|
|
173
|
+
// if (diffDayNum > (1000 * 60 * 60 * 24 * 31 * 3)) {
|
|
174
|
+
// reactData.tableColumn = []
|
|
175
|
+
// reactData.headerGroups = []
|
|
176
|
+
// return
|
|
177
|
+
// }
|
|
178
|
+
// break
|
|
179
|
+
// case 'minute':
|
|
180
|
+
// if (diffDayNum > (1000 * 60 * 60 * 24 * 3)) {
|
|
181
|
+
// reactData.tableColumn = []
|
|
182
|
+
// reactData.headerGroups = []
|
|
183
|
+
// return
|
|
184
|
+
// }
|
|
185
|
+
// break
|
|
186
|
+
// case 'second':
|
|
187
|
+
// if (diffDayNum > (1000 * 60 * 60 * 3)) {
|
|
188
|
+
// reactData.tableColumn = []
|
|
189
|
+
// reactData.headerGroups = []
|
|
190
|
+
// return
|
|
191
|
+
// }
|
|
192
|
+
// break
|
|
193
|
+
// }
|
|
195
194
|
|
|
196
195
|
const renderListMaps: Record<VxeGanttDefines.ColumnScaleType, VxeGanttDefines.ViewColumn[]> = {
|
|
197
196
|
year: [],
|
|
@@ -379,8 +378,10 @@ export default defineVxeComponent({
|
|
|
379
378
|
internalData.chartMaps = ctMaps
|
|
380
379
|
}
|
|
381
380
|
}
|
|
382
|
-
|
|
381
|
+
internalData.visibleColumn = fullCols
|
|
383
382
|
reactData.headerGroups = groupCols
|
|
383
|
+
updateScrollXStatus()
|
|
384
|
+
handleTableColumn()
|
|
384
385
|
}
|
|
385
386
|
|
|
386
387
|
const handleUpdateData = () => {
|
|
@@ -476,8 +477,8 @@ export default defineVxeComponent({
|
|
|
476
477
|
}
|
|
477
478
|
|
|
478
479
|
const updateStyle = () => {
|
|
479
|
-
const { scrollbarWidth, scrollbarHeight,
|
|
480
|
-
const { elemStore } = internalData
|
|
480
|
+
const { scrollbarWidth, scrollbarHeight, headerGroups, tableColumn } = reactData
|
|
481
|
+
const { elemStore, visibleColumn } = internalData
|
|
481
482
|
const $xeTable = internalData.xeTable
|
|
482
483
|
|
|
483
484
|
const el = refElem.value
|
|
@@ -568,25 +569,28 @@ export default defineVxeComponent({
|
|
|
568
569
|
}
|
|
569
570
|
|
|
570
571
|
const colInfoElem = refColInfoElem.value
|
|
572
|
+
let viewCellWidth = 40
|
|
571
573
|
if (colInfoElem) {
|
|
572
|
-
|
|
574
|
+
viewCellWidth = colInfoElem.clientWidth || 40
|
|
573
575
|
}
|
|
574
|
-
let viewTableWidth =
|
|
576
|
+
let viewTableWidth = viewCellWidth * visibleColumn.length
|
|
575
577
|
if (bodyScrollElem) {
|
|
576
578
|
const viewWidth = bodyScrollElem.clientWidth
|
|
577
579
|
const remainWidth = viewWidth - viewTableWidth
|
|
578
580
|
if (remainWidth > 0) {
|
|
579
|
-
|
|
581
|
+
viewCellWidth += Math.floor(remainWidth / visibleColumn.length)
|
|
580
582
|
viewTableWidth = viewWidth
|
|
581
583
|
}
|
|
582
584
|
}
|
|
585
|
+
reactData.viewCellWidth = viewCellWidth
|
|
583
586
|
const headerTableElem = getRefElem(elemStore['main-header-table'])
|
|
584
587
|
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
588
|
+
const vmTableWidth = viewCellWidth * tableColumn.length
|
|
585
589
|
if (headerTableElem) {
|
|
586
590
|
headerTableElem.style.width = `${viewTableWidth}px`
|
|
587
591
|
}
|
|
588
592
|
if (bodyTableElem) {
|
|
589
|
-
bodyTableElem.style.width = `${
|
|
593
|
+
bodyTableElem.style.width = `${vmTableWidth}px`
|
|
590
594
|
}
|
|
591
595
|
|
|
592
596
|
reactData.scrollXWidth = viewTableWidth
|
|
@@ -594,16 +598,171 @@ export default defineVxeComponent({
|
|
|
594
598
|
return updateChart()
|
|
595
599
|
}
|
|
596
600
|
|
|
597
|
-
const
|
|
601
|
+
const handleRecalculateStyle = () => {
|
|
602
|
+
const el = refElem.value
|
|
603
|
+
internalData.rceRunTime = Date.now()
|
|
604
|
+
if (!el || !el.clientWidth) {
|
|
605
|
+
return nextTick()
|
|
606
|
+
}
|
|
598
607
|
calcScrollbar()
|
|
599
608
|
updateStyle()
|
|
600
609
|
updateChart()
|
|
610
|
+
return computeScrollLoad()
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
const handleLazyRecalculate = () => {
|
|
614
|
+
return new Promise<void>(resolve => {
|
|
615
|
+
const { rceTimeout, rceRunTime } = internalData
|
|
616
|
+
const $xeTable = internalData.xeTable
|
|
617
|
+
let refreshDelay = 50
|
|
618
|
+
if ($xeTable) {
|
|
619
|
+
const { computeResizeOpts } = $xeTable.getComputeMaps()
|
|
620
|
+
const resizeOpts = computeResizeOpts.value
|
|
621
|
+
refreshDelay = resizeOpts.refreshDelay || 50
|
|
622
|
+
}
|
|
623
|
+
if (rceTimeout) {
|
|
624
|
+
clearTimeout(rceTimeout)
|
|
625
|
+
if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
|
|
626
|
+
resolve(
|
|
627
|
+
handleRecalculateStyle()
|
|
628
|
+
)
|
|
629
|
+
} else {
|
|
630
|
+
nextTick(() => {
|
|
631
|
+
resolve()
|
|
632
|
+
})
|
|
633
|
+
}
|
|
634
|
+
} else {
|
|
635
|
+
resolve(
|
|
636
|
+
handleRecalculateStyle()
|
|
637
|
+
)
|
|
638
|
+
}
|
|
639
|
+
internalData.rceTimeout = setTimeout(() => {
|
|
640
|
+
internalData.rceTimeout = undefined
|
|
641
|
+
handleRecalculateStyle()
|
|
642
|
+
}, refreshDelay)
|
|
643
|
+
})
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
const computeScrollLoad = () => {
|
|
647
|
+
return nextTick().then(() => {
|
|
648
|
+
const { scrollXLoad } = reactData
|
|
649
|
+
const { scrollXStore } = internalData
|
|
650
|
+
// 计算 X 逻辑
|
|
651
|
+
if (scrollXLoad) {
|
|
652
|
+
const { toVisibleIndex: toXVisibleIndex, visibleSize: visibleXSize } = handleVirtualXVisible()
|
|
653
|
+
const offsetXSize = 2
|
|
654
|
+
scrollXStore.preloadSize = 1
|
|
655
|
+
scrollXStore.offsetSize = offsetXSize
|
|
656
|
+
scrollXStore.visibleSize = visibleXSize
|
|
657
|
+
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex)
|
|
658
|
+
scrollXStore.visibleStartIndex = Math.max(scrollXStore.startIndex, toXVisibleIndex)
|
|
659
|
+
scrollXStore.visibleEndIndex = Math.min(scrollXStore.endIndex, toXVisibleIndex + visibleXSize)
|
|
660
|
+
updateScrollXData().then(() => {
|
|
661
|
+
loadScrollXData()
|
|
662
|
+
})
|
|
663
|
+
} else {
|
|
664
|
+
updateScrollXSpace()
|
|
665
|
+
}
|
|
666
|
+
})
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
const handleVirtualXVisible = () => {
|
|
670
|
+
const { viewCellWidth } = reactData
|
|
671
|
+
const { elemStore } = internalData
|
|
672
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
673
|
+
if (bodyScrollElem) {
|
|
674
|
+
const clientWidth = bodyScrollElem.clientWidth
|
|
675
|
+
const scrollLeft = bodyScrollElem.scrollLeft
|
|
676
|
+
const toVisibleIndex = Math.floor(scrollLeft / viewCellWidth) - 1
|
|
677
|
+
const visibleSize = Math.ceil(clientWidth / viewCellWidth) + 1
|
|
678
|
+
return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(1, visibleSize) }
|
|
679
|
+
}
|
|
680
|
+
return { toVisibleIndex: 0, visibleSize: 6 }
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
const loadScrollXData = () => {
|
|
684
|
+
const { isScrollXBig } = reactData
|
|
685
|
+
const { scrollXStore } = internalData
|
|
686
|
+
const { preloadSize, startIndex, endIndex, offsetSize } = scrollXStore
|
|
687
|
+
const { toVisibleIndex, visibleSize } = handleVirtualXVisible()
|
|
688
|
+
const offsetItem = {
|
|
689
|
+
startIndex: Math.max(0, isScrollXBig ? toVisibleIndex - 1 : toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
690
|
+
endIndex: isScrollXBig ? toVisibleIndex + visibleSize : toVisibleIndex + visibleSize + offsetSize + preloadSize
|
|
691
|
+
}
|
|
692
|
+
scrollXStore.visibleStartIndex = toVisibleIndex - 1
|
|
693
|
+
scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1
|
|
694
|
+
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem
|
|
695
|
+
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
696
|
+
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
697
|
+
scrollXStore.startIndex = offsetStartIndex
|
|
698
|
+
scrollXStore.endIndex = offsetEndIndex
|
|
699
|
+
updateScrollXData()
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
const updateScrollXData = () => {
|
|
705
|
+
handleTableColumn()
|
|
706
|
+
updateScrollXSpace()
|
|
601
707
|
return nextTick()
|
|
602
708
|
}
|
|
603
709
|
|
|
604
|
-
|
|
710
|
+
const updateScrollXStatus = () => {
|
|
711
|
+
const scrollXLoad = true
|
|
712
|
+
reactData.scrollXLoad = scrollXLoad
|
|
713
|
+
return scrollXLoad
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
const handleTableColumn = () => {
|
|
717
|
+
const { scrollXLoad } = reactData
|
|
718
|
+
const { visibleColumn, scrollXStore } = internalData
|
|
719
|
+
const tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0)
|
|
720
|
+
reactData.tableColumn = tableColumn
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
const updateScrollXSpace = () => {
|
|
724
|
+
const { scrollXLoad, scrollXWidth, viewCellWidth } = reactData
|
|
725
|
+
const { elemStore, scrollXStore } = internalData
|
|
726
|
+
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
727
|
+
// const headerTableElem = getRefElem(elemStore['main-header-table'])
|
|
728
|
+
// const footerTableElem = getRefElem(elemStore['main-footer-table'])
|
|
729
|
+
|
|
730
|
+
const { startIndex } = scrollXStore
|
|
731
|
+
let xSpaceLeft = 0
|
|
732
|
+
if (scrollXLoad) {
|
|
733
|
+
xSpaceLeft = Math.max(0, startIndex * viewCellWidth)
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
// if (headerTableElem) {
|
|
737
|
+
// headerTableElem.style.transform = `translate(${xSpaceLeft}px, 0px)`
|
|
738
|
+
// }
|
|
739
|
+
if (bodyTableElem) {
|
|
740
|
+
bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`
|
|
741
|
+
}
|
|
742
|
+
// if (footerTableElem) {
|
|
743
|
+
// footerTableElem.style.transform = `translate(${xSpaceLeft}px, 0px)`
|
|
744
|
+
// }
|
|
745
|
+
|
|
746
|
+
const layoutList = ['header', 'body', 'footer']
|
|
747
|
+
layoutList.forEach(layout => {
|
|
748
|
+
const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`])
|
|
749
|
+
if (xSpaceElem) {
|
|
750
|
+
xSpaceElem.style.width = scrollXLoad ? `${scrollXWidth}px` : ''
|
|
751
|
+
}
|
|
752
|
+
})
|
|
753
|
+
|
|
754
|
+
const scrollXSpaceEl = refScrollXSpaceElem.value
|
|
755
|
+
if (scrollXSpaceEl) {
|
|
756
|
+
scrollXSpaceEl.style.width = `${scrollXWidth}px`
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
calcScrollbar()
|
|
760
|
+
return nextTick()
|
|
761
|
+
}
|
|
605
762
|
|
|
606
|
-
|
|
763
|
+
const triggerScrollXEvent = () => {
|
|
764
|
+
loadScrollXData()
|
|
765
|
+
}
|
|
607
766
|
|
|
608
767
|
const updateScrollYSpace = () => {
|
|
609
768
|
const { elemStore } = internalData
|
|
@@ -687,6 +846,13 @@ export default defineVxeComponent({
|
|
|
687
846
|
|
|
688
847
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
689
848
|
const handleScrollEvent = (evnt: Event, isRollY: boolean, isRollX: boolean, scrollTop: number, scrollLeft: number) => {
|
|
849
|
+
if (isRollX) {
|
|
850
|
+
internalData.lastScrollLeft = scrollLeft
|
|
851
|
+
}
|
|
852
|
+
if (isRollY) {
|
|
853
|
+
internalData.lastScrollTop = scrollTop
|
|
854
|
+
}
|
|
855
|
+
reactData.lastScrollTime = Date.now()
|
|
690
856
|
checkLastSyncScroll(isRollX, isRollY)
|
|
691
857
|
}
|
|
692
858
|
|
|
@@ -780,7 +946,8 @@ export default defineVxeComponent({
|
|
|
780
946
|
}
|
|
781
947
|
},
|
|
782
948
|
triggerBodyScrollEvent (evnt) {
|
|
783
|
-
const {
|
|
949
|
+
const { scrollXLoad } = reactData
|
|
950
|
+
const { elemStore, inVirtualScroll, inHeaderScroll, inFooterScroll, lastScrollLeft, lastScrollTop } = internalData
|
|
784
951
|
if (inVirtualScroll) {
|
|
785
952
|
return
|
|
786
953
|
}
|
|
@@ -791,36 +958,44 @@ export default defineVxeComponent({
|
|
|
791
958
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
|
|
792
959
|
const xHandleEl = refScrollXHandleElem.value
|
|
793
960
|
const yHandleEl = refScrollYHandleElem.value
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
syncTableScrollTop(currTopNum)
|
|
804
|
-
handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum)
|
|
805
|
-
}
|
|
806
|
-
},
|
|
807
|
-
triggerFooterScrollEvent (evnt) {
|
|
808
|
-
const { inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData
|
|
809
|
-
if (inVirtualScroll) {
|
|
810
|
-
return
|
|
961
|
+
const scrollLeft = wrapperEl.scrollLeft
|
|
962
|
+
const scrollTop = wrapperEl.scrollTop
|
|
963
|
+
const isRollX = scrollLeft !== lastScrollLeft
|
|
964
|
+
const isRollY = scrollTop !== lastScrollTop
|
|
965
|
+
internalData.inBodyScroll = true
|
|
966
|
+
internalData.scrollRenderType = ''
|
|
967
|
+
if (isRollY) {
|
|
968
|
+
setScrollTop(yHandleEl, scrollTop)
|
|
969
|
+
syncTableScrollTop(scrollTop)
|
|
811
970
|
}
|
|
812
|
-
if (
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
const currLeftNum = wrapperEl.scrollLeft
|
|
820
|
-
handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum)
|
|
971
|
+
if (isRollX) {
|
|
972
|
+
internalData.inBodyScroll = true
|
|
973
|
+
setScrollLeft(xHandleEl, scrollLeft)
|
|
974
|
+
setScrollLeft(headerScrollElem, scrollLeft)
|
|
975
|
+
if (scrollXLoad) {
|
|
976
|
+
triggerScrollXEvent()
|
|
977
|
+
}
|
|
821
978
|
}
|
|
979
|
+
handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, scrollLeft)
|
|
822
980
|
},
|
|
981
|
+
// triggerFooterScrollEvent (evnt) {
|
|
982
|
+
// const { inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData
|
|
983
|
+
// if (inVirtualScroll) {
|
|
984
|
+
// return
|
|
985
|
+
// }
|
|
986
|
+
// if (inHeaderScroll || inBodyScroll) {
|
|
987
|
+
// return
|
|
988
|
+
// }
|
|
989
|
+
// const wrapperEl = evnt.currentTarget as HTMLDivElement
|
|
990
|
+
// if (wrapperEl) {
|
|
991
|
+
// const isRollX = true
|
|
992
|
+
// const isRollY = false
|
|
993
|
+
// const currLeftNum = wrapperEl.scrollLeft
|
|
994
|
+
// handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum)
|
|
995
|
+
// }
|
|
996
|
+
// },
|
|
823
997
|
triggerVirtualScrollXEvent (evnt) {
|
|
998
|
+
const { scrollXLoad } = reactData
|
|
824
999
|
const { elemStore, inHeaderScroll, inBodyScroll } = internalData
|
|
825
1000
|
if (inHeaderScroll || inBodyScroll) {
|
|
826
1001
|
return
|
|
@@ -835,6 +1010,9 @@ export default defineVxeComponent({
|
|
|
835
1010
|
internalData.inVirtualScroll = true
|
|
836
1011
|
setScrollLeft(headerScrollElem, currLeftNum)
|
|
837
1012
|
setScrollLeft(bodyScrollElem, currLeftNum)
|
|
1013
|
+
if (scrollXLoad) {
|
|
1014
|
+
triggerScrollXEvent()
|
|
1015
|
+
}
|
|
838
1016
|
handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum)
|
|
839
1017
|
}
|
|
840
1018
|
},
|
|
@@ -856,26 +1034,11 @@ export default defineVxeComponent({
|
|
|
856
1034
|
}
|
|
857
1035
|
},
|
|
858
1036
|
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()
|
|
1037
|
+
return updateScrollXSpace()
|
|
1038
|
+
},
|
|
1039
|
+
handleUpdateSYSpace () {
|
|
1040
|
+
return updateScrollYSpace()
|
|
877
1041
|
},
|
|
878
|
-
handleUpdateSYSpace: updateScrollYSpace,
|
|
879
1042
|
handleUpdateSYStatus (sYLoad) {
|
|
880
1043
|
reactData.scrollYLoad = sYLoad
|
|
881
1044
|
}
|
|
@@ -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', {
|
|
@@ -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