vxe-table 3.12.10-beta.9 → 3.12.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +114 -87
  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 +74 -58
  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 +1725 -1022
  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 +114 -80
  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 +88 -71
  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 +126 -90
  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 +83 -63
  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.1739008141486.ttf} +0 -0
  174. /package/es/{iconfont.1736854649055.woff → iconfont.1739008141486.woff} +0 -0
  175. /package/es/{iconfont.1736854649055.woff2 → iconfont.1739008141486.woff2} +0 -0
  176. /package/lib/{iconfont.1736854649055.ttf → iconfont.1739008141486.ttf} +0 -0
  177. /package/lib/{iconfont.1736854649055.woff → iconfont.1739008141486.woff} +0 -0
  178. /package/lib/{iconfont.1736854649055.woff2 → iconfont.1739008141486.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.11";
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.11"}`;
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 || rowRest.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,73 +3471,67 @@ 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.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
3442
3481
  for (let i = 0; i < afterFullData.length; i++) {
3443
3482
  const currRow = afterFullData[i];
3444
3483
  const currRowid = getRowid($xeTable, currRow);
3445
3484
  if (currRow === row || currRowid === rowid) {
3446
3485
  break;
3447
3486
  }
3448
- const rowRest = fullAllDataRowIdData[currRowid];
3449
- scrollTop += rowRest ? rowRest.height || rowHeight : rowHeight;
3487
+ const currRowRest = fullAllDataRowIdData[currRowid];
3488
+ scrollTop += currRowRest.resizeHeight || cellOpts.height || rowOpts.height || currRowRest.height || 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 || cellOpts.height || rowOpts.height || rowRest.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 || rowRest.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
+ }
9109
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 || cellOpts.height || rowOpts.height || rowRest.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
+ }
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 || cellOpts.height || rowOpts.height || rowRest.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) {
13717
- return;
13718
- }
13719
- if (inBodyScroll) {
14298
+ if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
13720
14299
  return;
13721
14300
  }
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) {
13764
- return;
13765
- }
13766
- if (inVirtualScroll) {
13767
- return;
13768
- }
13769
- if (inHeaderScroll) {
14343
+ if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
13770
14344
  return;
13771
14345
  }
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 || cellOpts.height || rowOpts.height || rowRest.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 || cellOpts.height || rowOpts.height || rowRest.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,14 @@ 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;
14671
15253
  const {
14672
15254
  disabledMethod: dragDisabledMethod,
14673
15255
  isCrossDrag,
@@ -14687,17 +15269,18 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14687
15269
  showOverflow,
14688
15270
  className,
14689
15271
  treeNode,
15272
+ rowResize,
15273
+ padding,
15274
+ verticalAlign,
14690
15275
  slots
14691
15276
  } = column;
14692
15277
  const {
14693
- verticalAlign
15278
+ verticalAlign: allVerticalAlign
14694
15279
  } = cellOpts;
14695
15280
  const {
14696
15281
  actived
14697
15282
  } = editStore;
14698
- const {
14699
- height: customRHeight
14700
- } = rowOpts;
15283
+ const rowRest = fullAllDataRowIdData[rowid];
14701
15284
  const colid = column.id;
14702
15285
  const renderOpts = editRender || cellRender;
14703
15286
  const compConf = renderOpts ? body_renderer.get(renderOpts.name) : null;
@@ -14707,23 +15290,27 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14707
15290
  const columnIndex = $xeTable.getColumnIndex(column);
14708
15291
  const _columnIndex = $xeTable.getVTColumnIndex(column);
14709
15292
  const isEdit = isEnableConf(editRender);
15293
+ const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
14710
15294
  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;
15295
+ const isCellPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(padding) ? allPadding === null ? cellOpts.padding : allPadding : padding;
15296
+ const cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showOverflow) ? isAllOverflow : showOverflow;
14712
15297
  const showEllipsis = cellOverflow === 'ellipsis';
14713
15298
  const showTitle = cellOverflow === 'title';
14714
15299
  const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
14715
- // 如果表格加上 showOverflow 则不再支持列单独设置
14716
- const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis;
15300
+ const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
15301
+ const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
15302
+ const isCsHeight = !!customCellHeight;
15303
+ const isRsHeight = resizeHeight > 0;
14717
15304
  let isDirty;
14718
15305
  const tdOns = {};
14719
- const rest = fullAllDataRowIdData[rowid];
14720
15306
  const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
15307
+ const cellVerticalAlign = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
14721
15308
  const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
14722
15309
  const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
14723
- const attrs = {
15310
+ const tdAttrs = {
14724
15311
  colid
14725
15312
  };
14726
- const params = {
15313
+ const cellParams = {
14727
15314
  $table: $xeTable,
14728
15315
  $grid: $xeTable.xegrid,
14729
15316
  isEdit: false,
@@ -14751,7 +15338,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14751
15338
  isRowDragCell = rowDragOpts.trigger === 'row' || column.dragSort && rowDragOpts.trigger === 'cell';
14752
15339
  }
14753
15340
  if (isRowDragCell) {
14754
- isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params));
15341
+ isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
14755
15342
  }
14756
15343
  // hover 进入事件
14757
15344
  if (showTitle || showTooltip || showAllTip || tooltipConfig) {
@@ -14763,11 +15350,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14763
15350
  updateCellTitle(evnt.currentTarget, column);
14764
15351
  } else if (showTooltip || showAllTip) {
14765
15352
  // 如果配置了显示 tooltip
14766
- $xeTable.triggerBodyTooltipEvent(evnt, params);
15353
+ $xeTable.triggerBodyTooltipEvent(evnt, cellParams);
14767
15354
  }
14768
15355
  $xeTable.dispatchEvent('cell-mouseenter', Object.assign({
14769
15356
  cell: evnt.currentTarget
14770
- }, params), evnt);
15357
+ }, cellParams), evnt);
14771
15358
  };
14772
15359
  }
14773
15360
  // hover 退出事件
@@ -14781,13 +15368,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14781
15368
  }
14782
15369
  $xeTable.dispatchEvent('cell-mouseleave', Object.assign({
14783
15370
  cell: evnt.currentTarget
14784
- }, params), evnt);
15371
+ }, cellParams), evnt);
14785
15372
  };
14786
15373
  }
14787
15374
  // 按下事件处理
14788
15375
  if (isRowDragCell || checkboxOpts.range || mouseConfig) {
14789
15376
  tdOns.mousedown = evnt => {
14790
- $xeTable.triggerCellMousedownEvent(evnt, params);
15377
+ $xeTable.triggerCellMousedownEvent(evnt, cellParams);
14791
15378
  };
14792
15379
  }
14793
15380
  // 拖拽列事件
@@ -14796,11 +15383,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14796
15383
  }
14797
15384
  // 点击事件处理
14798
15385
  tdOns.click = evnt => {
14799
- $xeTable.triggerCellClickEvent(evnt, params);
15386
+ $xeTable.triggerCellClickEvent(evnt, cellParams);
14800
15387
  };
14801
15388
  // 双击事件处理
14802
15389
  tdOns.dblclick = evnt => {
14803
- $xeTable.triggerCellDblclickEvent(evnt, params);
15390
+ $xeTable.triggerCellDblclickEvent(evnt, cellParams);
14804
15391
  };
14805
15392
  // 合并行或列
14806
15393
  if (mergeList.length) {
@@ -14814,10 +15401,10 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14814
15401
  return null;
14815
15402
  }
14816
15403
  if (rowspan > 1) {
14817
- attrs.rowspan = rowspan;
15404
+ tdAttrs.rowspan = rowspan;
14818
15405
  }
14819
15406
  if (colspan > 1) {
14820
- attrs.colspan = colspan;
15407
+ tdAttrs.colspan = colspan;
14821
15408
  }
14822
15409
  }
14823
15410
  } else if (spanMethod) {
@@ -14825,20 +15412,20 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14825
15412
  const {
14826
15413
  rowspan = 1,
14827
15414
  colspan = 1
14828
- } = spanMethod(params) || {};
15415
+ } = spanMethod(cellParams) || {};
14829
15416
  if (!rowspan || !colspan) {
14830
15417
  return null;
14831
15418
  }
14832
15419
  if (rowspan > 1) {
14833
- attrs.rowspan = rowspan;
15420
+ tdAttrs.rowspan = rowspan;
14834
15421
  }
14835
15422
  if (colspan > 1) {
14836
- attrs.colspan = colspan;
15423
+ tdAttrs.colspan = colspan;
14837
15424
  }
14838
15425
  }
14839
15426
  // 如果被合并不可隐藏
