vxe-gantt 3.0.6 → 3.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.
@@ -20,8 +20,10 @@ export default defineVxeComponent({
20
20
  const _vm = this;
21
21
  const $xeGantt = _vm.$xeGantt;
22
22
  const $xeGanttView = _vm.$xeGanttView;
23
- const { reactData } = $xeGanttView;
24
- const { tableColumn, headerGroups, viewCellWidth } = reactData;
23
+ const reactData = $xeGanttView.reactData;
24
+ const internalData = $xeGanttView.internalData;
25
+ const { headerGroups, viewCellWidth } = reactData;
26
+ const { visibleColumn } = internalData;
25
27
  return h('div', {
26
28
  ref: 'refElem',
27
29
  class: 'vxe-gantt-view--header-wrapper'
@@ -41,7 +43,7 @@ export default defineVxeComponent({
41
43
  ref: 'refHeaderTable',
42
44
  class: 'vxe-gantt-view--header-table'
43
45
  }, [
44
- h('colgroup', {}, tableColumn.map((column, cIndex) => {
46
+ h('colgroup', {}, visibleColumn.map((column, cIndex) => {
45
47
  return h('col', {
46
48
  key: cIndex,
47
49
  style: {
@@ -10,6 +10,7 @@ const { globalEvents } = VxeUI;
10
10
  function createInternalData() {
11
11
  return {
12
12
  xeTable: null,
13
+ visibleColumn: [],
13
14
  startMaps: {},
14
15
  endMaps: {},
15
16
  chartMaps: {},
@@ -24,16 +25,9 @@ function createInternalData() {
24
25
  startIndex: 0,
25
26
  endIndex: 0
26
27
  },
27
- // 存放纵向 Y 虚拟滚动相关信息
28
- scrollYStore: {
29
- preloadSize: 0,
30
- offsetSize: 0,
31
- visibleSize: 0,
32
- visibleStartIndex: 0,
33
- visibleEndIndex: 0,
34
- startIndex: 0,
35
- endIndex: 0
36
- }
28
+ // 最后滚动位置
29
+ lastScrollTop: 0,
30
+ lastScrollLeft: 0
37
31
  };
38
32
  }
39
33
  const maxYHeight = 5e6;
@@ -53,9 +47,12 @@ function handleParseColumn($xeGanttView) {
53
47
  const { treeConfig } = ganttProps;
54
48
  const { taskScaleList } = ganttReactData;
55
49
  const { minViewDate, maxViewDate } = reactData;
50
+ const { scrollXStore } = internalData;
56
51
  const minScale = XEUtils.last(taskScaleList);
57
52
  const fullCols = [];
58
53
  const groupCols = [];
54
+ scrollXStore.startIndex = 0;
55
+ scrollXStore.endIndex = 1;
59
56
  if (minScale && minViewDate && maxViewDate) {
60
57
  const minSType = minScale.type;
61
58
  const weekScale = taskScaleList.find(item => item.type === 'week');
@@ -77,37 +74,37 @@ function handleParseColumn($xeGanttView) {
77
74
  const currTime = minViewDate.getTime();
78
75
  const diffDayNum = maxViewDate.getTime() - minViewDate.getTime();
79
76
  const countSize = Math.max(5, Math.floor(diffDayNum / gapTime) + 1);
80
- switch (minScale.type) {
81
- case 'day':
82
- case 'date':
83
- if (diffDayNum > (1000 * 60 * 60 * 24 * 366 * 3)) {
84
- reactData.tableColumn = [];
85
- reactData.headerGroups = [];
86
- return;
87
- }
88
- break;
89
- case 'hour':
90
- if (diffDayNum > (1000 * 60 * 60 * 24 * 31 * 3)) {
91
- reactData.tableColumn = [];
92
- reactData.headerGroups = [];
93
- return;
94
- }
95
- break;
96
- case 'minute':
97
- if (diffDayNum > (1000 * 60 * 60 * 24 * 3)) {
98
- reactData.tableColumn = [];
99
- reactData.headerGroups = [];
100
- return;
101
- }
102
- break;
103
- case 'second':
104
- if (diffDayNum > (1000 * 60 * 60 * 3)) {
105
- reactData.tableColumn = [];
106
- reactData.headerGroups = [];
107
- return;
108
- }
109
- break;
110
- }
77
+ // switch (minScale.type) {
78
+ // case 'day':
79
+ // case 'date':
80
+ // if (diffDayNum > (1000 * 60 * 60 * 24 * 366 * 3)) {
81
+ // reactData.tableColumn = []
82
+ // reactData.headerGroups = []
83
+ // return
84
+ // }
85
+ // break
86
+ // case 'hour':
87
+ // if (diffDayNum > (1000 * 60 * 60 * 24 * 31 * 3)) {
88
+ // reactData.tableColumn = []
89
+ // reactData.headerGroups = []
90
+ // return
91
+ // }
92
+ // break
93
+ // case 'minute':
94
+ // if (diffDayNum > (1000 * 60 * 60 * 24 * 3)) {
95
+ // reactData.tableColumn = []
96
+ // reactData.headerGroups = []
97
+ // return
98
+ // }
99
+ // break
100
+ // case 'second':
101
+ // if (diffDayNum > (1000 * 60 * 60 * 3)) {
102
+ // reactData.tableColumn = []
103
+ // reactData.headerGroups = []
104
+ // return
105
+ // }
106
+ // break
107
+ // }
111
108
  const renderListMaps = {
112
109
  year: [],
113
110
  quarter: [],
@@ -287,8 +284,10 @@ function handleParseColumn($xeGanttView) {
287
284
  internalData.chartMaps = ctMaps;
288
285
  }
289
286
  }
290
- reactData.tableColumn = fullCols;
287
+ internalData.visibleColumn = fullCols;
291
288
  reactData.headerGroups = groupCols;
289
+ updateScrollXStatus($xeGanttView);
290
+ handleTableColumn($xeGanttView);
292
291
  }
293
292
  function handleUpdateData($xeGanttView) {
294
293
  const $xeGantt = $xeGanttView.$xeGantt;
@@ -387,8 +386,8 @@ function updateStyle($xeGanttView) {
387
386
  const $xeGantt = $xeGanttView.$xeGantt;
388
387
  const reactData = $xeGanttView.reactData;
389
388
  const internalData = $xeGanttView.internalData;
390
- const { scrollbarWidth, scrollbarHeight, tableColumn, headerGroups } = reactData;
391
- const { elemStore } = internalData;
389
+ const { scrollbarWidth, scrollbarHeight, headerGroups, tableColumn } = reactData;
390
+ const { elemStore, visibleColumn } = internalData;
392
391
  const $xeTable = internalData.xeTable;
393
392
  const el = $xeGanttView.$refs.refElem;
394
393
  if (!el || !el.clientHeight) {
@@ -469,82 +468,194 @@ function updateStyle($xeGanttView) {
469
468
  yBottomCornerEl.style.display = tFooterHeight ? 'block' : '';
470
469
  }
471
470
  const colInfoElem = $xeGanttView.$refs.refColInfoElem;
471
+ let viewCellWidth = 40;
472
472
  if (colInfoElem) {
473
- reactData.viewCellWidth = colInfoElem.clientWidth || 40;
473
+ viewCellWidth = colInfoElem.clientWidth || 40;
474
474
  }
475
- let viewTableWidth = reactData.viewCellWidth * tableColumn.length;
475
+ let viewTableWidth = viewCellWidth * visibleColumn.length;
476
476
  if (bodyScrollElem) {
477
477
  const viewWidth = bodyScrollElem.clientWidth;
478
478
  const remainWidth = viewWidth - viewTableWidth;
479
479
  if (remainWidth > 0) {
480
- reactData.viewCellWidth += Math.floor(remainWidth / tableColumn.length);
480
+ viewCellWidth += Math.floor(remainWidth / visibleColumn.length);
481
481
  viewTableWidth = viewWidth;
482
482
  }
483
483
  }
484
+ reactData.viewCellWidth = viewCellWidth;
484
485
  const headerTableElem = getRefElem(elemStore['main-header-table']);
485
486
  const bodyTableElem = getRefElem(elemStore['main-body-table']);
487
+ const vmTableWidth = viewCellWidth * tableColumn.length;
486
488
  if (headerTableElem) {
487
489
  headerTableElem.style.width = `${viewTableWidth}px`;
488
490
  }
489
491
  if (bodyTableElem) {
490
- bodyTableElem.style.width = `${viewTableWidth}px`;
492
+ bodyTableElem.style.width = `${vmTableWidth}px`;
491
493
  }
492
494
  reactData.scrollXWidth = viewTableWidth;
493
495
  return updateChart($xeGanttView);
494
496
  }
495
- function handleLazyRecalculate($xeGanttView) {
497
+ function handleRecalculateStyle($xeGanttView) {
498
+ const internalData = $xeGanttView.internalData;
499
+ const el = $xeGanttView.$refs.refElem;
500
+ internalData.rceRunTime = Date.now();
501
+ if (!el || !el.clientWidth) {
502
+ return $xeGanttView.$nextTick();
503
+ }
496
504
  calcScrollbar($xeGanttView);
497
505
  updateStyle($xeGanttView);
498
506
  updateChart($xeGanttView);
507
+ return computeScrollLoad($xeGanttView);
508
+ }
509
+ function handleLazyRecalculate($xeGanttView) {
510
+ const internalData = $xeGanttView.internalData;
511
+ return new Promise(resolve => {
512
+ const { rceTimeout, rceRunTime } = internalData;
513
+ const $xeTable = internalData.xeTable;
514
+ let refreshDelay = 50;
515
+ if ($xeTable) {
516
+ const resizeOpts = $xeTable.computeResizeOpts;
517
+ refreshDelay = resizeOpts.refreshDelay || 50;
518
+ }
519
+ if (rceTimeout) {
520
+ clearTimeout(rceTimeout);
521
+ if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
522
+ resolve(handleRecalculateStyle($xeGanttView));
523
+ }
524
+ else {
525
+ $xeGanttView.$nextTick(() => {
526
+ resolve();
527
+ });
528
+ }
529
+ }
530
+ else {
531
+ resolve(handleRecalculateStyle($xeGanttView));
532
+ }
533
+ internalData.rceTimeout = setTimeout(() => {
534
+ internalData.rceTimeout = undefined;
535
+ handleRecalculateStyle($xeGanttView);
536
+ }, refreshDelay);
537
+ });
538
+ }
539
+ function computeScrollLoad($xeGanttView) {
540
+ const reactData = $xeGanttView.reactData;
541
+ const internalData = $xeGanttView.internalData;
542
+ return $xeGanttView.$nextTick().then(() => {
543
+ const { scrollXLoad } = reactData;
544
+ const { scrollXStore } = internalData;
545
+ // 计算 X 逻辑
546
+ if (scrollXLoad) {
547
+ const { toVisibleIndex: toXVisibleIndex, visibleSize: visibleXSize } = handleVirtualXVisible($xeGanttView);
548
+ const offsetXSize = 2;
549
+ scrollXStore.preloadSize = 1;
550
+ scrollXStore.offsetSize = offsetXSize;
551
+ scrollXStore.visibleSize = visibleXSize;
552
+ scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
553
+ scrollXStore.visibleStartIndex = Math.max(scrollXStore.startIndex, toXVisibleIndex);
554
+ scrollXStore.visibleEndIndex = Math.min(scrollXStore.endIndex, toXVisibleIndex + visibleXSize);
555
+ updateScrollXData($xeGanttView).then(() => {
556
+ loadScrollXData($xeGanttView);
557
+ });
558
+ }
559
+ else {
560
+ updateScrollXSpace($xeGanttView);
561
+ }
562
+ });
563
+ }
564
+ function handleVirtualXVisible($xeGanttView) {
565
+ const reactData = $xeGanttView.reactData;
566
+ const internalData = $xeGanttView.internalData;
567
+ const { viewCellWidth } = reactData;
568
+ const { elemStore } = internalData;
569
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
570
+ if (bodyScrollElem) {
571
+ const clientWidth = bodyScrollElem.clientWidth;
572
+ const scrollLeft = bodyScrollElem.scrollLeft;
573
+ const toVisibleIndex = Math.floor(scrollLeft / viewCellWidth) - 1;
574
+ const visibleSize = Math.ceil(clientWidth / viewCellWidth) + 1;
575
+ return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(1, visibleSize) };
576
+ }
577
+ return { toVisibleIndex: 0, visibleSize: 6 };
578
+ }
579
+ function loadScrollXData($xeGanttView) {
580
+ const reactData = $xeGanttView.reactData;
581
+ const internalData = $xeGanttView.internalData;
582
+ const { isScrollXBig } = reactData;
583
+ const { scrollXStore } = internalData;
584
+ const { preloadSize, startIndex, endIndex, offsetSize } = scrollXStore;
585
+ const { toVisibleIndex, visibleSize } = handleVirtualXVisible($xeGanttView);
586
+ const offsetItem = {
587
+ startIndex: Math.max(0, isScrollXBig ? toVisibleIndex - 1 : toVisibleIndex - 1 - offsetSize - preloadSize),
588
+ endIndex: isScrollXBig ? toVisibleIndex + visibleSize : toVisibleIndex + visibleSize + offsetSize + preloadSize
589
+ };
590
+ scrollXStore.visibleStartIndex = toVisibleIndex - 1;
591
+ scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
592
+ const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
593
+ if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
594
+ if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
595
+ scrollXStore.startIndex = offsetStartIndex;
596
+ scrollXStore.endIndex = offsetEndIndex;
597
+ updateScrollXData($xeGanttView);
598
+ }
599
+ }
600
+ }
601
+ function updateScrollXData($xeGanttView) {
602
+ handleTableColumn($xeGanttView);
603
+ updateScrollXSpace($xeGanttView);
499
604
  return $xeGanttView.$nextTick();
500
605
  }
501
- // function updateScrollXSpace ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods) {
502
- // const reactData = $xeGanttView.reactData
503
- // const internalData = $xeGanttView.internalData
504
- // const { scrollXLoad, scrollXWidth } = reactData
505
- // const { elemStore } = internalData
506
- // const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
507
- // const bodyTableElem = getRefElem(elemStore['main-body-table'])
508
- // let xSpaceLeft = 0
509
- // let clientWidth = 0
510
- // if (bodyScrollElem) {
511
- // clientWidth = bodyScrollElem.clientWidth
512
- // }
513
- // // 虚拟渲染
514
- // let isScrollXBig = false
515
- // let ySpaceWidth = scrollXWidth
516
- // if (scrollXWidth > maxXWidth) {
517
- // // 触右
518
- // if (bodyScrollElem && bodyTableElem && bodyScrollElem.scrollLeft + clientWidth >= maxXWidth) {
519
- // xSpaceLeft = maxXWidth - bodyTableElem.clientWidth
520
- // } else {
521
- // xSpaceLeft = (maxXWidth - clientWidth) * (xSpaceLeft / (scrollXWidth - clientWidth))
522
- // }
523
- // ySpaceWidth = maxXWidth
524
- // isScrollXBig = true
525
- // }
526
- // if (bodyTableElem) {
527
- // bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`
528
- // }
529
- // const layoutList = ['header', 'body', 'footer']
530
- // layoutList.forEach(layout => {
531
- // const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`])
532
- // if (xSpaceElem) {
533
- // xSpaceElem.style.width = scrollXLoad ? `${ySpaceWidth}px` : ''
534
- // }
535
- // })
536
- // reactData.scrollXLeft = xSpaceLeft
537
- // reactData.scrollXWidth = ySpaceWidth
538
- // reactData.isScrollXBig = isScrollXBig
539
- // const scrollXSpaceEl = $xeGanttView.$refs.refScrollXSpaceElem as HTMLDivElement
540
- // if (scrollXSpaceEl) {
541
- // scrollXSpaceEl.style.width = `${ySpaceWidth}px`
542
- // }
543
- // calcScrollbar($xeGanttView)
544
- // return $xeGanttView.$nextTick().then(() => {
545
- // updateStyle($xeGanttView)
546
- // })
547
- // }
606
+ function updateScrollXStatus($xeGanttView) {
607
+ const reactData = $xeGanttView.reactData;
608
+ const scrollXLoad = true;
609
+ reactData.scrollXLoad = scrollXLoad;
610
+ return scrollXLoad;
611
+ }
612
+ function handleTableColumn($xeGanttView) {
613
+ const reactData = $xeGanttView.reactData;
614
+ const internalData = $xeGanttView.internalData;
615
+ const { scrollXLoad } = reactData;
616
+ const { visibleColumn, scrollXStore } = internalData;
617
+ const tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0);
618
+ reactData.tableColumn = tableColumn;
619
+ }
620
+ function updateScrollXSpace($xeGanttView) {
621
+ const reactData = $xeGanttView.reactData;
622
+ const internalData = $xeGanttView.internalData;
623
+ const { scrollXLoad, scrollXWidth, viewCellWidth } = reactData;
624
+ const { elemStore, scrollXStore } = internalData;
625
+ const bodyTableElem = getRefElem(elemStore['main-body-table']);
626
+ // const headerTableElem = getRefElem(elemStore['main-header-table'])
627
+ // const footerTableElem = getRefElem(elemStore['main-footer-table'])
628
+ const { startIndex } = scrollXStore;
629
+ let xSpaceLeft = 0;
630
+ if (scrollXLoad) {
631
+ xSpaceLeft = Math.max(0, startIndex * viewCellWidth);
632
+ }
633
+ // if (headerTableElem) {
634
+ // headerTableElem.style.transform = `translate(${xSpaceLeft}px, 0px)`
635
+ // }
636
+ if (bodyTableElem) {
637
+ bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`;
638
+ }
639
+ // if (footerTableElem) {
640
+ // footerTableElem.style.transform = `translate(${xSpaceLeft}px, 0px)`
641
+ // }
642
+ const layoutList = ['header', 'body', 'footer'];
643
+ layoutList.forEach(layout => {
644
+ const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`]);
645
+ if (xSpaceElem) {
646
+ xSpaceElem.style.width = scrollXLoad ? `${scrollXWidth}px` : '';
647
+ }
648
+ });
649
+ const scrollXSpaceEl = $xeGanttView.$refs.refScrollXSpaceElem;
650
+ if (scrollXSpaceEl) {
651
+ scrollXSpaceEl.style.width = `${scrollXWidth}px`;
652
+ }
653
+ calcScrollbar($xeGanttView);
654
+ return $xeGanttView.$nextTick();
655
+ }
656
+ function triggerScrollXEvent($xeGanttView) {
657
+ loadScrollXData($xeGanttView);
658
+ }
548
659
  function updateScrollYSpace($xeGanttView) {
549
660
  const reactData = $xeGanttView.reactData;
550
661
  const internalData = $xeGanttView.internalData;
@@ -673,6 +784,8 @@ export default defineVxeComponent({
673
784
  scrollbarWidth: 0,
674
785
  // 横向滚动条的高度
675
786
  scrollbarHeight: 0,
787
+ // 最后滚动时间戳
788
+ lastScrollTime: 0,
676
789
  lazScrollLoading: false,
677
790
  scrollVMLoading: false,
678
791
  scrollYHeight: 0,
@@ -791,8 +904,10 @@ export default defineVxeComponent({
791
904
  },
792
905
  triggerBodyScrollEvent(evnt) {
793
906
  const $xeGanttView = this;
907
+ const reactData = $xeGanttView.reactData;
794
908
  const internalData = $xeGanttView.internalData;
795
- const { elemStore, inVirtualScroll, inHeaderScroll, inFooterScroll } = internalData;
909
+ const { scrollXLoad } = reactData;
910
+ const { elemStore, inVirtualScroll, inHeaderScroll, inFooterScroll, lastScrollLeft, lastScrollTop } = internalData;
796
911
  if (inVirtualScroll) {
797
912
  return;
798
913
  }
@@ -803,40 +918,49 @@ export default defineVxeComponent({
803
918
  const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
804
919
  const xHandleEl = $xeGanttView.$refs.refScrollXHandleElem;
805
920
  const yHandleEl = $xeGanttView.$refs.refScrollYHandleElem;
806
- if (headerScrollElem && wrapperEl) {
807
- const isRollX = true;
808
- const isRollY = true;
809
- const currLeftNum = wrapperEl.scrollLeft;
810
- const currTopNum = wrapperEl.scrollTop;
811
- internalData.inBodyScroll = true;
812
- setScrollLeft(xHandleEl, currLeftNum);
813
- setScrollLeft(headerScrollElem, currLeftNum);
814
- setScrollTop(yHandleEl, currTopNum);
815
- syncTableScrollTop($xeGanttView, currTopNum);
816
- handleScrollEvent($xeGanttView, evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum);
921
+ const scrollLeft = wrapperEl.scrollLeft;
922
+ const scrollTop = wrapperEl.scrollTop;
923
+ const isRollX = scrollLeft !== lastScrollLeft;
924
+ const isRollY = scrollTop !== lastScrollTop;
925
+ internalData.inBodyScroll = true;
926
+ internalData.scrollRenderType = '';
927
+ if (isRollY) {
928
+ setScrollTop(yHandleEl, scrollTop);
929
+ syncTableScrollTop($xeGanttView, scrollTop);
817
930
  }
818
- },
819
- triggerFooterScrollEvent(evnt) {
820
- const $xeGanttView = this;
821
- const internalData = $xeGanttView.internalData;
822
- const { inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData;
823
- if (inVirtualScroll) {
824
- return;
825
- }
826
- if (inHeaderScroll || inBodyScroll) {
827
- return;
828
- }
829
- const wrapperEl = evnt.currentTarget;
830
- if (wrapperEl) {
831
- const isRollX = true;
832
- const isRollY = false;
833
- const currLeftNum = wrapperEl.scrollLeft;
834
- handleScrollEvent($xeGanttView, evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum);
931
+ if (isRollX) {
932
+ internalData.inBodyScroll = true;
933
+ setScrollLeft(xHandleEl, scrollLeft);
934
+ setScrollLeft(headerScrollElem, scrollLeft);
935
+ if (scrollXLoad) {
936
+ triggerScrollXEvent($xeGanttView);
937
+ }
835
938
  }
939
+ handleScrollEvent($xeGanttView, evnt, isRollY, isRollX, wrapperEl.scrollTop, scrollLeft);
836
940
  },
941
+ // triggerFooterScrollEvent (evnt: Event) {
942
+ // const $xeGanttView = this
943
+ // const internalData = $xeGanttView.internalData
944
+ // const { inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData
945
+ // if (inVirtualScroll) {
946
+ // return
947
+ // }
948
+ // if (inHeaderScroll || inBodyScroll) {
949
+ // return
950
+ // }
951
+ // const wrapperEl = evnt.currentTarget as HTMLDivElement
952
+ // if (wrapperEl) {
953
+ // const isRollX = true
954
+ // const isRollY = false
955
+ // const currLeftNum = wrapperEl.scrollLeft
956
+ // handleScrollEvent($xeGanttView, evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum)
957
+ // }
958
+ // },
837
959
  triggerVirtualScrollXEvent(evnt) {
838
960
  const $xeGanttView = this;
961
+ const reactData = $xeGanttView.reactData;
839
962
  const internalData = $xeGanttView.internalData;
963
+ const { scrollXLoad } = reactData;
840
964
  const { elemStore, inHeaderScroll, inBodyScroll } = internalData;
841
965
  if (inHeaderScroll || inBodyScroll) {
842
966
  return;
@@ -851,6 +975,9 @@ export default defineVxeComponent({
851
975
  internalData.inVirtualScroll = true;
852
976
  setScrollLeft(headerScrollElem, currLeftNum);
853
977
  setScrollLeft(bodyScrollElem, currLeftNum);
978
+ if (scrollXLoad) {
979
+ triggerScrollXEvent($xeGanttView);
980
+ }
854
981
  handleScrollEvent($xeGanttView, evnt, isRollY, isRollX, wrapperEl.scrollTop, currLeftNum);
855
982
  }
856
983
  },
@@ -875,23 +1002,7 @@ export default defineVxeComponent({
875
1002
  },
876
1003
  handleUpdateSXSpace() {
877
1004
  const $xeGanttView = this;
878
- const reactData = $xeGanttView.reactData;
879
- const internalData = $xeGanttView.internalData;
880
- const { scrollXLoad, scrollXWidth } = reactData;
881
- const { elemStore } = internalData;
882
- const layoutList = ['header', 'body', 'footer'];
883
- layoutList.forEach(layout => {
884
- const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`]);
885
- if (xSpaceElem) {
886
- xSpaceElem.style.width = scrollXLoad ? `${scrollXWidth}px` : '';
887
- }
888
- });
889
- const scrollXSpaceEl = $xeGanttView.$refs.refScrollXSpaceElem;
890
- if (scrollXSpaceEl) {
891
- scrollXSpaceEl.style.width = `${scrollXWidth}px`;
892
- }
893
- calcScrollbar($xeGanttView);
894
- return $xeGanttView.$nextTick();
1005
+ return updateScrollXSpace($xeGanttView);
895
1006
  },
896
1007
  handleUpdateSYSpace() {
897
1008
  const $xeGanttView = this;
@@ -445,7 +445,7 @@ export default {
445
445
  });
446
446
  }
447
447
  if (!scaleConfs.length) {
448
- scaleConfs.push({ type: 'month', level: viewTypeLevelMaps.month }, { type: 'day', level: viewTypeLevelMaps.day });
448
+ scaleConfs.push({ type: 'month', level: viewTypeLevelMaps.month }, { type: 'date', level: viewTypeLevelMaps.date });
449
449
  }
450
450
  reactData.taskScaleList = XEUtils.orderBy(scaleConfs, { field: 'level', order: 'desc' });
451
451
  },
@@ -717,23 +717,23 @@ export default {
717
717
  let tipHeight = 0;
718
718
  if (rsNumLeftEl) {
719
719
  if (offsetLeft < 0) {
720
+ rsNumLeftEl.style.display = 'none';
721
+ }
722
+ else {
720
723
  rsNumLeftEl.textContent = `${targetTableWidth}px`;
721
724
  rsNumLeftEl.style.display = 'block';
722
725
  tipHeight = rsNumLeftEl.offsetHeight;
723
726
  }
724
- else {
725
- rsNumLeftEl.style.display = 'none';
726
- }
727
727
  }
728
728
  if (rsNumRightEl) {
729
729
  if (offsetLeft < 0) {
730
- rsNumRightEl.style.display = 'none';
731
- }
732
- else {
733
730
  rsNumRightEl.textContent = `${Math.floor(containerRect.width - targetTableWidth)}px`;
734
731
  rsNumRightEl.style.display = 'block';
735
732
  tipHeight = rsNumRightEl.offsetHeight;
736
733
  }
734
+ else {
735
+ rsNumRightEl.style.display = 'none';
736
+ }
737
737
  }
738
738
  const tipTop = evnt.clientY - containerRect.top - tipHeight / 2;
739
739
  rsSplitLineEl.style.left = `${targetTableWidth}px`;
@@ -1930,10 +1930,10 @@ export default {
1930
1930
  }, [
1931
1931
  h('div', {
1932
1932
  class: 'vxe-gantt--resizable-split-number-left'
1933
- }, '10px'),
1933
+ }),
1934
1934
  h('div', {
1935
1935
  class: 'vxe-gantt--resizable-split-number-right'
1936
- }, '20px')
1936
+ })
1937
1937
  ])
1938
1938
  ]),
1939
1939
  h('div', {
@@ -154,6 +154,9 @@
154
154
  width: var(--vxe-ui-gantt-view-split-bar-width);
155
155
  background-color: var(--vxe-ui-gantt-view-split-bar-background-color);
156
156
  }
157
+ .vxe-gantt .vxe-gantt--view-split-bar:hover, .vxe-gantt .vxe-gantt--view-split-bar:active {
158
+ background-color: var(--vxe-ui-gantt-view-split-bar-hover-background-color);
159
+ }
157
160
  .vxe-gantt .vxe-gantt--view-split-bar.is--resize {
158
161
  cursor: col-resize;
159
162
  }
@@ -360,7 +363,8 @@
360
363
  }
361
364
  .vxe-gantt--view-split-bar-left-btn:hover,
362
365
  .vxe-gantt--view-split-bar-right-btn:hover {
363
- background-color: var(--vxe-ui-font-primary-lighten-color);
366
+ color: #ffffff;
367
+ background-color: var(--vxe-ui-font-primary-color);
364
368
  }
365
369
  .vxe-gantt--view-split-bar-left-btn:active,
366
370
  .vxe-gantt--view-split-bar-right-btn:active {