vxe-table 4.17.0 → 4.17.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 (51) hide show
  1. package/README.md +3 -4
  2. package/README.zh-TW.md +1 -1
  3. package/es/grid/src/grid.js +13 -5
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/locale/lang/en-US.js +22 -22
  7. package/es/style.css +1 -1
  8. package/es/style.min.css +1 -1
  9. package/es/table/src/table.js +74 -21
  10. package/es/table/src/util.js +19 -16
  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 +12 -4
  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 +36 -33
  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/table.js +15 -11
  29. package/lib/table/src/table.min.js +1 -1
  30. package/lib/table/src/util.js +7 -16
  31. package/lib/table/src/util.min.js +1 -1
  32. package/lib/table/style/style.css +29 -2
  33. package/lib/table/style/style.min.css +1 -1
  34. package/lib/ui/index.js +1 -1
  35. package/lib/ui/index.min.js +1 -1
  36. package/lib/ui/src/log.js +1 -1
  37. package/lib/ui/src/log.min.js +1 -1
  38. package/lib/vxe-table/style/style.css +29 -2
  39. package/lib/vxe-table/style/style.min.css +1 -1
  40. package/package.json +2 -2
  41. package/packages/grid/src/grid.ts +53 -45
  42. package/packages/locale/lang/en-US.ts +22 -22
  43. package/packages/table/src/table.ts +77 -21
  44. package/packages/table/src/util.ts +27 -16
  45. package/styles/components/table.scss +52 -2
  46. /package/es/{iconfont.1760925752102.ttf → iconfont.1761181613193.ttf} +0 -0
  47. /package/es/{iconfont.1760925752102.woff → iconfont.1761181613193.woff} +0 -0
  48. /package/es/{iconfont.1760925752102.woff2 → iconfont.1761181613193.woff2} +0 -0
  49. /package/lib/{iconfont.1760925752102.ttf → iconfont.1761181613193.ttf} +0 -0
  50. /package/lib/{iconfont.1760925752102.woff → iconfont.1761181613193.woff} +0 -0
  51. /package/lib/{iconfont.1760925752102.woff2 → iconfont.1761181613193.woff2} +0 -0