14840
15427
  if (fixedHiddenColumn && mergeList) {
14841
- if (attrs.colspan > 1 || attrs.rowspan > 1) {
15428
+ if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
14842
15429
  fixedHiddenColumn = false;
14843
15430
  }
14844
15431
  }
@@ -14847,28 +15434,25 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14847
15434
  isDirty = $xeTable.isUpdateByRow(row, column.field);
14848
15435
  }
14849
15436
  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
- }
14858
- } else {
14859
- cellHeight = vnHeight || defaultRowHeight || 18;
15437
+ const cellHeight = calcCellHeightFlag ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight : defaultRowHeight;
15438
+ const isLastColumn = $columnIndex === columns.length - 1;
15439
+ const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
15440
+ let isVNPreEmptyStatus = false;
15441
+ if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
15442
+ isVNPreEmptyStatus = true;
15443
+ } else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
15444
+ isVNPreEmptyStatus = true;
14860
15445
  }
14861
15446
  const tcStyle = {};
14862
- if (cellHeight) {
14863
- if (hasEllipsis) {
14864
- tcStyle.maxHeight = `${cellHeight}px`;
14865
- } else if (isVNAutoHeight) {
14866
- tcStyle.height = `${cellHeight}px`;
14867
- }
15447
+ if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
15448
+ tcStyle.height = `${cellHeight}px`;
15449
+ } else {
15450
+ tcStyle.minHeight = `${cellHeight}px`;
14868
15451
  }
14869
15452
  const tdVNs = [];
14870
- if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
15453
+ if (fixedHiddenColumn && isAllOverflow) {
14871
15454
  tdVNs.push(h('div', {
15455
+ key: 'tc',
14872
15456
  class: ['vxe-cell', {
14873
15457
  'c--title': showTitle,
14874
15458
  'c--tooltip': showTooltip,
@@ -14878,7 +15462,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14878
15462
  }));
14879
15463
  } else {
14880
15464
  // 渲染单元格
14881
- tdVNs.push(...renderLine(h, _vm, params), h('div', {
15465
+ tdVNs.push(...renderLine(h, _vm, cellParams, cellHeight), h('div', {
15466
+ key: 'tc',
14882
15467
  class: ['vxe-cell', {
14883
15468
  'c--title': showTitle,
14884
15469
  'c--tooltip': showTooltip,
@@ -14888,18 +15473,23 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14888
15473
  attrs: {
14889
15474
  title: showTitle ? $xeTable.getCellLabel(row, column) : null
14890
15475
  }
14891
- }, isVNAutoHeight ? [h('div', {
14892
- class: 'vxe-cell--auto-wrapper'
14893
- }, column.renderCell(h, params))] : column.renderCell(h, params)));
15476
+ }, isVNPreEmptyStatus ? [] : [h('div', {
15477
+ attrs: {
15478
+ colid,
15479
+ rowid
15480
+ },
15481
+ class: 'vxe-cell--wrapper'
15482
+ }, column.renderCell(h, cellParams))]));
14894
15483
  if (showValidTip && errorValidItem) {
14895
15484
  const errRule = errorValidItem.rule;
14896
15485
  const validSlot = slots ? slots.valid : null;
14897
15486
  const validParams = {
14898
- ...params,
15487
+ ...cellParams,
14899
15488
  ...errorValidItem,
14900
15489
  rule: errorValidItem
14901
15490
  };
14902
15491
  tdVNs.push(h('div', {
15492
+ key: 'tcv',
14903
15493
  class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
14904
15494
  style: errRule && errRule.maxWidth ? {
14905
15495
  width: `${errRule.maxWidth}px`
@@ -14911,47 +15501,59 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
14911
15501
  }, errorValidItem.content)]])]));
14912
15502
  }
14913
15503
  }
15504
+ let showAreaRowStatus = false;
14914
15505
  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
- }));
15506
+ if (!_columnIndex && selectCellToRow === true || selectCellToRow === column.field) {
15507
+ showAreaRowStatus = true;
14919
15508
  }
14920
15509
  }
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;
15510
+ if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
15511
+ tdVNs.push(h('div', {
15512
+ key: 'tcc',
15513
+ class: ['vxe-cell--col-resizable', {
15514
+ 'is--line': !border || border === 'none'
15515
+ }],
15516
+ on: {
15517
+ mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
15518
+ dblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
15519
+ }
15520
+ }));
15521
+ }
15522
+ if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
15523
+ tdVNs.push(h('div', {
15524
+ key: 'tcr',
15525
+ class: 'vxe-cell--row-resizable',
15526
+ on: {
15527
+ mousedown: evnt => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
15528
+ dblclick: evnt => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
15529
+ }
15530
+ }));
14928
15531
  }
14929
15532
  return h('td', {
14930
- class: ['vxe-body--column', column.id, {
14931
- [`col--${cellAlign}`]: cellAlign,
14932
- [`col--vertical-${verticalAlign}`]: verticalAlign,
14933
- [`col--${type}`]: type,
15533
+ class: ['vxe-body--column', colid, cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '', cellAlign ? `col--${cellAlign}` : '', type ? `col--${type}` : '', {
14934
15534
  'col--last': isLastColumn,
14935
15535
  'col--tree-node': treeNode,
14936
15536
  'col--edit': isEdit,
14937
15537
  'col--ellipsis': hasEllipsis,
15538
+ 'col--cs-height': isCsHeight,
15539
+ 'col--rs-height': isRsHeight,
15540
+ 'col--to-row': showAreaRowStatus,
14938
15541
  'col--auto-height': isVNAutoHeight,
14939
15542
  'fixed--width': !isAutoCellWidth,
14940
15543
  'fixed--hidden': fixedHiddenColumn,
15544
+ 'is--padding': isCellPadding,
14941
15545
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
14942
15546
  'is--drag-disabled': isDisabledDrag,
14943
15547
  'col--dirty': isDirty,
14944
15548
  'col--active': editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row'),
14945
15549
  'col--valid-error': !!errorValidItem,
14946
15550
  'col--current': currentColumn === column
14947
- }, getClass(compCellClassName, params), getClass(className, params), getClass(allCellClassName, params)],
15551
+ }, getClass(compCellClassName, cellParams), getClass(className, cellParams), getClass(allCellClassName, cellParams)],
14948
15552
  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),
15553
+ attrs: tdAttrs,
15554
+ 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
15555
  on: tdOns
14954
- }, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
15556
+ }, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
14955
15557
  }
14956
15558
  function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
14957
15559
  const $xeTable = _vm.$parent;
@@ -14964,15 +15566,16 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
14964
15566
  highlightHoverRow,
14965
15567
  rowClassName,
14966
15568
  rowStyle,
14967
- showOverflow: allColumnOverflow,
14968
15569
  editConfig,
14969
15570
  treeConfig
14970
15571
  } = tableProps;
