vxe-table 3.19.0 → 3.19.1

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 (54) hide show
  1. package/README.md +2 -2
  2. package/es/grid/src/grid.js +27 -31
  3. package/es/index.css +1 -1
  4. package/es/index.min.css +1 -1
  5. package/es/locale/lang/en-US.js +22 -22
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/table/src/methods.js +52 -15
  9. package/es/table/src/table.js +18 -5
  10. package/es/table/src/util.js +29 -23
  11. package/es/table/style.css +29 -2
  12. package/es/table/style.min.css +1 -1
  13. package/es/ui/index.js +1 -1
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-table/style.css +29 -2
  16. package/es/vxe-table/style.min.css +1 -1
  17. package/lib/grid/src/grid.js +48 -52
  18. package/lib/grid/src/grid.min.js +1 -1
  19. package/lib/index.css +1 -1
  20. package/lib/index.min.css +1 -1
  21. package/lib/index.umd.js +136 -95
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/locale/lang/en-US.js +22 -22
  24. package/lib/locale/lang/en-US.min.js +1 -1
  25. package/lib/locale/lang/en-US.umd.js +22 -22
  26. package/lib/style.css +1 -1
  27. package/lib/style.min.css +1 -1
  28. package/lib/table/src/methods.js +55 -15
  29. package/lib/table/src/methods.min.js +1 -1
  30. package/lib/table/src/table.js +14 -3
  31. package/lib/table/src/table.min.js +1 -1
  32. package/lib/table/src/util.js +17 -23
  33. package/lib/table/src/util.min.js +1 -1
  34. package/lib/table/style/style.css +29 -2
  35. package/lib/table/style/style.min.css +1 -1
  36. package/lib/ui/index.js +1 -1
  37. package/lib/ui/index.min.js +1 -1
  38. package/lib/ui/src/log.js +1 -1
  39. package/lib/ui/src/log.min.js +1 -1
  40. package/lib/vxe-table/style/style.css +29 -2
  41. package/lib/vxe-table/style/style.min.css +1 -1
  42. package/package.json +2 -2
  43. package/packages/grid/src/grid.ts +64 -68
  44. package/packages/locale/lang/en-US.ts +22 -22
  45. package/packages/table/src/methods.ts +55 -15
  46. package/packages/table/src/table.ts +19 -5
  47. package/packages/table/src/util.ts +37 -23
  48. package/styles/components/table.scss +52 -2
  49. /package/es/{iconfont.1760925668508.ttf → iconfont.1761181583983.ttf} +0 -0
  50. /package/es/{iconfont.1760925668508.woff → iconfont.1761181583983.woff} +0 -0
  51. /package/es/{iconfont.1760925668508.woff2 → iconfont.1761181583983.woff2} +0 -0
  52. /package/lib/{iconfont.1760925668508.ttf → iconfont.1761181583983.ttf} +0 -0
  53. /package/lib/{iconfont.1760925668508.woff → iconfont.1761181583983.woff} +0 -0
  54. /package/lib/{iconfont.1760925668508.woff2 → iconfont.1761181583983.woff2} +0 -0
@@ -438,8 +438,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
438
438
  */
439
439
  getExcludeHeight () {
440
440
  const $xeGrid = this
441
+ const props = $xeGrid
441
442
  const reactData = $xeGrid.reactData
442
443
 
444
+ const { height } = props
443
445
  const { isZMax } = reactData
444
446
  const el = $xeGrid.$refs.refElem as HTMLDivElement
445
447
  if (el) {
@@ -449,7 +451,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
449
451
  const bottomWrapper = $xeGrid.$refs.refBottomWrapper as HTMLDivElement
450
452
  const pagerWrapper = $xeGrid.$refs.refPagerWrapper as HTMLDivElement
451
453
  const parentEl = el.parentElement as HTMLElement
452
- const parentPaddingSize = isZMax ? 0 : (parentEl ? getPaddingTopBottomSize(parentEl) : 0)
454
+ let parentPaddingSize = 0
455
+ if (parentEl && (height === '100%' || height === 'auto')) {
456
+ parentPaddingSize = isZMax ? 0 : getPaddingTopBottomSize(parentEl)
457
+ }
453
458
  return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper)
454
459
  }
