vxe-gantt 4.0.5 → 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.
Files changed (46) hide show
  1. package/es/gantt/src/emits.js +3 -1
  2. package/es/gantt/src/gantt-chart.js +18 -4
  3. package/es/gantt/src/gantt-header.js +17 -9
  4. package/es/gantt/src/gantt-view.js +259 -106
  5. package/es/gantt/src/gantt.js +9 -9
  6. package/es/gantt/style.css +7 -1
  7. package/es/gantt/style.min.css +1 -1
  8. package/es/style.css +1 -1
  9. package/es/style.min.css +1 -1
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-gantt/style.css +7 -1
  13. package/es/vxe-gantt/style.min.css +1 -1
  14. package/lib/gantt/src/emits.js +1 -1
  15. package/lib/gantt/src/emits.min.js +1 -1
  16. package/lib/gantt/src/gantt-chart.js +24 -4
  17. package/lib/gantt/src/gantt-chart.min.js +1 -1
  18. package/lib/gantt/src/gantt-header.js +26 -14
  19. package/lib/gantt/src/gantt-header.min.js +1 -1
  20. package/lib/gantt/src/gantt-view.js +317 -116
  21. package/lib/gantt/src/gantt-view.min.js +1 -1
  22. package/lib/gantt/src/gantt.js +7 -7
  23. package/lib/gantt/src/gantt.min.js +1 -1
  24. package/lib/gantt/style/style.css +7 -1
  25. package/lib/gantt/style/style.min.css +1 -1
  26. package/lib/index.umd.js +377 -144
  27. package/lib/index.umd.min.js +1 -1
  28. package/lib/style.css +1 -1
  29. package/lib/style.min.css +1 -1
  30. package/lib/ui/index.js +1 -1
  31. package/lib/ui/index.min.js +1 -1
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/ui/src/log.min.js +1 -1
  34. package/lib/vxe-gantt/style/style.css +7 -1
  35. package/lib/vxe-gantt/style/style.min.css +1 -1
  36. package/package.json +3 -3
  37. package/packages/gantt/src/emits.ts +3 -1
  38. package/packages/gantt/src/gantt-chart.ts +20 -4
  39. package/packages/gantt/src/gantt-header.ts +18 -10
  40. package/packages/gantt/src/gantt-view.ts +273 -110
  41. package/packages/gantt/src/gantt.ts +7 -7
  42. package/styles/components/gantt-module/gantt-chart.scss +2 -0
  43. package/styles/components/gantt.scss +6 -1
  44. package/styles/theme/base.scss +1 -1
  45. package/styles/theme/dark.scss +1 -0
  46. 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
- // 存放纵向 Y 虚拟滚动相关信息
33
- scrollYStore: {
34
- preloadSize: 0,
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
- const groupCols: VxeGanttDefines.HeaderColumn[] = []
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
- case 'day':
166
- case 'date':
167
- if (diffDayNum > (1000 * 60 * 60 * 24 * 366 * 3)) {
168
- reactData.tableColumn = []
169
- reactData.headerGroups = []
170
- return
171
- }
172
- break
173
- case 'hour':
174
- if (diffDayNum > (1000 * 60 * 60 * 24 * 31 * 3)) {
175
- reactData.tableColumn = []
176
- reactData.headerGroups = []
177
- return
178
- }
179
- break
180
- case 'minute':
181
- if (diffDayNum > (1000 * 60 * 60 * 24 * 3)) {
182
- reactData.tableColumn = []
183
- reactData.headerGroups = []
184
- return
185
- }
186
- break
187
- case 'second':
188
- if (diffDayNum > (1000 * 60 * 60 * 3)) {
189
- reactData.tableColumn = []
190
- reactData.headerGroups = []
191
- return
192
- }
193
- break
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: [],
@@ -248,47 +247,47 @@ export default defineVxeComponent({
248
247
  year: {
249
248
  field: yyyy,
250
249
  title: yyyy,
251
- params: dateObj
250
+ dateObj
252
251
  },
253
252
  quarter: {
254
253
  field: `${yyyy}_q${q}`,
255
- title: q,
256
- params: dateObj
254
+ title: `${q}`,
255
+ dateObj
257
256
  },
258
257
  month: {
259
258
  field: `${yyyy}_${MM}`,
260
259
  title: MM,
261
- params: dateObj
260
+ dateObj
262
261
  },
263
262
  week: {
264
263
  field: `${yyyy}_W${W}`,
265
- title: W,
266
- params: dateObj
264
+ title: `${W}`,
265
+ dateObj
267
266
  },
268
267
  day: {
269
268
  field: `${yyyy}_${MM}_${dd}_E${E}`,
270
- title: E,
271
- params: dateObj
269
+ title: `${E}`,
270
+ dateObj
272
271
  },
273
272
  date: {
274
273
  field: `${yyyy}_${MM}_${dd}`,
275
274
  title: dd,
276
- params: dateObj
275
+ dateObj
277
276
  },
278
277
  hour: {
279
278
  field: `${yyyy}_${MM}_${dd}_${HH}`,
280
279
  title: HH,
281
- params: dateObj
280
+ dateObj
282
281
  },
283
282
  minute: {
284
283
  field: `${yyyy}_${MM}_${dd}_${HH}_${mm}`,
285
284
  title: mm,
286
- params: dateObj
285
+ dateObj
287
286
  },
288
287
  second: {
289
288
  field: `${yyyy}_${MM}_${dd}_${HH}_${mm}_${ss}`,
290
289
  title: ss,
291
- params: dateObj
290
+ dateObj
292
291
  }
293
292
  }
294
293
  const minCol = colMaps[minSType]
@@ -379,8 +378,10 @@ export default defineVxeComponent({
379
378
  internalData.chartMaps = ctMaps
380
379
  }
381
380
  }
382
- reactData.tableColumn = fullCols
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, tableColumn, headerGroups } = reactData
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
- reactData.viewCellWidth = colInfoElem.clientWidth || 40
574
+ viewCellWidth = colInfoElem.clientWidth || 40
573
575
  }