@@ -19,7 +19,7 @@ import type { VxeTableMethods, VxeGridConstructor, VxeGridEmits, GridReactData,
19
19
  const { getConfig, getI18n, commands, hooks, useFns, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement } = VxeUI
20
20
 
21
21
  const tableComponentPropKeys = Object.keys(tableProps) as (keyof VxeTableProps)[]
22
- const tableComponentMethodKeys: (keyof VxeTableMethods)[] = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar']
22
+ const tableComponentMethodKeys: (keyof VxeTableMethods)[] = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar']
23
23
 
24
24
  function createInternalData (): GridInternalData {
25
25
  return {
@@ -1015,6 +1015,7 @@ export default defineVxeComponent({
1015
1015
  if (!isInited && reactData.tableLoading) {
1016
1016
  return nextTick()
1017
1017
  }
1018
+ let operPromise = null
1018
1019
  let sortList: any[] = []
1019
1020
  let filterList: VxeTableDefines.FilterCheckedParams[] = []
1020
1021
  let pageParams: any = {}
@@ -1068,7 +1069,7 @@ export default defineVxeComponent({
1068
1069
  } else {
1069
1070
  if ($xeTable) {
1070
1071
  if (isReload) {
1071
- $xeTable.clearAll()
1072
+ operPromise = $xeTable.clearAll()
1072
1073
  } else {
1073
1074
  sortList = $xeTable.getSortColumns()
1074
1075
  filterList = $xeTable.getCheckedFilters()
@@ -1093,50 +1094,53 @@ export default defineVxeComponent({
1093
1094
  reactData.sortData = sortList
1094
1095
  reactData.filterData = filterList
1095
1096
  reactData.tableLoading = true
1096
- return Promise.resolve((beforeQuery || ajaxMethods)(commitParams, ...args))
1097
- .then(rest => {
1098
- let tableData: any[] = []
1099
- reactData.tableLoading = false
1100
- if (rest) {
1101
- if (pagerConfig && isEnableConf(pagerOpts)) {
1102
- const totalProp = resConfigs.total
1103
- const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, totalProp || 'page.total')) || 0
1104
- tablePage.total = XEUtils.toNumber(total)
1105
- const resultProp = resConfigs.result
1106
- tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, resultProp || 'result')) || []
1107
- // 检验当前页码,不能超出当前最大页数
1108
- const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1)
1109
- if (tablePage.currentPage > pageCount) {
1110
- tablePage.currentPage = pageCount
1111
- }
1112
- } else {
1113
- const listProp = resConfigs.list
1114
- tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, listProp)) : rest) || []
1097
+ return Promise.all([
1098
+ Promise.resolve((beforeQuery || ajaxMethods)(commitParams, ...args)),
1099
+ operPromise
1100
+ ]).then(([rest]) => {
1101
+ let tableData: any[] = []
1102
+ reactData.tableLoading = false
1103
+ if (rest) {
1104
+ if (pagerConfig && isEnableConf(pagerOpts)) {
1105
+ const totalProp = resConfigs.total
1106
+ const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, totalProp || 'page.total')) || 0
1107
+ tablePage.total = XEUtils.toNumber(total)
1108
+ const resultProp = resConfigs.result
1109
+ tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, resultProp || 'result')) || []
1110
+ // 检验当前页码,不能超出当前最大页数
1111
+ const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1)
1112
+ if (tablePage.currentPage > pageCount) {
1113
+ tablePage.currentPage = pageCount
1115
1114
  }
1116
- }
1117
- if ($xeTable as any) {
1118
- $xeTable.loadData(tableData)
1119
1115
  } else {
1120
- nextTick(() => {
1121
- if ($xeTable) {
1122
- $xeTable.loadData(tableData)
1123
- }
1124
- })
1125
- }
1126
- if (afterQuery) {
1127
- afterQuery(commitParams, ...args)
1116
+ const listProp = resConfigs.list
1117
+ tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : XEUtils.get(rest, listProp)) : rest) || []
1128
1118
  }
1129
- if (querySuccessMethods) {
1130
- querySuccessMethods({ ...commitParams, response: rest })
1131
- }
1132
- return { status: true }
1133
- }).catch((rest) => {
1134
- reactData.tableLoading = false
1135
- if (queryErrorMethods) {
1136
- queryErrorMethods({ ...commitParams, response: rest })
1137
- }
1138
- return { status: false }
1139
- })
1119
+ }
1120
+ if ($xeTable) {
1121
+ $xeTable.loadData(tableData)
1122
+ } else {
1123
+ nextTick(() => {
1124
+ const $xeTable = refTable.value
1125
+ if ($xeTable) {
1126
+ $xeTable.loadData(tableData)
1127
+ }
1128
+ })
1129
+ }
1130
+ if (afterQuery) {
1131
+ afterQuery(commitParams, ...args)
1132
+ }
1133
+ if (querySuccessMethods) {
1134
+ querySuccessMethods({ ...commitParams, response: rest })
1135
+ }
1136
+ return { status: true }
1137
+ }).catch((rest) => {
1138
+ reactData.tableLoading = false
1139
+ if (queryErrorMethods) {
1140
+ queryErrorMethods({ ...commitParams, response: rest })
1141
+ }
1142
+ return { status: false }
1143
+ })
1140
1144
  } else {
1141
1145
  errLog('vxe.error.notFunc', ['[grid] proxy-config.ajax.query'])
1142
1146
  }