455
460
  return 0
@@ -673,6 +678,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
673
678
  if (!isInited && reactData.tableLoading) {
674
679
  return $xeGrid.$nextTick()
675
680
  }
681
+ let operPromise = null
676
682
  let sortList: any[] = []
677
683
  let filterList: VxeTableDefines.FilterCheckedParams[] = []
678
684
  let pageParams: any = {}
@@ -724,7 +730,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
724
730
  } else {
725
731
  if ($xeTable) {
726
732
  if (isReload) {
727
- $xeTable.clearAll()
733
+ operPromise = $xeTable.clearAll()
728
734
  } else {
729
735
  sortList = $xeTable.getSortColumns()
730
736
  filterList = $xeTable.getCheckedFilters()
@@ -749,51 +755,53 @@ export default /* define-vxe-component start */ defineVxeComponent({
749
755
  reactData.sortData = sortList
750
756
  reactData.filterData = filterList
751
757
  reactData.tableLoading = true
752
- const applyArgs = [commitParams].concat(args)
753
- return Promise.resolve((beforeQuery || ajaxMethods)(...applyArgs))
754
- .then(rest => {
755
- let tableData: any[] = []
756
- reactData.tableLoading = false
757
- if (rest) {
758
- if (pagerConfig && isEnableConf(pagerOpts)) {
759
- const totalProp = resConfigs.total
760
- const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $table: $xeTable, $grid: $xeGrid as VxeGridConstructor, $gantt: null }) : XEUtils.get(rest, totalProp || 'page.total')) || 0
761
- tablePage.total = XEUtils.toNumber(total)
762
- const resultProp = resConfigs.result
763
- tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $table: $xeTable, $grid: $xeGrid as VxeGridConstructor, $gantt: null }) : XEUtils.get(rest, resultProp || 'result')) || []
764
- // 检验当前页码,不能超出当前最大页数
765
- const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1)
766
- if (tablePage.currentPage > pageCount) {
767
- tablePage.currentPage = pageCount
768
- }
769
- } else {
770
- const listProp = resConfigs.list
771
- tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid as VxeGridConstructor, $gantt: null }) : XEUtils.get(rest, listProp)) : rest) || []
758
+ return Promise.all([
759
+ Promise.resolve((beforeQuery || ajaxMethods)(commitParams, ...args)),
760
+ operPromise
761
+ ]).then(([rest]) => {
762
+ let tableData: any[] = []
763
+ reactData.tableLoading = false
764
+ if (rest) {
765
+ if (pagerConfig && isEnableConf(pagerOpts)) {
766
+ const totalProp = resConfigs.total
767
+ const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $table: $xeTable, $grid: $xeGrid as VxeGridConstructor, $gantt: null }) : XEUtils.get(rest, totalProp || 'page.total')) || 0
768
+ tablePage.total = XEUtils.toNumber(total)
769
+ const resultProp = resConfigs.result
770
+ tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $table: $xeTable, $grid: $xeGrid as VxeGridConstructor, $gantt: null }) : XEUtils.get(rest, resultProp || 'result')) || []
771
+ // 检验当前页码,不能超出当前最大页数
772
+ const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1)
773
+ if (tablePage.currentPage > pageCount) {
774
+ tablePage.currentPage = pageCount
772
775
  }
773
- }
774
- if ($xeTable as any) {
775
- $xeTable.loadData(tableData)
776
776
  } else {
777
- $xeTable.$nextTick(() => {
778
- if ($xeTable) {
779
- $xeTable.loadData(tableData)
780
- }
781
- })
782
- }
783
- if (afterQuery) {
784
- afterQuery(...applyArgs)
785
- }
786
- if (querySuccessMethods) {
787
- querySuccessMethods({ ...commitParams, response: rest })
777
+ const listProp = resConfigs.list
778
+ tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid as VxeGridConstructor, $gantt: null }) : XEUtils.get(rest, listProp)) : rest) || []
788
779
  }