574
- let viewTableWidth = reactData.viewCellWidth * tableColumn.length
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
- reactData.viewCellWidth += Math.floor(remainWidth / tableColumn.length)
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 = `${viewTableWidth}px`
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 handleLazyRecalculate = () => {
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
- // const updateScrollXSpace = () => {
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 { elemStore, inVirtualScroll, inHeaderScroll, inFooterScroll } = internalData
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
- if (headerScrollElem && wrapperEl) {
795
- const isRollX = true
796
- const isRollY = true
797
- const currLeftNum = wrapperEl.scrollLeft
798
- const currTopNum = wrapperEl.scrollTop
799
- internalData.inBodyScroll = true
800
- setScrollLeft(xHandleEl, currLeftNum)
801
- setScrollLeft(headerScrollElem, currLeftNum)
802
- setScrollTop(yHandleEl, currTopNum)
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 (inHeaderScroll || inBodyScroll) {
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)
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
- const { scrollXLoad, scrollXWidth } = reactData
860
- const { elemStore } = internalData
861
-
862
- const layoutList = ['header', 'body', 'footer']
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
  }
@@ -273,7 +273,7 @@ export default defineVxeComponent({
273
273
  stys.maxHeight = maxHeight === 'auto' || maxHeight === '100%' ? '100%' : toCssUnit(maxHeight)
274
274
  }
275
275
  }
276
- if (barStyle) {
276
+ if (barStyle && !XEUtils.isFunction(barStyle)) {
277
277
  const { bgColor, completedBgColor } = barStyle
278
278
  if (bgColor) {
279
279
  stys['--vxe-ui-gantt-view-task-bar-background-color'] = bgColor
@@ -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
- }, '10px'),
1932
+ }),
1933
1933
  h('div', {
1934
1934
  class: 'vxe-gantt--resizable-split-number-right'
1935
- }, '20px')
1935
+ })
1936
1936
  ])
1937
1937
  ]),
1938
1938
  h('div', {
@@ -6,6 +6,8 @@
6
6
  }
7
7
  .vxe-gantt-view--chart-row {
8
8
  position: relative;
9
+ width: 100%;
10
+ height: 0;
9
11
  &.is--round {
10
12
  & > .vxe-gantt-view--chart-bar,
11
13
  & > .vxe-gantt-view--chart-custom-bar {
@@ -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
- background-color: var(--vxe-ui-font-primary-lighten-color);
333
+ color: #ffffff;
334
+ background-color: var(--vxe-ui-font-primary-color);
330
335
  }
331
336
  &:active {
332
337
  transform: scale(0.9);
@@ -1,6 +1,6 @@
1
1
  :root {
2
2
  /*gantt*/
3
- --vxe-ui-gantt-view-default-cell-width: 2.2em;
3
+ --vxe-ui-gantt-view-default-cell-width: 2.6em;
4
4
  --vxe-ui-gantt-view-chart-bar-height: 1.6em;
5
5
  --vxe-ui-gantt-view-split-bar-width: 10px;
6
6
  --vxe-ui-gantt-view-split-bar-height: 6.8em;
@@ -4,4 +4,5 @@
4
4
  /*gantt*/
5
5
  --vxe-ui-gantt-view-handle-background-color: #9f9f9f;
6
6
  --vxe-ui-gantt-view-split-bar-background-color: #444444;
7
+ --vxe-ui-gantt-view-split-bar-hover-background-color: #606060;
7
8
  }
@@ -4,4 +4,5 @@
4
4
  /*gantt*/
5
5
  --vxe-ui-gantt-view-handle-background-color: #8b8b8b;
6
6
  --vxe-ui-gantt-view-split-bar-background-color: #e2e2e3;
7
+ --vxe-ui-gantt-view-split-bar-hover-background-color: #d8d8d8;
7
8
  }