vxe-table 3.12.0-beta.8 → 3.12.0

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 (79) hide show
  1. package/es/locale/lang/de-DE.js +490 -490
  2. package/es/locale/lang/en-US.js +438 -438
  3. package/es/locale/lang/it-IT.js +692 -0
  4. package/es/locale/lang/ru-RU.js +36 -36
  5. package/es/locale/lang/th-TH.js +692 -0
  6. package/es/locale/lang/zh-CHT.js +19 -19
  7. package/es/style.css +1 -1
  8. package/es/table/module/custom/panel.js +5 -5
  9. package/es/table/module/export/mixin.js +208 -140
  10. package/es/table/module/validator/mixin.js +2 -6
  11. package/es/table/src/cell.js +88 -61
  12. package/es/table/src/column.js +2 -2
  13. package/es/table/src/group.js +2 -2
  14. package/es/table/src/methods.js +112 -87
  15. package/es/table/src/table.js +7 -11
  16. package/es/toolbar/src/toolbar.js +22 -4
  17. package/es/ui/index.js +2 -2
  18. package/es/ui/src/log.js +1 -1
  19. package/es/ui/src/vn.js +3 -0
  20. package/lib/index.umd.js +513 -362
  21. package/lib/index.umd.min.js +1 -1
  22. package/lib/locale/lang/de-DE.js +490 -490
  23. package/lib/locale/lang/de-DE.min.js +1 -1
  24. package/lib/locale/lang/en-US.js +438 -438
  25. package/lib/locale/lang/en-US.min.js +1 -1
  26. package/lib/locale/lang/en-US.umd.js +438 -438
  27. package/lib/locale/lang/it-IT.js +698 -0
  28. package/lib/locale/lang/it-IT.min.js +1 -0
  29. package/lib/locale/lang/ru-RU.js +36 -36
  30. package/lib/locale/lang/ru-RU.min.js +1 -1
  31. package/lib/locale/lang/ru-RU.umd.js +36 -36
  32. package/lib/locale/lang/th-TH.js +698 -0
  33. package/lib/locale/lang/th-TH.min.js +1 -0
  34. package/lib/locale/lang/zh-CHT.js +19 -19
  35. package/lib/locale/lang/zh-CHT.min.js +1 -1
  36. package/lib/locale/lang/zh-CHT.umd.js +19 -19
  37. package/lib/style.css +1 -1
  38. package/lib/table/module/custom/panel.js +5 -5
  39. package/lib/table/module/custom/panel.min.js +1 -1
  40. package/lib/table/module/export/mixin.js +239 -167
  41. package/lib/table/module/export/mixin.min.js +1 -1
  42. package/lib/table/module/validator/mixin.js +1 -6
  43. package/lib/table/module/validator/mixin.min.js +1 -1
  44. package/lib/table/src/cell.js +109 -83
  45. package/lib/table/src/cell.min.js +1 -1
  46. package/lib/table/src/methods.js +112 -87
  47. package/lib/table/src/methods.min.js +1 -1
  48. package/lib/table/src/table.js +4 -9
  49. package/lib/table/src/table.min.js +1 -1
  50. package/lib/toolbar/src/toolbar.js +36 -2
  51. package/lib/toolbar/src/toolbar.min.js +1 -1
  52. package/lib/ui/index.js +2 -2
  53. package/lib/ui/index.min.js +1 -1
  54. package/lib/ui/src/log.js +1 -1
  55. package/lib/ui/src/log.min.js +1 -1
  56. package/lib/ui/src/vn.js +3 -0
  57. package/lib/ui/src/vn.min.js +1 -1
  58. package/package.json +3 -3
  59. package/packages/locale/lang/de-DE.ts +492 -491
  60. package/packages/locale/lang/en-US.ts +438 -438
  61. package/packages/locale/lang/it-IT.ts +692 -0
  62. package/packages/locale/lang/ru-RU.ts +36 -36
  63. package/packages/locale/lang/th-TH.ts +692 -0
  64. package/packages/locale/lang/zh-CHT.ts +19 -19
  65. package/packages/table/module/custom/panel.ts +5 -5
  66. package/packages/table/module/export/mixin.ts +227 -156
  67. package/packages/table/module/validator/mixin.ts +2 -6
  68. package/packages/table/src/cell.ts +141 -108
  69. package/packages/table/src/methods.ts +136 -105
  70. package/packages/table/src/table.ts +8 -12
  71. package/packages/toolbar/src/toolbar.ts +26 -8
  72. package/packages/ui/index.ts +1 -1
  73. package/packages/ui/src/vn.ts +4 -1
  74. /package/es/{iconfont.1735299026800.ttf → iconfont.1735661059384.ttf} +0 -0
  75. /package/es/{iconfont.1735299026800.woff → iconfont.1735661059384.woff} +0 -0
  76. /package/es/{iconfont.1735299026800.woff2 → iconfont.1735661059384.woff2} +0 -0
  77. /package/lib/{iconfont.1735299026800.ttf → iconfont.1735661059384.ttf} +0 -0
  78. /package/lib/{iconfont.1735299026800.woff → iconfont.1735661059384.woff} +0 -0
  79. /package/lib/{iconfont.1735299026800.woff2 → iconfont.1735661059384.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.0-beta.8";
2223
+ const version = "3.12.0";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2251,7 +2251,7 @@ core_.VxeUI.setConfig({
2251
2251
  // keyField: '_X_ROW_KEY' // 行数据的唯一主键字段名
2252
2252
  // },
2253
2253
  resizeConfig: {
2254
- // refreshDelay: 250
2254
+ // refreshDelay: 20
2255
2255
  },
2256
2256
  resizableConfig: {
2257
2257
  dragMode: 'auto',
@@ -2808,7 +2808,7 @@ function isNodeElement(elem) {
2808
2808
  const {
2809
2809
  log: log_log
2810
2810
  } = core_.VxeUI;
2811
- const log_version = `table v${"3.12.0-beta.8"}`;
2811
+ const log_version = `table v${"3.12.0"}`;
2812
2812
  const warnLog = log_log.create('warn', log_version);
2813
2813
  const errLog = log_log.create('error', log_version);
2814
2814
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -3514,6 +3514,9 @@ function getChangeEvent(renderOpts) {
3514
3514
  return 'change';
3515
3515
  }
3516
3516
  function getSlotVNs(vns) {
3517
+ if (vns === null || vns === undefined) {
3518
+ return [];
3519
+ }
3517
3520
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(vns)) {
3518
3521
  return vns;
3519
3522
  }
@@ -3629,6 +3632,7 @@ function renderCellBaseVNs(h, params, content) {
3629
3632
  const rowDragOpts = $table.computeRowDragOpts;
3630
3633
  const {
3631
3634
  showIcon,
3635
+ isPeerDrag,
3632
3636
  isCrossDrag,
3633
3637
  visibleMethod
3634
3638
  } = rowDragOpts;
@@ -3636,7 +3640,7 @@ function renderCellBaseVNs(h, params, content) {
3636
3640
  const vns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(content) ? content : [content];
3637
3641
  if (dragSort && rowOpts.drag && (showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params))) {
3638
3642
  if (treeConfig) {
3639
- if (isCrossDrag || !level) {
3643
+ if (isPeerDrag || isCrossDrag || !level) {
3640
3644
  vns.unshift(renderCellDragIcon(h, params));
3641
3645
  }
3642
3646
  } else {
@@ -3656,12 +3660,13 @@ function renderHeaderCellDragIcon(h, params) {
3656
3660
  showIcon,
3657
3661
  icon,
3658
3662
  trigger,
3663
+ isPeerDrag,
3659
3664
  isCrossDrag,
3660
3665
  visibleMethod,
3661
3666
  disabledMethod
3662
3667
  } = columnDragOpts;
3663
3668
  if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
3664
- if (!column.fixed && (isCrossDrag || !column.parentId)) {
3669
+ if (!column.fixed && (isPeerDrag || isCrossDrag || !column.parentId)) {
3665
3670
  const isDisabled = disabledMethod && disabledMethod(params);
3666
3671
  const ons = {};
3667
3672
  if (trigger !== 'cell') {
@@ -3698,18 +3703,20 @@ function renderTitleContent(h, params, content) {
3698
3703
  type,
3699
3704
  showHeaderOverflow
3700
3705
  } = column;
3706
+ const tableProps = $table;
3707
+ const tableReactData = $table;
3701
3708
  const {
3702
- showHeaderOverflow: allColumnHeaderOverflow,
3703
- tooltipOpts
3704
- } = $table;
3705
- const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
3709
+ showHeaderOverflow: allColumnHeaderOverflow
3710
+ } = tableProps;
3711
+ const tooltipOpts = $table.computeTooltipOpts;
3712
+ const showAllTip = tooltipOpts.showAll;
3706
3713
  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;
3707
3714
  const showTitle = headOverflow === 'title';
3708
3715
  const showTooltip = headOverflow === true || headOverflow === 'tooltip';
3709
3716
  const ons = {};
3710
3717
  if (showTitle || showTooltip || showAllTip) {
3711
3718
  ons.mouseenter = evnt => {
3712
- if ($table._isResize) {
3719
+ if (tableReactData._isResize) {
3713
3720
  return;
3714
3721
  }
3715
3722
  if (showTitle) {
@@ -3721,7 +3728,7 @@ function renderTitleContent(h, params, content) {
3721
3728
  }
3722
3729
  if (showTooltip || showAllTip) {
3723
3730
  ons.mouseleave = evnt => {
3724
- if ($table._isResize) {
3731
+ if (tableReactData._isResize) {
3725
3732
  return;
3726
3733
  }
3727
3734
  if (showTooltip || showAllTip) {
@@ -3742,13 +3749,13 @@ function renderTitleContent(h, params, content) {
3742
3749
  }
3743
3750
  function formatFooterLabel(footerFormatter, params) {
3744
3751
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerFormatter)) {
3745
- return footerFormatter(params);
3752
+ return `${footerFormatter(params)}`;
3746
3753
  }
3747
3754
  const isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerFormatter);
3748
3755
  const gFormatOpts = isArr ? cell_formats.get(footerFormatter[0]) : cell_formats.get(footerFormatter);
3749
3756
  const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
3750
3757
  if (footerFormatMethod) {
3751
- return isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params);
3758
+ return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`;
3752
3759
  }
3753
3760
  return '';
3754
3761
  }
@@ -3948,12 +3955,16 @@ const Cell = {
3948
3955
  $table,
3949
3956
  isHidden
3950
3957
  } = params;
3958
+ const tableReactData = $table;
3959
+ const tableInternalData = $table;
3951
3960
  const {
3952
- treeOpts,
3953
3961
  treeExpandedMaps,
3954
- treeExpandLazyLoadedMaps,
3962
+ treeExpandLazyLoadedMaps
3963
+ } = tableReactData;
3964
+ const {
3955
3965
  fullAllDataRowIdData
3956
- } = $table;
3966
+ } = tableInternalData;
3967
+ const treeOpts = $table.computeTreeOpts;
3957
3968
  const {
3958
3969
  row,
3959
3970
  column,
@@ -3975,17 +3986,18 @@ const Cell = {
3975
3986
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
3976
3987
  const rowChilds = row[childrenField];
3977
3988
  const hasChild = rowChilds && rowChilds.length;
3989
+ const iconSlot = slots ? slots.icon : null;
3978
3990
  let hasLazyChilds = false;
3979
- let isAceived = false;
3991
+ let isActive = false;
3980
3992
  let isLazyLoading = false;
3981
3993
  let isLazyLoaded = false;
3982
- const on = {};
3983
- if (slots && slots.icon) {
3984
- return $table.callSlot(slots.icon, params, h, cellVNodes);
3994
+ const ons = {};
3995
+ if (iconSlot) {
3996
+ return $table.callSlot(iconSlot, params, h);
3985
3997
  }
3986
3998
  if (!isHidden) {
3987
3999
  const rowid = getRowid($table, row);
3988
- isAceived = !!treeExpandedMaps[rowid];
4000
+ isActive = !!treeExpandedMaps[rowid];
3989
4001
  if (lazy) {
3990
4002
  const rest = fullAllDataRowIdData[rowid];
3991
4003
  isLazyLoading = !!treeExpandLazyLoadedMaps[rowid];
@@ -3994,22 +4006,22 @@ const Cell = {
3994
4006
  }
3995
4007
  }
3996
4008
  if (!trigger || trigger === 'default') {
3997
- on.click = evnt => {
4009
+ ons.click = evnt => {
3998
4010
  $table.triggerTreeExpandEvent(evnt, params);
3999
4011
  };
4000
4012
  }
4001
4013
  return [h('div', {
4002
4014
  class: ['vxe-cell--tree-node', {
4003
- 'is--active': isAceived
4015
+ 'is--active': isActive
4004
4016
  }],
4005
4017
  style: {
4006
4018
  paddingLeft: `${level * indent}px`
4007
4019
  }
4008
4020
  }, [showIcon && (lazy ? isLazyLoaded ? hasChild : hasLazyChilds : hasChild) ? [h('div', {
4009
4021
  class: 'vxe-tree--btn-wrapper',
4010
- on
4022
+ on: ons
4011
4023
  }, [h('i', {
4012
- class: ['vxe-tree--node-btn', isLazyLoading ? iconLoaded || cell_getIcon().TABLE_TREE_LOADED : isAceived ? iconOpen || cell_getIcon().TABLE_TREE_OPEN : iconClose || cell_getIcon().TABLE_TREE_CLOSE]
4024
+ class: ['vxe-tree--node-btn', isLazyLoading ? iconLoaded || cell_getIcon().TABLE_TREE_LOADED : isActive ? iconOpen || cell_getIcon().TABLE_TREE_OPEN : iconClose || cell_getIcon().TABLE_TREE_CLOSE]
4013
4025
  })])] : null, h('div', {
4014
4026
  class: 'vxe-tree-cell'
4015
4027
  }, cellVNodes)])];
@@ -4032,10 +4044,11 @@ const Cell = {
4032
4044
  $table,
4033
4045
  column
4034
4046
  } = params;
4047
+ const tableProps = $table;
4035
4048
  const {
4036
- treeConfig,
4037
- seqOpts
4038
- } = $table;
4049
+ treeConfig
4050
+ } = tableProps;
4051
+ const seqOpts = $table.computeSeqOpts;
4039
4052
  const {
4040
4053
  slots
4041
4054
  } = column;
@@ -4074,10 +4087,11 @@ const Cell = {
4074
4087
  column,
4075
4088
  isHidden
4076
4089
  } = params;
4090
+ const tableReactData = $table;
4077
4091
  const {
4078
- radioOpts,
4079
4092
  selectRadioRow
4080
- } = $table;
4093
+ } = tableReactData;
4094
+ const radioOpts = $table.computeRadioOpts;
4081
4095
  const {
4082
4096
  slots
4083
4097
  } = column;
@@ -4151,25 +4165,24 @@ const Cell = {
4151
4165
  column,
4152
4166
  isHidden
4153
4167
  } = params;
4168
+ const tableReactData = $table;
4154
4169
  const {
4155
4170
  isAllSelected: isAllCheckboxSelected,
4156
- isIndeterminate: isAllCheckboxIndeterminate,
4157
- isAllCheckboxDisabled
4158
- } = $table;
4171
+ isIndeterminate: isAllCheckboxIndeterminate
4172
+ } = tableReactData;
4173
+ const isAllCheckboxDisabled = $table.computeIsAllCheckboxDisabled;
4159
4174
  const {
4160
4175
  slots
4161
4176
  } = column;
4162
4177
  const headerSlot = slots ? slots.header : null;
4163
4178
  const titleSlot = slots ? slots.title : null;
4164
- const checkboxOpts = $table.checkboxOpts;
4179
+ const checkboxOpts = $table.computeCheckboxOpts;
4165
4180
  const headerTitle = column.getTitle();
4166
- let on;
4181
+ const ons = {};
4167
4182
  if (!isHidden) {
4168
- on = {
4169
- click(evnt) {
4170
- if (!isAllCheckboxDisabled) {
4171
- $table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected);
4172
- }
4183
+ ons.click = evnt => {
4184
+ if (!isAllCheckboxDisabled) {
4185
+ $table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected);
4173
4186
  }
4174
4187
  };
4175
4188
  }
@@ -4196,7 +4209,7 @@ const Cell = {
4196
4209
  attrs: {
4197
4210
  title: cell_getI18n('vxe.table.allTitle')
4198
4211
  },
4199
- on
4212
+ on: ons
4200
4213
  }, [h('span', {
4201
4214
  class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? cell_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? cell_getIcon().TABLE_CHECKBOX_CHECKED : cell_getIcon().TABLE_CHECKBOX_UNCHECKED]
4202
4215
  })].concat(titleSlot || headerTitle ? [h('span', {
@@ -4210,16 +4223,21 @@ const Cell = {
4210
4223
  column,
4211
4224
  isHidden
4212
4225
  } = params;
4226
+ const tableProps = $table;
4227
+ const tableReactData = $table;
4213
4228
  const {
4214
- treeConfig,
4215
- treeIndeterminateMaps,
4216
- selectCheckboxMaps
4217
- } = $table;
4229
+ treeConfig
4230
+ } = tableProps;
4231
+ const {
4232
+ selectCheckboxMaps,
4233
+ treeIndeterminateMaps
4234
+ } = tableReactData;
4235
+ const checkboxOpts = $table.computeCheckboxOpts;
4218
4236
  const {
4219
4237
  labelField,
4220
4238
  checkMethod,
4221
4239
  visibleMethod
4222
- } = $table.checkboxOpts;
4240
+ } = checkboxOpts;
4223
4241
  const {
4224
4242
  slots
4225
4243
  } = column;
@@ -4231,15 +4249,13 @@ const Cell = {
4231
4249
  row
4232
4250
  });
4233
4251
  let isDisabled = !!checkMethod;
4234
- let on;
4252
+ const ons = {};
4235
4253
  if (!isHidden) {
4236
4254
  const rowid = getRowid($table, row);
4237
4255
  isChecked = !!selectCheckboxMaps[rowid];
4238
- on = {
4239
- click(evnt) {
4240
- if (!isDisabled && isVisible) {
4241
- $table.triggerCheckRowEvent(evnt, params, !isChecked);
4242
- }
4256
+ ons.click = evnt => {
4257
+ if (!isDisabled && isVisible) {
4258
+ $table.triggerCheckRowEvent(evnt, params, !isChecked);
4243
4259
  }
4244
4260
  };
4245
4261
  if (checkMethod) {
@@ -4279,7 +4295,7 @@ const Cell = {
4279
4295
  'is--indeterminate': indeterminate,
4280
4296
  'is--hidden': !isVisible
4281
4297
  }],
4282
- on
4298
+ on: ons
4283
4299
  }, checkVNs)]);
4284
4300
  },
4285
4301
  renderTreeSelectionCell(h, params) {
@@ -4292,11 +4308,15 @@ const Cell = {
4292
4308
  column,
4293
4309
  isHidden
4294
4310
  } = params;
4311
+ const tableProps = $table;
4312
+ const tableReactData = $table;
4295
4313
  const {
4296
- treeConfig,
4297
- treeIndeterminateMaps,
4298
- checkboxOpts
4299
- } = $table;
4314
+ treeConfig
4315
+ } = tableProps;
4316
+ const {
4317
+ treeIndeterminateMaps
4318
+ } = tableReactData;
4319
+ const checkboxOpts = $table.computeCheckboxOpts;
4300
4320
  const {
4301
4321
  labelField,
4302
4322
  checkField,
@@ -4315,15 +4335,13 @@ const Cell = {
4315
4335
  row
4316
4336
  });
4317
4337
  let isDisabled = !!checkMethod;
4318
- let on;
4338
+ const ons = {};
4319
4339
  if (!isHidden) {
4320
4340
  const rowid = getRowid($table, row);
4321
4341
  isChecked = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField);
4322
- on = {
4323
- click(evnt) {
4324
- if (!isDisabled && isVisible) {
4325
- $table.triggerCheckRowEvent(evnt, params, !isChecked);
4326
- }
4342
+ ons.click = evnt => {
4343
+ if (!isDisabled && isVisible) {
4344
+ $table.triggerCheckRowEvent(evnt, params, !isChecked);
4327
4345
  }
4328
4346
  };
4329
4347
  if (checkMethod) {
@@ -4363,7 +4381,7 @@ const Cell = {
4363
4381
  'is--indeterminate': indeterminateField && !isChecked ? row[indeterminateField] : isIndeterminate,
4364
4382
  'is--hidden': !isVisible
4365
4383
  }],
4366
- on
4384
+ on: ons
4367
4385
  }, checkVNs)]);
4368
4386
  },
4369
4387
  renderTreeSelectionCellByProp(h, params) {
@@ -4379,11 +4397,12 @@ const Cell = {
4379
4397
  row,
4380
4398
  column
4381
4399
  } = params;
4400
+ const tableReactData = $table;
4382
4401
  const {
4383
- expandOpts,
4384
4402
  rowExpandedMaps,
4385
4403
  rowExpandLazyLoadedMaps
4386
- } = $table;
4404
+ } = tableReactData;
4405
+ const expandOpts = $table.computeExpandOpts;
4387
4406
  const {
4388
4407
  lazy,
4389
4408
  labelField,
@@ -4397,21 +4416,22 @@ const Cell = {
4397
4416
  slots
4398
4417
  } = column;
4399
4418
  const defaultSlot = slots ? slots.default : null;
4400
- let isAceived = false;
4419
+ const iconSlot = slots ? slots.icon : null;
4420
+ let isActive = false;
4401
4421
  let isLazyLoading = false;
4402
- if (slots && slots.icon) {
4403
- return renderCellBaseVNs(h, params, $table.callSlot(slots.icon, params, h));
4422
+ if (iconSlot) {
4423
+ return renderCellBaseVNs(h, params, $table.callSlot(iconSlot, params, h));
4404
4424
  }
4405
4425
  if (!isHidden) {
4406
4426
  const rowid = getRowid($table, row);
4407
- isAceived = !!rowExpandedMaps[rowid];
4427
+ isActive = !!rowExpandedMaps[rowid];
4408
4428
  if (lazy) {
4409
4429
  isLazyLoading = !!rowExpandLazyLoadedMaps[rowid];
4410
4430
  }
4411
4431
  }
4412
4432
  return renderCellBaseVNs(h, params, [showIcon && (!visibleMethod || visibleMethod(params)) ? h('span', {
4413
4433
  class: ['vxe-table--expanded', {
4414
- 'is--active': isAceived
4434
+ 'is--active': isActive
4415
4435
  }],
4416
4436
  on: {
4417
4437
  click(evnt) {
@@ -4419,7 +4439,7 @@ const Cell = {
4419
4439
  }
4420
4440
  }
4421
4441
  }, [h('i', {
4422
- class: ['vxe-table--expand-btn', isLazyLoading ? iconLoaded || cell_getIcon().TABLE_EXPAND_LOADED : isAceived ? iconOpen || cell_getIcon().TABLE_EXPAND_OPEN : iconClose || cell_getIcon().TABLE_EXPAND_CLOSE]
4442
+ class: ['vxe-table--expand-btn', isLazyLoading ? iconLoaded || cell_getIcon().TABLE_EXPAND_LOADED : isActive ? iconOpen || cell_getIcon().TABLE_EXPAND_OPEN : iconClose || cell_getIcon().TABLE_EXPAND_CLOSE]
4423
4443
  })]) : renderEmptyElement($table), defaultSlot || labelField ? h('span', {
4424
4444
  class: 'vxe-table--expand-label'
4425
4445
  }, defaultSlot ? $table.callSlot(defaultSlot, params, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)) : renderEmptyElement($table)]);
@@ -4534,10 +4554,11 @@ const Cell = {
4534
4554
  column,
4535
4555
  hasFilter
4536
4556
  } = params;
4557
+ const tableReactData = $table;
4537
4558
  const {
4538
- filterStore,
4539
- filterOpts
4540
- } = $table;
4559
+ filterStore
4560
+ } = tableReactData;
4561
+ const filterOpts = $table.computeFilterOpts;
4541
4562
  const {
4542
4563
  showIcon,
4543
4564
  iconNone,
@@ -4569,14 +4590,14 @@ const Cell = {
4569
4590
  $table,
4570
4591
  column
4571
4592
  } = params;
4593
+ const tableProps = $table;
4572
4594
  const {
4573
4595
  editConfig,
4574
- editRules,
4575
- editOpts
4576
- } = $table;
4596
+ editRules
4597
+ } = tableProps;
4598
+ const editOpts = $table.computeEditOpts;
4577
4599
  const {
4578
4600
  sortable,
4579
- remoteSort,
4580
4601
  filters,
4581
4602
  editRender
4582
4603
  } = column;
@@ -4595,7 +4616,7 @@ const Cell = {
4595
4616
  class: ['vxe-cell--edit-icon', editOpts.icon || cell_getIcon().TABLE_EDIT]
4596
4617
  }) : renderEmptyElement($table)];
4597
4618
  }
4598
- return renderHeaderCellBaseVNs(h, params, editIconVNs.concat(Cell.renderHeaderTitle(h, params)).concat(sortable || remoteSort ? Cell.renderSortIcon(h, params) : []).concat(filters ? Cell.renderFilterIcon(h, params) : []));
4619
+ return renderHeaderCellBaseVNs(h, params, editIconVNs.concat(Cell.renderHeaderTitle(h, params)).concat(sortable ? Cell.renderSortIcon(h, params) : []).concat(filters ? Cell.renderFilterIcon(h, params) : []));
4599
4620
  },
4600
4621
  // 行格编辑模式
4601
4622
  renderRowEdit(h, params) {
@@ -4603,12 +4624,16 @@ const Cell = {
4603
4624
  $table,
4604
4625
  column
4605
4626
  } = params;
4627
+ const tableReactData = $table;
4606
4628
  const {
4607
- editRender
4608
- } = column;
4629
+ editStore
4630
+ } = tableReactData;
4609
4631
  const {
4610
4632
  actived
4611
- } = $table.editStore;
4633
+ } = editStore;
4634
+ const {
4635
+ editRender
4636
+ } = column;
4612
4637
  return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row);
4613
4638
  },
4614
4639
  renderTreeRowEdit(h, params) {
@@ -4620,12 +4645,16 @@ const Cell = {
4620
4645
  $table,
4621
4646
  column
4622
4647
  } = params;
4648
+ const tableReactData = $table;
4623
4649
  const {
4624
- editRender
4625
- } = column;
4650
+ editStore
4651
+ } = tableReactData;
4626
4652
  const {
4627
4653
  actived
4628
- } = $table.editStore;
4654
+ } = editStore;
4655
+ const {
4656
+ editRender
4657
+ } = column;
4629
4658
  return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row && actived.column === params.column);
4630
4659
  },
4631
4660
  renderTreeCellEdit(h, params) {
@@ -5040,33 +5069,28 @@ function handleVirtualXVisible($xeTable) {
5040
5069
  };
5041
5070
  }
5042
5071
  const computeRowHeight = $xeTable => {
5043
- const props = $xeTable;
5044
- const {
5045
- showOverflow
5046
- } = props;
5047
5072
  const tableHeader = $xeTable.$refs.tableHeader;
5048
5073
  const tableBody = $xeTable.$refs.tableBody;
5049
5074
  const tableBodyElem = tableBody ? tableBody.$el : null;
5050
5075
  const vSize = $xeTable.computeSize;
5051
5076
  const rowHeightMaps = $xeTable.computeRowHeightMaps;
5052
- let rowHeight = 24;
5053
- if (showOverflow) {
5054
- if (tableBodyElem) {
5055
- const tableHeaderElem = tableHeader ? tableHeader.$el : null;
5056
- let firstTrElem;
5057
- firstTrElem = tableBodyElem.querySelector('tr');
5058
- if (!firstTrElem && tableHeaderElem) {
5059
- firstTrElem = tableHeaderElem.querySelector('tr');
5060
- }
5061
- if (firstTrElem) {
5062
- rowHeight = firstTrElem.clientHeight;
5063
- }
5064
- if (!rowHeight) {
5065
- rowHeight = rowHeightMaps[vSize || 'default'];
5066
- }
5077
+ let rowHeight = 0;
5078
+ if (tableBodyElem) {
5079
+ const tableHeaderElem = tableHeader ? tableHeader.$el : null;
5080
+ let firstTrElem;
5081
+ firstTrElem = tableBodyElem.querySelector('tr');
5082
+ if (!firstTrElem && tableHeaderElem) {
5083
+ firstTrElem = tableHeaderElem.querySelector('tr');
5067
5084
  }
5085
+ if (firstTrElem) {
5086
+ rowHeight = firstTrElem.clientHeight;
5087
+ }
5088
+ }
5089
+ if (!rowHeight) {
5090
+ rowHeight = rowHeightMaps[vSize || 'default'];
5068
5091
  }
5069
- return rowHeight;
5092
+ // 最低支持 18px 行高
5093
+ return Math.max(18, rowHeight);
5070
5094
  };
5071
5095
  function handleVirtualYVisible($xeTable) {
5072
5096
  const internalData = $xeTable;
@@ -5535,7 +5559,9 @@ const handleScrollToRowColumn = ($xeTable, fieldOrColumn, row) => {
5535
5559
  return $xeTable.$nextTick();
5536
5560
  };
5537
5561
  function handleRecalculateLayout($xeTable, reFull) {
5562
+ const internalData = $xeTable;
5538
5563
  const el = $xeTable.$refs.refElem;
5564
+ internalData.reRunTime = Date.now();
5539
5565
  if (!el || !el.clientWidth) {
5540
5566
  return $xeTable.$nextTick();
5541
5567
  }
@@ -6024,7 +6050,7 @@ const Methods = {
6024
6050
  const isLazy = treeConfig && treeOpts.lazy;
6025
6051
  const fullAllDataRowIdMaps = {};
6026
6052
  const fullDataRowIdMaps = {};
6027
- const handleCache = (row, index, items, path, parent, nodes) => {
6053
+ const handleCache = (row, index, items, path, parentRow, nodes) => {
6028
6054
  let rowid = getRowid(this, row);
6029
6055
  const seq = treeConfig && path ? toTreePathSeq(path) : index + 1;
6030
6056
  const level = nodes ? nodes.length - 1 : 0;
@@ -6045,16 +6071,16 @@ const Methods = {
6045
6071
  _index: -1,
6046
6072
  $index: -1,
6047
6073
  items,
6048
- parent,
6074
+ parent: parentRow,
6049
6075
  level,
6050
6076
  height: 0
6051
6077
  };
6052
6078
  }
6053
6079
  cacheItem.row = row;
6054
6080
  cacheItem.items = items;
6055
- cacheItem.parent = parent;
6081
+ cacheItem.parent = parentRow;
6056
6082
  cacheItem.level = level;
6057
- cacheItem.index = treeConfig && parent ? -1 : index;
6083
+ cacheItem.index = treeConfig && parentRow ? -1 : index;
6058
6084
  if (isSource) {
6059
6085
  fullDataRowIdMaps[rowid] = cacheItem;
6060
6086
  }
@@ -6137,9 +6163,9 @@ const Methods = {
6137
6163
  sourceDataRowIdData[rowid] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(childRow, true);
6138
6164
  });
6139
6165
  }
6140
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rows, (childRow, index, items, path, parent, nodes) => {
6166
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rows, (childRow, index, items, path, parentItem, nodes) => {
6141
6167
  const rowid = getRowid($xeTable, childRow);
6142
- const parentRow = parent || parentRest.row;
6168
+ const parentRow = parentItem || parentRest.row;
6143
6169
  const rest = {
6144
6170
  row: childRow,
6145
6171
  rowid,
@@ -6196,7 +6222,7 @@ const Methods = {
6196
6222
  let radioColumn;
6197
6223
  let htmlColumn;
6198
6224
  let hasFixed;
6199
- const handleFunc = (column, index, items, path, parent) => {
6225
+ const handleFunc = (column, index, items, path, parentColumn) => {
6200
6226
  const {
6201
6227
  id: colid,
6202
6228
  field,
@@ -6211,7 +6237,7 @@ const Methods = {
6211
6237
  colid,
6212
6238
  index,
6213
6239
  items,
6214
- parent: parent || null,
6240
+ parent: parentColumn || null,
6215
6241
  width: 0
6216
6242
  };
6217
6243
  if (field) {
@@ -6275,9 +6301,9 @@ const Methods = {
6275
6301
  fullColumnIdData[colid] = rest;
6276
6302
  };
6277
6303
  if (isGroup) {
6278
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parent, nodes) => {
6304
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn, nodes) => {
6279
6305
  column.level = nodes.length;
6280
- handleFunc(column, index, items, path, parent);
6306
+ handleFunc(column, index, items, path, parentColumn);
6281
6307
  });
6282
6308
  } else {
6283
6309
  tableFullColumn.forEach(handleFunc);
@@ -6947,10 +6973,10 @@ const Methods = {
6947
6973
  if (treeConfig && treeOpts.transform) {
6948
6974
  const fullData = [];
6949
6975
  const expandMaps = {};
6950
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, (row, index, items, path, parent) => {
6976
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, (row, index, items, path, parentRow) => {
6951
6977
  const rowid = getRowid(this, row);
6952
- const parentRowid = getRowid(this, parent);
6953
- if (!parent || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
6978
+ const parentRowid = getRowid(this, parentRow);
6979
+ if (!parentRow || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
6954
6980
  const rowRest = fullAllDataRowIdData[rowid];
6955
6981
  if (rowRest) {
6956
6982
  rowRest._index = fullData.length;
@@ -7646,11 +7672,11 @@ const Methods = {
7646
7672
  let hasCustomSort = false;
7647
7673
  // 处理还原
7648
7674
  if (resizableData || sortData || visibleData || fixedData) {
7649
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parent) => {
7675
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentRow) => {
7650
7676
  const colKey = column.getKey();
7651
7677
  // 支持一级
7652
- if (!parent) {
7653
- if (fixedData && fixedData[colKey]) {
7678
+ if (!parentRow) {
7679
+ if (fixedData && fixedData[colKey] !== undefined) {
7654
7680
  column.fixed = fixedData[colKey];
7655
7681
  }
7656
7682
  if (sortData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(sortData[colKey])) {
@@ -7744,9 +7770,9 @@ const Methods = {
7744
7770
  let hasSort = 0;
7745
7771
  let hasFixedt = 0;
7746
7772
  let hasVisible = 0;
7747
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parent) => {
7773
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
7748
7774
  // 只支持一级
7749
- if (!parent) {
7775
+ if (!parentColumn) {
7750
7776
  collectColumn.forEach(column => {
7751
7777
  const colKey = column.getKey();
7752
7778
  if (colKey) {
@@ -7754,7 +7780,7 @@ const Methods = {
7754
7780
  sortData[colKey] = column.renderSortNumber;
7755
7781
  }
7756
7782
  });
7757
- if (column.fixed && column.fixed !== column.defaultFixed) {
7783
+ if (column.fixed !== column.defaultFixed) {
7758
7784
  const colKey = column.getKey();
7759
7785
  if (colKey) {
7760
7786
  hasFixedt = 1;
@@ -7890,13 +7916,13 @@ const Methods = {
7890
7916
  const leftGroupList = [];
7891
7917
  const centerGroupList = [];
7892
7918
  const rightGroupList = [];
7893
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parent) => {
7919
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
7894
7920
  const isColGroup = hasChildrenList(column);
7895
7921
  // 如果是分组,必须按组设置固定列,不允许给子列设置固定
7896
- if (parent && parent.fixed) {
7897
- column.fixed = parent.fixed;
7922
+ if (parentColumn && parentColumn.fixed) {
7923
+ column.fixed = parentColumn.fixed;
7898
7924
  }
7899
- if (parent && column.fixed !== parent.fixed) {
7925
+ if (parentColumn && column.fixed !== parentColumn.fixed) {
7900
7926
  errLog('vxe.error.groupFixed');
7901
7927
  }
7902
7928
  if (isColGroup) {
@@ -8104,28 +8130,35 @@ const Methods = {
8104
8130
  * 刷新布局
8105
8131
  */
8106
8132
  recalculate(reFull) {
8133
+ const $xeTable = this;
8134
+ const internalData = $xeTable;
8107
8135
  return new Promise(resolve => {
8108
- const $xeTable = this;
8109
- const internalData = $xeTable;
8110
8136
  const {
8111
- rceTimeout
8137
+ rceTimeout,
8138
+ reRunTime
8112
8139
  } = internalData;
8140
+ const resizeOpts = $xeTable.computeResizeOpts;
8141
+ const refreshDelay = resizeOpts.refreshDelay || 20;
8113
8142
  const el = $xeTable.$refs.refElem;
8114
8143
  if (el && el.clientWidth) {
8115
8144
  $xeTable.autoCellWidth();
8116
8145
  }
8117
8146
  if (rceTimeout) {
8118
8147
  clearTimeout(rceTimeout);
8119
- $xeTable.$nextTick(() => {
8120
- resolve();
8121
- });
8148
+ if (reRunTime && reRunTime + (refreshDelay - 5) < Date.now()) {
8149
+ resolve(handleRecalculateLayout($xeTable, !!reFull));
8150
+ } else {
8151
+ $xeTable.$nextTick(() => {
8152
+ resolve();
8153
+ });
8154
+ }
8122
8155
  } else {
8123
8156
  resolve(handleRecalculateLayout($xeTable, !!reFull));
8124
8157
  }
8125
8158
  internalData.rceTimeout = setTimeout(() => {
8126
8159
  internalData.rceTimeout = undefined;
8127
- resolve(handleRecalculateLayout($xeTable, !!reFull));
8128
- }, 20);
8160
+ handleRecalculateLayout($xeTable, !!reFull);
8161
+ }, refreshDelay);
8129
8162
  });
8130
8163
  },
8131
8164
  calcCellWidth() {
@@ -10884,7 +10917,9 @@ const Methods = {
10884
10917
  actived
10885
10918
  } = editStore;
10886
10919
  const cell = evnt.currentTarget;
10887
- params.cell = cell;
10920
+ params = Object.assign({
10921
+ cell
10922
+ }, params);
10888
10923
  if (isEnableConf(editConfig) && editOpts.trigger === 'dblclick') {
10889
10924
  if (!actived.args || evnt.currentTarget !== actived.args.cell) {
10890
10925
  if (editOpts.mode === 'row') {
@@ -11099,6 +11134,7 @@ const Methods = {
11099
11134
  prevDragToChild
11100
11135
  } = internalData;
11101
11136
  const {
11137
+ isPeerDrag,
11102
11138
  isCrossDrag,
11103
11139
  isSelfToChildDrag,
11104
11140
  dragEndMethod
@@ -11160,20 +11196,27 @@ const Methods = {
11160
11196
  let isSelfToChildStatus = false;
11161
11197
  if (oldLevel && newLevel) {
11162
11198
  // 子到子
11163
- if (!isCrossDrag) {
11164
- return;
11165
- }
11166
- if (oldAllMaps[newRowid]) {
11167
- isSelfToChildStatus = true;
11168
- if (!isSelfToChildDrag) {
11169
- if (core_.VxeUI.modal) {
11170
- core_.VxeUI.modal.message({
11171
- status: 'error',
11172
- content: methods_getI18n('vxe.error.treeDragChild')
11173
- });
11174
- }
11199
+ if (isPeerDrag) {
11200
+ if (oldRest.row[parentField] !== newRest.row[parentField]) {
11201
+ // 非同级
11175
11202
  return;
11176
11203
  }
11204
+ } else {
11205
+ if (!isCrossDrag) {
11206
+ return;
11207
+ }
11208
+ if (oldAllMaps[newRowid]) {
11209
+ isSelfToChildStatus = true;
11210
+ if (!(isCrossDrag && isSelfToChildDrag)) {
11211
+ if (core_.VxeUI.modal) {
11212
+ core_.VxeUI.modal.message({
11213
+ status: 'error',
11214
+ content: methods_getI18n('vxe.error.treeDragChild')
11215
+ });
11216
+ }
11217
+ return;
11218
+ }
11219
+ }
11177
11220
  }
11178
11221
  } else if (oldLevel) {
11179
11222
  // 子到根
@@ -11187,7 +11230,7 @@ const Methods = {
11187
11230
  }
11188
11231
  if (oldAllMaps[newRowid]) {
11189
11232
  isSelfToChildStatus = true;
11190
- if (!isSelfToChildDrag) {
11233
+ if (!(isCrossDrag && isSelfToChildDrag)) {
11191
11234
  if (core_.VxeUI.modal) {
11192
11235
  core_.VxeUI.modal.message({
11193
11236
  status: 'error',
@@ -11211,7 +11254,7 @@ const Methods = {
11211
11254
  const ntfIndex = ptfIndex + dragOffsetIndex;
11212
11255
  fullList.splice(ntfIndex, 0, dragRow);
11213
11256
  // 改变层级
11214
- if (isSelfToChildStatus && isSelfToChildDrag) {
11257
+ if (isSelfToChildStatus && isCrossDrag && isSelfToChildDrag) {
11215
11258
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(dragRow[childrenField], childRow => {
11216
11259
  childRow[parentField] = dragRow[parentField];
11217
11260
  });
@@ -11292,10 +11335,12 @@ const Methods = {
11292
11335
  } = reactData;
11293
11336
  const treeOpts = $xeTable.computeTreeOpts;
11294
11337
  const {
11295
- transform
11338
+ transform,
11339
+ parentField
11296
11340
  } = treeOpts;
11297
11341
  const rowDragOpts = $xeTable.computeRowDragOpts;
11298
11342
  const {
11343
+ isPeerDrag,
11299
11344
  isCrossDrag,
11300
11345
  isToChildDrag
11301
11346
  } = rowDragOpts;
@@ -11315,7 +11360,7 @@ const Methods = {
11315
11360
  } = reactData;
11316
11361
  const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
11317
11362
  const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
11318
- if ($xeTable.eqRow(dragRow, row) || !isCrossDrag && treeConfig && rest.level) {
11363
+ if ($xeTable.eqRow(dragRow, row) || !isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rest.level)) {
11319
11364
  showDropTip($xeTable, evnt, trEl, null, false, dragPos);
11320
11365
  return;
11321
11366
  }
@@ -11396,6 +11441,7 @@ const Methods = {
11396
11441
  } = props;
11397
11442
  const columnDragOpts = $xeTable.computeColumnDragOpts;
11398
11443
  const {
11444
+ isPeerDrag,
11399
11445
  isCrossDrag,
11400
11446
  isSelfToChildDrag,
11401
11447
  isToChildDrag,
@@ -11428,20 +11474,27 @@ const Methods = {
11428
11474
  let isSelfToChildStatus = false;
11429
11475
  if (oldColumn.parentId && newColumn.parentId) {
11430
11476
  // 子到子
11431
- if (!isCrossDrag) {
11432
- return;
11433
- }
11434
- if (oldAllMaps[newColumn.id]) {
11435
- isSelfToChildStatus = true;
11436
- if (!isSelfToChildDrag) {
11437
- if (core_.VxeUI.modal) {
11438
- core_.VxeUI.modal.message({
11439
- status: 'error',
11440
- content: methods_getI18n('vxe.error.treeDragChild')
11441
- });
11442
- }
11477
+ if (isPeerDrag) {
11478
+ if (oldColumn.parentId !== newColumn.parentId) {
11479
+ // 非同级
11443
11480
  return;
11444
11481
  }
11482
+ } else {
11483
+ if (!isCrossDrag) {
11484
+ return;
11485
+ }
11486
+ if (oldAllMaps[newColumn.id]) {
11487
+ isSelfToChildStatus = true;
11488
+ if (!(isCrossDrag && isSelfToChildDrag)) {
11489
+ if (core_.VxeUI.modal) {
11490
+ core_.VxeUI.modal.message({
11491
+ status: 'error',
11492
+ content: methods_getI18n('vxe.error.treeDragChild')
11493
+ });
11494
+ }
11495
+ return;
11496
+ }
11497
+ }
11445
11498
  }
11446
11499
  } else if (oldColumn.parentId) {
11447
11500
  // 子到根
@@ -11455,7 +11508,7 @@ const Methods = {
11455
11508
  }
11456
11509
  if (oldAllMaps[newColumn.id]) {
11457
11510
  isSelfToChildStatus = true;
11458
- if (!isSelfToChildDrag) {
11511
+ if (!(isCrossDrag && isSelfToChildDrag)) {
11459
11512
  if (core_.VxeUI.modal) {
11460
11513
  core_.VxeUI.modal.message({
11461
11514
  status: 'error',
@@ -11470,7 +11523,7 @@ const Methods = {
11470
11523
  }
11471
11524
  const oldewMatchRest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(collectColumn, item => item.id === oldColumn.id);
11472
11525
  // 改变层级
11473
- if (isSelfToChildStatus && isSelfToChildDrag) {
11526
+ if (isSelfToChildStatus && isCrossDrag && isSelfToChildDrag) {
11474
11527
  if (oldewMatchRest) {
11475
11528
  const {
11476
11529
  items: oCols,
@@ -11504,7 +11557,7 @@ const Methods = {
11504
11557
  parent: nParent
11505
11558
  } = newMatchRest;
11506
11559
  // 转子级
11507
- if (isToChildDrag && prevDragToChild) {
11560
+ if (isCrossDrag && isToChildDrag && prevDragToChild) {
11508
11561
  oldColumn.parentId = newColumn.id;
11509
11562
  newColumn.children = (newColumn.children || []).concat([oldColumn]);
11510
11563
  } else {
@@ -11515,8 +11568,8 @@ const Methods = {
11515
11568
  nafIndex = nIndex;
11516
11569
  }
11517
11570
  }
11518
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parent) => {
11519
- if (!parent) {
11571
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
11572
+ if (!parentColumn) {
11520
11573
  const sortIndex = index + 1;
11521
11574
  column.renderSortNumber = sortIndex;
11522
11575
  }
@@ -11584,6 +11637,7 @@ const Methods = {
11584
11637
  const columnDragOpts = $xeTable.computeColumnDragOpts;
11585
11638
  const {
11586
11639
  isToChildDrag,
11640
+ isPeerDrag,
11587
11641
  isCrossDrag
11588
11642
  } = columnDragOpts;
11589
11643
  if (!dragCol) {
@@ -11601,11 +11655,11 @@ const Methods = {
11601
11655
  } = evnt;
11602
11656
  const offsetX = clientX - thEl.getBoundingClientRect().x;
11603
11657
  const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
11604
- if (column.fixed || dragCol && dragCol.id === column.id || !isCrossDrag && column.parentId) {
11658
+ if (column.fixed || dragCol && dragCol.id === column.id || !isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : column.parentId)) {
11605
11659
  showDropTip($xeTable, evnt, null, thEl, false, dragPos);
11606
11660
  return;
11607
11661
  }
11608
- internalData.prevDragToChild = !!(isToChildDrag && hasCtrlKey);
11662
+ internalData.prevDragToChild = !!(isCrossDrag && isToChildDrag && hasCtrlKey);
11609
11663
  internalData.prevDragCol = column;
11610
11664
  internalData.prevDragPos = dragPos;
11611
11665
  showDropTip($xeTable, evnt, null, thEl, true, dragPos);
@@ -17065,7 +17119,7 @@ const renderPopupPanel = (h, _vm) => {
17065
17119
  }
17066
17120
  if (oldAllMaps[newColumn.id]) {
17067
17121
  isSelfToChildStatus = true;
17068
- if (!isSelfToChildDrag) {
17122
+ if (!(isCrossDrag && isSelfToChildDrag)) {
17069
17123
  if (core_.VxeUI.modal) {
17070
17124
  core_.VxeUI.modal.message({
17071
17125
  status: 'error',
@@ -17087,7 +17141,7 @@ const renderPopupPanel = (h, _vm) => {
17087
17141
  }
17088
17142
  if (oldAllMaps[newColumn.id]) {
17089
17143
  isSelfToChildStatus = true;
17090
- if (!isSelfToChildDrag) {
17144
+ if (!(isCrossDrag && isSelfToChildDrag)) {
17091
17145
  if (core_.VxeUI.modal) {
17092
17146
  core_.VxeUI.modal.message({
17093
17147
  status: 'error',
@@ -17102,7 +17156,7 @@ const renderPopupPanel = (h, _vm) => {
17102
17156
  }
17103
17157
  const oldewMatchRest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(collectColumn, item => item.id === oldColumn.id);
17104
17158
  // 改变层级
17105
- if (isSelfToChildStatus && isSelfToChildDrag) {
17159
+ if (isSelfToChildStatus && isCrossDrag && isSelfToChildDrag) {
17106
17160
  if (oldewMatchRest) {
17107
17161
  const {
17108
17162
  items: oCols,
@@ -17136,7 +17190,7 @@ const renderPopupPanel = (h, _vm) => {
17136
17190
  parent: nParent
17137
17191
  } = newMatchRest;
17138
17192
  // 转子级
17139
- if (isToChildDrag && prevDragToChild) {
17193
+ if (isCrossDrag && isToChildDrag && prevDragToChild) {
17140
17194
  oldColumn.parentId = newColumn.id;
17141
17195
  newColumn.children = (newColumn.children || []).concat([oldColumn]);
17142
17196
  } else {
@@ -17220,7 +17274,7 @@ const renderPopupPanel = (h, _vm) => {
17220
17274
  panel_showDropTip(this, evnt, optEl, false, dragPos);
17221
17275
  return;
17222
17276
  }
17223
- this.prevDragToChild = !!(isToChildDrag && hasCtrlKey && immediate);
17277
+ this.prevDragToChild = !!(isCrossDrag && isToChildDrag && hasCtrlKey && immediate);
17224
17278
  this.prevDragCol = column;
17225
17279
  this.prevDragPos = dragPos;
17226
17280
  panel_showDropTip(this, evnt, optEl, true, dragPos);
@@ -20208,7 +20262,6 @@ function createHtmlPage(opts, content) {
20208
20262
 
20209
20263
 
20210
20264
 
20211
-
20212
20265
  const {
20213
20266
  getI18n: export_mixin_getI18n,
20214
20267
  renderer: export_mixin_renderer
@@ -20217,30 +20270,23 @@ let htmlCellElem;
20217
20270
  // 导入
20218
20271
  let fileForm;
20219
20272
  let fileInput;
20220
- // 打印
20221
- let printFrame;
20222
20273
  const csvBOM = '\ufeff';
20223
20274
  const enterSymbol = '\r\n';
20224
- function createFrame() {
20225
- const frame = document.createElement('iframe');
20226
- frame.className = 'vxe-table--print-frame';
20227
- return frame;
20228
- }
20229
- function hasTreeChildren($xetable, row) {
20230
- const treeOpts = $xetable.treeOpts;
20275
+ function hasTreeChildren($xeTable, row) {
20276
+ const treeOpts = $xeTable.computeTreeOpts;
20231
20277
  const childrenField = treeOpts.children || treeOpts.childrenField;
20232
- return row[childrenField] && row[childrenField].length > 0;
20278
+ return row[childrenField] && row[childrenField].length;
20233
20279
  }
20234
- function getSeq($xetable, cellValue, row, $rowIndex, column, $columnIndex) {
20235
- const seqOpts = $xetable.seqOpts;
20280
+ function getSeq($xeTable, cellValue, row, $rowIndex, column, $columnIndex) {
20281
+ const seqOpts = $xeTable.computeSeqOpts;
20236
20282
  const seqMethod = seqOpts.seqMethod || column.seqMethod;
20237
20283
  if (seqMethod) {
20238
20284
  return seqMethod({
20239
20285
  row,
20240
- rowIndex: $xetable.getRowIndex(row),
20286
+ rowIndex: $xeTable.getRowIndex(row),
20241
20287
  $rowIndex,
20242
20288
  column,
20243
- columnIndex: $xetable.getColumnIndex(column),
20289
+ columnIndex: $xeTable.getColumnIndex(column),
20244
20290
  $columnIndex
20245
20291
  });
20246
20292
  }
@@ -20265,22 +20311,23 @@ const toStringValue = cellValue => {
20265
20311
  return eqEmptyValue(cellValue) ? '' : `${cellValue}`;
20266
20312
  };
20267
20313
  function getBodyLabelData($xeTable, opts, columns, datas) {
20314
+ const props = $xeTable;
20268
20315
  const {
20269
20316
  isAllExpand,
20270
20317
  mode
20271
20318
  } = opts;
20272
20319
  const {
20273
- treeConfig,
20274
- treeOpts,
20275
- radioOpts,
20276
- checkboxOpts,
20277
- columnOpts
20278
- } = $xeTable;
20279
- const childrenField = treeOpts.children || treeOpts.childrenField;
20320
+ treeConfig
20321
+ } = props;
20322
+ const radioOpts = $xeTable.computeRadioOpts;
20323
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
20324
+ const treeOpts = $xeTable.computeTreeOpts;
20325
+ const columnOpts = $xeTable.computeColumnOpts;
20280
20326
  if (!htmlCellElem) {
20281
20327
  htmlCellElem = document.createElement('div');
20282
20328
  }
20283
20329
  if (treeConfig) {
20330
+ const childrenField = treeOpts.children || treeOpts.childrenField;
20284
20331
  // 如果是树表格只允许导出数据源
20285
20332
  const rest = [];
20286
20333
  const expandMaps = new Map();
@@ -20298,11 +20345,11 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
20298
20345
  columns.forEach((column, $columnIndex) => {
20299
20346
  let cellValue = '';
20300
20347
  const renderOpts = column.editRender || column.cellRender;
20301
- let bodyExportMethod = column.exportMethod;
20348
+ let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
20302
20349
  if (!bodyExportMethod && renderOpts && renderOpts.name) {
20303
20350
  const compConf = export_mixin_renderer.get(renderOpts.name);
20304
20351
  if (compConf) {
20305
- bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod || compConf.cellExportMethod;
20352
+ bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
20306
20353
  }
20307
20354
  }
20308
20355
  if (!bodyExportMethod) {
@@ -20319,8 +20366,8 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
20319
20366
  switch (column.type) {
20320
20367
  case 'seq':
20321
20368
  {
20322
- const seqValue = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
20323
- cellValue = mode === 'all' ? seqValue : getSeq($xeTable, seqValue, row, $rowIndex, column, $columnIndex);
20369
+ const seqVal = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
20370
+ cellValue = mode === 'all' ? seqVal : getSeq($xeTable, seqVal, row, $rowIndex, column, $columnIndex);
20324
20371
  break;
20325
20372
  }
20326
20373
  case 'checkbox':
@@ -20371,16 +20418,13 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
20371
20418
  columns.forEach((column, $columnIndex) => {
20372
20419
  let cellValue = '';
20373
20420
  const renderOpts = column.editRender || column.cellRender;
20374
- let bodyExportMethod = column.exportMethod;
20421
+ let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
20375
20422
  if (!bodyExportMethod && renderOpts && renderOpts.name) {
20376
20423
  const compConf = export_mixin_renderer.get(renderOpts.name);
20377
20424
  if (compConf) {
20378
- bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod || compConf.cellExportMethod;
20425
+ bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
20379
20426
  }
20380
20427
  }
20381
- if (!bodyExportMethod) {
20382
- bodyExportMethod = columnOpts.exportMethod;
20383
- }
20384
20428
  if (bodyExportMethod) {
20385
20429
  cellValue = bodyExportMethod({
20386
20430
  $table: $xeTable,
@@ -20857,7 +20901,8 @@ function clearColumnConvert(columns) {
20857
20901
  children: 'children'
20858
20902
  });
20859
20903
  }
20860
- function handleExport($xetable, opts) {
20904
+ function handleExport($xeTable, opts) {
20905
+ const $xeGrid = $xeTable.$xeGrid;
20861
20906
  const {
20862
20907
  remote,
20863
20908
  columns,
@@ -20869,19 +20914,19 @@ function handleExport($xetable, opts) {
20869
20914
  if (remote) {
20870
20915
  const params = {
20871
20916
  options: opts,
20872
- $table: $xetable,
20873
- $grid: $xetable.$xegrid
20917
+ $table: $xeTable,
20918
+ $grid: $xeGrid
20874
20919
  };
20875
20920
  resolve(exportMethod ? exportMethod(params) : params);
20876
20921
  } else {
20877
- const datas = getExportData($xetable, opts);
20878
- resolve($xetable.preventEvent(null, 'event.export', {
20922
+ const datas = getExportData($xeTable, opts);
20923
+ resolve($xeTable.preventEvent(null, 'event.export', {
20879
20924
  options: opts,
20880
20925
  columns,
20881
20926
  colgroups,
20882
20927
  datas
20883
20928
  }, () => {
20884
- return downloadFile($xetable, opts, getContent($xetable, opts, columns, datas));
20929
+ return downloadFile($xeTable, opts, getContent($xeTable, opts, columns, datas));
20885
20930
  }));
20886
20931
  }
20887
20932
  }).then(params => {
@@ -20891,8 +20936,8 @@ function handleExport($xetable, opts) {
20891
20936
  afterExportMethod({
20892
20937
  status: true,
20893
20938
  options: opts,
20894
- $table: $xetable,
20895
- $grid: $xetable.$xegrid
20939
+ $table: $xeTable,
20940
+ $grid: $xeGrid
20896
20941
  });
20897
20942
  }
20898
20943
  }
@@ -20906,8 +20951,8 @@ function handleExport($xetable, opts) {
20906
20951
  afterExportMethod({
20907
20952
  status: false,
20908
20953
  options: opts,
20909
- $table: $xetable,
20910
- $grid: $xetable.$xegrid
20954
+ $table: $xeTable,
20955
+ $grid: $xeGrid
20911
20956
  });
20912
20957
  }
20913
20958
  }
@@ -21330,79 +21375,42 @@ function readLocalFile(options = {}) {
21330
21375
  fileInput.click();
21331
21376
  });
21332
21377
  }
21333
- function removePrintFrame() {
21334
- if (printFrame) {
21335
- if (printFrame.parentNode) {
21336
- try {
21337
- printFrame.contentDocument.write('');
21338
- } catch (e) {}
21339
- printFrame.parentNode.removeChild(printFrame);
21340
- }
21341
- printFrame = null;
21342
- }
21343
- }
21344
- function appendPrintFrame() {
21345
- if (!printFrame.parentNode) {
21346
- document.body.appendChild(printFrame);
21347
- }
21348
- }
21349
- function afterPrintEvent() {
21350
- requestAnimationFrame(removePrintFrame);
21351
- }
21352
- function handlePrint($xetable, opts, content) {
21378
+ function handleExportAndPrint($xeTable, options, isPrint) {
21379
+ const props = $xeTable;
21380
+ const reactData = $xeTable;
21381
+ const internalData = $xeTable;
21382
+ const $xeGrid = $xeTable.$xeGrid;
21353
21383
  const {
21354
- beforePrintMethod
21355
- } = opts;
21356
- if (beforePrintMethod) {
21357
- content = beforePrintMethod({
21358
- content,
21359
- options: opts,
21360
- $table: $xetable
21361
- }) || '';
21362
- }
21363
- content = createHtmlPage(opts, content);
21364
- const blob = getExportBlobByContent(content, opts);
21365
- if (browse.msie) {
21366
- removePrintFrame();
21367
- printFrame = createFrame();
21368
- appendPrintFrame();
21369
- printFrame.contentDocument.write(content);
21370
- printFrame.contentDocument.execCommand('print');
21371
- } else {
21372
- if (!printFrame) {
21373
- printFrame = createFrame();
21374
- printFrame.onload = evnt => {
21375
- if (evnt.target.src) {
21376
- evnt.target.contentWindow.onafterprint = afterPrintEvent;
21377
- evnt.target.contentWindow.print();
21378
- }
21379
- };
21380
- }
21381
- appendPrintFrame();
21382
- printFrame.src = URL.createObjectURL(blob);
21383
- }
21384
- }
21385
- function handleExportAndPrint($xetable, options, isPrint) {
21384
+ treeConfig,
21385
+ showHeader,
21386
+ showFooter
21387
+ } = props;
21386
21388
  const {
21387
- $xegrid,
21388
21389
  initStore,
21389
- customOpts,
21390
- collectColumn,
21391
- footerTableData,
21392
- treeConfig,
21393
21390
  mergeList,
21391
+ mergeFooterList,
21394
21392
  isGroup,
21395
- exportParams,
21396
- exportOpts
21397
- } = $xetable;
21398
- const proxyOpts = $xegrid ? $xegrid.proxyOpts : {};
21399
- const selectRecords = $xetable.getCheckboxRecords();
21400
- const hasFooter = !!footerTableData.length;
21393
+ footerTableData,
21394
+ exportStore,
21395
+ exportParams
21396
+ } = reactData;
21397
+ const {
21398
+ collectColumn
21399
+ } = internalData;
21400
+ const exportOpts = $xeTable.computeExportOpts;
21401
21401
  const hasTree = treeConfig;
21402
- const hasMerge = !hasTree && mergeList.length;
21402
+ const customOpts = $xeTable.computeCustomOpts;
21403
+ const selectRecords = $xeTable.getCheckboxRecords();
21404
+ const proxyOpts = $xeGrid ? $xeGrid.computeProxyOpts : {};
21405
+ const hasFooter = !!footerTableData.length;
21406
+ const hasMerge = !!(mergeList.length || mergeFooterList.length);
21403
21407
  const defOpts = Object.assign({
21404
21408
  message: true,
21405
- isHeader: true,
21409
+ isHeader: showHeader,
21410
+ isFooter: showFooter,
21411
+ isColgroup: isGroup,
21412
+ isMerge: hasMerge,
21413
+ useStyle: true,
21406
21414
  current: 'current',
21407
21415
  modes: ['current', 'selected'].concat(proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : [])
21408
21416
  }, options);
@@ -21438,7 +21446,7 @@ function handleExportAndPrint($xetable, options, isPrint) {
21438
21446
  if (isColGroup || defaultFilterExportColumn(column)) {
21439
21447
  column.checked = columns ? columns.some(item => {
21440
21448
  if (isColumnInfo(item)) {
21441
- return column === item;
21449
+ return column.id === item.id;
21442
21450
  } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(item)) {
21443
21451
  return column.field === item;
21444
21452
  } else {
@@ -21464,7 +21472,7 @@ function handleExportAndPrint($xetable, options, isPrint) {
21464
21472
  }
21465
21473
  });
21466
21474
  // 更新条件
21467
- Object.assign($xetable.exportStore, {
21475
+ Object.assign(exportStore, {
21468
21476
  columns: exportColumns,
21469
21477
  typeList,
21470
21478
  modeList,
@@ -21479,14 +21487,42 @@ function handleExportAndPrint($xetable, options, isPrint) {
21479
21487
  Object.assign(exportParams, {
21480
21488
  mode: selectRecords.length ? 'selected' : 'current'
21481
21489
  }, defOpts);
21482
- if (!modeList.some(item => item.value === exportParams.mode)) {
21490
+ const {
21491
+ filename,
21492
+ sheetName,
21493
+ mode,
21494
+ type
21495
+ } = exportParams;
21496
+ if (filename) {
21497
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(filename)) {
21498
+ exportParams.filename = filename({
21499
+ options: defOpts,
21500
+ $table: $xeTable,
21501
+ $grid: $xeGrid
21502
+ });
21503
+ } else {
21504
+ exportParams.filename = `${filename}`;
21505
+ }
21506
+ }
21507
+ if (sheetName) {
21508
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sheetName)) {
21509
+ exportParams.sheetName = sheetName({
21510
+ options: defOpts,
21511
+ $table: $xeTable,
21512
+ $grid: $xeGrid
21513
+ });
21514
+ } else {
21515
+ exportParams.sheetName = `${sheetName}`;
21516
+ }
21517
+ }
21518
+ if (!modeList.some(item => item.value === mode)) {
21483
21519
  exportParams.mode = modeList[0].value;
21484
21520
  }
21485
- if (!typeList.some(item => item.value === exportParams.type)) {
21521
+ if (!typeList.some(item => item.value === type)) {
21486
21522
  exportParams.type = typeList[0].value;
21487
21523
  }
21488
21524
  initStore.export = true;
21489
- return $xetable.$nextTick();
21525
+ return $xeTable.$nextTick();
21490
21526
  }
21491
21527
  const getConvertColumns = columns => {
21492
21528
  const result = [];
@@ -21544,12 +21580,13 @@ const convertToRows = originColumns => {
21544
21580
  /**
21545
21581
  * 导出文件,支持 csv/html/xml/txt
21546
21582
  * 如果是树表格,则默认是导出所有节点
21547
- * 如果是启用了虚拟滚动,则只能导出数据源,可以配合 dataFilterMethod 函数自行转换数据
21583
+ * 如果是启用了虚拟滚动,则只能导出数据源,可以配合 dataFilterMethod 函数转换数据
21548
21584
  * @param {Object} options 参数
21549
21585
  */
21550
21586
  _exportData(options) {
21587
+ const $xeTable = this;
21588
+ const $xeGrid = $xeTable.$xeGrid;
21551
21589
  const {
21552
- $xegrid,
21553
21590
  isGroup,
21554
21591
  tableGroupColumn,
21555
21592
  tableFullColumn,
@@ -21583,20 +21620,26 @@ const convertToRows = originColumns => {
21583
21620
  print: false
21584
21621
  }, options);
21585
21622
  const {
21623
+ filename,
21624
+ sheetName,
21586
21625
  type,
21587
21626
  mode,
21588
21627
  columns,
21589
21628
  original,
21629
+ columnFilterMethod,
21590
21630
  beforeExportMethod,
21591
- excludeFields,
21592
- includeFields
21631
+ includeFields,
21632
+ excludeFields
21593
21633
  } = opts;
21594
21634
  let groups = [];
21595
21635
  const customCols = columns && columns.length ? columns : null;
21636
+ const handleOptions = Object.assign({}, opts, {
21637
+ filename: '',
21638
+ sheetName: ''
21639
+ });
21596
21640
  // 如果设置源数据,则默认导出设置了字段的列
21597
- let columnFilterMethod = opts.columnFilterMethod;
21598
21641
  if (!customCols && !columnFilterMethod) {
21599
- columnFilterMethod = ({
21642
+ handleOptions.columnFilterMethod = ({
21600
21643
  column
21601
21644
  }) => {
21602
21645
  if (excludeFields) {
@@ -21614,24 +21657,24 @@ const convertToRows = originColumns => {
21614
21657
  };
21615
21658
  }
21616
21659
  if (customCols) {
21617
- opts._isCustomColumn = true;
21660
+ handleOptions._isCustomColumn = true;
21618
21661
  groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().mapTree(customCols, item => {
21619
21662
  let targetColumn;
21620
21663
  if (item) {
21621
21664
  if (isColumnInfo(item)) {
21622
21665
  targetColumn = item;
21623
21666
  } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(item)) {
21624
- targetColumn = this.getColumnByField(item);
21667
+ targetColumn = $xeTable.getColumnByField(item);
21625
21668
  } else {
21626
21669
  const colid = item.id || item.colId;
21627
21670
  const type = item.type;
21628
21671
  const field = item.field;
21629
21672
  if (colid) {
21630
- targetColumn = this.getColumnById(colid);
21673
+ targetColumn = $xeTable.getColumnById(colid);
21631
21674
  } else if (field && type) {
21632
21675
  targetColumn = tableFullColumn.find(column => column.field === field && column.type === type);
21633
21676
  } else if (field) {
21634
- targetColumn = this.getColumnByField(field);
21677
+ targetColumn = $xeTable.getColumnByField(field);
21635
21678
  } else if (type) {
21636
21679
  targetColumn = tableFullColumn.find(column => column.type === type);
21637
21680
  }
@@ -21642,7 +21685,7 @@ const convertToRows = originColumns => {
21642
21685
  children: 'childNodes',
21643
21686
  mapChildren: '_children'
21644
21687
  }), (column, index) => isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({
21645
- column,
21688
+ column: column,
21646
21689
  $columnIndex: index
21647
21690
  })), {
21648
21691
  children: '_children',
@@ -21670,16 +21713,38 @@ const convertToRows = originColumns => {
21670
21713
  children: 'childNodes'
21671
21714
  });
21672
21715
  // 构建分组层级
21673
- opts.columns = cols;
21674
- opts.colgroups = convertToRows(groups);
21675
- if (!opts.filename) {
21676
- opts.filename = export_mixin_getI18n(opts.original ? 'vxe.table.expOriginFilename' : 'vxe.table.expFilename', [external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(Date.now(), 'yyyyMMddHHmmss')]);
21716
+ handleOptions.columns = cols;
21717
+ handleOptions.colgroups = convertToRows(groups);
21718
+ if (filename) {
21719
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(filename)) {
21720
+ handleOptions.filename = filename({
21721
+ options: opts,
21722
+ $table: $xeTable,
21723
+ $grid: $xeGrid
21724
+ });
21725
+ } else {
21726
+ handleOptions.filename = `${filename}`;
21727
+ }
21677
21728
  }
21678
- if (!opts.sheetName) {
21679
- opts.sheetName = document.title;
21729
+ if (!handleOptions.filename) {
21730
+ handleOptions.filename = export_mixin_getI18n(handleOptions.original ? 'vxe.table.expOriginFilename' : 'vxe.table.expFilename', [external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(Date.now(), 'yyyyMMddHHmmss')]);
21731
+ }
21732
+ if (sheetName) {
21733
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sheetName)) {
21734
+ handleOptions.sheetName = sheetName({
21735
+ options: opts,
21736
+ $table: $xeTable,
21737
+ $grid: $xeGrid
21738
+ });
21739
+ } else {
21740
+ handleOptions.sheetName = `${sheetName}`;
21741
+ }
21742
+ }
21743
+ if (!handleOptions.sheetName) {
21744
+ handleOptions.sheetName = document.title || '';
21680
21745
  }
21681
21746
  // 检查类型,如果为自定义导出,则不需要校验类型
21682
- if (!opts.exportMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps), type)) {
21747
+ if (!handleOptions.exportMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps), type)) {
21683
21748
  errLog('vxe.error.notType', [type]);
21684
21749
  if (true) {
21685
21750
  if (['xlsx', 'pdf'].includes(type)) {
@@ -21691,21 +21756,21 @@ const convertToRows = originColumns => {
21691
21756
  };
21692
21757
  return Promise.reject(params);
21693
21758
  }
21694
- if (!opts.print) {
21759
+ if (!handleOptions.print) {
21695
21760
  if (beforeExportMethod) {
21696
21761
  beforeExportMethod({
21697
- options: opts,
21698
- $table: this,
21699
- $grid: $xegrid
21762
+ options: handleOptions,
21763
+ $table: $xeTable,
21764
+ $grid: $xeGrid
21700
21765
  });
21701
21766
  }
21702
21767
  }
21703
21768
  if (!opts.data) {
21704
- opts.data = [];
21769
+ handleOptions.data = [];
21705
21770
  if (mode === 'selected') {
21706
- const selectRecords = this.getCheckboxRecords();
21771
+ const selectRecords = $xeTable.getCheckboxRecords();
21707
21772
  if (['html', 'pdf'].indexOf(type) > -1 && treeConfig) {
21708
- opts.data = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(this.getTableData().fullData, item => selectRecords.indexOf(item) > -1, Object.assign({}, treeOpts, {
21773
+ opts.data = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree($xeTable.getTableData().fullData, item => $xeTable.findRowIndexOf(selectRecords, item) > -1, Object.assign({}, treeOpts, {
21709
21774
  data: '_row'
21710
21775
  }));
21711
21776
  } else {
@@ -21713,17 +21778,22 @@ const convertToRows = originColumns => {
21713
21778
  }
21714
21779
  } else if (mode === 'all') {
21715
21780
  if (true) {
21716
- if (!$xegrid) {
21781
+ if (!$xeGrid) {
21717
21782
  warnLog('vxe.error.errProp', ['all', 'mode=current,selected']);
21718
21783
  }
21719
21784
  }
21720
- if ($xegrid && !opts.remote) {
21785
+ if ($xeGrid && !handleOptions.remote) {
21786
+ const gridReactData = $xeGrid;
21787
+ const proxyOpts = $xeGrid.computeProxyOpts;
21788
+ const {
21789
+ sortData
21790
+ } = gridReactData;
21721
21791
  const {
21722
21792
  beforeQueryAll,
21723
21793
  afterQueryAll,
21724
- ajax = {},
21725
- props = {}
21726
- } = $xegrid.proxyOpts;
21794
+ ajax = {}
21795
+ } = proxyOpts;
21796
+ const resConfigs = proxyOpts.response || proxyOpts.props || {};
21727
21797
  const ajaxMethods = ajax.queryAll;
21728
21798
  const queryAllSuccessMethods = ajax.queryAllSuccess;
21729
21799
  const queryAllErrorMethods = ajax.queryAllError;
@@ -21734,16 +21804,20 @@ const convertToRows = originColumns => {
21734
21804
  }
21735
21805
  if (ajaxMethods) {
21736
21806
  const params = {
21737
- $table: this,
21738
- $grid: $xegrid,
21739
- sort: $xegrid.sortData,
21740
- filters: $xegrid.filterData,
21741
- form: $xegrid.formData,
21742
- target: ajaxMethods,
21743
- options: opts
21807
+ $table: $xeTable,
21808
+ $grid: $xeGrid,
21809
+ sort: sortData.length ? sortData[0] : {},
21810
+ sorts: sortData,
21811
+ filters: gridReactData.filterData,
21812
+ form: gridReactData.formData,
21813
+ options: handleOptions
21744
21814
  };
21745
21815
  return Promise.resolve((beforeQueryAll || ajaxMethods)(params)).then(rest => {
21746
- opts.data = (props.list ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, props.list) : rest) || [];
21816
+ const listProp = resConfigs.list;
21817
+ handleOptions.data = (listProp ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(listProp) ? listProp({
21818
+ data: rest,
21819
+ $grid: $xeGrid
21820
+ }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, listProp) : rest) || [];
21747
21821
  if (afterQueryAll) {
21748
21822
  afterQueryAll(params);
21749
21823
  }
@@ -21753,7 +21827,7 @@ const convertToRows = originColumns => {
21753
21827
  response: rest
21754
21828
  });
21755
21829
  }
21756
- return handleExport(this, opts);
21830
+ return handleExport($xeTable, handleOptions);
21757
21831
  }).catch(rest => {
21758
21832
  if (queryAllErrorMethods) {
21759
21833
  queryAllErrorMethods({
@@ -21765,10 +21839,10 @@ const convertToRows = originColumns => {
21765
21839
  }
21766
21840
  }
21767
21841
  } else if (mode === 'current') {
21768
- opts.data = afterFullData;
21842
+ handleOptions.data = afterFullData;
21769
21843
  }
21770
21844
  }
21771
- return handleExport(this, opts);
21845
+ return handleExport($xeTable, opts);
21772
21846
  },
21773
21847
  _importByFile(file, options) {
21774
21848
  const opts = Object.assign({}, options);
@@ -21825,6 +21899,8 @@ const convertToRows = originColumns => {
21825
21899
  return readLocalFile(options);
21826
21900
  },
21827
21901
  _print(options) {
21902
+ const $xeTable = this;
21903
+ const $xeGrid = $xeTable.$xeGrid;
21828
21904
  const opts = Object.assign({
21829
21905
  original: false
21830
21906
  // beforePrintMethod
@@ -21834,25 +21910,76 @@ const convertToRows = originColumns => {
21834
21910
  remote: false,
21835
21911
  print: true
21836
21912
  });
21837
- if (!opts.sheetName) {
21838
- opts.sheetName = document.title;
21839
- }
21840
- return new Promise(resolve => {
21841
- if (opts.content) {
21842
- resolve(handlePrint(this, opts, opts.content));
21913
+ const {
21914
+ sheetName
21915
+ } = opts;
21916
+ let printTitle = '';
21917
+ if (sheetName) {
21918
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sheetName)) {
21919
+ printTitle = sheetName({
21920
+ options: opts,
21921
+ $table: $xeTable,
21922
+ $grid: $xeGrid
21923
+ });
21843
21924
  } else {
21844
- resolve(this.exportData(opts).then(({
21845
- content
21846
- }) => {
21847
- return handlePrint(this, opts, content);
21848
- }));
21925
+ printTitle = `${sheetName}`;
21926
+ }
21927
+ }
21928
+ if (!printTitle) {
21929
+ printTitle = document.title || '';
21930
+ }
21931
+ const beforePrintMethod = opts.beforePrintMethod;
21932
+ const tableHtml = opts.html || opts.content;
21933
+ return new Promise((resolve, reject) => {
21934
+ if (core_.VxeUI.print) {
21935
+ if (tableHtml) {
21936
+ resolve(core_.VxeUI.print({
21937
+ title: printTitle,
21938
+ html: tableHtml,
21939
+ customStyle: opts.style,
21940
+ beforeMethod: beforePrintMethod ? ({
21941
+ html
21942
+ }) => {
21943
+ return beforePrintMethod({
21944
+ html,
21945
+ content: html,
21946
+ options: opts,
21947
+ $table: $xeTable
21948
+ });
21949
+ } : undefined
21950
+ }));
21951
+ } else {
21952
+ resolve($xeTable.exportData(opts).then(({
21953
+ content
21954
+ }) => {
21955
+ return core_.VxeUI.print({
21956
+ title: printTitle,
21957
+ html: content,
21958
+ customStyle: opts.style,
21959
+ beforeMethod: beforePrintMethod ? ({
21960
+ html
21961
+ }) => {
21962
+ return beforePrintMethod({
21963
+ html,
21964
+ content: html,
21965
+ options: opts,
21966
+ $table: $xeTable
21967
+ });
21968
+ } : undefined
21969
+ });
21970
+ }));
21971
+ }
21972
+ } else {
21973
+ const e = {
21974
+ status: false
21975
+ };
21976
+ reject(e);
21849
21977
  }
21850
21978
  });
21851
21979
  },
21852
21980
  _getPrintHtml(options) {
21853
- const {
21854
- printOpts
21855
- } = this;
21981
+ const $xeTable = this;
21982
+ const printOpts = $xeTable.computePrintOpts;
21856
21983
  const opts = Object.assign({
21857
21984
  original: false
21858
21985
  // beforePrintMethod
@@ -21862,7 +21989,7 @@ const convertToRows = originColumns => {
21862
21989
  remote: false,
21863
21990
  print: true
21864
21991
  });
21865
- return this.exportData(opts).then(({
21992
+ return $xeTable.exportData(opts).then(({
21866
21993
  content
21867
21994
  }) => {
21868
21995
  return {
@@ -22571,7 +22698,6 @@ function validErrorRuleValue(rule, val) {
22571
22698
  const {
22572
22699
  editRules,
22573
22700
  afterFullData,
22574
- visibleColumn,
22575
22701
  treeConfig,
22576
22702
  treeOpts
22577
22703
  } = this;
@@ -22686,11 +22812,7 @@ function validErrorRuleValue(rule, val) {
22686
22812
  } else {
22687
22813
  const row = firstErrParams.row;
22688
22814
  const column = firstErrParams.column;
22689
- const rowIndex = afterFullData.indexOf(row);
22690
- const columnIndex = visibleColumn.indexOf(column);
22691
- const targetRow = rowIndex > 0 ? afterFullData[rowIndex - 1] : row;
22692
- const targetColumn = columnIndex > 0 ? visibleColumn[columnIndex - 1] : column;
22693
- this.scrollToRow(targetRow, targetColumn).then(posAndFinish);
22815
+ this.scrollToRow(row, column).then(posAndFinish);
22694
22816
  }
22695
22817
  });
22696
22818
  });
@@ -23795,6 +23917,9 @@ function handleUupdateResize(_vm) {
23795
23917
  return 0;
23796
23918
  },
23797
23919
  rowHeightMaps() {
23920
+ return this.computeRowHeightMaps;
23921
+ },
23922
+ computeRowHeightMaps() {
23798
23923
  return {
23799
23924
  default: 48,
23800
23925
  medium: 44,
@@ -24483,15 +24608,7 @@ function handleUupdateResize(_vm) {
24483
24608
  });
24484
24609
  }
24485
24610
  if (this.autoResize) {
24486
- const handleWrapperResize = this.resizeOpts.refreshDelay ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().throttle(() => this.recalculate(true), this.resizeOpts.refreshDelay, {
24487
- leading: true,
24488
- trailing: true
24489
- }) : null;
24490
- const resizeObserver = table_globalResize.create(handleWrapperResize ? () => {
24491
- if (this.autoResize) {
24492
- handleWrapperResize();
24493
- }
24494
- } : () => {
24611
+ const resizeObserver = table_globalResize.create(() => {
24495
24612
  if (this.autoResize) {
24496
24613
  this.recalculate(true);
24497
24614
  }
@@ -25263,11 +25380,12 @@ const {
25263
25380
  /**
25264
25381
  * 渲染按钮
25265
25382
  */
25266
- renderBtns(h) {
25383
+ renderLeftBtns(h) {
25267
25384
  // 使用已安装的组件,如果未安装则不渲染
25268
25385
  const VxeUIButtonComponent = core_.VxeUI.getComponent('VxeButton');
25269
25386
  const $xeToolbar = this;
25270
25387
  const props = $xeToolbar;
25388
+ const slots = $xeToolbar.$scopedSlots;
25271
25389
  const internalData = $xeToolbar.internalData;
25272
25390
  const $xeGrid = $xeToolbar.$xeGrid;
25273
25391
  const {
@@ -25277,7 +25395,16 @@ const {
25277
25395
  connectTable
25278
25396
  } = internalData;
25279
25397
  const $table = connectTable;
25398
+ const buttonPrefixSlot = slots.buttonPrefix || slots['button-prefix'];
25399
+ const buttonSuffixSlot = slots.buttonSuffix || slots['button-suffix'];
25280
25400
  const btnVNs = [];
25401
+ if (buttonPrefixSlot) {
25402
+ btnVNs.push(...getSlotVNs(buttonPrefixSlot.call($xeToolbar, {
25403
+ buttons: buttons || [],
25404
+ $grid: $xeGrid,
25405
+ $table: $table
25406
+ })));
25407
+ }
25281
25408
  if (buttons) {
25282
25409
  buttons.forEach(item => {
25283
25410
  const {
@@ -25332,6 +25459,13 @@ const {
25332
25459
  }
25333
25460
  });
25334
25461
  }
25462
+ if (buttonSuffixSlot) {
25463
+ btnVNs.push(...getSlotVNs(buttonSuffixSlot.call($xeToolbar, {
25464
+ buttons: buttons || [],
25465
+ $grid: $xeGrid,
25466
+ $table: $table
25467
+ })));
25468
+ }
25335
25469
  return btnVNs;
25336
25470
  },
25337
25471
  /**
@@ -25342,6 +25476,7 @@ const {
25342
25476
  const VxeUIButtonComponent = core_.VxeUI.getComponent('VxeButton');
25343
25477
  const $xeToolbar = this;
25344
25478
  const props = $xeToolbar;
25479
+ const slots = $xeToolbar.$scopedSlots;
25345
25480
  const internalData = $xeToolbar.internalData;
25346
25481
  const $xeGrid = $xeToolbar.$xeGrid;
25347
25482
  const {
@@ -25351,7 +25486,16 @@ const {
25351
25486
  connectTable
25352
25487
  } = internalData;
25353
25488
  const $table = connectTable;
25489
+ const toolPrefixSlot = slots.toolPrefix || slots['tool-prefix'];
25490
+ const toolSuffixSlot = slots.toolSuffix || slots['tool-suffix'];
25354
25491
  const btnVNs = [];
25492
+ if (toolPrefixSlot) {
25493
+ btnVNs.push(...getSlotVNs(toolPrefixSlot.call($xeToolbar, {
25494
+ tools: tools || [],
25495
+ $grid: $xeGrid,
25496
+ $table: $table
25497
+ })));
25498
+ }
25355
25499
  if (tools) {
25356
25500
  tools.forEach((item, tIndex) => {
25357
25501
  const {
@@ -25409,6 +25553,13 @@ const {
25409
25553
  }
25410
25554
  });
25411
25555
  }
25556
+ if (toolSuffixSlot) {
25557
+ btnVNs.push(...getSlotVNs(toolSuffixSlot.call($xeToolbar, {
25558
+ tools: tools || [],
25559
+ $grid: $xeGrid,
25560
+ $table: $table
25561
+ })));
25562
+ }
25412
25563
  return btnVNs;
25413
25564
  },
25414
25565
  renderToolImport(h) {
@@ -25561,7 +25712,7 @@ const {
25561
25712
  }, buttonsSlot ? buttonsSlot({
25562
25713
  $grid: $xeGrid,
25563
25714
  $table: $table
25564
- }) : $xeToolbar.renderBtns(h)), h('div', {
25715
+ }) : $xeToolbar.renderLeftBtns(h)), h('div', {
25565
25716
  class: 'vxe-tools--wrapper'
25566
25717
  }, toolsSlot ? toolsSlot({
25567
25718
  $grid: $xeGrid,