789
- return { status: true }
790
- }).catch((rest) => {
791
- reactData.tableLoading = false
792
- if (queryErrorMethods) {
793
- queryErrorMethods({ ...commitParams, response: rest })
794
- }
795
- return { status: false }
796
- })
780
+ }
781
+ if ($xeTable) {
782
+ $xeTable.loadData(tableData)
783
+ } else {
784
+ $xeGrid.$nextTick(() => {
785
+ const $xeTable = $xeGrid.$refs.refTable as VxeTableConstructor & VxeTablePrivateMethods
786
+ if ($xeTable) {
787
+ $xeTable.loadData(tableData)
788
+ }
789
+ })
790
+ }
791
+ if (afterQuery) {
792
+ afterQuery(commitParams, ...args)
793
+ }
794
+ if (querySuccessMethods) {
795
+ querySuccessMethods({ ...commitParams, response: rest })
796
+ }
797
+ return { status: true }
798
+ }).catch((rest) => {
799
+ reactData.tableLoading = false
800
+ if (queryErrorMethods) {
801
+ queryErrorMethods({ ...commitParams, response: rest })
802
+ }
803
+ return { status: false }
804
+ })
797
805
  } else {
798
806
  errLog('vxe.error.notFunc', ['[grid] proxy-config.ajax.query'])
799
807
  }
@@ -829,11 +837,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
829
837
  reactData.tableLoading = false
830
838
  $xeTable.setPendingRow(removeRecords, false)
