vxe-table 3.12.10-beta.9 → 3.12.10

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 (178) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/ar-EG.js +2 -1
  4. package/es/locale/lang/de-DE.js +2 -1
  5. package/es/locale/lang/en-US.js +4 -3
  6. package/es/locale/lang/es-ES.js +2 -1
  7. package/es/locale/lang/fr-FR.js +2 -1
  8. package/es/locale/lang/hu-HU.js +2 -1
  9. package/es/locale/lang/hy-AM.js +2 -1
  10. package/es/locale/lang/it-IT.js +2 -1
  11. package/es/locale/lang/ja-JP.js +2 -1
  12. package/es/locale/lang/ko-KR.js +2 -1
  13. package/es/locale/lang/nb-NO.js +2 -1
  14. package/es/locale/lang/pt-BR.js +2 -1
  15. package/es/locale/lang/ru-RU.js +4 -3
  16. package/es/locale/lang/th-TH.js +2 -1
  17. package/es/locale/lang/ug-CN.js +2 -1
  18. package/es/locale/lang/uk-UA.js +518 -517
  19. package/es/locale/lang/vi-VN.js +2 -1
  20. package/es/locale/lang/zh-CHT.js +2 -1
  21. package/es/locale/lang/zh-CN.js +2 -1
  22. package/es/style.css +1 -1
  23. package/es/style.min.css +1 -1
  24. package/es/table/module/edit/mixin.js +7 -7
  25. package/es/table/module/export/mixin.js +105 -69
  26. package/es/table/module/keyboard/mixin.js +68 -25
  27. package/es/table/module/menu/mixin.js +3 -1
  28. package/es/table/src/body.js +125 -86
  29. package/es/table/src/cell.js +43 -57
  30. package/es/table/src/column.js +43 -8
  31. package/es/table/src/columnInfo.js +3 -0
  32. package/es/table/src/footer.js +47 -6
  33. package/es/table/src/header.js +67 -165
  34. package/es/table/src/methods.js +962 -480
  35. package/es/table/src/props.js +14 -4
  36. package/es/table/src/table.js +114 -33
  37. package/es/table/src/util.js +73 -57
  38. package/es/table/style.css +246 -191
  39. package/es/table/style.min.css +1 -1
  40. package/es/ui/index.js +20 -6
  41. package/es/ui/src/log.js +1 -1
  42. package/es/vxe-table/style.css +246 -191
  43. package/es/vxe-table/style.min.css +1 -1
  44. package/lib/index.css +1 -1
  45. package/lib/index.min.css +1 -1
  46. package/lib/index.umd.js +1734 -1020
  47. package/lib/index.umd.min.js +1 -1
  48. package/lib/locale/lang/ar-EG.js +2 -1
  49. package/lib/locale/lang/ar-EG.min.js +1 -1
  50. package/lib/locale/lang/de-DE.js +2 -1
  51. package/lib/locale/lang/de-DE.min.js +1 -1
  52. package/lib/locale/lang/en-US.js +4 -3
  53. package/lib/locale/lang/en-US.min.js +1 -1
  54. package/lib/locale/lang/en-US.umd.js +4 -3
  55. package/lib/locale/lang/es-ES.js +2 -1
  56. package/lib/locale/lang/es-ES.min.js +1 -1
  57. package/lib/locale/lang/es-ES.umd.js +2 -1
  58. package/lib/locale/lang/fr-FR.js +2 -1
  59. package/lib/locale/lang/fr-FR.min.js +1 -1
  60. package/lib/locale/lang/hu-HU.js +2 -1
  61. package/lib/locale/lang/hu-HU.min.js +1 -1
  62. package/lib/locale/lang/hu-HU.umd.js +2 -1
  63. package/lib/locale/lang/hy-AM.js +2 -1
  64. package/lib/locale/lang/hy-AM.min.js +1 -1
  65. package/lib/locale/lang/it-IT.js +2 -1
  66. package/lib/locale/lang/it-IT.min.js +1 -1
  67. package/lib/locale/lang/ja-JP.js +2 -1
  68. package/lib/locale/lang/ja-JP.min.js +1 -1
  69. package/lib/locale/lang/ja-JP.umd.js +2 -1
  70. package/lib/locale/lang/ko-KR.js +2 -1
  71. package/lib/locale/lang/ko-KR.min.js +1 -1
  72. package/lib/locale/lang/ko-KR.umd.js +2 -1
  73. package/lib/locale/lang/nb-NO.js +2 -1
  74. package/lib/locale/lang/nb-NO.min.js +1 -1
  75. package/lib/locale/lang/pt-BR.js +2 -1
  76. package/lib/locale/lang/pt-BR.min.js +1 -1
  77. package/lib/locale/lang/pt-BR.umd.js +2 -1
  78. package/lib/locale/lang/ru-RU.js +4 -3
  79. package/lib/locale/lang/ru-RU.min.js +1 -1
  80. package/lib/locale/lang/ru-RU.umd.js +4 -3
  81. package/lib/locale/lang/th-TH.js +2 -1
  82. package/lib/locale/lang/th-TH.min.js +1 -1
  83. package/lib/locale/lang/ug-CN.js +2 -1
  84. package/lib/locale/lang/ug-CN.min.js +1 -1
  85. package/lib/locale/lang/uk-UA.js +518 -517
  86. package/lib/locale/lang/uk-UA.min.js +1 -1
  87. package/lib/locale/lang/uk-UA.umd.js +518 -517
  88. package/lib/locale/lang/vi-VN.js +2 -1
  89. package/lib/locale/lang/vi-VN.min.js +1 -1
  90. package/lib/locale/lang/zh-CHT.js +2 -1
  91. package/lib/locale/lang/zh-CHT.min.js +1 -1
  92. package/lib/locale/lang/zh-CHT.umd.js +2 -1
  93. package/lib/locale/lang/zh-CN.js +2 -1
  94. package/lib/locale/lang/zh-CN.min.js +1 -1
  95. package/lib/locale/lang/zh-CN.umd.js +2 -1
  96. package/lib/style.css +1 -1
  97. package/lib/style.min.css +1 -1
  98. package/lib/table/module/edit/mixin.js +7 -2
  99. package/lib/table/module/edit/mixin.min.js +1 -1
  100. package/lib/table/module/export/mixin.js +105 -64
  101. package/lib/table/module/export/mixin.min.js +1 -1
  102. package/lib/table/module/keyboard/mixin.js +73 -27
  103. package/lib/table/module/keyboard/mixin.min.js +1 -1
  104. package/lib/table/module/menu/mixin.js +3 -1
  105. package/lib/table/src/body.js +124 -79
  106. package/lib/table/src/body.min.js +1 -1
  107. package/lib/table/src/cell.js +32 -42
  108. package/lib/table/src/cell.min.js +1 -1
  109. package/lib/table/src/column.js +12 -0
  110. package/lib/table/src/column.min.js +1 -1
  111. package/lib/table/src/columnInfo.js +3 -0
  112. package/lib/table/src/columnInfo.min.js +1 -1
  113. package/lib/table/src/footer.js +43 -4
  114. package/lib/table/src/footer.min.js +1 -1
  115. package/lib/table/src/header.js +49 -172
  116. package/lib/table/src/header.min.js +1 -1
  117. package/lib/table/src/methods.js +1072 -538
  118. package/lib/table/src/methods.min.js +1 -1
  119. package/lib/table/src/props.js +14 -4
  120. package/lib/table/src/props.min.js +1 -1
  121. package/lib/table/src/table.js +113 -36
  122. package/lib/table/src/table.min.js +1 -1
  123. package/lib/table/src/util.js +87 -70
  124. package/lib/table/src/util.min.js +1 -1
  125. package/lib/table/style/style.css +246 -191
  126. package/lib/table/style/style.min.css +1 -1
  127. package/lib/ui/index.js +20 -6
  128. package/lib/ui/index.min.js +1 -1
  129. package/lib/ui/src/log.js +1 -1
  130. package/lib/ui/src/log.min.js +1 -1
  131. package/lib/vxe-table/style/style.css +246 -191
  132. package/lib/vxe-table/style/style.min.css +1 -1
  133. package/package.json +2 -2
  134. package/packages/locale/lang/ar-EG.ts +2 -1
  135. package/packages/locale/lang/de-DE.ts +2 -1
  136. package/packages/locale/lang/en-US.ts +4 -3
  137. package/packages/locale/lang/es-ES.ts +2 -1
  138. package/packages/locale/lang/fr-FR.ts +2 -1
  139. package/packages/locale/lang/hu-HU.ts +2 -1
  140. package/packages/locale/lang/hy-AM.ts +2 -1
  141. package/packages/locale/lang/it-IT.ts +2 -1
  142. package/packages/locale/lang/ja-JP.ts +2 -1
  143. package/packages/locale/lang/ko-KR.ts +2 -1
  144. package/packages/locale/lang/nb-NO.ts +2 -1
  145. package/packages/locale/lang/pt-BR.ts +2 -1
  146. package/packages/locale/lang/ru-RU.ts +4 -3
  147. package/packages/locale/lang/th-TH.ts +2 -1
  148. package/packages/locale/lang/ug-CN.ts +2 -1
  149. package/packages/locale/lang/uk-UA.ts +518 -517
  150. package/packages/locale/lang/vi-VN.ts +2 -1
  151. package/packages/locale/lang/zh-CHT.ts +2 -1
  152. package/packages/locale/lang/zh-CN.ts +2 -1
  153. package/packages/table/module/edit/mixin.ts +7 -7
  154. package/packages/table/module/export/mixin.ts +138 -80
  155. package/packages/table/module/keyboard/mixin.ts +65 -24
  156. package/packages/table/module/menu/mixin.ts +4 -1
  157. package/packages/table/src/body.ts +136 -89
  158. package/packages/table/src/cell.ts +45 -67
  159. package/packages/table/src/column.ts +48 -10
  160. package/packages/table/src/columnInfo.ts +3 -0
  161. package/packages/table/src/footer.ts +50 -7
  162. package/packages/table/src/header.ts +67 -166
  163. package/packages/table/src/methods.ts +1007 -492
  164. package/packages/table/src/props.ts +16 -6
  165. package/packages/table/src/table.ts +124 -33
  166. package/packages/table/src/util.ts +82 -62
  167. package/packages/ui/index.ts +19 -5
  168. package/styles/components/table.scss +313 -274
  169. package/styles/theme/base.scss +4 -6
  170. package/styles/theme/dark.scss +1 -0
  171. package/styles/theme/light.scss +1 -0
  172. package/styles/variable.scss +1 -0
  173. /package/es/{iconfont.1736854649055.ttf → iconfont.1738985837413.ttf} +0 -0
  174. /package/es/{iconfont.1736854649055.woff → iconfont.1738985837413.woff} +0 -0
  175. /package/es/{iconfont.1736854649055.woff2 → iconfont.1738985837413.woff2} +0 -0
  176. /package/lib/{iconfont.1736854649055.ttf → iconfont.1738985837413.ttf} +0 -0
  177. /package/lib/{iconfont.1736854649055.woff → iconfont.1738985837413.woff} +0 -0
  178. /package/lib/{iconfont.1736854649055.woff2 → iconfont.1738985837413.woff2} +0 -0
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.12.10-beta.9";
2223
+ const version = "3.12.10";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2255,7 +2255,10 @@ core_.VxeUI.setConfig({
2255
2255
  },
2256
2256
  resizableConfig: {
2257
2257
  dragMode: 'auto',
2258
- showDragTip: true
2258
+ showDragTip: true,
2259
+ isSyncAutoHeight: true,
2260
+ isSyncAutoWidth: true,
2261
+ minHeight: 18
2259
2262
  },
2260
2263
  radioConfig: {
2261
2264
  // trigger: 'default'
@@ -2289,6 +2292,15 @@ core_.VxeUI.setConfig({
2289
2292
  columnConfig: {
2290
2293
  maxFixedSize: 4
2291
2294
  },
2295
+ cellConfig: {
2296
+ padding: true
2297
+ },
2298
+ headerCellConfig: {
2299
+ height: 'unset'
2300
+ },
2301
+ footerCellConfig: {
2302
+ height: 'unset'
2303
+ },
2292
2304
  // menuConfig: {
2293
2305
  // visibleMethod () {}
2294
2306
  // },
@@ -2322,6 +2334,8 @@ core_.VxeUI.setConfig({
2322
2334
  // orders: ['asc', 'desc', null],
2323
2335
  // sortMethod: null,
2324
2336
  showIcon: true,
2337
+ allowClear: true,
2338
+ allowBtn: true,
2325
2339
  iconLayout: 'vertical'
2326
2340
  },
2327
2341
  filterConfig: {
@@ -2393,20 +2407,20 @@ core_.VxeUI.setConfig({
2393
2407
  isReplace: true
2394
2408
  },
2395
2409
  virtualXConfig: {
2396
- // enabled: false,
2410
+ enabled: true,
2397
2411
  gt: 60,
2398
2412
  preSize: 0,
2399
2413
  oSize: 1
2400
2414
  },
2401
2415
  virtualYConfig: {
2402
- // enabled: false,
2416
+ enabled: true,
2403
2417
  gt: 100,
2404
2418
  preSize: 1,
2405
2419
  oSize: 2
2406
2420
  },
2407
2421
  scrollbarConfig: {
2408
- width: 10,
2409
- height: 10
2422
+ // width: 0,
2423
+ // height: 0
2410
2424
  }
2411
2425
  },
2412
2426
  // export: {
@@ -2826,7 +2840,7 @@ function isNodeElement(elem) {
2826
2840
  const {
2827
2841
  log: log_log
2828
2842
  } = core_.VxeUI;
2829
- const log_version = `table v${"3.12.10-beta.9"}`;
2843
+ const log_version = `table v${"3.12.10"}`;
2830
2844
  const warnLog = log_log.create('warn', log_version);
2831
2845
  const errLog = log_log.create('error', log_version);
2832
2846
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -2916,6 +2930,8 @@ class ColumnInfo {
2916
2930
  footerClassName: _vm.footerClassName,
2917
2931
  formatter,
2918
2932
  footerFormatter: _vm.footerFormatter,
2933
+ padding: _vm.padding,
2934
+ verticalAlign: _vm.verticalAlign,
2919
2935
  sortable: _vm.sortable,
2920
2936
  sortBy: _vm.sortBy,
2921
2937
  sortType: _vm.sortType,
@@ -2929,6 +2945,7 @@ class ColumnInfo {
2929
2945
  filterRender: _vm.filterRender,
2930
2946
  treeNode: _vm.treeNode,
2931
2947
  dragSort: _vm.dragSort,
2948
+ rowResize: _vm.rowResize,
2932
2949
  cellType: _vm.cellType,
2933
2950
  cellRender: _vm.cellRender,
2934
2951
  editRender: _vm.editRender,
@@ -3122,9 +3139,15 @@ function getElementMarginWidth(elem) {
3122
3139
  }
3123
3140
  return 0;
3124
3141
  }
3142
+ function getCellHeight(height) {
3143
+ if (height === 'unset') {
3144
+ return 0;
3145
+ }
3146
+ return height || 0;
3147
+ }
3125
3148
  function handleFieldOrColumn(_vm, fieldOrColumn) {
3126
3149
  if (fieldOrColumn) {
3127
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? _vm.getColumnByField(fieldOrColumn) : fieldOrColumn;
3150
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(fieldOrColumn) ? _vm.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
3128
3151
  }
3129
3152
  return null;
3130
3153
  }
@@ -3209,6 +3232,7 @@ function getColReMinWidth(params) {
3209
3232
  column,
3210
3233
  cell
3211
3234
  } = params;
3235
+ const internalData = $table;
3212
3236
  const {
3213
3237
  showHeaderOverflow: allColumnHeaderOverflow,
3214
3238
  resizableOpts
@@ -3223,6 +3247,9 @@ function getColReMinWidth(params) {
3223
3247
  return Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(customMinWidth));
3224
3248
  }
3225
3249
  }
3250
+ const {
3251
+ elemStore
3252
+ } = internalData;
3226
3253
  const {
3227
3254
  showHeaderOverflow,
3228
3255
  minWidth: colMinWidth
@@ -3249,13 +3276,10 @@ function getColReMinWidth(params) {
3249
3276
  }
3250
3277
  // 如果设置最小宽
3251
3278
  if (colMinWidth) {
3252
- const {
3253
- refTableBody
3254
- } = $table.$refs;
3255
- const bodyElem = refTableBody ? refTableBody.$el : null;
3256
- if (bodyElem) {
3279
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
3280
+ if (bodyScrollElem) {
3257
3281
  if (isScale(colMinWidth)) {
3258
- const bodyWidth = bodyElem.clientWidth - 1;
3282
+ const bodyWidth = bodyScrollElem.clientWidth - 1;
3259
3283
  const meanWidth = bodyWidth / 100;
3260
3284
  return Math.max(mWidth, Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(colMinWidth) * meanWidth));
3261
3285
  } else if (isPx(colMinWidth)) {
@@ -3301,14 +3325,39 @@ function getOffsetSize($xeTable) {
3301
3325
  }
3302
3326
  function calcTreeLine(params, prevRow) {
3303
3327
  const {
3304
- $table
3328
+ $table,
3329
+ row
3305
3330
  } = params;
3331
+ const tableProps = $table;
3306
3332
  const tableReactData = $table;
3333
+ const tableInternalData = $table;
3334
+ const {
3335
+ showOverflow
3336
+ } = tableProps;
3337
+ const {
3338
+ scrollYLoad
3339
+ } = tableReactData;
3340
+ const {
3341
+ fullAllDataRowIdData
3342
+ } = tableInternalData;
3343
+ const rowOpts = $table.computeRowOpts;
3344
+ const cellOpts = $table.computeCellOpts;
3345
+ const defaultRowHeight = $table.computeDefaultRowHeight;
3346
+ const rowid = getRowid($table, row);
3347
+ const rowRest = fullAllDataRowIdData[rowid];
3348
+ const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
3307
3349
  let expandSize = 1;
3308
3350
  if (prevRow) {
3309
3351
  expandSize = countTreeExpand(prevRow, params);
3310
3352
  }
3311
- return tableReactData.rowHeight * expandSize - (prevRow ? 1 : 12 - getOffsetSize($table));
3353
+ let cellHeight = currCellHeight;
3354
+ const vnHeight = rowRest.height;
3355
+ if (scrollYLoad) {
3356
+ if (!showOverflow) {
3357
+ cellHeight = vnHeight || currCellHeight;
3358
+ }
3359
+ }
3360
+ return cellHeight * expandSize - (prevRow ? 1 : 12 - getOffsetSize($table));
3312
3361
  }
3313
3362
  function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
3314
3363
  for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
@@ -3383,43 +3432,32 @@ function createColumn($xeTable, options, renderOptions) {
3383
3432
  return isColumnInfo(options) ? options : new ColumnInfo($xeTable, options, renderOptions);
3384
3433
  }
3385
3434
  function rowToVisible($xeTable, row) {
3435
+ const tableProps = $xeTable;
3386
3436
  const reactData = $xeTable;
3387
3437
  const internalData = $xeTable;
3388
- const tableProps = $xeTable;
3389
3438
  const {
3390
3439
  showOverflow
3391
3440
  } = tableProps;
3392
- const refTableBody = $xeTable.$refs.refTableBody;
3393
3441
  const {
3394
- columnStore,
3395
3442
  scrollYLoad
3396
3443
  } = reactData;
3397
3444
  const {
3445
+ elemStore,
3398
3446
  afterFullData,
3399
- scrollYStore,
3400
- fullAllDataRowIdData
3447
+ fullAllDataRowIdData,
3448
+ isResizeCellHeight
3401
3449
  } = internalData;
3402
- const {
3403
- rowHeight
3404
- } = scrollYStore;
3405
- const {
3406
- leftList,
3407
- rightList
3408
- } = columnStore;
3409
- const bodyElem = refTableBody ? refTableBody.$el : null;
3450
+ const rowOpts = $xeTable.computeRowOpts;
3451
+ const cellOpts = $xeTable.computeCellOpts;
3452
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
3453
+ const leftFixedWidth = $xeTable.computeLeftFixedWidth;
3454
+ const rightFixedWidth = $xeTable.computeRightFixedWidth;
3455
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
3410
3456
  const rowid = getRowid($xeTable, row);
3411
- let offsetFixedLeft = 0;
3412
- leftList.forEach(item => {
3413
- offsetFixedLeft += item.renderWidth;
3414
- });
3415
- let offsetFixedRight = 0;
3416
- rightList.forEach(item => {
3417
- offsetFixedRight += item.renderWidth;
3418
- });
3419
- if (bodyElem) {
3420
- const bodyHeight = bodyElem.clientHeight;
3421
- const bodyScrollTop = bodyElem.scrollTop;
3422
- const trElem = bodyElem.querySelector(`[rowid="${rowid}"]`);
3457
+ if (bodyScrollElem) {
3458
+ const bodyHeight = bodyScrollElem.clientHeight;
3459
+ const bodyScrollTop = bodyScrollElem.scrollTop;
3460
+ const trElem = bodyScrollElem.querySelector(`[rowid="${rowid}"]`);
3423
3461
  if (trElem) {
3424
3462
  const trOffsetParent = trElem.offsetParent;
3425
3463
  const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0);
@@ -3433,12 +3471,13 @@ function rowToVisible($xeTable, row) {
3433
3471
  } else {
3434
3472
  // 如果是虚拟渲染滚动
3435
3473
  if (scrollYLoad) {
3436
- if (showOverflow) {
3437
- return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * rowHeight);
3474
+ const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
3475
+ if (!isCustomCellHeight && showOverflow) {
3476
+ return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight);
3438
3477
  }
3439
3478
  let scrollTop = 0;
3440
3479
  const rowRest = fullAllDataRowIdData[rowid];
3441
- const rHeight = rowRest ? rowRest.height || rowHeight : rowHeight;
3480
+ const rHeight = rowRest ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight : defaultRowHeight;
3442
3481
  for (let i = 0; i < afterFullData.length; i++) {
3443
3482
  const currRow = afterFullData[i];
3444
3483
  const currRowid = getRowid($xeTable, currRow);
@@ -3446,60 +3485,53 @@ function rowToVisible($xeTable, row) {
3446
3485
  break;
3447
3486
  }
3448
3487
  const rowRest = fullAllDataRowIdData[currRowid];
3449
- scrollTop += rowRest ? rowRest.height || rowHeight : rowHeight;
3488
+ scrollTop += rowRest ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight : defaultRowHeight;
3450
3489
  }
3451
3490
  if (scrollTop < bodyScrollTop) {
3452
- return $xeTable.scrollTo(null, scrollTop - offsetFixedLeft - 1);
3491
+ return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1);
3453
3492
  }
3454
- return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight - offsetFixedRight - 1));
3493
+ return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight - rightFixedWidth - 1));
3455
3494
  }
3456
3495
  }
3457
3496
  }
3458
3497
  return Promise.resolve();
3459
3498
  }
3460
3499
  function colToVisible($xeTable, column, row) {
3500
+ const reactData = $xeTable;
3501
+ const internalData = $xeTable;
3461
3502
  const {
3462
- columnStore,
3463
- scrollXLoad,
3464
- visibleColumn
3465
- } = $xeTable;
3466
- const refTableBody = $xeTable.$refs.refTableBody;
3503
+ scrollXLoad
3504
+ } = reactData;
3467
3505
  const {
3468
- leftList,
3469
- rightList
3470
- } = columnStore;
3471
- const bodyElem = refTableBody ? refTableBody.$el : null;
3506
+ elemStore,
3507
+ visibleColumn
3508
+ } = internalData;
3509
+ const leftFixedWidth = $xeTable.computeLeftFixedWidth;
3510
+ const rightFixedWidth = $xeTable.computeRightFixedWidth;
3511
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
3472
3512
  if (column.fixed) {
3473
3513
  return Promise.resolve();
3474
3514
  }
3475
- let offsetFixedLeft = 0;
3476
- leftList.forEach(item => {
3477
- offsetFixedLeft += item.renderWidth;
3478
- });
3479
- let offsetFixedRight = 0;
3480
- rightList.forEach(item => {
3481
- offsetFixedRight += item.renderWidth;
3482
- });
3483
- if (bodyElem) {
3484
- const bodyWidth = bodyElem.clientWidth;
3485
- const bodyScrollLeft = bodyElem.scrollLeft;
3515
+ if (bodyScrollElem) {
3516
+ const bodyWidth = bodyScrollElem.clientWidth;
3517
+ const bodyScrollLeft = bodyScrollElem.scrollLeft;
3486
3518
  let tdElem = null;
3487
3519
  if (row) {
3488
3520
  const rowid = getRowid($xeTable, row);
3489
- tdElem = bodyElem.querySelector(`[rowid="${rowid}"] .${column.id}`);
3521
+ tdElem = bodyScrollElem.querySelector(`[rowid="${rowid}"] .${column.id}`);
3490
3522
  }
3491
3523
  if (!tdElem) {
3492
- tdElem = bodyElem.querySelector(`.${column.id}`);
3524
+ tdElem = bodyScrollElem.querySelector(`.${column.id}`);
3493
3525
  }
3494
3526
  if (tdElem) {
3495
3527
  const tdOffsetParent = tdElem.offsetParent;
3496
3528
  const tdOffsetLeft = tdElem.offsetLeft + (tdOffsetParent ? tdOffsetParent.offsetLeft : 0);
3497
3529
  const cellWidth = tdElem.clientWidth;
3498
3530
  // 检测是否在可视区中
3499
- if (tdOffsetLeft < bodyScrollLeft + offsetFixedLeft) {
3500
- return $xeTable.scrollTo(tdOffsetLeft - offsetFixedLeft - 1);
3501
- } else if (tdOffsetLeft + cellWidth - bodyScrollLeft > bodyWidth - offsetFixedRight) {
3502
- return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth - offsetFixedRight - 1));
3531
+ if (tdOffsetLeft < bodyScrollLeft + leftFixedWidth) {
3532
+ return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
3533
+ } else if (tdOffsetLeft + cellWidth - bodyScrollLeft > bodyWidth - rightFixedWidth) {
3534
+ return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
3503
3535
  }
3504
3536
  } else {
3505
3537
  // 检测是否在虚拟渲染可视区中
@@ -3507,15 +3539,16 @@ function colToVisible($xeTable, column, row) {
3507
3539
  let scrollLeft = 0;
3508
3540
  const cellWidth = column.renderWidth;
3509
3541
  for (let i = 0; i < visibleColumn.length; i++) {
3510
- if (visibleColumn[i] === column) {
3542
+ const currCol = visibleColumn[i];
3543
+ if (currCol === column || currCol.id === column.id) {
3511
3544
  break;
3512
3545
  }
3513
- scrollLeft += visibleColumn[i].renderWidth;
3546
+ scrollLeft += currCol.renderWidth;
3514
3547
  }
3515
3548
  if (scrollLeft < bodyScrollLeft) {
3516
- return $xeTable.scrollTo(scrollLeft - offsetFixedLeft - 1);
3549
+ return $xeTable.scrollTo(scrollLeft - leftFixedWidth - 1);
3517
3550
  }
3518
- return $xeTable.scrollTo(scrollLeft + cellWidth - (bodyWidth - offsetFixedRight - 1));
3551
+ return $xeTable.scrollTo(scrollLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
3519
3552
  }
3520
3553
  }
3521
3554
  }
@@ -3759,7 +3792,7 @@ function renderTitleContent(h, params, content) {
3759
3792
  const ons = {};
3760
3793
  if (showTitle || showTooltip || showAllTip) {
3761
3794
  ons.mouseenter = evnt => {
3762
- if (tableReactData._isResize) {
3795
+ if (tableReactData.isDragResize) {
3763
3796
  return;
3764
3797
  }
3765
3798
  if (showTitle) {
@@ -3771,7 +3804,7 @@ function renderTitleContent(h, params, content) {
3771
3804
  }
3772
3805
  if (showTooltip || showAllTip) {
3773
3806
  ons.mouseleave = evnt => {
3774
- if (tableReactData._isResize) {
3807
+ if (tableReactData.isDragResize) {
3775
3808
  return;
3776
3809
  }
3777
3810
  if (showTooltip || showAllTip) {
@@ -3790,18 +3823,6 @@ function renderTitleContent(h, params, content) {
3790
3823
  on: ons
3791
3824
  }, getSlotVNs(content))];
3792
3825
  }
3793
- function formatFooterLabel(footerFormatter, params) {
3794
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerFormatter)) {
3795
- return `${footerFormatter(params)}`;
3796
- }
3797
- const isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerFormatter);
3798
- const gFormatOpts = isArr ? cell_formats.get(footerFormatter[0]) : cell_formats.get(footerFormatter);
3799
- const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
3800
- if (footerFormatMethod) {
3801
- return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`;
3802
- }
3803
- return '';
3804
- }
3805
3826
  function getFooterContent(h, params) {
3806
3827
  const {
3807
3828
  $table,
@@ -3820,33 +3841,36 @@ function getFooterContent(h, params) {
3820
3841
  if (slots && slots.footer) {
3821
3842
  return $table.callSlot(slots.footer, params, h);
3822
3843
  }
3844
+ let itemValue = '';
3845
+ // 兼容老模式
3846
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(items)) {
3847
+ itemValue = items[_columnIndex];
3848
+ } else {
3849
+ itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
3850
+ }
3851
+ const footParams = Object.assign(params, {
3852
+ itemValue
3853
+ });
3854
+ if (footerFormatter) {
3855
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerFormatter)) {
3856
+ return `${footerFormatter(footParams)}`;
3857
+ }
3858
+ const isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerFormatter);
3859
+ const gFormatOpts = isArr ? cell_formats.get(footerFormatter[0]) : cell_formats.get(footerFormatter);
3860
+ const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
3861
+ if (footerFormatMethod) {
3862
+ return `${isArr ? footerFormatMethod(footParams, ...footerFormatter.slice(1)) : footerFormatMethod(footParams)}`;
3863
+ }
3864
+ return '';
3865
+ }
3823
3866
  if (renderOpts) {
3824
3867
  const compConf = cell_renderer.get(renderOpts.name);
3825
3868
  const rtFooter = compConf ? compConf.renderTableFooter || compConf.renderFooter : null;
3826
3869
  if (rtFooter) {
3827
- return getSlotVNs(rtFooter.call($table, h, renderOpts, params));
3870
+ return getSlotVNs(rtFooter.call($table, h, renderOpts, footParams));
3828
3871
  }
3829
3872
  }
3830
- let itemValue = '';
3831
- // 兼容老模式
3832
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(items)) {
3833
- itemValue = items[_columnIndex];
3834
- return [footerFormatter ? formatFooterLabel(footerFormatter, {
3835
- itemValue,
3836
- column,
3837
- row,
3838
- items,
3839
- _columnIndex
3840
- }) : formatText(itemValue, 1)];
3841
- }
3842
- itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
3843
- return [footerFormatter ? formatFooterLabel(footerFormatter, {
3844
- itemValue,
3845
- column,
3846
- row,
3847
- items,
3848
- _columnIndex
3849
- }) : formatText(itemValue, 1)];
3873
+ return [formatText(itemValue, 1)];
3850
3874
  }
3851
3875
  function getDefaultCellLabel(params) {
3852
3876
  const {
@@ -4019,9 +4043,7 @@ const Cell = {
4019
4043
  return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
4020
4044
  },
4021
4045
  renderDefaultFooter(h, params) {
4022
- return [h('span', {
4023
- class: 'vxe-cell--item'
4024
- }, getFooterContent(h, params))];
4046
+ return getFooterContent(h, params);
4025
4047
  },
4026
4048
  /**
4027
4049
  * 树节点
@@ -4585,6 +4607,7 @@ const Cell = {
4585
4607
  const sortOpts = $table.computeSortOpts;
4586
4608
  const {
4587
4609
  showIcon,
4610
+ allowBtn,
4588
4611
  iconLayout,
4589
4612
  iconAsc,
4590
4613
  iconDesc,
@@ -4600,12 +4623,12 @@ const Cell = {
4600
4623
  attrs: {
4601
4624
  title: cell_getI18n('vxe.table.sortAsc')
4602
4625
  },
4603
- on: {
4626
+ on: allowBtn ? {
4604
4627
  click(evnt) {
4605
4628
  evnt.stopPropagation();
4606
4629
  $table.triggerSortEvent(evnt, column, 'asc');
4607
4630
  }
4608
- }
4631
+ } : undefined
4609
4632
  }), h('i', {
4610
4633
  class: ['vxe-sort--desc-btn', iconDesc || cell_getIcon().TABLE_SORT_DESC, {
4611
4634
  'sort--active': column.order === 'desc'
@@ -4613,12 +4636,12 @@ const Cell = {
4613
4636
  attrs: {
4614
4637
  title: cell_getI18n('vxe.table.sortDesc')
4615
4638
  },
4616
- on: {
4639
+ on: allowBtn ? {
4617
4640
  click(evnt) {
4618
4641
  evnt.stopPropagation();
4619
4642
  $table.triggerSortEvent(evnt, column, 'desc');
4620
4643
  }
4621
- }
4644
+ } : undefined
4622
4645
  })])];
4623
4646
  }
4624
4647
  return [];
@@ -4841,6 +4864,16 @@ const columnProps = {
4841
4864
  formatter: [Function, Array, String],
4842
4865
  // 格式化表尾显示内容
4843
4866
  footerFormatter: [Function, Array, String],
4867
+ // 是否显示间距
4868
+ padding: {
4869
+ type: Boolean,
4870
+ default: null
4871
+ },
4872
+ // 垂直对齐方式
4873
+ verticalAlign: {
4874
+ type: String,
4875
+ default: null
4876
+ },
4844
4877
  // 是否允许排序
4845
4878
  sortable: Boolean,
4846
4879
  // 在 v3 中废弃
@@ -4876,6 +4909,8 @@ const columnProps = {
4876
4909
  treeNode: Boolean,
4877
4910
  // 设置为拖拽排序
4878
4911
  dragSort: Boolean,
4912
+ // 设置为行高拖拽
4913
+ rowResize: Boolean,
4879
4914
  // 是否可视
4880
4915
  visible: {
4881
4916
  type: Boolean,
@@ -5412,6 +5447,7 @@ function updateAfterListIndex($xeTable) {
5412
5447
  parent: null,
5413
5448
  level: 0,
5414
5449
  height: 0,
5450
+ resizeHeight: 0,
5415
5451
  oTop: 0
5416
5452
  };
5417
5453
  fullAllDataRowIdData[rowid] = rest;
@@ -5463,6 +5499,7 @@ function updateAfterDataIndex($xeTable) {
5463
5499
  parent: null,
5464
5500
  level: 0,
5465
5501
  height: 0,
5502
+ resizeHeight: 0,
5466
5503
  oTop: 0
5467
5504
  };
5468
5505
  fullAllDataRowIdData[rowid] = rest;
@@ -5526,7 +5563,6 @@ function updateStyle($xeTable) {
5526
5563
  const internalData = $xeTable;
5527
5564
  const {
5528
5565
  border,
5529
- showOverflow: allColumnOverflow,
5530
5566
  showHeaderOverflow: allColumnHeaderOverflow,
5531
5567
  showFooterOverflow: allColumnFooterOverflow,
5532
5568
  mouseConfig,
@@ -5539,7 +5575,9 @@ function updateStyle($xeTable) {
5539
5575
  tableColumn,
5540
5576
  scrollXLoad,
5541
5577
  scrollYLoad,
5578
+ overflowX,
5542
5579
  scrollbarWidth,
5580
+ overflowY,
5543
5581
  scrollbarHeight,
5544
5582
  columnStore,
5545
5583
  editStore,
@@ -5563,6 +5601,8 @@ function updateStyle($xeTable) {
5563
5601
  return;
5564
5602
  }
5565
5603
  const containerList = ['main', 'left', 'right'];
5604
+ const osbWidth = overflowY ? scrollbarWidth : 0;
5605
+ const osbHeight = overflowX ? scrollbarHeight : 0;
5566
5606
  const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
5567
5607
  const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
5568
5608
  const mouseOpts = $xeTable.computeMouseOpts;
@@ -5570,16 +5610,16 @@ function updateStyle($xeTable) {
5570
5610
  const bodyTableElem = getRefElem(elemStore['main-body-table']);
5571
5611
  if (emptyPlaceholderElem) {
5572
5612
  emptyPlaceholderElem.style.top = `${headerHeight}px`;
5573
- emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - scrollbarHeight}px` : '';
5613
+ emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
5574
5614
  }
5575
5615
  let bodyHeight = 0;
5576
5616
  let bodyMaxHeight = 0;
5577
- const bodyMinHeight = customMinHeight - headerHeight - footerHeight - scrollbarHeight;
5617
+ const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight;
5578
5618
  if (customMaxHeight) {
5579
- bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - scrollbarHeight);
5619
+ bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight);
5580
5620
  }
5581
5621
  if (customHeight) {
5582
- bodyHeight = customHeight - headerHeight - footerHeight - scrollbarHeight;
5622
+ bodyHeight = customHeight - headerHeight - footerHeight - osbHeight;
5583
5623
  }
5584
5624
  if (!bodyHeight) {
5585
5625
  if (bodyTableElem) {
@@ -5597,27 +5637,27 @@ function updateStyle($xeTable) {
5597
5637
  const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
5598
5638
  const scrollXVirtualEl = $xeTable.$refs.refScrollXVirtualElem;
5599
5639
  if (scrollXVirtualEl) {
5600
- scrollXVirtualEl.style.height = `${scrollbarHeight}px`;
5601
- scrollXVirtualEl.style.visibility = scrollbarHeight ? 'visible' : 'hidden';
5640
+ scrollXVirtualEl.style.height = `${osbHeight}px`;
5641
+ scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden';
5602
5642
  }
5603
5643
  const xWrapperEl = $xeTable.$refs.refScrollXWrapperElem;
5604
5644
  if (xWrapperEl) {
5605
- xWrapperEl.style.left = scrollbarXToTop ? `${scrollbarWidth}px` : '';
5606
- xWrapperEl.style.width = `${el.clientWidth - scrollbarWidth}px`;
5645
+ xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : '';
5646
+ xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`;
5607
5647
  }
5608
5648
  if (xLeftCornerEl) {
5609
- xLeftCornerEl.style.width = scrollbarXToTop ? `${scrollbarWidth}px` : '';
5610
- xLeftCornerEl.style.display = scrollbarXToTop ? scrollbarWidth && scrollbarHeight ? 'block' : '' : '';
5649
+ xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
5650
+ xLeftCornerEl.style.display = scrollbarXToTop ? osbWidth && osbHeight ? 'block' : '' : '';
5611
5651
  }
5612
5652
  if (xRightCornerEl) {
5613
- xRightCornerEl.style.width = scrollbarXToTop ? '' : `${scrollbarWidth}px`;
5614
- xRightCornerEl.style.display = scrollbarXToTop ? '' : scrollbarWidth && scrollbarHeight ? 'block' : '';
5653
+ xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
5654
+ xRightCornerEl.style.display = scrollbarXToTop ? '' : osbWidth && osbHeight ? 'block' : '';
5615
5655
  }
5616
5656
  const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem;
5617
5657
  if (scrollYVirtualEl) {
5618
- scrollYVirtualEl.style.width = `${scrollbarWidth}px`;
5658
+ scrollYVirtualEl.style.width = `${osbWidth}px`;
5619
5659
  scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`;
5620
- scrollYVirtualEl.style.visibility = scrollbarWidth ? 'visible' : 'hidden';
5660
+ scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden';
5621
5661
  }
5622
5662
  const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem;
5623
5663
  if (yTopCornerEl) {
@@ -5736,14 +5776,14 @@ function updateStyle($xeTable) {
5736
5776
  if (wrapperElem) {
5737
5777
  wrapperElem.style.top = `${headerHeight}px`;
5738
5778
  }
5739
- fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight + scrollbarHeight}px`;
5779
+ fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight + osbHeight}px`;
5740
5780
  fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
5741
5781
  }
5742
5782
  let tWidth = tableWidth;
5743
5783
  let renderColumnList = tableColumn;
5744
5784
  let isOptimizeMode = false;
5745
5785
  // 如果是使用优化模式
5746
- if (scrollXLoad || scrollYLoad || allColumnOverflow && isAllOverflow) {
5786
+ if (scrollXLoad || scrollYLoad || isAllOverflow) {
5747
5787
  if (expandColumn || spanMethod || footerSpanMethod) {
5748
5788
  // 如果不支持优化模式
5749
5789
  } else {
@@ -5765,7 +5805,7 @@ function updateStyle($xeTable) {
5765
5805
  if (tableElem) {
5766
5806
  tableElem.style.width = tWidth ? `${tWidth}px` : '';
5767
5807
  // 兼容性处理
5768
- tableElem.style.paddingRight = scrollbarWidth && fixedType && (browse['-moz'] || browse.safari) ? `${scrollbarWidth}px` : '';
5808
+ tableElem.style.paddingRight = osbWidth && fixedType && (browse['-moz'] || browse.safari) ? `${osbWidth}px` : '';
5769
5809
  }
5770
5810
  const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);
5771
5811
  if (emptyBlockElem) {
@@ -5800,7 +5840,7 @@ function updateStyle($xeTable) {
5800
5840
  // 如果是固定列
5801
5841
  if (fixedWrapperElem) {
5802
5842
  if (wrapperElem) {
5803
- wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - scrollbarHeight : tableHeight + headerHeight}px`;
5843
+ wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`;
5804
5844
  }
5805
5845
  }
5806
5846
  }
@@ -5827,7 +5867,7 @@ function updateStyle($xeTable) {
5827
5867
  } else if (layout === 'footer') {
5828
5868
  cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showFooterOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
5829
5869
  } else {
5830
- cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow) ? allColumnOverflow : showOverflow;
5870
+ cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow) ? isAllOverflow : showOverflow;
5831
5871
  }
5832
5872
  const showEllipsis = cellOverflow === 'ellipsis';
5833
5873
  const showTitle = cellOverflow === 'title';
@@ -5871,16 +5911,16 @@ function updateStyle($xeTable) {
5871
5911
  return $xeTable.$nextTick();
5872
5912
  }
5873
5913
  function computeRowHeight($xeTable) {
5874
- const props = $xeTable;
5914
+ const reactData = $xeTable;
5875
5915
  const {
5876
- showOverflow
5877
- } = props;
5916
+ isAllOverflow
5917
+ } = reactData;
5878
5918
  const tableHeader = $xeTable.$refs.refTableHeader;
5879
5919
  const tableBody = $xeTable.$refs.refTableBody;
5880
5920
  const tableBodyElem = tableBody ? tableBody.$el : null;
5881
5921
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
5882
5922
  let rowHeight = 0;
5883
- if (showOverflow) {
5923
+ if (isAllOverflow) {
5884
5924
  if (tableBodyElem) {
5885
5925
  const tableHeaderElem = tableHeader ? tableHeader.$el : null;
5886
5926
  let firstTrElem;
@@ -5901,40 +5941,39 @@ function computeRowHeight($xeTable) {
5901
5941
  // 最低支持 18px 行高
5902
5942
  return Math.max(18, rowHeight);
5903
5943
  }
5904
- function handleVirtualYVisible($xeTable) {
5905
- const props = $xeTable;
5944
+ function handleVirtualYVisible($xeTable, currScrollTop) {
5906
5945
  const reactData = $xeTable;
5907
5946
  const internalData = $xeTable;
5908
5947
  const {
5909
- showOverflow
5910
- } = props;
5911
- const {
5912
- rowHeight
5948
+ isAllOverflow
5913
5949
  } = reactData;
5914
5950
  const {
5915
5951
  elemStore,
5952
+ isResizeCellHeight,
5916
5953
  afterFullData,
5917
5954
  fullAllDataRowIdData
5918
5955
  } = internalData;
5956
+ const rowOpts = $xeTable.computeRowOpts;
5957
+ const cellOpts = $xeTable.computeCellOpts;
5958
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
5919
5959
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
5920
5960
  if (bodyScrollElem) {
5921
- const {
5922
- scrollTop,
5923
- clientHeight
5924
- } = bodyScrollElem;
5961
+ const clientHeight = bodyScrollElem.clientHeight;
5962
+ const scrollTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(currScrollTop) ? currScrollTop : bodyScrollElem.scrollTop;
5925
5963
  const endHeight = scrollTop + clientHeight;
5926
5964
  let toVisibleIndex = -1;
5927
5965
  let offsetTop = 0;
5928
5966
  let visibleSize = 0;
5929
- if (showOverflow) {
5930
- toVisibleIndex = Math.floor(scrollTop / rowHeight);
5931
- visibleSize = Math.ceil(clientHeight / rowHeight) + 1;
5967
+ const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
5968
+ if (!isCustomCellHeight && isAllOverflow) {
5969
+ toVisibleIndex = Math.floor(scrollTop / defaultRowHeight);
5970
+ visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
5932
5971
  } else {
5933
5972
  for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
5934
5973
  const row = afterFullData[rIndex];
5935
5974
  const rowid = getRowid($xeTable, row);
5936
- const rowRest = fullAllDataRowIdData[rowid];
5937
- offsetTop += rowRest ? rowRest.height || rowHeight : rowHeight;
5975
+ const rowRest = fullAllDataRowIdData[rowid] || {};
5976
+ offsetTop += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
5938
5977
  if (toVisibleIndex === -1 && scrollTop < offsetTop) {
5939
5978
  toVisibleIndex = rIndex;
5940
5979
  }
@@ -6222,7 +6261,7 @@ function autoCellWidth($xeTable) {
6222
6261
  }
6223
6262
  const tableHeight = bodyElem.offsetHeight;
6224
6263
  const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
6225
- reactData.scrollbarWidth = overflowY ? Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth) : 0;
6264
+ reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
6226
6265
  reactData.overflowY = overflowY;
6227
6266
  internalData.tableWidth = tableWidth;
6228
6267
  internalData.tableHeight = tableHeight;
@@ -6231,7 +6270,7 @@ function autoCellWidth($xeTable) {
6231
6270
  const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
6232
6271
  const overflowX = tableWidth > bodyWidth;
6233
6272
  const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
6234
- reactData.scrollbarHeight = overflowX ? Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight) : 0;
6273
+ reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
6235
6274
  internalData.headerHeight = headerHeight;
6236
6275
  internalData.footerHeight = footerHeight;
6237
6276
  reactData.overflowX = overflowX;
@@ -6241,68 +6280,43 @@ function autoCellWidth($xeTable) {
6241
6280
  $xeTable.checkScrolling();
6242
6281
  }
6243
6282
  }
6244
- // const updateCellOffset = ($xeTable: VxeTableConstructor) => {
6245
- // const internalData = $xeTable as unknown as TableInternalData
6246
- // const { chTimeout, chRunTime } = internalData
6247
- // if (chTimeout) {
6248
- // clearTimeout(chTimeout)
6249
- // }
6250
- // if (!chRunTime || chRunTime + 10 < Date.now()) {
6251
- // internalData.chRunTime = Date.now()
6252
- // }
6253
- // internalData.chTimeout = setTimeout(() => {
6254
- // internalData.chRunTime = undefined
6255
- // internalData.chTimeout = undefined
6256
- // }, 80)
6257
- // }
6283
+ const calcCellAutoHeight = (rowRest, wrapperEl) => {
6284
+ const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
6285
+ let colHeight = rowRest.height;
6286
+ for (let i = 0; i < cellElemList.length; i++) {
6287
+ const cellElem = cellElemList[i];
6288
+ const tdEl = cellElem.parentElement;
6289
+ const topBottomPadding = Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingTop) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingBottom));
6290
+ const cellHeight = cellElem ? cellElem.clientHeight : 0;
6291
+ colHeight = Math.max(colHeight - topBottomPadding, Math.ceil(cellHeight));
6292
+ }
6293
+ return colHeight;
6294
+ };
6258
6295
  const calcCellHeight = $xeTable => {
6259
- const props = $xeTable;
6260
6296
  const reactData = $xeTable;
6261
6297
  const internalData = $xeTable;
6262
- const {
6263
- showOverflow
6264
- } = props;
6265
6298
  const {
6266
6299
  tableData,
6300
+ isAllOverflow,
6301
+ scrollYLoad,
6267
6302
  scrollXLoad
6268
6303
  } = reactData;
6269
6304
  const {
6270
6305
  fullAllDataRowIdData
6271
6306
  } = internalData;
6307
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
6272
6308
  const el = $xeTable.$refs.refElem;
6273
- if (!showOverflow && el) {
6274
- let paddingTop = 0;
6275
- let paddingBottom = 0;
6276
- let calcPadding = false;
6309
+ if (!isAllOverflow && scrollYLoad && el) {
6277
6310
  tableData.forEach(row => {
6278
6311
  const rowid = getRowid($xeTable, row);
6279
6312
  const rowRest = fullAllDataRowIdData[rowid];
6280
- const cellList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]>.vxe-body--column>.vxe-cell>.vxe-cell--auto-wrapper`);
6281
- if (rowRest && cellList.length) {
6282
- let height = 0;
6283
- for (let i = 0; i < cellList.length; i++) {
6284
- const cellElem = cellList[i];
6285
- const tdEl = cellElem.parentElement;
6286
- if (!tdEl || !tdEl.clientWidth) {
6287
- break;
6288
- }
6289
- if (!calcPadding) {
6290
- paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingTop);
6291
- paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingBottom);
6292
- calcPadding = true;
6293
- }
6294
- let cellHeight = paddingTop + paddingBottom;
6295
- if (cellElem) {
6296
- cellHeight += cellElem.clientHeight;
6297
- }
6298
- height = Math.max(height, cellHeight);
6299
- }
6300
- rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
6313
+ if (rowRest) {
6314
+ const height = calcCellAutoHeight(rowRest, el);
6315
+ rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, height) : height);
6301
6316
  }
6302
6317
  });
6303
- reactData.isCalcCellHeight++;
6318
+ reactData.calcCellHeightFlag++;
6304
6319
  }
6305
- // updateCellOffset()
6306
6320
  };
6307
6321
  function getOrderField(_vm, column) {
6308
6322
  const {
@@ -6329,6 +6343,18 @@ function getOrderField(_vm, column) {
6329
6343
  return cellValue;
6330
6344
  };
6331
6345
  }
6346
+ function handleTargetEnterEvent($xeTable, isClear) {
6347
+ const internalData = $xeTable;
6348
+ const $tooltip = $xeTable.$refs.refTooltip;
6349
+ clearTimeout(internalData.tooltipTimeout);
6350
+ if (isClear) {
6351
+ $xeTable.closeTooltip();
6352
+ } else {
6353
+ if ($tooltip && $tooltip.setActived) {
6354
+ $tooltip.setActived(true);
6355
+ }
6356
+ }
6357
+ }
6332
6358
  function clearDragStatus($xeTable) {
6333
6359
  const reactData = $xeTable;
6334
6360
  const {
@@ -6439,13 +6465,17 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
6439
6465
  return;
6440
6466
  }
6441
6467
  const {
6468
+ overflowX,
6442
6469
  scrollbarWidth,
6470
+ overflowY,
6443
6471
  scrollbarHeight
6444
6472
  } = reactData;
6445
6473
  const {
6446
6474
  prevDragToChild
6447
6475
  } = internalData;
6448
6476
  const wrapperRect = el.getBoundingClientRect();
6477
+ const osbWidth = overflowY ? scrollbarWidth : 0;
6478
+ const osbHeight = overflowX ? scrollbarHeight : 0;
6449
6479
  const tableWidth = el.clientWidth;
6450
6480
  const tableHeight = el.clientHeight;
6451
6481
  if (trEl) {
@@ -6456,14 +6486,14 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
6456
6486
  const trRect = trEl.getBoundingClientRect();
6457
6487
  let trHeight = trEl.clientHeight;
6458
6488
  const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
6459
- if (offsetTop + trHeight > tableHeight - scrollbarHeight) {
6460
- trHeight = tableHeight - offsetTop - scrollbarHeight;
6489
+ if (offsetTop + trHeight > tableHeight - osbHeight) {
6490
+ trHeight = tableHeight - offsetTop - osbHeight;
6461
6491
  }
6462
6492
  rdLineEl.style.display = 'block';
6463
- rdLineEl.style.left = `${scrollbarYToLeft ? scrollbarWidth : 0}px`;
6493
+ rdLineEl.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
6464
6494
  rdLineEl.style.top = `${offsetTop}px`;
6465
6495
  rdLineEl.style.height = `${trHeight}px`;
6466
- rdLineEl.style.width = `${tableWidth - scrollbarWidth}px`;
6496
+ rdLineEl.style.width = `${tableWidth - osbWidth}px`;
6467
6497
  rdLineEl.setAttribute('drag-pos', dragPos);
6468
6498
  rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
6469
6499
  } else {
@@ -6488,7 +6518,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
6488
6518
  thWidth -= startX - offsetLeft;
6489
6519
  offsetLeft = startX;
6490
6520
  }
6491
- const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : scrollbarWidth);
6521
+ const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth);
6492
6522
  if (offsetLeft + thWidth > endX) {
6493
6523
  thWidth = endX - offsetLeft;
6494
6524
  }
@@ -6499,7 +6529,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
6499
6529
  if (prevDragToChild) {
6500
6530
  cdLineEl.style.height = `${thRect.height}px`;
6501
6531
  } else {
6502
- cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : scrollbarHeight)}px`;
6532
+ cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`;
6503
6533
  }
6504
6534
  cdLineEl.setAttribute('drag-pos', dragPos);
6505
6535
  cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
@@ -6530,6 +6560,49 @@ function hideDropTip($xeTable) {
6530
6560
  cdLineEl.style.display = '';
6531
6561
  }
6532
6562
  }
6563
+ /**
6564
+ * 处理显示 tooltip
6565
+ * @param {Event} evnt 事件
6566
+ * @param {Row} row 行对象
6567
+ */
6568
+ function handleTooltip($xeTable, evnt, tdEl, overflowElem, tipElem, params) {
6569
+ const reactData = $xeTable;
6570
+ if (!overflowElem) {
6571
+ return $xeTable.$nextTick();
6572
+ }
6573
+ params.cell = tdEl;
6574
+ const {
6575
+ tooltipStore
6576
+ } = reactData;
6577
+ const tooltipOpts = $xeTable.computeTooltipOpts;
6578
+ const {
6579
+ column,
6580
+ row
6581
+ } = params;
6582
+ const {
6583
+ showAll,
6584
+ contentMethod
6585
+ } = tooltipOpts;
6586
+ const customContent = contentMethod ? contentMethod(params) : null;
6587
+ const useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContent);
6588
+ const content = useCustom ? customContent : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toString(column.type === 'html' ? overflowElem.innerText : overflowElem.textContent).trim();
6589
+ const isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
6590
+ if (content && (showAll || useCustom || isCellOverflow)) {
6591
+ Object.assign(tooltipStore, {
6592
+ row,
6593
+ column,
6594
+ visible: true,
6595
+ currOpts: {}
6596
+ });
6597
+ $xeTable.$nextTick(() => {
6598
+ const $tooltip = $xeTable.$refs.refTooltip;
6599
+ if ($tooltip && $tooltip.open) {
6600
+ $tooltip.open(isCellOverflow ? overflowElem : tipElem || overflowElem, formatText(content));
6601
+ }
6602
+ });
6603
+ }
6604
+ return $xeTable.$nextTick();
6605
+ }
6533
6606
  function handleScrollToRowColumn($xeTable, fieldOrColumn, row) {
6534
6607
  const internalData = $xeTable;
6535
6608
  const {
@@ -6861,11 +6934,10 @@ function handleColumn($xeTable, collectColumn) {
6861
6934
  internalData.collectColumn = collectColumn;
6862
6935
  const tableFullColumn = getColumnList(collectColumn);
6863
6936
  internalData.tableFullColumn = tableFullColumn;
6864
- reactData.isLoading = true;
6937
+ reactData.isColLoading = true;
6865
6938
  reactData.isDragColMove = false;
6866
6939
  initColumnSort($xeTable);
6867
6940
  return Promise.resolve(restoreCustomStorage($xeTable)).then(() => {
6868
- reactData.isLoading = false;
6869
6941
  cacheColumnMap($xeTable);
6870
6942
  parseColumns($xeTable, true).then(() => {
6871
6943
  if (reactData.scrollXLoad) {
@@ -6890,6 +6962,7 @@ function handleColumn($xeTable, collectColumn) {
6890
6962
  if ($xeTable.handleUpdateCustomColumn) {
6891
6963
  $xeTable.handleUpdateCustomColumn();
6892
6964
  }
6965
+ reactData.isColLoading = false;
6893
6966
  return $xeTable.recalculate();
6894
6967
  });
6895
6968
  });
@@ -6897,15 +6970,12 @@ function handleColumn($xeTable, collectColumn) {
6897
6970
  /**
6898
6971
  * 纵向 Y 可视渲染处理
6899
6972
  */
6900
- function loadScrollYData($xeTable) {
6901
- const props = $xeTable;
6973
+ function loadScrollYData($xeTable, scrollTop) {
6902
6974
  const reactData = $xeTable;
6903
6975
  const internalData = $xeTable;
6904
6976
  const {
6905
- showOverflow
6906
- } = props;
6907
- const {
6908
- mergeList
6977
+ mergeList,
6978
+ isAllOverflow
6909
6979
  } = reactData;
6910
6980
  const {
6911
6981
  scrollYStore
@@ -6916,11 +6986,11 @@ function loadScrollYData($xeTable) {
6916
6986
  endIndex,
6917
6987
  offsetSize
6918
6988
  } = scrollYStore;
6919
- const autoOffsetYSize = showOverflow ? offsetSize : offsetSize + 1;
6989
+ const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
6920
6990
  const {
6921
6991
  toVisibleIndex,
6922
6992
  visibleSize
6923
- } = handleVirtualYVisible($xeTable);
6993
+ } = handleVirtualYVisible($xeTable, scrollTop);
6924
6994
  const offsetItem = {
6925
6995
  startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize - preloadSize),
6926
6996
  endIndex: toVisibleIndex + visibleSize + autoOffsetYSize + preloadSize
@@ -6940,6 +7010,54 @@ function loadScrollYData($xeTable) {
6940
7010
  }
6941
7011
  }
6942
7012
  }
7013
+ function lazyScrollXData($xeTable) {
7014
+ const internalData = $xeTable;
7015
+ const {
7016
+ lxTimeout,
7017
+ lxRunTime,
7018
+ scrollXStore
7019
+ } = internalData;
7020
+ const {
7021
+ visibleSize
7022
+ } = scrollXStore;
7023
+ const fpsTime = Math.max(5, Math.min(10, Math.floor(visibleSize / 3)));
7024
+ if (lxTimeout) {
7025
+ clearTimeout(lxTimeout);
7026
+ }
7027
+ if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
7028
+ internalData.lxRunTime = Date.now();
7029
+ loadScrollXData($xeTable);
7030
+ }
7031
+ internalData.lxTimeout = setTimeout(() => {
7032
+ internalData.lxTimeout = undefined;
7033
+ internalData.lxRunTime = undefined;
7034
+ loadScrollXData($xeTable);
7035
+ }, fpsTime);
7036
+ }
7037
+ function lazyScrollYData($xeTable) {
7038
+ const internalData = $xeTable;
7039
+ const {
7040
+ lyTimeout,
7041
+ lyRunTime,
7042
+ scrollYStore
7043
+ } = internalData;
7044
+ const {
7045
+ visibleSize
7046
+ } = scrollYStore;
7047
+ const fpsTime = Math.floor(Math.max(4, Math.min(10, visibleSize / 3)));
7048
+ if (lyTimeout) {
7049
+ clearTimeout(lyTimeout);
7050
+ }
7051
+ if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
7052
+ internalData.lyRunTime = Date.now();
7053
+ loadScrollYData($xeTable);
7054
+ }
7055
+ internalData.lyTimeout = setTimeout(() => {
7056
+ internalData.lyTimeout = undefined;
7057
+ internalData.lyRunTime = undefined;
7058
+ loadScrollYData($xeTable);
7059
+ }, fpsTime);
7060
+ }
6943
7061
  function checkLastSyncScroll($xeTable, isRollX, isRollY) {
6944
7062
  const reactData = $xeTable;
6945
7063
  const internalData = $xeTable;
@@ -6956,6 +7074,7 @@ function checkLastSyncScroll($xeTable, isRollX, isRollY) {
6956
7074
  internalData.lcsTimeout = setTimeout(() => {
6957
7075
  internalData.lcsRunTime = Date.now();
6958
7076
  internalData.lcsTimeout = undefined;
7077
+ internalData.intoRunScroll = false;
6959
7078
  internalData.inVirtualScroll = false;
6960
7079
  internalData.inWheelScroll = false;
6961
7080
  internalData.inHeaderScroll = false;
@@ -6975,6 +7094,43 @@ function checkLastSyncScroll($xeTable, isRollX, isRollY) {
6975
7094
  $xeTable.updateCellAreas();
6976
7095
  }, 200);
6977
7096
  }
7097
+ const getWheelSpeed = lastScrollTime => {
7098
+ let multiple = 1;
7099
+ const currTime = Date.now();
7100
+ if (lastScrollTime + 25 > currTime) {
7101
+ multiple = 1.18;
7102
+ } else if (lastScrollTime + 30 > currTime) {
7103
+ multiple = 1.15;
7104
+ } else if (lastScrollTime + 40 > currTime) {
7105
+ multiple = 1.12;
7106
+ } else if (lastScrollTime + 55 > currTime) {
7107
+ multiple = 1.09;
7108
+ } else if (lastScrollTime + 75 > currTime) {
7109
+ multiple = 1.06;
7110
+ } else if (lastScrollTime + 100 > currTime) {
7111
+ multiple = 1.03;
7112
+ }
7113
+ return multiple;
7114
+ };
7115
+ const wheelScrollTo = (diffNum, cb) => {
7116
+ const duration = Math.abs(diffNum);
7117
+ const startTime = performance.now();
7118
+ let countTop = 0;
7119
+ const step = timestamp => {
7120
+ let progress = (timestamp - startTime) / duration;
7121
+ if (progress > 1) {
7122
+ progress = 1;
7123
+ }
7124
+ const easedProgress = Math.pow(progress, 2);
7125
+ const offsetTop = Math.floor(diffNum * easedProgress) - countTop;
7126
+ countTop += offsetTop;
7127
+ cb(offsetTop);
7128
+ if (progress < 1) {
7129
+ requestAnimationFrame(step);
7130
+ }
7131
+ };
7132
+ requestAnimationFrame(step);
7133
+ };
6978
7134
  function updateHeight($xeTable) {
6979
7135
  const internalData = $xeTable;
6980
7136
  internalData.customHeight = calcTableHeight($xeTable, 'height');
@@ -6982,59 +7138,62 @@ function updateHeight($xeTable) {
6982
7138
  internalData.customMaxHeight = calcTableHeight($xeTable, 'maxHeight');
6983
7139
  }
6984
7140
  function calcColumnAutoWidth(column, wrapperEl) {
6985
- const cellElList = wrapperEl.querySelectorAll(`.vxe-header--column.${column.id}>.vxe-cell,.vxe-body--column.${column.id}>.vxe-cell,.vxe-footer--column.${column.id}>.vxe-cell`);
6986
- const firstCellEl = cellElList[0];
6987
- let paddingSize = 0;
6988
- if (firstCellEl) {
6989
- const cellStyle = getComputedStyle(firstCellEl);
6990
- paddingSize = Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingLeft) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingRight)) + 2;
6991
- }
6992
- let colWidth = column.renderAutoWidth - paddingSize;
6993
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(cellElList, itemEl => {
6994
- const cellEl = itemEl;
6995
- const thElem = cellEl.parentElement;
6996
- let titleWidth = 0;
6997
- if (`${thElem.tagName}`.toLowerCase() === 'th') {
6998
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(cellEl.children, btnEl => {
6999
- titleWidth += btnEl.offsetWidth + 1;
7000
- });
7001
- } else {
7002
- const labelEl = cellEl.firstElementChild;
7003
- if (labelEl) {
7004
- titleWidth = labelEl.offsetWidth;
7005
- }
7006
- }
7007
- if (titleWidth) {
7008
- colWidth = Math.max(colWidth, Math.ceil(titleWidth) + 4);
7009
- }
7010
- });
7011
- return colWidth + paddingSize;
7141
+ const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[colid="${column.id}"]`);
7142
+ let leftRightPadding = 0;
7143
+ const firstCellEl = cellElemList[0];
7144
+ if (firstCellEl && firstCellEl.parentElement) {
7145
+ const cellStyle = getComputedStyle(firstCellEl.parentElement);
7146
+ leftRightPadding = Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingLeft) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingRight));
7147
+ }
7148
+ let colWidth = column.renderAutoWidth - leftRightPadding;
7149
+ for (let i = 0; i < cellElemList.length; i++) {
7150
+ const celEl = cellElemList[i];
7151
+ colWidth = Math.max(colWidth, celEl ? Math.ceil(celEl.scrollWidth) + 4 : 0);
7152
+ }
7153
+ return colWidth + leftRightPadding;
7012
7154
  }
7013
7155
  function calcCellWidth($xeTable) {
7014
- const reactData = $xeTable;
7015
7156
  const internalData = $xeTable;
7016
7157
  const autoWidthColumnList = $xeTable.computeAutoWidthColumnList;
7017
- reactData.isCalcColumn = true;
7018
- return $xeTable.$nextTick().then(() => {
7019
- const {
7020
- fullColumnIdData
7021
- } = internalData;
7022
- const el = $xeTable.$refs.refElem;
7023
- if (el) {
7024
- autoWidthColumnList.forEach(column => {
7025
- const colid = column.id;
7026
- const colRest = fullColumnIdData[colid];
7027
- const colWidth = calcColumnAutoWidth(column, el);
7028
- if (colRest) {
7029
- colRest.width = Math.max(colWidth, colRest.width);
7030
- }
7031
- column.renderAutoWidth = colWidth;
7032
- });
7033
- $xeTable.analyColumnWidth();
7034
- }
7035
- reactData.isCalcColumn = false;
7036
- });
7158
+ const {
7159
+ fullColumnIdData
7160
+ } = internalData;
7161
+ const el = $xeTable.$refs.refElem;
7162
+ if (el) {
7163
+ el.setAttribute('data-calc-col', 'Y');
7164
+ autoWidthColumnList.forEach(column => {
7165
+ const colid = column.id;
7166
+ const colRest = fullColumnIdData[colid];
7167
+ const colWidth = calcColumnAutoWidth(column, el);
7168
+ if (colRest) {
7169
+ colRest.width = Math.max(colWidth, colRest.width);
7170
+ }
7171
+ column.renderAutoWidth = colWidth;
7172
+ });
7173
+ $xeTable.analyColumnWidth();
7174
+ el.removeAttribute('data-calc-col');
7175
+ }
7037
7176
  }
7177
+ const handleUpdateColResize = ($xeTable, evnt, params) => {
7178
+ $xeTable.analyColumnWidth();
7179
+ $xeTable.recalculate(true).then(() => {
7180
+ $xeTable.saveCustomStore('update:width');
7181
+ $xeTable.updateCellAreas();
7182
+ $xeTable.dispatchEvent('column-resizable-change', params, evnt);
7183
+ // 已废弃 resizable-change
7184
+ $xeTable.dispatchEvent('resizable-change', params, evnt);
7185
+ setTimeout(() => $xeTable.recalculate(true), 300);
7186
+ });
7187
+ };
7188
+ const handleUpdateRowResize = ($xeTable, evnt, params) => {
7189
+ const reactData = $xeTable;
7190
+ reactData.resizeHeightFlag++;
7191
+ $xeTable.recalculate(true).then(() => {
7192
+ $xeTable.updateCellAreas();
7193
+ $xeTable.dispatchEvent('row-resizable-change', params, evnt);
7194
+ setTimeout(() => $xeTable.recalculate(true), 300);
7195
+ });
7196
+ };
7038
7197
  const Methods = {
7039
7198
  callSlot(slotFunc, params, h, vNodes) {
7040
7199
  if (slotFunc) {
@@ -7099,7 +7258,7 @@ const Methods = {
7099
7258
  warnLog('vxe.error.delFunc', ['syncData', 'getData']);
7100
7259
  return this.$nextTick().then(() => {
7101
7260
  this.tableData = [];
7102
- return this.$nextTick().then(() => this.loadTableData(this.tableFullData));
7261
+ return this.$nextTick().then(() => this.loadTableData(this.tableFullData, true));
7103
7262
  });
7104
7263
  },
7105
7264
  /**
@@ -7161,11 +7320,12 @@ const Methods = {
7161
7320
  * 加载表格数据
7162
7321
  * @param {Array} datas 数据
7163
7322
  */
7164
- loadTableData(datas) {
7323
+ loadTableData(datas, isReset) {
7165
7324
  const $xeTable = this;
7325
+ const reactData = $xeTable;
7326
+ const internalData = $xeTable;
7166
7327
  const {
7167
7328
  keepSource,
7168
- showOverflow,
7169
7329
  treeConfig,
7170
7330
  treeOpts,
7171
7331
  editStore,
@@ -7178,7 +7338,6 @@ const Methods = {
7178
7338
  sYOpts
7179
7339
  } = this;
7180
7340
  const childrenField = treeOpts.children || treeOpts.childrenField;
7181
- const rowOpts = $xeTable.computeRowOpts;
7182
7341
  let treeData = [];
7183
7342
  let fullData = datas ? datas.slice(0) : [];
7184
7343
  if (treeConfig) {
@@ -7221,42 +7380,30 @@ const Methods = {
7221
7380
  scrollYStore.endIndex = 1;
7222
7381
  scrollXStore.startIndex = 0;
7223
7382
  scrollXStore.endIndex = 1;
7383
+ reactData.isRowLoading = true;
7384
+ reactData.scrollVMLoading = false;
7224
7385
  editStore.insertMaps = {};
7225
- editStore.removeList = [];
7226
7386
  editStore.removeMaps = {};
7227
7387
  const sYLoad = updateScrollYStatus($xeTable, fullData);
7228
- this.isDragRowMove = false;
7388
+ reactData.isDragColMove = false;
7389
+ reactData.isDragRowMove = false;
7229
7390
  // 全量数据
7230
- this.tableFullData = fullData;
7231
- this.tableFullTreeData = treeData;
7391
+ internalData.tableFullData = fullData;
7392
+ internalData.tableFullTreeData = treeData;
7232
7393
  // 缓存数据
7233
- this.cacheRowMap(true);
7394
+ $xeTable.cacheRowMap(true, isReset);
7234
7395
  // 原始数据
7235
- this.tableSynchData = datas;
7396
+ internalData.tableSynchData = datas;
7397
+ if (isReset) {
7398
+ internalData.isResizeCellHeight = false;
7399
+ reactData.rowExpandedMaps = {};
7400
+ reactData.rowExpandLazyLoadedMaps = {};
7401
+ reactData.treeExpandedMaps = {};
7402
+ reactData.treeExpandLazyLoadedMaps = {};
7403
+ }
7236
7404
  // 克隆原数据,用于显示编辑状态,与编辑值做对比
7237
7405
  if (keepSource) {
7238
- this.cacheSourceMap(fullData);
7239
- }
7240
- if (sYLoad) {
7241
- if (showOverflow) {
7242
- if (!rowOpts.height) {
7243
- const errColumn = this.tableFullColumn.find(column => column.showOverflow === false);
7244
- if (errColumn) {
7245
- errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
7246
- }
7247
- }
7248
- }
7249
- if (true) {
7250
- if (!(this.height || this.maxHeight)) {
7251
- errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
7252
- }
7253
- // if (!this.showOverflow) {
7254
- // warnLog('vxe.error.reqProp', ['table.show-overflow'])
7255
- // }
7256
- if (this.spanMethod) {
7257
- warnLog('vxe.error.scrollErrProp', ['table.span-method']);
7258
- }
7259
- }
7406
+ $xeTable.cacheSourceMap(fullData);
7260
7407
  }
7261
7408
  if (this.clearCellAreas && this.mouseConfig) {
7262
7409
  this.clearCellAreas();
@@ -7276,6 +7423,27 @@ const Methods = {
7276
7423
  if (sYLoad) {
7277
7424
  scrollYStore.endIndex = scrollYStore.visibleSize;
7278
7425
  }
7426
+ if (sYLoad) {
7427
+ // if (showOverflow) {
7428
+ // if (!rowOpts.height) {
7429
+ // const errColumn = this.tableFullColumn.find((column: any) => column.showOverflow === false)
7430
+ // if (errColumn) {
7431
+ // errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
7432
+ // }
7433
+ // }
7434
+ // }
7435
+ if (true) {
7436
+ if (!(this.height || this.maxHeight)) {
7437
+ errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
7438
+ }
7439
+ // if (!this.showOverflow) {
7440
+ // warnLog('vxe.error.reqProp', ['table.show-overflow'])
7441
+ // }
7442
+ if (this.spanMethod) {
7443
+ warnLog('vxe.error.scrollErrProp', ['table.span-method']);
7444
+ }
7445
+ }
7446
+ }
7279
7447
  this.handleReserveStatus();
7280
7448
  this.checkSelectionStatus();
7281
7449
  return new Promise(resolve => {
@@ -7289,6 +7457,7 @@ const Methods = {
7289
7457
  if (sYOpts.scrollToTopOnChange) {
7290
7458
  targetScrollTop = 0;
7291
7459
  }
7460
+ reactData.isRowLoading = false;
7292
7461
  calcCellHeight($xeTable);
7293
7462
  // 是否变更虚拟滚动
7294
7463
  if (oldScrollYLoad === sYLoad) {
@@ -7314,7 +7483,7 @@ const Methods = {
7314
7483
  const {
7315
7484
  initStatus
7316
7485
  } = this;
7317
- return this.loadTableData(datas).then(() => {
7486
+ return this.loadTableData(datas, false).then(() => {
7318
7487
  this.inited = true;
7319
7488
  this.initStatus = true;
7320
7489
  if (!initStatus) {
@@ -7331,7 +7500,7 @@ const Methods = {
7331
7500
  return this.clearAll().then(() => {
7332
7501
  this.inited = true;
7333
7502
  this.initStatus = true;
7334
- return this.loadTableData(datas);
7503
+ return this.loadTableData(datas, true);
7335
7504
  }).then(() => {
7336
7505
  this.handleLoadDefaults();
7337
7506
  return this.recalculate();
@@ -7414,9 +7583,8 @@ const Methods = {
7414
7583
  },
7415
7584
  /**
7416
7585
  * 更新数据行的 Map
7417
- * 牺牲数据组装的耗时,用来换取使用过程中的流畅
7418
7586
  */
7419
- cacheRowMap(isSource) {
7587
+ cacheRowMap(isReset, isSource) {
7420
7588
  const {
7421
7589
  treeConfig,
7422
7590
  treeOpts,
@@ -7442,7 +7610,7 @@ const Methods = {
7442
7610
  row[childrenField] = null;
7443
7611
  }
7444
7612
  let cacheItem = fullAllDataRowIdData[rowid];
7445
- if (!cacheItem) {
7613
+ if (isReset || !cacheItem) {
7446
7614
  cacheItem = {
7447
7615
  row,
7448
7616
  rowid,
@@ -7455,6 +7623,7 @@ const Methods = {
7455
7623
  parent: parentRow,
7456
7624
  level,
7457
7625
  height: 0,
7626
+ resizeHeight: 0,
7458
7627
  oTop: 0
7459
7628
  };
7460
7629
  }
@@ -7560,6 +7729,7 @@ const Methods = {
7560
7729
  parent: parentRow,
7561
7730
  level: parentLevel + nodes.length,
7562
7731
  height: 0,
7732
+ resizeHeight: 0,
7563
7733
  oTop: 0
7564
7734
  };
7565
7735
  fullDataRowIdData[rowid] = rest;
@@ -7952,20 +8122,38 @@ const Methods = {
7952
8122
  return this.$nextTick();
7953
8123
  },
7954
8124
  getCellElement(row, fieldOrColumn) {
7955
- const column = handleFieldOrColumn(this, fieldOrColumn);
8125
+ const $xeTable = this;
8126
+ const internalData = $xeTable;
8127
+ const {
8128
+ elemStore
8129
+ } = internalData;
8130
+ const column = handleFieldOrColumn($xeTable, fieldOrColumn);
7956
8131
  if (!column) {
7957
8132
  return null;
7958
8133
  }
7959
- const {
7960
- $refs
7961
- } = this;
7962
- const rowid = getRowid(this, row);
7963
- let bodyElem = null;
8134
+ const rowid = getRowid($xeTable, row);
8135
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
8136
+ const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
8137
+ const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
8138
+ let bodyElem;
7964
8139
  if (column) {
7965
- bodyElem = $refs[`${column.fixed || 'table'}Body`] || $refs.refTableBody;
7966
- }
7967
- if (bodyElem && bodyElem.$el) {
7968
- return bodyElem.$el.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);
8140
+ if (column.fixed) {
8141
+ if (column.fixed === 'left') {
8142
+ if (leftScrollElem) {
8143
+ bodyElem = leftScrollElem;
8144
+ }
8145
+ } else {
8146
+ if (rightScrollElem) {
8147
+ bodyElem = rightScrollElem;
8148
+ }
8149
+ }
8150
+ }
8151
+ if (!bodyElem) {
8152
+ bodyElem = bodyScrollElem;
8153
+ }
8154
+ if (bodyElem) {
8155
+ return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);
8156
+ }
7969
8157
  }
7970
8158
  return null;
7971
8159
  },
@@ -8492,7 +8680,11 @@ const Methods = {
8492
8680
  * @param {String/Number} rowid 行主键
8493
8681
  */
8494
8682
  getRowById(cellValue) {
8495
- const fullDataRowIdData = this.fullDataRowIdData;
8683
+ const $xeTable = this;
8684
+ const internalData = $xeTable;
8685
+ const {
8686
+ fullDataRowIdData
8687
+ } = internalData;
8496
8688
  const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue) ? '' : encodeURIComponent(cellValue);
8497
8689
  return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
8498
8690
  },
@@ -8500,14 +8692,9 @@ const Methods = {
8500
8692
  * 根据行获取行的唯一主键
8501
8693
  * @param {Row} row 行对象
8502
8694
  */
8503
- getRowid(cellValue) {
8695
+ getRowid(row) {
8504
8696
  const $xeTable = this;
8505
- const internalData = $xeTable;
8506
- const {
8507
- fullDataRowIdData
8508
- } = internalData;
8509
- const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue) ? '' : encodeURIComponent(cellValue || '');
8510
- return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
8697
+ return getRowid($xeTable, row);
8511
8698
  },
8512
8699
  /**
8513
8700
  * 获取处理后的表格数据
@@ -8711,29 +8898,41 @@ const Methods = {
8711
8898
  },
8712
8899
  setColumnWidth(fieldOrColumn, width) {
8713
8900
  const $xeTable = this;
8901
+ const internalData = $xeTable;
8902
+ const {
8903
+ elemStore
8904
+ } = internalData;
8714
8905
  let status = false;
8715
8906
  const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
8716
- cols.forEach(item => {
8717
- const column = handleFieldOrColumn($xeTable, item);
8718
- if (column) {
8719
- const colWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(width);
8720
- let rdWidth = colWidth;
8721
- if (isScale(width)) {
8722
- const refTableBody = $xeTable.$refs.refTableBody;
8723
- const bodyElem = refTableBody ? refTableBody.$el : null;
8724
- const bodyWidth = bodyElem ? bodyElem.clientWidth - 1 : 0;
8725
- rdWidth = Math.floor(colWidth * bodyWidth);
8726
- }
8727
- column.resizeWidth = rdWidth;
8728
- if (!status) {
8729
- status = true;
8907
+ let cWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(width);
8908
+ if (isScale(width)) {
8909
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
8910
+ const bodyWidth = bodyScrollElem ? bodyScrollElem.clientWidth - 1 : 0;
8911
+ cWidth = Math.floor(cWidth * bodyWidth);
8912
+ }
8913
+ if (cWidth) {
8914
+ cols.forEach(item => {
8915
+ const column = handleFieldOrColumn($xeTable, item);
8916
+ if (column) {
8917
+ column.resizeWidth = cWidth;
8918
+ if (!status) {
8919
+ status = true;
8920
+ }
8730
8921
  }
8922
+ });
8923
+ if (status) {
8924
+ return $xeTable.refreshColumn().then(() => {
8925
+ return {
8926
+ status
8927
+ };
8928
+ });
8731
8929
  }
8732
- });
8733
- if (status) {
8734
- return $xeTable.refreshColumn();
8735
8930
  }
8736
- return $xeTable.$nextTick();
8931
+ return $xeTable.$nextTick().then(() => {
8932
+ return {
8933
+ status
8934
+ };
8935
+ });
8737
8936
  },
8738
8937
  getColumnWidth(fieldOrColumn) {
8739
8938
  const column = handleFieldOrColumn(this, fieldOrColumn);
@@ -9060,7 +9259,162 @@ const Methods = {
9060
9259
  remainList
9061
9260
  });
9062
9261
  },
9063
- handleResizeDblclickEvent(evnt, params) {
9262
+ handleColResizeMousedownEvent(evnt, fixedType, params) {
9263
+ const $xeTable = this;
9264
+ const reactData = $xeTable;
9265
+ const internalData = $xeTable;
9266
+ evnt.stopPropagation();
9267
+ evnt.preventDefault();
9268
+ const {
9269
+ column
9270
+ } = params;
9271
+ const {
9272
+ overflowX,
9273
+ scrollbarHeight
9274
+ } = reactData;
9275
+ const {
9276
+ elemStore,
9277
+ visibleColumn
9278
+ } = internalData;
9279
+ const resizableOpts = $xeTable.computeResizableOpts;
9280
+ const osbHeight = overflowX ? scrollbarHeight : 0;
9281
+ const tableEl = $xeTable.$refs.refElem;
9282
+ const leftContainerElem = $xeTable.$refs.refLeftContainer;
9283
+ const rightContainerElem = $xeTable.$refs.refRightContainer;
9284
+ const resizeBarElem = $xeTable.$refs.refColResizeBar;
9285
+ if (!resizeBarElem) {
9286
+ return;
9287
+ }
9288
+ const resizeTipElem = resizeBarElem.firstElementChild;
9289
+ const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
9290
+ const {
9291
+ clientX: dragClientX
9292
+ } = evnt;
9293
+ const wrapperElem = $xeTable.$refs.refElem;
9294
+ const dragBtnElem = evnt.target;
9295
+ let resizeColumn = column;
9296
+ if (column.children && column.children.length) {
9297
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
9298
+ resizeColumn = childColumn;
9299
+ });
9300
+ }
9301
+ const cell = dragBtnElem.parentNode;
9302
+ const cellParams = Object.assign(params, {
9303
+ cell
9304
+ });
9305
+ let dragLeft = 0;
9306
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
9307
+ if (!bodyScrollElem) {
9308
+ return;
9309
+ }
9310
+ const pos = getOffsetPos(dragBtnElem, wrapperElem);
9311
+ const dragBtnWidth = dragBtnElem.clientWidth;
9312
+ const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
9313
+ const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
9314
+ let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
9315
+ let dragPosLeft = pos.left + dragBtnOffsetWidth;
9316
+ const isLeftFixed = fixedType === 'left';
9317
+ const isRightFixed = fixedType === 'right';
9318
+ // 计算左右侧固定列偏移量
9319
+ let fixedOffsetWidth = 0;
9320
+ if (isLeftFixed || isRightFixed) {
9321
+ const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
9322
+ let tempCellElem = cell[siblingProp];
9323
+ while (tempCellElem) {
9324
+ if (hasClass(tempCellElem, 'fixed--hidden')) {
9325
+ break;
9326
+ } else if (!hasClass(tempCellElem, 'col--group')) {
9327
+ fixedOffsetWidth += tempCellElem.offsetWidth;
9328
+ }
9329
+ tempCellElem = tempCellElem[siblingProp];
9330
+ }
9331
+ if (isRightFixed && rightContainerElem) {
9332
+ dragPosLeft = rightContainerElem.offsetLeft + fixedOffsetWidth;
9333
+ }
9334
+ }
9335
+ // 处理拖动事件
9336
+ const updateEvent = evnt => {
9337
+ evnt.stopPropagation();
9338
+ evnt.preventDefault();
9339
+ const tableHeight = tableEl.clientHeight;
9340
+ const offsetX = evnt.clientX - dragClientX;
9341
+ let left = dragPosLeft + offsetX;
9342
+ const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
9343
+ if (isLeftFixed) {
9344
+ // 左固定列(不允许超过右侧固定列、不允许超过右边距)
9345
+ left = Math.min(left, (rightContainerElem ? rightContainerElem.offsetLeft : bodyScrollElem.clientWidth) - fixedOffsetWidth - minInterval);
9346
+ } else if (isRightFixed) {
9347
+ // 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
9348
+ dragMinLeft = (leftContainerElem ? leftContainerElem.clientWidth : 0) + fixedOffsetWidth + minInterval;
9349
+ left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
9350
+ } else {
9351
+ dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
9352
+ // left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
9353
+ }
9354
+ dragLeft = Math.max(left, dragMinLeft);
9355
+ const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
9356
+ resizeBarElem.style.left = `${resizeBarLeft}px`;
9357
+ resizeBarElem.style.top = `${scrollbarXToTop ? osbHeight : 0}px`;
9358
+ resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - osbHeight : tableHeight}px`;
9359
+ if (resizableOpts.showDragTip && resizeTipElem) {
9360
+ resizeTipElem.textContent = methods_getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
9361
+ const tableWidth = tableEl.clientWidth;
9362
+ const wrapperRect = wrapperElem.getBoundingClientRect();
9363
+ const resizeBarWidth = resizeBarElem.clientWidth;
9364
+ const resizeTipWidth = resizeTipElem.clientWidth;
9365
+ const resizeTipHeight = resizeTipElem.clientHeight;
9366
+ let resizeTipLeft = -resizeTipWidth;
9367
+ if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
9368
+ resizeTipLeft = 0;
9369
+ } else if (resizeBarLeft > tableWidth) {
9370
+ resizeTipLeft += tableWidth - resizeBarLeft;
9371
+ }
9372
+ resizeTipElem.style.left = `${resizeTipLeft}px`;
9373
+ resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
9374
+ }
9375
+ reactData.isDragResize = true;
9376
+ };
9377
+ reactData.isDragResize = true;
9378
+ addClass(tableEl, 'col-drag--resize');
9379
+ resizeBarElem.style.display = 'block';
9380
+ document.onmousemove = updateEvent;
9381
+ document.onmouseup = function (evnt) {
9382
+ document.onmousemove = null;
9383
+ document.onmouseup = null;
9384
+ resizeBarElem.style.display = 'none';
9385
+ internalData._lastResizeTime = Date.now();
9386
+ setTimeout(() => {
9387
+ reactData.isDragResize = false;
9388
+ }, 50);
9389
+ const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
9390
+ const resizeParams = {
9391
+ ...params,
9392
+ resizeWidth,
9393
+ resizeColumn
9394
+ };
9395
+ if (resizableOpts.dragMode === 'fixed') {
9396
+ visibleColumn.forEach(item => {
9397
+ if (item.id !== resizeColumn.id) {
9398
+ if (!item.resizeWidth) {
9399
+ item.resizeWidth = item.renderWidth;
9400
+ }
9401
+ }
9402
+ });
9403
+ }
9404
+ if ($xeTable.handleColResizeCellAreaEvent) {
9405
+ $xeTable.handleColResizeCellAreaEvent(evnt, resizeParams);
9406
+ } else {
9407
+ resizeColumn.resizeWidth = resizeWidth;
9408
+ handleUpdateColResize($xeTable, evnt, resizeParams);
9409
+ }
9410
+ removeClass(tableEl, 'col-drag--resize');
9411
+ };
9412
+ updateEvent(evnt);
9413
+ if ($xeTable.closeMenu) {
9414
+ $xeTable.closeMenu();
9415
+ }
9416
+ },
9417
+ handleColResizeDblclickEvent(evnt, params) {
9064
9418
  const $xeTable = this;
9065
9419
  const reactData = $xeTable;
9066
9420
  const internalData = $xeTable;
@@ -9070,6 +9424,8 @@ const Methods = {
9070
9424
  } = resizableOpts;
9071
9425
  const el = $xeTable.$refs.refElem;
9072
9426
  if (isDblclickAutoWidth && el) {
9427
+ evnt.stopPropagation();
9428
+ evnt.preventDefault();
9073
9429
  const {
9074
9430
  fullColumnIdData
9075
9431
  } = internalData;
@@ -9090,24 +9446,306 @@ const Methods = {
9090
9446
  cell
9091
9447
  });
9092
9448
  const colMinWidth = getColReMinWidth(cellParams);
9449
+ el.setAttribute('data-calc-col', 'Y');
9093
9450
  let resizeWidth = calcColumnAutoWidth(resizeColumn, el);
9451
+ el.removeAttribute('data-calc-col');
9094
9452
  if (colRest) {
9095
9453
  resizeWidth = Math.max(resizeWidth, colRest.width);
9096
9454
  }
9097
- resizeColumn.resizeWidth = Math.max(colMinWidth, resizeWidth);
9098
- reactData._isResize = false;
9455
+ resizeWidth = Math.max(colMinWidth, resizeWidth);
9456
+ const resizeParams = {
9457
+ ...params,
9458
+ resizeWidth,
9459
+ resizeColumn
9460
+ };
9461
+ reactData.isDragResize = false;
9099
9462
  internalData._lastResizeTime = Date.now();
9100
- $xeTable.analyColumnWidth();
9101
- $xeTable.recalculate(true).then(() => {
9102
- $xeTable.saveCustomStore('update:visible');
9103
- $xeTable.updateCellAreas();
9104
- $xeTable.dispatchEvent('resizable-change', {
9463
+ if ($xeTable.handleColResizeDblclickCellAreaEvent) {
9464
+ $xeTable.handleColResizeDblclickCellAreaEvent(evnt, resizeParams);
9465
+ } else {
9466
+ resizeColumn.resizeWidth = resizeWidth;
9467
+ handleUpdateColResize($xeTable, evnt, resizeParams);
9468
+ }
9469
+ }
9470
+ },
9471
+ handleRowResizeMousedownEvent(evnt, params) {
9472
+ const $xeTable = this;
9473
+ const reactData = $xeTable;
9474
+ const internalData = $xeTable;
9475
+ evnt.stopPropagation();
9476
+ evnt.preventDefault();
9477
+ const {
9478
+ row
9479
+ } = params;
9480
+ const {
9481
+ overflowX,
9482
+ scrollbarWidth,
9483
+ overflowY,
9484
+ scrollbarHeight
9485
+ } = reactData;
9486
+ const {
9487
+ elemStore,
9488
+ fullAllDataRowIdData
9489
+ } = internalData;
9490
+ const osbWidth = overflowY ? scrollbarWidth : 0;
9491
+ const osbHeight = overflowX ? scrollbarHeight : 0;
9492
+ const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
9493
+ const resizableOpts = $xeTable.computeResizableOpts;
9494
+ const rowOpts = $xeTable.computeRowOpts;
9495
+ const cellOpts = $xeTable.computeCellOpts;
9496
+ const tableEl = $xeTable.$refs.refElem;
9497
+ const resizeBarElem = $xeTable.$refs.refRowResizeBar;
9498
+ if (!resizeBarElem) {
9499
+ return;
9500
+ }
9501
+ const {
9502
+ clientY: dragClientY
9503
+ } = evnt;
9504
+ const resizeTipElem = resizeBarElem.firstElementChild;
9505
+ const dragBtnElem = evnt.currentTarget;
9506
+ const tdEl = dragBtnElem.parentNode;
9507
+ const trEl = tdEl.parentNode;
9508
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
9509
+ if (!bodyScrollElem) {
9510
+ return;
9511
+ }
9512
+ const rowid = getRowid($xeTable, row);
9513
+ const rowRest = fullAllDataRowIdData[rowid];
9514
+ if (!rowRest) {
9515
+ return;
9516
+ }
9517
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
9518
+ const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
9519
+ const tableRect = tableEl.getBoundingClientRect();
9520
+ const trRect = trEl.getBoundingClientRect();
9521
+ const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
9522
+ let resizeHeight = currCellHeight;
9523
+ const cellEl = tdEl.querySelector('.vxe-cell');
9524
+ let cellMinHeight = 0;
9525
+ if (cellEl) {
9526
+ const cellStyle = getComputedStyle(cellEl);
9527
+ cellMinHeight = Math.max(1, Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingTop) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingBottom)));
9528
+ }
9529
+ const minTop = trRect.y - tableRect.y + cellMinHeight;
9530
+ // 处理拖动事件
9531
+ const updateEvent = evnt => {
9532
+ evnt.stopPropagation();
9533
+ evnt.preventDefault();
9534
+ const tableWidth = tableEl.clientWidth - osbWidth;
9535
+ const tableHeight = tableEl.clientHeight - osbHeight;
9536
+ let dragTop = evnt.clientY - tableRect.y - targetOffsetY;
9537
+ if (dragTop < minTop) {
9538
+ dragTop = minTop;
9539
+ } else {
9540
+ resizeHeight = Math.max(cellMinHeight, currCellHeight + evnt.clientY - dragClientY);
9541
+ }
9542
+ resizeBarElem.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
9543
+ resizeBarElem.style.top = `${dragTop}px`;
9544
+ resizeBarElem.style.width = `${tableWidth}px`;
9545
+ if (resizableOpts.showDragTip && resizeTipElem) {
9546
+ resizeTipElem.textContent = methods_getI18n('vxe.table.resizeRowTip', [resizeHeight]);
9547
+ const resizeTipWidth = resizeTipElem.clientWidth;
9548
+ const resizeTipHeight = resizeTipElem.clientHeight;
9549
+ let resizeBarLeft = Math.max(2, evnt.clientX - tableRect.x);
9550
+ let resizeBarTop = 0;
9551
+ if (resizeBarLeft + resizeTipWidth >= tableWidth - 2) {
9552
+ resizeBarLeft = tableWidth - resizeTipWidth - 2;
9553
+ }
9554
+ if (dragTop + resizeTipHeight >= tableHeight) {
9555
+ resizeBarTop = tableHeight - (dragTop + resizeTipHeight);
9556
+ }
9557
+ resizeTipElem.style.left = `${resizeBarLeft}px`;
9558
+ resizeTipElem.style.top = `${resizeBarTop}px`;
9559
+ }
9560
+ reactData.isDragResize = true;
9561
+ };
9562
+ reactData.isDragResize = true;
9563
+ addClass(tableEl, 'row-drag--resize');
9564
+ resizeBarElem.style.display = 'block';
9565
+ document.onmousemove = updateEvent;
9566
+ document.onmouseup = function (evnt) {
9567
+ document.onmousemove = null;
9568
+ document.onmouseup = null;
9569
+ resizeBarElem.style.display = 'none';
9570
+ internalData._lastResizeTime = Date.now();
9571
+ setTimeout(() => {
9572
+ reactData.isDragResize = false;
9573
+ }, 50);
9574
+ if (resizeHeight !== currCellHeight) {
9575
+ const resizeParams = {
9105
9576
  ...params,
9106
- resizeWidth
9107
- }, evnt);
9108
- setTimeout(() => $xeTable.recalculate(true), 300);
9577
+ resizeHeight,
9578
+ resizeRow: row
9579
+ };
9580
+ internalData.isResizeCellHeight = true;
9581
+ if ($xeTable.handleRowResizeCellAreaEvent) {
9582
+ $xeTable.handleRowResizeCellAreaEvent(evnt, resizeParams);
9583
+ } else {
9584
+ rowRest.resizeHeight = resizeHeight;
9585
+ handleUpdateRowResize($xeTable, evnt, resizeParams);
9586
+ }
9587
+ }
9588
+ removeClass(tableEl, 'row-drag--resize');
9589
+ };
9590
+ updateEvent(evnt);
9591
+ },
9592
+ handleRowResizeDblclickEvent(evnt, params) {
9593
+ const $xeTable = this;
9594
+ const reactData = $xeTable;
9595
+ const internalData = $xeTable;
9596
+ const resizableOpts = $xeTable.computeResizableOpts;
9597
+ const {
9598
+ isDblclickAutoHeight
9599
+ } = resizableOpts;
9600
+ const el = $xeTable.$refs.refElem;
9601
+ if (isDblclickAutoHeight && el) {
9602
+ evnt.stopPropagation();
9603
+ evnt.preventDefault();
9604
+ const {
9605
+ editStore
9606
+ } = reactData;
9607
+ const {
9608
+ fullAllDataRowIdData
9609
+ } = internalData;
9610
+ const {
9611
+ actived
9612
+ } = editStore;
9613
+ const {
9614
+ row
9615
+ } = params;
9616
+ const rowid = getRowid($xeTable, row);
9617
+ const rowRest = fullAllDataRowIdData[rowid];
9618
+ if (!rowRest) {
9619
+ return;
9620
+ }
9621
+ const handleRsHeight = () => {
9622
+ const resizeHeight = calcCellAutoHeight(rowRest, el);
9623
+ const resizeParams = {
9624
+ ...params,
9625
+ resizeHeight,
9626
+ resizeRow: row
9627
+ };
9628
+ reactData.isDragResize = false;
9629
+ internalData._lastResizeTime = Date.now();
9630
+ if ($xeTable.handleRowResizeDblclickCellAreaEvent) {
9631
+ $xeTable.handleRowResizeDblclickCellAreaEvent(evnt, resizeParams);
9632
+ } else {
9633
+ rowRest.resizeHeight = resizeHeight;
9634
+ handleUpdateRowResize($xeTable, evnt, resizeParams);
9635
+ }
9636
+ };
9637
+ if (actived.row || actived.column) {
9638
+ $xeTable.clearEdit().then(handleRsHeight);
9639
+ } else {
9640
+ handleRsHeight();
9641
+ }
9642
+ }
9643
+ },
9644
+ setRowHeightConf(heightConf) {
9645
+ const $xeTable = this;
9646
+ const reactData = $xeTable;
9647
+ const internalData = $xeTable;
9648
+ const {
9649
+ fullAllDataRowIdData
9650
+ } = internalData;
9651
+ let status = false;
9652
+ if (heightConf) {
9653
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(heightConf, (height, rowid) => {
9654
+ const rowRest = fullAllDataRowIdData[rowid];
9655
+ if (rowRest) {
9656
+ const rHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);
9657
+ if (rHeight) {
9658
+ rowRest.resizeHeight = rHeight;
9659
+ if (!status) {
9660
+ status = true;
9661
+ }
9662
+ }
9663
+ }
9664
+ });
9665
+ if (status) {
9666
+ internalData.isResizeCellHeight = true;
9667
+ reactData.resizeHeightFlag++;
9668
+ }
9669
+ }
9670
+ return $xeTable.$nextTick().then(() => {
9671
+ return {
9672
+ status
9673
+ };
9674
+ });
9675
+ },
9676
+ getRowHeightConf(isFull) {
9677
+ const $xeTable = this;
9678
+ const internalData = $xeTable;
9679
+ const {
9680
+ fullAllDataRowIdData,
9681
+ afterFullData
9682
+ } = internalData;
9683
+ const rowOpts = $xeTable.computeRowOpts;
9684
+ const cellOpts = $xeTable.computeCellOpts;
9685
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
9686
+ const rest = {};
9687
+ afterFullData.forEach(row => {
9688
+ const rowid = getRowid($xeTable, row);
9689
+ const rowRest = fullAllDataRowIdData[rowid];
9690
+ if (rowRest) {
9691
+ const resizeHeight = rowRest.resizeHeight;
9692
+ if (resizeHeight || isFull) {
9693
+ const currCellHeight = resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
9694
+ rest[rowid] = currCellHeight;
9695
+ }
9696
+ }
9697
+ });
9698
+ return rest;
9699
+ },
9700
+ setRowHeight(rowOrId, height) {
9701
+ const $xeTable = this;
9702
+ const reactData = $xeTable;
9703
+ const internalData = $xeTable;
9704
+ const {
9705
+ fullAllDataRowIdData
9706
+ } = internalData;
9707
+ let status = false;
9708
+ const rows = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rowOrId) ? rowOrId : [rowOrId];
9709
+ let rHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);
9710
+ if (isScale(height)) {
9711
+ const tableBody = $xeTable.$refs.refTableBody;
9712
+ const bodyElem = tableBody ? tableBody.$el : null;
9713
+ const bodyHeight = bodyElem ? bodyElem.clientHeight - 1 : 0;
9714
+ rHeight = Math.floor(rHeight * bodyHeight);
9715
+ }
9716
+ if (rHeight) {
9717
+ rows.forEach(row => {
9718
+ const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row) ? row : getRowid($xeTable, row);
9719
+ const rowRest = fullAllDataRowIdData[rowid];
9720
+ if (rowRest) {
9721
+ rowRest.resizeHeight = rHeight;
9722
+ if (!status) {
9723
+ status = true;
9724
+ }
9725
+ }
9109
9726
  });
9727
+ if (status) {
9728
+ internalData.isResizeCellHeight = true;
9729
+ reactData.resizeHeightFlag++;
9730
+ }
9731
+ }
9732
+ return $xeTable.$nextTick();
9733
+ },
9734
+ getRowHeight(rowOrId) {
9735
+ const $xeTable = this;
9736
+ const internalData = $xeTable;
9737
+ const {
9738
+ fullAllDataRowIdData
9739
+ } = internalData;
9740
+ const rowOpts = $xeTable.computeRowOpts;
9741
+ const cellOpts = $xeTable.computeCellOpts;
9742
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
9743
+ const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrId) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowOrId) ? rowOrId : getRowid($xeTable, rowOrId);
9744
+ const rowRest = fullAllDataRowIdData[rowid];
9745
+ if (rowRest) {
9746
+ return rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
9110
9747
  }
9748
+ return 0;
9111
9749
  },
9112
9750
  /**
9113
9751
  * 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
@@ -9543,10 +10181,10 @@ const Methods = {
9543
10181
  }
9544
10182
  } else if (isContextMenu) {
9545
10183
  // 如果按下上下文键
9546
- this._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
10184
+ internalData._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
9547
10185
  clearTimeout(internalData.keyCtxTimeout);
9548
10186
  internalData.keyCtxTimeout = setTimeout(() => {
9549
- this._keyCtx = false;
10187
+ internalData._keyCtx = false;
9550
10188
  }, 1000);
9551
10189
  } else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow)) {
9552
10190
  const {
@@ -9827,53 +10465,45 @@ const Methods = {
9827
10465
  this.updateCellAreas();
9828
10466
  this.recalculate(true);
9829
10467
  },
9830
- handleTargetEnterEvent(isClear) {
9831
- const $tooltip = this.$refs.tooltip;
9832
- clearTimeout(this.tooltipTimeout);
9833
- if (isClear) {
9834
- this.closeTooltip();
9835
- } else {
9836
- if ($tooltip) {
9837
- $tooltip.setActived(true);
9838
- }
9839
- }
9840
- },
9841
10468
  handleTargetLeaveEvent() {
9842
- const tooltipOpts = this.tooltipOpts;
9843
- let $tooltip = this.$refs.tooltip;
9844
- if ($tooltip) {
10469
+ const $xeTable = this;
10470
+ const internalData = $xeTable;
10471
+ const tooltipOpts = $xeTable.computeTooltipOpts;
10472
+ let $tooltip = $xeTable.$refs.refTooltip;
10473
+ if ($tooltip && $tooltip.setActived) {
9845
10474
  $tooltip.setActived(false);
9846
10475
  }
9847
10476
  if (tooltipOpts.enterable) {
9848
- this.tooltipTimeout = setTimeout(() => {
9849
- $tooltip = this.$refs.tooltip;
9850
- if ($tooltip && !$tooltip.isActived()) {
9851
- this.closeTooltip();
10477
+ internalData.tooltipTimeout = setTimeout(() => {
10478
+ $tooltip = $xeTable.$refs.refTooltip;
10479
+ if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
10480
+ $xeTable.closeTooltip();
9852
10481
  }
9853
10482
  }, tooltipOpts.leaveDelay);
9854
10483
  } else {
9855
- this.closeTooltip();
10484
+ $xeTable.closeTooltip();
9856
10485
  }
9857
10486
  },
9858
10487
  triggerHeaderTitleEvent(evnt, iconParams, params) {
10488
+ const $xeTable = this;
10489
+ const reactData = $xeTable;
9859
10490
  const tipContent = iconParams.content || iconParams.message;
9860
10491
  if (tipContent) {
9861
10492
  const {
9862
- $refs,
9863
10493
  tooltipStore
9864
- } = this;
10494
+ } = reactData;
9865
10495
  const {
9866
10496
  column
9867
10497
  } = params;
9868
10498
  const content = getFuncText(tipContent);
9869
- this.handleTargetEnterEvent(true);
10499
+ handleTargetEnterEvent($xeTable, true);
9870
10500
  tooltipStore.row = null;
9871
10501
  tooltipStore.column = column;
9872
10502
  tooltipStore.visible = true;
9873
10503
  tooltipStore.currOpts = iconParams;
9874
- this.$nextTick(() => {
9875
- const $tooltip = $refs.tooltip;
9876
- if ($tooltip) {
10504
+ $xeTable.$nextTick(() => {
10505
+ const $tooltip = $xeTable.$refs.refTooltip;
10506
+ if ($tooltip && $tooltip.open) {
9877
10507
  $tooltip.open(evnt.currentTarget, content);
9878
10508
  }
9879
10509
  });
@@ -9883,28 +10513,48 @@ const Methods = {
9883
10513
  * 触发表头 tooltip 事件
9884
10514
  */
9885
10515
  triggerHeaderTooltipEvent(evnt, params) {
10516
+ const $xeTable = this;
10517
+ const reactData = $xeTable;
9886
10518
  const {
9887
10519
  tooltipStore
9888
- } = this;
10520
+ } = reactData;
9889
10521
  const {
9890
10522
  column
9891
10523
  } = params;
10524
+ handleTargetEnterEvent($xeTable, true);
9892
10525
  const titleElem = evnt.currentTarget;
9893
- this.handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row);
10526
+ if (!titleElem) {
10527
+ return;
10528
+ }
10529
+ const cellEl = titleElem.parentElement;
10530
+ if (!cellEl) {
10531
+ return;
10532
+ }
10533
+ const thEl = cellEl.parentElement;
10534
+ if (!thEl) {
10535
+ return;
10536
+ }
9894
10537
  if (tooltipStore.column !== column || !tooltipStore.visible) {
9895
- this.handleTooltip(evnt, titleElem, titleElem, null, params);
10538
+ handleTooltip($xeTable, evnt, thEl, cellEl, null, params);
9896
10539
  }
9897
10540
  },
9898
10541
  /**
9899
10542
  * 触发单元格 tooltip 事件
9900
10543
  */
9901
10544
  triggerBodyTooltipEvent(evnt, params) {
10545
+ const $xeTable = this;
10546
+ const props = $xeTable;
10547
+ const reactData = $xeTable;
10548
+ const {
10549
+ editConfig
10550
+ } = props;
10551
+ const {
10552
+ editStore
10553
+ } = reactData;
9902
10554
  const {
9903
- editConfig,
9904
- editOpts,
9905
- editStore,
9906
10555
  tooltipStore
9907
- } = this;
10556
+ } = reactData;
10557
+ const editOpts = $xeTable.computeEditOpts;
9908
10558
  const {
9909
10559
  actived
9910
10560
  } = editStore;
@@ -9912,8 +10562,8 @@ const Methods = {
9912
10562
  row,
9913
10563
  column
9914
10564
  } = params;
9915
- const cell = evnt.currentTarget;
9916
- this.handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row !== row);
10565
+ const tdEl = evnt.currentTarget;
10566
+ handleTargetEnterEvent($xeTable, tooltipStore.column !== column || tooltipStore.row !== row);
9917
10567
  // 单元格处于编辑状态时不触发提示框
9918
10568
  if (column.editRender && isEnableConf(editConfig)) {
9919
10569
  // 如果是行编辑模式
@@ -9926,80 +10576,26 @@ const Methods = {
9926
10576
  }
9927
10577
  }
9928
10578
  if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
9929
- let overflowElem;
9930
- let tipElem;
9931
- if (column.treeNode) {
9932
- overflowElem = cell.querySelector('.vxe-tree-cell');
9933
- if (column.type === 'html') {
9934
- tipElem = cell.querySelector('.vxe-cell--html');
9935
- }
9936
- } else {
9937
- tipElem = cell.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
9938
- }
9939
- this.handleTooltip(evnt, cell, overflowElem || cell.children[0], tipElem, params);
10579
+ handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), null, params);
9940
10580
  }
9941
10581
  },
9942
10582
  /**
9943
10583
  * 触发表尾 tooltip 事件
9944
10584
  */
9945
10585
  triggerFooterTooltipEvent(evnt, params) {
10586
+ const $xeTable = this;
10587
+ const reactData = $xeTable;
9946
10588
  const {
9947
10589
  column
9948
10590
  } = params;
9949
10591
  const {
9950
10592
  tooltipStore
9951
- } = this;
10593
+ } = reactData;
9952
10594
  const cell = evnt.currentTarget;
9953
- this.handleTargetEnterEvent(true);
10595
+ handleTargetEnterEvent($xeTable, tooltipStore.column !== column || !!tooltipStore.row);
9954
10596
  if (tooltipStore.column !== column || !tooltipStore.visible) {
9955
- this.handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--item') || cell.children[0], null, params);
9956
- }
9957
- },
9958
- /**
9959
- * 处理显示 tooltip
9960
- * @param {Event} evnt 事件
9961
- * @param {ColumnInfo} column 列配置
9962
- * @param {Row} row 行对象
9963
- */
9964
- handleTooltip(evnt, cell, overflowElem, tipElem, params) {
9965
- const $xeTable = this;
9966
- if (!overflowElem) {
9967
- return $xeTable.$nextTick();
9968
- }
9969
- params.cell = cell;
9970
- const {
9971
- $refs,
9972
- tooltipOpts,
9973
- tooltipStore
9974
- } = this;
9975
- const {
9976
- column,
9977
- row
9978
- } = params;
9979
- const {
9980
- showAll,
9981
- enabled,
9982
- contentMethod
9983
- } = tooltipOpts;
9984
- const customContent = contentMethod ? contentMethod(params) : null;
9985
- const useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContent);
9986
- const content = useCustom ? customContent : (column.type === 'html' ? overflowElem.innerText : overflowElem.textContent).trim();
9987
- const isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
9988
- if (content && (showAll || enabled || useCustom || isCellOverflow)) {
9989
- Object.assign(tooltipStore, {
9990
- row,
9991
- column,
9992
- visible: true,
9993
- currOpts: {}
9994
- });
9995
- this.$nextTick(() => {
9996
- const $tooltip = $refs.tooltip;
9997
- if ($tooltip) {
9998
- $tooltip.open(isCellOverflow ? overflowElem : tipElem || overflowElem, formatText(content));
9999
- }
10000
- });
10597
+ handleTooltip($xeTable, evnt, cell, cell.querySelector('.vxe-cell--wrapper') || cell.children[0], null, params);
10001
10598
  }
10002
- return this.$nextTick();
10003
10599
  },
10004
10600
  openTooltip(target, content) {
10005
10601
  const {
@@ -10015,12 +10611,13 @@ const Methods = {
10015
10611
  * 关闭 tooltip
10016
10612
  */
10017
10613
  closeTooltip() {
10614
+ const $xeTable = this;
10615
+ const reactData = $xeTable;
10018
10616
  const {
10019
- $refs,
10020
10617
  tooltipStore
10021
- } = this;
10022
- const tooltip = $refs.tooltip;
10023
- const commTip = $refs.refCommTooltip;
10618
+ } = reactData;
10619
+ const tooltip = $xeTable.$refs.refTooltip;
10620
+ const commTip = $xeTable.$refs.refCommTooltip;
10024
10621
  if (tooltipStore.visible) {
10025
10622
  Object.assign(tooltipStore, {
10026
10623
  row: null,
@@ -11243,10 +11840,13 @@ const Methods = {
11243
11840
  this.hoverRow = null;
11244
11841
  },
11245
11842
  triggerHeaderCellClickEvent(evnt, params) {
11843
+ const $xeTable = this;
11844
+ const internalData = $xeTable;
11246
11845
  const {
11247
- _lastResizeTime,
11248
- sortOpts
11249
- } = this;
11846
+ _lastResizeTime
11847
+ } = internalData;
11848
+ const sortOpts = $xeTable.computeSortOpts;
11849
+ const columnOpts = $xeTable.computeColumnOpts;
11250
11850
  const {
11251
11851
  column
11252
11852
  } = params;
@@ -11255,18 +11855,18 @@ const Methods = {
11255
11855
  const triggerSort = getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
11256
11856
  const triggerFilter = getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
11257
11857
  if (sortOpts.trigger === 'cell' && !(triggerResizable || triggerSort || triggerFilter)) {
11258
- this.triggerSortEvent(evnt, column, getNextSortOrder(this, column));
11858
+ $xeTable.triggerSortEvent(evnt, column, getNextSortOrder($xeTable, column));
11259
11859
  }
11260
- this.emitEvent('header-cell-click', Object.assign({
11860
+ $xeTable.dispatchEvent('header-cell-click', Object.assign({
11261
11861
  triggerResizable,
11262
11862
  triggerSort,
11263
11863
  triggerFilter,
11264
11864
  cell
11265
11865
  }, params), evnt);
11266
- if (this.columnOpts.isCurrent || this.highlightCurrentColumn) {
11267
- this.triggerCurrentColumnEvent(evnt, params);
11866
+ if (columnOpts.isCurrent || $xeTable.highlightCurrentColumn) {
11867
+ $xeTable.triggerCurrentColumnEvent(evnt, params);
11268
11868
  }
11269
- return this.$nextTick();
11869
+ return $xeTable.$nextTick();
11270
11870
  },
11271
11871
  triggerHeaderCellDblclickEvent(evnt, params) {
11272
11872
  this.emitEvent('header-cell-dblclick', Object.assign({
@@ -11318,18 +11918,26 @@ const Methods = {
11318
11918
  */
11319
11919
  triggerCellClickEvent(evnt, params) {
11320
11920
  const $xeTable = this;
11921
+ const props = $xeTable;
11922
+ const reactData = $xeTable;
11321
11923
  const {
11322
11924
  highlightCurrentRow,
11925
+ editConfig
11926
+ } = props;
11927
+ const {
11323
11928
  editStore,
11324
- radioOpts,
11325
- expandOpts,
11326
- treeOpts,
11327
- keyboardOpts,
11328
- editConfig,
11329
- editOpts,
11330
- checkboxOpts,
11331
- rowOpts
11332
- } = this;
11929
+ isDragResize
11930
+ } = reactData;
11931
+ if (isDragResize) {
11932
+ return;
11933
+ }
11934
+ const expandOpts = $xeTable.computeExpandOpts;
11935
+ const editOpts = $xeTable.computeEditOpts;
11936
+ const treeOpts = $xeTable.computeTreeOpts;
11937
+ const radioOpts = $xeTable.computeRadioOpts;
11938
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
11939
+ const keyboardOpts = $xeTable.computeKeyboardOpts;
11940
+ const rowOpts = $xeTable.computeRowOpts;
11333
11941
  const {
11334
11942
  actived,
11335
11943
  focused
@@ -11428,11 +12036,20 @@ const Methods = {
11428
12036
  * 如果是双击模式,则激活为编辑状态
11429
12037
  */
11430
12038
  triggerCellDblclickEvent(evnt, params) {
12039
+ const $xeTable = this;
12040
+ const props = $xeTable;
12041
+ const reactData = $xeTable;
12042
+ const {
12043
+ editConfig
12044
+ } = props;
11431
12045
  const {
11432
12046
  editStore,
11433
- editConfig,
11434
- editOpts
11435
- } = this;
12047
+ isDragResize
12048
+ } = reactData;
12049
+ if (isDragResize) {
12050
+ return;
12051
+ }
12052
+ const editOpts = $xeTable.computeEditOpts;
11436
12053
  const {
11437
12054
  actived
11438
12055
  } = editStore;
@@ -11520,6 +12137,10 @@ const Methods = {
11520
12137
  triggerSortEvent(evnt, column, order) {
11521
12138
  const $xeTable = this;
11522
12139
  const sortOpts = $xeTable.computeSortOpts;
12140
+ const {
12141
+ multiple,
12142
+ allowClear
12143
+ } = sortOpts;
11523
12144
  const {
11524
12145
  field,
11525
12146
  sortable,
@@ -11527,7 +12148,9 @@ const Methods = {
11527
12148
  } = column;
11528
12149
  if (sortable || remoteSort) {
11529
12150
  if (!order || column.order === order) {
11530
- $xeTable.clearSort(sortOpts.multiple ? column : null);
12151
+ if (allowClear) {
12152
+ $xeTable.clearSort(multiple ? column : null);
12153
+ }
11531
12154
  } else {
11532
12155
  $xeTable.sort({
11533
12156
  field,
@@ -11662,7 +12285,8 @@ const Methods = {
11662
12285
  isPeerDrag,
11663
12286
  isCrossDrag,
11664
12287
  isSelfToChildDrag,
11665
- dragEndMethod
12288
+ dragEndMethod,
12289
+ dragToChildMethod
11666
12290
  } = rowDragOpts;
11667
12291
  const treeOpts = $xeTable.computeTreeOpts;
11668
12292
  const {
@@ -11681,13 +12305,15 @@ const Methods = {
11681
12305
  if (prevDragRow && dragRow) {
11682
12306
  // 判断是否有拖动
11683
12307
  if (prevDragRow !== dragRow) {
11684
- return Promise.resolve(dEndMethod ? dEndMethod({
12308
+ const dragParams = {
11685
12309
  oldRow: dragRow,
11686
12310
  newRow: prevDragRow,
11687
12311
  dragPos: prevDragPos,
11688
12312
  dragToChild: !!prevDragToChild,
11689
12313
  offsetIndex: dragOffsetIndex
11690
- }) : true).then(status => {
12314
+ };
12315
+ const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
12316
+ return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
11691
12317
  if (!status) {
11692
12318
  return;
11693
12319
  }
@@ -11765,7 +12391,9 @@ const Methods = {
11765
12391
  // 根到根
11766
12392
  }
11767
12393
  const fullList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(internalData.afterTreeFullData, {
11768
- children: childrenField
12394
+ key: rowField,
12395
+ parentKey: parentField,
12396
+ children: mapChildrenField
11769
12397
  });
11770
12398
  // 移出
11771
12399
  const otfIndex = $xeTable.findRowIndexOf(fullList, dragRow);
@@ -11780,12 +12408,12 @@ const Methods = {
11780
12408
  childRow[parentField] = dragRow[parentField];
11781
12409
  });
11782
12410
  }
11783
- dragRow[parentField] = prevDragToChild ? prevDragRow[rowField] : prevDragRow[parentField];
12411
+ dragRow[parentField] = isDragToChildFlag ? prevDragRow[rowField] : prevDragRow[parentField];
11784
12412
  internalData.tableFullTreeData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullList, {
11785
- key: treeOpts.rowField,
11786
- parentKey: treeOpts.parentField,
12413
+ key: rowField,
12414
+ parentKey: parentField,
11787
12415
  children: childrenField,
11788
- mapChildren: treeOpts.mapChildrenField
12416
+ mapChildren: mapChildrenField
11789
12417
  });
11790
12418
  }
11791
12419
  }
@@ -11805,7 +12433,7 @@ const Methods = {
11805
12433
  }
11806
12434
  reactData.isDragRowMove = true;
11807
12435
  $xeTable.handleTableData(treeConfig && transform);
11808
- $xeTable.cacheRowMap();
12436
+ $xeTable.cacheRowMap(false);
11809
12437
  updateScrollYStatus($xeTable);
11810
12438
  if (!(treeConfig && transform)) {
11811
12439
  updateAfterDataIndex($xeTable);
@@ -11822,7 +12450,7 @@ const Methods = {
11822
12450
  oldRow: dragRow,
11823
12451
  newRow: prevDragRow,
11824
12452
  dragPos: prevDragPos,
11825
- dragToChild: !!prevDragToChild,
12453
+ dragToChild: isDragToChildFlag,
11826
12454
  offsetIndex: dragOffsetIndex,
11827
12455
  _index: {
11828
12456
  newIndex: nafIndex,
@@ -11858,18 +12486,16 @@ const Methods = {
11858
12486
  prevDragRow,
11859
12487
  prevDragPos
11860
12488
  } = internalData;
11861
- if (treeConfig && prevDragToChild) {
12489
+ if (treeConfig && lazy && prevDragToChild) {
11862
12490
  // 懒加载
11863
- if (lazy) {
11864
- const newRowid = getRowid($xeTable, prevDragRow);
11865
- const rowRest = fullAllDataRowIdData[newRowid];
11866
- if (prevDragRow[hasChildField]) {
11867
- if (rowRest && rowRest.treeLoaded) {
11868
- $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
11869
- }
11870
- } else {
12491
+ const newRowid = getRowid($xeTable, prevDragRow);
12492
+ const rowRest = fullAllDataRowIdData[newRowid];
12493
+ if (prevDragRow[hasChildField]) {
12494
+ if (rowRest && rowRest.treeLoaded) {
11871
12495
  $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
11872
12496
  }
12497
+ } else {
12498
+ $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
11873
12499
  }
11874
12500
  } else {
11875
12501
  $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
@@ -12013,7 +12639,8 @@ const Methods = {
12013
12639
  isCrossDrag,
12014
12640
  isSelfToChildDrag,
12015
12641
  isToChildDrag,
12016
- dragEndMethod
12642
+ dragEndMethod,
12643
+ dragToChildMethod
12017
12644
  } = columnDragOpts;
12018
12645
  const {
12019
12646
  collectColumn
@@ -12024,13 +12651,15 @@ const Methods = {
12024
12651
  if (prevDragCol !== dragCol) {
12025
12652
  const oldColumn = dragCol;
12026
12653
  const newColumn = prevDragCol;
12027
- return Promise.resolve(dragEndMethod ? dragEndMethod({
12654
+ const dragParams = {
12028
12655
  oldColumn,
12029
12656
  newColumn,
12030
12657
  dragPos: prevDragPos,
12031
12658
  dragToChild: !!prevDragToChild,
12032
12659
  offsetIndex: dragOffsetIndex
12033
- }) : true).then(status => {
12660
+ };
12661
+ const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
12662
+ return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
12034
12663
  if (!status) {
12035
12664
  return;
12036
12665
  }
@@ -12126,7 +12755,7 @@ const Methods = {
12126
12755
  parent: nParent
12127
12756
  } = newMatchRest;
12128
12757
  // 转子级
12129
- if (isCrossDrag && isToChildDrag && prevDragToChild) {
12758
+ if (isCrossDrag && isToChildDrag && isDragToChildFlag) {
12130
12759
  oldColumn.parentId = newColumn.id;
12131
12760
  newColumn.children = (newColumn.children || []).concat([oldColumn]);
12132
12761
  } else {
@@ -12157,7 +12786,7 @@ const Methods = {
12157
12786
  oldColumn,
12158
12787
  newColumn,
12159
12788
  dragPos: prevDragPos,
12160
- dragToChild: !!prevDragToChild,
12789
+ dragToChild: isDragToChildFlag,
12161
12790
  offsetIndex: dragOffsetIndex,
12162
12791
  _index: {
12163
12792
  newIndex: nafIndex,
@@ -13421,17 +14050,22 @@ const Methods = {
13421
14050
  * 获取表格的滚动状态
13422
14051
  */
13423
14052
  getScroll() {
14053
+ const $xeTable = this;
14054
+ const reactData = $xeTable;
14055
+ const internalData = $xeTable;
13424
14056
  const {
13425
- $refs,
13426
14057
  scrollXLoad,
13427
14058
  scrollYLoad
13428
- } = this;
13429
- const bodyElem = $refs.refTableBody.$el;
14059
+ } = reactData;
14060
+ const {
14061
+ elemStore
14062
+ } = internalData;
14063
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
13430
14064
  return {
13431
14065
  virtualX: scrollXLoad,
13432
14066
  virtualY: scrollYLoad,
13433
- scrollTop: bodyElem.scrollTop,
13434
- scrollLeft: bodyElem.scrollLeft
14067
+ scrollTop: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
14068
+ scrollLeft: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
13435
14069
  };
13436
14070
  },
13437
14071
  handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
@@ -13540,60 +14174,6 @@ const Methods = {
13540
14174
  }
13541
14175
  $xeTable.dispatchEvent('scroll', evntParams, evnt);
13542
14176
  },
13543
- lazyScrollXData() {
13544
- const $xeTable = this;
13545
- const internalData = $xeTable;
13546
- const {
13547
- lxTimeout,
13548
- lxRunTime,
13549
- scrollXStore
13550
- } = internalData;
13551
- const {
13552
- visibleSize
13553
- } = scrollXStore;
13554
- const fpsTime = Math.max(5, Math.min(80, Math.floor(visibleSize * 3)));
13555
- if (lxTimeout) {
13556
- clearTimeout(lxTimeout);
13557
- }
13558
- if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
13559
- internalData.lxRunTime = Date.now();
13560
- loadScrollXData($xeTable);
13561
- }
13562
- internalData.lxTimeout = setTimeout(() => {
13563
- internalData.lxTimeout = undefined;
13564
- internalData.lxRunTime = undefined;
13565
- loadScrollXData($xeTable);
13566
- }, fpsTime);
13567
- },
13568
- lazyScrollYData() {
13569
- const $xeTable = this;
13570
- const props = $xeTable;
13571
- const internalData = $xeTable;
13572
- const {
13573
- showOverflow
13574
- } = props;
13575
- const {
13576
- lyTimeout,
13577
- lyRunTime,
13578
- scrollYStore
13579
- } = internalData;
13580
- const {
13581
- visibleSize
13582
- } = scrollYStore;
13583
- const fpsTime = showOverflow ? 5 : Math.max(5, Math.min(80, Math.floor(visibleSize / 2)));
13584
- if (lyTimeout) {
13585
- clearTimeout(lyTimeout);
13586
- }
13587
- if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
13588
- internalData.lyRunTime = Date.now();
13589
- loadScrollYData($xeTable);
13590
- }
13591
- internalData.lyTimeout = setTimeout(() => {
13592
- internalData.lyTimeout = undefined;
13593
- internalData.lyRunTime = undefined;
13594
- loadScrollYData($xeTable);
13595
- }, fpsTime);
13596
- },
13597
14177
  /**
13598
14178
  * 横向 X 可视渲染事件处理
13599
14179
  */
@@ -13603,7 +14183,7 @@ const Methods = {
13603
14183
  if (sXOpts.immediate) {
13604
14184
  loadScrollXData($xeTable);
13605
14185
  } else {
13606
- $xeTable.lazyScrollXData();
14186
+ lazyScrollXData($xeTable);
13607
14187
  }
13608
14188
  },
13609
14189
  /**
@@ -13615,7 +14195,7 @@ const Methods = {
13615
14195
  if (sYOpts.immediate) {
13616
14196
  loadScrollYData($xeTable);
13617
14197
  } else {
13618
- $xeTable.lazyScrollYData();
14198
+ lazyScrollYData($xeTable);
13619
14199
  }
13620
14200
  },
13621
14201
  triggerBodyScrollEvent(evnt, fixedType) {
@@ -13623,6 +14203,7 @@ const Methods = {
13623
14203
  const internalData = $xeTable;
13624
14204
  const {
13625
14205
  elemStore,
14206
+ intoRunScroll,
13626
14207
  lastScrollTop,
13627
14208
  lastScrollLeft,
13628
14209
  inWheelScroll,
@@ -13642,6 +14223,9 @@ const Methods = {
13642
14223
  if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
13643
14224
  return;
13644
14225
  }
14226
+ if (intoRunScroll) {
14227
+ return;
14228
+ }
13645
14229
  if (!bodyScrollElem) {
13646
14230
  return;
13647
14231
  }
@@ -13700,6 +14284,7 @@ const Methods = {
13700
14284
  const internalData = $xeTable;
13701
14285
  const {
13702
14286
  elemStore,
14287
+ intoRunScroll,
13703
14288
  inWheelScroll,
13704
14289
  inVirtualScroll,
13705
14290
  inBodyScroll,
@@ -13710,16 +14295,10 @@ const Methods = {
13710
14295
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
13711
14296
  const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
13712
14297
  const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
13713
- if (inWheelScroll) {
13714
- return;
13715
- }
13716
- if (inVirtualScroll) {
14298
+ if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
13717
14299
  return;
13718
14300
  }
13719
- if (inBodyScroll) {
13720
- return;
13721
- }
13722
- if (inFooterScroll) {
14301
+ if (intoRunScroll) {
13723
14302
  return;
13724
14303
  }
13725
14304
  if (!headerScrollElem) {
@@ -13750,6 +14329,7 @@ const Methods = {
13750
14329
  const internalData = $xeTable;
13751
14330
  const {
13752
14331
  elemStore,
14332
+ intoRunScroll,
13753
14333
  inWheelScroll,
13754
14334
  inVirtualScroll,
13755
14335
  inHeaderScroll,
@@ -13760,16 +14340,10 @@ const Methods = {
13760
14340
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
13761
14341
  const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
13762
14342
  const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
13763
- if (inWheelScroll) {
14343
+ if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
13764
14344
  return;
13765
14345
  }
13766
- if (inVirtualScroll) {
13767
- return;
13768
- }
13769
- if (inHeaderScroll) {
13770
- return;
13771
- }
13772
- if (inBodyScroll) {
14346
+ if (intoRunScroll) {
13773
14347
  return;
13774
14348
  }
13775
14349
  if (!footerScrollElem) {
@@ -13801,9 +14375,13 @@ const Methods = {
13801
14375
  const reactData = $xeTable;
13802
14376
  const internalData = $xeTable;
13803
14377
  const {
14378
+ target,
13804
14379
  deltaY,
13805
14380
  deltaX
13806
14381
  } = evnt;
14382
+ if (target && /^textarea$/i.test(target.tagName)) {
14383
+ return;
14384
+ }
13807
14385
  const {
13808
14386
  highlightHoverRow
13809
14387
  } = tableProps;
@@ -13827,26 +14405,13 @@ const Methods = {
13827
14405
  if (!bodyScrollElem) {
13828
14406
  return;
13829
14407
  }
13830
- let multiple = 1;
13831
- if (reactData.lastScrollTime + 25 > Date.now()) {
13832
- multiple = 1.18;
13833
- } else if (reactData.lastScrollTime + 30 > Date.now()) {
13834
- multiple = 1.15;
13835
- } else if (reactData.lastScrollTime + 40 > Date.now()) {
13836
- multiple = 1.12;
13837
- } else if (reactData.lastScrollTime + 55 > Date.now()) {
13838
- multiple = 1.09;
13839
- } else if (reactData.lastScrollTime + 75 > Date.now()) {
13840
- multiple = 1.06;
13841
- } else if (reactData.lastScrollTime + 100 > Date.now()) {
13842
- multiple = 1.03;
13843
- }
13844
- const deltaTop = deltaY * multiple;
13845
- const deltaLeft = deltaX * multiple;
14408
+ const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
14409
+ const deltaTop = deltaY * wheelSpeed;
14410
+ const deltaLeft = deltaX * wheelSpeed;
13846
14411
  const isTopWheel = deltaTop < 0;
13847
- const currScrollTop = yHandleEl.scrollTop;
14412
+ const currScrollTop = bodyScrollElem.scrollTop;
13848
14413
  // 如果滚动位置已经是顶部或底部,则不需要触发
13849
- if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= yHandleEl.scrollHeight - yHandleEl.clientHeight) {
14414
+ if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
13850
14415
  return;
13851
14416
  }
13852
14417
  const scrollTop = bodyScrollElem.scrollTop + deltaTop;
@@ -13859,16 +14424,29 @@ const Methods = {
13859
14424
  if (rowOpts.isHover || highlightHoverRow) {
13860
14425
  $xeTable.clearHoverRow();
13861
14426
  }
13862
- internalData.inWheelScroll = true;
13863
- setScrollTop(yHandleEl, scrollTop);
13864
- setScrollTop(bodyScrollElem, scrollTop);
13865
- setScrollTop(leftScrollElem, scrollTop);
13866
- setScrollTop(rightScrollElem, scrollTop);
13867
- $xeTable.triggerScrollYEvent(evnt);
13868
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
13869
- type: 'footer',
13870
- fixed: ''
14427
+ wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
14428
+ const currTopNum = bodyScrollElem.scrollTop + offsetTop;
14429
+ internalData.inWheelScroll = true;
14430
+ setScrollTop(yHandleEl, currTopNum);
14431
+ setScrollTop(bodyScrollElem, currTopNum);
14432
+ setScrollTop(leftScrollElem, currTopNum);
14433
+ setScrollTop(rightScrollElem, currTopNum);
14434
+ $xeTable.triggerScrollYEvent(evnt);
14435
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
14436
+ type: 'table',
14437
+ fixed: ''
14438
+ });
13871
14439
  });
14440
+ // internalData.inWheelScroll = true
14441
+ // setScrollTop(yHandleEl, scrollTop)
14442
+ // setScrollTop(bodyScrollElem, scrollTop)
14443
+ // setScrollTop(leftScrollElem, scrollTop)
14444
+ // setScrollTop(rightScrollElem, scrollTop)
14445
+ // loadScrollYData($xeTable, scrollTop)
14446
+ // $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
14447
+ // type: 'footer',
14448
+ // fixed: ''
14449
+ // })
13872
14450
  }
13873
14451
  },
13874
14452
  triggerVirtualScrollXEvent(evnt) {
@@ -13957,15 +14535,15 @@ const Methods = {
13957
14535
  },
13958
14536
  updateScrollXData() {
13959
14537
  const $xeTable = this;
13960
- const props = $xeTable;
14538
+ const reactData = $xeTable;
13961
14539
  const {
13962
- showOverflow
13963
- } = props;
14540
+ isAllOverflow
14541
+ } = reactData;
13964
14542
  handleTableColumn($xeTable);
13965
14543
  return $xeTable.$nextTick().then(() => {
13966
14544
  handleTableColumn($xeTable);
13967
14545
  $xeTable.updateScrollXSpace();
13968
- if (!showOverflow) {
14546
+ if (!isAllOverflow) {
13969
14547
  $xeTable.updateScrollYSpace();
13970
14548
  }
13971
14549
  });
@@ -14037,49 +14615,46 @@ const Methods = {
14037
14615
  // 更新纵向 Y 可视渲染上下剩余空间大小
14038
14616
  updateScrollYSpace() {
14039
14617
  const $xeTable = this;
14040
- const props = $xeTable;
14041
14618
  const reactData = $xeTable;
14042
14619
  const internalData = $xeTable;
14043
14620
  const {
14044
- showOverflow
14045
- } = props;
14046
- const {
14047
- scrollYLoad,
14048
- rowHeight
14621
+ isAllOverflow,
14622
+ scrollYLoad
14049
14623
  } = reactData;
14050
14624
  const {
14051
14625
  scrollYStore,
14052
14626
  elemStore,
14627
+ isResizeCellHeight,
14053
14628
  afterFullData,
14054
14629
  fullAllDataRowIdData
14055
14630
  } = internalData;
14056
14631
  const {
14057
14632
  startIndex
14058
14633
  } = scrollYStore;
14634
+ const rowOpts = $xeTable.computeRowOpts;
14635
+ const cellOpts = $xeTable.computeCellOpts;
14636
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
14059
14637
  const bodyTableElem = getRefElem(elemStore['main-body-table']);
14060
14638
  const containerList = ['main', 'left', 'right'];
14061
14639
  let topSpaceHeight = 0;
14062
14640
  let ySpaceHeight = 0;
14063
14641
  if (scrollYLoad) {
14064
- if (showOverflow) {
14065
- ySpaceHeight = afterFullData.length * rowHeight;
14066
- topSpaceHeight = Math.max(0, startIndex * rowHeight);
14642
+ const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
14643
+ if (!isCustomCellHeight && isAllOverflow) {
14644
+ ySpaceHeight = afterFullData.length * defaultRowHeight;
14645
+ topSpaceHeight = Math.max(0, startIndex * defaultRowHeight);
14067
14646
  } else {
14068
14647
  for (let i = 0; i < afterFullData.length; i++) {
14069
14648
  const row = afterFullData[i];
14070
14649
  const rowid = getRowid($xeTable, row);
14071
- const rowRest = fullAllDataRowIdData[rowid];
14072
- if (rowRest) {
14073
- ySpaceHeight += rowRest.height || rowHeight;
14074
- }
14650
+ const rowRest = fullAllDataRowIdData[rowid] || {};
14651
+ ySpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
14075
14652
  }
14076
14653
  for (let i = 0; i < startIndex; i++) {
14077
14654
  const row = afterFullData[i];
14078
14655
  const rowid = getRowid($xeTable, row);
14079
- const rowRest = fullAllDataRowIdData[rowid];
14080
- if (rowRest) {
14081
- topSpaceHeight += rowRest.height || rowHeight;
14082
- }
14656
+ const rowRest = fullAllDataRowIdData[rowid] || {};
14657
+ topSpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
14083
14658
  }
14084
14659
  }
14085
14660
  } else {
@@ -14104,7 +14679,7 @@ const Methods = {
14104
14679
  if (scrollYSpaceEl) {
14105
14680
  scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
14106
14681
  }
14107
- $xeTable.$nextTick(() => {
14682
+ return $xeTable.$nextTick().then(() => {
14108
14683
  updateStyle($xeTable);
14109
14684
  });
14110
14685
  },
@@ -14175,12 +14750,9 @@ const Methods = {
14175
14750
  */
14176
14751
  scrollToRow(row, fieldOrColumn) {
14177
14752
  const $xeTable = this;
14178
- const props = $xeTable;
14179
14753
  const reactData = $xeTable;
14180
14754
  const {
14181
- showOverflow
14182
- } = props;
14183
- const {
14755
+ isAllOverflow,
14184
14756
  scrollYLoad,
14185
14757
  scrollXLoad
14186
14758
  } = reactData;
@@ -14197,7 +14769,7 @@ const Methods = {
14197
14769
  }
14198
14770
  return Promise.all(rest).then(() => {
14199
14771
  if (row) {
14200
- if (!showOverflow && (scrollYLoad || scrollXLoad)) {
14772
+ if (!isAllOverflow && (scrollYLoad || scrollXLoad)) {
14201
14773
  calcCellHeight($xeTable);
14202
14774
  calcCellWidth($xeTable);
14203
14775
  }
@@ -14568,11 +15140,11 @@ const isVMScrollProcess = $xeTable => {
14568
15140
  } = tableProps;
14569
15141
  const {
14570
15142
  lastScrollTime,
14571
- _isResize
15143
+ isDragResize
14572
15144
  } = tableReactData;
14573
- return !!(_isResize || lastScrollTime && Date.now() < lastScrollTime + delayHover);
15145
+ return !!(isDragResize || lastScrollTime && Date.now() < lastScrollTime + delayHover);
14574
15146
  };
14575
- function renderLine(h, _vm, params) {
15147
+ function renderLine(h, _vm, params, cellHeight) {
14576
15148
  const $xeTable = _vm.$parent;
14577
15149
  const tableProps = $xeTable;
14578
15150
  const tableInternalData = $xeTable;
@@ -14608,11 +15180,13 @@ function renderLine(h, _vm, params) {
14608
15180
  const isFirstRow = $xeTable.eqRow(afterFullData[0], row);
14609
15181
  if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
14610
15182
  return [h('div', {
15183
+ key: 'tl',
14611
15184
  class: 'vxe-tree--line-wrapper'
14612
15185
  }, [h('div', {
14613
15186
  class: 'vxe-tree--line',
14614
15187
  style: {
14615
15188
  height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
15189
+ bottom: `-${Math.floor(cellHeight / 2)}px`,
14616
15190
  left: `${rLevel * treeOpts.indent + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
14617
15191
  }
14618
15192
  })])];
@@ -14632,8 +15206,9 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14632
15206
  } = tableInternalData;
14633
15207
  const {
14634
15208
  columnKey,
15209
+ resizable: allResizable,
15210
+ border,
14635
15211
  height,
14636
- showOverflow: allColumnOverflow,
14637
15212
  cellClassName: allCellClassName,
14638
15213
  cellStyle,
14639
15214
  align: allAlign,
@@ -14641,7 +15216,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14641
15216
  mouseConfig,
14642
15217
  editConfig,
14643
15218
  editRules,
14644
- tooltipConfig
15219
+ tooltipConfig,
15220
+ padding: allPadding
14645
15221
  } = tableProps;
14646
15222
  const {
14647
15223
  tableData,
@@ -14649,7 +15225,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14649
15225
  currentColumn,
14650
15226
  scrollXLoad,
14651
15227
  scrollYLoad,
14652
- isCalcCellHeight,
15228
+ calcCellHeightFlag,
15229
+ resizeHeightFlag,
14653
15230
  mergeList,
14654
15231
  editStore,
14655
15232
  isAllOverflow,
@@ -14665,9 +15242,15 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14665
15242
  const checkboxOpts = $xeTable.computeCheckboxOpts;
14666
15243
  const editOpts = $xeTable.computeEditOpts;
14667
15244
  const tooltipOpts = $xeTable.computeTooltipOpts;
15245
+ const {
15246
+ isAllColumnDrag,
15247
+ isAllRowDrag
15248
+ } = $xeTable.resizableOpts;
14668
15249
  const rowOpts = $xeTable.computeRowOpts;
14669
15250
  const rowDragOpts = $xeTable.computeRowDragOpts;
14670
15251
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
15252
+ const customCellHeight = cellOpts.height || rowOpts.height;
15253
+ const currCellHeight = customCellHeight || defaultRowHeight;
14671
15254
  const {
14672
15255
  disabledMethod: dragDisabledMethod,
14673
15256
  isCrossDrag,
@@ -14687,17 +15270,18 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14687
15270
  showOverflow,
14688
15271
  className,
14689
15272
  treeNode,
15273
+ rowResize,
15274
+ padding,
15275
+ verticalAlign,
14690
15276
  slots
14691
15277
  } = column;
14692
15278
  const {
14693
- verticalAlign
15279
+ verticalAlign: allVerticalAlign
14694
15280
  } = cellOpts;
14695
15281
  const {
14696
15282
  actived
14697
15283
  } = editStore;
14698
- const {
14699
- height: customRHeight
14700
- } = rowOpts;
15284
+ const rowRest = fullAllDataRowIdData[rowid];
14701
15285
  const colid = column.id;
14702
15286
  const renderOpts = editRender || cellRender;
14703
15287
  const compConf = renderOpts ? body_renderer.get(renderOpts.name) : null;
@@ -14707,23 +15291,27 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14707
15291
  const columnIndex = $xeTable.getColumnIndex(column);
14708
15292
  const _columnIndex = $xeTable.getVTColumnIndex(column);
14709
15293
  const isEdit = isEnableConf(editRender);
15294
+ const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
14710
15295
  let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
14711
- const cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow) ? allColumnOverflow : showOverflow;
15296
+ const isCellPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(padding) ? allPadding === null ? cellOpts.padding : allPadding : padding;
15297
+ const cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showOverflow) ? isAllOverflow : showOverflow;
14712
15298
  const showEllipsis = cellOverflow === 'ellipsis';
14713
15299
  const showTitle = cellOverflow === 'title';
14714
15300
  const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
14715
- // 如果表格加上 showOverflow 则不再支持列单独设置
14716
- const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis;
15301
+ const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
15302
+ const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
15303
+ const isCsHeight = !!customCellHeight;
15304
+ const isRsHeight = resizeHeight > 0;
14717
15305
  let isDirty;
14718
15306
  const tdOns = {};
14719
- const rest = fullAllDataRowIdData[rowid];
14720
15307
  const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
15308
+ const cellVerticalAlign = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
14721
15309
  const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
14722
15310
  const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
14723
- const attrs = {
15311
+ const tdAttrs = {
14724
15312
  colid
14725
15313
  };
14726
- const params = {
15314
+ const cellParams = {
14727
15315
  $table: $xeTable,
14728
15316
  $grid: $xeTable.xegrid,
14729
15317
  isEdit: false,
@@ -14751,7 +15339,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14751
15339
  isRowDragCell = rowDragOpts.trigger === 'row' || column.dragSort && rowDragOpts.trigger === 'cell';
14752
15340
  }
14753
15341
  if (isRowDragCell) {
14754
- isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params));
15342
+ isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
14755
15343
  }
14756
15344
  // hover 进入事件
14757
15345
  if (showTitle || showTooltip || showAllTip || tooltipConfig) {
@@ -14763,11 +15351,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14763
15351
  updateCellTitle(evnt.currentTarget, column);
14764
15352
  } else if (showTooltip || showAllTip) {
14765
15353
  // 如果配置了显示 tooltip
14766
- $xeTable.triggerBodyTooltipEvent(evnt, params);
15354
+ $xeTable.triggerBodyTooltipEvent(evnt, cellParams);
14767
15355
  }
14768
15356
  $xeTable.dispatchEvent('cell-mouseenter', Object.assign({
14769
15357
  cell: evnt.currentTarget
14770
- }, params), evnt);
15358
+ }, cellParams), evnt);
14771
15359
  };
14772
15360
  }
14773
15361
  // hover 退出事件
@@ -14781,13 +15369,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14781
15369
  }
14782
15370
  $xeTable.dispatchEvent('cell-mouseleave', Object.assign({
14783
15371
  cell: evnt.currentTarget
14784
- }, params), evnt);
15372
+ }, cellParams), evnt);
14785
15373
  };
14786
15374
  }
14787
15375
  // 按下事件处理
14788
15376
  if (isRowDragCell || checkboxOpts.range || mouseConfig) {
14789
15377
  tdOns.mousedown = evnt => {
14790
- $xeTable.triggerCellMousedownEvent(evnt, params);
15378
+ $xeTable.triggerCellMousedownEvent(evnt, cellParams);
14791
15379
  };
14792
15380
  }
14793
15381
  // 拖拽列事件
@@ -14796,11 +15384,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14796
15384
  }
14797
15385
  // 点击事件处理
14798
15386
  tdOns.click = evnt => {
14799
- $xeTable.triggerCellClickEvent(evnt, params);
15387
+ $xeTable.triggerCellClickEvent(evnt, cellParams);
14800
15388
  };
14801
15389
  // 双击事件处理
14802
15390
  tdOns.dblclick = evnt => {
14803
- $xeTable.triggerCellDblclickEvent(evnt, params);
15391
+ $xeTable.triggerCellDblclickEvent(evnt, cellParams);
14804
15392
  };
14805
15393
  // 合并行或列
14806
15394
  if (mergeList.length) {
@@ -14814,10 +15402,10 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14814
15402
  return null;
14815
15403
  }
14816
15404
  if (rowspan > 1) {
14817
- attrs.rowspan = rowspan;
15405
+ tdAttrs.rowspan = rowspan;
14818
15406
  }
14819
15407
  if (colspan > 1) {
14820
- attrs.colspan = colspan;
15408
+ tdAttrs.colspan = colspan;
14821
15409
  }
14822
15410
  }
14823
15411
  } else if (spanMethod) {
@@ -14825,20 +15413,20 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14825
15413
  const {
14826
15414
  rowspan = 1,
14827
15415
  colspan = 1
14828
- } = spanMethod(params) || {};
15416
+ } = spanMethod(cellParams) || {};
14829
15417
  if (!rowspan || !colspan) {
14830
15418
  return null;
14831
15419
  }
14832
15420
  if (rowspan > 1) {
14833
- attrs.rowspan = rowspan;
15421
+ tdAttrs.rowspan = rowspan;
14834
15422
  }
14835
15423
  if (colspan > 1) {
14836
- attrs.colspan = colspan;
15424
+ tdAttrs.colspan = colspan;
14837
15425
  }
14838
15426
  }
14839
15427
  // 如果被合并不可隐藏
14840
15428
  if (fixedHiddenColumn && mergeList) {
14841
- if (attrs.colspan > 1 || attrs.rowspan > 1) {
15429
+ if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
14842
15430
  fixedHiddenColumn = false;
14843
15431
  }
14844
15432
  }
@@ -14847,28 +15435,35 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14847
15435
  isDirty = $xeTable.isUpdateByRow(row, column.field);
14848
15436
  }
14849
15437
  const isVNAutoHeight = scrollYLoad && !hasEllipsis;
14850
- let cellHeight = 0;
14851
- const vnHeight = isCalcCellHeight ? rest.height : 0;
14852
- if (hasEllipsis) {
14853
- if (customRHeight) {
14854
- cellHeight = customRHeight;
14855
- } else if (!isAllOverflow) {
14856
- cellHeight = vnHeight || defaultRowHeight || 18;
14857
- }
15438
+ let cellHeight = currCellHeight;
15439
+ const vnHeight = calcCellHeightFlag ? rowRest.height : 0;
15440
+ if (resizeHeight) {
15441
+ cellHeight = resizeHeight;
14858
15442
  } else {
14859
- cellHeight = vnHeight || defaultRowHeight || 18;
15443
+ if (scrollYLoad) {
15444
+ if (!hasEllipsis) {
15445
+ cellHeight = vnHeight || currCellHeight;
15446
+ }
15447
+ }
15448
+ }
15449
+ const isLastColumn = $columnIndex === columns.length - 1;
15450
+ const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
15451
+ let isVNPreEmptyStatus = false;
15452
+ if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
15453
+ isVNPreEmptyStatus = true;
15454
+ } else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
15455
+ isVNPreEmptyStatus = true;
14860
15456
  }
14861
15457
  const tcStyle = {};
14862
- if (cellHeight) {
14863
- if (hasEllipsis) {
14864
- tcStyle.maxHeight = `${cellHeight}px`;
14865
- } else if (isVNAutoHeight) {
14866
- tcStyle.height = `${cellHeight}px`;
14867
- }
15458
+ if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
15459
+ tcStyle.height = `${cellHeight}px`;
15460
+ } else {
15461
+ tcStyle.minHeight = `${cellHeight}px`;
14868
15462
  }
14869
15463
  const tdVNs = [];
14870
- if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
15464
+ if (fixedHiddenColumn && isAllOverflow) {
14871
15465
  tdVNs.push(h('div', {
15466
+ key: 'tc',
14872
15467
  class: ['vxe-cell', {
14873
15468
  'c--title': showTitle,
14874
15469
  'c--tooltip': showTooltip,
@@ -14878,7 +15473,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14878
15473
  }));
14879
15474
  } else {
14880
15475
  // 渲染单元格
14881
- tdVNs.push(...renderLine(h, _vm, params), h('div', {
15476
+ tdVNs.push(...renderLine(h, _vm, cellParams, cellHeight), h('div', {
15477
+ key: 'tc',
14882
15478
  class: ['vxe-cell', {
14883
15479
  'c--title': showTitle,
14884
15480
  'c--tooltip': showTooltip,
@@ -14888,18 +15484,23 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14888
15484
  attrs: {
14889
15485
  title: showTitle ? $xeTable.getCellLabel(row, column) : null
14890
15486
  }
14891
- }, isVNAutoHeight ? [h('div', {
14892
- class: 'vxe-cell--auto-wrapper'
14893
- }, column.renderCell(h, params))] : column.renderCell(h, params)));
15487
+ }, isVNPreEmptyStatus ? [] : [h('div', {
15488
+ attrs: {
15489
+ colid,
15490
+ rowid
15491
+ },
15492
+ class: 'vxe-cell--wrapper'
15493
+ }, column.renderCell(h, cellParams))]));
14894
15494
  if (showValidTip && errorValidItem) {
14895
15495
  const errRule = errorValidItem.rule;
14896
15496
  const validSlot = slots ? slots.valid : null;
14897
15497
  const validParams = {
14898
- ...params,
15498
+ ...cellParams,
14899
15499
  ...errorValidItem,
14900
15500
  rule: errorValidItem
14901
15501
  };
14902
15502
  tdVNs.push(h('div', {
15503
+ key: 'tcv',
14903
15504
  class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
14904
15505
  style: errRule && errRule.maxWidth ? {
14905
15506
  width: `${errRule.maxWidth}px`
@@ -14911,47 +15512,59 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14911
15512
  }, errorValidItem.content)]])]));
14912
15513
  }
14913
15514
  }
15515
+ let showAreaRowStatus = false;
14914
15516
  if (mouseConfig && mouseOpts.area && selectCellToRow) {
14915
- if (!$columnIndex && selectCellToRow === true || selectCellToRow === column.field) {
14916
- tdVNs.push(h('div', {
14917
- class: 'vxe-cell--area-status'
14918
- }));
15517
+ if (!_columnIndex && selectCellToRow === true || selectCellToRow === column.field) {
15518
+ showAreaRowStatus = true;
14919
15519
  }
14920
15520
  }
14921
- const isLastColumn = $columnIndex === columns.length - 1;
14922
- const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
14923
- let isVNPreEmptyStatus = false;
14924
- if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
14925
- isVNPreEmptyStatus = true;
14926
- } else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
14927
- isVNPreEmptyStatus = true;
15521
+ if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
15522
+ tdVNs.push(h('div', {
15523
+ key: 'tcc',
15524
+ class: ['vxe-cell--col-resizable', {
15525
+ 'is--line': !border || border === 'none'
15526
+ }],
15527
+ on: {
15528
+ mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
15529
+ dblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
15530
+ }
15531
+ }));
15532
+ }
15533
+ if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
15534
+ tdVNs.push(h('div', {
15535
+ key: 'tcr',
15536
+ class: 'vxe-cell--row-resizable',
15537
+ on: {
15538
+ mousedown: evnt => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
15539
+ dblclick: evnt => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
15540
+ }
15541
+ }));
14928
15542
  }
14929
15543
  return h('td', {
14930
- class: ['vxe-body--column', column.id, {
14931
- [`col--${cellAlign}`]: cellAlign,
14932
- [`col--vertical-${verticalAlign}`]: verticalAlign,
14933
- [`col--${type}`]: type,
15544
+ class: ['vxe-body--column', colid, cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '', cellAlign ? `col--${cellAlign}` : '', type ? `col--${type}` : '', {
14934
15545
  'col--last': isLastColumn,
14935
15546
  'col--tree-node': treeNode,
14936
15547
  'col--edit': isEdit,
14937
15548
  'col--ellipsis': hasEllipsis,
15549
+ 'col--cs-height': isCsHeight,
15550
+ 'col--rs-height': isRsHeight,
15551
+ 'col--to-row': showAreaRowStatus,
14938
15552
  'col--auto-height': isVNAutoHeight,
14939
15553
  'fixed--width': !isAutoCellWidth,
14940
15554
  'fixed--hidden': fixedHiddenColumn,
15555
+ 'is--padding': isCellPadding,
14941
15556
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
14942
15557
  'is--drag-disabled': isDisabledDrag,
14943
15558
  'col--dirty': isDirty,
14944
15559
  'col--active': editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row'),
14945
15560
  'col--valid-error': !!errorValidItem,
14946
15561
  'col--current': currentColumn === column
14947
- }, getClass(compCellClassName, params), getClass(className, params), getClass(allCellClassName, params)],
15562
+ }, getClass(compCellClassName, cellParams), getClass(className, cellParams), getClass(allCellClassName, cellParams)],
14948
15563
  key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
14949
- attrs,
14950
- style: Object.assign({
14951
- height: cellHeight ? `${cellHeight}px` : ''
14952
- }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cellStyle) ? cellStyle(params) : cellStyle),
15564
+ attrs: tdAttrs,
15565
+ style: Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
14953
15566
  on: tdOns
14954
- }, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
15567
+ }, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
14955
15568
  }
14956
15569
  function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
14957
15570
  const $xeTable = _vm.$parent;
@@ -14964,15 +15577,16 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
14964
15577
  highlightHoverRow,
14965
15578
  rowClassName,
14966
15579
  rowStyle,
14967
- showOverflow: allColumnOverflow,
14968
15580
  editConfig,
14969
15581
  treeConfig
14970
15582
  } = tableProps;
14971
15583
  const {
14972
15584
  hasFixedColumn,
14973
15585
  treeExpandedMaps,
15586
+ isColLoading,
14974
15587
  scrollXLoad,
14975
15588
  scrollYLoad,
15589
+ isAllOverflow,
14976
15590
  rowExpandedMaps,
14977
15591
  expandColumn,
14978
15592
  selectRadioRow,
@@ -15077,7 +15691,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15077
15691
  const tdVNs = tableColumn.map((column, $columnIndex) => {
15078
15692
  return renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
15079
15693
  });
15080
- rows.push(columnOpts.drag && columnDragOpts.animation ? h('transition-group', {
15694
+ rows.push(!isColLoading && columnOpts.drag && columnDragOpts.animation ? h('transition-group', {
15081
15695
  props: {
15082
15696
  tag: 'tr',
15083
15697
  name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`
@@ -15115,7 +15729,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15115
15729
  const {
15116
15730
  showOverflow
15117
15731
  } = expandColumn;
15118
- const hasEllipsis = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow) ? allColumnOverflow : showOverflow;
15732
+ const hasEllipsis = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow) ? isAllOverflow : showOverflow;
15119
15733
  const expandParams = {
15120
15734
  $table: $xeTable,
15121
15735
  seq,
@@ -15227,7 +15841,6 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15227
15841
  tableColumn
15228
15842
  } = props;
15229
15843
  const {
15230
- showOverflow: allColumnOverflow,
15231
15844
  spanMethod,
15232
15845
  footerSpanMethod,
15233
15846
  mouseConfig
@@ -15235,6 +15848,8 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15235
15848
  const {
15236
15849
  isGroup,
15237
15850
  tableData,
15851
+ isRowLoading,
15852
+ isColLoading,
15238
15853
  scrollXLoad,
15239
15854
  scrollYLoad,
15240
15855
  isAllOverflow,
@@ -15258,7 +15873,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15258
15873
  let renderColumnList = tableColumn;
15259
15874
  let isOptimizeMode = false;
15260
15875
  // 如果是使用优化模式
15261
- if (scrollXLoad || scrollYLoad || allColumnOverflow && isAllOverflow) {
15876
+ if (scrollXLoad || scrollYLoad || isAllOverflow) {
15262
15877
  if (expandColumn || spanMethod || footerSpanMethod) {
15263
15878
  // 如果不支持优化模式
15264
15879
  } else {
@@ -15382,9 +15997,9 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15382
15997
  });
15383
15998
  })),
15384
15999
  /**
15385
- * 内容
15386
- */
15387
- rowOpts.drag && rowDragOpts.animation ? h('transition-group', {
16000
+ * 内容
16001
+ */
16002
+ !(isRowLoading || isColLoading) && rowOpts.drag && rowDragOpts.animation ? h('transition-group', {
15388
16003
  ref: 'refBodyTBody',
15389
16004
  props: {
15390
16005
  tag: 'tbody',
@@ -15419,6 +16034,8 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15419
16034
  class: 'vxe-table--cell-multi-area'
15420
16035
  }), h('span', {
15421
16036
  class: 'vxe-table--cell-active-area'
16037
+ }), h('span', {
16038
+ class: 'vxe-table--cell-row-status-area'
15422
16039
  })]) : body_renderEmptyElement($xeTable), !fixedType ? h('div', {
15423
16040
  class: 'vxe-table--empty-block',
15424
16041
  ref: 'emptyBlock'
@@ -15432,9 +16049,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15432
16049
 
15433
16050
 
15434
16051
 
15435
-
15436
16052
  const {
15437
- getI18n: header_getI18n,
15438
16053
  renderer: header_renderer,
15439
16054
  renderEmptyElement: header_renderEmptyElement
15440
16055
  } = core_.VxeUI;
@@ -15471,6 +16086,10 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15471
16086
  } = tableInternalData;
15472
16087
  const columnOpts = $xeTable.computeColumnOpts;
15473
16088
  const columnDragOpts = $xeTable.computeColumnDragOpts;
16089
+ const cellOpts = $xeTable.computeCellOpts;
16090
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
16091
+ const headerCellOpts = $xeTable.computeHeaderCellOpts;
16092
+ const currCellHeight = getCellHeight(headerCellOpts.height || cellOpts.height) || defaultRowHeight;
15474
16093
  const {
15475
16094
  disabledMethod: dragDisabledMethod,
15476
16095
  isCrossDrag,
@@ -15493,6 +16112,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15493
16112
  const compConf = renderOpts ? header_renderer.get(renderOpts.name) : null;
15494
16113
  const isColGroup = column.children && column.children.length;
15495
16114
  const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
16115
+ const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding;
15496
16116
  const headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
15497
16117
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
15498
16118
  let showEllipsis = headOverflow === 'ellipsis';
@@ -15507,7 +16127,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15507
16127
  }
15508
16128
  const columnIndex = $xeTable.getColumnIndex(column);
15509
16129
  const _columnIndex = $xeTable.getVTColumnIndex(column);
15510
- const params = {
16130
+ const cellParams = {
15511
16131
  $table: $xeTable,
15512
16132
  $grid: $xeGrid,
15513
16133
  $rowIndex,
@@ -15527,8 +16147,8 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15527
16147
  rowspan: column.rowSpan > 1 ? column.rowSpan : null
15528
16148
  };
15529
16149
  const thOns = {
15530
- click: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, params),
15531
- dblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, params)
16150
+ click: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, cellParams),
16151
+ dblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, cellParams)
15532
16152
  };
15533
16153
  // 虚拟滚动不支持动态高度
15534
16154
  if (scrollXLoad && !hasEllipsis) {
@@ -15537,11 +16157,11 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15537
16157
  const isColDragCell = columnOpts.drag && columnDragOpts.trigger === 'cell';
15538
16158
  let isDisabledDrag = false;
15539
16159
  if (isColDragCell) {
15540
- isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params));
16160
+ isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
15541
16161
  }
15542
16162
  // 按下事件处理
15543
16163
  if (mouseConfig || isColDragCell) {
15544
- thOns.mousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, params);
16164
+ thOns.mousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, cellParams);
15545
16165
  }
15546
16166
  // 拖拽列事件
15547
16167
  if (columnOpts.drag) {
@@ -15559,6 +16179,12 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15559
16179
  if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
15560
16180
  isVNPreEmptyStatus = true;
15561
16181
  }
16182
+ const tcStyle = {};
16183
+ if (hasEllipsis) {
16184
+ tcStyle.height = `${currCellHeight}px`;
16185
+ } else {
16186
+ tcStyle.minHeight = `${currCellHeight}px`;
16187
+ }
15562
16188
  return h('th', {
15563
16189
  class: ['vxe-header--column', colid, {
15564
16190
  [`col--${headAlign}`]: headAlign,
@@ -15569,15 +16195,16 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15569
16195
  'col--ellipsis': hasEllipsis,
15570
16196
  'fixed--width': !isAutoCellWidth,
15571
16197
  'fixed--hidden': fixedHiddenColumn,
16198
+ 'is--padding': isPadding,
15572
16199
  'is--sortable': column.sortable,
15573
16200
  'col--filter': !!filters,
15574
16201
  'is--filter-active': hasFilter,
15575
16202
  'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
15576
16203
  'is--drag-disabled': isDisabledDrag,
15577
16204
  'col--current': currentColumn === column
15578
- }, getClass(headerClassName, params), getClass(headerCellClassName, params)],
16205
+ }, getClass(headerClassName, cellParams), getClass(headerCellClassName, cellParams)],
15579
16206
  attrs: thAttrs,
15580
- style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : undefined,
16207
+ style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(cellParams) : headerCellStyle : undefined,
15581
16208
  on: thOns,
15582
16209
  key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
15583
16210
  }, [h('div', {
@@ -15585,18 +16212,24 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15585
16212
  'c--title': showTitle,
15586
16213
  'c--tooltip': showTooltip,
15587
16214
  'c--ellipsis': showEllipsis
15588
- }]
15589
- }, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : column.renderHeader(h, params)),
16215
+ }],
16216
+ style: tcStyle
16217
+ }, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : [h('div', {
16218
+ attrs: {
16219
+ colid
16220
+ },
16221
+ class: 'vxe-cell--wrapper'
16222
+ }, column.renderHeader(h, cellParams))]),
15590
16223
  /**
15591
16224
  * 列宽拖动
15592
16225
  */
15593
16226
  !fixedHiddenColumn && showResizable ? h('div', {
15594
- class: ['vxe-resizable', {
16227
+ class: ['vxe-cell--col-resizable', {
15595
16228
  'is--line': !border || border === 'none'
15596
16229
  }],
15597
16230
  on: {
15598
- mousedown: evnt => _vm.resizeMousedownEvent(evnt, params),
15599
- dblclick: evnt => $xeTable.handleResizeDblclickEvent(evnt, params)
16231
+ mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
16232
+ dblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
15600
16233
  }
15601
16234
  }) : header_renderEmptyElement($xeTable)]);
15602
16235
  });
@@ -15616,6 +16249,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15616
16249
  headerRowStyle
15617
16250
  } = tableProps;
15618
16251
  const {
16252
+ isColLoading,
15619
16253
  isDragColMove
15620
16254
  } = tableReactData;
15621
16255
  return headerGroups.map((cols, $rowIndex) => {
@@ -15625,7 +16259,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15625
16259
  fixed: fixedType,
15626
16260
  type: cellType
15627
16261
  };
15628
- if (columnOpts.drag && columnDragOpts.animation) {
16262
+ if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
15629
16263
  return h('transition-group', {
15630
16264
  key: $rowIndex,
15631
16265
  props: {
@@ -15725,6 +16359,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15725
16359
  headerColumn
15726
16360
  } = this;
15727
16361
  const {
16362
+ mouseConfig,
15728
16363
  showHeaderOverflow: allColumnHeaderOverflow,
15729
16364
  spanMethod,
15730
16365
  footerSpanMethod
@@ -15739,6 +16374,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15739
16374
  visibleColumn,
15740
16375
  fullColumnIdData
15741
16376
  } = tableInternalData;
16377
+ const mouseOpts = $xeTable.computeMouseOpts;
15742
16378
  let renderHeaderList = headerColumn;
15743
16379
  let renderColumnList = tableColumn;
15744
16380
  let isOptimizeMode = false;
@@ -15833,14 +16469,21 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15833
16469
  */
15834
16470
  h('thead', {
15835
16471
  ref: 'refHeaderTHead'
15836
- }, renderHeads(h, this, isGroup, isOptimizeMode, renderHeaderList))]),
15837
- /**
15838
- * 其他
15839
- */
15840
- h('div', {
15841
- ref: 'refHeaderBorderRepair',
15842
- class: 'vxe-table--header-border-line'
15843
- })])]);
16472
+ }, renderHeads(h, this, isGroup, isOptimizeMode, renderHeaderList)), mouseConfig && mouseOpts.area ? h('div', {
16473
+ class: 'vxe-table--cell-area'
16474
+ }, [h('span', {
16475
+ class: 'vxe-table--cell-main-area'
16476
+ }), h('span', {
16477
+ class: 'vxe-table--cell-copy-area'
16478
+ }), h('span', {
16479
+ class: 'vxe-table--cell-extend-area'
16480
+ }), h('span', {
16481
+ class: 'vxe-table--cell-multi-area'
16482
+ }), h('span', {
16483
+ class: 'vxe-table--cell-active-area'
16484
+ }), h('span', {
16485
+ class: 'vxe-table--cell-col-status-area'
16486
+ })]) : header_renderEmptyElement($xeTable)])])]);
15844
16487
  },
15845
16488
  methods: {
15846
16489
  uploadColumn() {
@@ -15848,156 +16491,6 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15848
16491
  $parent: $xetable
15849
16492
  } = this;
15850
16493
  this.headerColumn = $xetable.isGroup ? convertHeaderColumnToRows(this.tableGroupColumn) : [];
15851
- },
15852
- resizeMousedownEvent(evnt, params) {
15853
- const _vm = this;
15854
- const props = _vm;
15855
- const $xeTable = this.$parent;
15856
- const tableReactData = $xeTable;
15857
- const tableInternalData = $xeTable;
15858
- const {
15859
- column
15860
- } = params;
15861
- const {
15862
- fixedType
15863
- } = props;
15864
- const {
15865
- scrollbarHeight
15866
- } = tableReactData;
15867
- const {
15868
- elemStore,
15869
- visibleColumn
15870
- } = tableInternalData;
15871
- const resizableOpts = $xeTable.computeResizableOpts;
15872
- const tableEl = $xeTable.$refs.refElem;
15873
- const leftContainerElem = $xeTable.$refs.refLeftContainer;
15874
- const rightContainerElem = $xeTable.$refs.refRightContainer;
15875
- const resizeBarElem = $xeTable.$refs.refCellResizeBar;
15876
- const resizeTipElem = $xeTable.$refs.refCellResizeTip;
15877
- const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
15878
- const {
15879
- clientX: dragClientX
15880
- } = evnt;
15881
- const wrapperElem = _vm.$el;
15882
- const dragBtnElem = evnt.target;
15883
- let resizeColumn = column;
15884
- if (column.children && column.children.length) {
15885
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
15886
- resizeColumn = childColumn;
15887
- });
15888
- }
15889
- const cell = dragBtnElem.parentNode;
15890
- const cellParams = Object.assign(params, {
15891
- cell
15892
- });
15893
- let dragLeft = 0;
15894
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
15895
- if (!bodyScrollElem) {
15896
- return;
15897
- }
15898
- const pos = getOffsetPos(dragBtnElem, tableEl);
15899
- const dragBtnWidth = dragBtnElem.clientWidth;
15900
- const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
15901
- const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
15902
- let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
15903
- let dragPosLeft = pos.left + dragBtnOffsetWidth;
15904
- const domMousemove = document.onmousemove;
15905
- const domMouseup = document.onmouseup;
15906
- const isLeftFixed = fixedType === 'left';
15907
- const isRightFixed = fixedType === 'right';
15908
- // 计算左右侧固定列偏移量
15909
- let fixedOffsetWidth = 0;
15910
- if (isLeftFixed || isRightFixed) {
15911
- const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
15912
- let tempCellElem = cell[siblingProp];
15913
- while (tempCellElem) {
15914
- if (hasClass(tempCellElem, 'fixed--hidden')) {
15915
- break;
15916
- } else if (!hasClass(tempCellElem, 'col--group')) {
15917
- fixedOffsetWidth += tempCellElem.offsetWidth;
15918
- }
15919
- tempCellElem = tempCellElem[siblingProp];
15920
- }
15921
- if (isRightFixed && rightContainerElem) {
15922
- dragPosLeft = rightContainerElem.offsetLeft + fixedOffsetWidth;
15923
- }
15924
- }
15925
- // 处理拖动事件
15926
- const updateEvent = function (evnt) {
15927
- evnt.stopPropagation();
15928
- evnt.preventDefault();
15929
- const tableHeight = tableEl.clientHeight;
15930
- const offsetX = evnt.clientX - dragClientX;
15931
- let left = dragPosLeft + offsetX;
15932
- const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
15933
- if (isLeftFixed) {
15934
- // 左固定列(不允许超过右侧固定列、不允许超过右边距)
15935
- left = Math.min(left, (rightContainerElem ? rightContainerElem.offsetLeft : bodyScrollElem.clientWidth) - fixedOffsetWidth - minInterval);
15936
- } else if (isRightFixed) {
15937
- // 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
15938
- dragMinLeft = (leftContainerElem ? leftContainerElem.clientWidth : 0) + fixedOffsetWidth + minInterval;
15939
- left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
15940
- } else {
15941
- dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
15942
- // left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
15943
- }
15944
- dragLeft = Math.max(left, dragMinLeft);
15945
- const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
15946
- resizeBarElem.style.left = `${resizeBarLeft}px`;
15947
- resizeBarElem.style.top = `${scrollbarXToTop ? scrollbarHeight : 0}px`;
15948
- resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - scrollbarHeight : tableHeight}px`;
15949
- if (resizableOpts.showDragTip && resizeTipElem) {
15950
- const tableWidth = tableEl.clientWidth;
15951
- const wrapperRect = wrapperElem.getBoundingClientRect();
15952
- const resizeBarWidth = resizeBarElem.clientWidth;
15953
- const resizeTipWidth = resizeTipElem.clientWidth;
15954
- const resizeTipHeight = resizeTipElem.clientHeight;
15955
- let resizeTipLeft = -resizeTipWidth;
15956
- if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
15957
- resizeTipLeft = 0;
15958
- } else if (resizeBarLeft > tableWidth) {
15959
- resizeTipLeft += tableWidth - resizeBarLeft;
15960
- }
15961
- resizeTipElem.style.left = `${resizeTipLeft}px`;
15962
- resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
15963
- resizeTipElem.textContent = header_getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
15964
- }
15965
- };
15966
- tableReactData._isResize = true;
15967
- addClass(tableEl, 'drag--resize');
15968
- resizeBarElem.style.display = 'block';
15969
- document.onmousemove = updateEvent;
15970
- document.onmouseup = function (evnt) {
15971
- document.onmousemove = domMousemove;
15972
- document.onmouseup = domMouseup;
15973
- const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
15974
- resizeColumn.resizeWidth = resizeWidth;
15975
- if (resizableOpts.dragMode === 'fixed') {
15976
- visibleColumn.forEach(item => {
15977
- if (item.id !== resizeColumn.id) {
15978
- if (!item.resizeWidth) {
15979
- item.resizeWidth = item.renderWidth;
15980
- }
15981
- }
15982
- });
15983
- }
15984
- resizeBarElem.style.display = 'none';
15985
- tableReactData._isResize = false;
15986
- tableInternalData._lastResizeTime = Date.now();
15987
- $xeTable.analyColumnWidth();
15988
- $xeTable.recalculate(true).then(() => {
15989
- $xeTable.saveCustomStore('update:visible');
15990
- $xeTable.updateCellAreas();
15991
- $xeTable.dispatchEvent('resizable-change', {
15992
- ...params,
15993
- resizeWidth
15994
- }, evnt);
15995
- setTimeout(() => $xeTable.recalculate(true), 300);
15996
- });
15997
- removeClass(tableEl, 'drag--resize');
15998
- };
15999
- updateEvent(evnt);
16000
- $xeTable.closeMenu();
16001
16494
  }
16002
16495
  }
16003
16496
  });
@@ -16006,6 +16499,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
16006
16499
 
16007
16500
 
16008
16501
 
16502
+
16009
16503
  const footer_renderType = 'footer';
16010
16504
  const {
16011
16505
  renderer: footer_renderer,
@@ -16045,6 +16539,8 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16045
16539
  fixedType
16046
16540
  } = props;
16047
16541
  const {
16542
+ resizable: allResizable,
16543
+ border,
16048
16544
  footerCellClassName,
16049
16545
  footerCellStyle,
16050
16546
  footerAlign: allFooterAlign,
@@ -16064,7 +16560,14 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16064
16560
  scrollXStore
16065
16561
  } = tableInternalData;
16066
16562
  const tooltipOpts = $xeTable.computeTooltipOpts;
16563
+ const {
16564
+ isAllColumnDrag
16565
+ } = $xeTable.resizableOpts;
16067
16566
  const columnOpts = $xeTable.computeColumnOpts;
16567
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
16568
+ const cellOpts = $xeTable.computeCellOpts;
16569
+ const footerCellOpts = $xeTable.computeFooterCellOpts;
16570
+ const currCellHeight = getCellHeight(footerCellOpts.height || cellOpts.height) || defaultRowHeight;
16068
16571
  return tableColumn.map((column, $columnIndex) => {
16069
16572
  const {
16070
16573
  type,
@@ -16075,19 +16578,22 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16075
16578
  editRender,
16076
16579
  cellRender
16077
16580
  } = column;
16581
+ const colid = column.id;
16078
16582
  const renderOpts = editRender || cellRender;
16079
16583
  const compConf = renderOpts ? footer_renderer.get(renderOpts.name) : null;
16080
16584
  const showAllTip = tooltipOpts.showAll;
16081
16585
  const isColGroup = column.children && column.children.length;
16082
16586
  const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
16587
+ const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding;
16083
16588
  const footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
16084
16589
  const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
16085
16590
  let showEllipsis = footOverflow === 'ellipsis';
16086
16591
  const showTitle = footOverflow === 'title';
16087
16592
  const showTooltip = footOverflow === true || footOverflow === 'tooltip';
16088
16593
  let hasEllipsis = showTitle || showTooltip || showEllipsis;
16594
+ const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
16089
16595
  const attrs = {
16090
- colid: column.id
16596
+ colid
16091
16597
  };
16092
16598
  const tfOns = {};
16093
16599
  const columnIndex = $xeTable.getColumnIndex(column);
@@ -16180,6 +16686,12 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16180
16686
  if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
16181
16687
  isVNPreEmptyStatus = true;
16182
16688
  }
16689
+ const tcStyle = {};
16690
+ if (hasEllipsis) {
16691
+ tcStyle.height = `${currCellHeight}px`;
16692
+ } else {
16693
+ tcStyle.minHeight = `${currCellHeight}px`;
16694
+ }
16183
16695
  return h('td', {
16184
16696
  class: ['vxe-footer--column', column.id, {
16185
16697
  [`col--${footAlign}`]: footAlign,
@@ -16187,6 +16699,7 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16187
16699
  'col--last': isLastColumn,
16188
16700
  'fixed--width': !isAutoCellWidth,
16189
16701
  'fixed--hidden': fixedHiddenColumn,
16702
+ 'is--padding': isPadding,
16190
16703
  'col--ellipsis': hasEllipsis,
16191
16704
  'col--current': currentColumn === column
16192
16705
  }, getClass(footerClassName, cellParams), getClass(footerCellClassName, cellParams)],
@@ -16199,8 +16712,26 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16199
16712
  'c--title': showTitle,
16200
16713
  'c--tooltip': showTooltip,
16201
16714
  'c--ellipsis': showEllipsis
16202
- }]
16203
- }, isVNPreEmptyStatus ? [] : column.renderFooter(h, cellParams))]);
16715
+ }],
16716
+ style: tcStyle
16717
+ }, isVNPreEmptyStatus ? [] : [h('div', {
16718
+ attrs: {
16719
+ colid
16720
+ },
16721
+ class: 'vxe-cell--wrapper'
16722
+ }, column.renderFooter(h, cellParams))]),
16723
+ /**
16724
+ * 列宽拖动
16725
+ */
16726
+ !fixedHiddenColumn && showResizable && isAllColumnDrag ? h('div', {
16727
+ class: ['vxe-cell--col-resizable', {
16728
+ 'is--line': !border || border === 'none'
16729
+ }],
16730
+ on: {
16731
+ mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
16732
+ dblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
16733
+ }
16734
+ }) : footer_renderEmptyElement($xeTable)]);
16204
16735
  });
16205
16736
  }
16206
16737
  function footer_renderHeads(h, _vm, renderColumnList) {
@@ -16217,6 +16748,7 @@ function footer_renderHeads(h, _vm, renderColumnList) {
16217
16748
  footerRowStyle
16218
16749
  } = tableProps;
16219
16750
  const {
16751
+ isColLoading,
16220
16752
  isDragColMove
16221
16753
  } = tableReactData;
16222
16754
  const columnOpts = $xeTable.computeColumnOpts;
@@ -16231,7 +16763,7 @@ function footer_renderHeads(h, _vm, renderColumnList) {
16231
16763
  fixed: fixedType,
16232
16764
  type: footer_renderType
16233
16765
  };
16234
- if (columnOpts.drag && columnDragOpts.animation) {
16766
+ if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
16235
16767
  return h('transition-group', {
16236
16768
  key: $rowIndex,
16237
16769
  props: {
@@ -16457,10 +16989,10 @@ const {
16457
16989
  type: [Boolean, String],
16458
16990
  default: () => props_getConfig().table.border
16459
16991
  },
16460
- // 单元格是否有边距
16992
+ // 已废弃,被 cell-config.padding 替换
16461
16993
  padding: {
16462
16994
  type: Boolean,
16463
- default: () => props_getConfig().table.padding
16995
+ default: null
16464
16996
  },
16465
16997
  // 是否圆角边框
16466
16998
  round: {
@@ -16509,12 +17041,18 @@ const {
16509
17041
  type: Boolean,
16510
17042
  default: () => props_getConfig().table.highlightHoverRow
16511
17043
  },
16512
- // 已废弃,被 column-config.isCurrent 替换
17044
+ /**
17045
+ * (即将废弃)是否要高亮当前选中列
17046
+ * @deprecated
17047
+ */
16513
17048
  highlightCurrentColumn: {
16514
17049
  type: Boolean,
16515
17050
  default: () => props_getConfig().table.highlightCurrentColumn
16516
17051
  },
16517
- // 已废弃,被 column-config.isHover 替换
17052
+ /**
17053
+ * (即将废弃)鼠标移到列是否要高亮显示
17054
+ * @deprecated
17055
+ */
16518
17056
  highlightHoverColumn: {
16519
17057
  type: Boolean,
16520
17058
  default: () => props_getConfig().table.highlightHoverColumn
@@ -16606,6 +17144,10 @@ const {
16606
17144
  columnConfig: Object,
16607
17145
  // 单元格配置信息
16608
17146
  cellConfig: Object,
17147
+ // 表头单元格配置信息
17148
+ headerCellConfig: Object,
17149
+ // 表尾单元格配置信息
17150
+ footerCellConfig: Object,
16609
17151
  // 行配置信息
16610
17152
  rowConfig: Object,
16611
17153
  // 已废弃,被 rowDragConfig 替换
@@ -19398,6 +19940,8 @@ const {
19398
19940
  * 快捷菜单事件处理
19399
19941
  */
19400
19942
  handleGlobalContextmenuEvent(evnt) {
19943
+ const $xeTable = this;
19944
+ const internalData = $xeTable;
19401
19945
  const {
19402
19946
  $refs,
19403
19947
  tId,
@@ -19418,7 +19962,7 @@ const {
19418
19962
  evnt.preventDefault();
19419
19963
  return;
19420
19964
  }
19421
- if (this._keyCtx) {
19965
+ if (internalData._keyCtx) {
19422
19966
  const type = 'body';
19423
19967
  const params = {
19424
19968
  type,
@@ -19736,6 +20280,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
19736
20280
  parent: parentRow,
19737
20281
  level: parentLevel + 1,
19738
20282
  height: 0,
20283
+ resizeHeight: 0,
19739
20284
  oTop: 0
19740
20285
  };
19741
20286
  fullDataRowIdData[rowid] = rest;
@@ -19760,6 +20305,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
19760
20305
  parent: null,
19761
20306
  level: 0,
19762
20307
  height: 0,
20308
+ resizeHeight: 0,
19763
20309
  oTop: 0
19764
20310
  };
19765
20311
  fullDataRowIdData[rowid] = rest;
@@ -19818,6 +20364,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
19818
20364
  parent: null,
19819
20365
  level: 0,
19820
20366
  height: 0,
20367
+ resizeHeight: 0,
19821
20368
  oTop: 0
19822
20369
  };
19823
20370
  fullDataRowIdData[rowid] = rest;
@@ -19855,6 +20402,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
19855
20402
  parent: null,
19856
20403
  level: 0,
19857
20404
  height: 0,
20405
+ resizeHeight: 0,
19858
20406
  oTop: 0
19859
20407
  };
19860
20408
  fullDataRowIdData[rowid] = rest;
@@ -19915,6 +20463,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
19915
20463
  parent: parentRow,
19916
20464
  level: parentLevel + 1,
19917
20465
  height: 0,
20466
+ resizeHeight: 0,
19918
20467
  oTop: 0
19919
20468
  };
19920
20469
  fullDataRowIdData[rowid] = rest;
@@ -19989,7 +20538,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
19989
20538
  const rowid = getRowid($xeTable, newRow);
19990
20539
  insertMaps[rowid] = newRow;
19991
20540
  });
19992
- $xeTable.cacheRowMap();
20541
+ $xeTable.cacheRowMap(false);
19993
20542
  $xeTable.updateScrollYStatus();
19994
20543
  $xeTable.handleTableData(treeConfig && transform);
19995
20544
  if (!(treeConfig && transform)) {
@@ -20201,7 +20750,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
20201
20750
  }
20202
20751
  });
20203
20752
  $xeTable.updateFooter();
20204
- $xeTable.cacheRowMap();
20753
+ $xeTable.cacheRowMap(false);
20205
20754
  $xeTable.handleTableData(treeConfig && transform);
20206
20755
  if (!(treeConfig && transform)) {
20207
20756
  $xeTable.updateAfterDataIndex();
@@ -21575,7 +22124,21 @@ function getTxtCellValue(val, vMaps) {
21575
22124
  const rest = replaceTxtCell(val, vMaps);
21576
22125
  return rest.replace(/^"+$/g, qVal => '"'.repeat(Math.ceil(qVal.length / 2)));
21577
22126
  }
21578
- function parseCsvAndTxt(columns, content, cellSeparator) {
22127
+ function toExportField(tableConf, field) {
22128
+ const {
22129
+ fieldMaps,
22130
+ titleMaps
22131
+ } = tableConf;
22132
+ // title 转 field
22133
+ if (!fieldMaps[field]) {
22134
+ const teCol = titleMaps[field];
22135
+ if (teCol && teCol.field) {
22136
+ field = teCol.field;
22137
+ }
22138
+ }
22139
+ return field;
22140
+ }
22141
+ function parseCsvAndTxt(tableConf, content, cellSeparator) {
21579
22142
  const list = content.split(enterSymbol);
21580
22143
  const rows = [];
21581
22144
  let fields = [];
@@ -21596,11 +22159,11 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
21596
22159
  });
21597
22160
  const cells = rVal.split(cellSeparator);
21598
22161
  if (!fields.length) {
21599
- fields = cells.map(val => getTxtCellValue(val.trim(), vMaps));
22162
+ fields = cells.map(val => toExportField(tableConf, getTxtCellValue(val.trim(), vMaps)));
21600
22163
  } else {
21601
22164
  cells.forEach((val, colIndex) => {
21602
22165
  if (colIndex < fields.length) {
21603
- item[fields[colIndex]] = getTxtCellValue(val, vMaps);
22166
+ item[fields[colIndex]] = getTxtCellValue(val.trim(), vMaps);
21604
22167
  }
21605
22168
  });
21606
22169
  rows.push(item);
@@ -21613,13 +22176,13 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
21613
22176
  rows
21614
22177
  };
21615
22178
  }
21616
- function parseCsv(columns, content) {
21617
- return parseCsvAndTxt(columns, content, ',');
22179
+ function parseCsv(tableConf, content) {
22180
+ return parseCsvAndTxt(tableConf, content, ',');
21618
22181
  }
21619
- function parseTxt(columns, content) {
21620
- return parseCsvAndTxt(columns, content, '\t');
22182
+ function parseTxt(tableConf, content) {
22183
+ return parseCsvAndTxt(tableConf, content, '\t');
21621
22184
  }
21622
- function parseHTML(columns, content) {
22185
+ function parseHTML(tableConf, content) {
21623
22186
  const domParser = new DOMParser();
21624
22187
  const xmlDoc = domParser.parseFromString(content, 'text/html');
21625
22188
  const bodyNodes = getElementsByTagName(xmlDoc, 'body');
@@ -21632,7 +22195,7 @@ function parseHTML(columns, content) {
21632
22195
  if (theadNodes.length) {
21633
22196
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(theadNodes[0], 'tr'), rowNode => {
21634
22197
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNode, 'th'), cellNode => {
21635
- fields.push(cellNode.textContent);
22198
+ fields.push(toExportField(tableConf, cellNode.textContent || ''));
21636
22199
  });
21637
22200
  });
21638
22201
  const tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
@@ -21655,7 +22218,7 @@ function parseHTML(columns, content) {
21655
22218
  rows
21656
22219
  };
21657
22220
  }
21658
- function parseXML(columns, content) {
22221
+ function parseXML(tableConf, content) {
21659
22222
  const domParser = new DOMParser();
21660
22223
  const xmlDoc = domParser.parseFromString(content, 'application/xml');
21661
22224
  const sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
@@ -21667,7 +22230,7 @@ function parseXML(columns, content) {
21667
22230
  const rowNodes = getElementsByTagName(tableNodes[0], 'Row');
21668
22231
  if (rowNodes.length) {
21669
22232
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), cellNode => {
21670
- fields.push(cellNode.textContent);
22233
+ fields.push(toExportField(tableConf, cellNode.textContent || ''));
21671
22234
  });
21672
22235
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(rowNodes, (rowNode, index) => {
21673
22236
  if (index) {
@@ -21689,60 +22252,62 @@ function parseXML(columns, content) {
21689
22252
  rows
21690
22253
  };
21691
22254
  }
21692
- /**
21693
- * 检查导入的列是否完整
21694
- * @param {Array} fields 字段名列表
21695
- * @param {Array} rows 数据列表
21696
- */
21697
- function checkImportData(columns, fields) {
21698
- const tableFields = [];
21699
- columns.forEach(column => {
21700
- const field = column.field;
21701
- if (field) {
21702
- tableFields.push(field);
21703
- }
21704
- });
21705
- return fields.some(field => tableFields.indexOf(field) > -1);
21706
- }
21707
- function handleImport($xetable, content, opts) {
22255
+ function handleImport($xeTable, content, opts) {
22256
+ const internalData = $xeTable;
21708
22257
  const {
21709
22258
  tableFullColumn,
21710
22259
  _importResolve,
21711
22260
  _importReject
21712
- } = $xetable;
22261
+ } = internalData;
21713
22262
  let rest = {
21714
22263
  fields: [],
21715
22264
  rows: []
21716
22265
  };
22266
+ const tableFieldMaps = {};
22267
+ const tableTitleMaps = {};
22268
+ tableFullColumn.forEach(column => {
22269
+ const field = column.field;
22270
+ const title = column.getTitle();
22271
+ if (field) {
22272
+ tableFieldMaps[field] = column;
22273
+ }
22274
+ if (title) {
22275
+ tableTitleMaps[column.getTitle()] = column;
22276
+ }
22277
+ });
22278
+ const tableConf = {
22279
+ fieldMaps: tableFieldMaps,
22280
+ titleMaps: tableTitleMaps
22281
+ };
21717
22282
  switch (opts.type) {
21718
22283
  case 'csv':
21719
- rest = parseCsv(tableFullColumn, content);
22284
+ rest = parseCsv(tableConf, content);
21720
22285
  break;
21721
22286
  case 'txt':
21722
- rest = parseTxt(tableFullColumn, content);
22287
+ rest = parseTxt(tableConf, content);
21723
22288
  break;
21724
22289
  case 'html':
21725
- rest = parseHTML(tableFullColumn, content);
22290
+ rest = parseHTML(tableConf, content);
21726
22291
  break;
21727
22292
  case 'xml':
21728
- rest = parseXML(tableFullColumn, content);
22293
+ rest = parseXML(tableConf, content);
21729
22294
  break;
21730
22295
  }
21731
22296
  const {
21732
22297
  fields,
21733
22298
  rows
21734
22299
  } = rest;
21735
- const status = checkImportData(tableFullColumn, fields);
22300
+ const status = fields.some(field => tableFieldMaps[field] || tableTitleMaps[field]);
21736
22301
  if (status) {
21737
- $xetable.createData(rows).then(data => {
22302
+ $xeTable.createData(rows).then(data => {
21738
22303
  let loadRest;
21739
22304
  if (opts.mode === 'insert' || opts.mode === 'insertBottom') {
21740
- loadRest = $xetable.insertAt(data, -1);
22305
+ loadRest = $xeTable.insertAt(data, -1);
21741
22306
  }
21742
22307
  if (opts.mode === 'insertTop') {
21743
- loadRest = $xetable.insert(data);
22308
+ loadRest = $xeTable.insert(data);
21744
22309
  } else {
21745
- loadRest = $xetable.reloadData(data);
22310
+ loadRest = $xeTable.reloadData(data);
21746
22311
  }
21747
22312
  if (opts.message !== false) {
21748
22313
  // 检测弹窗模块
@@ -21975,6 +22540,43 @@ function readLocalFile(options = {}) {
21975
22540
  fileInput.click();
21976
22541
  });
21977
22542
  }
22543
+ function handleFilterColumns(exportOpts, column, columns) {
22544
+ return columns.some(item => {
22545
+ if (isColumnInfo(item)) {
22546
+ return column.id === item.id;
22547
+ } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(item)) {
22548
+ return column.field === item;
22549
+ } else {
22550
+ const colid = item.id || item.colId;
22551
+ const type = item.type;
22552
+ const field = item.field;
22553
+ if (colid) {
22554
+ return column.id === colid;
22555
+ } else if (field && type) {
22556
+ return column.field === field && column.type === type;
22557
+ } else if (field) {
22558
+ return column.field === field;
22559
+ } else if (type) {
22560
+ return column.type === type;
22561
+ }
22562
+ }
22563
+ return false;
22564
+ });
22565
+ }
22566
+ function handleFilterFields(exportOpts, column, includeFields, excludeFields) {
22567
+ if (excludeFields) {
22568
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(excludeFields, column.field)) {
22569
+ return false;
22570
+ }
22571
+ }
22572
+ if (includeFields) {
22573
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(includeFields, column.field)) {
22574
+ return true;
22575
+ }
22576
+ return false;
22577
+ }
22578
+ return exportOpts.original ? column.field : defaultFilterExportColumn(column);
22579
+ }
21978
22580
  function handleExportAndPrint($xeTable, options, isPrint) {
21979
22581
  const props = $xeTable;
21980
22582
  const reactData = $xeTable;
@@ -22019,7 +22621,9 @@ function handleExportAndPrint($xeTable, options, isPrint) {
22019
22621
  const checkMethod = customOpts.checkMethod;
22020
22622
  const exportColumns = collectColumn.slice(0);
22021
22623
  const {
22022
- columns
22624
+ columns,
22625
+ excludeFields,
22626
+ includeFields
22023
22627
  } = defOpts;
22024
22628
  // 处理类型
22025
22629
  const typeList = types.map(value => {
@@ -22043,33 +22647,19 @@ function handleExportAndPrint($xeTable, options, isPrint) {
22043
22647
  // 默认选中
22044
22648
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(exportColumns, (column, index, items, path, parent) => {
22045
22649
  const isColGroup = column.children && column.children.length;
22046
- if (isColGroup || defaultFilterExportColumn(column)) {
22047
- column.checked = columns ? columns.some(item => {
22048
- if (isColumnInfo(item)) {
22049
- return column.id === item.id;
22050
- } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(item)) {
22051
- return column.field === item;
22052
- } else {
22053
- const colid = item.id || item.colId;
22054
- const type = item.type;
22055
- const field = item.field;
22056
- if (colid) {
22057
- return column.id === colid;
22058
- } else if (field && type) {
22059
- return column.field === field && column.type === type;
22060
- } else if (field) {
22061
- return column.field === field;
22062
- } else if (type) {
22063
- return column.type === type;
22064
- }
22065
- }
22066
- return false;
22067
- }) : column.visible;
22068
- column.halfChecked = false;
22069
- column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
22070
- column
22071
- }) : false);
22650
+ let isChecked = false;
22651
+ if (columns && columns.length) {
22652
+ isChecked = handleFilterColumns(defOpts, column, columns);
22653
+ } else if (excludeFields || includeFields) {
22654
+ isChecked = handleFilterFields(defOpts, column, includeFields, excludeFields);
22655
+ } else {
22656
+ isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
22072
22657
  }
22658
+ column.checked = isChecked;
22659
+ column.halfChecked = false;
22660
+ column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
22661
+ column
22662
+ }) : false);
22073
22663
  });
22074
22664
  // 更新条件
22075
22665
  Object.assign(exportStore, {
@@ -22691,6 +23281,7 @@ const convertToRows = originColumns => {
22691
23281
 
22692
23282
 
22693
23283
 
23284
+
22694
23285
  function getTargetOffset(target, container) {
22695
23286
  let offsetTop = 0;
22696
23287
  let offsetLeft = 0;
@@ -22716,37 +23307,72 @@ function getTargetOffset(target, container) {
22716
23307
  };
22717
23308
  }
22718
23309
  function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offsetClientTop, moveRange) {
23310
+ const props = $xeTable;
22719
23311
  const reactData = $xeTable;
22720
23312
  const internalData = $xeTable;
23313
+ const {
23314
+ showOverflow
23315
+ } = props;
23316
+ const {
23317
+ fullAllDataRowIdData,
23318
+ isResizeCellHeight
23319
+ } = internalData;
23320
+ const rowOpts = $xeTable.computeRowOpts;
23321
+ const cellOpts = $xeTable.computeCellOpts;
23322
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
23323
+ const {
23324
+ row
23325
+ } = params;
22721
23326
  let countHeight = 0;
22722
23327
  let rangeRows = [];
22723
23328
  let moveSize = 0;
22724
23329
  const isDown = moveRange > 0;
22725
23330
  const {
22726
- scrollYLoad,
22727
- rowHeight
23331
+ scrollYLoad
22728
23332
  } = reactData;
22729
23333
  const {
22730
23334
  afterFullData
22731
23335
  } = internalData;
23336
+ if (isDown) {
23337
+ moveSize = offsetClientTop + moveRange;
23338
+ } else {
23339
+ moveSize = trRect.height - offsetClientTop + Math.abs(moveRange);
23340
+ }
22732
23341
  if (scrollYLoad) {
22733
- if (isDown) {
22734
- moveSize = offsetClientTop + moveRange;
22735
- } else {
22736
- moveSize = trRect.height - offsetClientTop + Math.abs(moveRange);
22737
- }
22738
- const _rowIndex = $xeTable.getVTRowIndex(params.row);
22739
- if (isDown) {
22740
- rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / rowHeight));
23342
+ const _rowIndex = $xeTable.getVTRowIndex(row);
23343
+ const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
23344
+ if (!isCustomCellHeight && showOverflow) {
23345
+ if (isDown) {
23346
+ rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / defaultRowHeight));
23347
+ } else {
23348
+ rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / defaultRowHeight), _rowIndex + 1);
23349
+ }
22741
23350
  } else {
22742
- rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / rowHeight), _rowIndex + 1);
23351
+ if (isDown) {
23352
+ for (let i = _rowIndex; i < afterFullData.length; i++) {
23353
+ const item = afterFullData[i];
23354
+ const rowid = $xeTable.getRowid(item);
23355
+ const rowRest = fullAllDataRowIdData[rowid] || {};
23356
+ countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
23357
+ rangeRows.push(item);
23358
+ if (countHeight > moveSize) {
23359
+ return rangeRows;
23360
+ }
23361
+ }
23362
+ } else {
23363
+ for (let len = _rowIndex; len >= 0; len--) {
23364
+ const item = afterFullData[len];
23365
+ const rowid = $xeTable.getRowid(item);
23366
+ const rowRest = fullAllDataRowIdData[rowid] || {};
23367
+ countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
23368
+ rangeRows.push(item);
23369
+ if (countHeight > moveSize) {
23370
+ return rangeRows;
23371
+ }
23372
+ }
23373
+ }
22743
23374
  }
22744
23375
  } else {
22745
- if (isDown) {
22746
- moveSize = evnt.clientY - trRect.y;
22747
- } else {
22748
- moveSize = trRect.y - evnt.clientY + trRect.height;
22749
- }
22750
23376
  const siblingProp = isDown ? 'next' : 'previous';
22751
23377
  while (targetTrElem && countHeight < moveSize) {
22752
23378
  const rowNodeRest = $xeTable.getRowNode(targetTrElem);
@@ -22924,21 +23550,31 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
22924
23550
  },
22925
23551
  handleCheckboxRangeEvent(evnt, params) {
22926
23552
  const $xeTable = this;
23553
+ const internalData = $xeTable;
23554
+ const {
23555
+ elemStore
23556
+ } = internalData;
23557
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
23558
+ const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
23559
+ const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
22927
23560
  const {
22928
23561
  column,
22929
23562
  cell
22930
23563
  } = params;
22931
23564
  if (column.type === 'checkbox') {
22932
- const {
22933
- $el,
22934
- elemStore
22935
- } = this;
23565
+ let bodyWrapperElem = bodyScrollElem;
23566
+ if (leftScrollElem && column.fixed === 'left') {
23567
+ bodyWrapperElem = leftScrollElem;
23568
+ } else if (rightScrollElem && column.fixed === 'right') {
23569
+ bodyWrapperElem = rightScrollElem;
23570
+ }
23571
+ if (!bodyWrapperElem) {
23572
+ return;
23573
+ }
23574
+ const el = $xeTable.$refs.refElem;
22936
23575
  const disX = evnt.clientX;
22937
23576
  const disY = evnt.clientY;
22938
- const bodyWrapperElem = elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper'];
22939
23577
  const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
22940
- const domMousemove = document.onmousemove;
22941
- const domMouseup = document.onmouseup;
22942
23578
  const trElem = cell.parentNode;
22943
23579
  const selectRecords = this.getCheckboxRecords();
22944
23580
  let lastRangeRows = [];
@@ -23049,7 +23685,7 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
23049
23685
  }
23050
23686
  }, 50);
23051
23687
  };
23052
- addClass($el, 'drag--range');
23688
+ addClass(el, 'drag--range');
23053
23689
  document.onmousemove = evnt => {
23054
23690
  evnt.preventDefault();
23055
23691
  evnt.stopPropagation();
@@ -23079,10 +23715,10 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
23079
23715
  };
23080
23716
  document.onmouseup = evnt => {
23081
23717
  stopMouseScroll();
23082
- removeClass($el, 'drag--range');
23718
+ removeClass(el, 'drag--range');
23083
23719
  checkboxRangeElem.removeAttribute('style');
23084
- document.onmousemove = domMousemove;
23085
- document.onmouseup = domMouseup;
23720
+ document.onmousemove = null;
23721
+ document.onmouseup = null;
23086
23722
  triggerEvent('end', evnt);
23087
23723
  };
23088
23724
  triggerEvent('start', evnt);
@@ -24202,7 +24838,7 @@ const table_renderDragTip = (h, $xeTable) => {
24202
24838
  }
24203
24839
  return table_renderEmptyElement($xeTable);
24204
24840
  };
24205
- function handleUupdateResize(_vm) {
24841
+ function handleUpdateResize(_vm) {
24206
24842
  const {
24207
24843
  $el
24208
24844
  } = _vm;
@@ -24350,8 +24986,7 @@ function renderBody(h, $xeTable) {
24350
24986
  const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
24351
24987
  return {
24352
24988
  xID,
24353
- tId: `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId()}`,
24354
- isCalcColumn: false,
24989
+ tId: xID,
24355
24990
  // 低性能的静态列
24356
24991
  staticColumns: [],
24357
24992
  // 渲染的列分组
@@ -24562,15 +25197,17 @@ function renderBody(h, $xeTable) {
24562
25197
  isFooter: false
24563
25198
  },
24564
25199
  scrollVMLoading: false,
24565
- isCalcCellHeight: 0,
25200
+ calcCellHeightFlag: 0,
25201
+ resizeHeightFlag: 0,
24566
25202
  isCustomStatus: false,
24567
25203
  isDragRowMove: false,
24568
25204
  dragRow: null,
24569
25205
  isDragColMove: false,
24570
25206
  dragCol: null,
24571
25207
  dragTipText: '',
24572
- _isResize: false,
24573
- isLoading: false,
25208
+ isDragResize: false,
25209
+ isRowLoading: false,
25210
+ isColLoading: false,
24574
25211
  reScrollFlag: 0,
24575
25212
  reLayoutFlag: 0,
24576
25213
  footFlag: 0
@@ -24677,7 +25314,7 @@ function renderBody(h, $xeTable) {
24677
25314
  const $xeTable = this;
24678
25315
  const vSize = $xeTable.computeSize;
24679
25316
  const rowHeightMaps = $xeTable.computeRowHeightMaps;
24680
- return rowHeightMaps[vSize || 'default'];
25317
+ return rowHeightMaps[vSize || 'default'] || 18;
24681
25318
  },
24682
25319
  columnOpts() {
24683
25320
  return this.computeColumnOpts;
@@ -24686,7 +25323,19 @@ function renderBody(h, $xeTable) {
24686
25323
  return Object.assign({}, table_getConfig().table.columnConfig, this.columnConfig);
24687
25324
  },
24688
25325
  computeCellOpts() {
24689
- return Object.assign({}, table_getConfig().table.cellConfig, this.cellConfig);
25326
+ const $xeTable = this;
25327
+ const props = $xeTable;
25328
+ return Object.assign({}, table_getConfig().table.cellConfig, props.cellConfig);
25329
+ },
25330
+ computeHeaderCellOpts() {
25331
+ const $xeTable = this;
25332
+ const props = $xeTable;
25333
+ return Object.assign({}, table_getConfig().table.headerCellConfig, props.headerCellConfig);
25334
+ },
25335
+ computeFooterCellOpts() {
25336
+ const $xeTable = this;
25337
+ const props = $xeTable;
25338
+ return Object.assign({}, table_getConfig().table.footerCellConfig, props.footerCellConfig);
24690
25339
  },
24691
25340
  rowOpts() {
24692
25341
  return this.computeRowOpts;
@@ -24743,6 +25392,20 @@ function renderBody(h, $xeTable) {
24743
25392
  ...this.tooltipOpts
24744
25393
  };
24745
25394
  },
25395
+ computeTableTipConfig() {
25396
+ const $xeTable = this;
25397
+ const reactData = $xeTable;
25398
+ const {
25399
+ tooltipStore
25400
+ } = reactData;
25401
+ const tooltipOpts = $xeTable.computeTooltipOpts;
25402
+ return Object.assign({}, tooltipOpts, tooltipStore.currOpts);
25403
+ },
25404
+ computeValidTipConfig() {
25405
+ const $xeTable = this;
25406
+ const tooltipOpts = $xeTable.computeTooltipOpts;
25407
+ return Object.assign({}, tooltipOpts);
25408
+ },
24746
25409
  validTipOpts() {
24747
25410
  return Object.assign({
24748
25411
  isArrow: false
@@ -24799,23 +25462,55 @@ function renderBody(h, $xeTable) {
24799
25462
  return Object.assign({}, table_getConfig().table.fnrConfig, this.fnrConfig);
24800
25463
  },
24801
25464
  headerCtxMenu() {
24802
- const headerOpts = this.ctxMenuOpts.header;
25465
+ return this.computeHeaderMenu;
25466
+ },
25467
+ computeHeaderMenu() {
25468
+ const $xeTable = this;
25469
+ const menuOpts = $xeTable.computeMenuOpts;
25470
+ const headerOpts = menuOpts.header;
24803
25471
  return headerOpts && headerOpts.options ? headerOpts.options : [];
24804
25472
  },
24805
25473
  bodyCtxMenu() {
24806
- const bodyOpts = this.ctxMenuOpts.body;
25474
+ return this.computeBodyMenu;
25475
+ },
25476
+ computeBodyMenu() {
25477
+ const $xeTable = this;
25478
+ const menuOpts = $xeTable.computeMenuOpts;
25479
+ const bodyOpts = menuOpts.body;
24807
25480
  return bodyOpts && bodyOpts.options ? bodyOpts.options : [];
24808
25481
  },
24809
25482
  footerCtxMenu() {
24810
- const footerOpts = this.ctxMenuOpts.footer;
25483
+ return this.computeFooterMenu;
25484
+ },
25485
+ computeFooterMenu() {
25486
+ const $xeTable = this;
25487
+ const menuOpts = $xeTable.computeMenuOpts;
25488
+ const footerOpts = menuOpts.footer;
24811
25489
  return footerOpts && footerOpts.options ? footerOpts.options : [];
24812
25490
  },
24813
25491
  isCtxMenu() {
24814
- return !!((this.contextMenu || this.menuConfig) && isEnableConf(this.ctxMenuOpts) && (this.headerCtxMenu.length || this.bodyCtxMenu.length || this.footerCtxMenu.length));
25492
+ return this.computeIsMenu;
25493
+ },
25494
+ computeIsMenu() {
25495
+ const $xeTable = this;
25496
+ const props = $xeTable;
25497
+ const menuOpts = $xeTable.computeMenuOpts;
25498
+ const headerMenu = $xeTable.computeHeaderMenu;
25499
+ const bodyMenu = $xeTable.computeBodyMenu;
25500
+ const footerMenu = $xeTable.computeFooterMenu;
25501
+ return !!((props.contextMenu || props.menuConfig) && isEnableConf(menuOpts) && (headerMenu.length || bodyMenu.length || footerMenu.length));
24815
25502
  },
24816
25503
  ctxMenuList() {
25504
+ return this.computeMenuList;
25505
+ },
25506
+ computeMenuList() {
25507
+ const $xeTable = this;
25508
+ const reactData = $xeTable;
25509
+ const {
25510
+ ctxMenuStore
25511
+ } = reactData;
24817
25512
  const rest = [];
24818
- this.ctxMenuStore.list.forEach(list => {
25513
+ ctxMenuStore.list.forEach(list => {
24819
25514
  list.forEach(item => {
24820
25515
  rest.push(item);
24821
25516
  });
@@ -25028,7 +25723,7 @@ function renderBody(h, $xeTable) {
25028
25723
  if (value && value.length >= 50000) {
25029
25724
  warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
25030
25725
  }
25031
- this.loadTableData(value || []).then(() => {
25726
+ this.loadTableData(value || [], true).then(() => {
25032
25727
  this.inited = true;
25033
25728
  this.initStatus = true;
25034
25729
  if (!initStatus) {
@@ -25096,10 +25791,10 @@ function renderBody(h, $xeTable) {
25096
25791
  },
25097
25792
  syncResize(value) {
25098
25793
  if (value) {
25099
- handleUupdateResize(this);
25794
+ handleUpdateResize(this);
25100
25795
  this.$nextTick(() => {
25101
- handleUupdateResize(this);
25102
- setTimeout(() => handleUupdateResize(this));
25796
+ handleUpdateResize(this);
25797
+ setTimeout(() => handleUpdateResize(this));
25103
25798
  });
25104
25799
  }
25105
25800
  },
@@ -25211,11 +25906,14 @@ function renderBody(h, $xeTable) {
25211
25906
  if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(this.rowKey || rowOpts.useKey) || !showOverflow)) {
25212
25907
  warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow']);
25213
25908
  }
25909
+ if (treeConfig && !treeOpts.transform && this.stripe) {
25910
+ warnLog('vxe.error.noTree', ['stripe']);
25911
+ }
25214
25912
  if (this.showFooter && !(this.footerMethod || this.footerData)) {
25215
25913
  warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
25216
25914
  }
25217
- if (treeConfig && !treeOpts.transform && this.stripe) {
25218
- warnLog('vxe.error.noTree', ['stripe']);
25915
+ if (rowOpts.height) {
25916
+ warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
25219
25917
  }
25220
25918
  if (this.tooltipOpts.enabled) {
25221
25919
  warnLog('vxe.error.delProp', ['tooltip-config.enabled', 'tooltip-config.showAll']);
@@ -25362,7 +26060,7 @@ function renderBody(h, $xeTable) {
25362
26060
  endIndex: 1,
25363
26061
  visibleSize: 0
25364
26062
  });
25365
- this.loadTableData(data).then(() => {
26063
+ this.loadTableData(data, true).then(() => {
25366
26064
  if (data && data.length) {
25367
26065
  this.inited = true;
25368
26066
  this.initStatus = true;
@@ -25485,7 +26183,6 @@ function renderBody(h, $xeTable) {
25485
26183
  editRules
25486
26184
  } = props;
25487
26185
  const {
25488
- isCalcColumn,
25489
26186
  isGroup,
25490
26187
  overflowX,
25491
26188
  overflowY,
@@ -25495,15 +26192,15 @@ function renderBody(h, $xeTable) {
25495
26192
  initStore,
25496
26193
  columnStore,
25497
26194
  filterStore,
25498
- customStore,
25499
- tooltipStore
26195
+ customStore
25500
26196
  } = reactData;
25501
26197
  const {
25502
26198
  leftList,
25503
26199
  rightList
25504
26200
  } = columnStore;
25505
26201
  const loadingSlot = slots.loading;
25506
- const tooltipOpts = $xeTable.computeTooltipOpts;
26202
+ const tableTipConfig = $xeTable.computeTableTipConfig;
26203
+ const validTipConfig = $xeTable.computeValidTipConfig;
25507
26204
  const validOpts = $xeTable.computeValidOpts;
25508
26205
  const checkboxOpts = $xeTable.computeCheckboxOpts;
25509
26206
  const treeOpts = $xeTable.computeTreeOpts;
@@ -25515,7 +26212,7 @@ function renderBody(h, $xeTable) {
25515
26212
  const areaOpts = $xeTable.computeAreaOpts;
25516
26213
  const loadingOpts = $xeTable.computeLoadingOpts;
25517
26214
  const isMenu = $xeTable.computeIsMenu;
25518
- const currLoading = reactData.isLoading || loading;
26215
+ const currLoading = reactData.isColLoading || reactData.isRowLoading || loading;
25519
26216
  const resizableOpts = $xeTable.computeResizableOpts;
25520
26217
  const isArea = mouseConfig && mouseOpts.area;
25521
26218
  const columnDragOpts = $xeTable.computeColumnDragOpts;
@@ -25536,7 +26233,6 @@ function renderBody(h, $xeTable) {
25536
26233
  'row--highlight': rowOpts.isHover || highlightHoverRow,
25537
26234
  'column--highlight': columnOpts.isHover || highlightHoverColumn,
25538
26235
  'checkbox--range': checkboxOpts.range,
25539
- 'column--calc': isCalcColumn,
25540
26236
  'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
25541
26237
  'is--header': showHeader,
25542
26238
  'is--footer': showFooter,
@@ -25545,7 +26241,6 @@ function renderBody(h, $xeTable) {
25545
26241
  'is--fixed-left': leftList.length,
25546
26242
  'is--fixed-right': rightList.length,
25547
26243
  'is--animat': !!props.animat,
25548
- 'is--padding': props.padding,
25549
26244
  'is--round': props.round,
25550
26245
  'is--stripe': !treeConfig && stripe,
25551
26246
  'is--loading': currLoading,
@@ -25593,11 +26288,21 @@ function renderBody(h, $xeTable) {
25593
26288
  * 列宽线
25594
26289
  */
25595
26290
  h('div', {
25596
- key: 'cl',
25597
- ref: 'refCellResizeBar',
25598
- class: 'vxe-table--resizable-bar'
26291
+ key: 'tcl',
26292
+ ref: 'refColResizeBar',
26293
+ class: 'vxe-table--resizable-col-bar'
26294
+ }, resizableOpts.showDragTip ? [h('div', {
26295
+ ref: 'refColResizeTip',
26296
+ class: 'vxe-table--resizable-number-tip'
26297
+ })] : []),
26298
+ /**
26299
+ * 行高线
26300
+ */
26301
+ h('div', {
26302
+ key: 'trl',
26303
+ ref: 'refRowResizeBar',
26304
+ class: 'vxe-table--resizable-row-bar'
25599
26305
  }, resizableOpts.showDragTip ? [h('div', {
25600
- ref: 'refCellResizeTip',
25601
26306
  class: 'vxe-table--resizable-number-tip'
25602
26307
  })] : []),
25603
26308
  /**
@@ -25698,8 +26403,13 @@ function renderBody(h, $xeTable) {
25698
26403
  */
25699
26404
  VxeUITooltipComponent ? h(VxeUITooltipComponent, {
25700
26405
  key: 'btp',
25701
- ref: 'tooltip',
25702
- props: Object.assign({}, tooltipOpts, tooltipStore.currOpts)
26406
+ ref: 'refTooltip',
26407
+ props: {
26408
+ theme: tableTipConfig.theme,
26409
+ enterable: tableTipConfig.enterable,
26410
+ enterDelay: tableTipConfig.enterDelay,
26411
+ leaveDelay: tableTipConfig.leaveDelay
26412
+ }
25703
26413
  }) : table_renderEmptyElement($xeTable),
25704
26414
  /**
25705
26415
  * 校验提示
@@ -25710,9 +26420,12 @@ function renderBody(h, $xeTable) {
25710
26420
  class: [{
25711
26421
  'old-cell-valid': editRules && table_getConfig().cellVaildMode === 'obsolete'
25712
26422
  }, 'vxe-table--valid-error'],
25713
- props: validOpts.message === 'tooltip' || tableData.length === 1 ? Object.assign({
25714
- isArrow: false
25715
- }, tooltipOpts) : {}
26423
+ props: {
26424
+ theme: validTipConfig.theme,
26425
+ enterable: validTipConfig.enterable,
26426
+ enterDelay: validTipConfig.enterDelay,
26427
+ leaveDelay: validTipConfig.leaveDelay
26428
+ }
25716
26429
  }) : table_renderEmptyElement($xeTable)])]);
25717
26430
  },
25718
26431
  methods: methods
@@ -29367,7 +30080,8 @@ const Toolbar = VxeToolbar;
29367
30080
  customRestore: '恢复默认',
29368
30081
  maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
29369
30082
  dragTip: '移动:{0}',
29370
- resizeColTip: '{0} 像素'
30083
+ resizeColTip: '宽:{0} 像素',
30084
+ resizeRowTip: '高:{0} 像素'
29371
30085
  },
29372
30086
  grid: {
29373
30087
  selectOneRecord: '请至少选择一条记录!',