vxe-table 4.11.0-beta.1 → 4.11.0-beta.11

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 (72) hide show
  1. package/README.md +18 -13
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/locale/lang/id-ID.js +695 -0
  5. package/es/style.css +1 -1
  6. package/es/style.min.css +1 -1
  7. package/es/table/module/edit/hook.js +1 -7
  8. package/es/table/module/export/export-panel.js +8 -0
  9. package/es/table/module/export/hook.js +30 -11
  10. package/es/table/render/index.js +10 -0
  11. package/es/table/src/body.js +4 -2
  12. package/es/table/src/cell.js +3 -0
  13. package/es/table/src/footer.js +4 -2
  14. package/es/table/src/header.js +6 -4
  15. package/es/table/src/table.js +55 -27
  16. package/es/table/style.css +1 -1
  17. package/es/table/style.min.css +1 -1
  18. package/es/ui/index.js +1 -1
  19. package/es/ui/src/log.js +1 -1
  20. package/es/vxe-table/style.css +1 -1
  21. package/es/vxe-table/style.min.css +1 -1
  22. package/lib/index.css +1 -1
  23. package/lib/index.min.css +1 -1
  24. package/lib/index.umd.js +134 -53
  25. package/lib/index.umd.min.js +1 -1
  26. package/lib/locale/lang/id-ID.js +701 -0
  27. package/lib/locale/lang/id-ID.min.js +1 -0
  28. package/lib/style.css +1 -1
  29. package/lib/style.min.css +1 -1
  30. package/lib/table/module/edit/hook.js +1 -9
  31. package/lib/table/module/edit/hook.min.js +1 -1
  32. package/lib/table/module/export/export-panel.js +8 -0
  33. package/lib/table/module/export/hook.js +33 -10
  34. package/lib/table/module/export/hook.min.js +1 -1
  35. package/lib/table/render/index.js +10 -0
  36. package/lib/table/render/index.min.js +1 -1
  37. package/lib/table/src/body.js +4 -1
  38. package/lib/table/src/body.min.js +1 -1
  39. package/lib/table/src/cell.js +3 -0
  40. package/lib/table/src/cell.min.js +1 -1
  41. package/lib/table/src/footer.js +4 -1
  42. package/lib/table/src/footer.min.js +1 -1
  43. package/lib/table/src/header.js +6 -3
  44. package/lib/table/src/header.min.js +1 -1
  45. package/lib/table/src/table.js +63 -27
  46. package/lib/table/src/table.min.js +1 -1
  47. package/lib/table/style/style.css +1 -1
  48. package/lib/table/style/style.min.css +1 -1
  49. package/lib/ui/index.js +1 -1
  50. package/lib/ui/index.min.js +1 -1
  51. package/lib/ui/src/log.js +1 -1
  52. package/lib/ui/src/log.min.js +1 -1
  53. package/lib/vxe-table/style/style.css +1 -1
  54. package/lib/vxe-table/style/style.min.css +1 -1
  55. package/package.json +2 -2
  56. package/packages/locale/lang/id-ID.ts +695 -0
  57. package/packages/table/module/edit/hook.ts +1 -7
  58. package/packages/table/module/export/export-panel.ts +9 -0
  59. package/packages/table/module/export/hook.ts +37 -20
  60. package/packages/table/render/index.ts +10 -0
  61. package/packages/table/src/body.ts +5 -2
  62. package/packages/table/src/cell.ts +3 -0
  63. package/packages/table/src/footer.ts +5 -2
  64. package/packages/table/src/header.ts +7 -4
  65. package/packages/table/src/table.ts +59 -28
  66. package/styles/components/table.scss +1 -1
  67. /package/es/{iconfont.1739435040353.ttf → iconfont.1739840929802.ttf} +0 -0
  68. /package/es/{iconfont.1739435040353.woff → iconfont.1739840929802.woff} +0 -0
  69. /package/es/{iconfont.1739435040353.woff2 → iconfont.1739840929802.woff2} +0 -0
  70. /package/lib/{iconfont.1739435040353.ttf → iconfont.1739840929802.ttf} +0 -0
  71. /package/lib/{iconfont.1739435040353.woff → iconfont.1739840929802.woff} +0 -0
  72. /package/lib/{iconfont.1739435040353.woff2 → iconfont.1739840929802.woff2} +0 -0