831
839
  if (isRespMsg) {
832
- // 检测弹窗模块
833
- if (!VxeUI.modal) {
834
- errLog('vxe.error.reqModule', ['Modal'])
840
+ if (VxeUI.modal) {
841
+ VxeUI.modal.message({ content: $xeGrid.getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' })
835
842
  }
836
- VxeUI.modal.message({ content: $xeGrid.getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' })
837
843
  }
838
844
  if (afterDelete) {
839
845
  afterDelete(...applyArgs)
@@ -848,11 +854,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
848
854
  .catch(rest => {
849
855
  reactData.tableLoading = false
850
856
  if (isRespMsg) {
851
- // 检测弹窗模块
852
- if (!VxeUI.modal) {
853
- errLog('vxe.error.reqModule', ['Modal'])
857
+ if (VxeUI.modal) {
858
+ VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
854
859
  }
855
- VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
856
860
  }
857
861
  if (deleteErrorMethods) {
858
862
  deleteErrorMethods({ ...commitParams, response: rest })
@@ -862,11 +866,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
862
866
  })
863
867
  } else {
864
868
  if (isActiveMsg) {
865
- // 检测弹窗模块
866
- if (!VxeUI.modal) {
867
- errLog('vxe.error.reqModule', ['Modal'])
869
+ if (VxeUI.modal) {
870
+ VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.selectOneRecord'), status: 'warning' })
868
871
  }
869
- VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.selectOneRecord'), status: 'warning' })
870
872
  }
871
873
  }
872
874
  } else {
@@ -917,11 +919,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
917
919
  reactData.tableLoading = false
918
920
  $xeTable.clearPendingRow()
919
921
  if (isRespMsg) {
920
- // 检测弹窗模块
921
- if (!VxeUI.modal) {
922
- errLog('vxe.error.reqModule', ['Modal'])
922
+ if (VxeUI.modal) {
923
+ VxeUI.modal.message({ content: $xeGrid.getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' })
923
924
  }
924
- VxeUI.modal.message({ content: $xeGrid.getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' })
925
925
  }
926
926
  if (afterSave) {
927
927
  afterSave(...applyArgs)
@@ -936,11 +936,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
936
936
  .catch(rest => {
937
937
  reactData.tableLoading = false
938
938
  if (isRespMsg) {
939
- // 检测弹窗模块
940
- if (!VxeUI.modal) {
941
- errLog('vxe.error.reqModule', ['Modal'])
939
+ if (VxeUI.modal) {
940
+ VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
942
941
  }
943
- VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
944
942
  }
945
943
  if (saveErrorMethods) {
946
944
  saveErrorMethods({ ...commitParams, response: rest })
@@ -949,11 +947,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
949
947
  })
950
948
  } else {
951
949
  if (isActiveMsg) {
952
- // 检测弹窗模块
953
- if (!VxeUI.modal) {
954
- errLog('vxe.error.reqModule', ['Modal'])
950
+ if (VxeUI.modal) {
951
+ VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.dataUnchanged'), status: 'info' })
955
952
  }
956
- VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.dataUnchanged'), status: 'info' })
957
953
  }
958
954
  }
959
955
  })
@@ -7,7 +7,7 @@ export default {
7
7
  fullStop: '。'
8
8
  },
9
9
  loading: {
10
- text: 'loading...'
10
+ text: 'Loading...'
11
11
  },
12
12
  error: {
13
13
  downErr: 'Download failed',
@@ -181,7 +181,7 @@ export default {
181
181
  insertBottom: 'Append at the bottom (append new data at the bottom of the table)'
182
182
  },
183
183
  impTitle: 'Import data',
184
- impFile: 'file name',
184
+ impFile: 'File name',
185
185
  impSelect: 'Select file',
186
186
  impType: 'File type',
187
187
  impOpts: 'Parameter settings',
@@ -207,9 +207,9 @@ export default {
207
207
  },
208
208
  printTitle: 'Print data',
209
209
  expTitle: 'Export data',
210
- expName: 'file name',
210
+ expName: 'File name',
211
211
  expNamePlaceholder: 'Please enter a file name',
212
- expSheetName: 'title',
212
+ expSheetName: 'Title',
213
213
  expSheetNamePlaceholder: 'Please enter a title',
214
214
  expType: 'Save type',
215
215
  expMode: 'Select data',
@@ -643,10 +643,10 @@ export default {
643
643
  },
644
644
  cases: {
645
645
  equal: 'equal',
646
- gt: 'Greater than',
647
- lt: 'Less than',
648
- begin: 'The beginning is',
649
- endin: 'The end is',
646
+ gt: 'Greater',
647
+ lt: 'Less',
648
+ begin: 'Start',
649
+ endin: 'End',
650
650
  include: 'Include',
651
651
  isSensitive: 'case sensitive'
652
652
  }
@@ -675,14 +675,14 @@ export default {
675
675
  },
676
676
  cases: {
677
677
  equal: 'equal',
678
- unequal: 'Not equal to',
679
- gt: 'Greater than',
680
- ge: 'Greater than or equal to',
681
- lt: 'Less than',
682
- le: 'Less than or equal to',
683
- begin: 'The beginning is',
678
+ unequal: 'Not equal',
679
+ gt: 'Greater',
680
+ ge: 'Greater or equal',
681
+ lt: 'Less',
682
+ le: 'Less or equal',
683
+ begin: 'Start',
684
684
  notbegin: "It's not at the beginning",
685
- endin: 'The end is',
685
+ endin: 'End',
686
686
  notendin: 'The ending is not',
687
687
  include: 'Include',
688
688
  exclude: 'Not included',
@@ -740,14 +740,14 @@ export default {
740
740
  search: 'search',
741
741
  cases: {
742
742
  equal: 'equal',
743
- unequal: 'Not equal to',
744
- gt: 'Greater than',
745
- ge: 'Greater than or equal to',
746
- lt: 'Less than',
747
- le: 'Less than or equal to',
748
- begin: 'The beginning is',
743
+ unequal: 'Not equal',
744
+ gt: 'Greater',
745
+ ge: 'Greater or equal',
746
+ lt: 'Less',
747
+ le: 'Less or equal',
748
+ begin: 'Start',
749
749
  notbegin: "It's not at the beginning",
750
- endin: 'The end is',
750
+ endin: 'End',
751
751
  notendin: 'The ending is not',
752
752
  include: 'Include',
753
753
  exclude: 'Not included',
@@ -1002,7 +1002,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1002
1002
  const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
1003
1003
  const $xeGanttView = internalData.xeGanttView
1004
1004
  const el = $xeTable.$refs.refElem as HTMLDivElement
1005
- if (!el || !el.clientHeight) {
1005
+ if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
1006
1006
  return
1007
1007
  }
1008
1008
  const containerList = ['main', 'left', 'right']
@@ -2359,7 +2359,7 @@ function calcTableHeight ($xeTable: VxeTableConstructor & VxeTablePrivateMethods
2359
2359
  const props = $xeTable
2360
2360
  const reactData = $xeTable as unknown as TableReactData
2361
2361
 
2362
- const { editConfig } = props
2362
+ const { editConfig, editRules } = props
2363
2363
  const { parentHeight } = reactData
2364
2364
  let val = props[key]
2365
2365
  if (key === 'minHeight') {
@@ -2367,7 +2367,7 @@ function calcTableHeight ($xeTable: VxeTableConstructor & VxeTablePrivateMethods
2367
2367
  if (XEUtils.eqNull(val)) {
2368
2368
  if (eqEmptyValue(defMinHeight)) {
2369
2369
  // 编辑模式默认最小高度
2370
- if (isEnableConf(editConfig)) {
2370
+ if (editRules && isEnableConf(editConfig)) {
2371
2371
  val = 144
2372
2372
  }
2373
2373
  } else {
@@ -10824,17 +10824,45 @@ const Methods = {
10824
10824
  */
10825
10825
  getScroll () {
10826
10826
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
10827
+
10828
+ return $xeTable.getScrollData()
10829
+ },
10830
+ /**
10831
+ * 获取表格的滚动数据
10832
+ */
10833
+ getScrollData () {
10834
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
10827
10835
  const reactData = $xeTable as unknown as TableReactData
10828
10836
  const internalData = $xeTable as unknown as TableInternalData
10829
10837
 
10830
- const { scrollXLoad, scrollYLoad } = reactData
10838
+ const { scrollXLoad, scrollYLoad, scrollbarHeight, scrollbarWidth } = reactData
10831
10839
  const { elemStore } = internalData
10832
10840
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
10841
+ const scrollTop = bodyScrollElem ? bodyScrollElem.scrollTop : 0
10842
+ const scrollLeft = bodyScrollElem ? bodyScrollElem.scrollLeft : 0
10843
+ const clientHeight = bodyScrollElem ? bodyScrollElem.clientHeight : 0
10844
+ const clientWidth = bodyScrollElem ? bodyScrollElem.clientWidth : 0
10845
+ const scrollHeight = bodyScrollElem ? bodyScrollElem.scrollHeight : 0
10846
+ const scrollWidth = bodyScrollElem ? bodyScrollElem.scrollWidth : 0
10847
+ const isTop = scrollTop <= 0
10848
+ const isBottom = scrollTop + clientHeight >= scrollHeight
10849
+ const isLeft = scrollLeft <= 0
10850
+ const isRight = scrollLeft + clientWidth >= scrollWidth
10833
10851
  return {
10834
10852
  virtualX: scrollXLoad,
10835
10853
  virtualY: scrollYLoad,
10836
- scrollTop: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
10837
- scrollLeft: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
10854
+ isTop,
10855
+ isBottom,
10856
+ isLeft,
10857
+ isRight,
10858
+ scrollbarHeight,
10859
+ scrollbarWidth,
10860
+ scrollTop,
10861
+ scrollLeft,
10862
+ scrollHeight,
10863
+ scrollWidth,
10864
+ clientHeight,
10865
+ clientWidth
10838
10866
  }
10839
10867
  },
10840
10868
  handleScrollEvent (evnt: Event, isRollY: boolean, isRollX: boolean, scrollTop: number, scrollLeft: number, params: any) {
@@ -11152,12 +11180,11 @@ const Methods = {
11152
11180
  const { scrollXLoad, scrollYLoad, expandColumn } = reactData
11153
11181
  const leftFixedWidth = $xeTable.computeLeftFixedWidth
11154
11182
  const rightFixedWidth = $xeTable.computeRightFixedWidth
11155
- if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
11156
- return
11157
- }
11158
11183
 
11159
11184
  const { elemStore, lastScrollTop, lastScrollLeft } = internalData
11160
11185
  const rowOpts = $xeTable.computeRowOpts
11186
+ const scrollbarXOpts = $xeTable.computeScrollbarXOpts
11187
+ const scrollbarYOpts = $xeTable.computeScrollbarYOpts
11161
11188
  const xHandleEl = $xeTable.$refs.refScrollXHandleElem as HTMLDivElement
11162
11189
  const yHandleEl = $xeTable.$refs.refScrollYHandleElem as HTMLDivElement
11163
11190
  const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
@@ -11166,12 +11193,6 @@ const Methods = {
11166
11193
  const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
11167
11194
  const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
11168
11195
  const rowExpandEl = $xeTable.$refs.refRowExpandElem as HTMLDivElement
11169
- if (!xHandleEl) {
11170
- return
11171
- }
11172
- if (!yHandleEl) {
11173
- return
11174
- }
11175
11196
  if (!bodyScrollElem) {
11176
11197
  return
11177
11198
  }
@@ -11188,7 +11209,19 @@ const Methods = {
11188
11209
  const isRollX = scrollLeft !== lastScrollLeft
11189
11210
  const isRollY = scrollTop !== lastScrollTop
11190
11211
 
11212
+ if (isRollX) {
11213
+ // 如果禁用滚动
11214
+ if (scrollbarXOpts.visible === 'hidden') {
11215
+ evnt.preventDefault()
11216
+ return
11217
+ }
11218
+ }
11191
11219
  if (isRollY) {
11220
+ // 如果禁用滚动
11221
+ if (scrollbarYOpts.visible === 'hidden') {
11222
+ evnt.preventDefault()
11223
+ return
11224
+ }
11192
11225
  const isTopWheel = deltaTop < 0
11193
11226
  // 如果滚动位置已经是顶部或底部,则不需要触发
11194
11227
  if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
@@ -11196,6 +11229,10 @@ const Methods = {
11196
11229
  }
11197
11230
  }
11198
11231
 
11232
+ if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
11233
+ return
11234
+ }
11235
+
11199
11236
  if (rowOpts.isHover || highlightHoverRow) {
11200
11237
  $xeTable.clearHoverRow()
11201
11238
  }
@@ -11745,7 +11782,10 @@ const Methods = {
11745
11782
  scrollYStore.visibleStartIndex = 0
11746
11783
  scrollYStore.endIndex = scrollYStore.visibleSize
11747
11784
  scrollYStore.visibleEndIndex = scrollYStore.visibleSize
11785
+
11748
11786
  return $xeTable.$nextTick().then(() => {
11787
+ internalData.lastScrollLeft = 0
11788
+ internalData.lastScrollTop = 0
11749
11789
  internalData.intoRunScroll = false
11750
11790
  })
11751
11791
  },
@@ -88,7 +88,7 @@ function renderViewFixed (h: CreateElement, $xeTable: VxeTableConstructor & VxeT
88
88
  const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior
89
89
  return h('div', {
90
90
  ref: isFixedLeft ? 'refLeftContainer' : 'refRightContainer',
91
- class: [`vxe-table--fixed-${fixedType}-wrapper`, {
91
+ class: [`vxe-table--fixed-${fixedType}-wrapper`, `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`, {
92
92
  [`x-ob--${osXBehavior}`]: osXBehavior,
93
93
  [`y-ob--${osYBehavior}`]: osYBehavior
94
94
  }]
@@ -446,7 +446,7 @@ function renderViewport (h: CreateElement, $xeTable: VxeTableConstructor & VxeTa
446
446
  }]
447
447
  }, [
448
448
  h('div', {
449
- class: 'vxe-table--main-wrapper'
449
+ class: ['vxe-table--main-wrapper', `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`]
450
450
  }, [
451
451
  /**
452
452
  * 表头
@@ -1475,6 +1475,13 @@ export default {
1475
1475
  },
1476
1476
  computeVxeLanguage () {
1477
1477
  return VxeUI.getLanguage()
1478
+ },
1479
+ computeScrollbarVisible () {
1480
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1481
+
1482
+ const scrollbarXOpts = $xeTable.computeScrollbarXOpts
1483
+ const scrollbarYOpts = $xeTable.computeScrollbarYOpts
1484
+ return `${scrollbarXOpts.visible}${scrollbarYOpts.visible}`
1478
1485
  }
1479
1486
  } as any,
1480
1487
  watch: {
@@ -1547,6 +1554,9 @@ export default {
1547
1554
  computeVxeLanguage () {
1548
1555
  this.reLayoutFlag++
1549
1556
  },
1557
+ computeScrollbarVisible () {
1558
+ this.reLayoutFlag++
1559
+ },
1550
1560
  reLayoutFlag () {
1551
1561
  const $xeTable = this
1552
1562
 
@@ -2211,11 +2221,15 @@ export default {
2211
2221
  h('div', {
2212
2222
  key: 'tn',
2213
2223
  ref: 'refEmptyPlaceholder',
2214
- class: 'vxe-table--empty-placeholder'
2224
+ class: 'vxe-table--empty-place-wrapper'
2215
2225
  }, [
2216
2226
  h('div', {
2217
- class: 'vxe-table--empty-content'
2218
- }, renderEmptyBody(h, $xeTable))
2227
+ class: 'vxe-table--empty-placeholder'
2228
+ }, [
2229
+ h('div', {
2230
+ class: 'vxe-table--empty-content'
2231
+ }, renderEmptyBody(h, $xeTable))
2232
+ ])
2219
2233
  ]),
2220
2234
  /**
2221
2235
  * 边框线
@@ -630,29 +630,43 @@ export function getRefElem (refEl: any) {
630
630
  return null
631
631
  }
632
632
 
633
- export function clearTableDefaultStatus (_vm: any) {
634
- _vm.initStatus = false
635
- _vm.clearSort()
636
- _vm.clearCurrentRow()
637
- _vm.clearCurrentColumn()
638
- _vm.clearRadioRow()
639
- _vm.clearRadioReserve()
640
- _vm.clearCheckboxRow()
641
- _vm.clearCheckboxReserve()
642
- _vm.clearRowExpand()
643
- _vm.clearTreeExpand()
644
- _vm.clearTreeExpandReserve()
645
- if (_vm.clearEdit) {
646
- _vm.clearEdit()
647
- }
648
- if (_vm.clearSelected && (_vm.keyboardConfig || _vm.mouseConfig)) {
649
- _vm.clearSelected()
650
- }
651
- if (_vm.clearCellAreas && _vm.mouseConfig) {
652
- _vm.clearCellAreas()
653
- _vm.clearCopyCellArea()
654
- }
655
- return _vm.clearScroll()
633
+ export function clearTableDefaultStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
634
+ const props = $xeTable
635
+ const internalData = $xeTable as unknown as TableInternalData
636
+
637
+ internalData.initStatus = false
638
+ const actionList = [
639
+ $xeTable.clearSort(),
640
+ $xeTable.clearCurrentRow(),
641
+ $xeTable.clearCurrentColumn(),
642
+ $xeTable.clearRadioRow(),
643
+ $xeTable.clearRadioReserve(),
644
+ $xeTable.clearCheckboxRow(),
645
+ $xeTable.clearCheckboxReserve(),
646
+ $xeTable.clearRowExpand(),
647
+ $xeTable.clearTreeExpand(),
648
+ $xeTable.clearTreeExpandReserve(),
649
+ $xeTable.clearPendingRow()
650
+ ]
651
+ if ($xeTable.clearFilter) {
652
+ actionList.push(
653
+ $xeTable.clearFilter()
654
+ )
655
+ }
656
+ if ($xeTable.clearSelected && (props.keyboardConfig || props.mouseConfig)) {
657
+ actionList.push(
658
+ $xeTable.clearSelected()
659
+ )
660
+ }
661
+ if ($xeTable.clearCellAreas && props.mouseConfig) {
662
+ actionList.push(
663
+ $xeTable.clearCellAreas(),
664
+ $xeTable.clearCopyCellArea()
665
+ )
666
+ }
667
+ return Promise.all(actionList).then(() => {
668
+ return $xeTable.clearScroll()
669
+ })
656
670
  }
657
671
 
658
672
  export function clearTableAllStatus (_vm: any) {
@@ -136,6 +136,51 @@ $btnThemeList: (
136
136
  overflow-x: scroll;
137
137
  }
138
138
 
139
+ // 禁用滚动条
140
+ .vxe-table--main-wrapper {
141
+ &.sx--hidden {
142
+ & > .vxe-table--header-wrapper {
143
+ & > .vxe-table--header-inner-wrapper {
144
+ overflow-x: hidden;
145
+ }
146
+ }
147
+ & > .vxe-table--body-wrapper {
148
+ & > .vxe-table--body-inner-wrapper {
149
+ overflow-x: hidden;
150
+ }
151
+ }
152
+ & > .vxe-table--footer-wrapper {
153
+ & > .vxe-table--footer-inner-wrapper {
154
+ overflow-x: hidden;
155
+ }
156
+ }
157
+ }
158
+ &.sy--hidden {
159
+ & > .vxe-table--body-wrapper {
160
+ & > .vxe-table--body-inner-wrapper {
161
+ overflow-y: hidden;
162
+ }
163
+ }
164
+ }
165
+ }
166
+ .vxe-table--fixed-left-wrapper,
167
+ .vxe-table--fixed-right-wrapper {
168
+ &.sx--hidden {
169
+ & > .vxe-table--body-wrapper {
170
+ & > .vxe-table--body-inner-wrapper {
171
+ overflow-x: hidden;
172
+ }
173
+ }
174
+ }
175
+ &.sy--hidden {
176
+ & > .vxe-table--body-wrapper {
177
+ & > .vxe-table--body-inner-wrapper {
178
+ overflow-y: hidden;
179
+ }
180
+ }
181
+ }
182
+ }
183
+
139
184
  .vxe-loading--custom-wrapper {
140
185
  display: none;
141
186
  position: absolute;
@@ -2141,11 +2186,16 @@ $btnThemeList: (
2141
2186
  display: none;
2142
2187
  visibility: hidden;
2143
2188
  }
2144
- .vxe-table--empty-placeholder {
2189
+ .vxe-table--empty-place-wrapper {
2145
2190
  display: none;
2146
2191
  position: absolute;
2192
+ width: 100%;
2147
2193
  top: 0;
2148
2194
  z-index: 5;
2195
+ overflow: hidden;
2196
+ }
2197
+ .vxe-table--empty-placeholder {
2198
+ display: flex;
2149
2199
  }
2150
2200
  .vxe-table--empty-content {
2151
2201
  display: block;
@@ -2154,7 +2204,7 @@ $btnThemeList: (
2154
2204
  }
2155
2205
  &.is--empty {
2156
2206
  .vxe-table--empty-block,
2157
- .vxe-table--empty-placeholder {
2207
+ .vxe-table--empty-place-wrapper{
2158
2208
  display: flex;
2159
2209
  }
2160
2210
  }