14971
15572
  const {
14972
15573
  hasFixedColumn,
14973
15574
  treeExpandedMaps,
15575
+ isColLoading,
14974
15576
  scrollXLoad,
14975
15577
  scrollYLoad,
15578
+ isAllOverflow,
14976
15579
  rowExpandedMaps,
14977
15580
  expandColumn,
14978
15581
  selectRadioRow,
@@ -15077,7 +15680,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15077
15680
  const tdVNs = tableColumn.map((column, $columnIndex) => {
15078
15681
  return renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
15079
15682
  });
15080
- rows.push(columnOpts.drag && columnDragOpts.animation ? h('transition-group', {
15683
+ rows.push(!isColLoading && columnOpts.drag && columnDragOpts.animation ? h('transition-group', {
15081
15684
  props: {
15082
15685
  tag: 'tr',
15083
15686
  name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`
@@ -15115,7 +15718,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15115
15718
  const {
15116
15719
  showOverflow
15117
15720
  } = 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;
15721
+ 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
15722
  const expandParams = {
15120
15723
  $table: $xeTable,
15121
15724
  seq,
@@ -15227,7 +15830,6 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15227
15830
  tableColumn
15228
15831
  } = props;
15229
15832
  const {
15230
- showOverflow: allColumnOverflow,
15231
15833
  spanMethod,
15232
15834
  footerSpanMethod,
15233
15835
  mouseConfig
@@ -15235,6 +15837,8 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15235
15837
  const {
15236
15838
  isGroup,
15237
15839
  tableData,
15840
+ isRowLoading,
15841
+ isColLoading,
15238
15842
  scrollXLoad,
15239
15843
  scrollYLoad,
15240
15844
  isAllOverflow,
@@ -15258,7 +15862,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15258
15862
  let renderColumnList = tableColumn;
15259
15863
  let isOptimizeMode = false;
15260
15864
  // 如果是使用优化模式
15261
- if (scrollXLoad || scrollYLoad || allColumnOverflow && isAllOverflow) {
15865
+ if (scrollXLoad || scrollYLoad || isAllOverflow) {
15262
15866
  if (expandColumn || spanMethod || footerSpanMethod) {
15263
15867
  // 如果不支持优化模式
15264
15868
  } else {
@@ -15382,9 +15986,9 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15382
15986
  });
15383
15987
  })),
15384
15988
  /**
15385
- * 内容
15386
- */
15387
- rowOpts.drag && rowDragOpts.animation ? h('transition-group', {
15989
+ * 内容
15990
+ */
15991
+ !(isRowLoading || isColLoading) && rowOpts.drag && rowDragOpts.animation ? h('transition-group', {
15388
15992
  ref: 'refBodyTBody',
15389
15993
  props: {
15390
15994
  tag: 'tbody',
@@ -15419,6 +16023,8 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15419
16023
  class: 'vxe-table--cell-multi-area'
15420
16024
  }), h('span', {
15421
16025
  class: 'vxe-table--cell-active-area'
16026
+ }), h('span', {
16027
+ class: 'vxe-table--cell-row-status-area'
15422
16028
  })]) : body_renderEmptyElement($xeTable), !fixedType ? h('div', {
15423
16029
  class: 'vxe-table--empty-block',
15424
16030
  ref: 'emptyBlock'
@@ -15432,9 +16038,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15432
16038
 
15433
16039
 
15434
16040
 
15435
-
15436
16041
  const {
15437
- getI18n: header_getI18n,
15438
16042
  renderer: header_renderer,
15439
16043
  renderEmptyElement: header_renderEmptyElement
15440
16044
  } = core_.VxeUI;
@@ -15471,6 +16075,10 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15471
16075
  } = tableInternalData;
15472
16076
  const columnOpts = $xeTable.computeColumnOpts;
15473
16077
  const columnDragOpts = $xeTable.computeColumnDragOpts;
16078
+ const cellOpts = $xeTable.computeCellOpts;
16079
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
16080
+ const headerCellOpts = $xeTable.computeHeaderCellOpts;
16081
+ const currCellHeight = getCellHeight(headerCellOpts.height || cellOpts.height) || defaultRowHeight;
15474
16082
  const {
15475
16083
  disabledMethod: dragDisabledMethod,
15476
16084
  isCrossDrag,
@@ -15493,6 +16101,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15493
16101
  const compConf = renderOpts ? header_renderer.get(renderOpts.name) : null;
15494
16102
  const isColGroup = column.children && column.children.length;
15495
16103
  const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
16104
+ const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding;
15496
16105
  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
16106
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
15498
16107
  let showEllipsis = headOverflow === 'ellipsis';
@@ -15507,7 +16116,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15507
16116
  }
15508
16117
  const columnIndex = $xeTable.getColumnIndex(column);
15509
16118
  const _columnIndex = $xeTable.getVTColumnIndex(column);
15510
- const params = {
16119
+ const cellParams = {
15511
16120
  $table: $xeTable,
15512
16121
  $grid: $xeGrid,
15513
16122
  $rowIndex,
@@ -15527,8 +16136,8 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15527
16136
  rowspan: column.rowSpan > 1 ? column.rowSpan : null
15528
16137
  };
15529
16138
  const thOns = {
15530
- click: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, params),
15531
- dblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, params)
16139
+ click: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, cellParams),
16140
+ dblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, cellParams)
15532
16141
  };
15533
16142
  // 虚拟滚动不支持动态高度
15534
16143
  if (scrollXLoad && !hasEllipsis) {
@@ -15537,11 +16146,11 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15537
16146
  const isColDragCell = columnOpts.drag && columnDragOpts.trigger === 'cell';
15538
16147
  let isDisabledDrag = false;
15539
16148
  if (isColDragCell) {
15540
- isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params));
16149
+ isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
15541
16150
  }
15542
16151
  // 按下事件处理
15543
16152
  if (mouseConfig || isColDragCell) {
15544
- thOns.mousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, params);
16153
+ thOns.mousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, cellParams);
15545
16154
  }
15546
16155
  // 拖拽列事件
15547
16156
  if (columnOpts.drag) {
@@ -15559,6 +16168,12 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15559
16168
  if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
15560
16169
  isVNPreEmptyStatus = true;
15561
16170
  }
16171
+ const tcStyle = {};
16172
+ if (hasEllipsis) {
16173
+ tcStyle.height = `${currCellHeight}px`;
16174
+ } else {
16175
+ tcStyle.minHeight = `${currCellHeight}px`;
16176
+ }
15562
16177
  return h('th', {
15563
16178
  class: ['vxe-header--column', colid, {
15564
16179
  [`col--${headAlign}`]: headAlign,
@@ -15569,15 +16184,16 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15569
16184
  'col--ellipsis': hasEllipsis,
15570
16185
  'fixed--width': !isAutoCellWidth,
15571
16186
  'fixed--hidden': fixedHiddenColumn,
16187
+ 'is--padding': isPadding,
15572
16188
  'is--sortable': column.sortable,
15573
16189
  'col--filter': !!filters,
15574
16190
  'is--filter-active': hasFilter,
15575
16191
  'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
15576
16192
  'is--drag-disabled': isDisabledDrag,
15577
16193
  'col--current': currentColumn === column
15578
- }, getClass(headerClassName, params), getClass(headerCellClassName, params)],
16194
+ }, getClass(headerClassName, cellParams), getClass(headerCellClassName, cellParams)],
15579
16195
  attrs: thAttrs,
15580
- style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : undefined,
16196
+ style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(cellParams) : headerCellStyle : undefined,
15581
16197
  on: thOns,
15582
16198
  key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
15583
16199
  }, [h('div', {
@@ -15585,18 +16201,24 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
15585
16201
  'c--title': showTitle,
15586
16202
  'c--tooltip': showTooltip,
15587
16203
  'c--ellipsis': showEllipsis
15588
- }]
15589
- }, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : column.renderHeader(h, params)),
16204
+ }],
16205
+ style: tcStyle
16206
+ }, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : [h('div', {
16207
+ attrs: {
16208
+ colid
16209
+ },
16210
+ class: 'vxe-cell--wrapper'
16211
+ }, column.renderHeader(h, cellParams))]),
15590
16212
  /**
15591
16213
  * 列宽拖动
15592
16214
  */
15593
16215
  !fixedHiddenColumn && showResizable ? h('div', {
15594
- class: ['vxe-resizable', {
16216
+ class: ['vxe-cell--col-resizable', {
15595
16217
  'is--line': !border || border === 'none'
15596
16218
  }],
15597
16219
  on: {
15598
- mousedown: evnt => _vm.resizeMousedownEvent(evnt, params),
15599
- dblclick: evnt => $xeTable.handleResizeDblclickEvent(evnt, params)
16220
+ mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
16221
+ dblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
15600
16222
  }
15601
16223
  }) : header_renderEmptyElement($xeTable)]);
15602
16224
  });
@@ -15616,6 +16238,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15616
16238
  headerRowStyle
15617
16239
  } = tableProps;
15618
16240
  const {
16241
+ isColLoading,
15619
16242
  isDragColMove
15620
16243
  } = tableReactData;
15621
16244
  return headerGroups.map((cols, $rowIndex) => {
@@ -15625,7 +16248,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15625
16248
  fixed: fixedType,
15626
16249
  type: cellType
15627
16250
  };
15628
- if (columnOpts.drag && columnDragOpts.animation) {
16251
+ if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
15629
16252
  return h('transition-group', {
15630
16253
  key: $rowIndex,
15631
16254
  props: {
@@ -15725,6 +16348,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15725
16348
  headerColumn
15726
16349
  } = this;
15727
16350
  const {
16351
+ mouseConfig,
15728
16352
  showHeaderOverflow: allColumnHeaderOverflow,
15729
16353
  spanMethod,
15730
16354
  footerSpanMethod
@@ -15739,6 +16363,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15739
16363
  visibleColumn,
15740
16364
  fullColumnIdData
15741
16365
  } = tableInternalData;
16366
+ const mouseOpts = $xeTable.computeMouseOpts;
15742
16367
  let renderHeaderList = headerColumn;
15743
16368
  let renderColumnList = tableColumn;
15744
16369
  let isOptimizeMode = false;
@@ -15833,14 +16458,21 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15833
16458
  */
15834
16459
  h('thead', {
15835
16460
  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
- })])]);
16461
+ }, renderHeads(h, this, isGroup, isOptimizeMode, renderHeaderList)), mouseConfig && mouseOpts.area ? h('div', {
16462
+ class: 'vxe-table--cell-area'
16463
+ }, [h('span', {
16464
+ class: 'vxe-table--cell-main-area'
16465
+ }), h('span', {
16466
+ class: 'vxe-table--cell-copy-area'
16467
+ }), h('span', {
16468
+ class: 'vxe-table--cell-extend-area'
16469
+ }), h('span', {
16470
+ class: 'vxe-table--cell-multi-area'
16471
+ }), h('span', {
16472
+ class: 'vxe-table--cell-active-area'
16473
+ }), h('span', {
16474
+ class: 'vxe-table--cell-col-status-area'
16475
+ })]) : header_renderEmptyElement($xeTable)])])]);
15844
16476
  },
15845
16477
  methods: {
15846
16478
  uploadColumn() {
@@ -15848,156 +16480,6 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
15848
16480
  $parent: $xetable
15849
16481
  } = this;
15850
16482
  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
16483
  }
16002
16484
  }
16003
16485
  });
@@ -16006,6 +16488,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
16006
16488
 
16007
16489
 
16008
16490
 
16491
+
16009
16492
  const footer_renderType = 'footer';
16010
16493
  const {
16011
16494
  renderer: footer_renderer,
@@ -16045,6 +16528,8 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16045
16528
  fixedType
16046
16529
  } = props;
16047
16530
  const {
16531
+ resizable: allResizable,
16532
+ border,
16048
16533
  footerCellClassName,
16049
16534
  footerCellStyle,
16050
16535
  footerAlign: allFooterAlign,
@@ -16064,7 +16549,14 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16064
16549
  scrollXStore
16065
16550
  } = tableInternalData;
16066
16551
  const tooltipOpts = $xeTable.computeTooltipOpts;
16552
+ const {
16553
+ isAllColumnDrag
16554
+ } = $xeTable.resizableOpts;
16067
16555
  const columnOpts = $xeTable.computeColumnOpts;
16556
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
16557
+ const cellOpts = $xeTable.computeCellOpts;
16558
+ const footerCellOpts = $xeTable.computeFooterCellOpts;
16559
+ const currCellHeight = getCellHeight(footerCellOpts.height || cellOpts.height) || defaultRowHeight;
16068
16560
  return tableColumn.map((column, $columnIndex) => {
16069
16561
  const {
16070
16562
  type,
@@ -16075,19 +16567,22 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16075
16567
  editRender,
16076
16568
  cellRender
16077
16569
  } = column;
16570
+ const colid = column.id;
16078
16571
  const renderOpts = editRender || cellRender;
16079
16572
  const compConf = renderOpts ? footer_renderer.get(renderOpts.name) : null;
16080
16573
  const showAllTip = tooltipOpts.showAll;
16081
16574
  const isColGroup = column.children && column.children.length;
16082
16575
  const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
16576
+ const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding;
16083
16577
  const footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
16084
16578
  const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
16085
16579
  let showEllipsis = footOverflow === 'ellipsis';
16086
16580
  const showTitle = footOverflow === 'title';
16087
16581
  const showTooltip = footOverflow === true || footOverflow === 'tooltip';
16088
16582
  let hasEllipsis = showTitle || showTooltip || showEllipsis;
16583
+ const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
16089
16584
  const attrs = {
16090
- colid: column.id
16585
+ colid
16091
16586
  };
16092
16587
  const tfOns = {};
16093
16588
  const columnIndex = $xeTable.getColumnIndex(column);
@@ -16180,6 +16675,12 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16180
16675
  if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
16181
16676
  isVNPreEmptyStatus = true;
16182
16677
  }
16678
+ const tcStyle = {};
16679
+ if (hasEllipsis) {
16680
+ tcStyle.height = `${currCellHeight}px`;
16681
+ } else {
16682
+ tcStyle.minHeight = `${currCellHeight}px`;
16683
+ }
16183
16684
  return h('td', {
16184
16685
  class: ['vxe-footer--column', column.id, {
16185
16686
  [`col--${footAlign}`]: footAlign,
@@ -16187,6 +16688,7 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16187
16688
  'col--last': isLastColumn,
16188
16689
  'fixed--width': !isAutoCellWidth,
16189
16690
  'fixed--hidden': fixedHiddenColumn,
16691
+ 'is--padding': isPadding,
16190
16692
  'col--ellipsis': hasEllipsis,
16191
16693
  'col--current': currentColumn === column
16192
16694
  }, getClass(footerClassName, cellParams), getClass(footerCellClassName, cellParams)],
@@ -16199,8 +16701,26 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
16199
16701
  'c--title': showTitle,
16200
16702
  'c--tooltip': showTooltip,
16201
16703
  'c--ellipsis': showEllipsis
16202
- }]
16203
- }, isVNPreEmptyStatus ? [] : column.renderFooter(h, cellParams))]);
16704
+ }],
16705
+ style: tcStyle
16706
+ }, isVNPreEmptyStatus ? [] : [h('div', {
16707
+ attrs: {
16708
+ colid
16709
+ },
16710
+ class: 'vxe-cell--wrapper'
16711
+ }, column.renderFooter(h, cellParams))]),
16712
+ /**
16713
+ * 列宽拖动
16714
+ */
16715
+ !fixedHiddenColumn && showResizable && isAllColumnDrag ? h('div', {
16716
+ class: ['vxe-cell--col-resizable', {
16717
+ 'is--line': !border || border === 'none'
16718
+ }],
16719
+ on: {
16720
+ mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
16721
+ dblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
16722
+ }
16723
+ }) : footer_renderEmptyElement($xeTable)]);
16204
16724
  });
16205
16725
  }
16206
16726
  function footer_renderHeads(h, _vm, renderColumnList) {
@@ -16217,6 +16737,7 @@ function footer_renderHeads(h, _vm, renderColumnList) {
16217
16737
  footerRowStyle
16218
16738
  } = tableProps;
16219
16739
  const {
16740
+ isColLoading,
16220
16741
  isDragColMove
16221
16742
  } = tableReactData;
16222
16743
  const columnOpts = $xeTable.computeColumnOpts;
@@ -16231,7 +16752,7 @@ function footer_renderHeads(h, _vm, renderColumnList) {
16231
16752
  fixed: fixedType,
16232
16753
  type: footer_renderType
16233
16754
  };
16234
- if (columnOpts.drag && columnDragOpts.animation) {
16755
+ if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
16235
16756
  return h('transition-group', {
16236
16757
  key: $rowIndex,
16237
16758
  props: {
@@ -16457,10 +16978,10 @@ const {
16457
16978
  type: [Boolean, String],
16458
16979
  default: () => props_getConfig().table.border
16459
16980
  },
16460
- // 单元格是否有边距
16981
+ // 已废弃,被 cell-config.padding 替换
16461
16982
  padding: {
16462
16983
  type: Boolean,
16463
- default: () => props_getConfig().table.padding
16984
+ default: null
16464
16985
  },
16465
16986
  // 是否圆角边框
16466
16987
  round: {
@@ -16509,12 +17030,18 @@ const {
16509
17030
  type: Boolean,
16510
17031
  default: () => props_getConfig().table.highlightHoverRow
16511
17032
  },
16512
- // 已废弃,被 column-config.isCurrent 替换
17033
+ /**
17034
+ * (即将废弃)是否要高亮当前选中列
17035
+ * @deprecated
17036
+ */
16513
17037
  highlightCurrentColumn: {
16514
17038
  type: Boolean,
16515
17039
  default: () => props_getConfig().table.highlightCurrentColumn
16516
17040
  },
16517
- // 已废弃,被 column-config.isHover 替换
17041
+ /**
17042
+ * (即将废弃)鼠标移到列是否要高亮显示
17043
+ * @deprecated
17044
+ */
16518
17045
  highlightHoverColumn: {
16519
17046
  type: Boolean,
16520
17047
  default: () => props_getConfig().table.highlightHoverColumn
@@ -16606,6 +17133,10 @@ const {
16606
17133
  columnConfig: Object,
16607
17134
  // 单元格配置信息
16608
17135
  cellConfig: Object,
17136
+ // 表头单元格配置信息
17137
+ headerCellConfig: Object,
17138
+ // 表尾单元格配置信息
17139
+ footerCellConfig: Object,
16609
17140
  // 行配置信息
16610
17141
  rowConfig: Object,
16611
17142
  // 已废弃,被 rowDragConfig 替换
@@ -19398,6 +19929,8 @@ const {
19398
19929
  * 快捷菜单事件处理
19399
19930
  */
19400
19931
  handleGlobalContextmenuEvent(evnt) {
19932
+ const $xeTable = this;
19933
+ const internalData = $xeTable;
19401
19934
  const {
19402
19935
  $refs,
19403
19936
  tId,
@@ -19418,7 +19951,7 @@ const {
19418
19951
  evnt.preventDefault();
19419
19952
  return;
19420
19953
  }
19421
- if (this._keyCtx) {
19954
+ if (internalData._keyCtx) {
19422
19955
  const type = 'body';
19423
19956
  const params = {
19424
19957
  type,
@@ -19736,6 +20269,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
19736
20269
  parent: parentRow,
19737
20270
  level: parentLevel + 1,
19738
20271
  height: 0,
20272
+ resizeHeight: 0,
19739
20273
  oTop: 0
19740
20274
  };
19741
20275
  fullDataRowIdData[rowid] = rest;
@@ -19760,6 +20294,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
19760
20294
  parent: null,
19761
20295
  level: 0,
19762
20296
  height: 0,
20297
+ resizeHeight: 0,
19763
20298
  oTop: 0
19764
20299
  };
19765
20300
  fullDataRowIdData[rowid] = rest;
@@ -19818,6 +20353,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
19818
20353
  parent: null,
19819
20354
  level: 0,
19820
20355
  height: 0,
20356
+ resizeHeight: 0,
19821
20357
  oTop: 0
19822
20358
  };
19823
20359
  fullDataRowIdData[rowid] = rest;
@@ -19855,6 +20391,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
19855
20391
  parent: null,
19856
20392
  level: 0,
19857
20393
  height: 0,
20394
+ resizeHeight: 0,
19858
20395
  oTop: 0
19859
20396
  };
19860
20397
  fullDataRowIdData[rowid] = rest;
@@ -19915,6 +20452,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
19915
20452
  parent: parentRow,
19916
20453
  level: parentLevel + 1,
19917
20454
  height: 0,
20455
+ resizeHeight: 0,
19918
20456
  oTop: 0
19919
20457
  };
19920
20458
  fullDataRowIdData[rowid] = rest;
@@ -19989,7 +20527,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
19989
20527
  const rowid = getRowid($xeTable, newRow);
19990
20528
  insertMaps[rowid] = newRow;
19991
20529
  });
19992
- $xeTable.cacheRowMap();
20530
+ $xeTable.cacheRowMap(false);
19993
20531
  $xeTable.updateScrollYStatus();
19994
20532
  $xeTable.handleTableData(treeConfig && transform);
19995
20533
  if (!(treeConfig && transform)) {
@@ -20201,7 +20739,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
20201
20739
  }
20202
20740
  });
20203
20741
  $xeTable.updateFooter();
20204
- $xeTable.cacheRowMap();
20742
+ $xeTable.cacheRowMap(false);
20205
20743
  $xeTable.handleTableData(treeConfig && transform);
20206
20744
  if (!(treeConfig && transform)) {
20207
20745
  $xeTable.updateAfterDataIndex();
@@ -21575,7 +22113,21 @@ function getTxtCellValue(val, vMaps) {
21575
22113
  const rest = replaceTxtCell(val, vMaps);
21576
22114
  return rest.replace(/^"+$/g, qVal => '"'.repeat(Math.ceil(qVal.length / 2)));
21577
22115
  }
21578
- function parseCsvAndTxt(columns, content, cellSeparator) {
22116
+ function toExportField(tableConf, field) {
22117
+ const {
22118
+ fieldMaps,
22119
+ titleMaps
22120
+ } = tableConf;
22121
+ // title 转 field
22122
+ if (!fieldMaps[field]) {
22123
+ const teCol = titleMaps[field];
22124
+ if (teCol && teCol.field) {
22125
+ field = teCol.field;
22126
+ }
22127
+ }
22128
+ return field;
22129
+ }
22130
+ function parseCsvAndTxt(tableConf, content, cellSeparator) {
21579
22131
  const list = content.split(enterSymbol);
21580
22132
  const rows = [];
21581
22133
  let fields = [];
@@ -21596,11 +22148,11 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
21596
22148
  });
21597
22149
  const cells = rVal.split(cellSeparator);
21598
22150
  if (!fields.length) {
21599
- fields = cells.map(val => getTxtCellValue(val.trim(), vMaps));
22151
+ fields = cells.map(val => toExportField(tableConf, getTxtCellValue(val.trim(), vMaps)));
21600
22152
  } else {
21601
22153
  cells.forEach((val, colIndex) => {
21602
22154
  if (colIndex < fields.length) {
21603
- item[fields[colIndex]] = getTxtCellValue(val, vMaps);
22155
+ item[fields[colIndex]] = getTxtCellValue(val.trim(), vMaps);
21604
22156
  }
21605
22157
  });
21606
22158
  rows.push(item);
@@ -21613,13 +22165,13 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
21613
22165
  rows
21614
22166
  };
21615
22167
  }
21616
- function parseCsv(columns, content) {
21617
- return parseCsvAndTxt(columns, content, ',');
22168
+ function parseCsv(tableConf, content) {
22169
+ return parseCsvAndTxt(tableConf, content, ',');
21618
22170
  }
21619
- function parseTxt(columns, content) {
21620
- return parseCsvAndTxt(columns, content, '\t');
22171
+ function parseTxt(tableConf, content) {
22172
+ return parseCsvAndTxt(tableConf, content, '\t');
21621
22173
  }
21622
- function parseHTML(columns, content) {
22174
+ function parseHTML(tableConf, content) {
21623
22175
  const domParser = new DOMParser();
21624
22176
  const xmlDoc = domParser.parseFromString(content, 'text/html');
21625
22177
  const bodyNodes = getElementsByTagName(xmlDoc, 'body');
@@ -21632,7 +22184,7 @@ function parseHTML(columns, content) {
21632
22184
  if (theadNodes.length) {
21633
22185
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(theadNodes[0], 'tr'), rowNode => {
21634
22186
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNode, 'th'), cellNode => {
21635
- fields.push(cellNode.textContent);
22187
+ fields.push(toExportField(tableConf, cellNode.textContent || ''));
21636
22188
  });
21637
22189
  });
21638
22190
  const tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
@@ -21655,7 +22207,7 @@ function parseHTML(columns, content) {
21655
22207
  rows
21656
22208
  };
21657
22209
  }
21658
- function parseXML(columns, content) {
22210
+ function parseXML(tableConf, content) {
21659
22211
  const domParser = new DOMParser();
21660
22212
  const xmlDoc = domParser.parseFromString(content, 'application/xml');
21661
22213
  const sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
@@ -21667,7 +22219,7 @@ function parseXML(columns, content) {
21667
22219
  const rowNodes = getElementsByTagName(tableNodes[0], 'Row');
21668
22220
  if (rowNodes.length) {
21669
22221
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), cellNode => {
21670
- fields.push(cellNode.textContent);
22222
+ fields.push(toExportField(tableConf, cellNode.textContent || ''));
21671
22223
  });
21672
22224
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(rowNodes, (rowNode, index) => {
21673
22225
  if (index) {
@@ -21689,60 +22241,62 @@ function parseXML(columns, content) {
21689
22241
  rows
21690
22242
  };
21691
22243
  }
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) {
22244
+ function handleImport($xeTable, content, opts) {
22245
+ const internalData = $xeTable;
21708
22246
  const {
21709
22247
  tableFullColumn,
21710
22248
  _importResolve,
21711
22249
  _importReject
21712
- } = $xetable;
22250
+ } = internalData;
21713
22251
  let rest = {
21714
22252
  fields: [],
21715
22253
  rows: []
21716
22254
  };
22255
+ const tableFieldMaps = {};
22256
+ const tableTitleMaps = {};
22257
+ tableFullColumn.forEach(column => {
22258
+ const field = column.field;
22259
+ const title = column.getTitle();
22260
+ if (field) {
22261
+ tableFieldMaps[field] = column;
22262
+ }
22263
+ if (title) {
22264
+ tableTitleMaps[column.getTitle()] = column;
22265
+ }
22266
+ });
22267
+ const tableConf = {
22268
+ fieldMaps: tableFieldMaps,
22269
+ titleMaps: tableTitleMaps
22270
+ };
21717
22271
  switch (opts.type) {
21718
22272
  case 'csv':
21719
- rest = parseCsv(tableFullColumn, content);
22273
+ rest = parseCsv(tableConf, content);
21720
22274
  break;
21721
22275
  case 'txt':
21722
- rest = parseTxt(tableFullColumn, content);
22276
+ rest = parseTxt(tableConf, content);
21723
22277
  break;
21724
22278
  case 'html':
21725
- rest = parseHTML(tableFullColumn, content);
22279
+ rest = parseHTML(tableConf, content);
21726
22280
  break;
21727
22281
  case 'xml':
21728
- rest = parseXML(tableFullColumn, content);
22282
+ rest = parseXML(tableConf, content);
21729
22283
  break;
21730
22284
  }
21731
22285
  const {
21732
22286
  fields,
21733
22287
  rows
21734
22288
  } = rest;
21735
- const status = checkImportData(tableFullColumn, fields);
22289
+ const status = fields.some(field => tableFieldMaps[field] || tableTitleMaps[field]);
21736
22290
  if (status) {
21737
- $xetable.createData(rows).then(data => {
22291
+ $xeTable.createData(rows).then(data => {
21738
22292
  let loadRest;
21739
22293
  if (opts.mode === 'insert' || opts.mode === 'insertBottom') {
21740
- loadRest = $xetable.insertAt(data, -1);
22294
+ loadRest = $xeTable.insertAt(data, -1);
21741
22295
  }
21742
22296
  if (opts.mode === 'insertTop') {
21743
- loadRest = $xetable.insert(data);
22297
+ loadRest = $xeTable.insert(data);
21744
22298
  } else {
21745
- loadRest = $xetable.reloadData(data);
22299
+ loadRest = $xeTable.reloadData(data);
21746
22300
  }
21747
22301
  if (opts.message !== false) {
21748
22302
  // 检测弹窗模块
@@ -21975,6 +22529,43 @@ function readLocalFile(options = {}) {
21975
22529
  fileInput.click();
21976
22530
  });
21977
22531
  }
22532
+ function handleFilterColumns(exportOpts, column, columns) {
22533
+ return columns.some(item => {
22534
+ if (isColumnInfo(item)) {
22535
+ return column.id === item.id;
22536
+ } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(item)) {
22537
+ return column.field === item;
22538
+ } else {
22539
+ const colid = item.id || item.colId;
22540
+ const type = item.type;
22541
+ const field = item.field;
22542
+ if (colid) {
22543
+ return column.id === colid;
22544
+ } else if (field && type) {
22545
+ return column.field === field && column.type === type;
22546
+ } else if (field) {
22547
+ return column.field === field;
22548
+ } else if (type) {
22549
+ return column.type === type;
22550
+ }
22551
+ }
22552
+ return false;
22553
+ });
22554
+ }
22555
+ function handleFilterFields(exportOpts, column, includeFields, excludeFields) {
22556
+ if (excludeFields) {
22557
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(excludeFields, column.field)) {
22558
+ return false;
22559
+ }
22560
+ }
22561
+ if (includeFields) {
22562
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(includeFields, column.field)) {
22563
+ return true;
22564
+ }
22565
+ return false;
22566
+ }
22567
+ return exportOpts.original ? column.field : defaultFilterExportColumn(column);
22568
+ }
21978
22569
  function handleExportAndPrint($xeTable, options, isPrint) {
21979
22570
  const props = $xeTable;
21980
22571
  const reactData = $xeTable;
@@ -22019,7 +22610,9 @@ function handleExportAndPrint($xeTable, options, isPrint) {
22019
22610
  const checkMethod = customOpts.checkMethod;
22020
22611
  const exportColumns = collectColumn.slice(0);
22021
22612
  const {
22022
- columns
22613
+ columns,
22614
+ excludeFields,
22615
+ includeFields
22023
22616
  } = defOpts;
22024
22617
  // 处理类型
22025
22618
  const typeList = types.map(value => {
@@ -22043,33 +22636,19 @@ function handleExportAndPrint($xeTable, options, isPrint) {
22043
22636
  // 默认选中
22044
22637
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(exportColumns, (column, index, items, path, parent) => {
22045
22638
  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);
22639
+ let isChecked = false;
22640
+ if (columns && columns.length) {
22641
+ isChecked = handleFilterColumns(defOpts, column, columns);
22642
+ } else if (excludeFields || includeFields) {
22643
+ isChecked = handleFilterFields(defOpts, column, includeFields, excludeFields);
22644
+ } else {
22645
+ isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
22072
22646
  }
22647
+ column.checked = isChecked;
22648
+ column.halfChecked = false;
22649
+ column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
22650
+ column
22651
+ }) : false);
22073
22652
  });
22074
22653
  // 更新条件
22075
22654
  Object.assign(exportStore, {
@@ -22691,6 +23270,7 @@ const convertToRows = originColumns => {
22691
23270
 
22692
23271
 
22693
23272
 
23273
+
22694
23274
  function getTargetOffset(target, container) {
22695
23275
  let offsetTop = 0;
22696
23276
  let offsetLeft = 0;
@@ -22716,37 +23296,72 @@ function getTargetOffset(target, container) {
22716
23296
  };
22717
23297
  }
22718
23298
  function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offsetClientTop, moveRange) {
23299
+ const props = $xeTable;
22719
23300
  const reactData = $xeTable;
22720
23301
  const internalData = $xeTable;
23302
+ const {
23303
+ showOverflow
23304
+ } = props;
23305
+ const {
23306
+ fullAllDataRowIdData,
23307
+ isResizeCellHeight
23308
+ } = internalData;
23309
+ const rowOpts = $xeTable.computeRowOpts;
23310
+ const cellOpts = $xeTable.computeCellOpts;
23311
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
23312
+ const {
23313
+ row
23314
+ } = params;
22721
23315
  let countHeight = 0;
22722
23316
  let rangeRows = [];
22723
23317
  let moveSize = 0;
22724
23318
  const isDown = moveRange > 0;
22725
23319
  const {
22726
- scrollYLoad,
22727
- rowHeight
23320
+ scrollYLoad
22728
23321
  } = reactData;
22729
23322
  const {
22730
23323
  afterFullData
22731
23324
  } = internalData;
23325
+ if (isDown) {
23326
+ moveSize = offsetClientTop + moveRange;
23327
+ } else {
23328
+ moveSize = trRect.height - offsetClientTop + Math.abs(moveRange);
23329
+ }
22732
23330
  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));
23331
+ const _rowIndex = $xeTable.getVTRowIndex(row);
23332
+ const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
23333
+ if (!isCustomCellHeight && showOverflow) {
23334
+ if (isDown) {
23335
+ rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / defaultRowHeight));
23336
+ } else {
23337
+ rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / defaultRowHeight), _rowIndex + 1);
23338
+ }
22741
23339
  } else {
22742
- rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / rowHeight), _rowIndex + 1);
23340
+ if (isDown) {
23341
+ for (let i = _rowIndex; i < afterFullData.length; i++) {
23342
+ const item = afterFullData[i];
23343
+ const rowid = $xeTable.getRowid(item);
23344
+ const rowRest = fullAllDataRowIdData[rowid] || {};
23345
+ countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
23346
+ rangeRows.push(item);
23347
+ if (countHeight > moveSize) {
23348
+ return rangeRows;
23349
+ }
23350
+ }
23351
+ } else {
23352
+ for (let len = _rowIndex; len >= 0; len--) {
23353
+ const item = afterFullData[len];
23354
+ const rowid = $xeTable.getRowid(item);
23355
+ const rowRest = fullAllDataRowIdData[rowid] || {};
23356
+ countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
23357
+ rangeRows.push(item);
23358
+ if (countHeight > moveSize) {
23359
+ return rangeRows;
23360
+ }
23361
+ }
23362
+ }
22743
23363
  }
22744
23364
  } else {
22745
- if (isDown) {
22746
- moveSize = evnt.clientY - trRect.y;
22747
- } else {
22748
- moveSize = trRect.y - evnt.clientY + trRect.height;
22749
- }
22750
23365
  const siblingProp = isDown ? 'next' : 'previous';
22751
23366
  while (targetTrElem && countHeight < moveSize) {
22752
23367
  const rowNodeRest = $xeTable.getRowNode(targetTrElem);
@@ -22924,21 +23539,31 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
22924
23539
  },
22925
23540
  handleCheckboxRangeEvent(evnt, params) {
22926
23541
  const $xeTable = this;
23542
+ const internalData = $xeTable;
23543
+ const {
23544
+ elemStore
23545
+ } = internalData;
23546
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
23547
+ const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
23548
+ const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
22927
23549
  const {
22928
23550
  column,
22929
23551
  cell
22930
23552
  } = params;
22931
23553
  if (column.type === 'checkbox') {
22932
- const {
22933
- $el,
22934
- elemStore
22935
- } = this;
23554
+ let bodyWrapperElem = bodyScrollElem;
23555
+ if (leftScrollElem && column.fixed === 'left') {
23556
+ bodyWrapperElem = leftScrollElem;
23557
+ } else if (rightScrollElem && column.fixed === 'right') {
23558
+ bodyWrapperElem = rightScrollElem;
23559
+ }
23560
+ if (!bodyWrapperElem) {
23561
+ return;
23562
+ }
23563
+ const el = $xeTable.$refs.refElem;
22936
23564
  const disX = evnt.clientX;
22937
23565
  const disY = evnt.clientY;
22938
- const bodyWrapperElem = elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper'];
22939
23566
  const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
22940
- const domMousemove = document.onmousemove;
22941
- const domMouseup = document.onmouseup;
22942
23567
  const trElem = cell.parentNode;
22943
23568
  const selectRecords = this.getCheckboxRecords();
22944
23569
  let lastRangeRows = [];
@@ -23049,7 +23674,7 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
23049
23674
  }
23050
23675
  }, 50);
23051
23676
  };
23052
- addClass($el, 'drag--range');
23677
+ addClass(el, 'drag--range');
23053
23678
  document.onmousemove = evnt => {
23054
23679
  evnt.preventDefault();
23055
23680
  evnt.stopPropagation();
@@ -23079,10 +23704,10 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
23079
23704
  };
23080
23705
  document.onmouseup = evnt => {
23081
23706
  stopMouseScroll();
23082
- removeClass($el, 'drag--range');
23707
+ removeClass(el, 'drag--range');
23083
23708
  checkboxRangeElem.removeAttribute('style');
23084
- document.onmousemove = domMousemove;
23085
- document.onmouseup = domMouseup;
23709
+ document.onmousemove = null;
23710
+ document.onmouseup = null;
23086
23711
  triggerEvent('end', evnt);
23087
23712
  };
23088
23713
  triggerEvent('start', evnt);
@@ -24202,7 +24827,7 @@ const table_renderDragTip = (h, $xeTable) => {
24202
24827
  }
24203
24828
  return table_renderEmptyElement($xeTable);
24204
24829
  };
24205
- function handleUupdateResize(_vm) {
24830
+ function handleUpdateResize(_vm) {
24206
24831
  const {
24207
24832
  $el
24208
24833
  } = _vm;
@@ -24350,8 +24975,7 @@ function renderBody(h, $xeTable) {
24350
24975
  const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
24351
24976
  return {
24352
24977
  xID,
24353
- tId: `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId()}`,
24354
- isCalcColumn: false,
24978
+ tId: xID,
24355
24979
  // 低性能的静态列
24356
24980
  staticColumns: [],
24357
24981
  // 渲染的列分组
@@ -24562,15 +25186,17 @@ function renderBody(h, $xeTable) {
24562
25186
  isFooter: false
24563
25187
  },
24564
25188
  scrollVMLoading: false,
24565
- isCalcCellHeight: 0,
25189
+ calcCellHeightFlag: 0,
25190
+ resizeHeightFlag: 0,
24566
25191
  isCustomStatus: false,
24567
25192
  isDragRowMove: false,
24568
25193
  dragRow: null,
24569
25194
  isDragColMove: false,
24570
25195
  dragCol: null,
24571
25196
  dragTipText: '',
24572
- _isResize: false,
24573
- isLoading: false,
25197
+ isDragResize: false,
25198
+ isRowLoading: false,
25199
+ isColLoading: false,
24574
25200
  reScrollFlag: 0,
24575
25201
  reLayoutFlag: 0,
24576
25202
  footFlag: 0
@@ -24677,7 +25303,7 @@ function renderBody(h, $xeTable) {
24677
25303
  const $xeTable = this;
24678
25304
  const vSize = $xeTable.computeSize;
24679
25305
  const rowHeightMaps = $xeTable.computeRowHeightMaps;
24680
- return rowHeightMaps[vSize || 'default'];
25306
+ return rowHeightMaps[vSize || 'default'] || 18;
24681
25307
  },
24682
25308
  columnOpts() {
24683
25309
  return this.computeColumnOpts;
@@ -24686,7 +25312,19 @@ function renderBody(h, $xeTable) {
24686
25312
  return Object.assign({}, table_getConfig().table.columnConfig, this.columnConfig);
24687
25313
  },
24688
25314
  computeCellOpts() {
24689
- return Object.assign({}, table_getConfig().table.cellConfig, this.cellConfig);
25315
+ const $xeTable = this;
25316
+ const props = $xeTable;
25317
+ return Object.assign({}, table_getConfig().table.cellConfig, props.cellConfig);
25318
+ },
25319
+ computeHeaderCellOpts() {
25320
+ const $xeTable = this;
25321
+ const props = $xeTable;
25322
+ return Object.assign({}, table_getConfig().table.headerCellConfig, props.headerCellConfig);
25323
+ },
25324
+ computeFooterCellOpts() {
25325
+ const $xeTable = this;
25326
+ const props = $xeTable;
25327
+ return Object.assign({}, table_getConfig().table.footerCellConfig, props.footerCellConfig);
24690
25328
  },
24691
25329
  rowOpts() {
24692
25330
  return this.computeRowOpts;
@@ -24743,6 +25381,20 @@ function renderBody(h, $xeTable) {
24743
25381
  ...this.tooltipOpts
24744
25382
  };
24745
25383
  },
25384
+ computeTableTipConfig() {
25385
+ const $xeTable = this;
25386
+ const reactData = $xeTable;
25387
+ const {
25388
+ tooltipStore
25389
+ } = reactData;
25390
+ const tooltipOpts = $xeTable.computeTooltipOpts;
25391
+ return Object.assign({}, tooltipOpts, tooltipStore.currOpts);
25392
+ },
25393
+ computeValidTipConfig() {
25394
+ const $xeTable = this;
25395
+ const tooltipOpts = $xeTable.computeTooltipOpts;
25396
+ return Object.assign({}, tooltipOpts);
25397
+ },
24746
25398
  validTipOpts() {
24747
25399
  return Object.assign({
24748
25400
  isArrow: false
@@ -24799,23 +25451,55 @@ function renderBody(h, $xeTable) {
24799
25451
  return Object.assign({}, table_getConfig().table.fnrConfig, this.fnrConfig);
24800
25452
  },
24801
25453
  headerCtxMenu() {
24802
- const headerOpts = this.ctxMenuOpts.header;
25454
+ return this.computeHeaderMenu;
25455
+ },
25456
+ computeHeaderMenu() {
25457
+ const $xeTable = this;
25458
+ const menuOpts = $xeTable.computeMenuOpts;
25459
+ const headerOpts = menuOpts.header;
24803
25460
  return headerOpts && headerOpts.options ? headerOpts.options : [];
24804
25461
  },
24805
25462
  bodyCtxMenu() {
24806
- const bodyOpts = this.ctxMenuOpts.body;
25463
+ return this.computeBodyMenu;
25464
+ },
25465
+ computeBodyMenu() {
25466
+ const $xeTable = this;
25467
+ const menuOpts = $xeTable.computeMenuOpts;
25468
+ const bodyOpts = menuOpts.body;
24807
25469
  return bodyOpts && bodyOpts.options ? bodyOpts.options : [];
24808
25470
  },
24809
25471
  footerCtxMenu() {
24810
- const footerOpts = this.ctxMenuOpts.footer;
25472
+ return this.computeFooterMenu;
25473
+ },
25474
+ computeFooterMenu() {
25475
+ const $xeTable = this;
25476
+ const menuOpts = $xeTable.computeMenuOpts;
25477
+ const footerOpts = menuOpts.footer;
24811
25478
  return footerOpts && footerOpts.options ? footerOpts.options : [];
24812
25479
  },
24813
25480
  isCtxMenu() {
24814
- return !!((this.contextMenu || this.menuConfig) && isEnableConf(this.ctxMenuOpts) && (this.headerCtxMenu.length || this.bodyCtxMenu.length || this.footerCtxMenu.length));
25481
+ return this.computeIsMenu;
25482
+ },
25483
+ computeIsMenu() {
25484
+ const $xeTable = this;
25485
+ const props = $xeTable;
25486
+ const menuOpts = $xeTable.computeMenuOpts;
25487
+ const headerMenu = $xeTable.computeHeaderMenu;
25488
+ const bodyMenu = $xeTable.computeBodyMenu;
25489
+ const footerMenu = $xeTable.computeFooterMenu;
25490
+ return !!((props.contextMenu || props.menuConfig) && isEnableConf(menuOpts) && (headerMenu.length || bodyMenu.length || footerMenu.length));
24815
25491
  },
24816
25492
  ctxMenuList() {
25493
+ return this.computeMenuList;
25494
+ },
25495
+ computeMenuList() {
25496
+ const $xeTable = this;
25497
+ const reactData = $xeTable;
25498
+ const {
25499
+ ctxMenuStore
25500
+ } = reactData;
24817
25501
  const rest = [];
24818
- this.ctxMenuStore.list.forEach(list => {
25502
+ ctxMenuStore.list.forEach(list => {
24819
25503
  list.forEach(item => {
24820
25504
  rest.push(item);
24821
25505
  });
@@ -25028,7 +25712,7 @@ function renderBody(h, $xeTable) {
25028
25712
  if (value && value.length >= 50000) {
25029
25713
  warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
25030
25714
  }
25031
- this.loadTableData(value || []).then(() => {
25715
+ this.loadTableData(value || [], true).then(() => {
25032
25716
  this.inited = true;
25033
25717
  this.initStatus = true;
25034
25718
  if (!initStatus) {
@@ -25096,10 +25780,10 @@ function renderBody(h, $xeTable) {
25096
25780
  },
25097
25781
  syncResize(value) {
25098
25782
  if (value) {
25099
- handleUupdateResize(this);
25783
+ handleUpdateResize(this);
25100
25784
  this.$nextTick(() => {
25101
- handleUupdateResize(this);
25102
- setTimeout(() => handleUupdateResize(this));
25785
+ handleUpdateResize(this);
25786
+ setTimeout(() => handleUpdateResize(this));
25103
25787
  });
25104
25788
  }
25105
25789
  },
@@ -25211,11 +25895,14 @@ function renderBody(h, $xeTable) {
25211
25895
  if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(this.rowKey || rowOpts.useKey) || !showOverflow)) {
25212
25896
  warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow']);
25213
25897
  }
25898
+ if (treeConfig && !treeOpts.transform && this.stripe) {
25899
+ warnLog('vxe.error.noTree', ['stripe']);
25900
+ }
25214
25901
  if (this.showFooter && !(this.footerMethod || this.footerData)) {
25215
25902
  warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
25216
25903
  }
25217
- if (treeConfig && !treeOpts.transform && this.stripe) {
25218
- warnLog('vxe.error.noTree', ['stripe']);
25904
+ if (rowOpts.height) {
25905
+ warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
25219
25906
  }
25220
25907
  if (this.tooltipOpts.enabled) {
25221
25908
  warnLog('vxe.error.delProp', ['tooltip-config.enabled', 'tooltip-config.showAll']);
@@ -25362,7 +26049,7 @@ function renderBody(h, $xeTable) {
25362
26049
  endIndex: 1,
25363
26050
  visibleSize: 0
25364
26051
  });
25365
- this.loadTableData(data).then(() => {
26052
+ this.loadTableData(data, true).then(() => {
25366
26053
  if (data && data.length) {
25367
26054
  this.inited = true;
25368
26055
  this.initStatus = true;
@@ -25485,7 +26172,6 @@ function renderBody(h, $xeTable) {
25485
26172
  editRules
25486
26173
  } = props;
25487
26174
  const {
25488
- isCalcColumn,
25489
26175
  isGroup,
25490
26176
  overflowX,
25491
26177
  overflowY,
@@ -25495,15 +26181,15 @@ function renderBody(h, $xeTable) {
25495
26181
  initStore,
25496
26182
  columnStore,
25497
26183
  filterStore,
25498
- customStore,
25499
- tooltipStore
26184
+ customStore
25500
26185
  } = reactData;
25501
26186
  const {
25502
26187
  leftList,
25503
26188
  rightList
25504
26189
  } = columnStore;
25505
26190
  const loadingSlot = slots.loading;
25506
- const tooltipOpts = $xeTable.computeTooltipOpts;
26191
+ const tableTipConfig = $xeTable.computeTableTipConfig;
26192
+ const validTipConfig = $xeTable.computeValidTipConfig;
25507
26193
  const validOpts = $xeTable.computeValidOpts;
25508
26194
  const checkboxOpts = $xeTable.computeCheckboxOpts;
25509
26195
  const treeOpts = $xeTable.computeTreeOpts;
@@ -25515,7 +26201,7 @@ function renderBody(h, $xeTable) {
25515
26201
  const areaOpts = $xeTable.computeAreaOpts;
25516
26202
  const loadingOpts = $xeTable.computeLoadingOpts;
25517
26203
  const isMenu = $xeTable.computeIsMenu;
25518
- const currLoading = reactData.isLoading || loading;
26204
+ const currLoading = reactData.isColLoading || reactData.isRowLoading || loading;
25519
26205
  const resizableOpts = $xeTable.computeResizableOpts;
25520
26206
  const isArea = mouseConfig && mouseOpts.area;
25521
26207
  const columnDragOpts = $xeTable.computeColumnDragOpts;
@@ -25536,7 +26222,6 @@ function renderBody(h, $xeTable) {
25536
26222
  'row--highlight': rowOpts.isHover || highlightHoverRow,
25537
26223
  'column--highlight': columnOpts.isHover || highlightHoverColumn,
25538
26224
  'checkbox--range': checkboxOpts.range,
25539
- 'column--calc': isCalcColumn,
25540
26225
  'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
25541
26226
  'is--header': showHeader,
25542
26227
  'is--footer': showFooter,
@@ -25545,7 +26230,6 @@ function renderBody(h, $xeTable) {
25545
26230
  'is--fixed-left': leftList.length,
25546
26231
  'is--fixed-right': rightList.length,
25547
26232
  'is--animat': !!props.animat,
25548
- 'is--padding': props.padding,
25549
26233
  'is--round': props.round,
25550
26234
  'is--stripe': !treeConfig && stripe,
25551
26235
  'is--loading': currLoading,
@@ -25593,11 +26277,21 @@ function renderBody(h, $xeTable) {
25593
26277
  * 列宽线
25594
26278
  */
25595
26279
  h('div', {
25596
- key: 'cl',
25597
- ref: 'refCellResizeBar',
25598
- class: 'vxe-table--resizable-bar'
26280
+ key: 'tcl',
26281
+ ref: 'refColResizeBar',
26282
+ class: 'vxe-table--resizable-col-bar'
26283
+ }, resizableOpts.showDragTip ? [h('div', {
26284
+ ref: 'refColResizeTip',
26285
+ class: 'vxe-table--resizable-number-tip'
26286
+ })] : []),
26287
+ /**
26288
+ * 行高线
26289
+ */
26290
+ h('div', {
26291
+ key: 'trl',
26292
+ ref: 'refRowResizeBar',
26293
+ class: 'vxe-table--resizable-row-bar'
25599
26294
  }, resizableOpts.showDragTip ? [h('div', {
25600
- ref: 'refCellResizeTip',
25601
26295
  class: 'vxe-table--resizable-number-tip'
25602
26296
  })] : []),
25603
26297
  /**
@@ -25698,8 +26392,13 @@ function renderBody(h, $xeTable) {
25698
26392
  */
25699
26393
  VxeUITooltipComponent ? h(VxeUITooltipComponent, {
25700
26394
  key: 'btp',
25701
- ref: 'tooltip',
25702
- props: Object.assign({}, tooltipOpts, tooltipStore.currOpts)
26395
+ ref: 'refTooltip',
26396
+ props: {
26397
+ theme: tableTipConfig.theme,
26398
+ enterable: tableTipConfig.enterable,
26399
+ enterDelay: tableTipConfig.enterDelay,
26400
+ leaveDelay: tableTipConfig.leaveDelay
26401
+ }
25703
26402
  }) : table_renderEmptyElement($xeTable),
25704
26403
  /**
25705
26404
  * 校验提示
@@ -25710,9 +26409,12 @@ function renderBody(h, $xeTable) {
25710
26409
  class: [{
25711
26410
  'old-cell-valid': editRules && table_getConfig().cellVaildMode === 'obsolete'
25712
26411
  }, 'vxe-table--valid-error'],
25713
- props: validOpts.message === 'tooltip' || tableData.length === 1 ? Object.assign({
25714
- isArrow: false
25715
- }, tooltipOpts) : {}
26412
+ props: {
26413
+ theme: validTipConfig.theme,
26414
+ enterable: validTipConfig.enterable,
26415
+ enterDelay: validTipConfig.enterDelay,
26416
+ leaveDelay: validTipConfig.leaveDelay
26417
+ }
25716
26418
  }) : table_renderEmptyElement($xeTable)])]);
25717
26419
  },
25718
26420
  methods: methods
@@ -29367,7 +30069,8 @@ const Toolbar = VxeToolbar;
29367
30069
  customRestore: '恢复默认',
29368
30070
  maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
29369
30071
  dragTip: '移动:{0}',
29370
- resizeColTip: '{0} 像素'
30072
+ resizeColTip: '宽:{0} 像素',
30073
+ resizeRowTip: '高:{0} 像素'
29371
30074
  },
29372
30075
  grid: {
29373
30076
  selectOneRecord: '请至少选择一条记录!',