vxe-table 4.10.6-beta.3 → 4.10.6-beta.5

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.
@@ -47,6 +47,12 @@ export default defineComponent({
47
47
  const { clientX: dragClientX } = evnt;
48
48
  const wrapperElem = refElem.value;
49
49
  const dragBtnElem = evnt.target;
50
+ let resizeColumn = column;
51
+ if (column.children && column.children.length) {
52
+ XEUtils.eachTree(column.children, childColumn => {
53
+ resizeColumn = childColumn;
54
+ });
55
+ }
50
56
  const cell = dragBtnElem.parentNode;
51
57
  const cellParams = Object.assign(params, { cell });
52
58
  let dragLeft = 0;
@@ -83,7 +89,7 @@ export default defineComponent({
83
89
  }
84
90
  }
85
91
  // 处理拖动事件
86
- const updateEvent = function (evnt) {
92
+ const updateEvent = (evnt) => {
87
93
  evnt.stopPropagation();
88
94
  evnt.preventDefault();
89
95
  const offsetX = evnt.clientX - dragClientX;
@@ -103,7 +109,7 @@ export default defineComponent({
103
109
  // left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
104
110
  }
105
111
  dragLeft = Math.max(left, dragMinLeft);
106
- const resizeBarLeft = dragLeft - scrollLeft;
112
+ const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
107
113
  resizeBarElem.style.left = `${resizeBarLeft}px`;
108
114
  if (resizableOpts.showDragTip && resizeTipElem) {
109
115
  const tableWidth = tableEl.clientWidth;
@@ -113,14 +119,14 @@ export default defineComponent({
113
119
  const resizeTipHeight = resizeTipElem.clientHeight;
114
120
  let resizeTipLeft = -resizeTipWidth;
115
121
  if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
116
- resizeTipLeft = resizeTipWidth + resizeBarWidth - resizeBarLeft;
122
+ resizeTipLeft = 0;
117
123
  }
118
124
  else if (resizeBarLeft > tableWidth) {
119
125
  resizeTipLeft += tableWidth - resizeBarLeft;
120
126
  }
121
127
  resizeTipElem.style.left = `${resizeTipLeft}px`;
122
128
  resizeTipElem.style.top = `${Math.min(tableEl.clientHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
123
- resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
129
+ resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
124
130
  }
125
131
  };
126
132
  tableReactData._isResize = true;
@@ -130,11 +136,11 @@ export default defineComponent({
130
136
  document.onmouseup = function (evnt) {
131
137
  document.onmousemove = domMousemove;
132
138
  document.onmouseup = domMouseup;
133
- const resizeWidth = column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
134
- column.resizeWidth = resizeWidth;
139
+ const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
140
+ resizeColumn.resizeWidth = resizeWidth;
135
141
  if (resizableOpts.dragMode === 'fixed') {
136
142
  visibleColumn.forEach(item => {
137
- if (item.id !== column.id) {
143
+ if (item.id !== resizeColumn.id) {
138
144
  if (!item.resizeWidth) {
139
145
  item.resizeWidth = item.renderWidth;
140
146
  }
@@ -219,6 +225,8 @@ export default defineComponent({
219
225
  thOns.onMouseup = $xeTable.handleHeaderCellDragMouseupEvent;
220
226
  }
221
227
  }
228
+ const isLastColumn = $columnIndex === cols.length - 1;
229
+ const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
222
230
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
223
231
  let isPreLoadStatus = false;
224
232
  if (scrollXLoad && !isGroup && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
@@ -227,7 +235,7 @@ export default defineComponent({
227
235
  return h('th', Object.assign(Object.assign(Object.assign({ class: ['vxe-header--column', colid, {
228
236
  [`col--${headAlign}`]: headAlign,
229
237
  [`col--${type}`]: type,
230
- 'col--last': $columnIndex === cols.length - 1,
238
+ 'col--last': isLastColumn,
231
239
  'col--fixed': column.fixed,
232
240
  'col--group': isColGroup,
233
241
  'col--ellipsis': hasEllipsis,
@@ -253,7 +261,7 @@ export default defineComponent({
253
261
  /**
254
262
  * 列宽拖动
255
263
  */
256
- !fixedHiddenColumn && !isColGroup && (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
264
+ !fixedHiddenColumn && showResizable
257
265
  ? h('div', {
258
266
  class: ['vxe-resizable', {
259
267
  'is--line': !border || border === 'none'
@@ -261,7 +269,7 @@ export default defineComponent({
261
269
  onMousedown: (evnt) => resizeMousedownEvent(evnt, params),
262
270
  onDblclick: (evnt) => $xeTable.handleResizeDblclickEvent(evnt, params)
263
271
  })
264
- : null
272
+ : renderEmptyElement($xeTable)
265
273
  ]);
266
274
  });
267
275
  };
@@ -1097,7 +1097,7 @@ export default defineComponent({
1097
1097
  fullColumnFieldData[field] = rest;
1098
1098
  }
1099
1099
  else {
1100
- if (storage || (columnOpts.drag && (isCrossDrag || isSelfToChildDrag))) {
1100
+ if ((storage && !type) || (columnOpts.drag && (isCrossDrag || isSelfToChildDrag))) {
1101
1101
  errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
1102
1102
  }
1103
1103
  }
@@ -1443,51 +1443,65 @@ export default defineComponent({
1443
1443
  return cellValue;
1444
1444
  };
1445
1445
  };
1446
+ const updateAfterListIndex = () => {
1447
+ const { afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData;
1448
+ const fullMaps = {};
1449
+ afterFullData.forEach((row, index) => {
1450
+ const rowid = getRowid($xeTable, row);
1451
+ const rowRest = fullAllDataRowIdData[rowid];
1452
+ const seq = index + 1;
1453
+ if (rowRest) {
1454
+ rowRest.seq = seq;
1455
+ rowRest._index = index;
1456
+ }
1457
+ else {
1458
+ const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, items: [], parent: null, level: 0, height: 0, oTop: 0 };
1459
+ fullAllDataRowIdData[rowid] = rest;
1460
+ fullDataRowIdData[rowid] = rest;
1461
+ }
1462
+ fullMaps[rowid] = row;
1463
+ });
1464
+ internalData.afterFullRowMaps = fullMaps;
1465
+ };
1446
1466
  /**
1447
1467
  * 预编译
1448
1468
  * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
1449
1469
  */
1450
1470
  const updateAfterDataIndex = () => {
1451
1471
  const { treeConfig } = props;
1452
- const { afterFullData, fullDataRowIdData, fullAllDataRowIdData, afterTreeFullData } = internalData;
1472
+ const { fullDataRowIdData, fullAllDataRowIdData, afterTreeFullData } = internalData;
1453
1473
  const treeOpts = computeTreeOpts.value;
1474
+ const { transform } = treeOpts;
1454
1475
  const childrenField = treeOpts.children || treeOpts.childrenField;
1455
1476
  const fullMaps = {};
1456
1477
  if (treeConfig) {
1457
- XEUtils.eachTree(afterTreeFullData, (row, index, items, path) => {
1458
- const rowid = getRowid($xeTable, row);
1459
- const rowRest = fullAllDataRowIdData[rowid];
1460
- const seq = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
1461
- if (rowRest) {
1462
- rowRest.seq = seq;
1463
- rowRest._index = index;
1464
- }
1465
- else {
1466
- const rest = { row, rowid, seq, index: -1, $index: -1, _index: -1, items: [], parent: null, level: 0, height: 0, oTop: 0 };
1467
- fullAllDataRowIdData[rowid] = rest;
1468
- fullDataRowIdData[rowid] = rest;
1469
- }
1470
- fullMaps[rowid] = row;
1471
- }, { children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField });
1478
+ if (transform) {
1479
+ updateAfterListIndex();
1480
+ }
1481
+ else {
1482
+ XEUtils.eachTree(afterTreeFullData, (row, index, items, path) => {
1483
+ const rowid = getRowid($xeTable, row);
1484
+ const rowRest = fullAllDataRowIdData[rowid];
1485
+ const seq = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
1486
+ if (rowRest) {
1487
+ rowRest.seq = seq;
1488
+ if (!transform) {
1489
+ rowRest._index = index;
1490
+ }
1491
+ }
1492
+ else {
1493
+ const rest = { row, rowid, seq, index: -1, $index: -1, _index: -1, items: [], parent: null, level: 0, height: 0, oTop: 0 };
1494
+ fullAllDataRowIdData[rowid] = rest;
1495
+ fullDataRowIdData[rowid] = rest;
1496
+ }
1497
+ fullMaps[rowid] = row;
1498
+ }, { children: transform ? treeOpts.mapChildrenField : childrenField });
1499
+ internalData.afterFullRowMaps = fullMaps;
1500
+ }
1472
1501
  }
1473
1502
  else {
1474
- afterFullData.forEach((row, index) => {
1475
- const rowid = getRowid($xeTable, row);
1476
- const rowRest = fullAllDataRowIdData[rowid];
1477
- const seq = index + 1;
1478
- if (rowRest) {
1479
- rowRest.seq = seq;
1480
- rowRest._index = index;
1481
- }
1482
- else {
1483
- const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, items: [], parent: null, level: 0, height: 0, oTop: 0 };
1484
- fullAllDataRowIdData[rowid] = rest;
1485
- fullDataRowIdData[rowid] = rest;
1486
- }
1487
- fullMaps[rowid] = row;
1488
- });
1503
+ updateAfterListIndex();
1489
1504
  }
1490
- internalData.afterFullRowMaps = fullMaps;
1491
1505
  };
1492
1506
  /**
1493
1507
  * 如果为虚拟树,将树结构拍平
@@ -6520,17 +6534,23 @@ export default defineComponent({
6520
6534
  if (isDblclickAutoWidth && el) {
6521
6535
  const { fullColumnIdData } = internalData;
6522
6536
  const { column } = params;
6523
- const colid = column.id;
6537
+ let resizeColumn = column;
6538
+ if (column.children && column.children.length) {
6539
+ XEUtils.eachTree(column.children, childColumn => {
6540
+ resizeColumn = childColumn;
6541
+ });
6542
+ }
6543
+ const colid = resizeColumn.id;
6524
6544
  const colRest = fullColumnIdData[colid];
6525
6545
  const dragBtnElem = evnt.target;
6526
6546
  const cell = dragBtnElem.parentNode;
6527
6547
  const cellParams = Object.assign(params, { cell });
6528
6548
  const colMinWidth = getColReMinWidth(cellParams);
6529
- let resizeWidth = calcColumnAutoWidth(column, el);
6549
+ let resizeWidth = calcColumnAutoWidth(resizeColumn, el);
6530
6550
  if (colRest) {
6531
6551
  resizeWidth = Math.max(resizeWidth, colRest.width);
6532
6552
  }
6533
- column.resizeWidth = Math.max(colMinWidth, resizeWidth);
6553
+ resizeColumn.resizeWidth = Math.max(colMinWidth, resizeWidth);
6534
6554
  reactData._isResize = false;
6535
6555
  internalData._lastResizeTime = Date.now();
6536
6556
  $xeTable.analyColumnWidth();
@@ -6768,7 +6788,7 @@ export default defineComponent({
6768
6788
  }
6769
6789
  vLen++;
6770
6790
  });
6771
- const isSelected = rootList.length > 0 && sLen >= vLen;
6791
+ const isSelected = vLen > 0 ? sLen >= vLen : sLen >= rootList.length;
6772
6792
  const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
6773
6793
  reactData.isAllSelected = isSelected;
6774
6794
  reactData.isIndeterminate = halfSelect;
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "4.10.6-beta.3";
3
+ export const version = "4.10.6-beta.5";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"4.10.6-beta.3"}`;
3
+ const version = `table v${"4.10.6-beta.5"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
3138
3138
  ;// ./packages/ui/index.ts
3139
3139
 
3140
3140
 
3141
- const version = "4.10.6-beta.3";
3141
+ const version = "4.10.6-beta.5";
3142
3142
  core_.VxeUI.version = version;
3143
3143
  core_.VxeUI.tableVersion = version;
3144
3144
  core_.VxeUI.setConfig({
@@ -3568,7 +3568,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3568
3568
  const {
3569
3569
  log: log_log
3570
3570
  } = core_.VxeUI;
3571
- const log_version = `table v${"4.10.6-beta.3"}`;
3571
+ const log_version = `table v${"4.10.6-beta.5"}`;
3572
3572
  const warnLog = log_log.create('warn', log_version);
3573
3573
  const errLog = log_log.create('error', log_version);
3574
3574
  ;// ./packages/table/src/columnInfo.ts
@@ -6512,6 +6512,7 @@ const renderType = 'body';
6512
6512
  }));
6513
6513
  }
6514
6514
  }
6515
+ const isLastColumn = $columnIndex === columns.length - 1;
6515
6516
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
6516
6517
  let isPreLoadStatus = false;
6517
6518
  if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex || _rowIndex > scrollYStore.visibleEndIndex)) {
@@ -6524,7 +6525,7 @@ const renderType = 'body';
6524
6525
  [`col--${cellAlign}`]: cellAlign,
6525
6526
  [`col--vertical-${verticalAlign}`]: verticalAlign,
6526
6527
  [`col--${type}`]: type,
6527
- 'col--last': $columnIndex === columns.length - 1,
6528
+ 'col--last': isLastColumn,
6528
6529
  'col--tree-node': treeNode,
6529
6530
  'col--edit': isEdit,
6530
6531
  'col--ellipsis': hasEllipsis,
@@ -7065,6 +7066,12 @@ const header_renderType = 'header';
7065
7066
  } = evnt;
7066
7067
  const wrapperElem = refElem.value;
7067
7068
  const dragBtnElem = evnt.target;
7069
+ let resizeColumn = column;
7070
+ if (column.children && column.children.length) {
7071
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
7072
+ resizeColumn = childColumn;
7073
+ });
7074
+ }
7068
7075
  const cell = dragBtnElem.parentNode;
7069
7076
  const cellParams = Object.assign(params, {
7070
7077
  cell
@@ -7102,7 +7109,7 @@ const header_renderType = 'header';
7102
7109
  }
7103
7110
  }
7104
7111
  // 处理拖动事件
7105
- const updateEvent = function (evnt) {
7112
+ const updateEvent = evnt => {
7106
7113
  evnt.stopPropagation();
7107
7114
  evnt.preventDefault();
7108
7115
  const offsetX = evnt.clientX - dragClientX;
@@ -7120,7 +7127,7 @@ const header_renderType = 'header';
7120
7127
  // left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
7121
7128
  }
7122
7129
  dragLeft = Math.max(left, dragMinLeft);
7123
- const resizeBarLeft = dragLeft - scrollLeft;
7130
+ const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
7124
7131
  resizeBarElem.style.left = `${resizeBarLeft}px`;
7125
7132
  if (resizableOpts.showDragTip && resizeTipElem) {
7126
7133
  const tableWidth = tableEl.clientWidth;
@@ -7130,13 +7137,13 @@ const header_renderType = 'header';
7130
7137
  const resizeTipHeight = resizeTipElem.clientHeight;
7131
7138
  let resizeTipLeft = -resizeTipWidth;
7132
7139
  if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
7133
- resizeTipLeft = resizeTipWidth + resizeBarWidth - resizeBarLeft;
7140
+ resizeTipLeft = 0;
7134
7141
  } else if (resizeBarLeft > tableWidth) {
7135
7142
  resizeTipLeft += tableWidth - resizeBarLeft;
7136
7143
  }
7137
7144
  resizeTipElem.style.left = `${resizeTipLeft}px`;
7138
7145
  resizeTipElem.style.top = `${Math.min(tableEl.clientHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
7139
- resizeTipElem.textContent = header_getI18n('vxe.table.resizeColTip', [column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
7146
+ resizeTipElem.textContent = header_getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
7140
7147
  }
7141
7148
  };
7142
7149
  tableReactData._isResize = true;
@@ -7146,11 +7153,11 @@ const header_renderType = 'header';
7146
7153
  document.onmouseup = function (evnt) {
7147
7154
  document.onmousemove = domMousemove;
7148
7155
  document.onmouseup = domMouseup;
7149
- const resizeWidth = column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
7150
- column.resizeWidth = resizeWidth;
7156
+ const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
7157
+ resizeColumn.resizeWidth = resizeWidth;
7151
7158
  if (resizableOpts.dragMode === 'fixed') {
7152
7159
  visibleColumn.forEach(item => {
7153
- if (item.id !== column.id) {
7160
+ if (item.id !== resizeColumn.id) {
7154
7161
  if (!item.resizeWidth) {
7155
7162
  item.resizeWidth = item.renderWidth;
7156
7163
  }
@@ -7283,6 +7290,8 @@ const header_renderType = 'header';
7283
7290
  thOns.onMouseup = $xeTable.handleHeaderCellDragMouseupEvent;
7284
7291
  }
7285
7292
  }
7293
+ const isLastColumn = $columnIndex === cols.length - 1;
7294
+ const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
7286
7295
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
7287
7296
  let isPreLoadStatus = false;
7288
7297
  if (scrollXLoad && !isGroup && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
@@ -7292,7 +7301,7 @@ const header_renderType = 'header';
7292
7301
  class: ['vxe-header--column', colid, {
7293
7302
  [`col--${headAlign}`]: headAlign,
7294
7303
  [`col--${type}`]: type,
7295
- 'col--last': $columnIndex === cols.length - 1,
7304
+ 'col--last': isLastColumn,
7296
7305
  'col--fixed': column.fixed,
7297
7306
  'col--group': isColGroup,
7298
7307
  'col--ellipsis': hasEllipsis,
@@ -7319,13 +7328,13 @@ const header_renderType = 'header';
7319
7328
  /**
7320
7329
  * 列宽拖动
7321
7330
  */
7322
- !fixedHiddenColumn && !isColGroup && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7331
+ !fixedHiddenColumn && showResizable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
7323
7332
  class: ['vxe-resizable', {
7324
7333
  'is--line': !border || border === 'none'
7325
7334
  }],
7326
7335
  onMousedown: evnt => resizeMousedownEvent(evnt, params),
7327
7336
  onDblclick: evnt => $xeTable.handleResizeDblclickEvent(evnt, params)
7328
- }) : null]);
7337
+ }) : header_renderEmptyElement($xeTable)]);
7329
7338
  });
7330
7339
  };
7331
7340
  const renderHeads = (isGroup, isOptimizeMode, headerGroups) => {
@@ -7735,6 +7744,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
7735
7744
  attrs.colspan = colspan;
7736
7745
  }
7737
7746
  }
7747
+ const isLastColumn = $columnIndex === tableColumn.length - 1;
7738
7748
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
7739
7749
  let isPreLoadStatus = false;
7740
7750
  if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
@@ -7744,7 +7754,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
7744
7754
  class: ['vxe-footer--column', column.id, {
7745
7755
  [`col--${footAlign}`]: footAlign,
7746
7756
  [`col--${type}`]: type,
7747
- 'col--last': $columnIndex === tableColumn.length - 1,
7757
+ 'col--last': isLastColumn,
7748
7758
  'fixed--width': !isAutoCellWidth,
7749
7759
  'fixed--hidden': fixedHiddenColumn,
7750
7760
  'col--ellipsis': hasEllipsis,
@@ -11522,7 +11532,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11522
11532
  }
11523
11533
  fullColumnFieldData[field] = rest;
11524
11534
  } else {
11525
- if (storage || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
11535
+ if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
11526
11536
  errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
11527
11537
  }
11528
11538
  }
@@ -11890,6 +11900,41 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11890
11900
  return cellValue;
11891
11901
  };
11892
11902
  };
11903
+ const updateAfterListIndex = () => {
11904
+ const {
11905
+ afterFullData,
11906
+ fullDataRowIdData,
11907
+ fullAllDataRowIdData
11908
+ } = internalData;
11909
+ const fullMaps = {};
11910
+ afterFullData.forEach((row, index) => {
11911
+ const rowid = getRowid($xeTable, row);
11912
+ const rowRest = fullAllDataRowIdData[rowid];
11913
+ const seq = index + 1;
11914
+ if (rowRest) {
11915
+ rowRest.seq = seq;
11916
+ rowRest._index = index;
11917
+ } else {
11918
+ const rest = {
11919
+ row,
11920
+ rowid,
11921
+ seq,
11922
+ index: -1,
11923
+ $index: -1,
11924
+ _index: index,
11925
+ items: [],
11926
+ parent: null,
11927
+ level: 0,
11928
+ height: 0,
11929
+ oTop: 0
11930
+ };
11931
+ fullAllDataRowIdData[rowid] = rest;
11932
+ fullDataRowIdData[rowid] = rest;
11933
+ }
11934
+ fullMaps[rowid] = row;
11935
+ });
11936
+ internalData.afterFullRowMaps = fullMaps;
11937
+ };
11893
11938
  /**
11894
11939
  * 预编译
11895
11940
  * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
@@ -11899,72 +11944,55 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11899
11944
  treeConfig
11900
11945
  } = props;
11901
11946
  const {
11902
- afterFullData,
11903
11947
  fullDataRowIdData,
11904
11948
  fullAllDataRowIdData,
11905
11949
  afterTreeFullData
11906
11950
  } = internalData;
11907
11951
  const treeOpts = computeTreeOpts.value;
11952
+ const {
11953
+ transform
11954
+ } = treeOpts;
11908
11955
  const childrenField = treeOpts.children || treeOpts.childrenField;
11909
11956
  const fullMaps = {};
11910
11957
  if (treeConfig) {
11911
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, (row, index, items, path) => {
11912
- const rowid = getRowid($xeTable, row);
11913
- const rowRest = fullAllDataRowIdData[rowid];
11914
- const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
11915
- if (rowRest) {
11916
- rowRest.seq = seq;
11917
- rowRest._index = index;
11918
- } else {
11919
- const rest = {
11920
- row,
11921
- rowid,
11922
- seq,
11923
- index: -1,
11924
- $index: -1,
11925
- _index: -1,
11926
- items: [],
11927
- parent: null,
11928
- level: 0,
11929
- height: 0,
11930
- oTop: 0
11931
- };
11932
- fullAllDataRowIdData[rowid] = rest;
11933
- fullDataRowIdData[rowid] = rest;
11934
- }
11935
- fullMaps[rowid] = row;
11936
- }, {
11937
- children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField
11938
- });
11958
+ if (transform) {
11959
+ updateAfterListIndex();
11960
+ } else {
11961
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, (row, index, items, path) => {
11962
+ const rowid = getRowid($xeTable, row);
11963
+ const rowRest = fullAllDataRowIdData[rowid];
11964
+ const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
11965
+ if (rowRest) {
11966
+ rowRest.seq = seq;
11967
+ if (!transform) {
11968
+ rowRest._index = index;
11969
+ }
11970
+ } else {
11971
+ const rest = {
11972
+ row,
11973
+ rowid,
11974
+ seq,
11975
+ index: -1,
11976
+ $index: -1,
11977
+ _index: -1,
11978
+ items: [],
11979
+ parent: null,
11980
+ level: 0,
11981
+ height: 0,
11982
+ oTop: 0
11983
+ };
11984
+ fullAllDataRowIdData[rowid] = rest;
11985
+ fullDataRowIdData[rowid] = rest;
11986
+ }
11987
+ fullMaps[rowid] = row;
11988
+ }, {
11989
+ children: transform ? treeOpts.mapChildrenField : childrenField
11990
+ });
11991
+ internalData.afterFullRowMaps = fullMaps;
11992
+ }
11939
11993
  } else {
11940
- afterFullData.forEach((row, index) => {
11941
- const rowid = getRowid($xeTable, row);
11942
- const rowRest = fullAllDataRowIdData[rowid];
11943
- const seq = index + 1;
11944
- if (rowRest) {
11945
- rowRest.seq = seq;
11946
- rowRest._index = index;
11947
- } else {
11948
- const rest = {
11949
- row,
11950
- rowid,
11951
- seq,
11952
- index: -1,
11953
- $index: -1,
11954
- _index: index,
11955
- items: [],
11956
- parent: null,
11957
- level: 0,
11958
- height: 0,
11959
- oTop: 0
11960
- };
11961
- fullAllDataRowIdData[rowid] = rest;
11962
- fullDataRowIdData[rowid] = rest;
11963
- }
11964
- fullMaps[rowid] = row;
11965
- });
11994
+ updateAfterListIndex();
11966
11995
  }
11967
- internalData.afterFullRowMaps = fullMaps;
11968
11996
  };
11969
11997
  /**
11970
11998
  * 如果为虚拟树,将树结构拍平
@@ -17803,7 +17831,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
17803
17831
  const {
17804
17832
  column
17805
17833
  } = params;
17806
- const colid = column.id;
17834
+ let resizeColumn = column;
17835
+ if (column.children && column.children.length) {
17836
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
17837
+ resizeColumn = childColumn;
17838
+ });
17839
+ }
17840
+ const colid = resizeColumn.id;
17807
17841
  const colRest = fullColumnIdData[colid];
17808
17842
  const dragBtnElem = evnt.target;
17809
17843
  const cell = dragBtnElem.parentNode;
@@ -17811,11 +17845,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
17811
17845
  cell
17812
17846
  });
17813
17847
  const colMinWidth = getColReMinWidth(cellParams);
17814
- let resizeWidth = calcColumnAutoWidth(column, el);
17848
+ let resizeWidth = calcColumnAutoWidth(resizeColumn, el);
17815
17849
  if (colRest) {
17816
17850
  resizeWidth = Math.max(resizeWidth, colRest.width);
17817
17851
  }
17818
- column.resizeWidth = Math.max(colMinWidth, resizeWidth);
17852
+ resizeColumn.resizeWidth = Math.max(colMinWidth, resizeWidth);
17819
17853
  reactData._isResize = false;
17820
17854
  internalData._lastResizeTime = Date.now();
17821
17855
  $xeTable.analyColumnWidth();
@@ -18081,7 +18115,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
18081
18115
  }
18082
18116
  vLen++;
18083
18117
  });
18084
- const isSelected = rootList.length > 0 && sLen >= vLen;
18118
+ const isSelected = vLen > 0 ? sLen >= vLen : sLen >= rootList.length;
18085
18119
  const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
18086
18120
  reactData.isAllSelected = isSelected;
18087
18121
  reactData.isIndeterminate = halfSelect;