@@ -1469,6 +1473,7 @@ export default defineVxeComponent({
1469
1473
  * 获取需要排除的高度
1470
1474
  */
1471
1475
  getExcludeHeight () {
1476
+ const { height } = props
1472
1477
  const { isZMax } = reactData
1473
1478
  const el = refElem.value
1474
1479
  if (el) {
@@ -1477,8 +1482,11 @@ export default defineVxeComponent({
1477
1482
  const topWrapper = refTopWrapper.value
1478
1483
  const bottomWrapper = refBottomWrapper.value
1479
1484
  const pagerWrapper = refPagerWrapper.value
1480
- const parentEl = el.parentElement as HTMLElement
1481
- const parentPaddingSize = isZMax ? 0 : (parentEl ? getPaddingTopBottomSize(parentEl) : 0)
1485
+ const parentEl = el.parentElement
1486
+ let parentPaddingSize = 0
1487
+ if (parentEl && (height === '100%' || height === 'auto')) {
1488
+ parentPaddingSize = isZMax ? 0 : getPaddingTopBottomSize(parentEl)
1489
+ }
1482
1490
  return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper)
1483
1491
  }
1484
1492
  return 0
@@ -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',
@@ -1598,7 +1598,7 @@ export default defineVxeComponent({
1598
1598
  }
1599
1599
 
1600
1600
  const calcTableHeight = (key: 'height' | 'minHeight' | 'maxHeight') => {
1601
- const { editConfig } = props
1601
+ const { editConfig, editRules } = props
1602
1602
  const { parentHeight } = reactData
1603
1603
  let val = props[key]
1604
1604
  if (key === 'minHeight') {
@@ -1606,7 +1606,7 @@ export default defineVxeComponent({
1606
1606
  if (XEUtils.eqNull(val)) {
1607
1607
  if (eqEmptyValue(defMinHeight)) {
1608
1608
  // 编辑模式默认最小高度
1609
- if (isEnableConf(editConfig)) {
1609
+ if (editRules && isEnableConf(editConfig)) {
1610
1610
  val = 144
1611
1611
  }
1612
1612
  } else {
@@ -2464,7 +2464,7 @@ export default defineVxeComponent({
2464
2464
  const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
2465
2465
  const $xeGanttView = internalData.xeGanttView
2466
2466
  const el = refElem.value
2467
- if (!el || !el.clientHeight) {
2467
+ if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
2468
2468
  return
2469
2469
  }
2470
2470
  const containerList = ['main', 'left', 'right']
@@ -7027,14 +7027,40 @@ export default defineVxeComponent({
7027
7027
  * 获取表格的滚动状态
7028
7028
  */
7029
7029
  getScroll () {
7030
- const { scrollXLoad, scrollYLoad } = reactData
7030
+ return $xeTable.getScrollData()
7031
+ },
7032
+ /**
7033
+ * 获取表格的滚动数据
7034
+ */
7035
+ getScrollData () {
7036
+ const { scrollXLoad, scrollYLoad, scrollbarHeight, scrollbarWidth } = reactData
7031
7037
  const { elemStore } = internalData
7032
7038
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
7039
+ const scrollTop = bodyScrollElem ? bodyScrollElem.scrollTop : 0
7040
+ const scrollLeft = bodyScrollElem ? bodyScrollElem.scrollLeft : 0
7041
+ const clientHeight = bodyScrollElem ? bodyScrollElem.clientHeight : 0
7042
+ const clientWidth = bodyScrollElem ? bodyScrollElem.clientWidth : 0
7043
+ const scrollHeight = bodyScrollElem ? bodyScrollElem.scrollHeight : 0
7044
+ const scrollWidth = bodyScrollElem ? bodyScrollElem.scrollWidth : 0
7045
+ const isTop = scrollTop <= 0
7046
+ const isBottom = scrollTop + clientHeight >= scrollHeight
7047
+ const isLeft = scrollLeft <= 0
7048
+ const isRight = scrollLeft + clientWidth >= scrollWidth
7033
7049
  return {
7034
7050
  virtualX: scrollXLoad,
7035
7051
  virtualY: scrollYLoad,
7036
- scrollTop: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
7037
- scrollLeft: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
7052
+ isTop,
7053
+ isBottom,
7054
+ isLeft,
7055
+ isRight,
7056
+ scrollbarHeight,
7057
+ scrollbarWidth,
7058
+ scrollTop,
7059
+ scrollLeft,
7060
+ scrollHeight,
7061
+ scrollWidth,
7062
+ clientHeight,
7063
+ clientWidth
7038
7064
  }
7039
7065
  },
7040
7066
  /**
@@ -7158,7 +7184,10 @@ export default defineVxeComponent({
7158
7184
  scrollYStore.visibleStartIndex = 0
7159
7185
  scrollYStore.endIndex = scrollYStore.visibleSize
7160
7186
  scrollYStore.visibleEndIndex = scrollYStore.visibleSize
7187
+
7161
7188
  return nextTick().then(() => {
7189
+ internalData.lastScrollLeft = 0
7190
+ internalData.lastScrollTop = 0
7162
7191
  internalData.intoRunScroll = false
7163
7192
  })
7164
7193
  },
@@ -8364,7 +8393,7 @@ export default defineVxeComponent({
8364
8393
  const el = refElem.value
8365
8394
  if (el) {
8366
8395
  const parentElem = el.parentNode as HTMLElement
8367
- const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0
8396
+ let parentPaddingSize = 0
8368
8397
  let parentWrapperHeight = 0
8369
8398
  if (parentElem) {
8370
8399
  if ($xeGantt && hasClass(parentElem, 'vxe-gantt--table-wrapper')) {
@@ -8373,6 +8402,7 @@ export default defineVxeComponent({
8373
8402
  parentWrapperHeight = $xeGrid.getParentHeight()
8374
8403
  } else {
8375
8404
  parentWrapperHeight = parentElem.clientHeight
8405
+ parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0
8376
8406
  }
8377
8407
  }
8378
8408
  return Math.floor(parentWrapperHeight - parentPaddingSize)
@@ -11404,12 +11434,11 @@ export default defineVxeComponent({
11404
11434
  const { scrollXLoad, scrollYLoad, expandColumn } = reactData
11405
11435
  const leftFixedWidth = computeLeftFixedWidth.value
11406
11436
  const rightFixedWidth = computeRightFixedWidth.value
11407
- if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
11408
- return
11409
- }
11410
11437
 
11411
11438
  const { elemStore, lastScrollTop, lastScrollLeft } = internalData
11412
11439
  const rowOpts = computeRowOpts.value
11440
+ const scrollbarXOpts = computeScrollbarXOpts.value
11441
+ const scrollbarYOpts = computeScrollbarYOpts.value
11413
11442
  const xHandleEl = refScrollXHandleElem.value
11414
11443
  const yHandleEl = refScrollYHandleElem.value
11415
11444
  const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
@@ -11418,12 +11447,6 @@ export default defineVxeComponent({
11418
11447
  const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
11419
11448
  const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
11420
11449
  const rowExpandEl = refRowExpandElem.value
11421
- if (!xHandleEl) {
11422
- return
11423
- }
11424
- if (!yHandleEl) {
11425
- return
11426
- }
11427
11450
  if (!bodyScrollElem) {
11428
11451
  return
11429
11452
  }
@@ -11440,7 +11463,19 @@ export default defineVxeComponent({
11440
11463
  const isRollX = scrollLeft !== lastScrollLeft
11441
11464
  const isRollY = scrollTop !== lastScrollTop
11442
11465
 
11466
+ if (isRollX) {
11467
+ // 如果禁用滚动
11468
+ if (scrollbarXOpts.visible === 'hidden') {
11469
+ evnt.preventDefault()
11470
+ return
11471
+ }
11472
+ }
11443
11473
  if (isRollY) {
11474
+ // 如果禁用滚动
11475
+ if (scrollbarYOpts.visible === 'hidden') {
11476
+ evnt.preventDefault()
11477
+ return
11478
+ }
11444
11479
  const isTopWheel = deltaTop < 0
11445
11480
  // 如果滚动位置已经是顶部或底部,则不需要触发
11446
11481
  if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
@@ -11448,9 +11483,14 @@ export default defineVxeComponent({
11448
11483
  }
11449
11484
  }
11450
11485
 
11486
+ if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
11487
+ return
11488
+ }
11489
+
11451
11490
  if (rowOpts.isHover || highlightHoverRow) {
11452
11491
  $xeTable.clearHoverRow()
11453
11492
  }
11493
+
11454
11494
  // 用于鼠标纵向滚轮处理
11455
11495
  if (isRollX) {
11456
11496
  evnt.preventDefault()
@@ -11972,7 +12012,7 @@ export default defineVxeComponent({
11972
12012
  const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior
11973
12013
  return h('div', {
11974
12014
  ref: isFixedLeft ? refLeftContainer : refRightContainer,
11975
- class: [`vxe-table--fixed-${fixedType}-wrapper`, {
12015
+ class: [`vxe-table--fixed-${fixedType}-wrapper`, `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`, {
11976
12016
  [`x-ob--${osXBehavior}`]: osXBehavior,
11977
12017
  [`y-ob--${osYBehavior}`]: osYBehavior
11978
12018
  }]
@@ -12290,7 +12330,7 @@ export default defineVxeComponent({
12290
12330
  }]
12291
12331
  }, [
12292
12332
  h('div', {
12293
- class: 'vxe-table--main-wrapper'
12333
+ class: ['vxe-table--main-wrapper', `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`]
12294
12334
  }, [
12295
12335
  /**
12296
12336
  * 表头
@@ -12466,11 +12506,15 @@ export default defineVxeComponent({
12466
12506
  h('div', {
12467
12507
  key: 'tn',
12468
12508
  ref: refEmptyPlaceholder,
12469
- class: 'vxe-table--empty-placeholder'
12509
+ class: 'vxe-table--empty-place-wrapper'
12470
12510
  }, [
12471
12511
  h('div', {
12472
- class: 'vxe-table--empty-content'
12473
- }, renderEmptyBody())
12512
+ class: 'vxe-table--empty-placeholder'
12513
+ }, [
12514
+ h('div', {
12515
+ class: 'vxe-table--empty-content'
12516
+ }, renderEmptyBody())
12517
+ ])
12474
12518
  ]),
12475
12519
  /**
12476
12520
  * 边框线
@@ -12783,6 +12827,18 @@ export default defineVxeComponent({
12783
12827
  watch(() => VxeUI.getLanguage(), () => {
12784
12828
  reLayoutFlag.value++
12785
12829
  })
12830
+ watch(() => {
12831
+ const scrollbarXOpts = computeScrollbarXOpts.value
12832
+ return scrollbarXOpts.visible
12833
+ }, () => {
12834
+ reLayoutFlag.value++
12835
+ })
12836
+ watch(() => {
12837
+ const scrollbarYOpts = computeScrollbarYOpts.value
12838
+ return scrollbarYOpts.visible
12839
+ }, () => {
12840
+ reLayoutFlag.value++
12841
+ })
12786
12842
  watch(reLayoutFlag, () => {
12787
12843
  $xeTable.recalculate(true)
12788
12844
  })
@@ -702,29 +702,40 @@ export function calcTreeLine (params: VxeTableDefines.CellRenderBodyParams, prev
702
702
 
703
703
  export function clearTableDefaultStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
704
704
  const { props, internalData } = $xeTable
705
+
705
706
  internalData.initStatus = false
706
- $xeTable.clearSort()
707
- $xeTable.clearCurrentRow()
708
- $xeTable.clearCurrentColumn()
709
- $xeTable.clearRadioRow()
710
- $xeTable.clearRadioReserve()
711
- $xeTable.clearCheckboxRow()
712
- $xeTable.clearCheckboxReserve()
713
- $xeTable.clearRowExpand()
714
- $xeTable.clearTreeExpand()
715
- $xeTable.clearTreeExpandReserve()
716
- $xeTable.clearPendingRow()
707
+ const actionList = [
708
+ $xeTable.clearSort(),
709
+ $xeTable.clearCurrentRow(),
710
+ $xeTable.clearCurrentColumn(),
711
+ $xeTable.clearRadioRow(),
712
+ $xeTable.clearRadioReserve(),
713
+ $xeTable.clearCheckboxRow(),
714
+ $xeTable.clearCheckboxReserve(),
715
+ $xeTable.clearRowExpand(),
716
+ $xeTable.clearTreeExpand(),
717
+ $xeTable.clearTreeExpandReserve(),
718
+ $xeTable.clearPendingRow()
719
+ ]
717
720
  if ($xeTable.clearFilter) {
718
- $xeTable.clearFilter()
721
+ actionList.push(
722
+ $xeTable.clearFilter()
723
+ )
719
724
  }
720
725
  if ($xeTable.clearSelected && (props.keyboardConfig || props.mouseConfig)) {
721
- $xeTable.clearSelected()
726
+ actionList.push(
727
+ $xeTable.clearSelected()
728
+ )
722
729
  }
723
730
  if ($xeTable.clearCellAreas && props.mouseConfig) {
724
- $xeTable.clearCellAreas()
725
- $xeTable.clearCopyCellArea()
731
+ actionList.push(
732
+ $xeTable.clearCellAreas(),
733
+ $xeTable.clearCopyCellArea()
734
+ )
726
735
  }
727
- return $xeTable.clearScroll()
736
+ return Promise.all(actionList).then(() => {
737
+ return $xeTable.clearScroll()
738
+ })
728
739
  }
729
740
 
730
741
  export function clearTableAllStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
@@ -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
  }