vxe-table 3.10.8 → 3.10.9

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.
@@ -1806,80 +1806,132 @@ const Methods = {
1806
1806
  * 设置为固定列
1807
1807
  */
1808
1808
  setColumnFixed(fieldOrColumn, fixed) {
1809
- const { isMaxFixedColumn, columnOpts } = this;
1810
- const column = handleFieldOrColumn(this, fieldOrColumn);
1811
- const targetColumn = getRootColumn(this, column);
1812
- if (targetColumn && targetColumn.fixed !== fixed) {
1813
- // 是否超过最大固定列数量
1814
- if (!targetColumn.fixed && isMaxFixedColumn) {
1815
- if (VxeUI.modal) {
1816
- VxeUI.modal.message({
1817
- status: 'error',
1818
- content: getI18n('vxe.table.maxFixedCol', [columnOpts.maxFixedSize])
1819
- });
1809
+ const $xeTable = this;
1810
+ let status = false;
1811
+ const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
1812
+ const columnOpts = $xeTable.computeColumnOpts;
1813
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
1814
+ for (let i = 0; i < cols.length; i++) {
1815
+ const item = cols[i];
1816
+ const column = handleFieldOrColumn($xeTable, item);
1817
+ const targetColumn = getRootColumn($xeTable, column);
1818
+ if (targetColumn && targetColumn.fixed !== fixed) {
1819
+ // 是否超过最大固定列数量
1820
+ if (!targetColumn.fixed && isMaxFixedColumn) {
1821
+ if (VxeUI.modal) {
1822
+ VxeUI.modal.message({
1823
+ status: 'error',
1824
+ content: getI18n('vxe.table.maxFixedCol', [columnOpts.maxFixedSize])
1825
+ });
1826
+ }
1827
+ return $xeTable.$nextTick();
1828
+ }
1829
+ XEUtils.eachTree([targetColumn], (column) => {
1830
+ column.fixed = fixed;
1831
+ });
1832
+ $xeTable.saveCustomStore('update:fixed');
1833
+ if (!status) {
1834
+ status = true;
1820
1835
  }
1821
- return this.$nextTick();
1822
1836
  }
1823
- XEUtils.eachTree([targetColumn], (column) => {
1824
- column.fixed = fixed;
1825
- });
1826
- this.saveCustomStore('update:fixed');
1827
- return this.refreshColumn();
1828
1837
  }
1829
- return this.$nextTick();
1838
+ if (status) {
1839
+ return $xeTable.refreshColumn();
1840
+ }
1841
+ return $xeTable.$nextTick();
1830
1842
  },
1831
1843
  /**
1832
1844
  * 取消指定固定列
1833
1845
  */
1834
1846
  clearColumnFixed(fieldOrColumn) {
1835
- const column = handleFieldOrColumn(this, fieldOrColumn);
1836
- const targetColumn = getRootColumn(this, column);
1837
- if (targetColumn && targetColumn.fixed) {
1838
- XEUtils.eachTree([targetColumn], (column) => {
1839
- column.fixed = null;
1840
- });
1841
- this.saveCustomStore('update:fixed');
1842
- return this.refreshColumn();
1847
+ const $xeTable = this;
1848
+ let status = false;
1849
+ const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
1850
+ cols.forEach(item => {
1851
+ const column = handleFieldOrColumn($xeTable, item);
1852
+ const targetColumn = getRootColumn($xeTable, column);
1853
+ if (targetColumn && targetColumn.fixed) {
1854
+ XEUtils.eachTree([targetColumn], (column) => {
1855
+ column.fixed = null;
1856
+ });
1857
+ $xeTable.saveCustomStore('update:fixed');
1858
+ if (!status) {
1859
+ status = true;
1860
+ }
1861
+ }
1862
+ });
1863
+ if (status) {
1864
+ return $xeTable.refreshColumn();
1843
1865
  }
1844
- return this.$nextTick();
1866
+ return $xeTable.$nextTick();
1845
1867
  },
1846
1868
  /**
1847
1869
  * 隐藏指定列
1848
1870
  */
1849
1871
  hideColumn(fieldOrColumn) {
1850
- const column = handleFieldOrColumn(this, fieldOrColumn);
1851
- if (column && column.visible) {
1852
- column.visible = false;
1853
- return this.handleCustom();
1872
+ const $xeTable = this;
1873
+ let status = false;
1874
+ const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
1875
+ cols.forEach(item => {
1876
+ const column = handleFieldOrColumn($xeTable, item);
1877
+ if (column && column.visible) {
1878
+ column.visible = false;
1879
+ if (!status) {
1880
+ status = true;
1881
+ }
1882
+ }
1883
+ });
1884
+ if (status) {
1885
+ return $xeTable.handleCustom();
1854
1886
  }
1855
- return this.$nextTick();
1887
+ return $xeTable.$nextTick();
1856
1888
  },
1857
1889
  /**
1858
1890
  * 显示指定列
1859
1891
  */
1860
1892
  showColumn(fieldOrColumn) {
1861
- const column = handleFieldOrColumn(this, fieldOrColumn);
1862
- if (column && !column.visible) {
1863
- column.visible = true;
1864
- return this.handleCustom();
1893
+ const $xeTable = this;
1894
+ let status = false;
1895
+ const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
1896
+ cols.forEach(item => {
1897
+ const column = handleFieldOrColumn($xeTable, item);
1898
+ if (column && !column.visible) {
1899
+ column.visible = true;
1900
+ if (!status) {
1901
+ status = true;
1902
+ }
1903
+ }
1904
+ });
1905
+ if (status) {
1906
+ return $xeTable.handleCustom();
1865
1907
  }
1866
- return this.$nextTick();
1908
+ return $xeTable.$nextTick();
1867
1909
  },
1868
1910
  setColumnWidth(fieldOrColumn, width) {
1869
- const column = handleFieldOrColumn(this, fieldOrColumn);
1870
- if (column) {
1871
- const colWidth = XEUtils.toInteger(width);
1872
- let rdWidth = colWidth;
1873
- if (isScale(width)) {
1874
- const { tableBody } = this.$refs;
1875
- const tableBodyElem = tableBody ? tableBody.$el : null;
1876
- const bodyWidth = tableBodyElem ? tableBodyElem.clientWidth - 1 : 0;
1877
- rdWidth = Math.floor(colWidth * bodyWidth);
1911
+ const $xeTable = this;
1912
+ let status = false;
1913
+ const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
1914
+ cols.forEach(item => {
1915
+ const column = handleFieldOrColumn($xeTable, item);
1916
+ if (column) {
1917
+ const colWidth = XEUtils.toInteger(width);
1918
+ let rdWidth = colWidth;
1919
+ if (isScale(width)) {
1920
+ const tableBody = $xeTable.$refs.tableBody;
1921
+ const bodyElem = tableBody ? tableBody.$el : null;
1922
+ const bodyWidth = bodyElem ? bodyElem.clientWidth - 1 : 0;
1923
+ rdWidth = Math.floor(colWidth * bodyWidth);
1924
+ }
1925
+ column.resizeWidth = rdWidth;
1926
+ if (!status) {
1927
+ status = true;
1928
+ }
1878
1929
  }
1879
- column.resizeWidth = rdWidth;
1880
- return this.refreshColumn();
1930
+ });
1931
+ if (status) {
1932
+ return $xeTable.refreshColumn();
1881
1933
  }
1882
- return this.$nextTick();
1934
+ return $xeTable.$nextTick();
1883
1935
  },
1884
1936
  getColumnWidth(fieldOrColumn) {
1885
1937
  const column = handleFieldOrColumn(this, fieldOrColumn);
@@ -5632,7 +5684,7 @@ const Methods = {
5632
5684
  }
5633
5685
  this.closeTooltip();
5634
5686
  },
5635
- handleScrollEvent(evnt, isRollY, isRollX, params) {
5687
+ handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
5636
5688
  const $xeTable = this;
5637
5689
  const props = $xeTable;
5638
5690
  const { highlightHoverRow } = props;
@@ -5657,10 +5709,32 @@ const Methods = {
5657
5709
  const bodyWidth = bodyElem ? bodyElem.clientWidth : 0;
5658
5710
  const scrollHeight = bodyElem ? bodyElem.scrollHeight : 0;
5659
5711
  const scrollWidth = bodyElem ? bodyElem.scrollWidth : 0;
5660
- const evntParams = Object.assign({ bodyHeight,
5712
+ let isTop = false;
5713
+ let isBottom = false;
5714
+ let isLeft = false;
5715
+ let isRight = false;
5716
+ if (isRollX) {
5717
+ isLeft = scrollLeft <= 0;
5718
+ if (!isTop) {
5719
+ isRight = scrollLeft + bodyWidth >= scrollWidth;
5720
+ }
5721
+ $xeTable.checkScrolling();
5722
+ }
5723
+ else {
5724
+ isTop = scrollTop <= 0;
5725
+ if (!isTop) {
5726
+ isBottom = scrollTop + bodyHeight >= scrollHeight;
5727
+ }
5728
+ }
5729
+ const evntParams = Object.assign({ scrollTop,
5730
+ scrollLeft,
5731
+ bodyHeight,
5661
5732
  bodyWidth,
5662
5733
  scrollHeight,
5663
- scrollWidth, isX: isRollX, isY: isRollY }, params);
5734
+ scrollWidth, isX: isRollX, isY: isRollY, isTop,
5735
+ isBottom,
5736
+ isLeft,
5737
+ isRight }, params);
5664
5738
  $xeTable.dispatchEvent('scroll', evntParams, evnt);
5665
5739
  },
5666
5740
  /**
@@ -5705,11 +5779,9 @@ const Methods = {
5705
5779
  $xeTable.lastScrollTime = Date.now();
5706
5780
  $xeTable.handleSyncScrollX(scrollLeft);
5707
5781
  $xeTable.triggerScrollXEvent(evnt);
5708
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
5782
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
5709
5783
  type: 'table',
5710
- fixed: '',
5711
- scrollTop,
5712
- scrollLeft
5784
+ fixed: ''
5713
5785
  });
5714
5786
  },
5715
5787
  debounceScrollYCalculate: XEUtils.debounce(function () {
@@ -5739,11 +5811,9 @@ const Methods = {
5739
5811
  $xeTable.lastScrollTime = Date.now();
5740
5812
  $xeTable.handleSyncScrollY(scrollTop);
5741
5813
  $xeTable.triggerScrollYEvent(evnt);
5742
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
5814
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
5743
5815
  type: 'table',
5744
- fixed: '',
5745
- scrollTop,
5746
- scrollLeft
5816
+ fixed: ''
5747
5817
  });
5748
5818
  },
5749
5819
  /**
@@ -5939,16 +6009,35 @@ const Methods = {
5939
6009
  * @param {Number} scrollTop 上距离
5940
6010
  */
5941
6011
  scrollTo(scrollLeft, scrollTop) {
6012
+ const $xeTable = this;
5942
6013
  const { $refs } = this;
5943
- const { tableBody, rightBody, tableFooter } = $refs;
6014
+ const { tableBody, tableHeader, leftBody, rightBody, tableFooter } = $refs;
5944
6015
  const tableBodyElem = tableBody ? tableBody.$el : null;
6016
+ const leftBodyElem = leftBody ? leftBody.$el : null;
5945
6017
  const rightBodyElem = rightBody ? rightBody.$el : null;
6018
+ const tableHeaderElem = tableHeader ? tableHeader.$el : null;
5946
6019
  const tableFooterElem = tableFooter ? tableFooter.$el : null;
5947
6020
  if (XEUtils.isNumber(scrollLeft)) {
5948
- setScrollLeft(tableFooterElem || tableBodyElem, scrollLeft);
6021
+ const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
6022
+ if (xHandleEl) {
6023
+ setScrollLeft(xHandleEl, scrollLeft);
6024
+ }
6025
+ else {
6026
+ setScrollLeft(tableBodyElem, scrollLeft);
6027
+ setScrollLeft(tableHeaderElem, scrollLeft);
6028
+ setScrollLeft(tableFooterElem, scrollLeft);
6029
+ }
5949
6030
  }
5950
6031
  if (XEUtils.isNumber(scrollTop)) {
5951
- setScrollTop(rightBodyElem || tableBodyElem, scrollTop);
6032
+ const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
6033
+ if (yHandleEl) {
6034
+ setScrollTop(yHandleEl, scrollTop);
6035
+ }
6036
+ else {
6037
+ setScrollTop(tableBodyElem, scrollTop);
6038
+ setScrollTop(leftBodyElem, scrollTop);
6039
+ setScrollTop(rightBodyElem, scrollTop);
6040
+ }
5952
6041
  }
5953
6042
  if (this.scrollXLoad || this.scrollYLoad) {
5954
6043
  return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()), 50));
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.10.8";
3
+ export const version = "3.10.9";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.10.8"}`;
3
+ const version = `table v${"3.10.9"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.10.8";
2223
+ const version = "3.10.9";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2769,7 +2769,7 @@ function isNodeElement(elem) {
2769
2769
  const {
2770
2770
  log: log_log
2771
2771
  } = core_.VxeUI;
2772
- const log_version = `table v${"3.10.8"}`;
2772
+ const log_version = `table v${"3.10.9"}`;
2773
2773
  const warnLog = log_log.create('warn', log_version);
2774
2774
  const errLog = log_log.create('error', log_version);
2775
2775
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -6947,85 +6947,132 @@ const Methods = {
6947
6947
  * 设置为固定列
6948
6948
  */
6949
6949
  setColumnFixed(fieldOrColumn, fixed) {
6950
- const {
6951
- isMaxFixedColumn,
6952
- columnOpts
6953
- } = this;
6954
- const column = handleFieldOrColumn(this, fieldOrColumn);
6955
- const targetColumn = getRootColumn(this, column);
6956
- if (targetColumn && targetColumn.fixed !== fixed) {
6957
- // 是否超过最大固定列数量
6958
- if (!targetColumn.fixed && isMaxFixedColumn) {
6959
- if (core_.VxeUI.modal) {
6960
- core_.VxeUI.modal.message({
6961
- status: 'error',
6962
- content: methods_getI18n('vxe.table.maxFixedCol', [columnOpts.maxFixedSize])
6963
- });
6950
+ const $xeTable = this;
6951
+ let status = false;
6952
+ const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
6953
+ const columnOpts = $xeTable.computeColumnOpts;
6954
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
6955
+ for (let i = 0; i < cols.length; i++) {
6956
+ const item = cols[i];
6957
+ const column = handleFieldOrColumn($xeTable, item);
6958
+ const targetColumn = getRootColumn($xeTable, column);
6959
+ if (targetColumn && targetColumn.fixed !== fixed) {
6960
+ // 是否超过最大固定列数量
6961
+ if (!targetColumn.fixed && isMaxFixedColumn) {
6962
+ if (core_.VxeUI.modal) {
6963
+ core_.VxeUI.modal.message({
6964
+ status: 'error',
6965
+ content: methods_getI18n('vxe.table.maxFixedCol', [columnOpts.maxFixedSize])
6966
+ });
6967
+ }
6968
+ return $xeTable.$nextTick();
6969
+ }
6970
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([targetColumn], column => {
6971
+ column.fixed = fixed;
6972
+ });
6973
+ $xeTable.saveCustomStore('update:fixed');
6974
+ if (!status) {
6975
+ status = true;
6964
6976
  }
6965
- return this.$nextTick();
6966
6977
  }
6967
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([targetColumn], column => {
6968
- column.fixed = fixed;
6969
- });
6970
- this.saveCustomStore('update:fixed');
6971
- return this.refreshColumn();
6972
6978
  }
6973
- return this.$nextTick();
6979
+ if (status) {
6980
+ return $xeTable.refreshColumn();
6981
+ }
6982
+ return $xeTable.$nextTick();
6974
6983
  },
6975
6984
  /**
6976
6985
  * 取消指定固定列
6977
6986
  */
6978
6987
  clearColumnFixed(fieldOrColumn) {
6979
- const column = handleFieldOrColumn(this, fieldOrColumn);
6980
- const targetColumn = getRootColumn(this, column);
6981
- if (targetColumn && targetColumn.fixed) {
6982
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([targetColumn], column => {
6983
- column.fixed = null;
6984
- });
6985
- this.saveCustomStore('update:fixed');
6986
- return this.refreshColumn();
6988
+ const $xeTable = this;
6989
+ let status = false;
6990
+ const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
6991
+ cols.forEach(item => {
6992
+ const column = handleFieldOrColumn($xeTable, item);
6993
+ const targetColumn = getRootColumn($xeTable, column);
6994
+ if (targetColumn && targetColumn.fixed) {
6995
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([targetColumn], column => {
6996
+ column.fixed = null;
6997
+ });
6998
+ $xeTable.saveCustomStore('update:fixed');
6999
+ if (!status) {
7000
+ status = true;
7001
+ }
7002
+ }
7003
+ });
7004
+ if (status) {
7005
+ return $xeTable.refreshColumn();
6987
7006
  }
6988
- return this.$nextTick();
7007
+ return $xeTable.$nextTick();
6989
7008
  },
6990
7009
  /**
6991
7010
  * 隐藏指定列
6992
7011
  */
6993
7012
  hideColumn(fieldOrColumn) {
6994
- const column = handleFieldOrColumn(this, fieldOrColumn);
6995
- if (column && column.visible) {
6996
- column.visible = false;
6997
- return this.handleCustom();
7013
+ const $xeTable = this;
7014
+ let status = false;
7015
+ const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
7016
+ cols.forEach(item => {
7017
+ const column = handleFieldOrColumn($xeTable, item);
7018
+ if (column && column.visible) {
7019
+ column.visible = false;
7020
+ if (!status) {
7021
+ status = true;
7022
+ }
7023
+ }
7024
+ });
7025
+ if (status) {
7026
+ return $xeTable.handleCustom();
6998
7027
  }
6999
- return this.$nextTick();
7028
+ return $xeTable.$nextTick();
7000
7029
  },
7001
7030
  /**
7002
7031
  * 显示指定列
7003
7032
  */
7004
7033
  showColumn(fieldOrColumn) {
7005
- const column = handleFieldOrColumn(this, fieldOrColumn);
7006
- if (column && !column.visible) {
7007
- column.visible = true;
7008
- return this.handleCustom();
7034
+ const $xeTable = this;
7035
+ let status = false;
7036
+ const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
7037
+ cols.forEach(item => {
7038
+ const column = handleFieldOrColumn($xeTable, item);
7039
+ if (column && !column.visible) {
7040
+ column.visible = true;
7041
+ if (!status) {
7042
+ status = true;
7043
+ }
7044
+ }
7045
+ });
7046
+ if (status) {
7047
+ return $xeTable.handleCustom();
7009
7048
  }
7010
- return this.$nextTick();
7049
+ return $xeTable.$nextTick();
7011
7050
  },
7012
7051
  setColumnWidth(fieldOrColumn, width) {
7013
- const column = handleFieldOrColumn(this, fieldOrColumn);
7014
- if (column) {
7015
- const colWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(width);
7016
- let rdWidth = colWidth;
7017
- if (isScale(width)) {
7018
- const {
7019
- tableBody
7020
- } = this.$refs;
7021
- const tableBodyElem = tableBody ? tableBody.$el : null;
7022
- const bodyWidth = tableBodyElem ? tableBodyElem.clientWidth - 1 : 0;
7023
- rdWidth = Math.floor(colWidth * bodyWidth);
7052
+ const $xeTable = this;
7053
+ let status = false;
7054
+ const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
7055
+ cols.forEach(item => {
7056
+ const column = handleFieldOrColumn($xeTable, item);
7057
+ if (column) {
7058
+ const colWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(width);
7059
+ let rdWidth = colWidth;
7060
+ if (isScale(width)) {
7061
+ const tableBody = $xeTable.$refs.tableBody;
7062
+ const bodyElem = tableBody ? tableBody.$el : null;
7063
+ const bodyWidth = bodyElem ? bodyElem.clientWidth - 1 : 0;
7064
+ rdWidth = Math.floor(colWidth * bodyWidth);
7065
+ }
7066
+ column.resizeWidth = rdWidth;
7067
+ if (!status) {
7068
+ status = true;
7069
+ }
7024
7070
  }
7025
- column.resizeWidth = rdWidth;
7026
- return this.refreshColumn();
7071
+ });
7072
+ if (status) {
7073
+ return $xeTable.refreshColumn();
7027
7074
  }
7028
- return this.$nextTick();
7075
+ return $xeTable.$nextTick();
7029
7076
  },
7030
7077
  getColumnWidth(fieldOrColumn) {
7031
7078
  const column = handleFieldOrColumn(this, fieldOrColumn);
@@ -11507,7 +11554,7 @@ const Methods = {
11507
11554
  }
11508
11555
  this.closeTooltip();
11509
11556
  },
11510
- handleScrollEvent(evnt, isRollY, isRollX, params) {
11557
+ handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
11511
11558
  const $xeTable = this;
11512
11559
  const props = $xeTable;
11513
11560
  const {
@@ -11534,13 +11581,35 @@ const Methods = {
11534
11581
  const bodyWidth = bodyElem ? bodyElem.clientWidth : 0;
11535
11582
  const scrollHeight = bodyElem ? bodyElem.scrollHeight : 0;
11536
11583
  const scrollWidth = bodyElem ? bodyElem.scrollWidth : 0;
11584
+ let isTop = false;
11585
+ let isBottom = false;
11586
+ let isLeft = false;
11587
+ let isRight = false;
11588
+ if (isRollX) {
11589
+ isLeft = scrollLeft <= 0;
11590
+ if (!isTop) {
11591
+ isRight = scrollLeft + bodyWidth >= scrollWidth;
11592
+ }
11593
+ $xeTable.checkScrolling();
11594
+ } else {
11595
+ isTop = scrollTop <= 0;
11596
+ if (!isTop) {
11597
+ isBottom = scrollTop + bodyHeight >= scrollHeight;
11598
+ }
11599
+ }
11537
11600
  const evntParams = {
11601
+ scrollTop,
11602
+ scrollLeft,
11538
11603
  bodyHeight,
11539
11604
  bodyWidth,
11540
11605
  scrollHeight,
11541
11606
  scrollWidth,
11542
11607
  isX: isRollX,
11543
11608
  isY: isRollY,
11609
+ isTop,
11610
+ isBottom,
11611
+ isLeft,
11612
+ isRight,
11544
11613
  ...params
11545
11614
  };
11546
11615
  $xeTable.dispatchEvent('scroll', evntParams, evnt);
@@ -11598,11 +11667,9 @@ const Methods = {
11598
11667
  $xeTable.lastScrollTime = Date.now();
11599
11668
  $xeTable.handleSyncScrollX(scrollLeft);
11600
11669
  $xeTable.triggerScrollXEvent(evnt);
11601
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
11670
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
11602
11671
  type: 'table',
11603
- fixed: '',
11604
- scrollTop,
11605
- scrollLeft
11672
+ fixed: ''
11606
11673
  });
11607
11674
  },
11608
11675
  debounceScrollYCalculate: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(function () {
@@ -11638,11 +11705,9 @@ const Methods = {
11638
11705
  $xeTable.lastScrollTime = Date.now();
11639
11706
  $xeTable.handleSyncScrollY(scrollTop);
11640
11707
  $xeTable.triggerScrollYEvent(evnt);
11641
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
11708
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
11642
11709
  type: 'table',
11643
- fixed: '',
11644
- scrollTop,
11645
- scrollLeft
11710
+ fixed: ''
11646
11711
  });
11647
11712
  },
11648
11713
  /**
@@ -11889,22 +11954,41 @@ const Methods = {
11889
11954
  * @param {Number} scrollTop 上距离
11890
11955
  */
11891
11956
  scrollTo(scrollLeft, scrollTop) {
11957
+ const $xeTable = this;
11892
11958
  const {
11893
11959
  $refs
11894
11960
  } = this;
11895
11961
  const {
11896
11962
  tableBody,
11963
+ tableHeader,
11964
+ leftBody,
11897
11965
  rightBody,
11898
11966
  tableFooter
11899
11967
  } = $refs;
11900
11968
  const tableBodyElem = tableBody ? tableBody.$el : null;
11969
+ const leftBodyElem = leftBody ? leftBody.$el : null;
11901
11970
  const rightBodyElem = rightBody ? rightBody.$el : null;
11971
+ const tableHeaderElem = tableHeader ? tableHeader.$el : null;
11902
11972
  const tableFooterElem = tableFooter ? tableFooter.$el : null;
11903
11973
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollLeft)) {
11904
- setScrollLeft(tableFooterElem || tableBodyElem, scrollLeft);
11974
+ const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
11975
+ if (xHandleEl) {
11976
+ setScrollLeft(xHandleEl, scrollLeft);
11977
+ } else {
11978
+ setScrollLeft(tableBodyElem, scrollLeft);
11979
+ setScrollLeft(tableHeaderElem, scrollLeft);
11980
+ setScrollLeft(tableFooterElem, scrollLeft);
11981
+ }
11905
11982
  }
11906
11983
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollTop)) {
11907
- setScrollTop(rightBodyElem || tableBodyElem, scrollTop);
11984
+ const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
11985
+ if (yHandleEl) {
11986
+ setScrollTop(yHandleEl, scrollTop);
11987
+ } else {
11988
+ setScrollTop(tableBodyElem, scrollTop);
11989
+ setScrollTop(leftBodyElem, scrollTop);
11990
+ setScrollTop(rightBodyElem, scrollTop);
11991
+ }
11908
11992
  }
11909
11993
  if (this.scrollXLoad || this.scrollYLoad) {
11910
11994
  return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()), 50));
@@ -13046,11 +13130,9 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
13046
13130
  setScrollTop(leftElem, scrollTop);
13047
13131
  setScrollTop(rightElem, scrollTop);
13048
13132
  }
13049
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
13133
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
13050
13134
  type: renderType,
13051
- fixed: fixedType,
13052
- scrollTop,
13053
- scrollLeft
13135
+ fixed: fixedType
13054
13136
  });
13055
13137
  }
13056
13138
  if (xHandleEl) {
@@ -13060,11 +13142,9 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
13060
13142
  $xeTable.lastScrollLeft = scrollLeft;
13061
13143
  setScrollLeft(headerElem, scrollLeft);
13062
13144
  setScrollLeft(footerElem, scrollLeft);
13063
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
13145
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
13064
13146
  type: renderType,
13065
- fixed: fixedType,
13066
- scrollTop,
13067
- scrollLeft
13147
+ fixed: fixedType
13068
13148
  });
13069
13149
  }
13070
13150
  },
@@ -13918,11 +13998,9 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
13918
13998
  $xeTable.lastScrollTime = Date.now();
13919
13999
  setScrollLeft(headerElem, scrollLeft);
13920
14000
  setScrollLeft(bodyElem, scrollLeft);
13921
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
14001
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
13922
14002
  type: footer_renderType,
13923
- fixed: fixedType,
13924
- scrollTop,
13925
- scrollLeft
14003
+ fixed: fixedType
13926
14004
  });
13927
14005
  }
13928
14006
  }