@@ -289,12 +289,10 @@ hooks.add('tableEditModule', {
289
289
  }
290
290
 
291
291
  const handleClearEdit = (evnt: Event | null, targetRow?: any) => {
292
- const { mouseConfig } = props
293
292
  const { editStore } = reactData
294
293
  const { actived, focused } = editStore
295
294
  const { row, column } = actived
296
295
  const validOpts = computeValidOpts.value
297
- const mouseOpts = computeMouseOpts.value
298
296
  if (row || column) {
299
297
  if (targetRow && getRowid($xeTable, targetRow) !== getRowid($xeTable, row)) {
300
298
  return nextTick()
@@ -322,11 +320,7 @@ hooks.add('tableEditModule', {
322
320
  }
323
321
  }
324
322
  }
325
- return nextTick().then(() => {
326
- if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
327
- return $xeTable.handleRecalculateCellAreas()
328
- }
329
- })
323
+ return nextTick().then(() => $xeTable.updateCellAreas())
330
324
  }
331
325
 
332
326
  const handleEditActive = (params: any, evnt: Event | null, isFocus: boolean) => {
@@ -50,6 +50,11 @@ export default defineComponent({
50
50
  return !defaultOptions.original && defaultOptions.mode === 'current' && (storeData.isPrint || ['html', 'xlsx'].indexOf(defaultOptions.type) > -1)
51
51
  })
52
52
 
53
+ // const computeSupportGroup = computed(() => {
54
+ // const { defaultOptions } = props
55
+ // return ['html', 'xlsx', 'csv', 'txt'].indexOf(defaultOptions.type) > -1
56
+ // })
57
+
53
58
  const computeSupportStyle = computed(() => {
54
59
  const { defaultOptions } = props
55
60
  return !defaultOptions.original && ['xlsx'].indexOf(defaultOptions.type) > -1
@@ -166,6 +171,7 @@ export default defineComponent({
166
171
  const showSheet = computeShowSheet.value
167
172
  const supportMerge = computeSupportMerge.value
168
173
  const supportStyle = computeSupportStyle.value
174
+ // const supportGroup = computeSupportGroup.value
169
175
  const slots = defaultOptions.slots || {}
170
176
  const topSlot = slots.top
171
177
  const bottomSlot = slots.bottom
@@ -415,6 +421,9 @@ export default defineComponent({
415
421
  }, [
416
422
  VxeUICheckboxComponent
417
423
  ? h(VxeUICheckboxComponent, {
424
+ // modelValue: supportGroup || (isHeader && hasColgroup && supportMerge) ? defaultOptions.isColgroup : false,
425
+ // title: getI18n('vxe.export.expColgroupTitle'),
426
+ // disabled: !supportGroup && (!isHeader || !hasColgroup || !supportMerge),
418
427
  modelValue: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
419
428
  title: getI18n('vxe.export.expColgroupTitle'),
420
429
  disabled: !isHeader || !hasColgroup || !supportMerge,
@@ -92,9 +92,9 @@ function getBooleanValue (cellValue: any) {
92
92
  return cellValue === 'TRUE' || cellValue === 'true' || cellValue === true
93
93
  }
94
94
 
95
- function getFooterData (opts: any, footerTableData: any) {
95
+ function getFooterData (opts: VxeTablePropTypes.ExportHandleOptions, footerTableData: any[]) {
96
96
  const { footerFilterMethod } = opts
97
- return footerFilterMethod ? footerTableData.filter((items: any, index: any) => footerFilterMethod({ items, $rowIndex: index })) : footerTableData
97
+ return footerFilterMethod ? footerTableData.filter((items, index) => footerFilterMethod({ items, $rowIndex: index })) : footerTableData
98
98
  }
99
99
 
100
100
  function getCsvCellTypeLabel (column: any, cellValue: any) {
@@ -511,7 +511,7 @@ hooks.add('tableExportModule', {
511
511
  return XEUtils.get(row, column.field)
512
512
  }
513
513
 
514
- const toCsv = (opts: any, columns: any[], datas: any[]) => {
514
+ const toCsv = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
515
515
  let content = csvBOM
516
516
  if (opts.isHeader) {
517
517
  content += columns.map((column) => toTxtCellLabel(getHeaderTitle(opts, column))).join(',') + enterSymbol
@@ -522,14 +522,14 @@ hooks.add('tableExportModule', {
522
522
  if (opts.isFooter) {
523
523
  const { footerTableData } = reactData
524
524
  const footers = getFooterData(opts, footerTableData)
525
- footers.forEach((row: any) => {
525
+ footers.forEach((row) => {
526
526
  content += columns.map((column: any) => toTxtCellLabel(getFooterCellValue(opts, row, column))).join(',') + enterSymbol
527
527
  })
528
528
  }
529
529
  return content
530
530
  }
531
531
 
532
- const toTxt = (opts: any, columns: any[], datas: any[]) => {
532
+ const toTxt = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
533
533
  let content = ''
534
534
  if (opts.isHeader) {
535
535
  content += columns.map((column) => toTxtCellLabel(getHeaderTitle(opts, column))).join('\t') + enterSymbol
@@ -540,14 +540,14 @@ hooks.add('tableExportModule', {
540
540
  if (opts.isFooter) {
541
541
  const { footerTableData } = reactData
542
542
  const footers = getFooterData(opts, footerTableData)
543
- footers.forEach((row: any) => {
543
+ footers.forEach((row) => {
544
544
  content += columns.map((column: any) => toTxtCellLabel(getFooterCellValue(opts, row, column))).join('\t') + enterSymbol
545
545
  })
546
546
  }
547
547
  return content
548
548
  }
549
549
 
550
- const hasEllipsis = (column: any, property: string, allColumnOverflow: any) => {
550
+ const hasEllipsis = (column: VxeTableDefines.ColumnInfo, property: 'showOverflow' | 'showHeaderOverflow', allColumnOverflow: VxeTablePropTypes.ShowOverflow | undefined) => {
551
551
  const columnOverflow = column[property]
552
552
  const headOverflow = XEUtils.isUndefined(columnOverflow) || XEUtils.isNull(columnOverflow) ? allColumnOverflow : columnOverflow
553
553
  const showEllipsis = headOverflow === 'ellipsis'
@@ -562,7 +562,7 @@ hooks.add('tableExportModule', {
562
562
  return isEllipsis
563
563
  }
564
564
 
565
- const toHtml = (opts: any, columns: any, datas: any) => {
565
+ const toHtml = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
566
566
  const { id, border, treeConfig, headerAlign: allHeaderAlign, align: allAlign, footerAlign: allFooterAlign, showOverflow: allColumnOverflow, showHeaderOverflow: allColumnHeaderOverflow } = props
567
567
  const { isAllSelected, isIndeterminate, mergeList } = reactData
568
568
  const treeOpts = computeTreeOpts.value
@@ -762,7 +762,7 @@ hooks.add('tableExportModule', {
762
762
  return `${xml}</Table></Worksheet></Workbook>`
763
763
  }
764
764
 
765
- const getContent = (opts: any, columns: any, datas: any) => {
765
+ const getContent = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
766
766
  if (columns.length) {
767
767
  switch (opts.type) {
768
768
  case 'csv':
@@ -1138,24 +1138,28 @@ hooks.add('tableExportModule', {
1138
1138
  * @param {Object} options 参数
1139
1139
  */
1140
1140
  exportData (options) {
1141
- const { treeConfig } = props
1142
- const { isGroup, tableGroupColumn } = reactData
1141
+ const { treeConfig, showHeader, showFooter } = props
1142
+ const { mergeList, mergeFooterList, isGroup, tableGroupColumn } = reactData
1143
1143
  const { tableFullColumn, afterFullData } = internalData
1144
1144
  const exportOpts = computeExportOpts.value
1145
1145
  const treeOpts = computeTreeOpts.value
1146
+ const proxyOpts = $xeGrid ? $xeGrid.getComputeMaps().computeProxyOpts.value : {} as VxeGridPropTypes.ProxyOpts
1147
+ const hasMerge = !!(mergeList.length || mergeFooterList.length)
1146
1148
  const opts = Object.assign({
1149
+ message: true,
1150
+ isHeader: showHeader,
1151
+ isFooter: showFooter,
1152
+ isColgroup: isGroup,
1153
+ isMerge: hasMerge,
1154
+ useStyle: true,
1155
+ current: 'current',
1156
+ modes: ['current', 'selected'].concat(proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : []),
1157
+ download: true,
1158
+ type: 'csv'
1147
1159
  // filename: '',
1148
1160
  // sheetName: '',
1149
1161
  // original: false,
1150
- // message: false,
1151
- isHeader: true,
1152
- isFooter: true,
1153
- isColgroup: true,
1154
- // isMerge: false,
1155
1162
  // isAllExpand: false,
1156
- download: true,
1157
- type: 'csv',
1158
- mode: 'current'
1159
1163
  // data: null,
1160
1164
  // remote: false,
1161
1165
  // dataFilterMethod: null,
@@ -1167,7 +1171,20 @@ hooks.add('tableExportModule', {
1167
1171
  }, exportOpts, options)
1168
1172
  const { filename, sheetName, type, mode, columns, original, columnFilterMethod, beforeExportMethod, includeFields, excludeFields } = opts
1169
1173
  let groups: any[] = []
1170
- const customCols = columns && columns.length ? columns : null
1174
+ const customCols = columns && columns.length
1175
+ ? columns
1176
+ : XEUtils.searchTree(tableGroupColumn, column => {
1177
+ const isColGroup = column.children && column.children.length
1178
+ let isChecked = false
1179
+ if (columns && columns.length) {
1180
+ isChecked = handleFilterColumns(opts, column, columns)
1181
+ } else if (excludeFields || includeFields) {
1182
+ isChecked = handleFilterFields(opts, column, includeFields, excludeFields)
1183
+ } else {
1184
+ isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column))
1185
+ }
1186
+ return isChecked
1187
+ }, { children: 'children', mapChildren: 'childNodes', original: true })
1171
1188
  const handleOptions: VxeTablePropTypes.ExportHandleOptions = Object.assign({ } as { data: any[], colgroups: any[], columns: any[] }, opts, { filename: '', sheetName: '' })
1172
1189
  // 如果设置源数据,则默认导出设置了字段的列
1173
1190
  if (!customCols && !columnFilterMethod) {
@@ -819,6 +819,11 @@ renderer.mixin({
819
819
  tableFilterDefaultMethod: handleFilterMethod,
820
820
  tableExportMethod: handleExportSelectMethod
821
821
  },
822
+ formatOption: {
823
+ renderTableDefault (renderOpts, params) {
824
+ return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params))
825
+ }
826
+ },
822
827
  VxeTreeSelect: {
823
828
  tableAutoFocus: 'input',
824
829
  renderTableEdit: defaultTableOrTreeSelectEditRender,
@@ -827,6 +832,11 @@ renderer.mixin({
827
832
  },
828
833
  tableExportMethod: handleExportTreeSelectMethod
829
834
  },
835
+ formatTree: {
836
+ renderTableDefault (renderOpts, params) {
837
+ return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params))
838
+ }
839
+ },
830
840
  VxeTableSelect: {
831
841
  tableAutoFocus: 'input',
832
842
  renderTableEdit: defaultTableOrTreeSelectEditRender,
@@ -635,7 +635,7 @@ export default defineComponent({
635
635
 
636
636
  const { fixedColumn, fixedType, tableColumn } = props
637
637
  const { spanMethod, footerSpanMethod, mouseConfig } = tableProps
638
- const { isGroup, tableData, isRowLoading, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData
638
+ const { isGroup, tableData, isRowLoading, isColLoading, overflowX, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData
639
639
  const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData
640
640
  const rowOpts = computeRowOpts.value
641
641
  const emptyOpts = computeEmptyOpts.value
@@ -655,8 +655,11 @@ export default defineComponent({
655
655
  }
656
656
  }
657
657
 
658
- if (fixedType) {
658
+ if (fixedType || !overflowX) {
659
659
  renderColumnList = visibleColumn
660
+ }
661
+
662
+ if (fixedType) {
660
663
  if (isOptimizeMode) {
661
664
  renderColumnList = fixedColumn || []
662
665
  }
@@ -806,6 +806,9 @@ export const Cell = {
806
806
  class: ['vxe-table--expanded', {
807
807
  'is--active': isActive
808
808
  }],
809
+ onMousedown (evnt) {
810
+ evnt.stopPropagation()
811
+ },
809
812
  onClick (evnt: MouseEvent) {
810
813
  $table.triggerRowExpandEvent(evnt, params)
811
814
  }
@@ -267,7 +267,7 @@ export default defineComponent({
267
267
  const { fixedType, fixedColumn, tableColumn } = props
268
268
  const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
269
269
  const { visibleColumn, fullColumnIdData } = tableInternalData
270
- const { isGroup, scrollXLoad, scrollYLoad, dragCol } = tableReactData
270
+ const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
271
271
 
272
272
  let renderColumnList = tableColumn
273
273
  let isOptimizeMode = false
@@ -280,8 +280,11 @@ export default defineComponent({
280
280
  }
281
281
  }
282
282
 
283
- if (fixedType) {
283
+ if (fixedType || !overflowX) {
284
284
  renderColumnList = visibleColumn
285
+ }
286
+
287
+ if (fixedType) {
285
288
  if (isOptimizeMode) {
286
289
  renderColumnList = fixedColumn || []
287
290
  }
@@ -142,8 +142,8 @@ export default defineComponent({
142
142
  'is--sortable': column.sortable,
143
143
  'col--filter': !!filters,
144
144
  'is--filter-active': hasFilter,
145
- 'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
146
- 'is--drag-disabled': isDisabledDrag,
145
+ 'is--drag-active': columnOpts.drag && !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
146
+ 'is--drag-disabled': columnOpts.drag && isDisabledDrag,
147
147
  'col--current': currentColumn === column
148
148
  },
149
149
  headerClassName ? (XEUtils.isFunction(headerClassName) ? headerClassName(cellParams) : headerClassName) : '',
@@ -223,7 +223,7 @@ export default defineComponent({
223
223
  const renderVN = () => {
224
224
  const { fixedType, fixedColumn, tableColumn } = props
225
225
  const { mouseConfig, showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps
226
- const { isGroup, scrollXLoad, scrollYLoad, dragCol } = tableReactData
226
+ const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
227
227
  const { visibleColumn, fullColumnIdData } = tableInternalData
228
228
 
229
229
  const mouseOpts = computeMouseOpts.value
@@ -243,8 +243,11 @@ export default defineComponent({
243
243
  }
244
244
  }
245
245
 
246
- if (fixedType) {
246
+ if (fixedType || !overflowX) {
247
247
  renderColumnList = visibleColumn
248
+ }
249
+
250
+ if (fixedType) {
248
251
  // 如果是使用优化模式
249
252
  if (isOptimizeMode) {
250
253
  renderColumnList = fixedColumn || []
@@ -1247,6 +1247,7 @@ export default defineComponent({
1247
1247
  const fullColumnIdData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnIdData = {}
1248
1248
  const fullColumnFieldData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnFieldData = {}
1249
1249
  const mouseOpts = computeMouseOpts.value
1250
+ const expandOpts = computeExpandOpts.value
1250
1251
  const columnOpts = computeColumnOpts.value
1251
1252
  const columnDragOpts = computeColumnDragOpts.value
1252
1253
  const { isCrossDrag, isSelfToChildDrag } = columnDragOpts
@@ -1333,10 +1334,8 @@ export default defineComponent({
1333
1334
  tableFullColumn.forEach(handleFunc)
1334
1335
  }
1335
1336
 
1336
- if (process.env.VUE_APP_VXE_ENV === 'development') {
1337
- if (expandColumn && mouseOpts.area) {
1338
- errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
1339
- }
1337
+ if ((expandColumn && expandOpts.mode !== 'fixed') && mouseOpts.area) {
1338
+ errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
1340
1339
  }
1341
1340
 
1342
1341
  if (process.env.VUE_APP_VXE_ENV === 'development') {
@@ -1584,6 +1583,7 @@ export default defineComponent({
1584
1583
  }
1585
1584
 
1586
1585
  const updateAfterListIndex = () => {
1586
+ const { treeConfig } = props
1587
1587
  const { afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData
1588
1588
  const fullMaps: Record<string, any> = {}
1589
1589
  afterFullData.forEach((row, index) => {
@@ -1591,7 +1591,9 @@ export default defineComponent({
1591
1591
  const rowRest = fullAllDataRowIdData[rowid]
1592
1592
  const seq = index + 1
1593
1593
  if (rowRest) {
1594
- rowRest.seq = seq
1594
+ if (!treeConfig) {
1595
+ rowRest.seq = seq
1596
+ }
1595
1597
  rowRest._index = index
1596
1598
  } else {
1597
1599
  const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, treeIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
@@ -2607,7 +2609,10 @@ export default defineComponent({
2607
2609
  delete rExpandLazyLoadedMaps[rowid]
2608
2610
  }
2609
2611
  reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps
2610
- nextTick().then(() => tableMethods.recalculate()).then(() => resolve())
2612
+ nextTick()
2613
+ .then(() => $xeTable.recalculate())
2614
+ .then(() => $xeTable.updateCellAreas())
2615
+ .then(() => resolve())
2611
2616
  })
2612
2617
  } else {
2613
2618
  resolve()
@@ -3089,6 +3094,7 @@ export default defineComponent({
3089
3094
  }
3090
3095
 
3091
3096
  const handleColumn = (collectColumn: VxeTableDefines.ColumnInfo[]) => {
3097
+ const expandOpts = computeExpandOpts.value
3092
3098
  internalData.collectColumn = collectColumn
3093
3099
  const tableFullColumn = getColumnList(collectColumn)
3094
3100
  internalData.tableFullColumn = tableFullColumn
@@ -3098,6 +3104,7 @@ export default defineComponent({
3098
3104
  return Promise.resolve(
3099
3105
  restoreCustomStorage()
3100
3106
  ).then(() => {
3107
+ const { scrollXLoad, scrollYLoad, expandColumn } = reactData
3101
3108
  cacheColumnMap()
3102
3109
  parseColumns(true).then(() => {
3103
3110
  if (reactData.scrollXLoad) {
@@ -3107,11 +3114,11 @@ export default defineComponent({
3107
3114
  $xeTable.clearMergeCells()
3108
3115
  $xeTable.clearMergeFooterItems()
3109
3116
  $xeTable.handleTableData(true)
3110
- // if (process.env.VUE_APP_VXE_ENV === 'development') {
3111
- // if ((reactData.scrollXLoad || reactData.scrollYLoad) && reactData.expandColumn) {
3112
- // warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
3113
- // }
3114
- // }
3117
+
3118
+ if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
3119
+ warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
3120
+ }
3121
+
3115
3122
  return nextTick().then(() => {
3116
3123
  if ($xeToolbar) {
3117
3124
  $xeToolbar.syncUpdate({
@@ -3495,6 +3502,15 @@ export default defineComponent({
3495
3502
  }
3496
3503
  }
3497
3504
 
3505
+ const handleRowExpandScroll = () => {
3506
+ const { elemStore } = internalData
3507
+ const rowExpandEl = refRowExpandElem.value
3508
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
3509
+ if (rowExpandEl && bodyScrollElem) {
3510
+ rowExpandEl.scrollTop = bodyScrollElem.scrollTop
3511
+ }
3512
+ }
3513
+
3498
3514
  tableMethods = {
3499
3515
  dispatchEvent,
3500
3516
  /**
@@ -5211,14 +5227,14 @@ export default defineComponent({
5211
5227
  * @param {Boolean} expanded 是否展开
5212
5228
  */
5213
5229
  setRowExpand (rows, expanded) {
5214
- const { rowExpandedMaps, rowExpandLazyLoadedMaps, expandColumn: column } = reactData
5230
+ const { rowExpandedMaps, rowExpandLazyLoadedMaps, expandColumn } = reactData
5215
5231
  const { fullAllDataRowIdData } = internalData
5216
5232
  let rExpandedMaps = { ...rowExpandedMaps }
5217
5233
  const expandOpts = computeExpandOpts.value
5218
5234
  const { reserve, lazy, accordion, toggleMethod } = expandOpts
5219
5235
  const lazyRests: any[] = []
5220
- const columnIndex = tableMethods.getColumnIndex(column)
5221
- const $columnIndex = tableMethods.getVMColumnIndex(column)
5236
+ const columnIndex = $xeTable.getColumnIndex(expandColumn)
5237
+ const $columnIndex = $xeTable.getVMColumnIndex(expandColumn)
5222
5238
  if (rows) {
5223
5239
  if (!XEUtils.isArray(rows)) {
5224
5240
  rows = [rows]
@@ -5228,7 +5244,7 @@ export default defineComponent({
5228
5244
  rExpandedMaps = {}
5229
5245
  rows = rows.slice(rows.length - 1, rows.length)
5230
5246
  }
5231
- const validRows: any[] = toggleMethod ? rows.filter((row: any) => toggleMethod({ $table: $xeTable, expanded, column, columnIndex, $columnIndex, row, rowIndex: tableMethods.getRowIndex(row), $rowIndex: tableMethods.getVMRowIndex(row) })) : rows
5247
+ const validRows: any[] = toggleMethod ? rows.filter((row: any) => toggleMethod({ $table: $xeTable, expanded, column: expandColumn, columnIndex, $columnIndex, row, rowIndex: tableMethods.getRowIndex(row), $rowIndex: tableMethods.getVMRowIndex(row) })) : rows
5232
5248
  if (expanded) {
5233
5249
  validRows.forEach((row: any) => {
5234
5250
  const rowid = getRowid($xeTable, row)
@@ -5251,11 +5267,19 @@ export default defineComponent({
5251
5267
  })
5252
5268
  }
5253
5269
  if (reserve) {
5254
- validRows.forEach((row: any) => handleRowExpandReserve(row, expanded))
5270
+ validRows.forEach((row) => handleRowExpandReserve(row, expanded))
5255
5271
  }
5256
5272
  }
5257
5273
  reactData.rowExpandedMaps = rExpandedMaps
5258
- return Promise.all(lazyRests).then(() => tableMethods.recalculate())
5274
+ return Promise.all(lazyRests)
5275
+ .then(() => $xeTable.recalculate())
5276
+ .then(() => {
5277
+ if (expandColumn) {
5278
+ updateRowExpandStyle()
5279
+ handleRowExpandScroll()
5280
+ }
5281
+ return $xeTable.updateCellAreas()
5282
+ })
5259
5283
  },
5260
5284
  /**
5261
5285
  * 判断行是否为展开状态
@@ -5289,7 +5313,7 @@ export default defineComponent({
5289
5313
  if (expList.length) {
5290
5314
  tableMethods.recalculate()
5291
5315
  }
5292
- })
5316
+ }).then(() => $xeTable.updateCellAreas())
5293
5317
  },
5294
5318
  clearRowExpandReserve () {
5295
5319
  internalData.rowExpandedReserveRowMap = {}
@@ -5712,8 +5736,8 @@ export default defineComponent({
5712
5736
  updateCellAreas () {
5713
5737
  const { mouseConfig } = props
5714
5738
  const mouseOpts = computeMouseOpts.value
5715
- if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
5716
- return $xeTable.handleRecalculateCellAreas()
5739
+ if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreaEvent) {
5740
+ return $xeTable.handleRecalculateCellAreaEvent()
5717
5741
  }
5718
5742
  return nextTick()
5719
5743
  },
@@ -7314,7 +7338,7 @@ export default defineComponent({
7314
7338
  const isSelected = sLen >= vLen
7315
7339
  const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1)
7316
7340
  if (checkField) {
7317
- XEUtils.get(row, checkField, isSelected)
7341
+ XEUtils.set(row, checkField, isSelected)
7318
7342
  }
7319
7343
  if (isSelected) {
7320
7344
  if (!checkField) {
@@ -7384,7 +7408,7 @@ export default defineComponent({
7384
7408
  vLen++
7385
7409
  })
7386
7410
 
7387
- const isSelected = vLen > 0 ? sLen >= vLen : sLen >= rootList.length
7411
+ const isSelected = rootList.length > 0 ? (vLen > 0 ? (sLen >= vLen) : (sLen >= rootList.length)) : false
7388
7412
  const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1)
7389
7413
 
7390
7414
  reactData.isAllSelected = isSelected
@@ -9046,7 +9070,7 @@ export default defineComponent({
9046
9070
  updateScrollYStatus,
9047
9071
  // 更新横向 X 可视渲染上下剩余空间大小
9048
9072
  updateScrollXSpace () {
9049
- const { isGroup, scrollXLoad } = reactData
9073
+ const { isGroup, scrollXLoad, overflowX } = reactData
9050
9074
  const { visibleColumn, scrollXStore, elemStore, tableWidth } = internalData
9051
9075
  const tableHeader = refTableHeader.value
9052
9076
  const tableBody = refTableBody.value
@@ -9060,7 +9084,7 @@ export default defineComponent({
9060
9084
  const footerElem = tableFooterElem ? tableFooterElem.querySelector('.vxe-table--footer') as HTMLTableElement : null
9061
9085
  const leftSpaceWidth = visibleColumn.slice(0, scrollXStore.startIndex).reduce((previous, column) => previous + column.renderWidth, 0)
9062
9086
  let marginLeft = ''
9063
- if (scrollXLoad) {
9087
+ if (scrollXLoad && overflowX) {
9064
9088
  marginLeft = `${leftSpaceWidth}px`
9065
9089
  }
9066
9090
  if (headerElem) {
@@ -9888,7 +9912,8 @@ export default defineComponent({
9888
9912
  warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
9889
9913
  }
9890
9914
  loadTableData(value, true).then(() => {
9891
- // const { scrollXLoad, scrollYLoad, expandColumn } = reactData
9915
+ const { scrollXLoad, scrollYLoad, expandColumn } = reactData
9916
+ const expandOpts = computeExpandOpts.value
9892
9917
  internalData.inited = true
9893
9918
  internalData.initStatus = true
9894
9919
  if (!initStatus) {
@@ -9899,9 +9924,9 @@ export default defineComponent({
9899
9924
  // if (checkboxColumn && internalData.tableFullData.length > 300 && !checkboxOpts.checkField) {
9900
9925
  // warnLog('vxe.error.checkProp', ['checkbox-config.checkField'])
9901
9926
  // }
9902
- // if ((scrollXLoad || scrollYLoad) && expandColumn) {
9903
- // warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
9904
- // }
9927
+ if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
9928
+ warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
9929
+ }
9905
9930
  return tableMethods.recalculate()
9906
9931
  })
9907
9932
  })
@@ -9950,6 +9975,12 @@ export default defineComponent({
9950
9975
  watch(() => props.showFooter, () => {
9951
9976
  reScrollFlag.value++
9952
9977
  })
9978
+ watch(() => reactData.overflowX, () => {
9979
+ reScrollFlag.value++
9980
+ })
9981
+ watch(() => reactData.overflowY, () => {
9982
+ reScrollFlag.value++
9983
+ })
9953
9984
  watch(reScrollFlag, () => {
9954
9985
  nextTick(() => {
9955
9986
  tableMethods.recalculate(true).then(() => tableMethods.refreshScroll())
@@ -271,7 +271,7 @@
271
271
  display: none;
272
272
  position: absolute;
273
273
  pointer-events: none;
274
- z-index: 1;
274
+ z-index: 6;
275
275
  }
276
276
 
277
277
  .vxe-table--header-wrapper {